pgpool-II-4.7.0/0000755000175000017500000000000015121000002010277 500000000000000pgpool-II-4.7.0/m4/0000755000175000017500000000000015120777674010662 500000000000000pgpool-II-4.7.0/m4/docbook.m40000644000175000017500000000556715116217422012462 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.7.0/m4/libtool.m40000644000175000017500000112530615120777417012513 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 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) 2014 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 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 this program. If not, see . ]) # serial 58 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.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK 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_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _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 m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that 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 set != "${COLLECT_NAMES+set}"; 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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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 0 = "$lt_write_fail" && 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 yes = "$silent" && 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 that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; 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) 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' 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 0 = "$_lt_result"; 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 0 = "$_lt_result" && $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 yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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 no = "$lt_cv_ld_force_load"; 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 yes = "$lt_cv_ld_force_load"; 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*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; 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 yes != "$lt_cv_apple_cc_single_mod"; 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 set = "${lt_cv_aix_libpath+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 that will find a shell with a builtin # printf (that 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], [AS_HELP_STRING([--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 yes = "$GCC"; 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 where 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 no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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 yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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*|x86_64-*-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 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; 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 bitrig* | 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" ## exclude from sc_useless_quotes_in_assignment # 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 yes = "[$]$2"; 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 yes = "[$]$2"; 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # 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" && \ test undefined != "$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 17 != "$i" # 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 yes = "$cross_compiling"; 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 -fvisibility=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 yes != "$enable_dlopen"; 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 ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$lt_cv_dlopen_self"; 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 no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 where 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 yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; 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 relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; 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_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _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 m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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 AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) 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 ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; 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=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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 yes = "$lt_cv_prog_gnu_ld"; 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | 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" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 yes = "$with_gnu_ld"; 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=sco 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 yes = "$with_gnu_ld"; 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _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], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that 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 that 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 no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [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 # that 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. if ( 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 ;; 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 | 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* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 no != "$lt_cv_path_NM"; 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 -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) 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 one 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 yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported 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};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 can'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* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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 yes = "$pipe_works"; 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_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _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_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _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 yes = "$GXX"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 ia64 = "$host_cpu"; 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 ia64 != "$host_cpu"; 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 | 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 ia64 = "$host_cpu"; 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 ;; 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' case $cc_basename in 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' ;; esac ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 | 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' ;; tcc*) # Fabrice Bellard et al's Tiny 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)='-static' ;; 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 that 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. 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) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) 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 yes = "$with_gnu_ld"; 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 yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/([^)]\+)\s\+//' 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 ia64 != "$host_cpu"; 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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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 ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" 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' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-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 yes = "$supports_anon_versioning"; 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 tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; 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 yes = "$supports_anon_versioning"; 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 cannot *** 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 no = "$_LT_TAGVAR(ld_shlibs, $1)"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. 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) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 yes = "$with_gnu_ld"; 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 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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 yes = "$GCC"; 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 "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes = "$GCC"; 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 yes = "$lt_cv_irix_exported_symbol"; 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 ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; 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* | bitrig*) 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__`"; 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 _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' 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 shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes,yes = "$GCC,$enable_shared"; 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 what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); 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 yes != "$_lt_caught_CXX_error"; 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 yes = "$GXX"; 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 yes = "$GXX"; 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 yes = "$with_gnu_ld"; 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 ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 yes = "$with_gnu_ld"; 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 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; 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 ;; 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 "x$output_objdir/$soname" = "x$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 yes = "$GXX"; 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 "x$output_objdir/$soname" = "x$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 no = "$with_gnu_ld"; 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 yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 | 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 yes = "$supports_anon_versioning"; 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 ;; openbsd* | bitrig*) 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__`"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 $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 $wl-h $wl$soname -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 $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 $wl-h $wl$soname -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 CANNOT 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes != "$_lt_caught_CXX_error" 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 @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@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 x-L = "$p" || test x-R = "$p"; 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 no = "$pre_test_object_deps_done"; 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 no = "$pre_test_object_deps_done"; 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)= ;; 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 no = "$F77"; 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 yes != "$_lt_disable_F77"; 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 yes != "$_lt_disable_F77" 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 no = "$FC"; 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 yes != "$_lt_disable_FC"; 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 yes != "$_lt_disable_FC" 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 set = "${GCJFLAGS+set}" || 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 10 -lt "$lt_ac_count" && 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], [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_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what 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.7.0/m4/ltoptions.m40000644000175000017500000003426215120777417013101 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 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 8 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_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _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_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _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=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.7.0/m4/ltsugar.m40000644000175000017500000001044015120777417012517 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 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.7.0/m4/ltversion.m40000644000175000017500000000127315120777417013067 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 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 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) pgpool-II-4.7.0/m4/lt~obsolete.m40000644000175000017500000001377415120777420013417 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 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.7.0/Makefile.am0000644000175000017500000000040415116217421012274 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.7.0/configure0000755000175000017500000203276515120777431012177 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for pgpool-II 4.7.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@lists.postgresql.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script 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.7.0' PACKAGE_STRING='pgpool-II 4.7.0' PACKAGE_BUGREPORT='pgpool-hackers@lists.postgresql.org' 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 LT_SYS_LIBRARY_PATH 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 runstatedir 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_aix_soname 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 LT_SYS_LIBRARY_PATH 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' runstatedir='${localstatedir}/run' 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 ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -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 runstatedir 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.7.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] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --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.7.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-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. 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.7.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@lists.postgresql.org ## ## -------------------------------------------------- ##" ) | 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.7.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 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. # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $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.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != 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.7.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 (and possibly the TAP driver). 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 -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # AC_PROG_RANLIB 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.6' macro_revision='2.4.6' 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 no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 no != "$lt_cv_path_NM"; 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 -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # 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" && \ test undefined != "$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 17 != "$i" # 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"} 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 yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; 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 # that 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. if ( 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 ;; 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 | 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* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) 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 one 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 0 -eq "$ac_status"; 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 0 -ne "$ac_status"; 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 no = "$lt_cv_ar_at_file"; 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 bitrig* | 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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported 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};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 can'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* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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 yes = "$pipe_works"; 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 yes = "$GCC"; 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; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_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 dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. 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 yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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 emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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 yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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*|x86_64-*-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 yes != "$lt_cv_path_mainfest_tool"; 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 0 = "$_lt_result"; 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 0 = "$_lt_result" && $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 yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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 no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; 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 # 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 shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # 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 set != "${COLLECT_NAMES+set}"; 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 func_cc_basename $compiler cc_basename=$func_cc_basename_result # 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 yes = "$GCC"; 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" ## exclude from sc_useless_quotes_in_assignment # 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 yes = "$lt_cv_prog_compiler_rtti_exceptions"; 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 yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; 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' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; 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' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; 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 | 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' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; 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 that 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" ## exclude from sc_useless_quotes_in_assignment # 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 yes = "$lt_cv_prog_compiler_pic_works"; 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 yes = "$lt_cv_prog_compiler_static_works"; 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 no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; 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 no = "$hard_links"; 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 yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) 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 yes = "$with_gnu_ld"; 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 yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 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 ia64 != "$host_cpu"; 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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" 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' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-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 yes = "$supports_anon_versioning"; 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 tcc*) export_dynamic_flag_spec='-rdynamic' ;; 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 yes = "$supports_anon_versioning"; 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 cannot *** 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 no = "$ld_shlibs"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. 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) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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 set = "${lt_cv_aix_libpath+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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 set = "${lt_cv_aix_libpath+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 yes = "$with_gnu_ld"; 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 archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' 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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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 yes = "$lt_cv_ld_force_load"; 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*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; 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 yes = "$GCC"; 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 "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes,no = "$GCC,$with_gnu_ld"; 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 yes = "$lt_cv_prog_compiler__b"; 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 no = "$with_gnu_ld"; 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 yes = "$GCC"; 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 yes = "$lt_cv_irix_exported_symbol"; 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 ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; 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* | bitrig*) 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__`"; 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 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$ld_shlibs" && 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 yes,yes = "$GCC,$enable_shared"; 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 yes = "$GCC"; 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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 ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; 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=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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 yes = "$lt_cv_prog_gnu_ld"; 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | 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" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 yes = "$with_gnu_ld"; 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=sco 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 yes = "$with_gnu_ld"; 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; 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 relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; 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 ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$cross_compiling"; 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 -fvisibility=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 yes = "$lt_cv_dlopen_self"; 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 yes = "$cross_compiling"; 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 -fvisibility=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 what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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" # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=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 if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=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 if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes 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_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # 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.7.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.7.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"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $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_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $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"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $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"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $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"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $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_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ 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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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 \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that 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' 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 that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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 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 this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### 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 # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # 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 into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # 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 # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # 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 where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # 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 # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # 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 cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; 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) 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.7.0/c-compiler.m40000644000175000017500000006000715116217421012541 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.7.0/c-library.m40000644000175000017500000002507515116217421012401 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.7.0/general.m40000644000175000017500000001351015116217422012122 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.7.0/ac_func_accept_argtypes.m40000644000175000017500000000707115116217421015344 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.7.0/configure.ac0000644000175000017500000004173415120733254012543 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([pgpool-II], [4.7.0], [pgpool-hackers@lists.postgresql.org], [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 AC_C_BIGENDIAN 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.7.0/aclocal.m40000644000175000017500000010234415120777426012121 00000000000000# generated automatically by aclocal 1.16.2 -*- Autoconf -*- # Copyright (C) 1996-2020 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-2020 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.16' 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.16.2], [], [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.16.2])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-2020 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], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2020 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-2020 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. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # 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 (and possibly the TAP driver). 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 # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) 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-2020 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+set}" != 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-2020 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-2020 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-2020 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 ] ) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2020 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-2020 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-2020 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])]) # Copyright (C) 1999-2020 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. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2020 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_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2020 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-2020 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-2020 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-2020 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-2020 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.7.0/Makefile.in0000644000175000017500000006333415120777437012335 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 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 = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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 = . 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) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) 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__maybe_remake_depfiles = 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 distdir-am 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 am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS COPYING ChangeLog \ INSTALL NEWS README TODO compile config.guess config.sub \ install-sh ltmain.sh missing ylwrap 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ runstatedir = @runstatedir@ 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 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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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) | eval GZIP= gzip $(GZIP_ENV) -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-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -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*) \ eval GZIP= gzip $(GZIP_ENV) -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*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(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/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(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 dist-zstd 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 .PRECIOUS: Makefile 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.7.0/AUTHORS0000644000175000017500000000017315116217421011313 00000000000000Authors of pgpool pgpool was originally written by Tatsuo Ishii, then was contributed to pgpool Global Development Group. pgpool-II-4.7.0/COPYING0000644000175000017500000000123215116217421011273 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.7.0/ChangeLog0000644000175000017500000000001215116217421012005 00000000000000See NEWS. pgpool-II-4.7.0/INSTALL0000644000175000017500000003660015116217421011300 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.7.0/NEWS0000644000175000017500000153567115116217421010763 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.7.0/README0000644000175000017500000000004015116217421011114 00000000000000See the file doc/pgpool-en.html pgpool-II-4.7.0/TODO0000644000175000017500000000452015116217421010733 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.7.0/compile0000755000175000017500000001635015120777436011641 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2020 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* | MSYS*) 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/* | msys/*) 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 | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pgpool-II-4.7.0/config.guess0000755000175000017500000012617315120777436012610 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-08-29' # 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; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -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-2018 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 # 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. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 set_cc_for_build() { : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 { 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" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$driver" 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 } # 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 ; 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 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' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; 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=`(uname -p 2>/dev/null || \ "/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 ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-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) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) 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 # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; 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/[-_].*//' | cut -d. -f1,2` ;; 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}${abi-}" 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 ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$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 ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 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 ;; 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.*:*) UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" case `isainfo -b` in 32) echo i386-pc-solaris2"$UNAME_REL" ;; 64) echo x86_64-pc-solaris2"$UNAME_REL" ;; esac 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) 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 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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:4.4BSD:*) 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 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 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:*:*) 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 ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi else echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys 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 ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-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 "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-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:*:*) 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 ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-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 ;; k1om: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:*:*) 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; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*: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 ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-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"-pc-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.*:*) 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 configure 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 ;; SX-ACE:SUPER-UX:*:*) echo sxace-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 set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then 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 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 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 ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-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. # shellcheck disable=SC2154 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 ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&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 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pgpool-II-4.7.0/config.sub0000755000175000017500000007530415120777436012252 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-08-29' # 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 to . # # 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: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # 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 or ALIAS Canonicalize a configuration name. Options: -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-2018 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 # Split fields of configuration type IFS="-" read -r field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 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* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 os=$maybe_os ;; android-linux) basic_machine=$field1-unknown os=linux-android ;; *) basic_machine=$field1-$field2 os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any patern case $field1-$field2 in decstation-3100) basic_machine=mips-dec os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | 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* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 os= ;; *) basic_machine=$field1 os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc os=bsd ;; a29khif) basic_machine=a29k-amd os=udi ;; adobe68k) basic_machine=m68010-adobe os=scout ;; alliant) basic_machine=fx80-alliant os= ;; altos | altos3068) basic_machine=m68k-altos os= ;; am29k) basic_machine=a29k-none os=bsd ;; amdahl) basic_machine=580-amdahl os=sysv ;; amiga) basic_machine=m68k-unknown os= ;; 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 ;; 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) basic_machine=j90-cray os=unicos ;; crds | unos) basic_machine=m68k-crds os= ;; da30) basic_machine=m68k-da30 os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec os= ;; delta88) basic_machine=m88k-motorola os=sysv3 ;; dicos) basic_machine=i686-pc os=dicos ;; djgpp) basic_machine=i586-pc os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=ose ;; gmicro) basic_machine=tron-gmicro os=sysv ;; go32) basic_machine=i386-pc os=go32 ;; 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 ;; hppaosf) basic_machine=hppa1.1-hp os=osf ;; hppro) basic_machine=hppa1.1-hp os=proelf ;; i386mach) basic_machine=i386-mach os=mach ;; vsta) basic_machine=i386-pc os=vsta ;; isi68 | isi) basic_machine=m68k-isi os=sysv ;; m68knommu) basic_machine=m68k-unknown os=linux ;; magnum | m3230) basic_machine=mips-mips os=sysv ;; merlin) basic_machine=ns32k-utek os=sysv ;; mingw64) basic_machine=x86_64-pc os=mingw64 ;; mingw32) basic_machine=i686-pc os=mingw32 ;; mingw32ce) basic_machine=arm-unknown os=mingw32ce ;; monitor) basic_machine=m68k-rom68k os=coff ;; morphos) basic_machine=powerpc-unknown os=morphos ;; moxiebox) basic_machine=moxie-unknown os=moxiebox ;; msdos) basic_machine=i386-pc os=msdos ;; msys) basic_machine=i686-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-pc 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 ;; necv70) basic_machine=v70-nec os=sysv ;; 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 ;; os400) basic_machine=powerpc-ibm os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=ose ;; os68k) basic_machine=m68k-none os=os68k ;; paragon) basic_machine=i860-intel os=osf ;; parisc) basic_machine=hppa-unknown os=linux ;; 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 ;; sa29200) basic_machine=a29k-amd os=udi ;; sei) basic_machine=mips-sei os=seiux ;; sequent) basic_machine=i386-sequent os= ;; sps7) basic_machine=m68k-bull os=sysv2 ;; st2000) basic_machine=m68k-tandem os= ;; stratus) basic_machine=i860-stratus os=sysv4 ;; sun2) basic_machine=m68000-sun os= ;; sun2os3) basic_machine=m68000-sun os=sunos3 ;; sun2os4) basic_machine=m68000-sun os=sunos4 ;; sun3) basic_machine=m68k-sun os= ;; sun3os3) basic_machine=m68k-sun os=sunos3 ;; sun3os4) basic_machine=m68k-sun os=sunos4 ;; sun4) basic_machine=sparc-sun os= ;; sun4os3) basic_machine=sparc-sun os=sunos3 ;; sun4os4) basic_machine=sparc-sun os=sunos4 ;; sun4sol2) basic_machine=sparc-sun os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun os= ;; 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 ;; toad1) basic_machine=pdp10-xkl os=tops20 ;; 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 ;; vxworks960) basic_machine=i960-wrs os=vxworks ;; vxworks68) basic_machine=m68k-wrs os=vxworks ;; vxworks29k) basic_machine=a29k-wrs os=vxworks ;; xbox) basic_machine=i686-pc os=mingw32 ;; ymp) basic_machine=ymp-cray os=unicos ;; *) basic_machine=$1 os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # 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) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi os=${os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray os=${os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $os in irix*) ;; *) os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony os=newsos ;; next | m*-next) cpu=m68k vendor=next case $os in nextstep* ) ;; ns2*) os=nextstep2 ;; *) os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde os=${os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) IFS="-" read -r cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=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 ;; bluegene*) os=cnk ;; solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; solaris) os=solaris2 ;; unixware*) os=sysv4.2uw ;; gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) es1800*) os=ose ;; # Some version numbers need modification chorusos*) os=chorusos ;; isc) os=isc2.2 ;; sco6) os=sco5v6 ;; sco5) os=sco3.2v5 ;; sco4) os=sco3.2v4 ;; sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ;; sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; scout) # Don't match below ;; sco*) os=sco3.2v2 ;; psos*) os=psos ;; # Now 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* | esix* | aix* | cnk* | sunos | sunos[34]*\ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | kopensolaris* | plan9* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | knetbsd* | mirbsd* | netbsd* \ | bitrig* | openbsd* | solidbsd* | libertybsd* \ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ | linux-newlib* | linux-musl* | linux-uclibc* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ | openstep* | oskit* | conix* | pw32* | nonstopux* \ | storm-chaos* | tops10* | tenex* | tops20* | its* \ | os2* | vos* | palmos* | uclinux* | nucleus* \ | morphos* | superux* | rtmk* | windiss* \ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; qnx*) case $cpu in x86 | i*86) ;; *) os=nto-$os ;; esac ;; hiux*) os=hiuxwe2 ;; nto-qnx*) ;; nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; sim | xray | os68k* | v88r* \ | windows* | osx | abug | netware* | os9* \ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; linux-dietlibc) os=linux-dietlibc ;; linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; lynx*178) os=lynxos178 ;; lynx*5) os=lynxos5 ;; lynx*) os=lynxos ;; mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; opened*) os=openedition ;; os400*) os=os400 ;; sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; wince*) os=wince ;; 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 ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) os=mint ;; zvmoe) os=zvmoe ;; dicos*) os=dicos ;; pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $cpu in arm*) os=eabi ;; *) os=elf ;; esac ;; nacl*) ;; ios) ;; none) ;; *-eabi) ;; *) 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 $cpu-$vendor in score-*) os=elf ;; spu-*) os=elf ;; *-acorn) os=riscix1.2 ;; arm*-rebel) os=linux ;; arm*-semi) os=aout ;; c4x-* | tic4x-*) os=coff ;; c8051-*) os=elf ;; clipper-intergraph) os=clix ;; 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 ;; or32-*) os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=sysv3 ;; sparc-* | *-sun) os=sunos4.1.1 ;; pru-*) os=elf ;; *-be) os=beos ;; *-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 ;; *-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 ;; *-wrs) os=vxworks ;; *) 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. case $vendor 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 ;; clix*) vendor=intergraph ;; 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 ;; esac echo "$cpu-$vendor-$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pgpool-II-4.7.0/install-sh0000755000175000017500000003643515120777436012275 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # 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. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # 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_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 is_target_a_directory=possibly 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 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi 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 if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi 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. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac 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. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/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. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 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 oIFS=$IFS IFS=/ set -f set fnord $dstdir shift 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=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_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 && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $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` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && 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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pgpool-II-4.7.0/ltmain.sh0000644000175000017500000117106715120777416012111 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 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 this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # 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. # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! 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 # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! 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 ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_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 # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_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 '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. 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. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # 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" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_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 "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # 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. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # 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 "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_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 "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_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_append 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_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || 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_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd 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 -z "$func_relative_path_tlibdir"; 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 -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # 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 () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_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. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # 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). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" 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 () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # 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. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --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 --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_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) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "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 yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; 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 } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # 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 # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # 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 test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. 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= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # 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 | func_generated_by_libtool_p } # 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 yes = "$lalib_p" } # 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 () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # 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 () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs 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 () { $debug_cmd 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 () { $debug_cmd 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 yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; 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 "$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 () { $debug_cmd # 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 () { $debug_cmd 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 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd $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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # 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 yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot 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 yes = "$build_old_libs"; 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 no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; 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 yes = "$need_locks"; 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 warn = "$need_locks"; 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 yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; 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 warn = "$need_locks" && 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 yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; 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 warn = "$need_locks" && 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 no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && 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 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -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 () { $debug_cmd # 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 $opt_dry_run; then # 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 else 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 fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd 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_quiet && 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 finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # 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=false 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=: ;; -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-m = "X$prev" && 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=: if $isdir; 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 ;; os2*) 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 yes = "$build_old_libs"; 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=: 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'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; 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_quiet || { 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 install = "$opt_mode" && 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 () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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) $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 can'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 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; 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 func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' 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[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi 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" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; 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" "${nlist}I"' # 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_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 () { $debug_cmd 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 () { $debug_cmd 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_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 () { $debug_cmd 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 case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) 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 } }'` ;; esac 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 () { $debug_cmd 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 () { $debug_cmd 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 that possess that section. Heuristic: eliminate # all those that 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_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 () { $debug_cmd 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 () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; 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 yes = "$lock_old_archive_extraction"; 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 () { $debug_cmd 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` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result 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 "$sed_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 where 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) $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/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that 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) $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 yes = "$fast_install"; 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 yes = "$shlibpath_overrides_runpath" && 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 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* 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_platform || defined ... */ #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 #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 (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]; size_t 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 = (size_t) (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 (STREQ (str, pat)) *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 size_t 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) { size_t orig_value_len = strlen (orig_value); size_t 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 #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\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 () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd 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 # what 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 that 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= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false 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 yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && 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) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; 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 ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. 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 none = "$pic_object" && test none = "$non_pic_object"; 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 none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; 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 dlprefiles = "$prev"; 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 none != "$non_pic_object"; 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 none = "$pic_object"; 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 ;; os2dllname) os2dllname=$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 rpath = "$prev"; 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-export-symbols = "X$arg"; 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-lc = "X$arg" || test X-lm = "X$arg"; 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-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && 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-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm 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 ;; -os2dllname) prev=os2dllname 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 # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang -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*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*) 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 ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # 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 none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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 dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; 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 yes = "$export_dynamic" && 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\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" 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 lib = "$linkmode"; 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=false 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 lib,link = "$linkmode,$pass"; 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; 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 dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; 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 .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; 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 conv = "$pass" && 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 conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; 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 link = "$pass"; 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 conv = "$pass"; 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=false 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=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else 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." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; 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=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; 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 prog != "$linkmode" && test lib != "$linkmode"; 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 yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; 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 dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" 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 yes = "$installed"; 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 yes = "$hardcode_automatic" && 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 dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; 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 lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: 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 $linkalldeplibs; 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 prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || 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 $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && 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 built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; 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 yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; 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 lib = "$linkmode" && test yes = "$hardcode_into_libs"; 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* | *os2*) 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 prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; 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 cannot # 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 no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; 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 yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; 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 prog = "$linkmode"; 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 yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; 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 prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; 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 no = "$link_static" && 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 no != "$link_all_deplibs"; 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 link = "$pass"; then if test prog = "$linkmode"; 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 dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # 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= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=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 # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # 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 prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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 no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; 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 pass_all != "$deplibs_check_method"; 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 no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; 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 # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|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" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; 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 0 -ne "$loop"; 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 0 -ne "$loop"; 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 ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. 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 no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; 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 -n "$precious_files_regex"; 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 yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; 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 yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 yes = "$build_libtool_libs"; 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 yes = "$build_libtool_need_lc"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 none = "$deplibs_check_method"; 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 yes = "$droppeddeps"; then if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || 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 relink = "$opt_mode" || 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 func_dll_def_p "$export_symbols" || { # 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 ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || 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 yes = "$try_normal_branch" \ && { 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 : != "$skipped_export"; 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 : != "$skipped_export" && 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 yes = "$compiler_needs_object" && 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 yes = "$thread_safe" && 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 relink = "$opt_mode"; 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 yes = "$module" && 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 : != "$skipped_export" && 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 : != "$skipped_export" && test yes = "$with_gnu_ld"; 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 : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; 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 -z "$objlist" || 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 1 -eq "$k"; 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 ${skipped_export-false} && { 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 } 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_quiet || { 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 relink = "$opt_mode"; 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 ${skipped_export-false} && { 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 } 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 yes = "$module" && 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=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { 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 relink = "$opt_mode"; 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 relink = "$opt_mode"; 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 yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags 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 yes = "$build_libtool_libs" || 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 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 test yes = "$build_libtool_libs" || { 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 } if test -n "$pic_flag" || test default != "$pic_mode"; 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" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && 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 CXX = "$tagname"; 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 yes = "$build_old_libs"; 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@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # 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 } 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 yes = "$no_install"; 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 case $hardcode_action,$fast_install in relink,*) # 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" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # 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 case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac 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 yes = "$build_libtool_libs"; 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 -z "$oldobjs"; 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 yes = "$build_old_libs" && 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 yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; 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 -n "$bindir"; 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) $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 cannot 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 no,yes = "$installed,$need_relink"; 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 } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false 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=: ;; -*) 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 . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; 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 $rmforce; 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" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || 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 none != "$pic_object"; 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 none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; 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 yes = "$fast_install" && 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 } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi 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 # where 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: pgpool-II-4.7.0/missing0000755000175000017500000001533615120777436011665 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2020 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=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://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 'autom4te' 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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pgpool-II-4.7.0/ylwrap0000755000175000017500000001531415120777440011521 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2020 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 # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pgpool-II-4.7.0/src/0000755000175000017500000000000015120777704011123 500000000000000pgpool-II-4.7.0/src/auth/0000755000175000017500000000000015120777676012074 500000000000000pgpool-II-4.7.0/src/auth/md5.c0000644000175000017500000002501415116217422012626 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.7.0/src/auth/pool_auth.c0000644000175000017500000017012615116217422014140 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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_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 void pool_send_backend_key_data(POOL_CONNECTION *frontend, int pid, char *key, int32 keylen, 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_md5(POOL_CONNECTION *backend, POOL_CONNECTION *frontend, int reauth, int protoMajor, char *storedPassword, PasswordType passwordType); 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 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); static void ProcessNegotiateProtocol(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *cp); /* * 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; int pid; 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) { char *p; int32 keylen; 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'"); length = ntohl(length); keylen = length - sizeof(int32) - sizeof(int32); if (keylen > MAX_CANCELKEY_LENGTH) { ereport(ERROR, (errmsg("failed to authenticate"), errdetail("invalid backend key data length. received %d bytes exceeding %d", ntohl(length), MAX_CANCELKEY_LENGTH))); } /* read pid */ pool_read_with_error(cp->con, &pid, sizeof(pid), "pid for authentication kind 'K'"); cp->pid = pid; /* read key */ keylen = length - sizeof(int32) - sizeof(int32); p = pool_read2(cp->con, keylen); memcpy(cp->key, p, keylen); 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 protoMajor; int length; int authkind; int i; int message_length = 0; StartupPacket *sp; int32 keylen; /* cancel key length */ char cancel_key[MAX_CANCELKEY_LENGTH]; char *p; protoMajor = MAIN_CONNECTION(cp)->sp->major; read_kind: 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 == 'v') { /* NegotiateProtocolVersion received */ ProcessNegotiateProtocol(frontend, cp); goto read_kind; } 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))); } } } /* md5 authentication? */ else if (authkind == AUTH_REQ_MD5) { char *password = NULL; PasswordType passwordType = PASSWORD_TYPE_UNKNOWN; /* * check if we can use md5 authentication. */ 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))); } if (kind == 'R') { 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; } } } /* * Read BackendKeyData message length. */ if (protoMajor == PROTO_MAJOR_V3) { length = pool_read_message_length(cp); keylen = length - sizeof(int32) - sizeof(int32); if (keylen > MAX_CANCELKEY_LENGTH) { ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("cancel key length exceeds 256 bytes"))); } } else keylen = 4; elog(DEBUG1, "cancel key length: %d", keylen); /* * 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 */ p = pool_read2(CONNECTION(cp, i), keylen); if (p == NULL) { ereport(ERROR, (errmsg("authentication failed"), errdetail("failed to read key of length: %d in slot %d", keylen, i))); } memcpy(CONNECTION_SLOT(cp, i)->key, p, keylen); memcpy(cp->info[i].key, p, keylen); memcpy(cancel_key, p, keylen); CONNECTION_SLOT(cp, i)->keylen = cp->info[i].keylen = keylen; cp->info[i].major = sp->major; /* * If NegotiateProtocol message has been received, set the minor * version. Othewise use the version in the StartupMessage. */ if (CONNECTION_SLOT(cp, i)->nplen > 0) cp->info[i].minor = CONNECTION_SLOT(cp, i)->negotiated_minor; else 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"))); } /* * We send the BackendKeyData to frontend, which belongs to the last * backend in the backend group. */ pool_send_backend_key_data(frontend, pid, cancel_key, MAIN_CONNECTION(cp)->keylen, protoMajor); 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; POOL_CONNECTION_POOL_SLOT *sp; protoMajor = MAJOR(cp); /* * If NegotiateProtocolMsg has been received from backend, forward it to * frontend. If the frontend dislike it, it will disconnect the * connection. Otherwise it will silently continue. */ sp = CONNECTION_SLOT(cp, MAIN_NODE_ID); if (protoMajor == PROTO_MAJOR_V3 && sp->nplen > 0) { elog(DEBUG1, "negotiateProtocol message is forwarded to frontend at reauth"); pool_write_and_flush(frontend, sp->negotiateProtocolMsg, sp->nplen); } /* * 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_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))); } } /* * Send auth ok */ 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)); /* send BackendKeyData */ pool_send_backend_key_data(frontend, MAIN_CONNECTION(cp)->pid, MAIN_CONNECTION(cp)->key, MAIN_CONNECTION(cp)->keylen, 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. */ static void pool_send_backend_key_data(POOL_CONNECTION *frontend, int pid, char *key, int32 keylen, int protoMajor) { char kind; int32 len; /* Send backend key data */ kind = 'K'; pool_write(frontend, &kind, 1); if (protoMajor == PROTO_MAJOR_V3) { len = htonl(sizeof(int32) + sizeof(int32) + keylen); pool_write(frontend, &len, sizeof(len)); } ereport(DEBUG1, (errmsg("sending backend key data"))); pool_write(frontend, &pid, sizeof(pid)); pool_write_and_flush(frontend, key, keylen); } 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; bool rtn; if (reauth && frontend->frontend_authenticated) { /* frontend and backend are both authenticated already */ return 0; } rtn = get_auth_password(backend, frontend, reauth, &pwd, &passwordType); /* * If pool_hba.conf == "password", we should already have frontend * password. When reauth, we want the password, rather than * backend->password, which is returned by get_auth_password() if * pool_passwd does not have an entry for the user. */ if (reauth && rtn && frontend->passwordMapping == NULL && frontend->pwd_size > 0 && frontend->passwordType == PASSWORD_TYPE_PLAINTEXT) { pwd = frontend->password; passwordType = frontend->passwordType; } else if (!rtn || frontend->pwd_size == 0) { /* * 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, 0, &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 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; } /* * 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 (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; } /* * Get user's password from various sources. Firstly try pool_passwd and * return it if the user's password is there. If reauth == 0 (first time the * user connect to pgpool) and the password is in frontend, return it. If * reauth != 0 (reuse connection pool) and the password is in backendm return * it. */ 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 (!reauth && 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 (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; } /* * Generate random bytes */ void pool_random(void *buf, size_t len) { if (!pg_strong_random(buf, len)) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("could not generate random bytes"))); } /* * pool_random_salt */ void pool_random_salt(char *md5Salt) { pool_random(md5Salt, 4); } 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; } /* * Forward NegotiateProtocol message to frontend. * * When this function is called, message kind has been already read. */ static void ProcessNegotiateProtocol(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *cp) { int32 len; int32 savelen; int32 protoMajor; int32 protoMinor; int32 protov; bool forwardMsg = false; int i; elog(DEBUG1, "Forwarding NegotiateProtocol message to frontend"); pool_write(frontend, "v", 1); /* forward message kind */ savelen = len = pool_read_int(cp); /* message length including self */ pool_write(frontend, &len, 4); /* forward message length */ len = ntohl(len) - 4; /* length of rest of the message */ protov = pool_read_int(cp); /* read protocol version */ protoMajor = PG_PROTOCOL_MAJOR(ntohl(protov)); /* protocol major version */ protoMinor = PG_PROTOCOL_MINOR(ntohl(protov)); /* protocol minor version */ pool_write(frontend, &protov, 4); /* forward protocol version */ elog(DEBUG1, "protocol verion offered: major: %d minor: %d", protoMajor, protoMinor); len -= 4; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { POOL_CONNECTION_POOL_SLOT *sp; char *p; char *np; Size nplen; p = pool_read2(CONNECTION(cp, i), len); if (!forwardMsg) { pool_write_and_flush(frontend, p, len); /* forward rest of * message */ forwardMsg = true; } /* save negatiate protocol version */ sp = CONNECTION_SLOT(cp, i); sp->negotiated_major = protoMajor; sp->negotiated_minor = protoMinor; /* save negatiate protocol message */ nplen = 1 + /* message kind */ sizeof(savelen) + /* message length */ sizeof(protov) + /* protocol version */ len; /* rest of message */ /* allocate message area */ sp->negotiateProtocolMsg = MemoryContextAlloc(TopMemoryContext, nplen); np = sp->negotiateProtocolMsg; sp->nplen = nplen; /* set message length */ *np++ = 'v'; memcpy(np, &savelen, sizeof(savelen)); np += sizeof(savelen); memcpy(np, &protov, sizeof(protov)); np += sizeof(protov); memcpy(np, p, len); } } } pgpool-II-4.7.0/src/auth/pool_passwd.c0000644000175000017500000003740215116217422014477 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 check_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.7.0/src/auth/pool_hba.c0000644000175000017500000024434715116217422013740 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.7.0/src/auth/auth-scram.c0000644000175000017500000013366715116217422014223 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.7.0/src/config/0000755000175000017500000000000015120777676012400 500000000000000pgpool-II-4.7.0/src/config/pool_config.c0000644000175000017500000017166515120733753014766 00000000000000#line 1 "config/pool_config.c" #line 3 "config/pool_config.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #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 #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* 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. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = NULL; 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 ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #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 yynoreturn yy_fatal_error ( const 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 = (int) (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 const 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 const YY_CHAR 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 const YY_CHAR yy_meta[20] = { 0, 1, 1, 2, 1, 1, 1, 3, 3, 3, 4, 4, 1, 5, 6, 5, 1, 3, 5, 3 } ; static const 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 const 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 const 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 const 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-2025 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); #line 552 "config/pool_config.c" #define YY_NO_INPUT 1 #line 554 "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 ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif #ifndef YY_NO_UNPUT #endif #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) 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 = '*'; \ int 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 = (int) fread(buf, 1, (yy_size_t) 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 /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; 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( ); } { #line 96 "config/pool_config.l" #line 772 "config/pool_config.c" while ( /*CONSTCOND*/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 { 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[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 user's declarations */ } /* 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) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; 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_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int 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, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (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) { yy_state_type yy_current_state; char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { 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[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 ) { int yy_is_jam; char *yy_cp = (yy_c_buf_p); 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[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 39); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((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 0; 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( (yy_size_t) (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; /* After all that talk, this was set to 1 anyways... */ (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. */ yy_size_t 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 NULL; 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 = (int) (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 = NULL; 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 (const char * yystr ) { return yy_scan_bytes( yystr, (int) 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 (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_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 yynoreturn yy_fatal_error (const char* msg ) { fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param _line_number 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) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #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, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return 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 realloc(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 strncat(buf, "|ALWAYS_PRIMARY", 16); } 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.7.0/src/config/pool_config.l0000644000175000017500000004063215116217422014757 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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 strncat(buf, "|ALWAYS_PRIMARY", 16); } 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.7.0/src/config/pool_config_variables.c0000644000175000017500000050233015116217422016774 00000000000000/* -*-pgsql-c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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 LogDirAssignMessage(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}, {"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, false, 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_database", CFGCXT_RELOAD, RECOVERY_CONFIG, "The database name for online recovery.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.recovery_database, "postgres", 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, "Old config parameter for work_dir.", CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_IN_SHOW_ALL }, NULL, "", LogDirAssignMessage, NULL, NULL, NULL }, { {"work_dir", CFGCXT_INIT, LOGGING_CONFIG, "directory to create pgpool_status and lock files.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.work_dir, 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 strncat(buffer, "|ALWAYS_PRIMARY", 16); } 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"))); if (g_pool_config.delegate_ip) pfree(g_pool_config.delegate_ip); if (newval) g_pool_config.delegate_ip = pstrdup(newval); else g_pool_config.delegate_ip = NULL; return true; } /* * Throws warning for if someone uses the removed logdir * configuration parameter and set the value to work_dir */ static bool LogDirAssignMessage(ConfigContext scontext, char *newval, int elevel) { if (scontext != CFGCXT_BOOT) ereport(WARNING, (errmsg("logdir is changed to work_dir"), errdetail("if logdir is specified, the value will be set to work_dir"))); if (g_pool_config.work_dir) pfree(g_pool_config.work_dir); if (newval) g_pool_config.work_dir = pstrdup(newval); else g_pool_config.work_dir = NULL; 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 dest_if_idx = 0; int local_if_idx = 0; char **addrs; char **if_names; int i, j, k, n_addr, n_if_name; g_pool_config.num_hb_local_if = 0; 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. g_pool_config.hb_local_if is * the local node information. 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) { 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) { if (i == g_pool_config.pgpool_node_id) g_pool_config.hb_local_if[local_if_idx].addr[0] = '\0'; else g_pool_config.hb_dest_if[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++) { /* local pgpool node */ if (i == g_pool_config.pgpool_node_id) { for (k = 0; k < g_pool_config.wd_nodes.num_wd - 1; k++) { strlcpy(g_pool_config.hb_local_if[local_if_idx].addr, addrs[j], WD_MAX_HOST_NAMELEN - 1); g_pool_config.hb_local_if[local_if_idx].dest_port = hbNodeInfo->dest_port; if (n_if_name > j) strlcpy(g_pool_config.hb_local_if[local_if_idx].if_name, if_names[j], WD_MAX_IF_NAME_LEN - 1); else g_pool_config.hb_local_if[local_if_idx].if_name[0] = '\0'; g_pool_config.num_hb_local_if = local_if_idx + 1; local_if_idx++; } if (n_if_name > j) pfree(if_names[j]); pfree(addrs[j]); } /* destination pgpool node */ else { strlcpy(g_pool_config.hb_dest_if[dest_if_idx].addr, addrs[j], WD_MAX_HOST_NAMELEN - 1); g_pool_config.hb_dest_if[dest_if_idx].dest_port = hbNodeInfo->dest_port; if (n_if_name > j) { strlcpy(g_pool_config.hb_dest_if[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[dest_if_idx].if_name[0] = '\0'; g_pool_config.num_hb_dest_if = dest_if_idx + 1; dest_if_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.7.0/src/context/0000755000175000017500000000000015120777676012617 500000000000000pgpool-II-4.7.0/src/context/pool_session_context.c0000644000175000017500000014110015116217422017137 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.7.0/src/context/pool_process_context.c0000644000175000017500000002114115116217422017134 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.7.0/src/context/pool_query_context.c0000644000175000017500000016453015116217422016635 00000000000000/* -*-pgsql-c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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, MAIN_CONNECTION(backend)->keylen); /* * 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, MAIN_CONNECTION(backend)->keylen); /* * 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. 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.7.0/src/main/0000755000175000017500000000000015120777676012057 500000000000000pgpool-II-4.7.0/src/main/main.c0000644000175000017500000004416215116217422013055 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.7.0/src/main/pool_globals.c0000644000175000017500000000535015116217422014601 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.7.0/src/main/pgpool_main.c0000644000175000017500000041650415116217422014440 00000000000000/* -*-pgpool_main-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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 */ /* followings are copy of Req_info */ 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 *), 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; /* * 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; /* * Query cache lock file path. This should be declared as "static" because * the path is passed to be registered using on_proc_exit(). */ static char query_cache_lock_path[MAXPGPATH]; 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 || pool_config->enable_shared_relcache) { int lfd; snprintf(query_cache_lock_path, sizeof(query_cache_lock_path), "%s/%s", pool_config->work_dir, QUERY_CACHE_LOCK_FILE); lfd = open(query_cache_lock_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\"", query_cache_lock_path), errdetail("%m"))); } close(lfd); /* Register file unlink at exit */ on_proc_exit(FileUnlink, (Datum) query_cache_lock_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 *), 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 streaming replication mode/native replication mode, we * treat this as a restart request. Otherwise we need to check if we * have already performed the failover. */ 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]; /* requested node */ 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]; /* set target node id */ /* 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 */ { /* process single failover 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())); } 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->work_dir, 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->work_dir, 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.7.0/src/main/health_check.c0000644000175000017500000004156515116217422014537 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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(void *params) { sigjmp_buf local_sigjmp_buf; MemoryContext HealthCheckMemoryContext; char psbuffer[NI_MAXHOST]; static struct timeval start_time; static struct timeval end_time; long diff_t; int node_id; POOL_HEALTH_CHECK_STATISTICS mystat; node_id = *((int *) params); 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()); if (strcmp("", pool_config->pool_passwd)) pool_reopen_passwd_file(); 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(DEBUG1, "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->work_dir, 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.7.0/src/main/pool_internal_comms.c0000644000175000017500000003111415116217422016165 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.7.0/src/main/pgpool_logger.c0000644000175000017500000010104615116217422014763 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 time_t 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; pg_noreturn static void SysLoggerMain(int argc, char *argv[]); 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.7.0/src/pcp_con/0000755000175000017500000000000015120777676012554 500000000000000pgpool-II-4.7.0/src/pcp_con/pcp_child.c0000644000175000017500000002761715116217422014561 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.7.0/src/pcp_con/pcp_worker.c0000644000175000017500000012502015116217422014772 00000000000000/* -*-pcp_worker.c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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; char tos; int rsize; ereport(DEBUG1, (errmsg("I am PCP worker child with pid:%d", getpid()))); /* Identify myself via ps */ init_ps_display("", "", "", ""); /* 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), "%lld", (long long) bi->standby_delay); snprintf(status_changed_time_str, sizeof(status_changed_time_str), "%lld", (long long) 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.7.0/src/pcp_con/recovery.c0000644000175000017500000003415615116217422014466 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 (check_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 *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); /* * If database is not specified, "postgres" database is assumed. */ if (*pool_config->recovery_database == '\0') dbname = "postgres"; else dbname = pool_config->recovery_database; conn = PQsetdbLogin(backend->backend_hostname, port_str, NULL, NULL, dbname, 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.7.0/src/protocol/0000755000175000017500000000000015120777676012774 500000000000000pgpool-II-4.7.0/src/protocol/pool_proto2.c0000644000175000017500000004245415116217422015326 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.7.0/src/protocol/child.c0000644000175000017500000015160315116217422014130 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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; /* * 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 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 < 4 || 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 except the length of the message. */ pool_read_with_error(cp, sp->startup_packet, len, "startup packet"); sp->len = len; memcpy(&protov, sp->startup_packet, sizeof(protov)); sp->major = PG_PROTOCOL_MAJOR(ntohl(protov)); sp->minor = PG_PROTOCOL_MINOR(ntohl(protov)); 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 = pstrdup(sp->user); else if (sp->database[0] == '\0') { pfree(sp->database); 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) { /* Send parameter status message to frontend. */ 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, int32 splen) { int len; int fd; POOL_CONNECTION *con; int i, j, k; ConnectionInfo *c = NULL; bool found = false; int32 keylen; /* cancel key length */ 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"))); /* * Cancel key length is cancel message length - cancel request code - * process id. */ keylen = splen - sizeof(int32) - sizeof(int32); /* * Look for cancel key from shmem info. Frontend should have saved one of * cancel key among backend groups and sent it in the cancel request * message. We are looking for the backend which has the same cancel key * and pid. The query we want to cancel should have been running one the * backend group. So some of query cancel requests may not work but it * should not be a problem. They are just ignored by the backend. */ 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 sp.pid:%d keylen:%d sp.keylen:%d i:%d", c, c->database, c->user, ntohl(c->pid), ntohl(sp->pid), c->keylen, keylen, i))); if (c->pid == sp->pid && c->keylen == keylen && memcmp(c->key, sp->key, keylen) == 0) { ereport(DEBUG1, (errmsg("processing cancel request"), errdetail("found pid:%d keylen:%d i:%d", ntohl(c->pid), c->keylen, i))); /* * "c" is a pointer to i th child, j th pool, and 0 th * backend. */ c = pool_coninfo(i, j, 0); found = true; goto found; } } } } found: if (!found) { ereport(LOG, (errmsg("invalid cancel key: pid:%d keylen:%d", ntohl(sp->pid), keylen))); return; /* invalid key */ } /* * We are sending cancel request message to all backend groups. So some * of query cancel requests may not work but it should not be a problem. * They are just ignored by the backend. */ for (i = 0; i < NUM_BACKENDS; i++, c++) { int32 cancel_request_code; 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(splen + sizeof(int32)); /* splen does not include packet * length field */ pool_write(con, &len, sizeof(len)); /* send cancel messages length */ cancel_request_code = htonl(PG_PROTOCOL(1234, 5678)); /* cancel request code */ pool_write(con, &cancel_request_code, sizeof(int32)); pool_write(con, &c->pid, sizeof(int32)); /* send pid */ pool_write(con, c->key, keylen); /* send cancel key */ ereport(LOG, (errmsg("forwarding cancel request to backend %d", i), errdetail("canceling backend pid: %d keylen: %d", ntohl(sp->pid), keylen))); if (pool_flush_noerror(con) < 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); elog(DEBUG1, "send parameter status message to frontend: \"%s\" = \"%s\"", name, value); } 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; ProcessInfo *pi; ereport(DEBUG1, (errmsg("I am %d accept fd %d", getpid(), front_end_fd))); pool_getnameinfo_all(saddr, remote_host, remote_port); /* save remote client host and port info onto shared memory */ pi = pool_get_my_process_info(); StrNCpy(pi->client_host, remote_host, NI_MAXHOST); StrNCpy(pi->client_port, remote_port, NI_MAXSERV); 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, sp->len); 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.7.0/src/protocol/pool_pg_utils.c0000644000175000017500000007162615116217422015732 00000000000000/* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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/pg_prng.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); static void initialize_prng(pg_prng_state *state); /* * 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) an SQL executes (if statement_level_load_balance is enabled) * 3) 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]; /* prng state data for load balancing */ static pg_prng_state backsel_state; /* * -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; /* initialize prng if necessary */ initialize_prng(&backsel_state); r = pg_prng_double(&backsel_state); /* * 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; } } } r = pg_prng_double(&backsel_state) * total_weight; 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; } } r = pg_prng_double(&backsel_state) * total_weight; 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; } } } r = pg_prng_double(&backsel_state) * total_weight; 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; } /* * initialize_prng() - * * Initialize (seed) the PRNG, if not done yet in this process. */ static void initialize_prng(pg_prng_state *state) { static bool prng_seed_set = false; uint64 seed; if (unlikely(!prng_seed_set)) { /* initialize prng */ if (!pg_strong_random(&seed, sizeof(seed))) seed = UINT64CONST(1); /* Pick a value, as long as it spreads */ pg_prng_seed(state, seed); prng_seed_set = true; } } /* * 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.7.0/src/protocol/pool_process_query.c0000644000175000017500000042020415116217422016775 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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, char *key, int keylen) { 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; memcpy(cancel_packet.key, key, keylen); cancel_request(&cancel_packet, keylen + sizeof(int32) + sizeof(int32)); } 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, char *key, int keylen, 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, keylen); /* * 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, MAIN_CONNECTION(backend)->keylen, 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, MAIN_CONNECTION(backend)->keylen, 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, MAIN_CONNECTION(backend)->keylen, 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, MAIN_CONNECTION(backend)->keylen, 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, MAIN_CONNECTION(backend)->keylen, 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, MAIN_CONNECTION(backend)->keylen, 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), 'N' (notice), 'H' (CopyOutResponse), 'd' (CopyData) or 'c' * (CopyDone) 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' || *decided_kind == 'H' || *decided_kind == 'd' || *decided_kind == 'c')) || (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, MAIN_CONNECTION(backend)->keylen, 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, MAIN_CONNECTION(backend)->keylen, 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, MAIN_CONNECTION(backend)->keylen, 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); buf = NULL; } data_pushed = true; if (kind == 'E') { /* Found error response */ ereport(DEBUG1, (errmsg("pool_push_pending_data: ERROR response found"))); pool_set_ignore_till_sync(); if (buf) pfree(buf); break; } num_pushed_messages++; } return data_pushed; } pgpool-II-4.7.0/src/protocol/pool_connection_pool.c0000644000175000017500000006676515116217422017304 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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)); if (CONNECTION_SLOT(p, i)->negotiateProtocolMsg) pfree(CONNECTION_SLOT(p, i)->negotiateProtocolMsg); 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: %lld", CONNECTION_SLOT(p, main_node_id)->sp->user, CONNECTION_SLOT(p, main_node_id)->sp->database, (long long) 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 %lld", (long long) 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 %lld", (long long) 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: %lld", (long long) (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; int retry_cnt = 5; /* getaddrinfo() retry count in case EAI_AGAIN */ /* * 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; for (;;) { if ((ret = getaddrinfo(host, portstr, &hints, &res)) != 0) { if (!retry || ret != EAI_AGAIN) { ereport(WARNING, (errmsg("failed to connect to PostgreSQL server, getaddrinfo() failed with error \"%s\"", gai_strerror(ret)))); free(portstr); return -1; } retry_cnt--; if (retry_cnt <= 0) { ereport(WARNING, (errmsg("failed to connect to PostgreSQL server, getaddrinfo() failed due to retry count over"))); free(portstr); return -1; } ereport(LOG, (errmsg("failed to connect to PostgreSQL server, getaddrinfo() failed. retrying..."))); sleep(1); } else break; } 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 = palloc0(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.7.0/src/protocol/pool_proto_modules.c0000644000175000017500000042555015116217422016776 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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); /* * Initialize ProcessInfo->node_ids and ProcessInfo->statement. */ init_pi_set(); /* * 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; } /* initialize backend send statement bitmap */ init_pi_set(); 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)); num_rows = ntohl(num_rows); ereport(DEBUG1, (errmsg("Execute: num_rows: %d", 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 and the query is cache safe * (i.e. read only SELECT), 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->is_cache_safe && !query_cache_disabled()) { 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); /* initialize backend send statement bitmap */ init_pi_set(); 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) { /* * 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) { char *errmessage; /* send error message to frontend */ errmessage = psprintf("prepared statement \"%s\" does not exist", pstmt_name); pool_send_error_message(frontend, MAJOR(cp), "XX000", errmessage, "", "", __FILE__, __LINE__); pfree(errmessage); /* * Since we do not receive an error response from backend, we need * similar treatement in case of error response. */ 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); return POOL_CONTINUE; } 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); } /* * If query cache is enabled and we updating table, save table oids. It * maybe possible that Parse() already collected the information but if * Bind is called without prior parse (this could happen if named prepared * statement is used), we miss the information. So we re-collect the * information here. This could result in duplicate oids in oid table, but * it's Okay. The duplication will be ignored anyway. */ if (pool_config->memory_cache_enabled) { /* * Save table oids if we are updating the table. */ if (!query_context->is_parse_error) { int num_oids; int *oids; int i; num_oids = pool_extract_table_oids(query_context->parse_tree, &oids); /* Save to oid buffer */ for (i = 0; i < num_oids; i++) pool_add_dml_table_oid(oids[i]); } } /* * 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, MAIN_CONNECTION(backend)->keylen, 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) { ProcessInfo *pi = pool_get_my_process_info(); 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))); pi_set(node_id); StrNCpy(pi->statement, query, MAXSTMTLEN); } /* * Initialize ProcessInfo->node_ids and ProcessInfo->statement. */ void init_pi_set(void) { ProcessInfo *pi = pool_get_my_process_info(); memset(pi->node_ids, 0, sizeof(pi->node_ids)); pi->statement[0] = '\0'; } /* * Set ProcessInfo->node_ids. */ void pi_set(int node_id) { ProcessInfo *pi = pool_get_my_process_info(); if (node_id < BITS_PER_TYPE(uint64)) pi->node_ids[0] |= ((uint64) 1 << node_id); else pi->node_ids[1] |= ((uint64) 1 << (node_id - BITS_PER_TYPE(uint64))); } /* * Returns true if node_id bit in ProcessInfo->node_ids is on. */ bool is_pi_set(uint64 *node_ids, int node_id) { int set; if (node_id < BITS_PER_TYPE(uint64)) set = node_ids[0] & ((uint64) 1 << node_id); else set = node_ids[1] & ((uint64) 1 << (node_id - BITS_PER_TYPE(uint64))); return set != 0; } /* * 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.7.0/src/protocol/CommandComplete.c0000644000175000017500000004541015116217422016112 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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.7.0/src/query_cache/0000755000175000017500000000000015120777676013423 500000000000000pgpool-II-4.7.0/src/query_cache/pool_memqcache.c0000644000175000017500000034066115116217422016454 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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 = %lld", (long long) 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 = %lld", (long long) 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); #ifdef USE_MEMCACHED if (!pool_is_shmem_cache()) { free(ptr); } #endif 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))); elog(DEBUG1, "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: %lld timestamp: %lld", (long long) now, (long long) (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->work_dir, 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); } else #ifdef USE_MEMCACHED { 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.7.0/src/redhat/0000755000175000017500000000000015120777702012370 500000000000000pgpool-II-4.7.0/src/redhat/pgpool.init0000644000175000017500000000763015116217422014474 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.7.0/src/redhat/pgpool_rhel.sysconfig0000644000175000017500000000027715116217422016547 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.7.0/src/redhat/pgpool_rhel6.sysconfig0000644000175000017500000000025115116217422016625 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.7.0/src/redhat/pgpool.conf.sample.patch0000644000175000017500000000455215116217422017034 00000000000000*** src/sample/pgpool.conf.sample 2025-09-30 17:44:36.223222257 +0900 --- pgpool.conf.sample 2025-09-30 17:46:22.952860803 +0900 *************** *** 82,96 **** # - 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 --- 82,96 ---- # - Backend Connection Settings - ! backend_hostname0 = 'localhost' # Host name or IP address to connect to for backend 0 ! backend_port0 = 5432 # Port number for backend 0 ! backend_weight0 = 1 # Weight for backend 0 (only in load balancing mode) ! backend_data_directory0 = '/var/lib/pgsql/data' # Data directory for backend 0 ! backend_flag0 = 'ALLOW_TO_FAILOVER' # Controls various backend behavior # ALLOW_TO_FAILOVER, DISALLOW_TO_FAILOVER # or ALWAYS_PRIMARY *************** *** 351,357 **** # location of pgpool.conf file or # as an absolute path # (change requires restart) ! #work_dir = '/tmp' # Directory for pgpool_status and lock files. # (change requires restart) --- 351,357 ---- # location of pgpool.conf file or # as an absolute path # (change requires restart) ! work_dir = '/var/lib/pgpool' # Directory for pgpool_status and lock files. # (change requires restart) pgpool-II-4.7.0/src/redhat/pcp_unix_domain_path.patch0000644000175000017500000000104315116217422017510 00000000000000*** src/include/pcp/pcp_stream.h 2025-08-15 16:47:16.214748366 +0900 --- pcp_stream.h 2025-08-15 16:47:07.339772297 +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.7.0/src/redhat/pgpool_log.patch0000644000175000017500000001065315116217422015470 00000000000000*** src/sample/pgpool.conf.sample 2025-08-15 17:12:42.964631588 +0900 --- pgpool.conf.sample 2025-08-15 17:17:21.762879829 +0900 *************** *** 231,237 **** # - Where to log - ! #log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. --- 231,237 ---- # - Where to log - ! log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. *************** *** 305,321 **** # 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 --- 305,321 ---- # 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' # directory where log files are written, # can be absolute ! log_filename = 'pgpool-%a.log' # log file name pattern, # can include strftime() escapes *************** *** 323,329 **** # 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. --- 323,329 ---- # 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. *************** *** 333,343 **** # 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. --- 333,343 ---- # 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.7.0/src/redhat/pgpool.service0000644000175000017500000000057515116217422015172 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.7.0/src/redhat/pgpool_socket_dir.patch0000644000175000017500000000503715116217422017035 00000000000000*** src/sample/pgpool.conf.sample 2025-08-15 11:18:51.825595514 +0900 --- pgpool.conf.sample 2025-08-15 17:04:49.381908570 +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 *************** *** 744,750 **** # 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 --- 744,750 ---- # 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.7.0/src/redhat/pgpool_sudoers.d0000644000175000017500000000011015116217422015502 00000000000000postgres ALL=NOPASSWD: /sbin/ip postgres ALL=NOPASSWD: /usr/sbin/arping pgpool-II-4.7.0/src/redhat/pgpool_tmpfiles.d0000644000175000017500000000004715116217422015652 00000000000000d /run/pgpool 0755 postgres postgres - pgpool-II-4.7.0/src/rewrite/0000755000175000017500000000000015120777676012614 500000000000000pgpool-II-4.7.0/src/rewrite/pool_timestamp.c0000644000175000017500000013712215116217422015721 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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, 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->returningClause, 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->returningClause, 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->returningClause, 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, tree_walker_callback walker, void *context) { #define WALK(n,c) walker((Node *) (n), c) 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 WALK(((RangeVar *) node)->alias, context); case T_GroupingFunc: return WALK(((GroupingFunc *) node)->args, context); case T_SubLink: { SubLink *sublink = (SubLink *) node; if (WALK(sublink->testexpr, context)) return true; /* we assume the operName is not interesting */ if (WALK(sublink->subselect, context)) return true; } break; case T_CaseExpr: { CaseExpr *caseexpr = (CaseExpr *) node; if (WALK(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 (WALK(when->expr, context)) return true; if (WALK(when->result, context)) return true; } if (WALK(caseexpr->defresult, context)) return true; } break; case T_RowExpr: /* Assume colnames isn't interesting */ return WALK(((RowExpr *) node)->args, context); case T_CoalesceExpr: return WALK(((CoalesceExpr *) node)->args, context); case T_MinMaxExpr: return WALK(((MinMaxExpr *) node)->args, context); case T_XmlExpr: { XmlExpr *xexpr = (XmlExpr *) node; if (WALK(xexpr->named_args, context)) return true; /* we assume walker doesn't care about arg_names */ if (WALK(xexpr->args, context)) return true; } break; case T_NullTest: return WALK(((NullTest *) node)->arg, context); case T_BooleanTest: return WALK(((BooleanTest *) node)->arg, context); case T_JoinExpr: { JoinExpr *join = (JoinExpr *) node; if (WALK(join->larg, context)) return true; if (WALK(join->rarg, context)) return true; if (WALK(join->quals, context)) return true; if (WALK(join->alias, context)) return true; /* using list is deemed uninteresting */ } break; case T_IntoClause: { IntoClause *into = (IntoClause *) node; if (WALK(into->rel, context)) return true; /* colNames, options are deemed uninteresting */ /* viewQuery should be null in raw parsetree, but check it */ if (WALK(into->viewQuery, context)) return true; } break; case T_List: foreach(temp, (List *) node) { if (WALK((Node *) lfirst(temp), context)) return true; } break; case T_MergeWhenClause: { MergeWhenClause *mergeWhenClause = (MergeWhenClause *) node; if (WALK(mergeWhenClause->condition, context)) return true; if (WALK(mergeWhenClause->targetList, context)) return true; if (WALK(mergeWhenClause->values, context)) return true; } break; case T_MergeAction: { MergeAction *action = (MergeAction *) node; if (WALK(action->targetList, context)) return true; if (WALK(action->qual, context)) return true; } break; case T_InsertStmt: { InsertStmt *stmt = (InsertStmt *) node; if (WALK(stmt->relation, context)) return true; if (WALK(stmt->cols, context)) return true; if (WALK(stmt->selectStmt, context)) return true; if (WALK(stmt->onConflictClause, context)) return true; if (WALK(stmt->returningClause, context)) return true; if (WALK(stmt->withClause, context)) return true; } break; case T_DeleteStmt: { DeleteStmt *stmt = (DeleteStmt *) node; if (WALK(stmt->relation, context)) return true; if (WALK(stmt->usingClause, context)) return true; if (WALK(stmt->whereClause, context)) return true; if (WALK(stmt->returningClause, context)) return true; if (WALK(stmt->withClause, context)) return true; } break; case T_UpdateStmt: { UpdateStmt *stmt = (UpdateStmt *) node; if (WALK(stmt->relation, context)) return true; if (WALK(stmt->targetList, context)) return true; if (WALK(stmt->whereClause, context)) return true; if (WALK(stmt->fromClause, context)) return true; if (WALK(stmt->returningClause, context)) return true; if (WALK(stmt->withClause, context)) return true; } break; case T_SelectStmt: { SelectStmt *stmt = (SelectStmt *) node; if (WALK(stmt->distinctClause, context)) return true; if (WALK(stmt->intoClause, context)) return true; if (WALK(stmt->targetList, context)) return true; if (WALK(stmt->fromClause, context)) return true; if (WALK(stmt->whereClause, context)) return true; if (WALK(stmt->groupClause, context)) return true; if (WALK(stmt->havingClause, context)) return true; if (WALK(stmt->windowClause, context)) return true; if (WALK(stmt->valuesLists, context)) return true; if (WALK(stmt->sortClause, context)) return true; if (WALK(stmt->limitOffset, context)) return true; if (WALK(stmt->limitCount, context)) return true; if (WALK(stmt->lockingClause, context)) return true; if (WALK(stmt->withClause, context)) return true; if (WALK(stmt->larg, context)) return true; if (WALK(stmt->rarg, context)) return true; } break; case T_A_Expr: { A_Expr *expr = (A_Expr *) node; if (WALK(expr->lexpr, context)) return true; if (WALK(expr->rexpr, context)) return true; /* operator name is deemed uninteresting */ } break; case T_BoolExpr: { BoolExpr *expr = (BoolExpr *) node; if (WALK(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 (WALK(fcall->args, context)) return true; if (WALK(fcall->agg_order, context)) return true; if (WALK(fcall->agg_filter, context)) return true; if (WALK(fcall->over, context)) return true; /* function name is deemed uninteresting */ } break; case T_NamedArgExpr: return WALK(((NamedArgExpr *) node)->arg, context); case T_A_Indices: { A_Indices *indices = (A_Indices *) node; if (WALK(indices->lidx, context)) return true; if (WALK(indices->uidx, context)) return true; } break; case T_A_Indirection: { A_Indirection *indir = (A_Indirection *) node; if (WALK(indir->arg, context)) return true; if (WALK(indir->indirection, context)) return true; } break; case T_A_ArrayExpr: return WALK(((A_ArrayExpr *) node)->elements, context); case T_ResTarget: { ResTarget *rt = (ResTarget *) node; if (WALK(rt->indirection, context)) return true; if (WALK(rt->val, context)) return true; } break; case T_MultiAssignRef: return WALK(((MultiAssignRef *) node)->source, context); case T_TypeCast: { TypeCast *tc = (TypeCast *) node; if (WALK(tc->arg, context)) return true; if (WALK(tc->typeName, context)) return true; } break; case T_CollateClause: return WALK(((CollateClause *) node)->arg, context); case T_SortBy: return WALK(((SortBy *) node)->node, context); case T_WindowDef: { WindowDef *wd = (WindowDef *) node; if (WALK(wd->partitionClause, context)) return true; if (WALK(wd->orderClause, context)) return true; if (WALK(wd->startOffset, context)) return true; if (WALK(wd->endOffset, context)) return true; } break; case T_RangeSubselect: { RangeSubselect *rs = (RangeSubselect *) node; if (WALK(rs->subquery, context)) return true; if (WALK(rs->alias, context)) return true; } break; case T_RangeFunction: { RangeFunction *rf = (RangeFunction *) node; if (WALK(rf->functions, context)) return true; if (WALK(rf->alias, context)) return true; if (WALK(rf->coldeflist, context)) return true; } break; case T_RangeTableSample: { RangeTableSample *rts = (RangeTableSample *) node; if (WALK(rts->relation, context)) return true; /* method name is deemed uninteresting */ if (WALK(rts->args, context)) return true; if (WALK(rts->repeatable, context)) return true; } break; case T_TypeName: { TypeName *tn = (TypeName *) node; if (WALK(tn->typmods, context)) return true; if (WALK(tn->arrayBounds, context)) return true; /* type name itself is deemed uninteresting */ } break; case T_ColumnDef: { ColumnDef *coldef = (ColumnDef *) node; if (WALK(coldef->typeName, context)) return true; if (WALK(coldef->raw_default, context)) return true; if (WALK(coldef->collClause, context)) return true; /* for now, constraints are ignored */ } break; case T_GroupingSet: return WALK(((GroupingSet *) node)->content, context); case T_LockingClause: return WALK(((LockingClause *) node)->lockedRels, context); case T_XmlSerialize: { XmlSerialize *xs = (XmlSerialize *) node; if (WALK(xs->expr, context)) return true; if (WALK(xs->typeName, context)) return true; } break; case T_WithClause: return WALK(((WithClause *) node)->ctes, context); case T_InferClause: { InferClause *stmt = (InferClause *) node; if (WALK(stmt->indexElems, context)) return true; if (WALK(stmt->whereClause, context)) return true; } break; case T_OnConflictClause: { OnConflictClause *stmt = (OnConflictClause *) node; if (WALK(stmt->infer, context)) return true; if (WALK(stmt->targetList, context)) return true; if (WALK(stmt->whereClause, context)) return true; } break; case T_CommonTableExpr: return WALK(((CommonTableExpr *) node)->ctequery, context); default: /* * elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node)); */ break; } return false; } /* from nodeFuncs.c end */ pgpool-II-4.7.0/src/rewrite/pool_lobj.c0000644000175000017500000001640315116217422014642 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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, MAIN_CONNECTION(backend)->keylen, 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.7.0/src/sample/0000755000175000017500000000000015120777677012415 500000000000000pgpool-II-4.7.0/src/sample/scripts/0000755000175000017500000000000015120777677014104 500000000000000pgpool-II-4.7.0/src/sample/scripts/failover.sh.sample0000755000175000017500000000535115120733012017425 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-18 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.7.0/src/sample/scripts/follow_primary.sh.sample0000755000175000017500000001104415120733012020657 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-18 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.7.0/src/sample/scripts/pgpool_remote_start.sample0000755000175000017500000000223715120733012021275 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-18 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.7.0/src/sample/scripts/recovery_1st_stage.sample0000755000175000017500000000616715120733012021023 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-18 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.7.0/src/sample/scripts/replication_mode_recovery_1st_stage.sample0000755000175000017500000000707715120733012024421 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-18 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.7.0/src/sample/scripts/replication_mode_recovery_2nd_stage.sample0000755000175000017500000000347315120733012024371 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-18 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.7.0/src/sample/scripts/escalation.sh.sample0000755000175000017500000000202415116217422017741 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.7.0/src/sample/scripts/aws_eip_if_cmd.sh.sample0000755000175000017500000000300715116217422020551 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.7.0/src/sample/scripts/aws_rtb_if_cmd.sh.sample0000755000175000017500000000477215116217422020575 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.7.0/src/sample/pgpool.pam0000644000175000017500000000005715116217422014314 00000000000000#%PAM-1.0 # create your own PAM configurations pgpool-II-4.7.0/src/sample/pgpool.conf.sample0000644000175000017500000015043315120733012015741 00000000000000# -------------------------------- # Pgpool-II 4.7 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, 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. # (change requires restart) #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 = off # 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) #work_dir = '/tmp' # Directory for pgpool_status and lock files. # (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_database = 'postgres' # Database name for online recovery #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 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.7.0/src/sample/pool_hba.conf.sample0000644000175000017500000000662415116217422016235 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.7.0/src/sample/pcp.conf.sample0000644000175000017500000000153215116217422015225 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.7.0/src/sql/0000755000175000017500000000000015120777677011733 500000000000000pgpool-II-4.7.0/src/sql/pgpool-recovery/0000755000175000017500000000000015120777700015052 500000000000000pgpool-II-4.7.0/src/sql/pgpool-recovery/pgpool-recovery.c0000644000175000017500000002567515116217422020304 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.7.0/src/sql/pgpool-recovery/pgpool-recovery.sql.in0000644000175000017500000000302215116217422021244 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.7.0/src/sql/pgpool-recovery/uninstall_pgpool-recovery.sql0000644000175000017500000000021015116217422022724 00000000000000DROP FUNCTION pgpool_switch_xlog(text); DROP FUNCTION pgpool_remote_start(text, text); DROP FUNCTION pgpool_recovery(text, text, text); pgpool-II-4.7.0/src/sql/pgpool-recovery/pgpool_recovery--1.4.sql0000644000175000017500000000337215116217422021306 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.7.0/src/sql/pgpool-recovery/pgpool_recovery--1.3--1.4.sql0000644000175000017500000000072215116217422021656 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.7.0/src/sql/pgpool-recovery/pgpool_recovery--1.3.sql0000644000175000017500000000271715116217422021307 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.7.0/src/sql/pgpool-recovery/pgpool_recovery--1.2--1.3.sql0000644000175000017500000000067715116217422021665 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.7.0/src/sql/pgpool-recovery/pgpool_recovery--1.2.sql0000644000175000017500000000230615116217422021300 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.7.0/src/sql/pgpool-recovery/pgpool_recovery--1.1--1.2.sql0000644000175000017500000000065515116217422021657 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.7.0/src/sql/pgpool-recovery/pgpool_recovery--1.1.sql0000644000175000017500000000172515116217422021303 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.7.0/src/sql/pgpool-recovery/pgpool_recovery.control0000644000175000017500000000025115116217422021603 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.7.0/src/sql/pgpool-recovery/Makefile0000644000175000017500000000152315116217422016426 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.7.0/src/sql/pgpool-regclass/0000755000175000017500000000000015120777700015017 500000000000000pgpool-II-4.7.0/src/sql/pgpool-regclass/pgpool-regclass.c0000644000175000017500000001206515116217422020203 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.7.0/src/sql/pgpool-regclass/pgpool-regclass.sql.in0000644000175000017500000000017315116217422021162 00000000000000CREATE FUNCTION pg_catalog.pgpool_regclass(cstring) RETURNS oid AS 'MODULE_PATHNAME', 'pgpool_regclass' LANGUAGE C STRICT; pgpool-II-4.7.0/src/sql/pgpool-regclass/uninstall_pgpool-regclass.sql0000644000175000017500000000005015116217422022640 00000000000000DROP FUNCTION pgpool_regclass(cstring); pgpool-II-4.7.0/src/sql/pgpool-regclass/pgpool_regclass--1.0.sql0000644000175000017500000000043315116217422021207 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.7.0/src/sql/pgpool-regclass/pgpool_regclass.control0000644000175000017500000000023015116217422021512 00000000000000# pgpool-regclass extension comment = 'replacement for regclass' default_version = '1.0' module_pathname = '$libdir/pgpool-regclass' relocatable = true pgpool-II-4.7.0/src/sql/pgpool-regclass/Makefile0000644000175000017500000000125015116217422016370 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.7.0/src/sql/pgpool_adm/0000755000175000017500000000000015120777700014037 500000000000000pgpool-II-4.7.0/src/sql/pgpool_adm/pgpool_adm.c0000644000175000017500000006622415116217422016251 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)))); } /** * 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_proc_info(PG_FUNCTION_ARGS) { MemoryContext oldcontext; FuncCallContext *funcctx; int32 nrows; int32 call_cntr; int32 max_calls; AttInMetadata *attinmeta; PCPConnInfo *pcpConnInfo; PCPResultInfo *pcpResInfo; int an; #define NUM_COLS 20 /* number of columns */ /* 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_process_info(pcpConnInfo, 0); 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(NUM_COLS); #else tupdesc = CreateTemplateTupleDesc(NUM_COLS, false); #endif an = 1; TupleDescInitEntry(tupdesc, an++, "database", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "username", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "start_time", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "client_connection_count", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "major", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "minor", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "backend_connection_time", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "client_connection_time", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "client_idle_duration", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "client_disconnection_time", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "pool_counter", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "backend_pid", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "connected", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "pid", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "backend_id", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "status", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "load_balance_node", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "client_host", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "client_port", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, an++, "statement", 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[NUM_COLS]; HeapTuple tuple; Datum result; int i = 0; POOL_REPORT_POOLS *pools = (POOL_REPORT_POOLS *) pcp_get_binary_data(pcpResInfo, call_cntr); values[i++] = pstrdup(pools->database); values[i++] = pstrdup(pools->username); values[i++] = pstrdup(pools->process_start_time); values[i++] = pstrdup(pools->client_connection_count); values[i++] = pstrdup(pools->pool_majorversion); values[i++] = pstrdup(pools->pool_minorversion); values[i++] = pstrdup(pools->backend_connection_time); values[i++] = pstrdup(pools->client_connection_time); values[i++] = pstrdup(pools->client_idle_duration); values[i++] = pstrdup(pools->client_disconnection_time); values[i++] = pstrdup(pools->pool_counter); values[i++] = pstrdup(pools->pool_backendpid); values[i++] = pstrdup(pools->pool_connected); values[i++] = pstrdup(pools->pool_pid); values[i++] = pstrdup(pools->backend_id); values[i++] = pstrdup(pools->status); values[i++] = pstrdup(pools->load_balance_node); values[i++] = pstrdup(pools->client_host); values[i++] = pstrdup(pools->client_port); values[i++] = pstrdup(pools->statement); /* 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); } } pgpool-II-4.7.0/src/sql/pgpool_adm/pgpool_adm.h0000644000175000017500000000207515116217422016250 00000000000000/*------------------------------------------------------------------------- * * pgpool_adm.h * * * Copyright (c) 2002-2025, PostgreSQL Global Development Group * Copyright (c) 2019-2025, PgPool 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); Datum _pcp_proc_info(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); PG_FUNCTION_INFO_V1(_pcp_proc_info); #endif pgpool-II-4.7.0/src/sql/pgpool_adm/pgpool_adm.control0000644000175000017500000000022215116217422017471 00000000000000# pcp extension comment = 'Administrative functions for pgPool' default_version = '1.6' module_pathname = '$libdir/pgpool_adm' relocatable = true pgpool-II-4.7.0/src/sql/pgpool_adm/pgpool_adm--1.1.sql0000644000175000017500000000513515116217422017172 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.0--1.1.sql0000644000175000017500000000143615116217422017543 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.0.sql0000644000175000017500000000501615116217422017167 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.2.sql0000644000175000017500000000523215116217422017171 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.1--1.2.sql0000644000175000017500000000160315116217422017541 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.3.sql0000644000175000017500000001017615116217422017175 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.2--1.3.sql0000644000175000017500000001353715116217422017554 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.4.sql0000644000175000017500000001024415116217422017172 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.3--1.4.sql0000644000175000017500000001515515116217422017554 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.5.sql0000644000175000017500000001026015116217422017171 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.4--1.5.sql0000644000175000017500000000244015116217422017547 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.7.0/src/sql/pgpool_adm/pgpool_adm--1.6.sql0000644000175000017500000001302415116217422017173 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.6.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; /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_proc_info(IN host text, IN port integer, IN username text, IN password text, OUT database text, OUT username text, OUT start_time text, OUT client_connection_count text, OUT major text, OUT minor text, OUT backend_connection_time text, OUT client_connection_time text, OUT client_idle_duration text, OUT client_disconnection_time text, OUT pool_counter text, OUT backend_pid text, OUT connected text, OUT pid text, OUT backend_id text, OUT status text, OUT load_balance_node text, OUT client_host text, OUT client_port text, OUT statement text) RETURNS SETOF record AS 'MODULE_PATHNAME', '_pcp_proc_info' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, pcp_server */ CREATE FUNCTION pcp_proc_info(IN pcp_server text, OUT database text, OUT username text, OUT start_time text, OUT client_connection_count text, OUT major text, OUT minor text, OUT backend_connection_time text, OUT client_connection_time text, OUT client_idle_duration text, OUT client_disconnection_time text, OUT pool_counter text, OUT backend_pid text, OUT connected text, OUT pid text, OUT backend_id text, OUT status text, OUT load_balance_node text, OUT client_host text, OUT client_port text, OUT statement text) RETURNS SETOF record AS 'MODULE_PATHNAME', '_pcp_proc_info' LANGUAGE C VOLATILE STRICT; pgpool-II-4.7.0/src/sql/pgpool_adm/pgpool_adm--1.5--1.6.sql0000644000175000017500000000306115116217422017551 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.5--1.6.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_adm UPDATE TO '1.6'" to load this file. \quit /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_proc_info(IN host text, IN port integer, IN username text, IN password text, OUT database text, OUT username text, OUT start_time text, OUT client_connection_count text, OUT major text, OUT minor text, OUT backend_connection_time text, OUT client_connection_time text, OUT client_idle_duration text, OUT client_disconnection_time text, OUT pool_counter text, OUT backend_pid text, OUT connected text, OUT pid text, OUT backend_id text, OUT status text, OUT load_balance_node text, OUT client_host text, OUT client_port text, OUT statement text) RETURNS SETOF record AS 'MODULE_PATHNAME', '_pcp_proc_info' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, pcp_server */ CREATE FUNCTION pcp_proc_info(IN pcp_server text, OUT database text, OUT username text, OUT start_time text, OUT client_connection_count text, OUT major text, OUT minor text, OUT backend_connection_time text, OUT client_connection_time text, OUT client_idle_duration text, OUT client_disconnection_time text, OUT pool_counter text, OUT backend_pid text, OUT connected text, OUT pid text, OUT backend_id text, OUT status text, OUT load_balance_node text, OUT client_host text, OUT client_port text, OUT statement text) RETURNS SETOF record AS 'MODULE_PATHNAME', '_pcp_proc_info' LANGUAGE C VOLATILE STRICT; pgpool-II-4.7.0/src/sql/pgpool_adm/Makefile0000644000175000017500000000200615116217422015410 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 \ pgpool_adm--1.6.sql pgpool_adm--1.5--1.6.sql SHLIB_LINK = -L../../libs/pcp/.libs -lpcp # 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.7.0/src/sql/Makefile0000644000175000017500000000257715116217422013304 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.7.0/src/sql/insert_lock.sql0000644000175000017500000000115115116217422014664 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.7.0/src/streaming_replication/0000755000175000017500000000000015120777676015515 500000000000000pgpool-II-4.7.0/src/streaming_replication/pool_worker_child.c0000644000175000017500000004715715116217422021303 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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 *params) { 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(); /* * 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; 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()); if (strcmp("", pool_config->pool_passwd)) pool_reopen_passwd_file(); 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.7.0/src/test/0000755000175000017500000000000015120777701012077 500000000000000pgpool-II-4.7.0/src/test/C/0000755000175000017500000000000015120777701012261 500000000000000pgpool-II-4.7.0/src/test/C/Makefile0000644000175000017500000000054315116217422013635 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.7.0/src/test/C/test_extended.c0000644000175000017500000000474115116217422015204 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.7.0/src/test/parser/0000755000175000017500000000000015120777701013373 500000000000000pgpool-II-4.7.0/src/test/parser/expected/0000755000175000017500000000000015120777701015174 500000000000000pgpool-II-4.7.0/src/test/parser/expected/copy.out0000644000175000017500000000106615116217422016614 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.7.0/src/test/parser/expected/create.out0000644000175000017500000000637515116217422017115 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.7.0/src/test/parser/expected/cursor.out0000644000175000017500000000200015116217422017144 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.7.0/src/test/parser/expected/delete.out0000644000175000017500000000104215116217422017076 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.7.0/src/test/parser/expected/drop.out0000644000175000017500000000061715116217422016607 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.7.0/src/test/parser/expected/insert.out0000644000175000017500000000111415116217422017140 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.7.0/src/test/parser/expected/misc.out0000644000175000017500000000055715116217422016601 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.7.0/src/test/parser/expected/prepare.out0000644000175000017500000000016615116217422017300 00000000000000PREPARE "xx" (int4,"text") AS INSERT INTO "foo" VALUES ($1,$2) EXECUTE "xx" (1,'xxx') DEALLOCATE "xx" DEALLOCATE "xx" pgpool-II-4.7.0/src/test/parser/expected/privileges.out0000644000175000017500000000337415116217422020017 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.7.0/src/test/parser/expected/scanner.out0000644000175000017500000000105515116217422017271 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.7.0/src/test/parser/expected/select.out0000644000175000017500000000765215116217422017130 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.7.0/src/test/parser/expected/transaction.out0000644000175000017500000000201415116217422020161 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.7.0/src/test/parser/expected/update.out0000644000175000017500000000072415116217422017124 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.7.0/src/test/parser/expected/v84.out0000644000175000017500000000332315116217422016261 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.7.0/src/test/parser/expected/v90.out0000644000175000017500000000224015116217422016253 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.7.0/src/test/parser/expected/var.out0000644000175000017500000000063115116217422016427 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.7.0/src/test/parser/input/0000755000175000017500000000000015120777701014532 500000000000000pgpool-II-4.7.0/src/test/parser/input/alter.sql0000644000175000017500000000006215116217422016272 00000000000000ALTER TABLE foo ; ALTER TEXT SEARCH CONFIGURATION pgpool-II-4.7.0/src/test/parser/input/copy.sql0000644000175000017500000000101315116217422016132 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.7.0/src/test/parser/input/create.sql0000644000175000017500000000553315116217422016436 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.7.0/src/test/parser/input/cursor.sql0000644000175000017500000000162015116217422016501 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.7.0/src/test/parser/input/delete.sql0000644000175000017500000000074715116217422016437 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.7.0/src/test/parser/input/drop.sql0000644000175000017500000000054615116217422016136 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.7.0/src/test/parser/input/insert.sql0000644000175000017500000000100315116217422016463 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.7.0/src/test/parser/input/misc.sql0000644000175000017500000000102615116217422016117 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.7.0/src/test/parser/input/prepare.sql0000644000175000017500000000017215116217422016623 00000000000000PREPARE xx(integer, text) AS INSERT INTO foo VALUES ($1, $2); EXECUTE xx(1, 'xxx'); DEALLOCATE xx; DEALLOCATE PREPARE xx; pgpool-II-4.7.0/src/test/parser/input/privileges.sql0000644000175000017500000000311015116217422017331 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.7.0/src/test/parser/input/scanner.sql0000644000175000017500000000155315116217422016622 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.7.0/src/test/parser/input/select.sql0000644000175000017500000000675015116217422016454 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.7.0/src/test/parser/input/transaction.sql0000644000175000017500000000201315116217422017506 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.7.0/src/test/parser/input/update.sql0000644000175000017500000000061315116217422016447 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.7.0/src/test/parser/input/v84.sql0000644000175000017500000000304315116217422015606 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.7.0/src/test/parser/input/v90.sql0000644000175000017500000000250015116217422015600 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.7.0/src/test/parser/input/var.sql0000644000175000017500000000063515116217422015761 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.7.0/src/test/parser/.cvsignore0000644000175000017500000000006315116217422015304 00000000000000gram.c parse.h parser-test scan.c test.diff result pgpool-II-4.7.0/src/test/parser/Makefile0000644000175000017500000000402015116217422014741 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.7.0/src/test/parser/README0000644000175000017500000000113115116217422014161 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.7.0/src/test/parser/main.c0000644000175000017500000000322015116217422014372 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.7.0/src/test/parser/pool.h0000644000175000017500000000020115116217422014420 00000000000000#ifndef POOL_H #define POOL_H #include #include #define pool_error printf #define child_exit exit #endif pgpool-II-4.7.0/src/test/parser/run-test0000644000175000017500000000224215116217422015011 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.7.0/src/test/parser/parse_schedule0000644000175000017500000000015415116217422016216 00000000000000select insert update delete misc var copy privileges transaction cursor prepare create drop scanner v84 v90 pgpool-II-4.7.0/src/test/pdo-test/0000755000175000017500000000000015120777701013636 500000000000000pgpool-II-4.7.0/src/test/pdo-test/SQLlist/0000755000175000017500000000000015120777701015171 500000000000000pgpool-II-4.7.0/src/test/pdo-test/SQLlist/test1.sql0000644000175000017500000000002615116217422016662 00000000000000BEGIN; SELECT 1; END; pgpool-II-4.7.0/src/test/pdo-test/SQLlist/test2.sql0000644000175000017500000000002615116217422016663 00000000000000BEGIN; select 2; END; pgpool-II-4.7.0/src/test/pdo-test/mod/0000755000175000017500000000000015120777701014415 500000000000000pgpool-II-4.7.0/src/test/pdo-test/mod/database.inc0000644000175000017500000000144315116217422016570 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.7.0/src/test/pdo-test/mod/errorhandler.inc0000644000175000017500000000147015116217422017513 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.7.0/src/test/pdo-test/README.euc_jp0000644000175000017500000000314015116217422015672 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.7.0/src/test/pdo-test/collections.inc0000644000175000017500000000040115116217422016554 00000000000000"; } return $result; } ?> pgpool-II-4.7.0/src/test/pdo-test/def.inc0000644000175000017500000000022215116217422014775 00000000000000 pgpool-II-4.7.0/src/test/pdo-test/pdotest.php0000644000175000017500000000033115116217422015740 00000000000000 pgpool-II-4.7.0/src/test/pdo-test/regsql.inc0000644000175000017500000000171615116217422015545 00000000000000"; trans_end($con,$sql); } } ?> pgpool-II-4.7.0/src/test/pgpool_setup.in0000644000175000017500000013537315120733022015067 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 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 directories PGSOCKET_DIR=${PGSOCKET_DIR:-"/tmp,/var/run/postgresql"} # remove inaccessible diretories from PGSOCKET_DIR tmp=`echo $PGSOCKET_DIR|sed "s/,/ /"` dir="" first=true for i in $tmp do if [ -w $i ];then if [ $first != "true" ];then dir="$dir,$i" else dir=$i fi fi first=false done PGSOCKET_DIR=$dir # 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|grep -E "[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 echo psql -p $new_main_port_number -c "CHECKPOINT" postgres psql -p $new_main_port_number -c "CHECKPOINT" postgres 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 pg_rewind=__PGBIN__/pg_rewind PCP_PORT=__PCPPORT__ pgversion=__PGVERSION__ export PCPPASSFILE=__PCPPASSFILE__ PGPOOL_BIN=__PGPOOL_INSTALL_DIR__/bin PGSUPERUSER=__PGSUPERUSER__ 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 # we need to restore WAL from old primay while running pg_rewind cp $db_cluster/myrecovery.conf /tmp/myrecovery.rewind.conf sed -i "/restore_command/s/data[0-9]/data$old_primary_node_id/" /tmp/myrecovery.rewind.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 echo "stopping the target server" >> $log $pg_ctl -w -m f -D $db_cluster stop >> $log 2>&1 # Make backup copy of postgresql.conf since pg_rewind/pg_basebackup unconditionally copies # $main_db_cluster/postgresql.conf. cp $db_cluster/postgresql.conf /tmp/ cp $db_cluster/myrecovery.conf /tmp/ # Run pg_rewind echo "pg_rewind starts" >> $log echo $pg_rewind -P -c --config-file=/tmp/myrecovery.rewind.conf -D $db_cluster --source-server="host=localhost port=$new_primary_port_number user=$PGSUPERUSER dbname=postgres" >> $log $pg_rewind -P -c --config-file=/tmp/myrecovery.rewind.conf -D $db_cluster --source-server="host=localhost port=$new_primary_port_number user=$PGSUPERUSER dbname=postgres" >> $log 2>&1 cp /tmp/postgresql.conf $db_cluster/ cp /tmp/myrecovery.conf $db_cluster/ touch $db_cluster/standby.signal echo "start the target server" >> $log $pg_ctl -w -m f -D $db_cluster start >> $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@" \ -e "/__PGSUPERUSER__/s/__PGSUPERUSER__/$WHOAMI/" \ $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_database = 'template1'" >> $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 "work_dir = '$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.7.0/src/test/watchdog_setup.in0000644000175000017500000002422615116217422015367 00000000000000#!/usr/bin/env bash # # Copyright (c) 2013-2025 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][-vip [ip]][-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. # -vip [ip]: allow to assign "ip" being set to delegate_ip. If "ip" is omitted, "127.0.0.1" is assumed. #------------------------------------------- # 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 # default vip DEFAULT_VIP="127.0.0.1" #------------------------------------------- # 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_database = 'template1'" >> $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 if [ "$VIP" != "" ];then echo "delegate_ip = '$VIP'" >> $conf echo "if_up_cmd = '/usr/bin/echo \"if_up_cmd executed\"'" >> $conf echo "if_down_cmd = 'usr/bin/echo \"if_down_cmd executed\"'" >> $conf echo "arping_cmd = '/usr/bin/true'" >> $conf fi 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] -vip [ip]] [-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][-vip [ip]][-d] #------------------------------------------- # # default mode is streaming replication mode MODE="s" NO_STOP="false" VIP="" 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 = "-vip" ];then if [ $# = 1 ];then # there's no more argument. set the default vip VIP=$DEFAULT_VIP else if [[ $2 =~ -.* ]];then # next argument given. set the default vip VIP=$DEFAULT_VIP else # VIP is specified shift VIP=$1 fi fi elif [ $1 = "-d" ];then export PGPOOLDEBUG="true" 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.7.0/src/test/regression/0000755000175000017500000000000015116217422014251 500000000000000pgpool-II-4.7.0/src/test/regression/.gitignore0000644000175000017500000000232415116217422016162 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.7.0/src/test/regression/README0000644000175000017500000000271415116217422015055 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.7.0/src/test/regression/clean.sh0000644000175000017500000000242215116217422015607 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.7.0/src/test/regression/libs.sh0000644000175000017500000000260615116217422015462 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.7.0/src/test/regression/regress.sh0000755000175000017500000001447315116217422016213 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,/var/run/postgresql 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 # skip if it's not a directory if [ ! -d $i ];then continue; fi 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.7.0/src/test/regression/tests/0000755000175000017500000000000015116217422015413 500000000000000pgpool-II-4.7.0/src/test/regression/tests/011.watchdog_quorum_failover/0000755000175000017500000000000015116217422023012 500000000000000pgpool-II-4.7.0/src/test/regression/tests/011.watchdog_quorum_failover/.gitignore0000644000175000017500000000003315116217422024716 00000000000000leader/ standby/ standby2/ pgpool-II-4.7.0/src/test/regression/tests/011.watchdog_quorum_failover/leader.conf0000644000175000017500000000065615116217422025044 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.7.0/src/test/regression/tests/011.watchdog_quorum_failover/standby.conf0000644000175000017500000000071515116217422025250 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.7.0/src/test/regression/tests/011.watchdog_quorum_failover/standby2.conf0000644000175000017500000000071615116217422025333 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.7.0/src/test/regression/tests/011.watchdog_quorum_failover/test.sh0000755000175000017500000001457715116217422024266 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 "work_dir = $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 "work_dir = $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.7.0/src/test/regression/tests/024.cert_auth/0000755000175000017500000000000015116217422017675 500000000000000pgpool-II-4.7.0/src/test/regression/tests/024.cert_auth/cert.sh0000755000175000017500000000505015116217422021111 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.7.0/src/test/regression/tests/038.pcp_commands/0000755000175000017500000000000015116217422020367 500000000000000pgpool-II-4.7.0/src/test/regression/tests/038.pcp_commands/expected0000644000175000017500000000032315116217422022031 00000000000000CREATE EXTENSION database | status | case | statement ----------+-----------------+-----------+-------------------- test | Execute command | localhost | SELECT pg_sleep(1) (1 row) pgpool-II-4.7.0/src/test/regression/tests/038.pcp_commands/test.sh0000755000175000017500000000403115116217422021623 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 # # test for pcp_proc_info, pgpool_adm: pcp_proc_info WHOAMI=`whoami` ./shutdownall ./startall wait_for_pgpool_startup $PSQL -a -h localhost -c "SELECT pg_sleep(1)" test & $PSQL -h localhost test > result 2>&1 < '', port => $PCP_PORT, username => '$WHOAMI', password => '$WHOAMI') WHERE connected = '1' AND backend_id = '0' AND statement = 'SELECT pg_sleep(1)' EOF if [ $? != 0 ];then r2=fail echo "test2 failed" else cmp ../expected result if [ $? != 0 ];then r2=fail echo "test2 failed" else r2=ok fi fi wait ./shutdownall if [ $r1 = ok -a $r2 = ok ]; then echo "all test succeeded" exit 0 else echo "some tests failed" echo "test1: $r1" echo "test2: $r2" exit 1 fi pgpool-II-4.7.0/src/test/regression/tests/111.cancel_query/0000755000175000017500000000000015116217422020366 500000000000000pgpool-II-4.7.0/src/test/regression/tests/111.cancel_query/.gitignore0000644000175000017500000000001115116217422022266 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/111.cancel_query/test.sh0000755000175000017500000000151515116217422021626 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.7.0/src/test/regression/tests/125.detach_primary_left_down_node/0000755000175000017500000000000015116217422023762 500000000000000pgpool-II-4.7.0/src/test/regression/tests/125.detach_primary_left_down_node/test.sh0000755000175000017500000000176315116217422025227 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=120 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.7.0/src/test/regression/tests/002.native_replication/0000755000175000017500000000000015116217422021572 500000000000000pgpool-II-4.7.0/src/test/regression/tests/002.native_replication/.gitignore0000644000175000017500000000001115116217422023472 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/002.native_replication/PgTester.java0000644000175000017500000000240715116217422024115 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.7.0/src/test/regression/tests/002.native_replication/create.sql0000644000175000017500000000015715116217422023501 00000000000000CREATE TABLE sequencetester ( id serial NOT NULL, recordno integer, CONSTRAINT sq_pk PRIMARY KEY (id ) ) pgpool-II-4.7.0/src/test/regression/tests/002.native_replication/test.sh0000755000175000017500000000505315116217422023033 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.7.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/0000755000175000017500000000000015116217422025433 500000000000000pgpool-II-4.7.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/.gitignore0000644000175000017500000000003315116217422027337 00000000000000leader/ standby/ standby2/ pgpool-II-4.7.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/leader.conf0000644000175000017500000000107515116217422027461 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.7.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/standby.conf0000644000175000017500000000113415116217422027665 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.7.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/standby2.conf0000644000175000017500000000113515116217422027750 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.7.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/test.sh0000755000175000017500000001313515116217422026674 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 "work_dir = $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 "work_dir = $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.7.0/src/test/regression/tests/025.enable_shared_relcache/0000755000175000017500000000000015116217422022322 500000000000000pgpool-II-4.7.0/src/test/regression/tests/025.enable_shared_relcache/test.sh0000755000175000017500000000272115116217422023562 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.7.0/src/test/regression/tests/039.log_backend_messages/0000755000175000017500000000000015116217422022044 500000000000000pgpool-II-4.7.0/src/test/regression/tests/039.log_backend_messages/expected.i0000644000175000017500000000526715116217422023751 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.7.0/src/test/regression/tests/039.log_backend_messages/expected.n0000644000175000017500000000526715116217422023756 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.7.0/src/test/regression/tests/039.log_backend_messages/expected.s0000644000175000017500000000540215116217422023752 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.7.0/src/test/regression/tests/039.log_backend_messages/pgproto.data0000644000175000017500000000010115116217422024301 00000000000000'P' "" "SELECT * FROM t1" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.7.0/src/test/regression/tests/039.log_backend_messages/test.sh0000755000175000017500000000376615116217422023316 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 send read 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. # We set synchronous_commit = remote_apply, and synchronous_standby_names = 'server1' # in streaming replication mode so that updation to primary is replicated to standby with no lag. cat >> etc/pgpool.conf <> data0/postgresql.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.7.0/src/test/regression/tests/112.select_error_hangs/0000755000175000017500000000000015116217422021565 500000000000000pgpool-II-4.7.0/src/test/regression/tests/112.select_error_hangs/.gitignore0000644000175000017500000000001115116217422023465 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/112.select_error_hangs/test.sh0000755000175000017500000000221115116217422023017 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.7.0/src/test/regression/tests/126.copy_hang/0000755000175000017500000000000015116217422017671 500000000000000pgpool-II-4.7.0/src/test/regression/tests/126.copy_hang/copy-out-expected0000644000175000017500000000146215116217422023115 00000000000000FE=> Query (query="CREATE TEMP TABLE copy_in_test AS SELECT I FROM generate_series(1,10) AS i") <= BE CommandComplete(SELECT 10) <= BE ReadyForQuery(I) FE=> Query (query="SELECT * FROM copy_in_test") <= BE RowDescription <= BE DataRow <= BE DataRow <= BE DataRow <= BE DataRow <= BE DataRow <= BE DataRow <= BE DataRow <= BE DataRow <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 10) <= BE ReadyForQuery(I) FE=> Parse(stmt="", query="COPY copy_in_test TO STDOUT") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE CopyOutResponse <= BE CopyData <= BE CopyData <= BE CopyData <= BE CopyData <= BE CopyData <= BE CopyData <= BE CopyData <= BE CopyData <= BE CopyData <= BE CopyData <= BE CopyDone <= BE CommandComplete(COPY 10) <= BE ReadyForQuery(I) pgpool-II-4.7.0/src/test/regression/tests/126.copy_hang/pgproto-copy-out.data0000644000175000017500000000030215116217422023706 00000000000000'Q' "CREATE TEMP TABLE copy_in_test AS SELECT I FROM generate_series(1,10) AS i" 'Y' 'Q' "SELECT * FROM copy_in_test" 'Y' 'P' "" "COPY copy_in_test TO STDOUT" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' pgpool-II-4.7.0/src/test/regression/tests/126.copy_hang/pgproto.data0000644000175000017500000000013515116217422022135 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.7.0/src/test/regression/tests/126.copy_hang/test.sh0000755000175000017500000000373615116217422021140 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 <> etc/pgpool.conf echo "backend_weight2 = 0" >> etc/pgpool.conf # reload pgpool.conf and wait until the effect is apparent ./pgpool_reload sleep 1 # run test script $PGPROTO -d test -f ../pgproto-copy-out.data > copy-out-result 2>&1 cmp ../copy-out-expected copy-out-result if [ ! $? -eq 0 ];then ./shutdownall exit 1 fi ./shutdownall pgpool-II-4.7.0/src/test/regression/tests/003.failover/0000755000175000017500000000000015116217422017523 500000000000000pgpool-II-4.7.0/src/test/regression/tests/003.failover/.gitignore0000644000175000017500000000001115116217422021423 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/003.failover/create_expected.sql0000644000175000017500000000177015116217422023315 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.7.0/src/test/regression/tests/003.failover/create_expected_node0.sql0000644000175000017500000000177015116217422024402 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.7.0/src/test/regression/tests/003.failover/test.sh0000755000175000017500000000331315116217422020761 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.7.0/src/test/regression/tests/013.watchdog_failover_require_consensus/0000755000175000017500000000000015116217422025240 500000000000000pgpool-II-4.7.0/src/test/regression/tests/013.watchdog_failover_require_consensus/.gitignore0000644000175000017500000000003315116217422027144 00000000000000leader/ standby/ standby2/ pgpool-II-4.7.0/src/test/regression/tests/013.watchdog_failover_require_consensus/leader.conf0000644000175000017500000000107415116217422027265 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.7.0/src/test/regression/tests/013.watchdog_failover_require_consensus/standby.conf0000644000175000017500000000113315116217422027471 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.7.0/src/test/regression/tests/013.watchdog_failover_require_consensus/standby2.conf0000644000175000017500000000113415116217422027554 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.7.0/src/test/regression/tests/013.watchdog_failover_require_consensus/test.sh0000755000175000017500000001375115116217422026505 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 "work_dir = $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 "work_dir = $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.7.0/src/test/regression/tests/026.temp_table/0000755000175000017500000000000015116217422020035 500000000000000pgpool-II-4.7.0/src/test/regression/tests/026.temp_table/expected.txt0000644000175000017500000000240215116217422022315 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.7.0/src/test/regression/tests/026.temp_table/temp_table.sql0000644000175000017500000000153515116217422022616 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.7.0/src/test/regression/tests/026.temp_table/test.sh0000755000175000017500000000141115116217422021270 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.7.0/src/test/regression/tests/040.client_auth/0000755000175000017500000000000015116217422020214 500000000000000pgpool-II-4.7.0/src/test/regression/tests/040.client_auth/client_auth_2node.csv0000644000175000017500000000723415116217422024245 00000000000000username,pool_hba.conf,allow_clear_text_frontend_auth,pool_passwd,pg_hba.conf,expected,comment scram1,scram,off,AES,scram,ok, scram2,scram,off,AES,md5,ok, scram3,scram,off,AES,password,ok, scram4,scram,off,AES,pam,ok, scram5,scram,off,AES,ldap,ok, scram6,scram,off,md5,scram,fail, scram7,scram,off,md5,md5,fail, scram8,scram,off,md5,password,fail, scram9,scram,off,md5,pam,fail, scram10,scram,off,md5,ldap,fail, scram11,scram,off,text,scram,ok, scram12,scram,off,text,md5,ok, scram13,scram,off,text,password,ok, scram14,scram,off,text,pam,ok, scram15,scram,off,text,ldap,ok, scram16,scram,off,off,scram,fail, scram17,scram,off,off,md5,fail, scram18,scram,off,off,password,fail, scram19,scram,off,off,pam,fail, scram20,scram,off,off,ldap,fail, md51,md5,off,AES,scram,ok, md52,md5,off,AES,md5,ok, md53,md5,off,AES,password,ok, md54,md5,off,AES,pam,ok, md55,md5,off,AES,ldap,ok, md56,md5,off,md5,scram,fail, md57,md5,off,md5,md5,ok, md58,md5,off,md5,password,fail, md59,md5,off,md5,pam,fail, md510,md5,off,md5,ldap,fail, md511,md5,off,text,scram,ok, md512,md5,off,text,md5,ok, md513,md5,off,text,password,ok, md514,md5,off,text,pam,ok, md515,md5,off,text,ldap,ok, md516,md5,off,off,scram,fail, md517,md5,off,off,md5,fail, md518,md5,off,off,password,fail, md519,md5,off,off,pam,fail, md520,md5,off,off,ldap,fail, p1,password,off,AES,scram,ok, p2,password,off,AES,md5,ok, p3,password,off,AES,password,ok, p4,password,off,AES,pam,ok, p5,password,off,AES,ldap,ok, p6,password,off,md5,scram,fail, p7,password,off,md5,md5,ok, p8,password,off,md5,password,fail, p9,password,off,md5,pam,fail, p10,password,off,md5,ldap,fail, p11,password,off,text,scram,ok, p12,password,off,text,md5,ok, p13,password,off,text,password,ok, p14,password,off,text,pam,ok, p15,password,off,text,ldap,ok, p16,password,off,off,scram,ok, p17,password,off,off,md5,ok, p18,password,off,off,password,ok, p19,password,off,off,pam,ok, p20,password,off,off,ldap,ok, o1,off,on,off,scram,ok, o2,off,on,off,md5,ok, o3,off,on,off,password,ok, o4,off,on,off,pam,ok, o5,off,on,off,ldap,ok, o6,off,off,AES,scram,ok, o7,off,off,AES,md5,ok, o8,off,off,AES,password,ok, o9,off,off,AES,pam,ok, o10,off,off,AES,ldap,ok, o11,off,off,md5,scram,fail, o12,off,off,md5,md5,ok, o13,off,off,md5,password,fail, o14,off,off,md5,pam,fail, o15,off,off,md5,ldap,fail, o16,off,off,text,scram,ok, o17,off,off,text,md5,ok, o18,off,off,text,password,ok, o19,off,off,text,pam,ok, o20,off,off,text,ldap,ok, o21,off,off,off,scram,fail, o22,off,off,off,md5,fail, o23,off,off,off,password,ok, o24,off,off,off,pam,ok, o25,off,off,off,ldap,ok, pam1,pam,off,AES,scram,ok, pam2,pam,off,AES,md5,ok, pam3,pam,off,AES,password,ok, pam4,pam,off,AES,pam,ok, pam5,pam,off,AES,ldap,ok, pam6,pam,off,md5,scram,fail, pam7,pam,off,md5,md5,ok, pam8,pam,off,md5,password,fail, pam9,pam,off,md5,pam,fail, pam10,pam,off,md5,ldap,fail, pam11,pam,off,text,scram,ok, pam12,pam,off,text,md5,ok, pam13,pam,off,text,password,ok, pam14,pam,off,text,pam,ok, pam15,pam,off,text,ldap,ok, pam16,pam,off,off,scram,fail, pam17,pam,off,off,md5,fail, pam18,pam,off,off,password,fail, pam19,pam,off,off,pam,fail, pam20,pam,off,off,ldap,fail, ldap1,ldap,off,AES,scram,ok, ldap2,ldap,off,AES,md5,ok, ldap3,ldap,off,AES,password,ok, ldap4,ldap,off,AES,pam,ok, ldap5,ldap,off,AES,ldap,ok, ldap6,ldap,off,md5,scram,fail, ldap7,ldap,off,md5,md5,ok, ldap8,ldap,off,md5,password,fail, ldap9,ldap,off,md5,pam,fail, ldap10,ldap,off,md5,ldap,fail, ldap11,ldap,off,text,scram,ok, ldap12,ldap,off,text,md5,ok, ldap13,ldap,off,text,password,ok, ldap14,ldap,off,text,pam,ok, ldap15,ldap,off,text,ldap,ok, ldap16,ldap,off,off,scram,fail, ldap17,ldap,off,off,md5,fail, ldap18,ldap,off,off,password,fail, ldap19,ldap,off,off,pam,fail, ldap20,ldap,off,off,ldap,fail, pgpool-II-4.7.0/src/test/regression/tests/040.client_auth/create_ldap_user.sh0000755000175000017500000000056015116217422023775 00000000000000#! /usr/bin/bash # Create input file for ldapadd command to stdout. # Users' list must be provided from stdin. if [ $# -ne 0 ];then echo "usage: $0" exit 1 fi while read username do cat <> $USERS done pgpool-II-4.7.0/src/test/regression/tests/040.client_auth/del_ldap_users.sh0000755000175000017500000000031615116217422023460 00000000000000#! /usr/bin/bash # read users list from stdin and perform ldapdelete command. PASSWORD=ldapadmin set -e while read i do ldapdelete -x -w $PASSWORD -D cn=admin,dc=nodomain uid=$i,ou=people,dc=nodomain done pgpool-II-4.7.0/src/test/regression/tests/040.client_auth/del_pam_users.sh0000755000175000017500000000020015116217422023305 00000000000000#! /usr/bin/bash # read users list from stdin and perform userdel command. set -e while read i do /usr/sbin/userdel $i done pgpool-II-4.7.0/src/test/regression/tests/040.client_auth/list_ldap_user.sh0000755000175000017500000000052715116217422023510 00000000000000#! /usr/bin/bash # List up user names used in the LDAP authentication test. # The result is put to stdout. spec=client_auth_2node.csv IFS="," cat $spec|while read line do set $line if [ $1 != 'username' ];then username=$1 pool_hba=$2 pg_hba=$5 if [ $pool_hba = "ldap" -o $pg_hba = "ldap" ];then echo $username fi fi done pgpool-II-4.7.0/src/test/regression/tests/040.client_auth/list_pam_user.sh0000755000175000017500000000046515116217422023346 00000000000000#! /usr/bin/bash # List up user names used in the PAM authentication test. spec=client_auth_2node.csv IFS="," cat $spec|while read line do set $line if [ $1 != 'username' ];then username=$1 pool_hba=$2 pg_hba=$5 if [ $pool_hba = "pam" -o $pg_hba = "pam" ];then echo $username fi fi done pgpool-II-4.7.0/src/test/regression/tests/040.client_auth/pam_users.txt0000644000175000017500000000033515116217422022674 00000000000000scram4 scram9 scram14 scram19 md54 md59 md514 md519 p4 p9 p14 p19 o4 o9 o14 o19 o24 pam1 pam2 pam3 pam4 pam5 pam6 pam7 pam8 pam9 pam10 pam11 pam12 pam13 pam14 pam15 pam16 pam17 pam18 pam19 pam20 ldap4 ldap9 ldap14 ldap19 pgpool-II-4.7.0/src/test/regression/tests/040.client_auth/test.sh0000755000175000017500000003611315116217422021456 00000000000000#!/usr/bin/bash #------------------------------------------------------------------- # test script for client authentication # # This test is only valid with PostgreSQL 10 or later. if [ $PGVERSION -le 9 ];then echo "all tests skipped due to PostgreSQL version: $PGVERSION" exit 0 fi # -------------------------------------------------------------------- # PAM authentication tests are not performed by default. In order to # test PAM authentication (both frontend and backend), run following # scripts here (040.client_auth). # # Create pam users list. # $ ./list_pam_user.sh > pam_users.txt # # Create input file for newusers command. # The result file is newusers_input.txt. # $ ./create_pam_user.sh pam_users.txt # # Finally run newusers command as root. # the users are not allowed to login (login shell is /usr/sbin/nologin) # /usr/sbin/newusers newusers_input.txt # # Note that newusers just ignore users that are already registered in # the system. So it is harmless to generate new newusers_input.txt and # run newusers command. It will happily register new users. # # Then set the environment variable DO_PAM_TEST to "true". # if [ "$DO_PAM_TEST" != "true" ];then echo "all pam tests will be skipped" fi # -------------------------------------------------------------------- # LDAP authentication tests are not performed by default. In order to # test LDAP authentication (both frontend and backend), run following # scripts here (040.client_auth). The procedure below assumes that # LDAP server is created on localhost, with LDAP admin name is # "admin", domain is "nodomain". # # To create LDAP ldif file, run: # $ cat client_auth_2node.csv|./list_ldap_user.sh|./create_ldap_user.sh > ldap_users.ldif # # Then run ldapadd command. # ldapadd -x -D cn=admin,dc=nodomain -W -f ldap_users.ldif # # Set the environment variable DO_LDAP_TEST to "true". # if [ "$DO_LDAP_TEST" != "true" ];then echo "all ldap tests will be skipped" fi # -------------------------------------------------------------------- # Function declarations # create user # $1: username # $2: "scram", "md5", "password", "pam" or "ldap". # $3: port # If "password" is specified, encryption method becomes 'scram-sha-256'. function add_user() { createuser -p $3 $1 if [ $2 = "scram" ];then psql -p $3 -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ $2 = "md5" ];then psql -p $3 -c "SET password_encryption = 'md5'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ $2 = "password" ];then psql -p $3 -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ "$DO_PAM_TEST" = "true" -a $2 = "pam" ];then psql -p $3 -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ "$DO_PAM_TEST" != "true" -a $2 = "pam" ];then echo "do nothing because DO_PAM_TEST is not true and auth method is pam" elif [ "$DO_LDAP_TEST" = "true" -a $2 = "ldap" ];then psql -p $3 -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ "$DO_LDAP_TEST" != "true" -a $2 = "ldap" ];then echo "do nothing because DO_LDAP_TEST is not true and auth method is ldap" else echo "wrong auth method \"$2\" for add_user $1" exit 1 fi } # create pool_hba.conf entry # $1: username # $2: auth method for pool_hba.conf # "scram", "md5" or "password" # $3: pgpool major version first digit (e.g. "4") function add_pool_hba() { # "scram-sha-256" is only supported in pgpool version 4.0 or later if [ $3 -gt 3 -a $2 = "scram" ];then echo "host all $1 127.0.0.1/32 scram-sha-256" >> $POOL_HBA echo "host all $1 ::1/128 scram-sha-256" >> $POOL_HBA elif [ $2 = "md5" ];then echo "host all $1 127.0.0.1/32 md5" >> $POOL_HBA echo "host all $1 ::1/128 md5" >> $POOL_HBA elif [ "$DO_PAM_TEST" = "true" -a $2 = "pam" ];then echo "host all $1 127.0.0.1/32 pam" >> $POOL_HBA echo "host all $1 ::1/128 pam" >> $POOL_HBA elif [ "$DO_PAM_TEST" != "true" -a $2 = "pam" ];then echo "do nothing because DO_PAM_TEST is not true and auth method is pam" elif [ "$DO_LDAP_TEST" = "true" -a $2 = "ldap" ];then echo "host all $1 127.0.0.1/32 ldap ldapserver=localhost ldapbasedn="dc=nodomain" ldapsearchattribute=uid" >> $POOL_HBA echo "host all $1 ::1/128 ldap ldapserver=localhost ldapbasedn="dc=nodomain" ldapsearchattribute=uid" >> $POOL_HBA elif [ "$DO_LDAP_TEST" != "true" -a $2 = "ldap" ];then echo "do nothing because DO_LDAP_TEST is not true and auth method is ldap" # "password" is only supported in pgpool version 4.0 or later elif [ $3 -gt 3 -a $2 = "password" ];then echo "host all $1 127.0.0.1/32 password" >> $POOL_HBA echo "host all $1 ::1/128 password" >> $POOL_HBA else echo "skip adding to pool_hba.conf" fi } # create pool_passwd entry # $1: username (also password) # $2: encryption method (AES, md5 or text) # $3: pgpool major version first digit (e.g. "4") function add_pool_passwd() { # "AES" is only supported in pgpool version 4.0 or later if [ $3 -gt 3 -a $2 = "AES" ];then echo $1|$PG_ENC -m -f $PGPOOL_CONF -u $1 $1 elif [ $2 = "md5" ];then echo $1|$PG_MD5 -m -f $PGPOOL_CONF -u $1 $1 # "text" is only supported in pgpool version 4.0 or later elif [ $3 -gt 3 -a $2 = "text" ];then if [ $3 -gt 3 ];then echo "$1:TEXT$1" >> $POOL_PASSWD else echo "$1:$1" >> $POOL_PASSWD fi else echo "skip adding to pool_passwd" fi } # create pg_hba.conf entry # $1: username # $2: "scram", "md5", "password" or "pam". function add_pg_hba() { for i in data0 data1 do if [ ! -d $i ];then continue fi PG_HBA=$i/pg_hba.conf if [ $2 = "scram" ];then echo "host all $1 127.0.0.1/32 scram-sha-256" >> $PG_HBA echo "host all $1 ::1/128 scram-sha-256" >> $PG_HBA echo "local all $1 scram-sha-256" >> $PG_HBA elif [ $2 = "md5" ];then echo "host all $1 127.0.0.1/32 md5" >> $PG_HBA echo "host all $1 ::1/128 md5" >> $PG_HBA echo "local all $1 md5" >> $PG_HBA elif [ $2 = "password" ];then echo "host all $1 127.0.0.1/32 password" >> $PG_HBA echo "host all $1 ::1/128 password" >> $PG_HBA echo "local all $1 password" >> $PG_HBA elif [ "$DO_PAM_TEST" = "true" -a $2 = "pam" ];then echo "host all $1 127.0.0.1/32 pam" >> $PG_HBA echo "host all $1 ::1/128 pam" >> $PG_HBA echo "local all $1 pam" >> $PG_HBA elif [ "$DO_PAM_TEST" != "true" -a $2 = "pam" ];then echo "do nothing because DO_PAM_TEST is not true and auth method is pam" elif [ "$DO_LDAP_TEST" = "true" -a $2 = "ldap" ];then echo "host all $1 127.0.0.1/32 ldap ldapserver=localhost ldapbasedn="dc=nodomain" ldapsearchattribute=uid" >> $PG_HBA echo "host all $1 ::1/128 ldap ldapserver=localhost ldapbasedn="dc=nodomain" ldapsearchattribute=uid" >> $PG_HBA echo "local all $1 ldap ldapserver=localhost ldapbasedn="dc=nodomain" ldapsearchattribute=uid" >> $PG_HBA elif [ "$DO_LDAP_TEST" != "true" -a $2 = "ldap" ];then echo "do nothing because DO_LDAP_TEST is not true and auth method is ldap" else echo "wrong auth method \"$2\" for add_pg_hba $1" exit 1 fi done } # create pgpass entry # $1: username function add_pgpass() { echo "127.0.0.1:$PGPORT:$PGDATABASE:$1:$1" >> pgpass echo "127.0.0.1:$PGPORT:$PGDATABASE:$1:$1foo" >> pgpasswrong } # Perform actual tests # $1: test spec csv file # $2: number of PostgreSQL nodes # $3: clustering mode function do_auth { rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR cp /dev/null $failed_usernames mode=$3 # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n $2 || exit 1 #$PGPOOL_SETUP -m $mode -n 1 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT export PGDATABASE=test # 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 PGPOOL_CONF=etc/pgpool.conf POOL_HBA=etc/pool_hba.conf if [ ! -f $POOL_HBA ];then cp ../../../../../sample/pool_hba.conf.sample $POOL_HBA fi POOL_PASSWD=etc/pool_passwd # # replace trust auth for all users with superuser in pg_hba.conf for i in data0 data1 do if [ ! -d $i ];then continue fi sed -i "s/local *all *all *trust/local all $superuser trust/" $i/pg_hba.conf sed -i "s/host *all *all *all *trust/host all $superuser all trust/" $i/pg_hba.conf done # # replace trust auth for all users with superuser in pool_hba.conf sed -i "s@host all all 127.0.0.1/32 trust@host all $superuser all trust@" $POOL_HBA sed -i "s@host all all ::1/128 trust@host all $superuser ::1/128 trust@" $POOL_HBA # set up pgpass cp /dev/null pgpass chmod 0600 pgpass cp /dev/null pgpasswrong chmod 0600 pgpasswrong # pgpool.conf opt cp /dev/null $PGPOOL_CONF_OPT # echo "include pgpool.conf.opt" >> etc/pgpool.conf # add last line marker to pgpool.conf echo "#last" >> etc/pgpool.conf # start pgpool ./startall wait_for_pgpool_startup IFS="," # # setup each user # cat $spec|while read line do set $line if [ $1 = 'username' ];then echo "skip title row" else username=$1 echo "==== $username ====" pool_hba=$2 allow_clear=$3 pool_passwd=$4 pg_hba=$5 expected=$6 add_user $username $pg_hba $PGPORT # for logical replication, we need to manually # add PostgreSQL user to node 1. if [ $mode = 'l' ];then add_user $username $pg_hba "11003" fi add_pool_hba $username $pool_hba $PGPOOL_VERSION_DIGIT add_pool_passwd $username $pool_passwd $PGPOOL_VERSION_DIGIT add_pg_hba $username $pg_hba add_pgpass $username fi done ./shutdownall # # do auth tests # cat $spec|while read line do set $line username=$1 echo "==== $username ====" pool_hba=$2 allow_clear=$3 pool_passwd=$4 pg_hba=$5 expected=$6 if [ $1 = 'username' ];then echo "skip tile row" elif [ "$DO_PAM_TEST" != "true" ] && [ $pool_hba = "pam" -o $pg_hba = "pam" ];then echo "skip pam test" elif [ "$DO_LDAP_TEST" != "true" ] && [ $pool_hba = "ldap" -o $pg_hba = "ldap" ];then echo "skip ldap test" else cp $PGPOOL_CONF_OPT $PGPOOL_CONF_OPT.old if [ $pool_hba = "scram" -o $pool_hba = "md5" -o $pool_hba = "password" -o $pool_hba = "pam" -o $pool_hba = "ldap" ];then echo "enable_pool_hba = on" > $PGPOOL_CONF_OPT last=`tail -1 etc/pgpool.conf` if [ "$last" != "#last" ];then # remove the last line if it's not a marker echo "remove the last line in pgpool.conf because \"$last\"" sed -i '$d' etc/pgpool.conf fi cat $PGPOOL_CONF_OPT >> etc/pgpool.conf echo "add \"`cat $PGPOOL_CONF_OPT`\"" else if [ $allow_clear = "off" ];then cp /dev/null $PGPOOL_CONF_OPT else echo "allow_clear_text_frontend_auth = on" > $PGPOOL_CONF_OPT fi last=`tail -1 etc/pgpool.conf` if [ $last != "#last" ];then # remove the last line if it's not a marker echo "remove the last line in pgpool.conf because \"$last\"" sed -i '$d' etc/pgpool.conf fi cat $PGPOOL_CONF_OPT >> etc/pgpool.conf echo "add \"`cat $PGPOOL_CONF_OPT`\"" fi # if pgpool.conf.opt was changed, restart pgpool cmp $PGPOOL_CONF_OPT $PGPOOL_CONF_OPT.old if [ $? != 0 ];then ./shutdownall ./startall wait_for_pgpool_startup fi result="" PGPASSFILE=pgpass $PSQL -h 127.0.0.1 -U $username -c "SELECT user" >/dev/null 2>&1 rtn=$? if [ $expected = "ok" ];then echo -n "checking $username auth expecting success..." if [ $rtn = 0 ];then echo "ok." echo -n "checking $username auth expecting success in reauth..." PGPASSFILE=pgpass $PSQL -h 127.0.0.1 -U $username -c "SELECT user" >/dev/null 2>&1 if [ $? != 0 ];then echo "$username: password verification on reauth failed." else # reauth was Ok. echo "ok." echo -n "$username: try with wrong password expecting rejected..." PGPASSFILE=pgpasswrong $PSQL -h 127.0.0.1 -U $username -c "SELECT user">/dev/null 2>&1 if [ $? = 0 ];then echo "$username: wrong password verification failed." echo "$mode $num_backends $username" >> $unexpected_passwd_verifi else echo "ok." result=ok fi fi else echo "$username: password verification failed." fi else # expecting fail echo -n "checking $username auth expecting failure..." if [ $rtn != 0 ];then echo "ok." result=ok else # make sure that wrong password is rejected PGPASSFILE=pgpasswrong $PSQL -h 127.0.0.1 -U $username -c "SELECT user">/dev/null 2>&1 if [ $? = 0 ];then echo "$username: unexpected successfull password verification" echo "$mode $num_backends $username" >> $unexpected_passwd_verifi else # maybe this test case should have been "ok", not "fail"? echo "$username: while expecting fail, wrong password was rejected but proper password was accepted" fi fi fi if [ "$result" != "ok" ];then echo -n " $username" >> $failed_usernames fi fi done ./shutdownall cd .. if [ -s $failed_usernames ];then echo "failed tests:" cat $failed_usernames echo fi } # #---------------------------------------- # Misc preparations # pgpool major version first digit (e.g. "4") PGPOOL_VERSION_DIGIT=`echo $PGPOOL_VERSION|awk '{print $3}'|sed 's/\([1-9]\).*$/\1/'` failed_usernames=/tmp/failed_usernames failed_modes=/tmp/failed_modes unexpected_passwd_verifi=/tmp/unexpected_passwd_verificatio total_failed_usernames=/tmp/total_failed_usernames trap "rm $failed_usernames $failed_modes $unexpected_passwd_verifi $total_failed_usernames" EXIT cp /dev/null $failed_usernames cp /dev/null $failed_modes cp /dev/null $unexpected_passwd_verifi cp /dev/null $total_failed_usernames source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_ENC=$PGPOOL_INSTALL_DIR/bin/pg_enc PG_MD5=$PGPOOL_INSTALL_DIR/bin/pg_md5 export CREATEUSER=$PGBIN/createuser superuser=`whoami` PGPOOL_CONF_OPT=etc/pgpool.conf.opt # .pgpoolkey export PGPOOLKEYFILE=`pwd`/pgpoolkey echo "secret" > $PGPOOLKEYFILE chmod 0600 $PGPOOLKEYFILE # #---------------------------------------- # Test execution starts here # Full test (6 clustering modes) takes too long time and it causes # timeout. For now, we skip logical replication and slony mode. #for mode in s r i n l y for mode in s r i n do echo "==== testing mode: $mode ===" anyfail="" spec=../client_auth_2node.csv num_backends=2 do_auth $spec $num_backends $mode if [ -s $failed_usernames ];then anyfail="yes" echo "$mode $num_backends `cat $failed_usernames`" >> $total_failed_usernames fi if [ -n "$anyfail" ];then echo -n "$mode " >> $failed_modes fi done if [ -s $unexpected_passwd_verifi ];then echo echo "IMPORTANT: unexpected successful password verfication found:" cat $unexpected_passwd_verifi fi if [ -s $failed_modes ];then echo echo "failed mode: `cat $failed_modes`" echo echo "failed tests:" cat $total_failed_usernames exit 1 fi exit 0 pgpool-II-4.7.0/src/test/regression/tests/113.tables_with_space/0000755000175000017500000000000015116217422021376 500000000000000pgpool-II-4.7.0/src/test/regression/tests/113.tables_with_space/.gitignore0000644000175000017500000000001115116217422023276 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/113.tables_with_space/test.sh0000755000175000017500000000210615116217422022633 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 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.7.0/src/test/regression/tests/014.watchdog_test_quorum_bypass/0000755000175000017500000000000015116217422023546 500000000000000pgpool-II-4.7.0/src/test/regression/tests/014.watchdog_test_quorum_bypass/.gitignore0000644000175000017500000000001015116217422025445 00000000000000leader/ pgpool-II-4.7.0/src/test/regression/tests/014.watchdog_test_quorum_bypass/leader.conf0000644000175000017500000000107415116217422025573 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.7.0/src/test/regression/tests/014.watchdog_test_quorum_bypass/test.sh0000755000175000017500000000342315116217422025006 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.7.0/src/test/regression/tests/027.auto_failback/0000755000175000017500000000000015116217422020506 500000000000000pgpool-II-4.7.0/src/test/regression/tests/027.auto_failback/.gitignore0000644000175000017500000000001115116217422022406 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/027.auto_failback/test.sh0000755000175000017500000000370715116217422021753 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.7.0/src/test/regression/tests/100.bug58/0000755000175000017500000000000015116217422016644 500000000000000pgpool-II-4.7.0/src/test/regression/tests/100.bug58/.gitignore0000644000175000017500000000001115116217422020544 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/100.bug58/test.sh0000755000175000017500000000226215116217422020104 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.7.0/src/test/regression/tests/114.bug153/0000755000175000017500000000000015116217422016725 500000000000000pgpool-II-4.7.0/src/test/regression/tests/114.bug153/.gitignore0000644000175000017500000000001115116217422020625 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/114.bug153/test.sh0000755000175000017500000000530315116217422020164 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for bug reported in bug#153 # CTE queries including DMLs are incorrectly handled. 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." source ./bashrc.ports echo "backend_weight0 = 0" >> 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.7.0/src/test/regression/tests/128.aborted_transaction/0000755000175000017500000000000015116217422021751 500000000000000pgpool-II-4.7.0/src/test/regression/tests/128.aborted_transaction/expected.txt0000644000175000017500000000140315116217422024231 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.7.0/src/test/regression/tests/128.aborted_transaction/test.sh0000755000175000017500000000155015116217422023210 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.7.0/src/test/regression/tests/005.jdbc/0000755000175000017500000000000015116217422016620 500000000000000pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/.gitignore0000644000175000017500000000001115116217422020520 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/AutoCommitTest.java0000644000175000017500000000226615116217422022332 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.7.0/src/test/regression/tests/005.jdbc/BatchTest.java0000644000175000017500000000270315116217422021266 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.7.0/src/test/regression/tests/005.jdbc/expected/0000755000175000017500000000000015116217422020421 500000000000000pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/CreateTempTable0000644000175000017500000000000415116217422023257 00000000000000200 pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/PrepareThreshold0000644000175000017500000000000315116217422023530 0000000000000030 pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/autocommit0000644000175000017500000000003715116217422022445 000000000000001 2 3 4 5 6 7 8 9 10 pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/batch0000644000175000017500000000000315116217422021336 0000000000000011 pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/column0000644000175000017500000000031015116217422021553 000000000000001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/insert0000644000175000017500000000000415116217422021562 00000000000000100 pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/lock0000644000175000017500000000031015116217422021206 000000000000001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/select0000644000175000017500000000001115116217422021533 00000000000000100 5050 pgpool-II-4.7.0/src/test/regression/tests/005.jdbc/expected/update0000644000175000017500000000000415116217422021540 00000000000000102 pgpool-II-4.7.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/0000755000175000017500000000000015116217422024356 500000000000000pgpool-II-4.7.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/.gitignore0000644000175000017500000000003315116217422026262 00000000000000leader/ standby/ standby2/ pgpool-II-4.7.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/leader.conf0000644000175000017500000000107415116217422026403 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.7.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/standby.conf0000644000175000017500000000113315116217422026607 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.7.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/standby2.conf0000644000175000017500000000113415116217422026672 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.7.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/test.sh0000755000175000017500000001274715116217422025627 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 "work_dir = $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 "work_dir = $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.7.0/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/0000755000175000017500000000000015116217422026376 500000000000000pgpool-II-4.7.0/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/test.sh0000755000175000017500000000646015116217422027642 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.7.0/src/test/regression/tests/101.bug60/0000755000175000017500000000000015116217422016636 500000000000000pgpool-II-4.7.0/src/test/regression/tests/101.bug60/.gitignore0000644000175000017500000000001115116217422020536 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/101.bug60/bug.sql0000644000175000017500000000073415116217422020060 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.7.0/src/test/regression/tests/101.bug60/database-clean.sql0000644000175000017500000000027715116217422022131 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.7.0/src/test/regression/tests/101.bug60/database-setup.sql0000644000175000017500000000156515116217422022210 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.7.0/src/test/regression/tests/101.bug60/test.sh0000755000175000017500000000343415116217422020100 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.7.0/src/test/regression/tests/115.bug152/0000755000175000017500000000000015116217422016725 500000000000000pgpool-II-4.7.0/src/test/regression/tests/115.bug152/.gitignore0000644000175000017500000000001115116217422020625 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/115.bug152/Main.java0000644000175000017500000000255415116217422020402 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.7.0/src/test/regression/tests/115.bug152/run.sh0000644000175000017500000000007215116217422020004 00000000000000export CLASSPATH=.:$JDBC_DRIVER javac Main.java java Main pgpool-II-4.7.0/src/test/regression/tests/115.bug152/test.sh0000755000175000017500000000143515116217422020166 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.7.0/src/test/regression/tests/129.multi_prepare/0000755000175000017500000000000015116217422020575 500000000000000pgpool-II-4.7.0/src/test/regression/tests/129.multi_prepare/expected.txt0000644000175000017500000000117715116217422023065 00000000000000FE=> 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.7.0/src/test/regression/tests/129.multi_prepare/pgproto.data0000644000175000017500000000070615116217422023045 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.7.0/src/test/regression/tests/129.multi_prepare/test.sh0000755000175000017500000000157715116217422022045 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.7.0/src/test/regression/tests/016.node_0_is_not_primary/0000755000175000017500000000000015116217422022202 500000000000000pgpool-II-4.7.0/src/test/regression/tests/016.node_0_is_not_primary/.gitignore0000644000175000017500000000001115116217422024102 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/016.node_0_is_not_primary/test.sh0000755000175000017500000000247215116217422023445 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.7.0/src/test/regression/tests/029.cert_passphrase/0000755000175000017500000000000015116217422021112 500000000000000pgpool-II-4.7.0/src/test/regression/tests/029.cert_passphrase/cert.sh0000755000175000017500000000121315116217422022323 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.7.0/src/test/regression/tests/029.cert_passphrase/test.sh0000755000175000017500000000522215116217422022351 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 # The error message is typically "bad decrypt". # But it seems sometimes "wrong tag". grep "could not load private key file" log/pgpool.log|egrep "bad decrypt|wrong tag" 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.7.0/src/test/regression/tests/102.do_query/0000755000175000017500000000000015116217422017543 500000000000000pgpool-II-4.7.0/src/test/regression/tests/102.do_query/.gitignore0000644000175000017500000000001115116217422021443 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/102.do_query/test.sh0000755000175000017500000000152515116217422021004 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.7.0/src/test/regression/tests/116.bug230/0000755000175000017500000000000015116217422016723 500000000000000pgpool-II-4.7.0/src/test/regression/tests/116.bug230/.gitignore0000644000175000017500000000001115116217422020623 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/116.bug230/Sample.java0000644000175000017500000000175415116217422020736 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.7.0/src/test/regression/tests/116.bug230/test.sh0000755000175000017500000000170115116217422020160 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.7.0/src/test/regression/tests/130.declare/0000755000175000017500000000000015116217422017314 500000000000000pgpool-II-4.7.0/src/test/regression/tests/130.declare/expected.txt0000644000175000017500000000167115116217422021603 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.7.0/src/test/regression/tests/130.declare/pgproto.data0000644000175000017500000000100015116217422021550 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.7.0/src/test/regression/tests/130.declare/test.sh0000755000175000017500000000162515116217422020556 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.7.0/src/test/regression/tests/006.memqcache/0000755000175000017500000000000015116217422017642 500000000000000pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/.gitignore0000644000175000017500000000001115116217422021542 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/alter_database1.data0000644000175000017500000000131615116217422023432 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.7.0/src/test/regression/tests/006.memqcache/alter_database2.data0000644000175000017500000000044215116217422023432 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.7.0/src/test/regression/tests/006.memqcache/alter_database3.data0000644000175000017500000000023315116217422023431 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.7.0/src/test/regression/tests/006.memqcache/alter_role.data0000644000175000017500000000132215116217422022543 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.7.0/src/test/regression/tests/006.memqcache/alter_table1.data0000644000175000017500000000165615116217422022764 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.7.0/src/test/regression/tests/006.memqcache/alter_table2.data0000644000175000017500000000044015116217422022753 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.7.0/src/test/regression/tests/006.memqcache/alter_table3.data0000644000175000017500000000023015116217422022751 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.7.0/src/test/regression/tests/006.memqcache/expected.10000644000175000017500000000132015116217422021441 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.7.0/src/test/regression/tests/006.memqcache/expected.20000644000175000017500000000127015116217422021446 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.7.0/src/test/regression/tests/006.memqcache/expected.30000644000175000017500000000143015116217422021445 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.7.0/src/test/regression/tests/006.memqcache/expected.40000644000175000017500000000231415116217422021450 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.7.0/src/test/regression/tests/006.memqcache/expected.50000644000175000017500000000204015116217422021445 00000000000000FE=> Query (query="CREATE TABLE regress_test(i int)") <= BE CommandComplete(CREATE TABLE) <= BE ReadyForQuery(I) FE=> Query (query="INSERT INTO regress_test VALUES(1)") <= BE CommandComplete(INSERT 0 1) <= BE ReadyForQuery(I) FE=> Parse(stmt="S0", query="SELECT * FROM regress_test WHERE i = 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="S2", query="UPDATE regress_test SET i = 2") FE=> Bind(stmt="S2", portal="P2") FE=> Execute(portal="P2") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE CommandComplete(UPDATE 1) <= BE ReadyForQuery(I) FE=> Bind(stmt="S0", portal="P0") FE=> Describe(portal="P0") FE=> Execute(portal="P0") FE=> Sync <= BE BindComplete <= BE RowDescription <= BE CommandComplete(SELECT 0) <= BE ReadyForQuery(I) FE=> Query (query="DROP TABLE regress_test") <= BE CommandComplete(DROP TABLE) <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/expected.60000644000175000017500000000176415116217422021462 00000000000000FE=> Query (query="CREATE TABLE regress_test(i int)") <= BE CommandComplete(CREATE TABLE) <= BE ReadyForQuery(I) FE=> Parse(stmt="S1", query="INSERT INTO regress_test VALUES(1)") FE=> Bind(stmt="S1", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE CommandComplete(INSERT 0 1) <= BE ReadyForQuery(I) FE=> Parse(stmt="S2", query="SELECT * FROM regress_test WHERE i = 1") FE=> Bind(stmt="S2", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE ReadyForQuery(I) FE=> Bind(stmt="S1", portal="") FE=> Execute(portal="") FE=> Sync <= BE BindComplete <= BE CommandComplete(INSERT 0 1) <= BE ReadyForQuery(I) FE=> Bind(stmt="S2", portal="") FE=> Execute(portal="") FE=> Sync <= BE BindComplete <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 2) <= BE ReadyForQuery(I) FE=> Query (query="DROP TABLE regress_test") <= BE CommandComplete(DROP TABLE) <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/expected.70000644000175000017500000000257215116217422021461 00000000000000FE=> Query (query="CREATE TABLE regress_test(i int)") <= BE CommandComplete(CREATE TABLE) <= BE ReadyForQuery(I) FE=> Parse(stmt="S1", query="INSERT INTO regress_test VALUES(1)") FE=> Bind(stmt="S1", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE CommandComplete(INSERT 0 1) <= BE ReadyForQuery(I) FE=> Parse(stmt="S2", query="SELECT * FROM regress_test WHERE i = 1") FE=> Bind(stmt="S2", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE ReadyForQuery(I) FE=> Parse(stmt="S3", query="BEGIN") FE=> Bind(stmt="S3", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE CommandComplete(BEGIN) <= BE ReadyForQuery(T) FE=> Bind(stmt="S1", portal="") FE=> Execute(portal="") FE=> Sync <= BE BindComplete <= BE CommandComplete(INSERT 0 1) <= BE ReadyForQuery(T) FE=> Parse(stmt="S4", query="COMMIT") FE=> Bind(stmt="S4", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE CommandComplete(COMMIT) <= BE ReadyForQuery(I) FE=> Bind(stmt="S2", portal="") FE=> Execute(portal="") FE=> Sync <= BE BindComplete <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 2) <= BE ReadyForQuery(I) FE=> Query (query="DROP TABLE regress_test") <= BE CommandComplete(DROP TABLE) <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/expected.n0000644000175000017500000003212015116217422021540 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.7.0/src/test/regression/tests/006.memqcache/expected.r0000644000175000017500000004126115116217422021552 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.7.0/src/test/regression/tests/006.memqcache/expected.s0000644000175000017500000003212015116217422021545 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.7.0/src/test/regression/tests/006.memqcache/expected.txt0000644000175000017500000000000215116217422022114 000000000000002 pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/jdbctest.java0000644000175000017500000000257515116217422022240 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.7.0/src/test/regression/tests/006.memqcache/query_cache_bug1.data0000644000175000017500000000046715116217422023632 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.7.0/src/test/regression/tests/006.memqcache/query_cache_bug2.data0000644000175000017500000000046115116217422023625 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.7.0/src/test/regression/tests/006.memqcache/query_cache_bug3.data0000644000175000017500000000044215116217422023625 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.7.0/src/test/regression/tests/006.memqcache/query_cache_bug4.data0000644000175000017500000000121115116217422023621 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.7.0/src/test/regression/tests/006.memqcache/query_cache_bug5.data0000644000175000017500000000136315116217422023632 00000000000000# Execute UPDATE to check if the query cache is invalidated. # create a test table "regress_test". 'Q' "CREATE TABLE regress_test(i int)" 'Y' 'Q' "INSERT INTO regress_test VALUES(1)" 'Y' 'P' "S0" "SELECT * FROM regress_test WHERE i = 1" 0 'B' "P0" "S0" 0 0 0 'D' 'P' "P0" # This SELECT is expected to return 1 row and it should have created # query cache. 'E' "P0" 0 'S' 'Y' 'P' "S2" "UPDATE regress_test SET i = 2" 0 'B' "P2" "S2" 0 0 0 # Set "maxrows" parameter to 1 of this execute message to trigger bug. 'E' "P2" 1 'S' 'Y' 'B' "P0" "S0" 0 0 0 'D' 'P' "P0" # This SELECT is expected to return 0 row because previous UPDATE # should have deleted the query cache. 'E' "P0" 0 'S' 'Y' # drop the test table. 'Q' "DROP TABLE regress_test" 'Y' 'X' pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/query_cache_bug6.data0000644000175000017500000000114615116217422023632 00000000000000# Test case for query cache invalidation bug. # # create a test table "regress_test". 'Q' "CREATE TABLE regress_test(i int)" 'Y' # create named statement S1 for INSERT. 'P' "S1" "INSERT INTO regress_test VALUES(1)" 0 'B' "" "S1" 0 0 0 'E' "" 0 'S' 'Y' # create query cache. 'P' "S2" "SELECT * FROM regress_test WHERE i = 1" 0 'B' "" "S2" 0 0 0 'E' "" 0 'S' 'Y' # INSERT one more row without bind message. 'B' "" "S1" 0 0 0 'E' "" 0 'S' 'Y' # This should return 2 rows if query cache validation succeeds. 'B' "" "S2" 0 0 0 'E' "" 0 'S' 'Y' # drop the test table. 'Q' "DROP TABLE regress_test" 'Y' 'X' pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/query_cache_bug7.data0000644000175000017500000000145715116217422023640 00000000000000# Test case for query cache invalidation bug with explicit # transaction. # create a test table "regress_test". 'Q' "CREATE TABLE regress_test(i int)" 'Y' # create named statement S1 for INSERT. 'P' "S1" "INSERT INTO regress_test VALUES(1)" 0 'B' "" "S1" 0 0 0 'E' "" 1 'S' 'Y' # create query cache. 'P' "S2" "SELECT * FROM regress_test WHERE i = 1" 0 'B' "" "S2" 0 0 0 'E' "" 0 'S' 'Y' # start an explicit transaction. 'P' "S3" "BEGIN" 0 'B' "" "S3" 0 0 0 'E' "" 0 'S' 'Y' # INSERT one more row without bind message. 'B' "" "S1" 0 0 0 'E' "" 1 'S' 'Y' # commit the transaction. 'P' "S4" "COMMIT" 0 'B' "" "S4" 0 0 0 'E' "" 0 'S' 'Y' # This should return 2 rows if query cache validation succeeds. 'B' "" "S2" 0 0 0 'E' "" 0 'S' 'Y' # drop the test table. 'Q' "DROP TABLE regress_test" 'Y' 'X' pgpool-II-4.7.0/src/test/regression/tests/006.memqcache/revoke1.data0000644000175000017500000000176115116217422021776 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.7.0/src/test/regression/tests/006.memqcache/revoke2.data0000644000175000017500000000046115116217422021773 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.7.0/src/test/regression/tests/006.memqcache/revoke3.data0000644000175000017500000000023315116217422021771 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.7.0/src/test/regression/tests/006.memqcache/row_security.data0000644000175000017500000000120515116217422023151 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.7.0/src/test/regression/tests/006.memqcache/session_authorization.data0000644000175000017500000000046315116217422025063 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.7.0/src/test/regression/tests/006.memqcache/set_role1.data0000644000175000017500000000042415116217422022312 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.7.0/src/test/regression/tests/006.memqcache/set_role2.data0000644000175000017500000000127715116217422022322 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.7.0/src/test/regression/tests/006.memqcache/set_role3.data0000644000175000017500000000144415116217422022317 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.7.0/src/test/regression/tests/006.memqcache/set_role4.data0000644000175000017500000000250015116217422022312 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.7.0/src/test/regression/tests/006.memqcache/test.sh0000755000175000017500000004174315116217422021111 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 5 6 7 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 # # case 5: simple cache invalidation test. # # case 6: execute INSERT without parse message cache invalidation test. # # case 7: similar to case 6 except this uses an explicit transaction. cd $TESTDIR # case 5 includes UPDATE, and we want the result without disturbed # by replication delay. if [ $i = 5 ];then echo "backend_weight1 = 0" >> etc/pgpool.conf fi ./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.7.0/src/test/regression/tests/017.node_0_is_down/0000755000175000017500000000000015116217422020607 500000000000000pgpool-II-4.7.0/src/test/regression/tests/017.node_0_is_down/.gitignore0000644000175000017500000000001115116217422022507 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/017.node_0_is_down/test.sh0000755000175000017500000000670515116217422022055 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.7.0/src/test/regression/tests/030.snapshot_isolation/0000755000175000017500000000000015116217422021634 500000000000000pgpool-II-4.7.0/src/test/regression/tests/030.snapshot_isolation/expected.txt0000644000175000017500000000004715116217422024117 00000000000000 count ------- 1 (1 row) VACUUM pgpool-II-4.7.0/src/test/regression/tests/030.snapshot_isolation/inconsistency1.sql0000644000175000017500000000004515116217422025245 00000000000000BEGIN; UPDATE t1 SET i = i + 1; END; pgpool-II-4.7.0/src/test/regression/tests/030.snapshot_isolation/inconsistency2.sql0000644000175000017500000000005615116217422025250 00000000000000BEGIN; INSERT INTO log SELECT * FROM t1; END; pgpool-II-4.7.0/src/test/regression/tests/030.snapshot_isolation/test.sh0000755000175000017500000000451415116217422023076 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.7.0/src/test/regression/tests/103.insert_lock_hangs/0000755000175000017500000000000015116217422021411 500000000000000pgpool-II-4.7.0/src/test/regression/tests/103.insert_lock_hangs/.gitignore0000644000175000017500000000001115116217422023311 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/103.insert_lock_hangs/test.sh0000755000175000017500000000372015116217422022651 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.7.0/src/test/regression/tests/117.bug231/0000755000175000017500000000000015116217422016725 500000000000000pgpool-II-4.7.0/src/test/regression/tests/117.bug231/.gitignore0000644000175000017500000000001115116217422020625 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/117.bug231/TestReplGap.java0000644000175000017500000000133415116217422021703 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.7.0/src/test/regression/tests/117.bug231/test.sh0000755000175000017500000000166615116217422020174 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.7.0/src/test/regression/tests/131.detach_primary_all_down/0000755000175000017500000000000015116217422022570 500000000000000pgpool-II-4.7.0/src/test/regression/tests/131.detach_primary_all_down/test.sh0000755000175000017500000000713415116217422024033 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.7.0/src/test/regression/tests/007.memqcache-memcached/0000755000175000017500000000000015116217422021547 500000000000000pgpool-II-4.7.0/src/test/regression/tests/007.memqcache-memcached/.gitignore0000644000175000017500000000001115116217422023447 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/007.memqcache-memcached/expected.txt0000644000175000017500000000000215116217422024021 000000000000002 pgpool-II-4.7.0/src/test/regression/tests/007.memqcache-memcached/jdbctest.java0000644000175000017500000000257415116217422024144 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.7.0/src/test/regression/tests/007.memqcache-memcached/test.sh0000755000175000017500000000216015116217422023004 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.7.0/src/test/regression/tests/018.detach_primary/0000755000175000017500000000000015116217422020715 500000000000000pgpool-II-4.7.0/src/test/regression/tests/018.detach_primary/.gitignore0000644000175000017500000000001115116217422022615 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/018.detach_primary/test.sh0000755000175000017500000000542515116217422022161 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.7.0/src/test/regression/tests/031.connection_life_time/0000755000175000017500000000000015116217422022071 500000000000000pgpool-II-4.7.0/src/test/regression/tests/031.connection_life_time/test.sh0000755000175000017500000000235115116217422023330 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.7.0/src/test/regression/tests/104.postgres_fdw/0000755000175000017500000000000015116217422020424 500000000000000pgpool-II-4.7.0/src/test/regression/tests/104.postgres_fdw/.gitignore0000644000175000017500000000001115116217422022324 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/104.postgres_fdw/test.sh0000755000175000017500000000344715116217422021672 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.7.0/src/test/regression/tests/118.memqcache_bug/0000755000175000017500000000000015116217422020503 500000000000000pgpool-II-4.7.0/src/test/regression/tests/118.memqcache_bug/.gitignore0000644000175000017500000000001115116217422022403 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/118.memqcache_bug/Sample.java0000644000175000017500000000262515116217422022514 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.7.0/src/test/regression/tests/118.memqcache_bug/test.sh0000755000175000017500000000172215116217422021743 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 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.7.0/src/test/regression/tests/008.dbredirect/0000755000175000017500000000000015116217422020030 500000000000000pgpool-II-4.7.0/src/test/regression/tests/008.dbredirect/.gitignore0000644000175000017500000000001115116217422021730 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/008.dbredirect/select.pgbench0000644000175000017500000000002015116217422022547 00000000000000SELECT 'test16' pgpool-II-4.7.0/src/test/regression/tests/008.dbredirect/select1.pgbench0000644000175000017500000000002015116217422022630 00000000000000SELECT 'test18' pgpool-II-4.7.0/src/test/regression/tests/008.dbredirect/test.sh0000755000175000017500000001374615116217422021301 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.7.0/src/test/regression/tests/019.log_client_messages/0000755000175000017500000000000015116217422021731 500000000000000pgpool-II-4.7.0/src/test/regression/tests/019.log_client_messages/.gitignore0000644000175000017500000000001115116217422023631 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/019.log_client_messages/test.sh0000755000175000017500000001001115116217422023160 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.7.0/src/test/regression/tests/019.log_client_messages/tests/0000755000175000017500000000000015116217422023073 500000000000000pgpool-II-4.7.0/src/test/regression/tests/019.log_client_messages/tests/copy.data0000644000175000017500000000047215116217422024623 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.7.0/src/test/regression/tests/019.log_client_messages/tests/describe.data0000644000175000017500000000026515116217422025431 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.7.0/src/test/regression/tests/019.log_client_messages/tests/extended_query.data0000644000175000017500000000047015116217422026674 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.7.0/src/test/regression/tests/019.log_client_messages/tests/function.data0000644000175000017500000000055015116217422025473 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.7.0/src/test/regression/tests/019.log_client_messages/tests/simple.data0000644000175000017500000000013215116217422025133 00000000000000# Test for simple-query protocol 'Q' 'Q' "SELECT * FROM pgbench_accounts LIMIT 1" 'Y' 'X' pgpool-II-4.7.0/src/test/regression/tests/032.dml_adaptive_load_balance/0000755000175000017500000000000015116217422023013 500000000000000pgpool-II-4.7.0/src/test/regression/tests/032.dml_adaptive_load_balance/test.sh0000755000175000017500000001046315116217422024255 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.7.0/src/test/regression/tests/105.backend_all_down/0000755000175000017500000000000015116217422021165 500000000000000pgpool-II-4.7.0/src/test/regression/tests/105.backend_all_down/.gitignore0000644000175000017500000000001115116217422023065 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/105.backend_all_down/test.sh0000755000175000017500000000234715116217422022431 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.7.0/src/test/regression/tests/119.memory_leak_extended/0000755000175000017500000000000015116217422022110 500000000000000pgpool-II-4.7.0/src/test/regression/tests/119.memory_leak_extended/.gitignore0000644000175000017500000000001115116217422024010 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/119.memory_leak_extended/test.sh0000755000175000017500000000317615116217422023355 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Testing memory leak in extended query protocol case. 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 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 # 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.7.0/src/test/regression/tests/009.sql_comments/0000755000175000017500000000000015116217422020426 500000000000000pgpool-II-4.7.0/src/test/regression/tests/009.sql_comments/.gitignore0000644000175000017500000000001115116217422022326 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/009.sql_comments/test.sh0000755000175000017500000000277515116217422021677 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.7.0/src/test/regression/tests/033.prefer_lower_standby_delay/0000755000175000017500000000000015116217422023314 500000000000000pgpool-II-4.7.0/src/test/regression/tests/033.prefer_lower_standby_delay/test.sh0000755000175000017500000001672315116217422024563 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.7.0/src/test/regression/tests/106.bug63/0000755000175000017500000000000015116217422016646 500000000000000pgpool-II-4.7.0/src/test/regression/tests/106.bug63/.gitignore0000644000175000017500000000001115116217422020546 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/106.bug63/jdbctest2.java0000644000175000017500000000271715116217422021324 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.7.0/src/test/regression/tests/106.bug63/test.sh0000755000175000017500000000177615116217422020117 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.7.0/src/test/regression/tests/120.memory_leak_extended_memqcache/0000755000175000017500000000000015116217422024103 500000000000000pgpool-II-4.7.0/src/test/regression/tests/120.memory_leak_extended_memqcache/.gitignore0000644000175000017500000000001115116217422026003 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/120.memory_leak_extended_memqcache/test.sh0000755000175000017500000000303215116217422025337 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.7.0/src/test/regression/tests/010.rewrite_timestamp/0000755000175000017500000000000015116217422021456 500000000000000pgpool-II-4.7.0/src/test/regression/tests/010.rewrite_timestamp/expected.txt0000644000175000017500000000012415116217422023735 00000000000000./run-test parse_schedule testcase insert: OK testcase update: OK testcase misc: OK pgpool-II-4.7.0/src/test/regression/tests/010.rewrite_timestamp/test.sh0000755000175000017500000000051115116217422022711 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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/0000755000175000017500000000000015116217422023461 500000000000000pgpool-II-4.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/.gitignore0000644000175000017500000000001315116217422025363 00000000000000result.txt pgpool-II-4.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/Makefile0000644000175000017500000000164015116217422025042 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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/main.c0000644000175000017500000000725515116217422024502 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, void *(*register_func) (), void *(*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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/parse_schedule0000644000175000017500000000002315116217422026305 00000000000000insert update misc pgpool-II-4.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/run-test0000755000175000017500000000250715116217422025114 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.exist? file) STDERR.puts "run-test: file does not exist: #{file}" exit 1 end if !(File.exist? 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.exist? 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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/0000755000175000017500000000000015116217422025262 500000000000000pgpool-II-4.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/insert.out0000644000175000017500000000331415116217422027240 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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/misc.out0000644000175000017500000000041415116217422026665 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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/update.out0000644000175000017500000000113215116217422027212 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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/0000755000175000017500000000000015116217422024620 500000000000000pgpool-II-4.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/insert.sql0000644000175000017500000000142715116217422026571 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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/misc.sql0000644000175000017500000000020215116217422026206 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.7.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/update.sql0000644000175000017500000000046215116217422026545 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.7.0/src/test/regression/tests/020.allow_clear_text_frontend_auth/0000755000175000017500000000000015116217422024163 500000000000000pgpool-II-4.7.0/src/test/regression/tests/020.allow_clear_text_frontend_auth/test.sh0000755000175000017500000000644415116217422025431 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.7.0/src/test/regression/tests/034.promote_node/0000755000175000017500000000000015116217422020412 500000000000000pgpool-II-4.7.0/src/test/regression/tests/034.promote_node/test.sh0000755000175000017500000000227515116217422021656 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=120 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.7.0/src/test/regression/tests/107.bug61/0000755000175000017500000000000015116217422016645 500000000000000pgpool-II-4.7.0/src/test/regression/tests/107.bug61/.gitignore0000644000175000017500000000001115116217422020545 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/107.bug61/test.sh0000755000175000017500000000216615116217422020110 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.7.0/src/test/regression/tests/121.execute_and_deallocate/0000755000175000017500000000000015116217422022356 500000000000000pgpool-II-4.7.0/src/test/regression/tests/121.execute_and_deallocate/.gitignore0000644000175000017500000000001115116217422024256 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/121.execute_and_deallocate/test.sh0000755000175000017500000000754615116217422023630 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.7.0/src/test/regression/tests/021.pool_passwd_auth/0000755000175000017500000000000015116217422021267 500000000000000pgpool-II-4.7.0/src/test/regression/tests/021.pool_passwd_auth/pool_hba.conf0000644000175000017500000000654615116217422023654 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.7.0/src/test/regression/tests/021.pool_passwd_auth/test.sh0000755000175000017500000000750615116217422022535 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.7.0/src/test/regression/tests/035.unix_sockets/0000755000175000017500000000000015116217422020437 500000000000000pgpool-II-4.7.0/src/test/regression/tests/035.unix_sockets/test.sh0000755000175000017500000001000715116217422021673 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 <> 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.7.0/src/test/regression/tests/122.meqcache_bug2/0000755000175000017500000000000015116217422020403 500000000000000pgpool-II-4.7.0/src/test/regression/tests/122.meqcache_bug2/extended_query_test.data0000644000175000017500000000035215116217422025242 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.7.0/src/test/regression/tests/122.meqcache_bug2/test.sh0000755000175000017500000000132015116217422021635 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.7.0/src/test/regression/tests/README0000644000175000017500000000032515116217422016213 00000000000000All test directory names should have following format: 3-digit-numbers '.' (dot) test-names For the 3-digit-number, range 000-099 are reserved for tests of features. Range 100- are reserved for tests for bugs. pgpool-II-4.7.0/src/test/regression/tests/001.load_balance/0000755000175000017500000000000015116217422020276 500000000000000pgpool-II-4.7.0/src/test/regression/tests/001.load_balance/sql/0000755000175000017500000000000015116217422021075 500000000000000pgpool-II-4.7.0/src/test/regression/tests/001.load_balance/sql/6.sql0000644000175000017500000000207715116217422021711 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.7.0/src/test/regression/tests/001.load_balance/sql/7.sql0000644000175000017500000000213315116217422021703 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.7.0/src/test/regression/tests/001.load_balance/.gitignore0000644000175000017500000000001115116217422022176 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/001.load_balance/test.sh0000755000175000017500000001522715116217422021543 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.7.0/src/test/regression/tests/001.load_balance/expected/0000755000175000017500000000000015116217422022077 500000000000000pgpool-II-4.7.0/src/test/regression/tests/001.load_balance/expected/expected1-r0000644000175000017500000000364215116217422024070 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.7.0/src/test/regression/tests/001.load_balance/expected/expected1-s0000644000175000017500000000240515116217422024065 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.7.0/src/test/regression/tests/001.load_balance/expected/expected2-r0000644000175000017500000000035615116217422024070 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.7.0/src/test/regression/tests/001.load_balance/expected/expected2-s0000644000175000017500000000035615116217422024071 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.7.0/src/test/regression/tests/001.load_balance/expected/expected3-r0000644000175000017500000000103415116217422024063 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.7.0/src/test/regression/tests/001.load_balance/expected/expected3-s0000644000175000017500000000103415116217422024064 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.7.0/src/test/regression/tests/001.load_balance/expected/expected4-r0000644000175000017500000000041315116217422024064 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.7.0/src/test/regression/tests/001.load_balance/expected/expected5-r0000644000175000017500000000025615116217422024072 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.7.0/src/test/regression/tests/001.load_balance/expected/expected6-r0000644000175000017500000000542015116217422024071 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.7.0/src/test/regression/tests/001.load_balance/expected/expected6-s0000644000175000017500000000473415116217422024101 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.7.0/src/test/regression/tests/001.load_balance/expected/expected7-r0000644000175000017500000000652415116217422024100 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.7.0/src/test/regression/tests/001.load_balance/expected/expected7-s0000644000175000017500000000523515116217422024077 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.7.0/src/test/regression/tests/001.load_balance/expected/expected8-s0000644000175000017500000000523515116217422024100 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.7.0/src/test/regression/tests/022.pool_passwd_alternative_auth/0000755000175000017500000000000015116217422023666 500000000000000pgpool-II-4.7.0/src/test/regression/tests/022.pool_passwd_alternative_auth/pool_hba.conf0000644000175000017500000000654615116217422026253 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.7.0/src/test/regression/tests/022.pool_passwd_alternative_auth/test.sh0000755000175000017500000000706715116217422025136 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.7.0/src/test/regression/tests/036.trusted_servers/0000755000175000017500000000000015116217422021165 500000000000000pgpool-II-4.7.0/src/test/regression/tests/036.trusted_servers/test.sh0000755000175000017500000000254615116217422022432 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for trusted_server_command # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql # set trusted_servers and trusted_server_command function set_param { n=0 while [ $n -lt 2 ] do echo "trusted_servers = 'localhost'" >> 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.7.0/src/test/regression/tests/109.bug92/0000755000175000017500000000000015116217422016653 500000000000000pgpool-II-4.7.0/src/test/regression/tests/109.bug92/.gitignore0000644000175000017500000000001115116217422020553 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/109.bug92/jdbctest.java0000644000175000017500000000134115116217422021237 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.7.0/src/test/regression/tests/109.bug92/test.sh0000755000175000017500000000226015116217422020111 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 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.7.0/src/test/regression/tests/023.ssl_connection/0000755000175000017500000000000015116217422020736 500000000000000pgpool-II-4.7.0/src/test/regression/tests/023.ssl_connection/README0000644000175000017500000000040315116217422021533 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.7.0/src/test/regression/tests/023.ssl_connection/server.crt0000644000175000017500000001030515116217422022675 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.7.0/src/test/regression/tests/023.ssl_connection/server.key0000644000175000017500000000321715116217422022701 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.7.0/src/test/regression/tests/023.ssl_connection/server.req0000644000175000017500000000653615116217422022707 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.7.0/src/test/regression/tests/023.ssl_connection/test.sh0000755000175000017500000000762415116217422022205 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 # PostgreSQL 18 or later prints tablular output for \conninfo. # For SSL, "SSL Connection | true (or false)" if [ $PGVERSION -ge 18 ];then grep "SSL Connection" result|grep true else grep SSL result fi 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." if [ $PGVERSION -ge 18 ];then grep "SSL Protocol" result|grep TLSv1.2 else grep SSL result |grep TLSv1.2 fi # 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 # Checking ssl_ecdh_curve. Set bad value to see if SSL connection fails. echo "ssl_ecdh_curve = 'badcurve'" >> etc/pgpool.conf ./startall wait_for_pgpool_startup $PSQL -h localhost test < result \conninfo \q EOF if [ $PGVERSION -ge 18 ];then grep "SSL Connection" result|grep true else grep SSL result fi if [ $? = 0 ];then echo "Checking SSL connection between frontend and Pgpool-II succeeded despite bad ssl_ecdh_curve." ./shutdownall exit 1 fi echo "Checking SSL connection between frontend and Pgpool-II failed due to bad ssl_ecdh_curve as expected." ./shutdownall # Make sure that SSL connection succeeds with good ssl_ecdh_curve echo "ssl_ecdh_curve = 'prime256v1'" >> etc/pgpool.conf ./startall wait_for_pgpool_startup $PSQL -h localhost test < result \conninfo \q EOF grep SSL result if [ $? = 0 ];then echo "Checking SSL connection between frontend and Pgpool-II succeeded with good ssl_ecdh_curve." ./shutdownall else echo "Checking SSL connection between frontend and Pgpool-II failed with good ssl_ecdh_curve." ./shutdownall exit 1 fi exit 0 pgpool-II-4.7.0/src/test/regression/tests/037.failover_session/0000755000175000017500000000000015116217422021275 500000000000000pgpool-II-4.7.0/src/test/regression/tests/037.failover_session/test.sh0000755000175000017500000000661615116217422022544 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.7.0/src/test/regression/tests/110.memory_leak/0000755000175000017500000000000015116217422020217 500000000000000pgpool-II-4.7.0/src/test/regression/tests/110.memory_leak/.gitignore0000644000175000017500000000001115116217422022117 00000000000000testdir/ pgpool-II-4.7.0/src/test/regression/tests/110.memory_leak/test.sh0000755000175000017500000000254715116217422021465 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Testing memory leak. 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 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 # 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.7.0/src/test/regression/tests/124.bug700_memqcache_segfault/0000755000175000017500000000000015116217422022621 500000000000000pgpool-II-4.7.0/src/test/regression/tests/124.bug700_memqcache_segfault/expected.txt0000644000175000017500000000104315116217422025101 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.7.0/src/test/regression/tests/124.bug700_memqcache_segfault/pgproto.data0000644000175000017500000000024215116217422025064 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.7.0/src/test/regression/tests/124.bug700_memqcache_segfault/test.sh0000755000175000017500000000210215116217422024052 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 echo "log_backend_messages = terse" >> etc/pgpool.conf echo "log_client_messages = on" >> 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.7.0/src/utils/0000755000175000017500000000000015120777704012263 500000000000000pgpool-II-4.7.0/src/utils/error/0000755000175000017500000000000015120777677013425 500000000000000pgpool-II-4.7.0/src/utils/error/elog.c0000644000175000017500000023214215116217422014421 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.7.0/src/utils/error/assert.c0000644000175000017500000000237315116217422014775 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.7.0/src/utils/mmgr/0000755000175000017500000000000015120777677013236 500000000000000pgpool-II-4.7.0/src/utils/mmgr/mcxt.c0000644000175000017500000007340115116217422014260 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.7.0/src/utils/mmgr/aset.c0000644000175000017500000011645215116217422014245 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.7.0/src/utils/pcp/0000755000175000017500000000000015120777677013056 500000000000000pgpool-II-4.7.0/src/utils/pcp/pcp_stream.c0000644000175000017500000001527115116217422015263 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.7.0/src/utils/psqlscan.c0000644000175000017500000035063415120734030014167 00000000000000#line 1 "utils/psqlscan.c" /*------------------------------------------------------------------------- * * 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 37 "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 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif #ifdef yy_create_buffer #define psql_yy_create_buffer_ALREADY_DEFINED #else #define yy_create_buffer psql_yy_create_buffer #endif #ifdef yy_delete_buffer #define psql_yy_delete_buffer_ALREADY_DEFINED #else #define yy_delete_buffer psql_yy_delete_buffer #endif #ifdef yy_scan_buffer #define psql_yy_scan_buffer_ALREADY_DEFINED #else #define yy_scan_buffer psql_yy_scan_buffer #endif #ifdef yy_scan_string #define psql_yy_scan_string_ALREADY_DEFINED #else #define yy_scan_string psql_yy_scan_string #endif #ifdef yy_scan_bytes #define psql_yy_scan_bytes_ALREADY_DEFINED #else #define yy_scan_bytes psql_yy_scan_bytes #endif #ifdef yy_init_buffer #define psql_yy_init_buffer_ALREADY_DEFINED #else #define yy_init_buffer psql_yy_init_buffer #endif #ifdef yy_flush_buffer #define psql_yy_flush_buffer_ALREADY_DEFINED #else #define yy_flush_buffer psql_yy_flush_buffer #endif #ifdef yy_load_buffer_state #define psql_yy_load_buffer_state_ALREADY_DEFINED #else #define yy_load_buffer_state psql_yy_load_buffer_state #endif #ifdef yy_switch_to_buffer #define psql_yy_switch_to_buffer_ALREADY_DEFINED #else #define yy_switch_to_buffer psql_yy_switch_to_buffer #endif #ifdef yypush_buffer_state #define psql_yypush_buffer_state_ALREADY_DEFINED #else #define yypush_buffer_state psql_yypush_buffer_state #endif #ifdef yypop_buffer_state #define psql_yypop_buffer_state_ALREADY_DEFINED #else #define yypop_buffer_state psql_yypop_buffer_state #endif #ifdef yyensure_buffer_stack #define psql_yyensure_buffer_stack_ALREADY_DEFINED #else #define yyensure_buffer_stack psql_yyensure_buffer_stack #endif #ifdef yylex #define psql_yylex_ALREADY_DEFINED #else #define yylex psql_yylex #endif #ifdef yyrestart #define psql_yyrestart_ALREADY_DEFINED #else #define yyrestart psql_yyrestart #endif #ifdef yylex_init #define psql_yylex_init_ALREADY_DEFINED #else #define yylex_init psql_yylex_init #endif #ifdef yylex_init_extra #define psql_yylex_init_extra_ALREADY_DEFINED #else #define yylex_init_extra psql_yylex_init_extra #endif #ifdef yylex_destroy #define psql_yylex_destroy_ALREADY_DEFINED #else #define yylex_destroy psql_yylex_destroy #endif #ifdef yyget_debug #define psql_yyget_debug_ALREADY_DEFINED #else #define yyget_debug psql_yyget_debug #endif #ifdef yyset_debug #define psql_yyset_debug_ALREADY_DEFINED #else #define yyset_debug psql_yyset_debug #endif #ifdef yyget_extra #define psql_yyget_extra_ALREADY_DEFINED #else #define yyget_extra psql_yyget_extra #endif #ifdef yyset_extra #define psql_yyset_extra_ALREADY_DEFINED #else #define yyset_extra psql_yyset_extra #endif #ifdef yyget_in #define psql_yyget_in_ALREADY_DEFINED #else #define yyget_in psql_yyget_in #endif #ifdef yyset_in #define psql_yyset_in_ALREADY_DEFINED #else #define yyset_in psql_yyset_in #endif #ifdef yyget_out #define psql_yyget_out_ALREADY_DEFINED #else #define yyget_out psql_yyget_out #endif #ifdef yyset_out #define psql_yyset_out_ALREADY_DEFINED #else #define yyset_out psql_yyset_out #endif #ifdef yyget_leng #define psql_yyget_leng_ALREADY_DEFINED #else #define yyget_leng psql_yyget_leng #endif #ifdef yyget_text #define psql_yyget_text_ALREADY_DEFINED #else #define yyget_text psql_yyget_text #endif #ifdef yyget_lineno #define psql_yyget_lineno_ALREADY_DEFINED #else #define yyget_lineno psql_yyget_lineno #endif #ifdef yyset_lineno #define psql_yyset_lineno_ALREADY_DEFINED #else #define yyset_lineno psql_yyset_lineno #endif #ifdef yyget_column #define psql_yyget_column_ALREADY_DEFINED #else #define yyget_column psql_yyget_column #endif #ifdef yyset_column #define psql_yyset_column_ALREADY_DEFINED #else #define yyset_column psql_yyset_column #endif #ifdef yywrap #define psql_yywrap_ALREADY_DEFINED #else #define yywrap psql_yywrap #endif #ifdef yyget_lval #define psql_yyget_lval_ALREADY_DEFINED #else #define yyget_lval psql_yyget_lval #endif #ifdef yyset_lval #define psql_yyset_lval_ALREADY_DEFINED #else #define yyset_lval psql_yyset_lval #endif #ifdef yyalloc #define psql_yyalloc_ALREADY_DEFINED #else #define yyalloc psql_yyalloc #endif #ifdef yyrealloc #define psql_yyrealloc_ALREADY_DEFINED #else #define yyrealloc psql_yyrealloc #endif #ifdef yyfree #define psql_yyfree_ALREADY_DEFINED #else #define yyfree psql_yyfree #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 #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_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 yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #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) #define YY_LINENO_REWIND_TO(ptr) /* 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. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* 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 yyrestart ( FILE *input_file , yyscan_t yyscanner ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); void yypop_buffer_state ( yyscan_t yyscanner ); static void yyensure_buffer_stack ( yyscan_t yyscanner ); static void yy_load_buffer_state ( yyscan_t yyscanner ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); void *yyalloc ( yy_size_t , yyscan_t yyscanner ); void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); void yyfree ( void * , yyscan_t yyscanner ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ 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 ){\ yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ 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) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef flex_uint8_t 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 yynoreturn yy_fatal_error ( const 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 = (int) (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 const 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 const YY_CHAR 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 const YY_CHAR 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 const 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 const 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 const 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 const 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 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); #line 1035 "utils/psqlscan.c" #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 1195 "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; int yy_n_chars; int yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; int yy_did_buffer_switch_on_eof; int yy_start_stack_ptr; int yy_start_stack_depth; int *yy_start_stack; yy_state_type yy_last_accepting_state; char* yy_last_accepting_cpos; int yylineno_r; int yy_flex_debug_r; char *yytext_r; int yy_more_flag; int yy_more_len; YYSTYPE * yylval_r; }; /* 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 yylex_init (yyscan_t* scanner); int 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 yylex_destroy ( yyscan_t yyscanner ); int yyget_debug ( yyscan_t yyscanner ); void yyset_debug ( int debug_flag , yyscan_t yyscanner ); YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); FILE *yyget_in ( yyscan_t yyscanner ); void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); FILE *yyget_out ( yyscan_t yyscanner ); void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); int yyget_leng ( yyscan_t yyscanner ); char *yyget_text ( yyscan_t yyscanner ); int yyget_lineno ( yyscan_t yyscanner ); void yyset_lineno ( int _line_number , yyscan_t yyscanner ); int yyget_column ( yyscan_t yyscanner ); void yyset_column ( int _column_no , yyscan_t yyscanner ); YYSTYPE * yyget_lval ( yyscan_t yyscanner ); void 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 yywrap ( yyscan_t yyscanner ); #else extern int yywrap ( yyscan_t yyscanner ); #endif #endif #ifndef YY_NO_UNPUT #endif #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const 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 #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) 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 = '*'; \ int 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 = (int) fread(buf, 1, (yy_size_t) 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 yylex \ (YYSTYPE * yylval_param , yyscan_t yyscanner); #define YY_DECL int 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 /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 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 ) { yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } yy_load_buffer_state( yyscanner ); } { #line 387 "utils/psqlscan.l" #line 391 "utils/psqlscan.l" /* 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); #line 1496 "utils/psqlscan.c" while ( /*CONSTCOND*/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 { 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[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 405 "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 417 "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 426 "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 433 "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 441 "utils/psqlscan.l" { ECHO; } YY_BREAK case 6: YY_RULE_SETUP #line 445 "utils/psqlscan.l" { ECHO; } YY_BREAK case 7: YY_RULE_SETUP #line 449 "utils/psqlscan.l" { ECHO; } YY_BREAK /* */ case 8: YY_RULE_SETUP #line 454 "utils/psqlscan.l" { BEGIN(xb); ECHO; } YY_BREAK case 9: /* rule 9 can match eol */ #line 459 "utils/psqlscan.l" case 10: /* rule 10 can match eol */ YY_RULE_SETUP #line 459 "utils/psqlscan.l" { ECHO; } YY_BREAK case 11: YY_RULE_SETUP #line 463 "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 474 "utils/psqlscan.l" { yyless(1); /* eat only 'n' this time */ ECHO; } YY_BREAK case 13: YY_RULE_SETUP #line 479 "utils/psqlscan.l" { if (cur_state->std_strings) BEGIN(xq); else BEGIN(xe); ECHO; } YY_BREAK case 14: YY_RULE_SETUP #line 486 "utils/psqlscan.l" { BEGIN(xe); ECHO; } YY_BREAK case 15: YY_RULE_SETUP #line 490 "utils/psqlscan.l" { BEGIN(xus); ECHO; } YY_BREAK case 16: YY_RULE_SETUP #line 495 "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 508 "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 518 "utils/psqlscan.l" case 19: /* rule 19 can match eol */ YY_RULE_SETUP #line 518 "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 529 "utils/psqlscan.l" { ECHO; } YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP #line 532 "utils/psqlscan.l" { ECHO; } YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP #line 535 "utils/psqlscan.l" { ECHO; } YY_BREAK case 23: YY_RULE_SETUP #line 538 "utils/psqlscan.l" { ECHO; } YY_BREAK case 24: YY_RULE_SETUP #line 541 "utils/psqlscan.l" { ECHO; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP #line 544 "utils/psqlscan.l" { ECHO; } YY_BREAK case 26: YY_RULE_SETUP #line 547 "utils/psqlscan.l" { ECHO; } YY_BREAK case 27: YY_RULE_SETUP #line 550 "utils/psqlscan.l" { ECHO; } YY_BREAK case 28: YY_RULE_SETUP #line 553 "utils/psqlscan.l" { /* This is only needed for \ just before EOF */ ECHO; } YY_BREAK case 29: YY_RULE_SETUP #line 558 "utils/psqlscan.l" { cur_state->dolqstart = pg_strdup(yytext); BEGIN(xdolq); ECHO; } YY_BREAK case 30: YY_RULE_SETUP #line 563 "utils/psqlscan.l" { /* throw back all but the initial "$" */ yyless(1); ECHO; } YY_BREAK case 31: YY_RULE_SETUP #line 568 "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 586 "utils/psqlscan.l" { ECHO; } YY_BREAK case 33: YY_RULE_SETUP #line 589 "utils/psqlscan.l" { ECHO; } YY_BREAK case 34: YY_RULE_SETUP #line 592 "utils/psqlscan.l" { /* This is only needed for $ inside the quoted text */ ECHO; } YY_BREAK case 35: YY_RULE_SETUP #line 597 "utils/psqlscan.l" { BEGIN(xd); ECHO; } YY_BREAK case 36: YY_RULE_SETUP #line 601 "utils/psqlscan.l" { BEGIN(xui); ECHO; } YY_BREAK case 37: YY_RULE_SETUP #line 605 "utils/psqlscan.l" { BEGIN(INITIAL); ECHO; } YY_BREAK case 38: YY_RULE_SETUP #line 609 "utils/psqlscan.l" { BEGIN(INITIAL); ECHO; } YY_BREAK case 39: YY_RULE_SETUP #line 613 "utils/psqlscan.l" { ECHO; } YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP #line 616 "utils/psqlscan.l" { ECHO; } YY_BREAK case 41: YY_RULE_SETUP #line 620 "utils/psqlscan.l" { /* throw back all but the initial u/U */ yyless(1); ECHO; } YY_BREAK case 42: YY_RULE_SETUP #line 626 "utils/psqlscan.l" { ECHO; } YY_BREAK case 43: YY_RULE_SETUP #line 630 "utils/psqlscan.l" { ECHO; } YY_BREAK case 44: YY_RULE_SETUP #line 634 "utils/psqlscan.l" { ECHO; } YY_BREAK case 45: YY_RULE_SETUP #line 638 "utils/psqlscan.l" { ECHO; } YY_BREAK case 46: YY_RULE_SETUP #line 642 "utils/psqlscan.l" { ECHO; } YY_BREAK case 47: YY_RULE_SETUP #line 646 "utils/psqlscan.l" { ECHO; } YY_BREAK case 48: YY_RULE_SETUP #line 650 "utils/psqlscan.l" { ECHO; } YY_BREAK case 49: YY_RULE_SETUP #line 654 "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 664 "utils/psqlscan.l" { cur_state->paren_depth++; ECHO; } YY_BREAK case 51: YY_RULE_SETUP #line 669 "utils/psqlscan.l" { if (cur_state->paren_depth > 0) cur_state->paren_depth--; ECHO; } YY_BREAK case 52: YY_RULE_SETUP #line 675 "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 691 "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 698 "utils/psqlscan.l" { /* Terminate lexing temporarily */ cur_state->start_state = YY_START; return LEXRES_BACKSLASH; } YY_BREAK case 55: YY_RULE_SETUP #line 704 "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); /* 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 750 "utils/psqlscan.l" { psqlscan_escape_variable(cur_state, yytext, yyleng, PQUOTE_SQL_LITERAL); } YY_BREAK case 57: YY_RULE_SETUP #line 755 "utils/psqlscan.l" { psqlscan_escape_variable(cur_state, yytext, yyleng, PQUOTE_SQL_IDENT); } YY_BREAK case 58: YY_RULE_SETUP #line 760 "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 769 "utils/psqlscan.l" { /* Throw back everything but the colon */ yyless(1); ECHO; } YY_BREAK case 60: YY_RULE_SETUP #line 775 "utils/psqlscan.l" { /* Throw back everything but the colon */ yyless(1); ECHO; } YY_BREAK case 61: YY_RULE_SETUP #line 781 "utils/psqlscan.l" { /* Throw back everything but the colon */ yyless(1); ECHO; } YY_BREAK case 62: YY_RULE_SETUP #line 786 "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 796 "utils/psqlscan.l" { ECHO; } YY_BREAK case 64: YY_RULE_SETUP #line 800 "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 867 "utils/psqlscan.l" { ECHO; } YY_BREAK case 66: YY_RULE_SETUP #line 870 "utils/psqlscan.l" { ECHO; } YY_BREAK case 67: YY_RULE_SETUP #line 874 "utils/psqlscan.l" { ECHO; } YY_BREAK case 68: YY_RULE_SETUP #line 877 "utils/psqlscan.l" { ECHO; } YY_BREAK case 69: YY_RULE_SETUP #line 880 "utils/psqlscan.l" { ECHO; } YY_BREAK case 70: YY_RULE_SETUP #line 883 "utils/psqlscan.l" { ECHO; } YY_BREAK case 71: YY_RULE_SETUP #line 886 "utils/psqlscan.l" { ECHO; } YY_BREAK case 72: YY_RULE_SETUP #line 889 "utils/psqlscan.l" { ECHO; } YY_BREAK case 73: YY_RULE_SETUP #line 892 "utils/psqlscan.l" { ECHO; } YY_BREAK case 74: YY_RULE_SETUP #line 895 "utils/psqlscan.l" { ECHO; } YY_BREAK case 75: YY_RULE_SETUP #line 898 "utils/psqlscan.l" { /* throw back the .., and treat as integer */ yyless(yyleng - 2); ECHO; } YY_BREAK case 76: YY_RULE_SETUP #line 903 "utils/psqlscan.l" { ECHO; } YY_BREAK case 77: YY_RULE_SETUP #line 906 "utils/psqlscan.l" { ECHO; } YY_BREAK case 78: YY_RULE_SETUP #line 909 "utils/psqlscan.l" { ECHO; } YY_BREAK case 79: YY_RULE_SETUP #line 912 "utils/psqlscan.l" { ECHO; } YY_BREAK case 80: YY_RULE_SETUP #line 915 "utils/psqlscan.l" { ECHO; } YY_BREAK case 81: YY_RULE_SETUP #line 918 "utils/psqlscan.l" { ECHO; } YY_BREAK case 82: YY_RULE_SETUP #line 921 "utils/psqlscan.l" { ECHO; } YY_BREAK case 83: YY_RULE_SETUP #line 924 "utils/psqlscan.l" { ECHO; } YY_BREAK case 84: YY_RULE_SETUP #line 929 "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 982 "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 986 "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 1001 "utils/psqlscan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 2461 "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 * 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 ( 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 user's declarations */ } /* 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 (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = yyg->yytext_ptr; int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; 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; 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 ((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. */ int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } 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) { yy_state_type yy_current_state; 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 ) { 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[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + 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) { int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ char *yy_cp = yyg->yy_c_buf_p; 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[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 209); (void)yyg; return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) #else static int input (yyscan_t yyscanner) #endif { int c; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) /* This was really a NUL. */ *yyg->yy_c_buf_p = '\0'; else { /* need more input */ int offset = (int) (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. */ yyrestart( yyin , yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( yyscanner ) ) return 0; 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 yyrestart (FILE * input_file , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); yy_load_buffer_state( yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ void 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 * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ 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; yy_load_buffer_state( yyscanner ); /* 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. */ yyg->yy_did_buffer_switch_on_eof = 1; } static void 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 yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); 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( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); 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 , yyscanner); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * @param yyscanner The scanner object. */ void 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 ) yyfree( (void *) b->yy_ch_buf , yyscanner ); 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 yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_flush_buffer( b , yyscanner); 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. * @param yyscanner The scanner object. */ void 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 ) 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 yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; yyensure_buffer_stack(yyscanner); /* This block is copied from 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 yy_switch_to_buffer. */ 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 yypop_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; 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) { 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 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; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in 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. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)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 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 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 NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (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 = NULL; 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 , yyscanner ); 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 * @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 * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) { return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } /** 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. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n , yyscanner ); 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 , yyscanner); 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 yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; 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 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 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 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 *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 *yyget_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ int 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 *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 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 line number * @param yyscanner The scanner object. */ void 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( "yyset_lineno called with no buffer" ); yylineno = _line_number; } /** Set the current column. * @param _column_no column number * @param yyscanner The scanner object. */ void 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( "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 yy_switch_to_buffer */ void yyset_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyin = _in_str ; } void yyset_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyout = _out_str ; } int yyget_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } void 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 * yyget_lval (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } /* User-visible API */ /* 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 yylex_init(yyscan_t* ptr_yy_globals) { if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) 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 ); } /* yylex_init_extra has the same functionality as 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 yyalloc in * the yyextra field. */ int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; yyset_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) 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)); 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 yylex_destroy(), so don't allocate here. */ yyg->yy_buffer_stack = NULL; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; yyg->yy_c_buf_p = NULL; 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 = NULL; yyout = NULL; #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 (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ yyfree(yyg->yy_buffer_stack , yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ 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 * yylex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* Destroy the main struct (reentrant only). */ yyfree ( yyscanner , yyscanner ); yyscanner = NULL; return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s , yyscan_t yyscanner) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; /* 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 realloc(ptr, size); } void yyfree (void * ptr , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 1001 "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; 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.7.0/src/utils/pool_select_walker.c0000644000175000017500000012102015116217422016207 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.7.0/src/utils/strlcpy.c0000644000175000017500000000466315116217422014047 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.7.0/src/utils/psprintf.c0000644000175000017500000001302215116217422014201 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.7.0/src/utils/pool_params.c0000644000175000017500000000663415116217422014663 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.7.0/src/utils/ps_status.c0000644000175000017500000002452015116217422014366 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.7.0/src/utils/pool_shmem.c0000644000175000017500000001141015116217422014475 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.7.0/src/utils/pool_sema.c0000644000175000017500000001111415116217422014312 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.7.0/src/utils/pool_signal.c0000644000175000017500000001132315116217422014644 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.7.0/src/utils/pool_path.c0000644000175000017500000001705415116217422014332 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.7.0/src/utils/pool_ip.c0000644000175000017500000003572115116217422014007 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.7.0/src/utils/pool_relcache.c0000644000175000017500000004060215116217422015137 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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, void *(*register_func) (POOL_SELECT_RESULT *), void *(*unregister_func) (void *), 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:%lld expiration time:%lld", dbname, table, (long long) now, (long long) 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.7.0/src/utils/pool_process_reporting.c0000644000175000017500000026715415116217422017155 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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, "work_dir", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->work_dir); StrNCpy(status[i].desc, "directory to create pgpool_status and lock files ", 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_database", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->recovery_database); StrNCpy(status[i].desc, "database name for online recovery", 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)); /* remove a newline added by ctime() */ *(strchrnul(status[i].value, '\n')) = '\0'; 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); StrNCpy(pools[lines].client_host, pi->client_host, NI_MAXHOST); StrNCpy(pools[lines].client_port, pi->client_port, NI_MAXSERV); /* * If this the statement was sent to backend id report the * statement. */ if (is_pi_set(pi->node_ids, backend_id)) { StrNCpy(pools[lines].statement, pi->statement, MAXSTMTLEN); elog(LOG, "pi->node_ids[0]:%ld pi->node_ids[1]:%ld", pi->node_ids[0], pi->node_ids[1]); } 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", "client_host", "client_port", "statement"}; 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 %lld", (long long) 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.7.0/src/utils/pool_ssl.c0000644000175000017500000007105615116217422014201 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.7.0/src/utils/pool_stream.c0000644000175000017500000007211115116217422014664 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.7.0/src/utils/socket_stream.c0000644000175000017500000000770515116217422015212 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.7.0/src/utils/getopt_long.c0000644000175000017500000001121015116217422014652 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.7.0/src/utils/regex_array.c0000644000175000017500000001233115116217422014646 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.7.0/src/utils/json_writer.c0000644000175000017500000002012515116217422014703 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 void jw_put_string_escape(JsonNode *jNode, char *string); 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, ','); jw_put_string_escape(jNode, key); appendStringInfoChar(jNode->buf, ':'); jw_put_string_escape(jNode, value); jw_inc_current_element_count(jNode); return true; } static void jw_put_string_escape(JsonNode *jNode, char *string) { int i; appendStringInfoChar(jNode->buf, '"'); for (i = 0; string[i] != '\0'; i++) { switch (string[i]) { case '\"': appendStringInfo(jNode->buf, "\\\""); break; case '\\': appendStringInfo(jNode->buf, "\\\\"); break; case '\b': appendStringInfo(jNode->buf, "\\b"); break; case '\f': appendStringInfo(jNode->buf, "\\f"); break; case '\n': appendStringInfo(jNode->buf, "\\n"); break; case '\r': appendStringInfo(jNode->buf, "\\r"); break; case '\t': appendStringInfo(jNode->buf, "\\t"); break; default: appendStringInfoChar(jNode->buf, string[i]); break; } } appendStringInfoChar(jNode->buf, '"'); } /* 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.7.0/src/utils/json.c0000644000175000017500000006170215116217422013315 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_llong_value_for_key(json_value *source, const char *key, long 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.7.0/src/utils/scram-common.c0000644000175000017500000001352515116217422014737 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.7.0/src/utils/base64.c0000644000175000017500000000747415116217422013436 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.7.0/src/utils/sha2.c0000644000175000017500000006506015116217422013202 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.7.0/src/utils/ssl_utils.c0000644000175000017500000001637715116217422014375 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-2025 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) 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) 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.7.0/src/utils/statistics.c0000644000175000017500000001046615116217422014537 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.7.0/src/utils/pool_health_check_stats.c0000644000175000017500000000725615116217422017221 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2025 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), offsetof(POOL_REPORT_POOLS, client_host), offsetof(POOL_REPORT_POOLS, client_port), offsetof(POOL_REPORT_POOLS, statement) }; *n = sizeof(offsettbl) / sizeof(int); return offsettbl; } pgpool-II-4.7.0/src/utils/psqlscan.l0000644000175000017500000012145315116217422014201 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.7.0/src/utils/pgstrcasecmp.c0000644000175000017500000000710315116217422015032 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.7.0/src/utils/pg_strong_random.c0000644000175000017500000001012115116217422015673 00000000000000/* * This file was imported from PostgreSQL source code * (src/port/pg_strong_random.c). */ /*------------------------------------------------------------------------- * * pg_strong_random.c * generate a cryptographically secure random number * * Our definition of "strong" is that it's suitable for generating random * salts and query cancellation keys, during authentication. * * Note: this code is run quite early in postmaster and backend startup; * therefore, even when built for backend, it cannot rely on backend * infrastructure such as elog() or palloc(). * * Portions Copyright (c) 2025, PgPool Global Development Group * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group * * IDENTIFICATION * src/port/pg_strong_random.c * *------------------------------------------------------------------------- */ #include "pool.h" #ifndef USE_SSL #include #endif #include #include #include /* * pg_strong_random & pg_strong_random_init * * Generate requested number of random bytes. The returned bytes are * cryptographically secure, suitable for use e.g. in authentication. * * Before pg_strong_random is called in any process, the generator must first * be initialized by calling pg_strong_random_init(). Initialization is a no- * op for all supported randomness sources, it is kept to maintain backwards * compatibility with extensions. * * We rely on system facilities for actually generating the numbers. * We support a number of sources: * * 1. OpenSSL's RAND_bytes() * 2. Windows' CryptGenRandom() function * 3. /dev/urandom * * Returns true on success, and false if none of the sources * were available. NB: It is important to check the return value! * Proceeding with key generation when no random data was available * would lead to predictable keys and security issues. */ #ifdef USE_SSL #include void pg_strong_random_init(void) { /* No initialization needed */ } bool pg_strong_random(void *buf, size_t len) { int i; /* * Check that OpenSSL's CSPRNG has been sufficiently seeded, and if not * add more seed data using RAND_poll(). With some older versions of * OpenSSL, it may be necessary to call RAND_poll() a number of times. If * RAND_poll() fails to generate seed data within the given amount of * retries, subsequent RAND_bytes() calls will fail, but we allow that to * happen to let pg_strong_random() callers handle that with appropriate * error handling. */ #define NUM_RAND_POLL_RETRIES 8 for (i = 0; i < NUM_RAND_POLL_RETRIES; i++) { if (RAND_status() == 1) { /* The CSPRNG is sufficiently seeded */ break; } RAND_poll(); } if (RAND_bytes(buf, len) == 1) return true; return false; } #elif WIN32 #include /* * Cache a global crypto provider that only gets freed when the process * exits, in case we need random numbers more than once. */ static HCRYPTPROV hProvider = 0; void pg_strong_random_init(void) { /* No initialization needed on WIN32 */ } bool pg_strong_random(void *buf, size_t len) { if (hProvider == 0) { if (!CryptAcquireContext(&hProvider, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { /* * On failure, set back to 0 in case the value was for some reason * modified. */ hProvider = 0; } } /* Re-check in case we just retrieved the provider */ if (hProvider != 0) { if (CryptGenRandom(hProvider, len, buf)) return true; } return false; } #else /* not USE_OPENSSL or WIN32 */ /* * Without OpenSSL or Win32 support, just read /dev/urandom ourselves. */ void pg_strong_random_init(void) { /* No initialization needed */ } bool pg_strong_random(void *buf, size_t len) { int f; char *p = buf; ssize_t res; f = open("/dev/urandom", O_RDONLY, 0); if (f == -1) return false; while (len) { res = read(f, p, len); if (res <= 0) { if (errno == EINTR) continue; /* interrupted by signal, just retry */ close(f); return false; } p += res; len -= res; } close(f); return true; } #endif pgpool-II-4.7.0/src/utils/pg_prng.c0000644000175000017500000001671315116217422014002 00000000000000/* * This file was imported from PostgreSQL source code * (src/common/pg_prng.c). */ /*------------------------------------------------------------------------- * * Pseudo-Random Number Generator * * We use Blackman and Vigna's xoroshiro128** 1.0 algorithm * to have a small, fast PRNG suitable for generating reasonably * good-quality 64-bit data. This should not be considered * cryptographically strong, however. * * About these generators: https://prng.di.unimi.it/ * See also https://en.wikipedia.org/wiki/List_of_random_number_generators * * Portions Copyright (c) 2025, PgPool Global Development Group * Portions Copyright (c) 2021-2025, PostgreSQL Global Development Group * * src/common/pg_prng.c * *------------------------------------------------------------------------- */ #include "pool.h" #include #include "utils/pg_prng.h" /* X/Open (XSI) requires to provide M_PI, but core POSIX does not */ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif /* process-wide state vector */ pg_prng_state pg_global_prng_state; /* * 64-bit rotate left */ static inline uint64 rotl(uint64 x, int bits) { return (x << bits) | (x >> (64 - bits)); } /* * The basic xoroshiro128** algorithm. * Generates and returns a 64-bit uniformly distributed number, * updating the state vector for next time. * * Note: the state vector must not be all-zeroes, as that is a fixed point. */ static uint64 xoroshiro128ss(pg_prng_state *state) { uint64 s0 = state->s0, sx = state->s1 ^ s0, val = rotl(s0 * 5, 7) * 9; /* update state */ state->s0 = rotl(s0, 24) ^ sx ^ (sx << 16); state->s1 = rotl(sx, 37); return val; } /* * We use this generator just to fill the xoroshiro128** state vector * from a 64-bit seed. */ static uint64 splitmix64(uint64 *state) { /* state update */ uint64 val = (*state += UINT64CONST(0x9E3779B97f4A7C15)); /* value extraction */ val = (val ^ (val >> 30)) * UINT64CONST(0xBF58476D1CE4E5B9); val = (val ^ (val >> 27)) * UINT64CONST(0x94D049BB133111EB); return val ^ (val >> 31); } /* * Initialize the PRNG state from a 64-bit integer, * taking care that we don't produce all-zeroes. */ void pg_prng_seed(pg_prng_state *state, uint64 seed) { state->s0 = splitmix64(&seed); state->s1 = splitmix64(&seed); /* Let's just make sure we didn't get all-zeroes */ (void) pg_prng_seed_check(state); } /* * Initialize the PRNG state from a double in the range [-1.0, 1.0], * taking care that we don't produce all-zeroes. */ void pg_prng_fseed(pg_prng_state *state, double fseed) { /* Assume there's about 52 mantissa bits; the sign contributes too. */ int64 seed = ((double) ((UINT64CONST(1) << 52) - 1)) * fseed; pg_prng_seed(state, (uint64) seed); } /* * Validate a PRNG seed value. */ bool pg_prng_seed_check(pg_prng_state *state) { /* * If the seeding mechanism chanced to produce all-zeroes, insert * something nonzero. Anything would do; use Knuth's LCG parameters. */ if (unlikely(state->s0 == 0 && state->s1 == 0)) { state->s0 = UINT64CONST(0x5851F42D4C957F2D); state->s1 = UINT64CONST(0x14057B7EF767814F); } /* As a convenience for the pg_prng_strong_seed macro, return true */ return true; } /* * Select a random uint64 uniformly from the range [0, PG_UINT64_MAX]. */ uint64 pg_prng_uint64(pg_prng_state *state) { return xoroshiro128ss(state); } /* * We ignore some functions because we do not port pg_bitutils.c (yet). */ #ifdef NOT_USED /* * Select a random uint64 uniformly from the range [rmin, rmax]. * If the range is empty, rmin is always produced. */ uint64 pg_prng_uint64_range(pg_prng_state *state, uint64 rmin, uint64 rmax) { uint64 val; if (likely(rmax > rmin)) { /* * Use bitmask rejection method to generate an offset in 0..range. * Each generated val is less than twice "range", so on average we * should not have to iterate more than twice. */ uint64 range = rmax - rmin; uint32 rshift = 63 - pg_leftmost_one_pos64(range); do { val = xoroshiro128ss(state) >> rshift; } while (val > range); } else val = 0; return rmin + val; } /* * Select a random int64 uniformly from the range [PG_INT64_MIN, PG_INT64_MAX]. */ int64 pg_prng_int64(pg_prng_state *state) { return (int64) xoroshiro128ss(state); } #endif /* * Select a random int64 uniformly from the range [0, PG_INT64_MAX]. */ int64 pg_prng_int64p(pg_prng_state *state) { return (int64) (xoroshiro128ss(state) & UINT64CONST(0x7FFFFFFFFFFFFFFF)); } #ifdef NOT_USED /* * Select a random int64 uniformly from the range [rmin, rmax]. * If the range is empty, rmin is always produced. */ int64 pg_prng_int64_range(pg_prng_state *state, int64 rmin, int64 rmax) { int64 val; if (likely(rmax > rmin)) { uint64 uval; /* * Use pg_prng_uint64_range(). Can't simply pass it rmin and rmax, * since (uint64) rmin will be larger than (uint64) rmax if rmin < 0. */ uval = (uint64) rmin + pg_prng_uint64_range(state, 0, (uint64) rmax - (uint64) rmin); /* * Safely convert back to int64, avoiding implementation-defined * behavior for values larger than PG_INT64_MAX. Modern compilers * will reduce this to a simple assignment. */ if (uval > PG_INT64_MAX) val = (int64) (uval - PG_INT64_MIN) + PG_INT64_MIN; else val = (int64) uval; } else val = rmin; return val; } #endif /* * Select a random uint32 uniformly from the range [0, PG_UINT32_MAX]. */ uint32 pg_prng_uint32(pg_prng_state *state) { /* * Although xoroshiro128** is not known to have any weaknesses in * randomness of low-order bits, we prefer to use the upper bits of its * result here and below. */ uint64 v = xoroshiro128ss(state); return (uint32) (v >> 32); } /* * Select a random int32 uniformly from the range [PG_INT32_MIN, PG_INT32_MAX]. */ int32 pg_prng_int32(pg_prng_state *state) { uint64 v = xoroshiro128ss(state); return (int32) (v >> 32); } /* * Select a random int32 uniformly from the range [0, PG_INT32_MAX]. */ int32 pg_prng_int32p(pg_prng_state *state) { uint64 v = xoroshiro128ss(state); return (int32) (v >> 33); } /* * Select a random double uniformly from the range [0.0, 1.0). * * Note: if you want a result in the range (0.0, 1.0], the standard way * to get that is "1.0 - pg_prng_double(state)". */ double pg_prng_double(pg_prng_state *state) { uint64 v = xoroshiro128ss(state); /* * As above, assume there's 52 mantissa bits in a double. This result * could round to 1.0 if double's precision is less than that; but we * assume IEEE float arithmetic elsewhere in Postgres, so this seems OK. */ return ldexp((double) (v >> (64 - 52)), -52); } /* * Select a random double from the normal distribution with * mean = 0.0 and stddev = 1.0. * * To get a result from a different normal distribution use * STDDEV * pg_prng_double_normal() + MEAN * * Uses https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform */ double pg_prng_double_normal(pg_prng_state *state) { double u1, u2, z0; /* * pg_prng_double generates [0, 1), but for the basic version of the * Box-Muller transform the two uniformly distributed random numbers are * expected to be in (0, 1]; in particular we'd better not compute log(0). */ u1 = 1.0 - pg_prng_double(state); u2 = 1.0 - pg_prng_double(state); /* Apply Box-Muller transform to get one normal-valued output */ z0 = sqrt(-2.0 * log(u1)) * sin(2.0 * M_PI * u2); return z0; } /* * Select a random boolean value. */ bool pg_prng_bool(pg_prng_state *state) { uint64 v = xoroshiro128ss(state); return (bool) (v >> 63); } pgpool-II-4.7.0/src/utils/sprompt.c0000644000175000017500000001127015116217422014043 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.7.0/src/Makefile.am0000644000175000017500000001634115116217422013073 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/pg_strong_random.c \ utils/pg_prng.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/pgpool_adm--1.6.sql \ sql/pgpool_adm/pgpool_adm--1.5--1.6.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.7.0/src/Makefile.in0000644000175000017500000012455215120777440013116 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 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 = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) 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) \ utils/pg_strong_random.$(OBJEXT) utils/pg_prng.$(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__maybe_remake_depfiles = 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 distdir-am 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) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ylwrap \ config/pool_config.c utils/psqlscan.c 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ runstatedir = @runstatedir@ 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 \ utils/pg_strong_random.c \ utils/pg_prng.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/pgpool_adm--1.6.sql \ sql/pgpool_adm/pgpool_adm--1.5--1.6.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 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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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) utils/pg_strong_random.$(OBJEXT): utils/$(am__dirstamp) utils/pg_prng.$(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 .PRECIOUS: Makefile 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.7.0/src/pgpool.spec0000644000175000017500000004713615116217422013221 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 %global _varlibdir %{_localstatedir}/lib/pgpool Summary: Pgpool is a connection pooling/replication server for PostgreSQL Name: pgpool-II-pg%{pg_version} Version: %{pgpool_version} Release: 1pgdg%{?dist} License: BSD Group: Applications/Databases Vendor: Pgpool Global Development Group URL: http://www.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 Patch4: pgpool.conf.sample.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 < %{version} # 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 %patch4 -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} mkdir -p %{buildroot}%{_varlibdir} 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} %attr(0755,postgres,postgres) %dir %{_varlibdir} %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--1.6.sql %{pghome}/share/extension/pgpool_adm--1.5--1.6.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 * Tue Oct 14 2025 Taiki Koshino 4.7.0 - Change the value of log_directory parameter to '/var/log/pgpool'. - Create '/var/lib/pgpool' and set it to work_dir. * 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.7.0/src/parser/0000755000175000017500000000000015120777703012416 500000000000000pgpool-II-4.7.0/src/parser/Makefile.am0000644000175000017500000000164515116217422014370 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.7.0/src/parser/Makefile.in0000644000175000017500000005045515120777440014412 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 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 = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) 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_builddir)/src/utils/mmgr/mcxt.$(OBJEXT) \ $(top_builddir)/src/utils/mmgr/aset.$(OBJEXT) \ $(top_builddir)/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__maybe_remake_depfiles = 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ylwrap README \ gram.c gram.h gram_minimal.c gram_minimal.h 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ runstatedir = @runstatedir@ 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 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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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_builddir)/src/utils/mmgr/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/src/utils/mmgr @: > $(top_builddir)/src/utils/mmgr/$(am__dirstamp) $(top_builddir)/src/utils/mmgr/mcxt.$(OBJEXT): \ $(top_builddir)/src/utils/mmgr/$(am__dirstamp) $(top_builddir)/src/utils/mmgr/aset.$(OBJEXT): \ $(top_builddir)/src/utils/mmgr/$(am__dirstamp) $(top_builddir)/src/utils/error/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/src/utils/error @: > $(top_builddir)/src/utils/error/$(am__dirstamp) $(top_builddir)/src/utils/error/elog.$(OBJEXT): \ $(top_builddir)/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_builddir)/src/utils/error/*.$(OBJEXT) -rm -f $(top_builddir)/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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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_builddir)/src/utils/error/$(am__dirstamp)" || rm -f $(top_builddir)/src/utils/error/$(am__dirstamp) -test -z "$(top_builddir)/src/utils/mmgr/$(am__dirstamp)" || rm -f $(top_builddir)/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 .PRECIOUS: Makefile 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.7.0/src/parser/README0000644000175000017500000000352515116217422013213 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.7.0/src/parser/gram.c0000644000175000017500001333514015120733626013436 00000000000000/* A Bison parser, made by GNU Bison 3.7.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 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. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* 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, and Bison version. */ #define YYBISON 30704 /* Bison version string. */ #define YYBISON_VERSION "3.7.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 /* First part of user prologue. */ #line 1 "gram.y" /*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y * POSTGRESQL BISON rules/actions * * Portions Copyright (c) 2003-2025, PgPool Global Development Group * Portions Copyright (c) 1996-2025, 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' #define ATTRIBUTE_GENERATED_STORED 's' #define ATTRIBUTE_GENERATED_VIRTUAL 'v' /* * 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. Unlike bison's default, we only want * to track the start position not the end position of each nonterminal. * Nonterminals that reduce to empty receive position "-1". Since a * production's leading RHS nonterminal(s) may have reduced to empty, * we have to scan to find the first one that's not -1. */ #define YYLLOC_DEFAULT(Current, Rhs, N) \ do { \ (Current) = (-1); \ for (int _i = 1; _i <= (N); _i++) \ { \ if ((Rhs)[_i] >= 0) \ { \ (Current) = (Rhs)[_i]; \ break; \ } \ } \ } while (0) /* * 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 select_limit & limit_clause productions */ typedef struct SelectLimit { Node *limitOffset; Node *limitCount; LimitOption limitOption; /* indicates presence of WITH TIES */ ParseLoc offsetLoc; /* location of OFFSET token, if present */ ParseLoc countLoc; /* location of LIMIT/FETCH token, if present */ ParseLoc optionLoc; /* location of WITH TIES, if present */ } 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 CAS_NOT_ENFORCED 0x40 #define CAS_ENFORCED 0x80 #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, int end_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, core_yyscan_t yyscanner); 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 *is_enforced, bool *not_valid, bool *no_inherit, core_yyscan_t yyscanner); static PartitionStrategy parsePartitionStrategy(char *strategy, int location, core_yyscan_t yyscanner); static void preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner); static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); #line 323 "gram.c" # ifndef YY_CAST # ifdef __cplusplus # define YY_CAST(Type, Val) static_cast (Val) # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else # define YY_CAST(Type, Val) ((Type) (Val)) # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Use api.header.include to #include this header instead of duplicating it here. */ #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 kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ IDENT = 258, /* IDENT */ UIDENT = 259, /* UIDENT */ FCONST = 260, /* FCONST */ SCONST = 261, /* SCONST */ USCONST = 262, /* USCONST */ BCONST = 263, /* BCONST */ XCONST = 264, /* XCONST */ Op = 265, /* Op */ ICONST = 266, /* ICONST */ PARAM = 267, /* PARAM */ TYPECAST = 268, /* TYPECAST */ DOT_DOT = 269, /* DOT_DOT */ COLON_EQUALS = 270, /* COLON_EQUALS */ EQUALS_GREATER = 271, /* EQUALS_GREATER */ LESS_EQUALS = 272, /* LESS_EQUALS */ GREATER_EQUALS = 273, /* GREATER_EQUALS */ NOT_EQUALS = 274, /* NOT_EQUALS */ ABORT_P = 275, /* ABORT_P */ ABSENT = 276, /* ABSENT */ ABSOLUTE_P = 277, /* ABSOLUTE_P */ ACCESS = 278, /* ACCESS */ ACTION = 279, /* ACTION */ ADD_P = 280, /* ADD_P */ ADMIN = 281, /* ADMIN */ AFTER = 282, /* AFTER */ AGGREGATE = 283, /* AGGREGATE */ ALL = 284, /* ALL */ ALSO = 285, /* ALSO */ ALTER = 286, /* ALTER */ ALWAYS = 287, /* ALWAYS */ ANALYSE = 288, /* ANALYSE */ ANALYZE = 289, /* ANALYZE */ AND = 290, /* AND */ ANY = 291, /* ANY */ ARRAY = 292, /* ARRAY */ AS = 293, /* AS */ ASC = 294, /* ASC */ ASENSITIVE = 295, /* ASENSITIVE */ ASSERTION = 296, /* ASSERTION */ ASSIGNMENT = 297, /* ASSIGNMENT */ ASYMMETRIC = 298, /* ASYMMETRIC */ ATOMIC = 299, /* ATOMIC */ AT = 300, /* AT */ ATTACH = 301, /* ATTACH */ ATTRIBUTE = 302, /* ATTRIBUTE */ AUTHORIZATION = 303, /* AUTHORIZATION */ BACKWARD = 304, /* BACKWARD */ BEFORE = 305, /* BEFORE */ BEGIN_P = 306, /* BEGIN_P */ BETWEEN = 307, /* BETWEEN */ BIGINT = 308, /* BIGINT */ BINARY = 309, /* BINARY */ BIT = 310, /* BIT */ BOOLEAN_P = 311, /* BOOLEAN_P */ BOTH = 312, /* BOTH */ BREADTH = 313, /* BREADTH */ BY = 314, /* BY */ CACHE = 315, /* CACHE */ CALL = 316, /* CALL */ CALLED = 317, /* CALLED */ CASCADE = 318, /* CASCADE */ CASCADED = 319, /* CASCADED */ CASE = 320, /* CASE */ CAST = 321, /* CAST */ CATALOG_P = 322, /* CATALOG_P */ CHAIN = 323, /* CHAIN */ CHAR_P = 324, /* CHAR_P */ CHARACTER = 325, /* CHARACTER */ CHARACTERISTICS = 326, /* CHARACTERISTICS */ CHECK = 327, /* CHECK */ CHECKPOINT = 328, /* CHECKPOINT */ CLASS = 329, /* CLASS */ CLOSE = 330, /* CLOSE */ CLUSTER = 331, /* CLUSTER */ COALESCE = 332, /* COALESCE */ COLLATE = 333, /* COLLATE */ COLLATION = 334, /* COLLATION */ COLUMN = 335, /* COLUMN */ COLUMNS = 336, /* COLUMNS */ COMMENT = 337, /* COMMENT */ COMMENTS = 338, /* COMMENTS */ COMMIT = 339, /* COMMIT */ COMMITTED = 340, /* COMMITTED */ COMPRESSION = 341, /* COMPRESSION */ CONCURRENTLY = 342, /* CONCURRENTLY */ CONDITIONAL = 343, /* CONDITIONAL */ CONFIGURATION = 344, /* CONFIGURATION */ CONFLICT = 345, /* CONFLICT */ CONNECTION = 346, /* CONNECTION */ CONSTRAINT = 347, /* CONSTRAINT */ CONSTRAINTS = 348, /* CONSTRAINTS */ CONTENT_P = 349, /* CONTENT_P */ CONTINUE_P = 350, /* CONTINUE_P */ CONVERSION_P = 351, /* CONVERSION_P */ COPY = 352, /* COPY */ COST = 353, /* COST */ CREATE = 354, /* CREATE */ CROSS = 355, /* CROSS */ CSV = 356, /* CSV */ CUBE = 357, /* CUBE */ CURRENT_P = 358, /* CURRENT_P */ CURRENT_CATALOG = 359, /* CURRENT_CATALOG */ CURRENT_DATE = 360, /* CURRENT_DATE */ CURRENT_ROLE = 361, /* CURRENT_ROLE */ CURRENT_SCHEMA = 362, /* CURRENT_SCHEMA */ CURRENT_TIME = 363, /* CURRENT_TIME */ CURRENT_TIMESTAMP = 364, /* CURRENT_TIMESTAMP */ CURRENT_USER = 365, /* CURRENT_USER */ CURSOR = 366, /* CURSOR */ CYCLE = 367, /* CYCLE */ DATA_P = 368, /* DATA_P */ DATABASE = 369, /* DATABASE */ DAY_P = 370, /* DAY_P */ DEALLOCATE = 371, /* DEALLOCATE */ DEC = 372, /* DEC */ DECIMAL_P = 373, /* DECIMAL_P */ DECLARE = 374, /* DECLARE */ DEFAULT = 375, /* DEFAULT */ DEFAULTS = 376, /* DEFAULTS */ DEFERRABLE = 377, /* DEFERRABLE */ DEFERRED = 378, /* DEFERRED */ DEFINER = 379, /* DEFINER */ DELETE_P = 380, /* DELETE_P */ DELIMITER = 381, /* DELIMITER */ DELIMITERS = 382, /* DELIMITERS */ DEPENDS = 383, /* DEPENDS */ DEPTH = 384, /* DEPTH */ DESC = 385, /* DESC */ DETACH = 386, /* DETACH */ DICTIONARY = 387, /* DICTIONARY */ DISABLE_P = 388, /* DISABLE_P */ DISCARD = 389, /* DISCARD */ DISTINCT = 390, /* DISTINCT */ DO = 391, /* DO */ DOCUMENT_P = 392, /* DOCUMENT_P */ DOMAIN_P = 393, /* DOMAIN_P */ DOUBLE_P = 394, /* DOUBLE_P */ DROP = 395, /* DROP */ EACH = 396, /* EACH */ ELSE = 397, /* ELSE */ EMPTY_P = 398, /* EMPTY_P */ ENABLE_P = 399, /* ENABLE_P */ ENCODING = 400, /* ENCODING */ ENCRYPTED = 401, /* ENCRYPTED */ END_P = 402, /* END_P */ ENFORCED = 403, /* ENFORCED */ ENUM_P = 404, /* ENUM_P */ ERROR_P = 405, /* ERROR_P */ ESCAPE = 406, /* ESCAPE */ EVENT = 407, /* EVENT */ EXCEPT = 408, /* EXCEPT */ EXCLUDE = 409, /* EXCLUDE */ EXCLUDING = 410, /* EXCLUDING */ EXCLUSIVE = 411, /* EXCLUSIVE */ EXECUTE = 412, /* EXECUTE */ EXISTS = 413, /* EXISTS */ EXPLAIN = 414, /* EXPLAIN */ EXPRESSION = 415, /* EXPRESSION */ EXTENSION = 416, /* EXTENSION */ EXTERNAL = 417, /* EXTERNAL */ EXTRACT = 418, /* EXTRACT */ FALSE_P = 419, /* FALSE_P */ FAMILY = 420, /* FAMILY */ FETCH = 421, /* FETCH */ FILTER = 422, /* FILTER */ FINALIZE = 423, /* FINALIZE */ FIRST_P = 424, /* FIRST_P */ FLOAT_P = 425, /* FLOAT_P */ FOLLOWING = 426, /* FOLLOWING */ FOR = 427, /* FOR */ FORCE = 428, /* FORCE */ FOREIGN = 429, /* FOREIGN */ FORMAT = 430, /* FORMAT */ FORWARD = 431, /* FORWARD */ FREEZE = 432, /* FREEZE */ FROM = 433, /* FROM */ FULL = 434, /* FULL */ FUNCTION = 435, /* FUNCTION */ FUNCTIONS = 436, /* FUNCTIONS */ GENERATED = 437, /* GENERATED */ GLOBAL = 438, /* GLOBAL */ GRANT = 439, /* GRANT */ GRANTED = 440, /* GRANTED */ GREATEST = 441, /* GREATEST */ GROUP_P = 442, /* GROUP_P */ GROUPING = 443, /* GROUPING */ GROUPS = 444, /* GROUPS */ HANDLER = 445, /* HANDLER */ HAVING = 446, /* HAVING */ HEADER_P = 447, /* HEADER_P */ HOLD = 448, /* HOLD */ HOUR_P = 449, /* HOUR_P */ IDENTITY_P = 450, /* IDENTITY_P */ IF_P = 451, /* IF_P */ ILIKE = 452, /* ILIKE */ IMMEDIATE = 453, /* IMMEDIATE */ IMMUTABLE = 454, /* IMMUTABLE */ IMPLICIT_P = 455, /* IMPLICIT_P */ IMPORT_P = 456, /* IMPORT_P */ IN_P = 457, /* IN_P */ INCLUDE = 458, /* INCLUDE */ INCLUDING = 459, /* INCLUDING */ INCREMENT = 460, /* INCREMENT */ INDENT = 461, /* INDENT */ INDEX = 462, /* INDEX */ INDEXES = 463, /* INDEXES */ INHERIT = 464, /* INHERIT */ INHERITS = 465, /* INHERITS */ INITIALLY = 466, /* INITIALLY */ INLINE_P = 467, /* INLINE_P */ INNER_P = 468, /* INNER_P */ INOUT = 469, /* INOUT */ INPUT_P = 470, /* INPUT_P */ INSENSITIVE = 471, /* INSENSITIVE */ INSERT = 472, /* INSERT */ INSTEAD = 473, /* INSTEAD */ INT_P = 474, /* INT_P */ INTEGER = 475, /* INTEGER */ INTERSECT = 476, /* INTERSECT */ INTERVAL = 477, /* INTERVAL */ INTO = 478, /* INTO */ INVOKER = 479, /* INVOKER */ IS = 480, /* IS */ ISNULL = 481, /* ISNULL */ ISOLATION = 482, /* ISOLATION */ JOIN = 483, /* JOIN */ JSON = 484, /* JSON */ JSON_ARRAY = 485, /* JSON_ARRAY */ JSON_ARRAYAGG = 486, /* JSON_ARRAYAGG */ JSON_EXISTS = 487, /* JSON_EXISTS */ JSON_OBJECT = 488, /* JSON_OBJECT */ JSON_OBJECTAGG = 489, /* JSON_OBJECTAGG */ JSON_QUERY = 490, /* JSON_QUERY */ JSON_SCALAR = 491, /* JSON_SCALAR */ JSON_SERIALIZE = 492, /* JSON_SERIALIZE */ JSON_TABLE = 493, /* JSON_TABLE */ JSON_VALUE = 494, /* JSON_VALUE */ KEEP = 495, /* KEEP */ KEY = 496, /* KEY */ KEYS = 497, /* KEYS */ LABEL = 498, /* LABEL */ LANGUAGE = 499, /* LANGUAGE */ LARGE_P = 500, /* LARGE_P */ LAST_P = 501, /* LAST_P */ LATERAL_P = 502, /* LATERAL_P */ LEADING = 503, /* LEADING */ LEAKPROOF = 504, /* LEAKPROOF */ LEAST = 505, /* LEAST */ LEFT = 506, /* LEFT */ LEVEL = 507, /* LEVEL */ LIKE = 508, /* LIKE */ LIMIT = 509, /* LIMIT */ LISTEN = 510, /* LISTEN */ LOAD = 511, /* LOAD */ LOCAL = 512, /* LOCAL */ LOCALTIME = 513, /* LOCALTIME */ LOCALTIMESTAMP = 514, /* LOCALTIMESTAMP */ LOCATION = 515, /* LOCATION */ LOCK_P = 516, /* LOCK_P */ LOCKED = 517, /* LOCKED */ LOGGED = 518, /* LOGGED */ MAPPING = 519, /* MAPPING */ MATCH = 520, /* MATCH */ MATCHED = 521, /* MATCHED */ MATERIALIZED = 522, /* MATERIALIZED */ MAXVALUE = 523, /* MAXVALUE */ MERGE = 524, /* MERGE */ MERGE_ACTION = 525, /* MERGE_ACTION */ METHOD = 526, /* METHOD */ MINUTE_P = 527, /* MINUTE_P */ MINVALUE = 528, /* MINVALUE */ MODE = 529, /* MODE */ MONTH_P = 530, /* MONTH_P */ MOVE = 531, /* MOVE */ NAME_P = 532, /* NAME_P */ NAMES = 533, /* NAMES */ NATIONAL = 534, /* NATIONAL */ NATURAL = 535, /* NATURAL */ NCHAR = 536, /* NCHAR */ NESTED = 537, /* NESTED */ NEW = 538, /* NEW */ NEXT = 539, /* NEXT */ NFC = 540, /* NFC */ NFD = 541, /* NFD */ NFKC = 542, /* NFKC */ NFKD = 543, /* NFKD */ NO = 544, /* NO */ NONE = 545, /* NONE */ NORMALIZE = 546, /* NORMALIZE */ NORMALIZED = 547, /* NORMALIZED */ NOT = 548, /* NOT */ NOTHING = 549, /* NOTHING */ NOTIFY = 550, /* NOTIFY */ NOTNULL = 551, /* NOTNULL */ NOWAIT = 552, /* NOWAIT */ NULL_P = 553, /* NULL_P */ NULLIF = 554, /* NULLIF */ NULLS_P = 555, /* NULLS_P */ NUMERIC = 556, /* NUMERIC */ OBJECT_P = 557, /* OBJECT_P */ OBJECTS_P = 558, /* OBJECTS_P */ OF = 559, /* OF */ OFF = 560, /* OFF */ OFFSET = 561, /* OFFSET */ OIDS = 562, /* OIDS */ OLD = 563, /* OLD */ OMIT = 564, /* OMIT */ ON = 565, /* ON */ ONLY = 566, /* ONLY */ OPERATOR = 567, /* OPERATOR */ OPTION = 568, /* OPTION */ OPTIONS = 569, /* OPTIONS */ OR = 570, /* OR */ ORDER = 571, /* ORDER */ ORDINALITY = 572, /* ORDINALITY */ OTHERS = 573, /* OTHERS */ OUT_P = 574, /* OUT_P */ OUTER_P = 575, /* OUTER_P */ OVER = 576, /* OVER */ OVERLAPS = 577, /* OVERLAPS */ OVERLAY = 578, /* OVERLAY */ OVERRIDING = 579, /* OVERRIDING */ OWNED = 580, /* OWNED */ OWNER = 581, /* OWNER */ PARALLEL = 582, /* PARALLEL */ PARAMETER = 583, /* PARAMETER */ PARSER = 584, /* PARSER */ PARTIAL = 585, /* PARTIAL */ PARTITION = 586, /* PARTITION */ PASSING = 587, /* PASSING */ PASSWORD = 588, /* PASSWORD */ PATH = 589, /* PATH */ PGPOOL = 590, /* PGPOOL */ PERIOD = 591, /* PERIOD */ PLACING = 592, /* PLACING */ PLAN = 593, /* PLAN */ PLANS = 594, /* PLANS */ POLICY = 595, /* POLICY */ POSITION = 596, /* POSITION */ PRECEDING = 597, /* PRECEDING */ PRECISION = 598, /* PRECISION */ PRESERVE = 599, /* PRESERVE */ PREPARE = 600, /* PREPARE */ PREPARED = 601, /* PREPARED */ PRIMARY = 602, /* PRIMARY */ PRIOR = 603, /* PRIOR */ PRIVILEGES = 604, /* PRIVILEGES */ PROCEDURAL = 605, /* PROCEDURAL */ PROCEDURE = 606, /* PROCEDURE */ PROCEDURES = 607, /* PROCEDURES */ PROGRAM = 608, /* PROGRAM */ PUBLICATION = 609, /* PUBLICATION */ QUOTE = 610, /* QUOTE */ QUOTES = 611, /* QUOTES */ RANGE = 612, /* RANGE */ READ = 613, /* READ */ REAL = 614, /* REAL */ REASSIGN = 615, /* REASSIGN */ RECURSIVE = 616, /* RECURSIVE */ REF_P = 617, /* REF_P */ REFERENCES = 618, /* REFERENCES */ REFERENCING = 619, /* REFERENCING */ REFRESH = 620, /* REFRESH */ REINDEX = 621, /* REINDEX */ RELATIVE_P = 622, /* RELATIVE_P */ RELEASE = 623, /* RELEASE */ RENAME = 624, /* RENAME */ REPEATABLE = 625, /* REPEATABLE */ REPLACE = 626, /* REPLACE */ REPLICA = 627, /* REPLICA */ RESET = 628, /* RESET */ RESTART = 629, /* RESTART */ RESTRICT = 630, /* RESTRICT */ RETURN = 631, /* RETURN */ RETURNING = 632, /* RETURNING */ RETURNS = 633, /* RETURNS */ REVOKE = 634, /* REVOKE */ RIGHT = 635, /* RIGHT */ ROLE = 636, /* ROLE */ ROLLBACK = 637, /* ROLLBACK */ ROLLUP = 638, /* ROLLUP */ ROUTINE = 639, /* ROUTINE */ ROUTINES = 640, /* ROUTINES */ ROW = 641, /* ROW */ ROWS = 642, /* ROWS */ RULE = 643, /* RULE */ SAVEPOINT = 644, /* SAVEPOINT */ SCALAR = 645, /* SCALAR */ SCHEMA = 646, /* SCHEMA */ SCHEMAS = 647, /* SCHEMAS */ SCROLL = 648, /* SCROLL */ SEARCH = 649, /* SEARCH */ SECOND_P = 650, /* SECOND_P */ SECURITY = 651, /* SECURITY */ SELECT = 652, /* SELECT */ SEQUENCE = 653, /* SEQUENCE */ SEQUENCES = 654, /* SEQUENCES */ SERIALIZABLE = 655, /* SERIALIZABLE */ SERVER = 656, /* SERVER */ SESSION = 657, /* SESSION */ SESSION_USER = 658, /* SESSION_USER */ SET = 659, /* SET */ SETS = 660, /* SETS */ SETOF = 661, /* SETOF */ SHARE = 662, /* SHARE */ SHOW = 663, /* SHOW */ SIMILAR = 664, /* SIMILAR */ SIMPLE = 665, /* SIMPLE */ SKIP = 666, /* SKIP */ SMALLINT = 667, /* SMALLINT */ SNAPSHOT = 668, /* SNAPSHOT */ SOME = 669, /* SOME */ SOURCE = 670, /* SOURCE */ SQL_P = 671, /* SQL_P */ STABLE = 672, /* STABLE */ STANDALONE_P = 673, /* STANDALONE_P */ START = 674, /* START */ STATEMENT = 675, /* STATEMENT */ STATISTICS = 676, /* STATISTICS */ STDIN = 677, /* STDIN */ STDOUT = 678, /* STDOUT */ STORAGE = 679, /* STORAGE */ STORED = 680, /* STORED */ STRICT_P = 681, /* STRICT_P */ STRING_P = 682, /* STRING_P */ STRIP_P = 683, /* STRIP_P */ SUBSCRIPTION = 684, /* SUBSCRIPTION */ SUBSTRING = 685, /* SUBSTRING */ SUPPORT = 686, /* SUPPORT */ SYMMETRIC = 687, /* SYMMETRIC */ SYSID = 688, /* SYSID */ SYSTEM_P = 689, /* SYSTEM_P */ SYSTEM_USER = 690, /* SYSTEM_USER */ TABLE = 691, /* TABLE */ TABLES = 692, /* TABLES */ TABLESAMPLE = 693, /* TABLESAMPLE */ TABLESPACE = 694, /* TABLESPACE */ TARGET = 695, /* TARGET */ TEMP = 696, /* TEMP */ TEMPLATE = 697, /* TEMPLATE */ TEMPORARY = 698, /* TEMPORARY */ TEXT_P = 699, /* TEXT_P */ THEN = 700, /* THEN */ TIES = 701, /* TIES */ TIME = 702, /* TIME */ TIMESTAMP = 703, /* TIMESTAMP */ TO = 704, /* TO */ TRAILING = 705, /* TRAILING */ TRANSACTION = 706, /* TRANSACTION */ TRANSFORM = 707, /* TRANSFORM */ TREAT = 708, /* TREAT */ TRIGGER = 709, /* TRIGGER */ TRIM = 710, /* TRIM */ TRUE_P = 711, /* TRUE_P */ TRUNCATE = 712, /* TRUNCATE */ TRUSTED = 713, /* TRUSTED */ TYPE_P = 714, /* TYPE_P */ TYPES_P = 715, /* TYPES_P */ UESCAPE = 716, /* UESCAPE */ UNBOUNDED = 717, /* UNBOUNDED */ UNCONDITIONAL = 718, /* UNCONDITIONAL */ UNCOMMITTED = 719, /* UNCOMMITTED */ UNENCRYPTED = 720, /* UNENCRYPTED */ UNION = 721, /* UNION */ UNIQUE = 722, /* UNIQUE */ UNKNOWN = 723, /* UNKNOWN */ UNLISTEN = 724, /* UNLISTEN */ UNLOGGED = 725, /* UNLOGGED */ UNTIL = 726, /* UNTIL */ UPDATE = 727, /* UPDATE */ USER = 728, /* USER */ USING = 729, /* USING */ VACUUM = 730, /* VACUUM */ VALID = 731, /* VALID */ VALIDATE = 732, /* VALIDATE */ VALIDATOR = 733, /* VALIDATOR */ VALUE_P = 734, /* VALUE_P */ VALUES = 735, /* VALUES */ VARCHAR = 736, /* VARCHAR */ VARIADIC = 737, /* VARIADIC */ VARYING = 738, /* VARYING */ VERBOSE = 739, /* VERBOSE */ VERSION_P = 740, /* VERSION_P */ VIEW = 741, /* VIEW */ VIEWS = 742, /* VIEWS */ VIRTUAL = 743, /* VIRTUAL */ VOLATILE = 744, /* VOLATILE */ WHEN = 745, /* WHEN */ WHERE = 746, /* WHERE */ WHITESPACE_P = 747, /* WHITESPACE_P */ WINDOW = 748, /* WINDOW */ WITH = 749, /* WITH */ WITHIN = 750, /* WITHIN */ WITHOUT = 751, /* WITHOUT */ WORK = 752, /* WORK */ WRAPPER = 753, /* WRAPPER */ WRITE = 754, /* WRITE */ XML_P = 755, /* XML_P */ XMLATTRIBUTES = 756, /* XMLATTRIBUTES */ XMLCONCAT = 757, /* XMLCONCAT */ XMLELEMENT = 758, /* XMLELEMENT */ XMLEXISTS = 759, /* XMLEXISTS */ XMLFOREST = 760, /* XMLFOREST */ XMLNAMESPACES = 761, /* XMLNAMESPACES */ XMLPARSE = 762, /* XMLPARSE */ XMLPI = 763, /* XMLPI */ XMLROOT = 764, /* XMLROOT */ XMLSERIALIZE = 765, /* XMLSERIALIZE */ XMLTABLE = 766, /* XMLTABLE */ YEAR_P = 767, /* YEAR_P */ YES_P = 768, /* YES_P */ ZONE = 769, /* ZONE */ FORMAT_LA = 770, /* FORMAT_LA */ NOT_LA = 771, /* NOT_LA */ NULLS_LA = 772, /* NULLS_LA */ WITH_LA = 773, /* WITH_LA */ WITHOUT_LA = 774, /* WITHOUT_LA */ MODE_TYPE_NAME = 775, /* MODE_TYPE_NAME */ MODE_PLPGSQL_EXPR = 776, /* MODE_PLPGSQL_EXPR */ MODE_PLPGSQL_ASSIGN1 = 777, /* MODE_PLPGSQL_ASSIGN1 */ MODE_PLPGSQL_ASSIGN2 = 778, /* MODE_PLPGSQL_ASSIGN2 */ MODE_PLPGSQL_ASSIGN3 = 779, /* MODE_PLPGSQL_ASSIGN3 */ UMINUS = 780 /* UMINUS */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #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 ENFORCED 403 #define ENUM_P 404 #define ERROR_P 405 #define ESCAPE 406 #define EVENT 407 #define EXCEPT 408 #define EXCLUDE 409 #define EXCLUDING 410 #define EXCLUSIVE 411 #define EXECUTE 412 #define EXISTS 413 #define EXPLAIN 414 #define EXPRESSION 415 #define EXTENSION 416 #define EXTERNAL 417 #define EXTRACT 418 #define FALSE_P 419 #define FAMILY 420 #define FETCH 421 #define FILTER 422 #define FINALIZE 423 #define FIRST_P 424 #define FLOAT_P 425 #define FOLLOWING 426 #define FOR 427 #define FORCE 428 #define FOREIGN 429 #define FORMAT 430 #define FORWARD 431 #define FREEZE 432 #define FROM 433 #define FULL 434 #define FUNCTION 435 #define FUNCTIONS 436 #define GENERATED 437 #define GLOBAL 438 #define GRANT 439 #define GRANTED 440 #define GREATEST 441 #define GROUP_P 442 #define GROUPING 443 #define GROUPS 444 #define HANDLER 445 #define HAVING 446 #define HEADER_P 447 #define HOLD 448 #define HOUR_P 449 #define IDENTITY_P 450 #define IF_P 451 #define ILIKE 452 #define IMMEDIATE 453 #define IMMUTABLE 454 #define IMPLICIT_P 455 #define IMPORT_P 456 #define IN_P 457 #define INCLUDE 458 #define INCLUDING 459 #define INCREMENT 460 #define INDENT 461 #define INDEX 462 #define INDEXES 463 #define INHERIT 464 #define INHERITS 465 #define INITIALLY 466 #define INLINE_P 467 #define INNER_P 468 #define INOUT 469 #define INPUT_P 470 #define INSENSITIVE 471 #define INSERT 472 #define INSTEAD 473 #define INT_P 474 #define INTEGER 475 #define INTERSECT 476 #define INTERVAL 477 #define INTO 478 #define INVOKER 479 #define IS 480 #define ISNULL 481 #define ISOLATION 482 #define JOIN 483 #define JSON 484 #define JSON_ARRAY 485 #define JSON_ARRAYAGG 486 #define JSON_EXISTS 487 #define JSON_OBJECT 488 #define JSON_OBJECTAGG 489 #define JSON_QUERY 490 #define JSON_SCALAR 491 #define JSON_SERIALIZE 492 #define JSON_TABLE 493 #define JSON_VALUE 494 #define KEEP 495 #define KEY 496 #define KEYS 497 #define LABEL 498 #define LANGUAGE 499 #define LARGE_P 500 #define LAST_P 501 #define LATERAL_P 502 #define LEADING 503 #define LEAKPROOF 504 #define LEAST 505 #define LEFT 506 #define LEVEL 507 #define LIKE 508 #define LIMIT 509 #define LISTEN 510 #define LOAD 511 #define LOCAL 512 #define LOCALTIME 513 #define LOCALTIMESTAMP 514 #define LOCATION 515 #define LOCK_P 516 #define LOCKED 517 #define LOGGED 518 #define MAPPING 519 #define MATCH 520 #define MATCHED 521 #define MATERIALIZED 522 #define MAXVALUE 523 #define MERGE 524 #define MERGE_ACTION 525 #define METHOD 526 #define MINUTE_P 527 #define MINVALUE 528 #define MODE 529 #define MONTH_P 530 #define MOVE 531 #define NAME_P 532 #define NAMES 533 #define NATIONAL 534 #define NATURAL 535 #define NCHAR 536 #define NESTED 537 #define NEW 538 #define NEXT 539 #define NFC 540 #define NFD 541 #define NFKC 542 #define NFKD 543 #define NO 544 #define NONE 545 #define NORMALIZE 546 #define NORMALIZED 547 #define NOT 548 #define NOTHING 549 #define NOTIFY 550 #define NOTNULL 551 #define NOWAIT 552 #define NULL_P 553 #define NULLIF 554 #define NULLS_P 555 #define NUMERIC 556 #define OBJECT_P 557 #define OBJECTS_P 558 #define OF 559 #define OFF 560 #define OFFSET 561 #define OIDS 562 #define OLD 563 #define OMIT 564 #define ON 565 #define ONLY 566 #define OPERATOR 567 #define OPTION 568 #define OPTIONS 569 #define OR 570 #define ORDER 571 #define ORDINALITY 572 #define OTHERS 573 #define OUT_P 574 #define OUTER_P 575 #define OVER 576 #define OVERLAPS 577 #define OVERLAY 578 #define OVERRIDING 579 #define OWNED 580 #define OWNER 581 #define PARALLEL 582 #define PARAMETER 583 #define PARSER 584 #define PARTIAL 585 #define PARTITION 586 #define PASSING 587 #define PASSWORD 588 #define PATH 589 #define PGPOOL 590 #define PERIOD 591 #define PLACING 592 #define PLAN 593 #define PLANS 594 #define POLICY 595 #define POSITION 596 #define PRECEDING 597 #define PRECISION 598 #define PRESERVE 599 #define PREPARE 600 #define PREPARED 601 #define PRIMARY 602 #define PRIOR 603 #define PRIVILEGES 604 #define PROCEDURAL 605 #define PROCEDURE 606 #define PROCEDURES 607 #define PROGRAM 608 #define PUBLICATION 609 #define QUOTE 610 #define QUOTES 611 #define RANGE 612 #define READ 613 #define REAL 614 #define REASSIGN 615 #define RECURSIVE 616 #define REF_P 617 #define REFERENCES 618 #define REFERENCING 619 #define REFRESH 620 #define REINDEX 621 #define RELATIVE_P 622 #define RELEASE 623 #define RENAME 624 #define REPEATABLE 625 #define REPLACE 626 #define REPLICA 627 #define RESET 628 #define RESTART 629 #define RESTRICT 630 #define RETURN 631 #define RETURNING 632 #define RETURNS 633 #define REVOKE 634 #define RIGHT 635 #define ROLE 636 #define ROLLBACK 637 #define ROLLUP 638 #define ROUTINE 639 #define ROUTINES 640 #define ROW 641 #define ROWS 642 #define RULE 643 #define SAVEPOINT 644 #define SCALAR 645 #define SCHEMA 646 #define SCHEMAS 647 #define SCROLL 648 #define SEARCH 649 #define SECOND_P 650 #define SECURITY 651 #define SELECT 652 #define SEQUENCE 653 #define SEQUENCES 654 #define SERIALIZABLE 655 #define SERVER 656 #define SESSION 657 #define SESSION_USER 658 #define SET 659 #define SETS 660 #define SETOF 661 #define SHARE 662 #define SHOW 663 #define SIMILAR 664 #define SIMPLE 665 #define SKIP 666 #define SMALLINT 667 #define SNAPSHOT 668 #define SOME 669 #define SOURCE 670 #define SQL_P 671 #define STABLE 672 #define STANDALONE_P 673 #define START 674 #define STATEMENT 675 #define STATISTICS 676 #define STDIN 677 #define STDOUT 678 #define STORAGE 679 #define STORED 680 #define STRICT_P 681 #define STRING_P 682 #define STRIP_P 683 #define SUBSCRIPTION 684 #define SUBSTRING 685 #define SUPPORT 686 #define SYMMETRIC 687 #define SYSID 688 #define SYSTEM_P 689 #define SYSTEM_USER 690 #define TABLE 691 #define TABLES 692 #define TABLESAMPLE 693 #define TABLESPACE 694 #define TARGET 695 #define TEMP 696 #define TEMPLATE 697 #define TEMPORARY 698 #define TEXT_P 699 #define THEN 700 #define TIES 701 #define TIME 702 #define TIMESTAMP 703 #define TO 704 #define TRAILING 705 #define TRANSACTION 706 #define TRANSFORM 707 #define TREAT 708 #define TRIGGER 709 #define TRIM 710 #define TRUE_P 711 #define TRUNCATE 712 #define TRUSTED 713 #define TYPE_P 714 #define TYPES_P 715 #define UESCAPE 716 #define UNBOUNDED 717 #define UNCONDITIONAL 718 #define UNCOMMITTED 719 #define UNENCRYPTED 720 #define UNION 721 #define UNIQUE 722 #define UNKNOWN 723 #define UNLISTEN 724 #define UNLOGGED 725 #define UNTIL 726 #define UPDATE 727 #define USER 728 #define USING 729 #define VACUUM 730 #define VALID 731 #define VALIDATE 732 #define VALIDATOR 733 #define VALUE_P 734 #define VALUES 735 #define VARCHAR 736 #define VARIADIC 737 #define VARYING 738 #define VERBOSE 739 #define VERSION_P 740 #define VIEW 741 #define VIEWS 742 #define VIRTUAL 743 #define VOLATILE 744 #define WHEN 745 #define WHERE 746 #define WHITESPACE_P 747 #define WINDOW 748 #define WITH 749 #define WITHIN 750 #define WITHOUT 751 #define WORK 752 #define WRAPPER 753 #define WRITE 754 #define XML_P 755 #define XMLATTRIBUTES 756 #define XMLCONCAT 757 #define XMLELEMENT 758 #define XMLEXISTS 759 #define XMLFOREST 760 #define XMLNAMESPACES 761 #define XMLPARSE 762 #define XMLPI 763 #define XMLROOT 764 #define XMLSERIALIZE 765 #define XMLTABLE 766 #define YEAR_P 767 #define YES_P 768 #define ZONE 769 #define FORMAT_LA 770 #define NOT_LA 771 #define NULLS_LA 772 #define WITH_LA 773 #define WITHOUT_LA 774 #define MODE_TYPE_NAME 775 #define MODE_PLPGSQL_EXPR 776 #define MODE_PLPGSQL_ASSIGN1 777 #define MODE_PLPGSQL_ASSIGN2 778 #define MODE_PLPGSQL_ASSIGN3 779 #define UMINUS 780 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 257 "gram.y" 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; ReturningClause *retclause; ReturningOptionKind retoptionkind; #line 1480 "gram.c" }; 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 */ /* Symbol kind. */ enum yysymbol_kind_t { YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEOF = 0, /* "end of file" */ YYSYMBOL_YYerror = 1, /* error */ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ YYSYMBOL_IDENT = 3, /* IDENT */ YYSYMBOL_UIDENT = 4, /* UIDENT */ YYSYMBOL_FCONST = 5, /* FCONST */ YYSYMBOL_SCONST = 6, /* SCONST */ YYSYMBOL_USCONST = 7, /* USCONST */ YYSYMBOL_BCONST = 8, /* BCONST */ YYSYMBOL_XCONST = 9, /* XCONST */ YYSYMBOL_Op = 10, /* Op */ YYSYMBOL_ICONST = 11, /* ICONST */ YYSYMBOL_PARAM = 12, /* PARAM */ YYSYMBOL_TYPECAST = 13, /* TYPECAST */ YYSYMBOL_DOT_DOT = 14, /* DOT_DOT */ YYSYMBOL_COLON_EQUALS = 15, /* COLON_EQUALS */ YYSYMBOL_EQUALS_GREATER = 16, /* EQUALS_GREATER */ YYSYMBOL_LESS_EQUALS = 17, /* LESS_EQUALS */ YYSYMBOL_GREATER_EQUALS = 18, /* GREATER_EQUALS */ YYSYMBOL_NOT_EQUALS = 19, /* NOT_EQUALS */ YYSYMBOL_ABORT_P = 20, /* ABORT_P */ YYSYMBOL_ABSENT = 21, /* ABSENT */ YYSYMBOL_ABSOLUTE_P = 22, /* ABSOLUTE_P */ YYSYMBOL_ACCESS = 23, /* ACCESS */ YYSYMBOL_ACTION = 24, /* ACTION */ YYSYMBOL_ADD_P = 25, /* ADD_P */ YYSYMBOL_ADMIN = 26, /* ADMIN */ YYSYMBOL_AFTER = 27, /* AFTER */ YYSYMBOL_AGGREGATE = 28, /* AGGREGATE */ YYSYMBOL_ALL = 29, /* ALL */ YYSYMBOL_ALSO = 30, /* ALSO */ YYSYMBOL_ALTER = 31, /* ALTER */ YYSYMBOL_ALWAYS = 32, /* ALWAYS */ YYSYMBOL_ANALYSE = 33, /* ANALYSE */ YYSYMBOL_ANALYZE = 34, /* ANALYZE */ YYSYMBOL_AND = 35, /* AND */ YYSYMBOL_ANY = 36, /* ANY */ YYSYMBOL_ARRAY = 37, /* ARRAY */ YYSYMBOL_AS = 38, /* AS */ YYSYMBOL_ASC = 39, /* ASC */ YYSYMBOL_ASENSITIVE = 40, /* ASENSITIVE */ YYSYMBOL_ASSERTION = 41, /* ASSERTION */ YYSYMBOL_ASSIGNMENT = 42, /* ASSIGNMENT */ YYSYMBOL_ASYMMETRIC = 43, /* ASYMMETRIC */ YYSYMBOL_ATOMIC = 44, /* ATOMIC */ YYSYMBOL_AT = 45, /* AT */ YYSYMBOL_ATTACH = 46, /* ATTACH */ YYSYMBOL_ATTRIBUTE = 47, /* ATTRIBUTE */ YYSYMBOL_AUTHORIZATION = 48, /* AUTHORIZATION */ YYSYMBOL_BACKWARD = 49, /* BACKWARD */ YYSYMBOL_BEFORE = 50, /* BEFORE */ YYSYMBOL_BEGIN_P = 51, /* BEGIN_P */ YYSYMBOL_BETWEEN = 52, /* BETWEEN */ YYSYMBOL_BIGINT = 53, /* BIGINT */ YYSYMBOL_BINARY = 54, /* BINARY */ YYSYMBOL_BIT = 55, /* BIT */ YYSYMBOL_BOOLEAN_P = 56, /* BOOLEAN_P */ YYSYMBOL_BOTH = 57, /* BOTH */ YYSYMBOL_BREADTH = 58, /* BREADTH */ YYSYMBOL_BY = 59, /* BY */ YYSYMBOL_CACHE = 60, /* CACHE */ YYSYMBOL_CALL = 61, /* CALL */ YYSYMBOL_CALLED = 62, /* CALLED */ YYSYMBOL_CASCADE = 63, /* CASCADE */ YYSYMBOL_CASCADED = 64, /* CASCADED */ YYSYMBOL_CASE = 65, /* CASE */ YYSYMBOL_CAST = 66, /* CAST */ YYSYMBOL_CATALOG_P = 67, /* CATALOG_P */ YYSYMBOL_CHAIN = 68, /* CHAIN */ YYSYMBOL_CHAR_P = 69, /* CHAR_P */ YYSYMBOL_CHARACTER = 70, /* CHARACTER */ YYSYMBOL_CHARACTERISTICS = 71, /* CHARACTERISTICS */ YYSYMBOL_CHECK = 72, /* CHECK */ YYSYMBOL_CHECKPOINT = 73, /* CHECKPOINT */ YYSYMBOL_CLASS = 74, /* CLASS */ YYSYMBOL_CLOSE = 75, /* CLOSE */ YYSYMBOL_CLUSTER = 76, /* CLUSTER */ YYSYMBOL_COALESCE = 77, /* COALESCE */ YYSYMBOL_COLLATE = 78, /* COLLATE */ YYSYMBOL_COLLATION = 79, /* COLLATION */ YYSYMBOL_COLUMN = 80, /* COLUMN */ YYSYMBOL_COLUMNS = 81, /* COLUMNS */ YYSYMBOL_COMMENT = 82, /* COMMENT */ YYSYMBOL_COMMENTS = 83, /* COMMENTS */ YYSYMBOL_COMMIT = 84, /* COMMIT */ YYSYMBOL_COMMITTED = 85, /* COMMITTED */ YYSYMBOL_COMPRESSION = 86, /* COMPRESSION */ YYSYMBOL_CONCURRENTLY = 87, /* CONCURRENTLY */ YYSYMBOL_CONDITIONAL = 88, /* CONDITIONAL */ YYSYMBOL_CONFIGURATION = 89, /* CONFIGURATION */ YYSYMBOL_CONFLICT = 90, /* CONFLICT */ YYSYMBOL_CONNECTION = 91, /* CONNECTION */ YYSYMBOL_CONSTRAINT = 92, /* CONSTRAINT */ YYSYMBOL_CONSTRAINTS = 93, /* CONSTRAINTS */ YYSYMBOL_CONTENT_P = 94, /* CONTENT_P */ YYSYMBOL_CONTINUE_P = 95, /* CONTINUE_P */ YYSYMBOL_CONVERSION_P = 96, /* CONVERSION_P */ YYSYMBOL_COPY = 97, /* COPY */ YYSYMBOL_COST = 98, /* COST */ YYSYMBOL_CREATE = 99, /* CREATE */ YYSYMBOL_CROSS = 100, /* CROSS */ YYSYMBOL_CSV = 101, /* CSV */ YYSYMBOL_CUBE = 102, /* CUBE */ YYSYMBOL_CURRENT_P = 103, /* CURRENT_P */ YYSYMBOL_CURRENT_CATALOG = 104, /* CURRENT_CATALOG */ YYSYMBOL_CURRENT_DATE = 105, /* CURRENT_DATE */ YYSYMBOL_CURRENT_ROLE = 106, /* CURRENT_ROLE */ YYSYMBOL_CURRENT_SCHEMA = 107, /* CURRENT_SCHEMA */ YYSYMBOL_CURRENT_TIME = 108, /* CURRENT_TIME */ YYSYMBOL_CURRENT_TIMESTAMP = 109, /* CURRENT_TIMESTAMP */ YYSYMBOL_CURRENT_USER = 110, /* CURRENT_USER */ YYSYMBOL_CURSOR = 111, /* CURSOR */ YYSYMBOL_CYCLE = 112, /* CYCLE */ YYSYMBOL_DATA_P = 113, /* DATA_P */ YYSYMBOL_DATABASE = 114, /* DATABASE */ YYSYMBOL_DAY_P = 115, /* DAY_P */ YYSYMBOL_DEALLOCATE = 116, /* DEALLOCATE */ YYSYMBOL_DEC = 117, /* DEC */ YYSYMBOL_DECIMAL_P = 118, /* DECIMAL_P */ YYSYMBOL_DECLARE = 119, /* DECLARE */ YYSYMBOL_DEFAULT = 120, /* DEFAULT */ YYSYMBOL_DEFAULTS = 121, /* DEFAULTS */ YYSYMBOL_DEFERRABLE = 122, /* DEFERRABLE */ YYSYMBOL_DEFERRED = 123, /* DEFERRED */ YYSYMBOL_DEFINER = 124, /* DEFINER */ YYSYMBOL_DELETE_P = 125, /* DELETE_P */ YYSYMBOL_DELIMITER = 126, /* DELIMITER */ YYSYMBOL_DELIMITERS = 127, /* DELIMITERS */ YYSYMBOL_DEPENDS = 128, /* DEPENDS */ YYSYMBOL_DEPTH = 129, /* DEPTH */ YYSYMBOL_DESC = 130, /* DESC */ YYSYMBOL_DETACH = 131, /* DETACH */ YYSYMBOL_DICTIONARY = 132, /* DICTIONARY */ YYSYMBOL_DISABLE_P = 133, /* DISABLE_P */ YYSYMBOL_DISCARD = 134, /* DISCARD */ YYSYMBOL_DISTINCT = 135, /* DISTINCT */ YYSYMBOL_DO = 136, /* DO */ YYSYMBOL_DOCUMENT_P = 137, /* DOCUMENT_P */ YYSYMBOL_DOMAIN_P = 138, /* DOMAIN_P */ YYSYMBOL_DOUBLE_P = 139, /* DOUBLE_P */ YYSYMBOL_DROP = 140, /* DROP */ YYSYMBOL_EACH = 141, /* EACH */ YYSYMBOL_ELSE = 142, /* ELSE */ YYSYMBOL_EMPTY_P = 143, /* EMPTY_P */ YYSYMBOL_ENABLE_P = 144, /* ENABLE_P */ YYSYMBOL_ENCODING = 145, /* ENCODING */ YYSYMBOL_ENCRYPTED = 146, /* ENCRYPTED */ YYSYMBOL_END_P = 147, /* END_P */ YYSYMBOL_ENFORCED = 148, /* ENFORCED */ YYSYMBOL_ENUM_P = 149, /* ENUM_P */ YYSYMBOL_ERROR_P = 150, /* ERROR_P */ YYSYMBOL_ESCAPE = 151, /* ESCAPE */ YYSYMBOL_EVENT = 152, /* EVENT */ YYSYMBOL_EXCEPT = 153, /* EXCEPT */ YYSYMBOL_EXCLUDE = 154, /* EXCLUDE */ YYSYMBOL_EXCLUDING = 155, /* EXCLUDING */ YYSYMBOL_EXCLUSIVE = 156, /* EXCLUSIVE */ YYSYMBOL_EXECUTE = 157, /* EXECUTE */ YYSYMBOL_EXISTS = 158, /* EXISTS */ YYSYMBOL_EXPLAIN = 159, /* EXPLAIN */ YYSYMBOL_EXPRESSION = 160, /* EXPRESSION */ YYSYMBOL_EXTENSION = 161, /* EXTENSION */ YYSYMBOL_EXTERNAL = 162, /* EXTERNAL */ YYSYMBOL_EXTRACT = 163, /* EXTRACT */ YYSYMBOL_FALSE_P = 164, /* FALSE_P */ YYSYMBOL_FAMILY = 165, /* FAMILY */ YYSYMBOL_FETCH = 166, /* FETCH */ YYSYMBOL_FILTER = 167, /* FILTER */ YYSYMBOL_FINALIZE = 168, /* FINALIZE */ YYSYMBOL_FIRST_P = 169, /* FIRST_P */ YYSYMBOL_FLOAT_P = 170, /* FLOAT_P */ YYSYMBOL_FOLLOWING = 171, /* FOLLOWING */ YYSYMBOL_FOR = 172, /* FOR */ YYSYMBOL_FORCE = 173, /* FORCE */ YYSYMBOL_FOREIGN = 174, /* FOREIGN */ YYSYMBOL_FORMAT = 175, /* FORMAT */ YYSYMBOL_FORWARD = 176, /* FORWARD */ YYSYMBOL_FREEZE = 177, /* FREEZE */ YYSYMBOL_FROM = 178, /* FROM */ YYSYMBOL_FULL = 179, /* FULL */ YYSYMBOL_FUNCTION = 180, /* FUNCTION */ YYSYMBOL_FUNCTIONS = 181, /* FUNCTIONS */ YYSYMBOL_GENERATED = 182, /* GENERATED */ YYSYMBOL_GLOBAL = 183, /* GLOBAL */ YYSYMBOL_GRANT = 184, /* GRANT */ YYSYMBOL_GRANTED = 185, /* GRANTED */ YYSYMBOL_GREATEST = 186, /* GREATEST */ YYSYMBOL_GROUP_P = 187, /* GROUP_P */ YYSYMBOL_GROUPING = 188, /* GROUPING */ YYSYMBOL_GROUPS = 189, /* GROUPS */ YYSYMBOL_HANDLER = 190, /* HANDLER */ YYSYMBOL_HAVING = 191, /* HAVING */ YYSYMBOL_HEADER_P = 192, /* HEADER_P */ YYSYMBOL_HOLD = 193, /* HOLD */ YYSYMBOL_HOUR_P = 194, /* HOUR_P */ YYSYMBOL_IDENTITY_P = 195, /* IDENTITY_P */ YYSYMBOL_IF_P = 196, /* IF_P */ YYSYMBOL_ILIKE = 197, /* ILIKE */ YYSYMBOL_IMMEDIATE = 198, /* IMMEDIATE */ YYSYMBOL_IMMUTABLE = 199, /* IMMUTABLE */ YYSYMBOL_IMPLICIT_P = 200, /* IMPLICIT_P */ YYSYMBOL_IMPORT_P = 201, /* IMPORT_P */ YYSYMBOL_IN_P = 202, /* IN_P */ YYSYMBOL_INCLUDE = 203, /* INCLUDE */ YYSYMBOL_INCLUDING = 204, /* INCLUDING */ YYSYMBOL_INCREMENT = 205, /* INCREMENT */ YYSYMBOL_INDENT = 206, /* INDENT */ YYSYMBOL_INDEX = 207, /* INDEX */ YYSYMBOL_INDEXES = 208, /* INDEXES */ YYSYMBOL_INHERIT = 209, /* INHERIT */ YYSYMBOL_INHERITS = 210, /* INHERITS */ YYSYMBOL_INITIALLY = 211, /* INITIALLY */ YYSYMBOL_INLINE_P = 212, /* INLINE_P */ YYSYMBOL_INNER_P = 213, /* INNER_P */ YYSYMBOL_INOUT = 214, /* INOUT */ YYSYMBOL_INPUT_P = 215, /* INPUT_P */ YYSYMBOL_INSENSITIVE = 216, /* INSENSITIVE */ YYSYMBOL_INSERT = 217, /* INSERT */ YYSYMBOL_INSTEAD = 218, /* INSTEAD */ YYSYMBOL_INT_P = 219, /* INT_P */ YYSYMBOL_INTEGER = 220, /* INTEGER */ YYSYMBOL_INTERSECT = 221, /* INTERSECT */ YYSYMBOL_INTERVAL = 222, /* INTERVAL */ YYSYMBOL_INTO = 223, /* INTO */ YYSYMBOL_INVOKER = 224, /* INVOKER */ YYSYMBOL_IS = 225, /* IS */ YYSYMBOL_ISNULL = 226, /* ISNULL */ YYSYMBOL_ISOLATION = 227, /* ISOLATION */ YYSYMBOL_JOIN = 228, /* JOIN */ YYSYMBOL_JSON = 229, /* JSON */ YYSYMBOL_JSON_ARRAY = 230, /* JSON_ARRAY */ YYSYMBOL_JSON_ARRAYAGG = 231, /* JSON_ARRAYAGG */ YYSYMBOL_JSON_EXISTS = 232, /* JSON_EXISTS */ YYSYMBOL_JSON_OBJECT = 233, /* JSON_OBJECT */ YYSYMBOL_JSON_OBJECTAGG = 234, /* JSON_OBJECTAGG */ YYSYMBOL_JSON_QUERY = 235, /* JSON_QUERY */ YYSYMBOL_JSON_SCALAR = 236, /* JSON_SCALAR */ YYSYMBOL_JSON_SERIALIZE = 237, /* JSON_SERIALIZE */ YYSYMBOL_JSON_TABLE = 238, /* JSON_TABLE */ YYSYMBOL_JSON_VALUE = 239, /* JSON_VALUE */ YYSYMBOL_KEEP = 240, /* KEEP */ YYSYMBOL_KEY = 241, /* KEY */ YYSYMBOL_KEYS = 242, /* KEYS */ YYSYMBOL_LABEL = 243, /* LABEL */ YYSYMBOL_LANGUAGE = 244, /* LANGUAGE */ YYSYMBOL_LARGE_P = 245, /* LARGE_P */ YYSYMBOL_LAST_P = 246, /* LAST_P */ YYSYMBOL_LATERAL_P = 247, /* LATERAL_P */ YYSYMBOL_LEADING = 248, /* LEADING */ YYSYMBOL_LEAKPROOF = 249, /* LEAKPROOF */ YYSYMBOL_LEAST = 250, /* LEAST */ YYSYMBOL_LEFT = 251, /* LEFT */ YYSYMBOL_LEVEL = 252, /* LEVEL */ YYSYMBOL_LIKE = 253, /* LIKE */ YYSYMBOL_LIMIT = 254, /* LIMIT */ YYSYMBOL_LISTEN = 255, /* LISTEN */ YYSYMBOL_LOAD = 256, /* LOAD */ YYSYMBOL_LOCAL = 257, /* LOCAL */ YYSYMBOL_LOCALTIME = 258, /* LOCALTIME */ YYSYMBOL_LOCALTIMESTAMP = 259, /* LOCALTIMESTAMP */ YYSYMBOL_LOCATION = 260, /* LOCATION */ YYSYMBOL_LOCK_P = 261, /* LOCK_P */ YYSYMBOL_LOCKED = 262, /* LOCKED */ YYSYMBOL_LOGGED = 263, /* LOGGED */ YYSYMBOL_MAPPING = 264, /* MAPPING */ YYSYMBOL_MATCH = 265, /* MATCH */ YYSYMBOL_MATCHED = 266, /* MATCHED */ YYSYMBOL_MATERIALIZED = 267, /* MATERIALIZED */ YYSYMBOL_MAXVALUE = 268, /* MAXVALUE */ YYSYMBOL_MERGE = 269, /* MERGE */ YYSYMBOL_MERGE_ACTION = 270, /* MERGE_ACTION */ YYSYMBOL_METHOD = 271, /* METHOD */ YYSYMBOL_MINUTE_P = 272, /* MINUTE_P */ YYSYMBOL_MINVALUE = 273, /* MINVALUE */ YYSYMBOL_MODE = 274, /* MODE */ YYSYMBOL_MONTH_P = 275, /* MONTH_P */ YYSYMBOL_MOVE = 276, /* MOVE */ YYSYMBOL_NAME_P = 277, /* NAME_P */ YYSYMBOL_NAMES = 278, /* NAMES */ YYSYMBOL_NATIONAL = 279, /* NATIONAL */ YYSYMBOL_NATURAL = 280, /* NATURAL */ YYSYMBOL_NCHAR = 281, /* NCHAR */ YYSYMBOL_NESTED = 282, /* NESTED */ YYSYMBOL_NEW = 283, /* NEW */ YYSYMBOL_NEXT = 284, /* NEXT */ YYSYMBOL_NFC = 285, /* NFC */ YYSYMBOL_NFD = 286, /* NFD */ YYSYMBOL_NFKC = 287, /* NFKC */ YYSYMBOL_NFKD = 288, /* NFKD */ YYSYMBOL_NO = 289, /* NO */ YYSYMBOL_NONE = 290, /* NONE */ YYSYMBOL_NORMALIZE = 291, /* NORMALIZE */ YYSYMBOL_NORMALIZED = 292, /* NORMALIZED */ YYSYMBOL_NOT = 293, /* NOT */ YYSYMBOL_NOTHING = 294, /* NOTHING */ YYSYMBOL_NOTIFY = 295, /* NOTIFY */ YYSYMBOL_NOTNULL = 296, /* NOTNULL */ YYSYMBOL_NOWAIT = 297, /* NOWAIT */ YYSYMBOL_NULL_P = 298, /* NULL_P */ YYSYMBOL_NULLIF = 299, /* NULLIF */ YYSYMBOL_NULLS_P = 300, /* NULLS_P */ YYSYMBOL_NUMERIC = 301, /* NUMERIC */ YYSYMBOL_OBJECT_P = 302, /* OBJECT_P */ YYSYMBOL_OBJECTS_P = 303, /* OBJECTS_P */ YYSYMBOL_OF = 304, /* OF */ YYSYMBOL_OFF = 305, /* OFF */ YYSYMBOL_OFFSET = 306, /* OFFSET */ YYSYMBOL_OIDS = 307, /* OIDS */ YYSYMBOL_OLD = 308, /* OLD */ YYSYMBOL_OMIT = 309, /* OMIT */ YYSYMBOL_ON = 310, /* ON */ YYSYMBOL_ONLY = 311, /* ONLY */ YYSYMBOL_OPERATOR = 312, /* OPERATOR */ YYSYMBOL_OPTION = 313, /* OPTION */ YYSYMBOL_OPTIONS = 314, /* OPTIONS */ YYSYMBOL_OR = 315, /* OR */ YYSYMBOL_ORDER = 316, /* ORDER */ YYSYMBOL_ORDINALITY = 317, /* ORDINALITY */ YYSYMBOL_OTHERS = 318, /* OTHERS */ YYSYMBOL_OUT_P = 319, /* OUT_P */ YYSYMBOL_OUTER_P = 320, /* OUTER_P */ YYSYMBOL_OVER = 321, /* OVER */ YYSYMBOL_OVERLAPS = 322, /* OVERLAPS */ YYSYMBOL_OVERLAY = 323, /* OVERLAY */ YYSYMBOL_OVERRIDING = 324, /* OVERRIDING */ YYSYMBOL_OWNED = 325, /* OWNED */ YYSYMBOL_OWNER = 326, /* OWNER */ YYSYMBOL_PARALLEL = 327, /* PARALLEL */ YYSYMBOL_PARAMETER = 328, /* PARAMETER */ YYSYMBOL_PARSER = 329, /* PARSER */ YYSYMBOL_PARTIAL = 330, /* PARTIAL */ YYSYMBOL_PARTITION = 331, /* PARTITION */ YYSYMBOL_PASSING = 332, /* PASSING */ YYSYMBOL_PASSWORD = 333, /* PASSWORD */ YYSYMBOL_PATH = 334, /* PATH */ YYSYMBOL_PGPOOL = 335, /* PGPOOL */ YYSYMBOL_PERIOD = 336, /* PERIOD */ YYSYMBOL_PLACING = 337, /* PLACING */ YYSYMBOL_PLAN = 338, /* PLAN */ YYSYMBOL_PLANS = 339, /* PLANS */ YYSYMBOL_POLICY = 340, /* POLICY */ YYSYMBOL_POSITION = 341, /* POSITION */ YYSYMBOL_PRECEDING = 342, /* PRECEDING */ YYSYMBOL_PRECISION = 343, /* PRECISION */ YYSYMBOL_PRESERVE = 344, /* PRESERVE */ YYSYMBOL_PREPARE = 345, /* PREPARE */ YYSYMBOL_PREPARED = 346, /* PREPARED */ YYSYMBOL_PRIMARY = 347, /* PRIMARY */ YYSYMBOL_PRIOR = 348, /* PRIOR */ YYSYMBOL_PRIVILEGES = 349, /* PRIVILEGES */ YYSYMBOL_PROCEDURAL = 350, /* PROCEDURAL */ YYSYMBOL_PROCEDURE = 351, /* PROCEDURE */ YYSYMBOL_PROCEDURES = 352, /* PROCEDURES */ YYSYMBOL_PROGRAM = 353, /* PROGRAM */ YYSYMBOL_PUBLICATION = 354, /* PUBLICATION */ YYSYMBOL_QUOTE = 355, /* QUOTE */ YYSYMBOL_QUOTES = 356, /* QUOTES */ YYSYMBOL_RANGE = 357, /* RANGE */ YYSYMBOL_READ = 358, /* READ */ YYSYMBOL_REAL = 359, /* REAL */ YYSYMBOL_REASSIGN = 360, /* REASSIGN */ YYSYMBOL_RECURSIVE = 361, /* RECURSIVE */ YYSYMBOL_REF_P = 362, /* REF_P */ YYSYMBOL_REFERENCES = 363, /* REFERENCES */ YYSYMBOL_REFERENCING = 364, /* REFERENCING */ YYSYMBOL_REFRESH = 365, /* REFRESH */ YYSYMBOL_REINDEX = 366, /* REINDEX */ YYSYMBOL_RELATIVE_P = 367, /* RELATIVE_P */ YYSYMBOL_RELEASE = 368, /* RELEASE */ YYSYMBOL_RENAME = 369, /* RENAME */ YYSYMBOL_REPEATABLE = 370, /* REPEATABLE */ YYSYMBOL_REPLACE = 371, /* REPLACE */ YYSYMBOL_REPLICA = 372, /* REPLICA */ YYSYMBOL_RESET = 373, /* RESET */ YYSYMBOL_RESTART = 374, /* RESTART */ YYSYMBOL_RESTRICT = 375, /* RESTRICT */ YYSYMBOL_RETURN = 376, /* RETURN */ YYSYMBOL_RETURNING = 377, /* RETURNING */ YYSYMBOL_RETURNS = 378, /* RETURNS */ YYSYMBOL_REVOKE = 379, /* REVOKE */ YYSYMBOL_RIGHT = 380, /* RIGHT */ YYSYMBOL_ROLE = 381, /* ROLE */ YYSYMBOL_ROLLBACK = 382, /* ROLLBACK */ YYSYMBOL_ROLLUP = 383, /* ROLLUP */ YYSYMBOL_ROUTINE = 384, /* ROUTINE */ YYSYMBOL_ROUTINES = 385, /* ROUTINES */ YYSYMBOL_ROW = 386, /* ROW */ YYSYMBOL_ROWS = 387, /* ROWS */ YYSYMBOL_RULE = 388, /* RULE */ YYSYMBOL_SAVEPOINT = 389, /* SAVEPOINT */ YYSYMBOL_SCALAR = 390, /* SCALAR */ YYSYMBOL_SCHEMA = 391, /* SCHEMA */ YYSYMBOL_SCHEMAS = 392, /* SCHEMAS */ YYSYMBOL_SCROLL = 393, /* SCROLL */ YYSYMBOL_SEARCH = 394, /* SEARCH */ YYSYMBOL_SECOND_P = 395, /* SECOND_P */ YYSYMBOL_SECURITY = 396, /* SECURITY */ YYSYMBOL_SELECT = 397, /* SELECT */ YYSYMBOL_SEQUENCE = 398, /* SEQUENCE */ YYSYMBOL_SEQUENCES = 399, /* SEQUENCES */ YYSYMBOL_SERIALIZABLE = 400, /* SERIALIZABLE */ YYSYMBOL_SERVER = 401, /* SERVER */ YYSYMBOL_SESSION = 402, /* SESSION */ YYSYMBOL_SESSION_USER = 403, /* SESSION_USER */ YYSYMBOL_SET = 404, /* SET */ YYSYMBOL_SETS = 405, /* SETS */ YYSYMBOL_SETOF = 406, /* SETOF */ YYSYMBOL_SHARE = 407, /* SHARE */ YYSYMBOL_SHOW = 408, /* SHOW */ YYSYMBOL_SIMILAR = 409, /* SIMILAR */ YYSYMBOL_SIMPLE = 410, /* SIMPLE */ YYSYMBOL_SKIP = 411, /* SKIP */ YYSYMBOL_SMALLINT = 412, /* SMALLINT */ YYSYMBOL_SNAPSHOT = 413, /* SNAPSHOT */ YYSYMBOL_SOME = 414, /* SOME */ YYSYMBOL_SOURCE = 415, /* SOURCE */ YYSYMBOL_SQL_P = 416, /* SQL_P */ YYSYMBOL_STABLE = 417, /* STABLE */ YYSYMBOL_STANDALONE_P = 418, /* STANDALONE_P */ YYSYMBOL_START = 419, /* START */ YYSYMBOL_STATEMENT = 420, /* STATEMENT */ YYSYMBOL_STATISTICS = 421, /* STATISTICS */ YYSYMBOL_STDIN = 422, /* STDIN */ YYSYMBOL_STDOUT = 423, /* STDOUT */ YYSYMBOL_STORAGE = 424, /* STORAGE */ YYSYMBOL_STORED = 425, /* STORED */ YYSYMBOL_STRICT_P = 426, /* STRICT_P */ YYSYMBOL_STRING_P = 427, /* STRING_P */ YYSYMBOL_STRIP_P = 428, /* STRIP_P */ YYSYMBOL_SUBSCRIPTION = 429, /* SUBSCRIPTION */ YYSYMBOL_SUBSTRING = 430, /* SUBSTRING */ YYSYMBOL_SUPPORT = 431, /* SUPPORT */ YYSYMBOL_SYMMETRIC = 432, /* SYMMETRIC */ YYSYMBOL_SYSID = 433, /* SYSID */ YYSYMBOL_SYSTEM_P = 434, /* SYSTEM_P */ YYSYMBOL_SYSTEM_USER = 435, /* SYSTEM_USER */ YYSYMBOL_TABLE = 436, /* TABLE */ YYSYMBOL_TABLES = 437, /* TABLES */ YYSYMBOL_TABLESAMPLE = 438, /* TABLESAMPLE */ YYSYMBOL_TABLESPACE = 439, /* TABLESPACE */ YYSYMBOL_TARGET = 440, /* TARGET */ YYSYMBOL_TEMP = 441, /* TEMP */ YYSYMBOL_TEMPLATE = 442, /* TEMPLATE */ YYSYMBOL_TEMPORARY = 443, /* TEMPORARY */ YYSYMBOL_TEXT_P = 444, /* TEXT_P */ YYSYMBOL_THEN = 445, /* THEN */ YYSYMBOL_TIES = 446, /* TIES */ YYSYMBOL_TIME = 447, /* TIME */ YYSYMBOL_TIMESTAMP = 448, /* TIMESTAMP */ YYSYMBOL_TO = 449, /* TO */ YYSYMBOL_TRAILING = 450, /* TRAILING */ YYSYMBOL_TRANSACTION = 451, /* TRANSACTION */ YYSYMBOL_TRANSFORM = 452, /* TRANSFORM */ YYSYMBOL_TREAT = 453, /* TREAT */ YYSYMBOL_TRIGGER = 454, /* TRIGGER */ YYSYMBOL_TRIM = 455, /* TRIM */ YYSYMBOL_TRUE_P = 456, /* TRUE_P */ YYSYMBOL_TRUNCATE = 457, /* TRUNCATE */ YYSYMBOL_TRUSTED = 458, /* TRUSTED */ YYSYMBOL_TYPE_P = 459, /* TYPE_P */ YYSYMBOL_TYPES_P = 460, /* TYPES_P */ YYSYMBOL_UESCAPE = 461, /* UESCAPE */ YYSYMBOL_UNBOUNDED = 462, /* UNBOUNDED */ YYSYMBOL_UNCONDITIONAL = 463, /* UNCONDITIONAL */ YYSYMBOL_UNCOMMITTED = 464, /* UNCOMMITTED */ YYSYMBOL_UNENCRYPTED = 465, /* UNENCRYPTED */ YYSYMBOL_UNION = 466, /* UNION */ YYSYMBOL_UNIQUE = 467, /* UNIQUE */ YYSYMBOL_UNKNOWN = 468, /* UNKNOWN */ YYSYMBOL_UNLISTEN = 469, /* UNLISTEN */ YYSYMBOL_UNLOGGED = 470, /* UNLOGGED */ YYSYMBOL_UNTIL = 471, /* UNTIL */ YYSYMBOL_UPDATE = 472, /* UPDATE */ YYSYMBOL_USER = 473, /* USER */ YYSYMBOL_USING = 474, /* USING */ YYSYMBOL_VACUUM = 475, /* VACUUM */ YYSYMBOL_VALID = 476, /* VALID */ YYSYMBOL_VALIDATE = 477, /* VALIDATE */ YYSYMBOL_VALIDATOR = 478, /* VALIDATOR */ YYSYMBOL_VALUE_P = 479, /* VALUE_P */ YYSYMBOL_VALUES = 480, /* VALUES */ YYSYMBOL_VARCHAR = 481, /* VARCHAR */ YYSYMBOL_VARIADIC = 482, /* VARIADIC */ YYSYMBOL_VARYING = 483, /* VARYING */ YYSYMBOL_VERBOSE = 484, /* VERBOSE */ YYSYMBOL_VERSION_P = 485, /* VERSION_P */ YYSYMBOL_VIEW = 486, /* VIEW */ YYSYMBOL_VIEWS = 487, /* VIEWS */ YYSYMBOL_VIRTUAL = 488, /* VIRTUAL */ YYSYMBOL_VOLATILE = 489, /* VOLATILE */ YYSYMBOL_WHEN = 490, /* WHEN */ YYSYMBOL_WHERE = 491, /* WHERE */ YYSYMBOL_WHITESPACE_P = 492, /* WHITESPACE_P */ YYSYMBOL_WINDOW = 493, /* WINDOW */ YYSYMBOL_WITH = 494, /* WITH */ YYSYMBOL_WITHIN = 495, /* WITHIN */ YYSYMBOL_WITHOUT = 496, /* WITHOUT */ YYSYMBOL_WORK = 497, /* WORK */ YYSYMBOL_WRAPPER = 498, /* WRAPPER */ YYSYMBOL_WRITE = 499, /* WRITE */ YYSYMBOL_XML_P = 500, /* XML_P */ YYSYMBOL_XMLATTRIBUTES = 501, /* XMLATTRIBUTES */ YYSYMBOL_XMLCONCAT = 502, /* XMLCONCAT */ YYSYMBOL_XMLELEMENT = 503, /* XMLELEMENT */ YYSYMBOL_XMLEXISTS = 504, /* XMLEXISTS */ YYSYMBOL_XMLFOREST = 505, /* XMLFOREST */ YYSYMBOL_XMLNAMESPACES = 506, /* XMLNAMESPACES */ YYSYMBOL_XMLPARSE = 507, /* XMLPARSE */ YYSYMBOL_XMLPI = 508, /* XMLPI */ YYSYMBOL_XMLROOT = 509, /* XMLROOT */ YYSYMBOL_XMLSERIALIZE = 510, /* XMLSERIALIZE */ YYSYMBOL_XMLTABLE = 511, /* XMLTABLE */ YYSYMBOL_YEAR_P = 512, /* YEAR_P */ YYSYMBOL_YES_P = 513, /* YES_P */ YYSYMBOL_ZONE = 514, /* ZONE */ YYSYMBOL_FORMAT_LA = 515, /* FORMAT_LA */ YYSYMBOL_NOT_LA = 516, /* NOT_LA */ YYSYMBOL_NULLS_LA = 517, /* NULLS_LA */ YYSYMBOL_WITH_LA = 518, /* WITH_LA */ YYSYMBOL_WITHOUT_LA = 519, /* WITHOUT_LA */ YYSYMBOL_MODE_TYPE_NAME = 520, /* MODE_TYPE_NAME */ YYSYMBOL_MODE_PLPGSQL_EXPR = 521, /* MODE_PLPGSQL_EXPR */ YYSYMBOL_MODE_PLPGSQL_ASSIGN1 = 522, /* MODE_PLPGSQL_ASSIGN1 */ YYSYMBOL_MODE_PLPGSQL_ASSIGN2 = 523, /* MODE_PLPGSQL_ASSIGN2 */ YYSYMBOL_MODE_PLPGSQL_ASSIGN3 = 524, /* MODE_PLPGSQL_ASSIGN3 */ YYSYMBOL_525_ = 525, /* '<' */ YYSYMBOL_526_ = 526, /* '>' */ YYSYMBOL_527_ = 527, /* '=' */ YYSYMBOL_528_ = 528, /* '+' */ YYSYMBOL_529_ = 529, /* '-' */ YYSYMBOL_530_ = 530, /* '*' */ YYSYMBOL_531_ = 531, /* '/' */ YYSYMBOL_532_ = 532, /* '%' */ YYSYMBOL_533_ = 533, /* '^' */ YYSYMBOL_UMINUS = 534, /* UMINUS */ YYSYMBOL_535_ = 535, /* '[' */ YYSYMBOL_536_ = 536, /* ']' */ YYSYMBOL_537_ = 537, /* '(' */ YYSYMBOL_538_ = 538, /* ')' */ YYSYMBOL_539_ = 539, /* '.' */ YYSYMBOL_540_ = 540, /* ';' */ YYSYMBOL_541_ = 541, /* ',' */ YYSYMBOL_542_ = 542, /* ':' */ YYSYMBOL_YYACCEPT = 543, /* $accept */ YYSYMBOL_parse_toplevel = 544, /* parse_toplevel */ YYSYMBOL_stmtmulti = 545, /* stmtmulti */ YYSYMBOL_toplevel_stmt = 546, /* toplevel_stmt */ YYSYMBOL_stmt = 547, /* stmt */ YYSYMBOL_opt_single_name = 548, /* opt_single_name */ YYSYMBOL_opt_qualified_name = 549, /* opt_qualified_name */ YYSYMBOL_opt_concurrently = 550, /* opt_concurrently */ YYSYMBOL_opt_drop_behavior = 551, /* opt_drop_behavior */ YYSYMBOL_CallStmt = 552, /* CallStmt */ YYSYMBOL_CreateRoleStmt = 553, /* CreateRoleStmt */ YYSYMBOL_opt_with = 554, /* opt_with */ YYSYMBOL_OptRoleList = 555, /* OptRoleList */ YYSYMBOL_AlterOptRoleList = 556, /* AlterOptRoleList */ YYSYMBOL_AlterOptRoleElem = 557, /* AlterOptRoleElem */ YYSYMBOL_CreateOptRoleElem = 558, /* CreateOptRoleElem */ YYSYMBOL_CreateUserStmt = 559, /* CreateUserStmt */ YYSYMBOL_AlterRoleStmt = 560, /* AlterRoleStmt */ YYSYMBOL_opt_in_database = 561, /* opt_in_database */ YYSYMBOL_AlterRoleSetStmt = 562, /* AlterRoleSetStmt */ YYSYMBOL_DropRoleStmt = 563, /* DropRoleStmt */ YYSYMBOL_CreateGroupStmt = 564, /* CreateGroupStmt */ YYSYMBOL_AlterGroupStmt = 565, /* AlterGroupStmt */ YYSYMBOL_add_drop = 566, /* add_drop */ YYSYMBOL_CreateSchemaStmt = 567, /* CreateSchemaStmt */ YYSYMBOL_OptSchemaEltList = 568, /* OptSchemaEltList */ YYSYMBOL_schema_stmt = 569, /* schema_stmt */ YYSYMBOL_VariableSetStmt = 570, /* VariableSetStmt */ YYSYMBOL_set_rest = 571, /* set_rest */ YYSYMBOL_generic_set = 572, /* generic_set */ YYSYMBOL_set_rest_more = 573, /* set_rest_more */ YYSYMBOL_var_name = 574, /* var_name */ YYSYMBOL_var_list = 575, /* var_list */ YYSYMBOL_var_value = 576, /* var_value */ YYSYMBOL_iso_level = 577, /* iso_level */ YYSYMBOL_opt_boolean_or_string = 578, /* opt_boolean_or_string */ YYSYMBOL_zone_value = 579, /* zone_value */ YYSYMBOL_opt_encoding = 580, /* opt_encoding */ YYSYMBOL_NonReservedWord_or_Sconst = 581, /* NonReservedWord_or_Sconst */ YYSYMBOL_VariableResetStmt = 582, /* VariableResetStmt */ YYSYMBOL_reset_rest = 583, /* reset_rest */ YYSYMBOL_generic_reset = 584, /* generic_reset */ YYSYMBOL_SetResetClause = 585, /* SetResetClause */ YYSYMBOL_FunctionSetResetClause = 586, /* FunctionSetResetClause */ YYSYMBOL_VariableShowStmt = 587, /* VariableShowStmt */ YYSYMBOL_ConstraintsSetStmt = 588, /* ConstraintsSetStmt */ YYSYMBOL_constraints_set_list = 589, /* constraints_set_list */ YYSYMBOL_constraints_set_mode = 590, /* constraints_set_mode */ YYSYMBOL_CheckPointStmt = 591, /* CheckPointStmt */ YYSYMBOL_DiscardStmt = 592, /* DiscardStmt */ YYSYMBOL_AlterTableStmt = 593, /* AlterTableStmt */ YYSYMBOL_alter_table_cmds = 594, /* alter_table_cmds */ YYSYMBOL_partition_cmd = 595, /* partition_cmd */ YYSYMBOL_index_partition_cmd = 596, /* index_partition_cmd */ YYSYMBOL_alter_table_cmd = 597, /* alter_table_cmd */ YYSYMBOL_alter_column_default = 598, /* alter_column_default */ YYSYMBOL_opt_collate_clause = 599, /* opt_collate_clause */ YYSYMBOL_alter_using = 600, /* alter_using */ YYSYMBOL_replica_identity = 601, /* replica_identity */ YYSYMBOL_reloptions = 602, /* reloptions */ YYSYMBOL_opt_reloptions = 603, /* opt_reloptions */ YYSYMBOL_reloption_list = 604, /* reloption_list */ YYSYMBOL_reloption_elem = 605, /* reloption_elem */ YYSYMBOL_alter_identity_column_option_list = 606, /* alter_identity_column_option_list */ YYSYMBOL_alter_identity_column_option = 607, /* alter_identity_column_option */ YYSYMBOL_set_statistics_value = 608, /* set_statistics_value */ YYSYMBOL_set_access_method_name = 609, /* set_access_method_name */ YYSYMBOL_PartitionBoundSpec = 610, /* PartitionBoundSpec */ YYSYMBOL_hash_partbound_elem = 611, /* hash_partbound_elem */ YYSYMBOL_hash_partbound = 612, /* hash_partbound */ YYSYMBOL_AlterCompositeTypeStmt = 613, /* AlterCompositeTypeStmt */ YYSYMBOL_alter_type_cmds = 614, /* alter_type_cmds */ YYSYMBOL_alter_type_cmd = 615, /* alter_type_cmd */ YYSYMBOL_ClosePortalStmt = 616, /* ClosePortalStmt */ YYSYMBOL_CopyStmt = 617, /* CopyStmt */ YYSYMBOL_copy_from = 618, /* copy_from */ YYSYMBOL_opt_program = 619, /* opt_program */ YYSYMBOL_copy_file_name = 620, /* copy_file_name */ YYSYMBOL_copy_options = 621, /* copy_options */ YYSYMBOL_copy_opt_list = 622, /* copy_opt_list */ YYSYMBOL_copy_opt_item = 623, /* copy_opt_item */ YYSYMBOL_opt_binary = 624, /* opt_binary */ YYSYMBOL_copy_delimiter = 625, /* copy_delimiter */ YYSYMBOL_opt_using = 626, /* opt_using */ YYSYMBOL_copy_generic_opt_list = 627, /* copy_generic_opt_list */ YYSYMBOL_copy_generic_opt_elem = 628, /* copy_generic_opt_elem */ YYSYMBOL_copy_generic_opt_arg = 629, /* copy_generic_opt_arg */ YYSYMBOL_copy_generic_opt_arg_list = 630, /* copy_generic_opt_arg_list */ YYSYMBOL_copy_generic_opt_arg_list_item = 631, /* copy_generic_opt_arg_list_item */ YYSYMBOL_CreateStmt = 632, /* CreateStmt */ YYSYMBOL_OptTemp = 633, /* OptTemp */ YYSYMBOL_OptTableElementList = 634, /* OptTableElementList */ YYSYMBOL_OptTypedTableElementList = 635, /* OptTypedTableElementList */ YYSYMBOL_TableElementList = 636, /* TableElementList */ YYSYMBOL_TypedTableElementList = 637, /* TypedTableElementList */ YYSYMBOL_TableElement = 638, /* TableElement */ YYSYMBOL_TypedTableElement = 639, /* TypedTableElement */ YYSYMBOL_columnDef = 640, /* columnDef */ YYSYMBOL_columnOptions = 641, /* columnOptions */ YYSYMBOL_column_compression = 642, /* column_compression */ YYSYMBOL_opt_column_compression = 643, /* opt_column_compression */ YYSYMBOL_column_storage = 644, /* column_storage */ YYSYMBOL_opt_column_storage = 645, /* opt_column_storage */ YYSYMBOL_ColQualList = 646, /* ColQualList */ YYSYMBOL_ColConstraint = 647, /* ColConstraint */ YYSYMBOL_ColConstraintElem = 648, /* ColConstraintElem */ YYSYMBOL_opt_unique_null_treatment = 649, /* opt_unique_null_treatment */ YYSYMBOL_generated_when = 650, /* generated_when */ YYSYMBOL_opt_virtual_or_stored = 651, /* opt_virtual_or_stored */ YYSYMBOL_ConstraintAttr = 652, /* ConstraintAttr */ YYSYMBOL_TableLikeClause = 653, /* TableLikeClause */ YYSYMBOL_TableLikeOptionList = 654, /* TableLikeOptionList */ YYSYMBOL_TableLikeOption = 655, /* TableLikeOption */ YYSYMBOL_TableConstraint = 656, /* TableConstraint */ YYSYMBOL_ConstraintElem = 657, /* ConstraintElem */ YYSYMBOL_DomainConstraint = 658, /* DomainConstraint */ YYSYMBOL_DomainConstraintElem = 659, /* DomainConstraintElem */ YYSYMBOL_opt_no_inherit = 660, /* opt_no_inherit */ YYSYMBOL_opt_without_overlaps = 661, /* opt_without_overlaps */ YYSYMBOL_opt_column_list = 662, /* opt_column_list */ YYSYMBOL_columnList = 663, /* columnList */ YYSYMBOL_optionalPeriodName = 664, /* optionalPeriodName */ YYSYMBOL_opt_column_and_period_list = 665, /* opt_column_and_period_list */ YYSYMBOL_columnElem = 666, /* columnElem */ YYSYMBOL_opt_c_include = 667, /* opt_c_include */ YYSYMBOL_key_match = 668, /* key_match */ YYSYMBOL_ExclusionConstraintList = 669, /* ExclusionConstraintList */ YYSYMBOL_ExclusionConstraintElem = 670, /* ExclusionConstraintElem */ YYSYMBOL_OptWhereClause = 671, /* OptWhereClause */ YYSYMBOL_key_actions = 672, /* key_actions */ YYSYMBOL_key_update = 673, /* key_update */ YYSYMBOL_key_delete = 674, /* key_delete */ YYSYMBOL_key_action = 675, /* key_action */ YYSYMBOL_OptInherit = 676, /* OptInherit */ YYSYMBOL_OptPartitionSpec = 677, /* OptPartitionSpec */ YYSYMBOL_PartitionSpec = 678, /* PartitionSpec */ YYSYMBOL_part_params = 679, /* part_params */ YYSYMBOL_part_elem = 680, /* part_elem */ YYSYMBOL_table_access_method_clause = 681, /* table_access_method_clause */ YYSYMBOL_OptWith = 682, /* OptWith */ YYSYMBOL_OnCommitOption = 683, /* OnCommitOption */ YYSYMBOL_OptTableSpace = 684, /* OptTableSpace */ YYSYMBOL_OptConsTableSpace = 685, /* OptConsTableSpace */ YYSYMBOL_ExistingIndex = 686, /* ExistingIndex */ YYSYMBOL_CreateStatsStmt = 687, /* CreateStatsStmt */ YYSYMBOL_stats_params = 688, /* stats_params */ YYSYMBOL_stats_param = 689, /* stats_param */ YYSYMBOL_AlterStatsStmt = 690, /* AlterStatsStmt */ YYSYMBOL_CreateAsStmt = 691, /* CreateAsStmt */ YYSYMBOL_create_as_target = 692, /* create_as_target */ YYSYMBOL_opt_with_data = 693, /* opt_with_data */ YYSYMBOL_CreateMatViewStmt = 694, /* CreateMatViewStmt */ YYSYMBOL_create_mv_target = 695, /* create_mv_target */ YYSYMBOL_OptNoLog = 696, /* OptNoLog */ YYSYMBOL_RefreshMatViewStmt = 697, /* RefreshMatViewStmt */ YYSYMBOL_CreateSeqStmt = 698, /* CreateSeqStmt */ YYSYMBOL_AlterSeqStmt = 699, /* AlterSeqStmt */ YYSYMBOL_OptSeqOptList = 700, /* OptSeqOptList */ YYSYMBOL_OptParenthesizedSeqOptList = 701, /* OptParenthesizedSeqOptList */ YYSYMBOL_SeqOptList = 702, /* SeqOptList */ YYSYMBOL_SeqOptElem = 703, /* SeqOptElem */ YYSYMBOL_opt_by = 704, /* opt_by */ YYSYMBOL_NumericOnly = 705, /* NumericOnly */ YYSYMBOL_NumericOnly_list = 706, /* NumericOnly_list */ YYSYMBOL_CreatePLangStmt = 707, /* CreatePLangStmt */ YYSYMBOL_opt_trusted = 708, /* opt_trusted */ YYSYMBOL_handler_name = 709, /* handler_name */ YYSYMBOL_opt_inline_handler = 710, /* opt_inline_handler */ YYSYMBOL_validator_clause = 711, /* validator_clause */ YYSYMBOL_opt_validator = 712, /* opt_validator */ YYSYMBOL_opt_procedural = 713, /* opt_procedural */ YYSYMBOL_CreateTableSpaceStmt = 714, /* CreateTableSpaceStmt */ YYSYMBOL_OptTableSpaceOwner = 715, /* OptTableSpaceOwner */ YYSYMBOL_DropTableSpaceStmt = 716, /* DropTableSpaceStmt */ YYSYMBOL_CreateExtensionStmt = 717, /* CreateExtensionStmt */ YYSYMBOL_create_extension_opt_list = 718, /* create_extension_opt_list */ YYSYMBOL_create_extension_opt_item = 719, /* create_extension_opt_item */ YYSYMBOL_AlterExtensionStmt = 720, /* AlterExtensionStmt */ YYSYMBOL_alter_extension_opt_list = 721, /* alter_extension_opt_list */ YYSYMBOL_alter_extension_opt_item = 722, /* alter_extension_opt_item */ YYSYMBOL_AlterExtensionContentsStmt = 723, /* AlterExtensionContentsStmt */ YYSYMBOL_CreateFdwStmt = 724, /* CreateFdwStmt */ YYSYMBOL_fdw_option = 725, /* fdw_option */ YYSYMBOL_fdw_options = 726, /* fdw_options */ YYSYMBOL_opt_fdw_options = 727, /* opt_fdw_options */ YYSYMBOL_AlterFdwStmt = 728, /* AlterFdwStmt */ YYSYMBOL_create_generic_options = 729, /* create_generic_options */ YYSYMBOL_generic_option_list = 730, /* generic_option_list */ YYSYMBOL_alter_generic_options = 731, /* alter_generic_options */ YYSYMBOL_alter_generic_option_list = 732, /* alter_generic_option_list */ YYSYMBOL_alter_generic_option_elem = 733, /* alter_generic_option_elem */ YYSYMBOL_generic_option_elem = 734, /* generic_option_elem */ YYSYMBOL_generic_option_name = 735, /* generic_option_name */ YYSYMBOL_generic_option_arg = 736, /* generic_option_arg */ YYSYMBOL_CreateForeignServerStmt = 737, /* CreateForeignServerStmt */ YYSYMBOL_opt_type = 738, /* opt_type */ YYSYMBOL_foreign_server_version = 739, /* foreign_server_version */ YYSYMBOL_opt_foreign_server_version = 740, /* opt_foreign_server_version */ YYSYMBOL_AlterForeignServerStmt = 741, /* AlterForeignServerStmt */ YYSYMBOL_CreateForeignTableStmt = 742, /* CreateForeignTableStmt */ YYSYMBOL_ImportForeignSchemaStmt = 743, /* ImportForeignSchemaStmt */ YYSYMBOL_import_qualification_type = 744, /* import_qualification_type */ YYSYMBOL_import_qualification = 745, /* import_qualification */ YYSYMBOL_CreateUserMappingStmt = 746, /* CreateUserMappingStmt */ YYSYMBOL_auth_ident = 747, /* auth_ident */ YYSYMBOL_DropUserMappingStmt = 748, /* DropUserMappingStmt */ YYSYMBOL_AlterUserMappingStmt = 749, /* AlterUserMappingStmt */ YYSYMBOL_CreatePolicyStmt = 750, /* CreatePolicyStmt */ YYSYMBOL_AlterPolicyStmt = 751, /* AlterPolicyStmt */ YYSYMBOL_RowSecurityOptionalExpr = 752, /* RowSecurityOptionalExpr */ YYSYMBOL_RowSecurityOptionalWithCheck = 753, /* RowSecurityOptionalWithCheck */ YYSYMBOL_RowSecurityDefaultToRole = 754, /* RowSecurityDefaultToRole */ YYSYMBOL_RowSecurityOptionalToRole = 755, /* RowSecurityOptionalToRole */ YYSYMBOL_RowSecurityDefaultPermissive = 756, /* RowSecurityDefaultPermissive */ YYSYMBOL_RowSecurityDefaultForCmd = 757, /* RowSecurityDefaultForCmd */ YYSYMBOL_row_security_cmd = 758, /* row_security_cmd */ YYSYMBOL_CreateAmStmt = 759, /* CreateAmStmt */ YYSYMBOL_am_type = 760, /* am_type */ YYSYMBOL_CreateTrigStmt = 761, /* CreateTrigStmt */ YYSYMBOL_TriggerActionTime = 762, /* TriggerActionTime */ YYSYMBOL_TriggerEvents = 763, /* TriggerEvents */ YYSYMBOL_TriggerOneEvent = 764, /* TriggerOneEvent */ YYSYMBOL_TriggerReferencing = 765, /* TriggerReferencing */ YYSYMBOL_TriggerTransitions = 766, /* TriggerTransitions */ YYSYMBOL_TriggerTransition = 767, /* TriggerTransition */ YYSYMBOL_TransitionOldOrNew = 768, /* TransitionOldOrNew */ YYSYMBOL_TransitionRowOrTable = 769, /* TransitionRowOrTable */ YYSYMBOL_TransitionRelName = 770, /* TransitionRelName */ YYSYMBOL_TriggerForSpec = 771, /* TriggerForSpec */ YYSYMBOL_TriggerForOptEach = 772, /* TriggerForOptEach */ YYSYMBOL_TriggerForType = 773, /* TriggerForType */ YYSYMBOL_TriggerWhen = 774, /* TriggerWhen */ YYSYMBOL_FUNCTION_or_PROCEDURE = 775, /* FUNCTION_or_PROCEDURE */ YYSYMBOL_TriggerFuncArgs = 776, /* TriggerFuncArgs */ YYSYMBOL_TriggerFuncArg = 777, /* TriggerFuncArg */ YYSYMBOL_OptConstrFromTable = 778, /* OptConstrFromTable */ YYSYMBOL_ConstraintAttributeSpec = 779, /* ConstraintAttributeSpec */ YYSYMBOL_ConstraintAttributeElem = 780, /* ConstraintAttributeElem */ YYSYMBOL_CreateEventTrigStmt = 781, /* CreateEventTrigStmt */ YYSYMBOL_event_trigger_when_list = 782, /* event_trigger_when_list */ YYSYMBOL_event_trigger_when_item = 783, /* event_trigger_when_item */ YYSYMBOL_event_trigger_value_list = 784, /* event_trigger_value_list */ YYSYMBOL_AlterEventTrigStmt = 785, /* AlterEventTrigStmt */ YYSYMBOL_enable_trigger = 786, /* enable_trigger */ YYSYMBOL_CreateAssertionStmt = 787, /* CreateAssertionStmt */ YYSYMBOL_DefineStmt = 788, /* DefineStmt */ YYSYMBOL_definition = 789, /* definition */ YYSYMBOL_def_list = 790, /* def_list */ YYSYMBOL_def_elem = 791, /* def_elem */ YYSYMBOL_def_arg = 792, /* def_arg */ YYSYMBOL_old_aggr_definition = 793, /* old_aggr_definition */ YYSYMBOL_old_aggr_list = 794, /* old_aggr_list */ YYSYMBOL_old_aggr_elem = 795, /* old_aggr_elem */ YYSYMBOL_opt_enum_val_list = 796, /* opt_enum_val_list */ YYSYMBOL_enum_val_list = 797, /* enum_val_list */ YYSYMBOL_AlterEnumStmt = 798, /* AlterEnumStmt */ YYSYMBOL_opt_if_not_exists = 799, /* opt_if_not_exists */ YYSYMBOL_CreateOpClassStmt = 800, /* CreateOpClassStmt */ YYSYMBOL_opclass_item_list = 801, /* opclass_item_list */ YYSYMBOL_opclass_item = 802, /* opclass_item */ YYSYMBOL_opt_default = 803, /* opt_default */ YYSYMBOL_opt_opfamily = 804, /* opt_opfamily */ YYSYMBOL_opclass_purpose = 805, /* opclass_purpose */ YYSYMBOL_CreateOpFamilyStmt = 806, /* CreateOpFamilyStmt */ YYSYMBOL_AlterOpFamilyStmt = 807, /* AlterOpFamilyStmt */ YYSYMBOL_opclass_drop_list = 808, /* opclass_drop_list */ YYSYMBOL_opclass_drop = 809, /* opclass_drop */ YYSYMBOL_DropOpClassStmt = 810, /* DropOpClassStmt */ YYSYMBOL_DropOpFamilyStmt = 811, /* DropOpFamilyStmt */ YYSYMBOL_DropOwnedStmt = 812, /* DropOwnedStmt */ YYSYMBOL_ReassignOwnedStmt = 813, /* ReassignOwnedStmt */ YYSYMBOL_DropStmt = 814, /* DropStmt */ YYSYMBOL_object_type_any_name = 815, /* object_type_any_name */ YYSYMBOL_object_type_name = 816, /* object_type_name */ YYSYMBOL_drop_type_name = 817, /* drop_type_name */ YYSYMBOL_object_type_name_on_any_name = 818, /* object_type_name_on_any_name */ YYSYMBOL_any_name_list = 819, /* any_name_list */ YYSYMBOL_any_name = 820, /* any_name */ YYSYMBOL_attrs = 821, /* attrs */ YYSYMBOL_type_name_list = 822, /* type_name_list */ YYSYMBOL_TruncateStmt = 823, /* TruncateStmt */ YYSYMBOL_opt_restart_seqs = 824, /* opt_restart_seqs */ YYSYMBOL_CommentStmt = 825, /* CommentStmt */ YYSYMBOL_comment_text = 826, /* comment_text */ YYSYMBOL_SecLabelStmt = 827, /* SecLabelStmt */ YYSYMBOL_opt_provider = 828, /* opt_provider */ YYSYMBOL_security_label = 829, /* security_label */ YYSYMBOL_FetchStmt = 830, /* FetchStmt */ YYSYMBOL_fetch_args = 831, /* fetch_args */ YYSYMBOL_from_in = 832, /* from_in */ YYSYMBOL_opt_from_in = 833, /* opt_from_in */ YYSYMBOL_GrantStmt = 834, /* GrantStmt */ YYSYMBOL_RevokeStmt = 835, /* RevokeStmt */ YYSYMBOL_privileges = 836, /* privileges */ YYSYMBOL_privilege_list = 837, /* privilege_list */ YYSYMBOL_privilege = 838, /* privilege */ YYSYMBOL_parameter_name_list = 839, /* parameter_name_list */ YYSYMBOL_parameter_name = 840, /* parameter_name */ YYSYMBOL_privilege_target = 841, /* privilege_target */ YYSYMBOL_grantee_list = 842, /* grantee_list */ YYSYMBOL_grantee = 843, /* grantee */ YYSYMBOL_opt_grant_grant_option = 844, /* opt_grant_grant_option */ YYSYMBOL_GrantRoleStmt = 845, /* GrantRoleStmt */ YYSYMBOL_RevokeRoleStmt = 846, /* RevokeRoleStmt */ YYSYMBOL_grant_role_opt_list = 847, /* grant_role_opt_list */ YYSYMBOL_grant_role_opt = 848, /* grant_role_opt */ YYSYMBOL_grant_role_opt_value = 849, /* grant_role_opt_value */ YYSYMBOL_opt_granted_by = 850, /* opt_granted_by */ YYSYMBOL_AlterDefaultPrivilegesStmt = 851, /* AlterDefaultPrivilegesStmt */ YYSYMBOL_DefACLOptionList = 852, /* DefACLOptionList */ YYSYMBOL_DefACLOption = 853, /* DefACLOption */ YYSYMBOL_DefACLAction = 854, /* DefACLAction */ YYSYMBOL_defacl_privilege_target = 855, /* defacl_privilege_target */ YYSYMBOL_IndexStmt = 856, /* IndexStmt */ YYSYMBOL_opt_unique = 857, /* opt_unique */ YYSYMBOL_access_method_clause = 858, /* access_method_clause */ YYSYMBOL_index_params = 859, /* index_params */ YYSYMBOL_index_elem_options = 860, /* index_elem_options */ YYSYMBOL_index_elem = 861, /* index_elem */ YYSYMBOL_opt_include = 862, /* opt_include */ YYSYMBOL_index_including_params = 863, /* index_including_params */ YYSYMBOL_opt_collate = 864, /* opt_collate */ YYSYMBOL_opt_asc_desc = 865, /* opt_asc_desc */ YYSYMBOL_opt_nulls_order = 866, /* opt_nulls_order */ YYSYMBOL_CreateFunctionStmt = 867, /* CreateFunctionStmt */ YYSYMBOL_opt_or_replace = 868, /* opt_or_replace */ YYSYMBOL_func_args = 869, /* func_args */ YYSYMBOL_func_args_list = 870, /* func_args_list */ YYSYMBOL_function_with_argtypes_list = 871, /* function_with_argtypes_list */ YYSYMBOL_function_with_argtypes = 872, /* function_with_argtypes */ YYSYMBOL_func_args_with_defaults = 873, /* func_args_with_defaults */ YYSYMBOL_func_args_with_defaults_list = 874, /* func_args_with_defaults_list */ YYSYMBOL_func_arg = 875, /* func_arg */ YYSYMBOL_arg_class = 876, /* arg_class */ YYSYMBOL_param_name = 877, /* param_name */ YYSYMBOL_func_return = 878, /* func_return */ YYSYMBOL_func_type = 879, /* func_type */ YYSYMBOL_func_arg_with_default = 880, /* func_arg_with_default */ YYSYMBOL_aggr_arg = 881, /* aggr_arg */ YYSYMBOL_aggr_args = 882, /* aggr_args */ YYSYMBOL_aggr_args_list = 883, /* aggr_args_list */ YYSYMBOL_aggregate_with_argtypes = 884, /* aggregate_with_argtypes */ YYSYMBOL_aggregate_with_argtypes_list = 885, /* aggregate_with_argtypes_list */ YYSYMBOL_opt_createfunc_opt_list = 886, /* opt_createfunc_opt_list */ YYSYMBOL_createfunc_opt_list = 887, /* createfunc_opt_list */ YYSYMBOL_common_func_opt_item = 888, /* common_func_opt_item */ YYSYMBOL_createfunc_opt_item = 889, /* createfunc_opt_item */ YYSYMBOL_func_as = 890, /* func_as */ YYSYMBOL_ReturnStmt = 891, /* ReturnStmt */ YYSYMBOL_opt_routine_body = 892, /* opt_routine_body */ YYSYMBOL_routine_body_stmt_list = 893, /* routine_body_stmt_list */ YYSYMBOL_routine_body_stmt = 894, /* routine_body_stmt */ YYSYMBOL_transform_type_list = 895, /* transform_type_list */ YYSYMBOL_opt_definition = 896, /* opt_definition */ YYSYMBOL_table_func_column = 897, /* table_func_column */ YYSYMBOL_table_func_column_list = 898, /* table_func_column_list */ YYSYMBOL_AlterFunctionStmt = 899, /* AlterFunctionStmt */ YYSYMBOL_alterfunc_opt_list = 900, /* alterfunc_opt_list */ YYSYMBOL_opt_restrict = 901, /* opt_restrict */ YYSYMBOL_RemoveFuncStmt = 902, /* RemoveFuncStmt */ YYSYMBOL_RemoveAggrStmt = 903, /* RemoveAggrStmt */ YYSYMBOL_RemoveOperStmt = 904, /* RemoveOperStmt */ YYSYMBOL_oper_argtypes = 905, /* oper_argtypes */ YYSYMBOL_any_operator = 906, /* any_operator */ YYSYMBOL_operator_with_argtypes_list = 907, /* operator_with_argtypes_list */ YYSYMBOL_operator_with_argtypes = 908, /* operator_with_argtypes */ YYSYMBOL_DoStmt = 909, /* DoStmt */ YYSYMBOL_dostmt_opt_list = 910, /* dostmt_opt_list */ YYSYMBOL_dostmt_opt_item = 911, /* dostmt_opt_item */ YYSYMBOL_CreateCastStmt = 912, /* CreateCastStmt */ YYSYMBOL_cast_context = 913, /* cast_context */ YYSYMBOL_DropCastStmt = 914, /* DropCastStmt */ YYSYMBOL_opt_if_exists = 915, /* opt_if_exists */ YYSYMBOL_CreateTransformStmt = 916, /* CreateTransformStmt */ YYSYMBOL_transform_element_list = 917, /* transform_element_list */ YYSYMBOL_DropTransformStmt = 918, /* DropTransformStmt */ YYSYMBOL_ReindexStmt = 919, /* ReindexStmt */ YYSYMBOL_reindex_target_relation = 920, /* reindex_target_relation */ YYSYMBOL_reindex_target_all = 921, /* reindex_target_all */ YYSYMBOL_opt_reindex_option_list = 922, /* opt_reindex_option_list */ YYSYMBOL_AlterTblSpcStmt = 923, /* AlterTblSpcStmt */ YYSYMBOL_RenameStmt = 924, /* RenameStmt */ YYSYMBOL_opt_column = 925, /* opt_column */ YYSYMBOL_opt_set_data = 926, /* opt_set_data */ YYSYMBOL_AlterObjectDependsStmt = 927, /* AlterObjectDependsStmt */ YYSYMBOL_opt_no = 928, /* opt_no */ YYSYMBOL_AlterObjectSchemaStmt = 929, /* AlterObjectSchemaStmt */ YYSYMBOL_AlterOperatorStmt = 930, /* AlterOperatorStmt */ YYSYMBOL_operator_def_list = 931, /* operator_def_list */ YYSYMBOL_operator_def_elem = 932, /* operator_def_elem */ YYSYMBOL_operator_def_arg = 933, /* operator_def_arg */ YYSYMBOL_AlterTypeStmt = 934, /* AlterTypeStmt */ YYSYMBOL_AlterOwnerStmt = 935, /* AlterOwnerStmt */ YYSYMBOL_CreatePublicationStmt = 936, /* CreatePublicationStmt */ YYSYMBOL_PublicationObjSpec = 937, /* PublicationObjSpec */ YYSYMBOL_pub_obj_list = 938, /* pub_obj_list */ YYSYMBOL_AlterPublicationStmt = 939, /* AlterPublicationStmt */ YYSYMBOL_CreateSubscriptionStmt = 940, /* CreateSubscriptionStmt */ YYSYMBOL_AlterSubscriptionStmt = 941, /* AlterSubscriptionStmt */ YYSYMBOL_DropSubscriptionStmt = 942, /* DropSubscriptionStmt */ YYSYMBOL_RuleStmt = 943, /* RuleStmt */ YYSYMBOL_RuleActionList = 944, /* RuleActionList */ YYSYMBOL_RuleActionMulti = 945, /* RuleActionMulti */ YYSYMBOL_RuleActionStmt = 946, /* RuleActionStmt */ YYSYMBOL_RuleActionStmtOrEmpty = 947, /* RuleActionStmtOrEmpty */ YYSYMBOL_event = 948, /* event */ YYSYMBOL_opt_instead = 949, /* opt_instead */ YYSYMBOL_NotifyStmt = 950, /* NotifyStmt */ YYSYMBOL_notify_payload = 951, /* notify_payload */ YYSYMBOL_ListenStmt = 952, /* ListenStmt */ YYSYMBOL_UnlistenStmt = 953, /* UnlistenStmt */ YYSYMBOL_TransactionStmt = 954, /* TransactionStmt */ YYSYMBOL_TransactionStmtLegacy = 955, /* TransactionStmtLegacy */ YYSYMBOL_opt_transaction = 956, /* opt_transaction */ YYSYMBOL_transaction_mode_item = 957, /* transaction_mode_item */ YYSYMBOL_transaction_mode_list = 958, /* transaction_mode_list */ YYSYMBOL_transaction_mode_list_or_empty = 959, /* transaction_mode_list_or_empty */ YYSYMBOL_opt_transaction_chain = 960, /* opt_transaction_chain */ YYSYMBOL_ViewStmt = 961, /* ViewStmt */ YYSYMBOL_opt_check_option = 962, /* opt_check_option */ YYSYMBOL_LoadStmt = 963, /* LoadStmt */ YYSYMBOL_CreatedbStmt = 964, /* CreatedbStmt */ YYSYMBOL_createdb_opt_list = 965, /* createdb_opt_list */ YYSYMBOL_createdb_opt_items = 966, /* createdb_opt_items */ YYSYMBOL_createdb_opt_item = 967, /* createdb_opt_item */ YYSYMBOL_createdb_opt_name = 968, /* createdb_opt_name */ YYSYMBOL_opt_equal = 969, /* opt_equal */ YYSYMBOL_AlterDatabaseStmt = 970, /* AlterDatabaseStmt */ YYSYMBOL_AlterDatabaseSetStmt = 971, /* AlterDatabaseSetStmt */ YYSYMBOL_DropdbStmt = 972, /* DropdbStmt */ YYSYMBOL_drop_option_list = 973, /* drop_option_list */ YYSYMBOL_drop_option = 974, /* drop_option */ YYSYMBOL_AlterCollationStmt = 975, /* AlterCollationStmt */ YYSYMBOL_AlterSystemStmt = 976, /* AlterSystemStmt */ YYSYMBOL_CreateDomainStmt = 977, /* CreateDomainStmt */ YYSYMBOL_AlterDomainStmt = 978, /* AlterDomainStmt */ YYSYMBOL_opt_as = 979, /* opt_as */ YYSYMBOL_AlterTSDictionaryStmt = 980, /* AlterTSDictionaryStmt */ YYSYMBOL_AlterTSConfigurationStmt = 981, /* AlterTSConfigurationStmt */ YYSYMBOL_any_with = 982, /* any_with */ YYSYMBOL_CreateConversionStmt = 983, /* CreateConversionStmt */ YYSYMBOL_ClusterStmt = 984, /* ClusterStmt */ YYSYMBOL_cluster_index_specification = 985, /* cluster_index_specification */ YYSYMBOL_VacuumStmt = 986, /* VacuumStmt */ YYSYMBOL_AnalyzeStmt = 987, /* AnalyzeStmt */ YYSYMBOL_utility_option_list = 988, /* utility_option_list */ YYSYMBOL_analyze_keyword = 989, /* analyze_keyword */ YYSYMBOL_utility_option_elem = 990, /* utility_option_elem */ YYSYMBOL_utility_option_name = 991, /* utility_option_name */ YYSYMBOL_utility_option_arg = 992, /* utility_option_arg */ YYSYMBOL_opt_analyze = 993, /* opt_analyze */ YYSYMBOL_opt_verbose = 994, /* opt_verbose */ YYSYMBOL_opt_full = 995, /* opt_full */ YYSYMBOL_opt_freeze = 996, /* opt_freeze */ YYSYMBOL_opt_name_list = 997, /* opt_name_list */ YYSYMBOL_vacuum_relation = 998, /* vacuum_relation */ YYSYMBOL_vacuum_relation_list = 999, /* vacuum_relation_list */ YYSYMBOL_opt_vacuum_relation_list = 1000, /* opt_vacuum_relation_list */ YYSYMBOL_ExplainStmt = 1001, /* ExplainStmt */ YYSYMBOL_ExplainableStmt = 1002, /* ExplainableStmt */ YYSYMBOL_PrepareStmt = 1003, /* PrepareStmt */ YYSYMBOL_prep_type_clause = 1004, /* prep_type_clause */ YYSYMBOL_PreparableStmt = 1005, /* PreparableStmt */ YYSYMBOL_ExecuteStmt = 1006, /* ExecuteStmt */ YYSYMBOL_execute_param_clause = 1007, /* execute_param_clause */ YYSYMBOL_DeallocateStmt = 1008, /* DeallocateStmt */ YYSYMBOL_InsertStmt = 1009, /* InsertStmt */ YYSYMBOL_insert_target = 1010, /* insert_target */ YYSYMBOL_insert_rest = 1011, /* insert_rest */ YYSYMBOL_override_kind = 1012, /* override_kind */ YYSYMBOL_insert_column_list = 1013, /* insert_column_list */ YYSYMBOL_insert_column_item = 1014, /* insert_column_item */ YYSYMBOL_opt_on_conflict = 1015, /* opt_on_conflict */ YYSYMBOL_opt_conf_expr = 1016, /* opt_conf_expr */ YYSYMBOL_returning_clause = 1017, /* returning_clause */ YYSYMBOL_returning_with_clause = 1018, /* returning_with_clause */ YYSYMBOL_returning_options = 1019, /* returning_options */ YYSYMBOL_returning_option = 1020, /* returning_option */ YYSYMBOL_returning_option_kind = 1021, /* returning_option_kind */ YYSYMBOL_DeleteStmt = 1022, /* DeleteStmt */ YYSYMBOL_using_clause = 1023, /* using_clause */ YYSYMBOL_LockStmt = 1024, /* LockStmt */ YYSYMBOL_opt_lock = 1025, /* opt_lock */ YYSYMBOL_lock_type = 1026, /* lock_type */ YYSYMBOL_opt_nowait = 1027, /* opt_nowait */ YYSYMBOL_opt_nowait_or_skip = 1028, /* opt_nowait_or_skip */ YYSYMBOL_UpdateStmt = 1029, /* UpdateStmt */ YYSYMBOL_set_clause_list = 1030, /* set_clause_list */ YYSYMBOL_set_clause = 1031, /* set_clause */ YYSYMBOL_set_target = 1032, /* set_target */ YYSYMBOL_set_target_list = 1033, /* set_target_list */ YYSYMBOL_MergeStmt = 1034, /* MergeStmt */ YYSYMBOL_merge_when_list = 1035, /* merge_when_list */ YYSYMBOL_merge_when_clause = 1036, /* merge_when_clause */ YYSYMBOL_merge_when_tgt_matched = 1037, /* merge_when_tgt_matched */ YYSYMBOL_merge_when_tgt_not_matched = 1038, /* merge_when_tgt_not_matched */ YYSYMBOL_opt_merge_when_condition = 1039, /* opt_merge_when_condition */ YYSYMBOL_merge_update = 1040, /* merge_update */ YYSYMBOL_merge_delete = 1041, /* merge_delete */ YYSYMBOL_merge_insert = 1042, /* merge_insert */ YYSYMBOL_merge_values_clause = 1043, /* merge_values_clause */ YYSYMBOL_DeclareCursorStmt = 1044, /* DeclareCursorStmt */ YYSYMBOL_cursor_name = 1045, /* cursor_name */ YYSYMBOL_cursor_options = 1046, /* cursor_options */ YYSYMBOL_opt_hold = 1047, /* opt_hold */ YYSYMBOL_SelectStmt = 1048, /* SelectStmt */ YYSYMBOL_select_with_parens = 1049, /* select_with_parens */ YYSYMBOL_select_no_parens = 1050, /* select_no_parens */ YYSYMBOL_select_clause = 1051, /* select_clause */ YYSYMBOL_simple_select = 1052, /* simple_select */ YYSYMBOL_with_clause = 1053, /* with_clause */ YYSYMBOL_cte_list = 1054, /* cte_list */ YYSYMBOL_common_table_expr = 1055, /* common_table_expr */ YYSYMBOL_opt_materialized = 1056, /* opt_materialized */ YYSYMBOL_opt_search_clause = 1057, /* opt_search_clause */ YYSYMBOL_opt_cycle_clause = 1058, /* opt_cycle_clause */ YYSYMBOL_opt_with_clause = 1059, /* opt_with_clause */ YYSYMBOL_into_clause = 1060, /* into_clause */ YYSYMBOL_OptTempTableName = 1061, /* OptTempTableName */ YYSYMBOL_opt_table = 1062, /* opt_table */ YYSYMBOL_set_quantifier = 1063, /* set_quantifier */ YYSYMBOL_distinct_clause = 1064, /* distinct_clause */ YYSYMBOL_opt_all_clause = 1065, /* opt_all_clause */ YYSYMBOL_opt_distinct_clause = 1066, /* opt_distinct_clause */ YYSYMBOL_opt_sort_clause = 1067, /* opt_sort_clause */ YYSYMBOL_sort_clause = 1068, /* sort_clause */ YYSYMBOL_sortby_list = 1069, /* sortby_list */ YYSYMBOL_sortby = 1070, /* sortby */ YYSYMBOL_select_limit = 1071, /* select_limit */ YYSYMBOL_opt_select_limit = 1072, /* opt_select_limit */ YYSYMBOL_limit_clause = 1073, /* limit_clause */ YYSYMBOL_offset_clause = 1074, /* offset_clause */ YYSYMBOL_select_limit_value = 1075, /* select_limit_value */ YYSYMBOL_select_offset_value = 1076, /* select_offset_value */ YYSYMBOL_select_fetch_first_value = 1077, /* select_fetch_first_value */ YYSYMBOL_I_or_F_const = 1078, /* I_or_F_const */ YYSYMBOL_row_or_rows = 1079, /* row_or_rows */ YYSYMBOL_first_or_next = 1080, /* first_or_next */ YYSYMBOL_group_clause = 1081, /* group_clause */ YYSYMBOL_group_by_list = 1082, /* group_by_list */ YYSYMBOL_group_by_item = 1083, /* group_by_item */ YYSYMBOL_empty_grouping_set = 1084, /* empty_grouping_set */ YYSYMBOL_rollup_clause = 1085, /* rollup_clause */ YYSYMBOL_cube_clause = 1086, /* cube_clause */ YYSYMBOL_grouping_sets_clause = 1087, /* grouping_sets_clause */ YYSYMBOL_having_clause = 1088, /* having_clause */ YYSYMBOL_for_locking_clause = 1089, /* for_locking_clause */ YYSYMBOL_opt_for_locking_clause = 1090, /* opt_for_locking_clause */ YYSYMBOL_for_locking_items = 1091, /* for_locking_items */ YYSYMBOL_for_locking_item = 1092, /* for_locking_item */ YYSYMBOL_for_locking_strength = 1093, /* for_locking_strength */ YYSYMBOL_locked_rels_list = 1094, /* locked_rels_list */ YYSYMBOL_values_clause = 1095, /* values_clause */ YYSYMBOL_from_clause = 1096, /* from_clause */ YYSYMBOL_from_list = 1097, /* from_list */ YYSYMBOL_table_ref = 1098, /* table_ref */ YYSYMBOL_joined_table = 1099, /* joined_table */ YYSYMBOL_alias_clause = 1100, /* alias_clause */ YYSYMBOL_opt_alias_clause = 1101, /* opt_alias_clause */ YYSYMBOL_opt_alias_clause_for_join_using = 1102, /* opt_alias_clause_for_join_using */ YYSYMBOL_func_alias_clause = 1103, /* func_alias_clause */ YYSYMBOL_join_type = 1104, /* join_type */ YYSYMBOL_opt_outer = 1105, /* opt_outer */ YYSYMBOL_join_qual = 1106, /* join_qual */ YYSYMBOL_relation_expr = 1107, /* relation_expr */ YYSYMBOL_extended_relation_expr = 1108, /* extended_relation_expr */ YYSYMBOL_relation_expr_list = 1109, /* relation_expr_list */ YYSYMBOL_relation_expr_opt_alias = 1110, /* relation_expr_opt_alias */ YYSYMBOL_tablesample_clause = 1111, /* tablesample_clause */ YYSYMBOL_opt_repeatable_clause = 1112, /* opt_repeatable_clause */ YYSYMBOL_func_table = 1113, /* func_table */ YYSYMBOL_rowsfrom_item = 1114, /* rowsfrom_item */ YYSYMBOL_rowsfrom_list = 1115, /* rowsfrom_list */ YYSYMBOL_opt_col_def_list = 1116, /* opt_col_def_list */ YYSYMBOL_opt_ordinality = 1117, /* opt_ordinality */ YYSYMBOL_where_clause = 1118, /* where_clause */ YYSYMBOL_where_or_current_clause = 1119, /* where_or_current_clause */ YYSYMBOL_OptTableFuncElementList = 1120, /* OptTableFuncElementList */ YYSYMBOL_TableFuncElementList = 1121, /* TableFuncElementList */ YYSYMBOL_TableFuncElement = 1122, /* TableFuncElement */ YYSYMBOL_xmltable = 1123, /* xmltable */ YYSYMBOL_xmltable_column_list = 1124, /* xmltable_column_list */ YYSYMBOL_xmltable_column_el = 1125, /* xmltable_column_el */ YYSYMBOL_xmltable_column_option_list = 1126, /* xmltable_column_option_list */ YYSYMBOL_xmltable_column_option_el = 1127, /* xmltable_column_option_el */ YYSYMBOL_xml_namespace_list = 1128, /* xml_namespace_list */ YYSYMBOL_xml_namespace_el = 1129, /* xml_namespace_el */ YYSYMBOL_json_table = 1130, /* json_table */ YYSYMBOL_json_table_path_name_opt = 1131, /* json_table_path_name_opt */ YYSYMBOL_json_table_column_definition_list = 1132, /* json_table_column_definition_list */ YYSYMBOL_json_table_column_definition = 1133, /* json_table_column_definition */ YYSYMBOL_path_opt = 1134, /* path_opt */ YYSYMBOL_json_table_column_path_clause_opt = 1135, /* json_table_column_path_clause_opt */ YYSYMBOL_Typename = 1136, /* Typename */ YYSYMBOL_opt_array_bounds = 1137, /* opt_array_bounds */ YYSYMBOL_SimpleTypename = 1138, /* SimpleTypename */ YYSYMBOL_ConstTypename = 1139, /* ConstTypename */ YYSYMBOL_GenericType = 1140, /* GenericType */ YYSYMBOL_opt_type_modifiers = 1141, /* opt_type_modifiers */ YYSYMBOL_Numeric = 1142, /* Numeric */ YYSYMBOL_opt_float = 1143, /* opt_float */ YYSYMBOL_Bit = 1144, /* Bit */ YYSYMBOL_ConstBit = 1145, /* ConstBit */ YYSYMBOL_BitWithLength = 1146, /* BitWithLength */ YYSYMBOL_BitWithoutLength = 1147, /* BitWithoutLength */ YYSYMBOL_Character = 1148, /* Character */ YYSYMBOL_ConstCharacter = 1149, /* ConstCharacter */ YYSYMBOL_CharacterWithLength = 1150, /* CharacterWithLength */ YYSYMBOL_CharacterWithoutLength = 1151, /* CharacterWithoutLength */ YYSYMBOL_character = 1152, /* character */ YYSYMBOL_opt_varying = 1153, /* opt_varying */ YYSYMBOL_ConstDatetime = 1154, /* ConstDatetime */ YYSYMBOL_ConstInterval = 1155, /* ConstInterval */ YYSYMBOL_opt_timezone = 1156, /* opt_timezone */ YYSYMBOL_opt_interval = 1157, /* opt_interval */ YYSYMBOL_interval_second = 1158, /* interval_second */ YYSYMBOL_JsonType = 1159, /* JsonType */ YYSYMBOL_a_expr = 1160, /* a_expr */ YYSYMBOL_b_expr = 1161, /* b_expr */ YYSYMBOL_c_expr = 1162, /* c_expr */ YYSYMBOL_func_application = 1163, /* func_application */ YYSYMBOL_func_expr = 1164, /* func_expr */ YYSYMBOL_func_expr_windowless = 1165, /* func_expr_windowless */ YYSYMBOL_func_expr_common_subexpr = 1166, /* func_expr_common_subexpr */ YYSYMBOL_xml_root_version = 1167, /* xml_root_version */ YYSYMBOL_opt_xml_root_standalone = 1168, /* opt_xml_root_standalone */ YYSYMBOL_xml_attributes = 1169, /* xml_attributes */ YYSYMBOL_xml_attribute_list = 1170, /* xml_attribute_list */ YYSYMBOL_xml_attribute_el = 1171, /* xml_attribute_el */ YYSYMBOL_document_or_content = 1172, /* document_or_content */ YYSYMBOL_xml_indent_option = 1173, /* xml_indent_option */ YYSYMBOL_xml_whitespace_option = 1174, /* xml_whitespace_option */ YYSYMBOL_xmlexists_argument = 1175, /* xmlexists_argument */ YYSYMBOL_xml_passing_mech = 1176, /* xml_passing_mech */ YYSYMBOL_within_group_clause = 1177, /* within_group_clause */ YYSYMBOL_filter_clause = 1178, /* filter_clause */ YYSYMBOL_window_clause = 1179, /* window_clause */ YYSYMBOL_window_definition_list = 1180, /* window_definition_list */ YYSYMBOL_window_definition = 1181, /* window_definition */ YYSYMBOL_over_clause = 1182, /* over_clause */ YYSYMBOL_window_specification = 1183, /* window_specification */ YYSYMBOL_opt_existing_window_name = 1184, /* opt_existing_window_name */ YYSYMBOL_opt_partition_clause = 1185, /* opt_partition_clause */ YYSYMBOL_opt_frame_clause = 1186, /* opt_frame_clause */ YYSYMBOL_frame_extent = 1187, /* frame_extent */ YYSYMBOL_frame_bound = 1188, /* frame_bound */ YYSYMBOL_opt_window_exclusion_clause = 1189, /* opt_window_exclusion_clause */ YYSYMBOL_row = 1190, /* row */ YYSYMBOL_explicit_row = 1191, /* explicit_row */ YYSYMBOL_implicit_row = 1192, /* implicit_row */ YYSYMBOL_sub_type = 1193, /* sub_type */ YYSYMBOL_all_Op = 1194, /* all_Op */ YYSYMBOL_MathOp = 1195, /* MathOp */ YYSYMBOL_qual_Op = 1196, /* qual_Op */ YYSYMBOL_qual_all_Op = 1197, /* qual_all_Op */ YYSYMBOL_subquery_Op = 1198, /* subquery_Op */ YYSYMBOL_expr_list = 1199, /* expr_list */ YYSYMBOL_func_arg_list = 1200, /* func_arg_list */ YYSYMBOL_func_arg_expr = 1201, /* func_arg_expr */ YYSYMBOL_func_arg_list_opt = 1202, /* func_arg_list_opt */ YYSYMBOL_type_list = 1203, /* type_list */ YYSYMBOL_array_expr = 1204, /* array_expr */ YYSYMBOL_array_expr_list = 1205, /* array_expr_list */ YYSYMBOL_extract_list = 1206, /* extract_list */ YYSYMBOL_extract_arg = 1207, /* extract_arg */ YYSYMBOL_unicode_normal_form = 1208, /* unicode_normal_form */ YYSYMBOL_overlay_list = 1209, /* overlay_list */ YYSYMBOL_position_list = 1210, /* position_list */ YYSYMBOL_substr_list = 1211, /* substr_list */ YYSYMBOL_trim_list = 1212, /* trim_list */ YYSYMBOL_case_expr = 1213, /* case_expr */ YYSYMBOL_when_clause_list = 1214, /* when_clause_list */ YYSYMBOL_when_clause = 1215, /* when_clause */ YYSYMBOL_case_default = 1216, /* case_default */ YYSYMBOL_case_arg = 1217, /* case_arg */ YYSYMBOL_columnref = 1218, /* columnref */ YYSYMBOL_indirection_el = 1219, /* indirection_el */ YYSYMBOL_opt_slice_bound = 1220, /* opt_slice_bound */ YYSYMBOL_indirection = 1221, /* indirection */ YYSYMBOL_opt_indirection = 1222, /* opt_indirection */ YYSYMBOL_opt_asymmetric = 1223, /* opt_asymmetric */ YYSYMBOL_json_passing_clause_opt = 1224, /* json_passing_clause_opt */ YYSYMBOL_json_arguments = 1225, /* json_arguments */ YYSYMBOL_json_argument = 1226, /* json_argument */ YYSYMBOL_json_wrapper_behavior = 1227, /* json_wrapper_behavior */ YYSYMBOL_json_behavior = 1228, /* json_behavior */ YYSYMBOL_json_behavior_type = 1229, /* json_behavior_type */ YYSYMBOL_json_behavior_clause_opt = 1230, /* json_behavior_clause_opt */ YYSYMBOL_json_on_error_clause_opt = 1231, /* json_on_error_clause_opt */ YYSYMBOL_json_value_expr = 1232, /* json_value_expr */ YYSYMBOL_json_format_clause = 1233, /* json_format_clause */ YYSYMBOL_json_format_clause_opt = 1234, /* json_format_clause_opt */ YYSYMBOL_json_quotes_clause_opt = 1235, /* json_quotes_clause_opt */ YYSYMBOL_json_returning_clause_opt = 1236, /* json_returning_clause_opt */ YYSYMBOL_json_predicate_type_constraint = 1237, /* json_predicate_type_constraint */ YYSYMBOL_json_key_uniqueness_constraint_opt = 1238, /* json_key_uniqueness_constraint_opt */ YYSYMBOL_json_name_and_value_list = 1239, /* json_name_and_value_list */ YYSYMBOL_json_name_and_value = 1240, /* json_name_and_value */ YYSYMBOL_json_object_constructor_null_clause_opt = 1241, /* json_object_constructor_null_clause_opt */ YYSYMBOL_json_array_constructor_null_clause_opt = 1242, /* json_array_constructor_null_clause_opt */ YYSYMBOL_json_value_expr_list = 1243, /* json_value_expr_list */ YYSYMBOL_json_aggregate_func = 1244, /* json_aggregate_func */ YYSYMBOL_json_array_aggregate_order_by_clause_opt = 1245, /* json_array_aggregate_order_by_clause_opt */ YYSYMBOL_opt_target_list = 1246, /* opt_target_list */ YYSYMBOL_target_list = 1247, /* target_list */ YYSYMBOL_target_el = 1248, /* target_el */ YYSYMBOL_qualified_name_list = 1249, /* qualified_name_list */ YYSYMBOL_qualified_name = 1250, /* qualified_name */ YYSYMBOL_name_list = 1251, /* name_list */ YYSYMBOL_name = 1252, /* name */ YYSYMBOL_attr_name = 1253, /* attr_name */ YYSYMBOL_file_name = 1254, /* file_name */ YYSYMBOL_func_name = 1255, /* func_name */ YYSYMBOL_AexprConst = 1256, /* AexprConst */ YYSYMBOL_Iconst = 1257, /* Iconst */ YYSYMBOL_Sconst = 1258, /* Sconst */ YYSYMBOL_SignedIconst = 1259, /* SignedIconst */ YYSYMBOL_RoleId = 1260, /* RoleId */ YYSYMBOL_RoleSpec = 1261, /* RoleSpec */ YYSYMBOL_role_list = 1262, /* role_list */ YYSYMBOL_PLpgSQL_Expr = 1263, /* PLpgSQL_Expr */ YYSYMBOL_PLAssignStmt = 1264, /* PLAssignStmt */ YYSYMBOL_plassign_target = 1265, /* plassign_target */ YYSYMBOL_plassign_equals = 1266, /* plassign_equals */ YYSYMBOL_ColId = 1267, /* ColId */ YYSYMBOL_type_function_name = 1268, /* type_function_name */ YYSYMBOL_NonReservedWord = 1269, /* NonReservedWord */ YYSYMBOL_ColLabel = 1270, /* ColLabel */ YYSYMBOL_BareColLabel = 1271, /* BareColLabel */ YYSYMBOL_unreserved_keyword = 1272, /* unreserved_keyword */ YYSYMBOL_col_name_keyword = 1273, /* col_name_keyword */ YYSYMBOL_type_func_name_keyword = 1274, /* type_func_name_keyword */ YYSYMBOL_reserved_keyword = 1275, /* reserved_keyword */ YYSYMBOL_bare_label_keyword = 1276 /* bare_label_keyword */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure and (if available) are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YY_STDINT_H # endif #endif /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ #ifdef __INT_LEAST8_MAX__ typedef __INT_LEAST8_TYPE__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ typedef __INT_LEAST16_TYPE__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; #else typedef short yytype_uint8; #endif #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; #else typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ # define YYPTRDIFF_T __PTRDIFF_TYPE__ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include /* INFRINGES ON USER NAME SPACE */ # endif # define YYPTRDIFF_T ptrdiff_t # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX # else # define YYPTRDIFF_T long # define YYPTRDIFF_MAXIMUM LONG_MAX # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ ? YYPTRDIFF_MAXIMUM \ : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; /* State numbers in computations. */ typedef int yy_state_fast_t; #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_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define YY_ATTRIBUTE_PURE # endif #endif #ifndef YY_ATTRIBUTE_UNUSED # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define YY_ATTRIBUTE_UNUSED # 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__ && ! defined __ICC && 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 __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if !defined yyoverflow /* 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 */ #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 { yy_state_t 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 (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + YYSIZEOF (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 \ { \ YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / YYSIZEOF (*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, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYPTRDIFF_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 939 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 124678 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 543 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 734 /* YYNRULES -- Number of rules. */ #define YYNRULES 3441 /* YYNSTATES -- Number of states. */ #define YYNSTATES 6518 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 780 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int16 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, 532, 2, 2, 537, 538, 530, 528, 541, 529, 539, 531, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 542, 540, 525, 527, 526, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 535, 2, 536, 533, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 522, 523, 524, 534 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 954, 954, 959, 963, 968, 976, 984, 1000, 1012, 1026, 1027, 1031, 1032, 1033, 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, 1156, 1163, 1164, 1168, 1169, 1173, 1174, 1178, 1179, 1180, 1189, 1205, 1217, 1218, 1219, 1228, 1229, 1233, 1234, 1238, 1243, 1247, 1257, 1265, 1269, 1273, 1278, 1282, 1330, 1332, 1336, 1340, 1344, 1348, 1362, 1381, 1390, 1402, 1403, 1407, 1416, 1425, 1434, 1456, 1464, 1472, 1480, 1488, 1496, 1514, 1533, 1545, 1546, 1557, 1568, 1579, 1595, 1614, 1619, 1627, 1628, 1629, 1630, 1631, 1632, 1646, 1653, 1660, 1667, 1674, 1684, 1695, 1706, 1710, 1720, 1730, 1739, 1751, 1752, 1762, 1776, 1784, 1794, 1807, 1817, 1827, 1836, 1848, 1859, 1867, 1868, 1872, 1873, 1876, 1878, 1882, 1883, 1884, 1885, 1889, 1890, 1891, 1897, 1909, 1913, 1917, 1934, 1942, 1943, 1944, 1948, 1949, 1950, 1954, 1955, 1959, 1960, 1969, 1970, 1979, 1988, 2000, 2009, 2021, 2022, 2027, 2028, 2034, 2040, 2046, 2053, 2060, 2067, 2074, 2085, 2096, 2097, 2101, 2102, 2110, 2126, 2133, 2140, 2147, 2154, 2174, 2184, 2194, 2204, 2214, 2226, 2238, 2248, 2258, 2268, 2280, 2292, 2302, 2312, 2322, 2332, 2342, 2352, 2364, 2376, 2386, 2399, 2400, 2405, 2419, 2432, 2448, 2465, 2475, 2485, 2495, 2505, 2515, 2524, 2533, 2543, 2552, 2562, 2572, 2588, 2598, 2608, 2618, 2628, 2645, 2655, 2665, 2675, 2686, 2700, 2716, 2725, 2734, 2765, 2779, 2788, 2799, 2810, 2818, 2827, 2836, 2844, 2852, 2861, 2870, 2879, 2887, 2895, 2904, 2912, 2920, 2929, 2938, 2947, 2956, 2965, 2974, 2985, 2993, 3002, 3011, 3020, 3029, 3038, 3047, 3055, 3063, 3071, 3078, 3089, 3090, 3094, 3103, 3107, 3108, 3112, 3120, 3128, 3136, 3147, 3150, 3151, 3155, 3156, 3161, 3165, 3169, 3174, 3181, 3183, 3188, 3192, 3196, 3207, 3214, 3215, 3219, 3220, 3225, 3280, 3293, 3307, 3319, 3326, 3330, 3344, 3357, 3358, 3363, 3373, 3384, 3395, 3422, 3429, 3463, 3499, 3522, 3523, 3527, 3528, 3537, 3538, 3539, 3542, 3543, 3548, 3549, 3553, 3557, 3561, 3565, 3569, 3573, 3577, 3581, 3585, 3589, 3593, 3597, 3601, 3605, 3609, 3618, 3622, 3626, 3630, 3634, 3635, 3640, 3644, 3651, 3658, 3659, 3660, 3661, 3662, 3663, 3667, 3671, 3679, 3690, 3710, 3730, 3751, 3772, 3793, 3827, 3828, 3829, 3830, 3831, 3838, 3845, 3846, 3850, 3851, 3855, 3856, 3860, 3864, 3871, 3875, 3882, 3883, 3884, 3888, 3889, 3892, 3916, 3935, 3957, 3958, 3962, 3963, 3967, 3968, 3972, 3973, 3977, 3978, 3982, 3990, 3991, 3992, 4024, 4036, 4044, 4057, 4069, 4083, 4095, 4105, 4130, 4151, 4152, 4153, 4157, 4158, 4162, 4163, 4164, 4183, 4191, 4199, 4207, 4215, 4223, 4235, 4247, 4248, 4249, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4271, 4279, 4283, 4297, 4310, 4329, 4345, 4363, 4379, 4399, 4444, 4452, 4456, 4471, 4487, 4488, 4492, 4493, 4497, 4498, 4502, 4503, 4507, 4508, 4512, 4513, 4516, 4522, 4523, 4526, 4530, 4538, 4543, 4549, 4550, 4554, 4559, 4566, 4567, 4571, 4581, 4591, 4599, 4608, 4621, 4633, 4640, 4648, 4656, 4664, 4672, 4682, 4683, 4687, 4688, 4691, 4703, 4704, 4707, 4718, 4729, 4743, 4744, 4749, 4750, 4751, 4754, 4755, 4756, 4757, 4760, 4761, 4764, 4765, 4768, 4788, 4801, 4823, 4824, 4827, 4833, 4839, 4856, 4865, 4887, 4901, 4918, 4934, 4935, 4936, 4948, 4962, 4979, 4993, 4994, 5006, 5027, 5038, 5052, 5061, 5073, 5074, 5077, 5078, 5081, 5082, 5085, 5089, 5093, 5097, 5101, 5105, 5109, 5113, 5117, 5121, 5125, 5129, 5133, 5137, 5141, 5145, 5151, 5152, 5156, 5157, 5158, 5165, 5168, 5169, 5181, 5197, 5213, 5214, 5222, 5223, 5227, 5228, 5232, 5233, 5237, 5238, 5242, 5243, 5253, 5265, 5266, 5279, 5287, 5305, 5314, 5326, 5329, 5333, 5337, 5341, 5348, 5360, 5371, 5374, 5378, 5391, 5401, 5411, 5421, 5431, 5441, 5451, 5461, 5471, 5481, 5491, 5501, 5511, 5530, 5542, 5543, 5544, 5545, 5549, 5550, 5554, 5555, 5565, 5574, 5587, 5588, 5592, 5596, 5604, 5608, 5612, 5619, 5623, 5628, 5633, 5640, 5647, 5652, 5662, 5675, 5691, 5692, 5697, 5698, 5702, 5703, 5713, 5723, 5732, 5750, 5771, 5792, 5814, 5848, 5864, 5865, 5869, 5878, 5893, 5903, 5916, 5917, 5929, 5938, 5956, 5981, 5999, 6014, 6015, 6019, 6020, 6024, 6025, 6029, 6030, 6034, 6048, 6052, 6053, 6057, 6058, 6059, 6060, 6061, 6071, 6083, 6084, 6095, 6118, 6151, 6152, 6153, 6157, 6159, 6181, 6183, 6185, 6187, 6189, 6194, 6195, 6199, 6200, 6204, 6216, 6217, 6221, 6230, 6234, 6238, 6243, 6253, 6254, 6258, 6259, 6263, 6264, 6268, 6269, 6273, 6274, 6275, 6279, 6283, 6284, 6285, 6289, 6290, 6295, 6296, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6344, 6355, 6370, 6372, 6377, 6382, 6384, 6389, 6400, 6401, 6402, 6403, 6414, 6434, 6446, 6459, 6470, 6481, 6493, 6502, 6510, 6518, 6528, 6538, 6548, 6558, 6568, 6579, 6589, 6602, 6605, 6606, 6609, 6613, 6620, 6621, 6622, 6623, 6624, 6625, 6628, 6631, 6632, 6640, 6647, 6648, 6651, 6653, 6664, 6676, 6688, 6700, 6712, 6741, 6742, 6758, 6774, 6775, 6779, 6792, 6802, 6811, 6821, 6831, 6832, 6835, 6836, 6839, 6840, 6841, 6846, 6857, 6867, 6880, 6881, 6885, 6894, 6907, 6918, 6932, 6943, 6966, 6977, 6996, 7007, 7018, 7029, 7040, 7051, 7062, 7073, 7084, 7095, 7106, 7117, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7154, 7155, 7156, 7157, 7158, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7174, 7175, 7176, 7180, 7181, 7184, 7185, 7188, 7190, 7195, 7196, 7207, 7219, 7220, 7221, 7231, 7240, 7249, 7258, 7267, 7276, 7285, 7294, 7303, 7312, 7326, 7335, 7344, 7353, 7362, 7371, 7380, 7389, 7401, 7402, 7416, 7427, 7438, 7449, 7460, 7471, 7482, 7493, 7504, 7515, 7528, 7529, 7532, 7533, 7543, 7550, 7559, 7568, 7577, 7586, 7595, 7604, 7613, 7622, 7631, 7640, 7649, 7658, 7667, 7676, 7685, 7694, 7705, 7706, 7709, 7710, 7720, 7738, 7754, 7782, 7784, 7786, 7788, 7796, 7806, 7807, 7810, 7818, 7826, 7834, 7841, 7852, 7856, 7863, 7867, 7878, 7887, 7896, 7905, 7914, 7923, 7932, 7941, 7950, 7959, 7968, 7977, 7986, 7994, 8003, 8012, 8021, 8030, 8039, 8048, 8057, 8070, 8071, 8075, 8076, 8081, 8082, 8092, 8103, 8117, 8129, 8147, 8148, 8152, 8159, 8160, 8161, 8164, 8165, 8175, 8186, 8187, 8191, 8195, 8199, 8210, 8224, 8239, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8275, 8307, 8342, 8343, 8347, 8348, 8351, 8352, 8357, 8369, 8388, 8393, 8398, 8405, 8406, 8409, 8410, 8413, 8414, 8418, 8419, 8420, 8423, 8424, 8425, 8441, 8455, 8470, 8484, 8501, 8502, 8505, 8506, 8510, 8511, 8515, 8516, 8521, 8535, 8543, 8551, 8567, 8568, 8572, 8573, 8588, 8599, 8610, 8621, 8632, 8646, 8647, 8648, 8649, 8650, 8656, 8660, 8675, 8676, 8682, 8692, 8696, 8701, 8709, 8751, 8755, 8759, 8763, 8771, 8772, 8776, 8788, 8789, 8794, 8795, 8800, 8801, 8808, 8812, 8816, 8820, 8824, 8828, 8832, 8836, 8840, 8844, 8848, 8852, 8856, 8860, 8864, 8868, 8873, 8880, 8884, 8888, 8892, 8896, 8902, 8903, 8909, 8919, 8923, 8934, 8940, 8949, 8955, 8956, 8960, 8961, 8965, 8966, 8969, 8983, 8987, 9002, 9011, 9020, 9033, 9034, 9039, 9040, 9057, 9068, 9079, 9090, 9101, 9112, 9126, 9137, 9151, 9162, 9176, 9184, 9186, 9188, 9193, 9195, 9200, 9201, 9206, 9225, 9235, 9236, 9240, 9244, 9256, 9268, 9280, 9294, 9295, 9296, 9300, 9313, 9314, 9324, 9337, 9341, 9345, 9349, 9356, 9378, 9391, 9404, 9419, 9420, 9423, 9424, 9427, 9428, 9438, 9448, 9466, 9476, 9486, 9496, 9506, 9516, 9526, 9536, 9546, 9556, 9566, 9576, 9586, 9597, 9608, 9618, 9628, 9638, 9648, 9658, 9668, 9679, 9690, 9701, 9712, 9723, 9734, 9745, 9756, 9767, 9778, 9789, 9800, 9812, 9824, 9836, 9848, 9860, 9872, 9883, 9894, 9906, 9918, 9929, 9940, 9949, 9959, 9969, 9979, 9989, 9999, 10009, 10019, 10029, 10039, 10054, 10055, 10058, 10059, 10069, 10079, 10089, 10099, 10110, 10120, 10132, 10133, 10143, 10153, 10163, 10173, 10183, 10193, 10203, 10213, 10223, 10233, 10243, 10253, 10263, 10273, 10283, 10293, 10303, 10313, 10323, 10333, 10343, 10353, 10363, 10373, 10383, 10393, 10403, 10422, 10432, 10433, 10436, 10438, 10440, 10446, 10447, 10448, 10449, 10450, 10462, 10478, 10487, 10496, 10505, 10514, 10523, 10532, 10541, 10550, 10559, 10568, 10577, 10586, 10595, 10604, 10613, 10622, 10631, 10640, 10649, 10658, 10667, 10676, 10685, 10713, 10721, 10730, 10756, 10765, 10772, 10778, 10805, 10816, 10825, 10833, 10835, 10857, 10865, 10875, 10885, 10904, 10923, 10933, 10943, 10953, 10964, 10975, 10986, 10997, 11008, 11026, 11035, 11052, 11070, 11071, 11072, 11077, 11083, 11092, 11093, 11094, 11095, 11096, 11100, 11101, 11104, 11105, 11106, 11107, 11111, 11112, 11113, 11125, 11136, 11137, 11140, 11150, 11157, 11177, 11187, 11196, 11206, 11216, 11225, 11234, 11243, 11252, 11261, 11270, 11279, 11291, 11300, 11312, 11313, 11314, 11318, 11321, 11324, 11327, 11330, 11337, 11339, 11341, 11346, 11348, 11352, 11353, 11354, 11366, 11380, 11394, 11413, 11435, 11436, 11437, 11438, 11448, 11465, 11476, 11477, 11481, 11482, 11486, 11490, 11494, 11512, 11513, 11514, 11515, 11516, 11517, 11518, 11525, 11526, 11537, 11545, 11553, 11562, 11572, 11590, 11599, 11608, 11617, 11629, 11633, 11644, 11656, 11674, 11681, 11698, 11712, 11722, 11731, 11740, 11750, 11762, 11774, 11785, 11786, 11797, 11808, 11820, 11832, 11844, 11856, 11866, 11879, 11880, 11894, 11918, 11927, 11937, 11949, 11961, 11975, 11976, 11988, 12009, 12020, 12032, 12044, 12048, 12055, 12056, 12060, 12067, 12068, 12069, 12073, 12074, 12075, 12079, 12080, 12084, 12085, 12088, 12089, 12092, 12093, 12097, 12098, 12102, 12109, 12111, 12116, 12117, 12130, 12138, 12149, 12157, 12168, 12169, 12170, 12171, 12172, 12173, 12174, 12175, 12176, 12177, 12187, 12198, 12199, 12203, 12204, 12205, 12206, 12207, 12217, 12225, 12243, 12263, 12264, 12274, 12283, 12292, 12301, 12320, 12338, 12342, 12350, 12356, 12363, 12369, 12376, 12385, 12386, 12390, 12392, 12397, 12408, 12418, 12428, 12434, 12443, 12452, 12458, 12467, 12473, 12474, 12478, 12479, 12483, 12495, 12496, 12507, 12522, 12523, 12534, 12545, 12546, 12549, 12550, 12551, 12552, 12553, 12554, 12555, 12556, 12559, 12560, 12564, 12565, 12566, 12577, 12595, 12596, 12600, 12605, 12629, 12640, 12641, 12653, 12673, 12674, 12684, 12691, 12698, 12705, 12715, 12728, 12729, 12733, 12734, 12738, 12739, 12743, 12756, 12769, 12778, 12787, 12796, 12805, 12817, 12829, 12841, 12844, 12845, 12846, 12847, 12848, 12849, 12852, 12853, 12854, 12902, 12903, 12907, 12908, 12923, 12924, 12931, 12939, 12947, 12955, 12963, 12971, 12982, 12983, 13015, 13031, 13048, 13049, 13068, 13072, 13076, 13091, 13098, 13105, 13115, 13116, 13119, 13135, 13136, 13137, 13141, 13151, 13162, 13168, 13180, 13193, 13199, 13200, 13204, 13216, 13224, 13229, 13234, 13239, 13244, 13252, 13260, 13265, 13270, 13277, 13278, 13282, 13283, 13284, 13291, 13292, 13296, 13297, 13301, 13302, 13306, 13307, 13311, 13315, 13316, 13319, 13328, 13341, 13347, 13353, 13357, 13372, 13373, 13377, 13389, 13405, 13417, 13429, 13441, 13456, 13459, 13464, 13465, 13473, 13493, 13494, 13496, 13501, 13502, 13506, 13507, 13510, 13511, 13536, 13545, 13555, 13556, 13560, 13561, 13562, 13563, 13564, 13568, 13581, 13588, 13595, 13602, 13603, 13607, 13608, 13612, 13613, 13617, 13618, 13622, 13634, 13635, 13636, 13637, 13641, 13642, 13652, 13659, 13678, 13679, 13683, 13684, 13690, 13695, 13704, 13712, 13721, 13728, 13736, 13745, 13754, 13758, 13763, 13770, 13799, 13803, 13817, 13838, 13860, 13873, 13890, 13896, 13901, 13907, 13914, 13915, 13925, 13931, 13939, 13943, 13947, 13954, 13962, 13967, 13968, 13969, 13970, 13974, 13975, 13990, 13994, 14002, 14009, 14016, 14023, 14030, 14041, 14042, 14055, 14059, 14067, 14081, 14095, 14096, 14111, 14122, 14135, 14140, 14141, 14144, 14145, 14148, 14149, 14154, 14155, 14160, 14161, 14170, 14175, 14176, 14180, 14184, 14190, 14215, 14226, 14240, 14241, 14245, 14259, 14316, 14330, 14332, 14337, 14346, 14348, 14350, 14352, 14357, 14359, 14364, 14372, 14383, 14411, 14412, 14416, 14418, 14423, 14432, 14452, 14472, 14490, 14502, 14517, 14518, 14522, 14525, 14538, 14543, 14550, 14555, 14561, 14566, 14575, 14577, 14580, 14584, 14585, 14586, 14587, 14588, 14589, 14594, 14600, 14615, 14616, 14617, 14618, 14619, 14630, 14636, 14644, 14645, 14651, 14656, 14661, 14666, 14671, 14676, 14681, 14686, 14692, 14698, 14704, 14711, 14733, 14742, 14746, 14754, 14758, 14766, 14778, 14799, 14803, 14809, 14813, 14826, 14834, 14844, 14846, 14848, 14850, 14852, 14854, 14859, 14860, 14867, 14876, 14884, 14893, 14904, 14912, 14913, 14914, 14918, 14920, 14922, 14924, 14926, 14928, 14930, 14935, 14940, 14946, 14954, 14959, 14966, 14973, 14977, 14981, 14989, 15024, 15025, 15027, 15036, 15043, 15059, 15061, 15063, 15065, 15067, 15069, 15071, 15073, 15075, 15077, 15079, 15081, 15083, 15085, 15088, 15090, 15093, 15095, 15097, 15099, 15102, 15107, 15116, 15121, 15130, 15135, 15144, 15149, 15159, 15168, 15177, 15186, 15205, 15214, 15223, 15232, 15241, 15258, 15267, 15276, 15285, 15294, 15303, 15312, 15316, 15320, 15328, 15336, 15344, 15352, 15365, 15374, 15388, 15397, 15409, 15416, 15432, 15437, 15443, 15450, 15457, 15465, 15473, 15490, 15509, 15535, 15537, 15539, 15541, 15543, 15545, 15547, 15549, 15551, 15553, 15555, 15557, 15559, 15561, 15563, 15565, 15567, 15569, 15571, 15575, 15579, 15584, 15600, 15601, 15602, 15619, 15632, 15634, 15636, 15648, 15673, 15685, 15697, 15705, 15716, 15727, 15737, 15743, 15752, 15762, 15772, 15785, 15795, 15826, 15862, 15872, 15883, 15884, 15885, 15892, 15899, 15903, 15907, 15911, 15915, 15919, 15923, 15927, 15931, 15935, 15939, 15943, 15947, 15954, 15958, 15962, 15966, 15968, 15975, 15982, 15989, 15996, 16007, 16021, 16031, 16042, 16058, 16068, 16075, 16082, 16089, 16093, 16101, 16110, 16119, 16123, 16127, 16131, 16135, 16139, 16148, 16152, 16162, 16166, 16170, 16175, 16186, 16192, 16206, 16217, 16231, 16247, 16259, 16269, 16278, 16287, 16295, 16317, 16333, 16357, 16359, 16363, 16365, 16367, 16370, 16373, 16376, 16377, 16380, 16388, 16398, 16399, 16402, 16403, 16404, 16407, 16408, 16409, 16414, 16418, 16422, 16426, 16433, 16434, 16442, 16443, 16447, 16448, 16456, 16457, 16461, 16462, 16467, 16476, 16478, 16493, 16496, 16524, 16525, 16528, 16529, 16537, 16545, 16553, 16562, 16572, 16590, 16636, 16645, 16654, 16663, 16672, 16684, 16685, 16686, 16687, 16688, 16702, 16703, 16704, 16707, 16708, 16711, 16714, 16715, 16716, 16719, 16720, 16723, 16724, 16725, 16726, 16727, 16728, 16729, 16730, 16731, 16732, 16733, 16734, 16737, 16739, 16744, 16746, 16751, 16753, 16755, 16757, 16759, 16761, 16773, 16777, 16784, 16788, 16794, 16798, 16808, 16820, 16821, 16824, 16825, 16828, 16832, 16836, 16842, 16843, 16848, 16858, 16859, 16860, 16861, 16862, 16863, 16864, 16865, 16869, 16870, 16871, 16872, 16877, 16882, 16891, 16912, 16916, 16921, 16932, 16949, 16955, 16956, 16957, 16967, 16982, 16983, 16987, 16999, 17000, 17003, 17004, 17007, 17011, 17018, 17022, 17026, 17035, 17047, 17048, 17052, 17053, 17057, 17058, 17061, 17062, 17067, 17068, 17072, 17073, 17077, 17089, 17090, 17091, 17092, 17093, 17094, 17095, 17096, 17097, 17101, 17103, 17108, 17109, 17110, 17111, 17112, 17113, 17114, 17116, 17120, 17122, 17124, 17127, 17131, 17134, 17138, 17147, 17165, 17172, 17177, 17183, 17184, 17185, 17186, 17187, 17191, 17200, 17214, 17215, 17216, 17217, 17218, 17227, 17228, 17229, 17230, 17231, 17235, 17237, 17247, 17250, 17256, 17257, 17258, 17262, 17263, 17264, 17268, 17269, 17273, 17291, 17311, 17312, 17321, 17322, 17326, 17327, 17330, 17338, 17346, 17354, 17377, 17378, 17389, 17393, 17399, 17401, 17406, 17408, 17410, 17420, 17422, 17433, 17437, 17441, 17445, 17449, 17458, 17466, 17498, 17502, 17509, 17517, 17521, 17525, 17531, 17532, 17534, 17535, 17536, 17540, 17581, 17609, 17613, 17617, 17623, 17625, 17639, 17676, 17689, 17690, 17693, 17694, 17711, 17712, 17713, 17718, 17719, 17720, 17725, 17726, 17727, 17728, 17734, 17735, 17736, 17737, 17738, 17744, 17745, 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, 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, 17990, 17991, 17992, 17993, 17994, 17995, 17996, 17997, 17998, 17999, 18000, 18001, 18002, 18003, 18004, 18005, 18006, 18007, 18008, 18009, 18010, 18011, 18012, 18013, 18014, 18015, 18016, 18017, 18018, 18019, 18020, 18021, 18022, 18023, 18024, 18025, 18026, 18027, 18028, 18029, 18030, 18031, 18032, 18033, 18034, 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, 18108, 18109, 18110, 18111, 18112, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120, 18121, 18122, 18123, 18124, 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, 18184, 18185, 18186, 18187, 18188, 18189, 18190, 18191, 18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200, 18201, 18202, 18203, 18204, 18205, 18206, 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, 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, 18593, 18594, 18595, 18596, 18597, 18598, 18599, 18600, 18601, 18602, 18603, 18604, 18605, 18606, 18607, 18608, 18609, 18610, 18611, 18612, 18613, 18614, 18615, 18616, 18617, 18618, 18619, 18620, 18621, 18622, 18623, 18624, 18625, 18626, 18627, 18628, 18629, 18630, 18631, 18632, 18633, 18634, 18635, 18636, 18637, 18638, 18639, 18640, 18641, 18642, 18643, 18644, 18645, 18646, 18647, 18648, 18649, 18650, 18651, 18652, 18653, 18654, 18655, 18656, 18657, 18658, 18659, 18660, 18661, 18662, 18663, 18664, 18665, 18666, 18667, 18668, 18669, 18670, 18671, 18672, 18673, 18674, 18675, 18676, 18677, 18678, 18679, 18680, 18681, 18682, 18683, 18684, 18685, 18686, 18687, 18688, 18689, 18690, 18691, 18692, 18693, 18694, 18695, 18696, 18697, 18698, 18699, 18700, 18701, 18702, 18703, 18704, 18705, 18706, 18707, 18708, 18709, 18710, 18711, 18712, 18713, 18714, 18715, 18716, 18717, 18718, 18719, 18720, 18721, 18722, 18723, 18724, 18725, 18726, 18727, 18728, 18729, 18730, 18731, 18732, 18733, 18734, 18735, 18736, 18737, 18738, 18739, 18740, 18741, 18742, 18743, 18744, 18745, 18746, 18747, 18748, 18749, 18750, 18751, 18752, 18753, 18754, 18755, 18756, 18757, 18758, 18759, 18760 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if YYDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "\"end of file\"", "error", "\"invalid token\"", "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", "ENFORCED", "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", "OBJECTS_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", "PERIOD", "PLACING", "PLAN", "PLANS", "POLICY", "POSITION", "PRECEDING", "PRECISION", "PRESERVE", "PREPARE", "PREPARED", "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PROCEDURES", "PROGRAM", "PUBLICATION", "QUOTE", "QUOTES", "RANGE", "READ", "REAL", "REASSIGN", "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", "VIRTUAL", "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", "opt_virtual_or_stored", "ConstraintAttr", "TableLikeClause", "TableLikeOptionList", "TableLikeOption", "TableConstraint", "ConstraintElem", "DomainConstraint", "DomainConstraintElem", "opt_no_inherit", "opt_without_overlaps", "opt_column_list", "columnList", "optionalPeriodName", "opt_column_and_period_list", "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", "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", "returning_with_clause", "returning_options", "returning_option", "returning_option_kind", "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", "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 }; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } #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_int16 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, 777, 778, 779, 60, 62, 61, 43, 45, 42, 47, 37, 94, 780, 91, 93, 40, 41, 46, 59, 44, 58 }; #endif #define YYPACT_NINF (-5973) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-3018) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const int yypact[] = { 12375, 1685, 21492, -5973, -5973, 1685, 72094, -5973, 81822, 10, 201, 122, 238, 22169, 82334, 93598, 1180, 404, 9442, 1685, 93598, 1922, 62365, 77726, 1053, 93598, 1237, 1108, 62365, 93598, 94110, 94622, 1377, 1508, 1252, 95134, 82846, 76702, 795, 93598, 1560, 1635, 95646, 83358, 1538, 83870, 1108, 57256, 403, 1693, 96158, 93598,121674, 1635, 84382, 84382, 84382, 1835, 2191, 1376, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 714, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 2113, -5973, 1076, 2136, 1502, 288, 1762, -5973, -5973, 2474, 72094, 93598, 93598, 93598, 2033, 93598, 1950, 93598, 915, 72094, 68510, 84894, 2238, 2062, 53044, 96670, -5973, 72094, 93598, 65950, 72094, 93598, 93598, 97182, 93598, 97694, 93598, 131, 80286, 93598, 2209, 93598, 93598, 66462, 98206, 2338, 1553, 287, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 2086, 1951, -5973, 303, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 62877, 93598, 22515, 1237, 2474, -5973, 1835, 93598, 2381, 93598, 2135, 98718, 93598, -5973, 93598, 2227, 99230, 974, 2084, 68510, 2252, 53575, 2323, 93598, 93598, 68510, 99742,100254,100766, 93598, 93598, -5973, -5973, 2325, 93598, -5973, 2433, 69022, 799, 2479, 2679, 2562, 1873, -5973, 85406, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 71582, 404, -5973, -5973, 2524, 72606, 2620, -5973, -5973,101278,122172, 2389, -5973, 1024, 73118, 69534, 2723, 2362, 54106, 2799, -5973, 73630, -5973, 70046, 74142, -5973, -5973, -5973, -5973, -5973,101790, -5973,102302, 2469, 2620, -5973,122670, 70558, -5973, 2626,102814, 103326,103838, 2474, 2350, 1747, 2221, 47304, -5973, -5973, -5973, 2391, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 375, 1779, 349, 258, 377, -5973, -5973, 269, 270, 295, 375, 2903, 2903, -5973, 93598, -5973, -5973, 1779, 1178, 2493, 2396, 2396, 2396, 2627, 724, -5973, 2396, 2551, -5973, -5973, -5973, -5973, 83870, -5973, 2408, 1237, 273, 85918, 71582, 1237, 2912,104350, 86430, 2453, 2592, 2662, -5973, -5973, 169, -5973, 1237, 2463, 2957, 2545, 62877, 1271, 93598, -5973, -5973, 2973, 2528, 2830, 2526, -5973, -5973, 2764, 2773, 189, 128, 1237, 286, -5973, 2916, -5973, 2790, 32060, 32060, 86942,104862, 87454, 3053, 1561, -5973, -5973, -5973, 3072, 2638, 2904, 2526, 1553, 49376, -5973, -5973, 2609, 1951, 83870, -5973, -5973, -5973, 62877, 2991, 35240, 93598, 2635, -5973, 2666, 2635, -5973, -5973, 2726, -5973, 2726, 2726, 2676, 2676, 2838, 2703, -5973, -5973, -5973, -5973, 2504, 2726, 2676, -5973,123666, -5973, 2012, 2018, -5973, -5973, 3209, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 2715, -5973, 1413, -5973, 2247, -5973, -5973, -5973, 32060, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 2725, 2728, 1502, -5973, 8005, 62877, 83870, 1897, 1897, 3215, 1897, 998, 2207, -5973, 2194, -5973, 3090, 3067, 3074, 83870, 2762, 1244, -5973, 2007, 2763, 1686, 2765, 2043, 2128, -5973, 1085, 93598, 555, 2803, 87966, 4969, 2775, 1951, 2776, -5973, -5973, -5973, -5973, 2933, 1514, -5973, -5973, -5973, -5973, 3113, 3158, 6698, 364, 88478, -5973, -5973, -5973, -5973, 93598, 93598, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 2785, 862, -5973, -5973, 2787, 3166, 3018, 8071, 1269, 3127, 2961, 1465, 9330, 3021, 894, 3179, 11908, 1665, 3185, 2051, 2112, 85918, 93598, 3143, 3194, 5917, 2045, 1092, 3043, 1222, 3127, 3182, 2986, 1465, 3198, 7314, 93598, -5973, 3107, 3238, 1429, -5973, 184, -5973, 24695, 35240, 56744, -5973, 1951, -5973, 718, -5973, -5973, 61853, -5973, 2887, 3056, 1259, 72094, 2826, 93598, 93598, -5973,121674, 72094, -5973, 3066, 54637, 72094, -5973, 72094, -5973, -5973, 3199,121674, 93598, 93598, -5973, 93598, -5973, -5973, 2832, -5973, -5973, -5973, -5973, -5973, 2396, 93598, 3302,121674, 3080, 166, 1909, 3337, 93598, 3088, 1909, 2889,105374, -5973, -5973, 1909, -5973, -5973, -5973, 93598, 93598, 2851, 1987, 3079, 950, 1909, 3098, 3344, 3347, 3103, 2938, 3105, 2666, -5973, 3309, 3078, 1101, 243, 2315, 1909, 2920,105886,106398, 93598, 2923, 93598, 3324, 72094, 2959, 72094, 72094, 93598, 3243, 93598, -5973, 3069, -5973, -5973, 1603, -5973, -5973, -5973, -5973, -5973, 3258, -5973, 266, 3259, 2883, 3263, 1916, 3264, 357, -5973, -5973, 2929, -5973, 3270, 366, -5973, 3272, -5973, 2891,106910, -5973,107422,107934, 3273, 382, -5973, 68510, 3276, 366, 3277, 2891, 3279, 366, 3280, 1075, 3281, -5973, 1110, 3268, 3284, 357, 3286, 2346, 2891, -5973, 3287, 386, -5973, 3288, 392, -5973, 3289, 3142, -5973, 35240, -5973, 3017, -5973, 1693, 1523, 2221, 1779, -5973, 93598, 1779, 93598, 1779, 93598, 1779, 93598, 1779, 93598, 93598, 93598, 1779, -5973, -5973, -5973, 93598, 2918, 93598, -5973, 93598, -5973, -5973, -5973, 78750, 68510, 79262, -5973, 93598, -5973, 156, 1237, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 71070, 3331, -5973, 1726, -5973, 2526, 368, 1237, 1972, 3355, 60317, 60829, 93598, -5973,121674, 3421, 68510, 3324, 2020, -5973, -5973, 3324, -5973, -5973, 3324, 3324, -5973, -5973, -5973, 3208, 3290, 78750, 68510, 3291, -5973,108446, -5973, 71582, 3151, 2930, -5973, -5973, -5973, -5973, -5973, 2201, 3460, 281, 3463, 35240, 2935, 281, 281, 2937, 3303, -5973, -5973, -5973, 307, 2941, 2942, -5973, 304, 304, -5973, 2943, 2945, -5973, 308, 2949, 2950, 3488, 3491, 310, 318, 2962, 2965, 2967, 2968, 2969, 2970, 2975, 2976, 2977, 2978, 2979, 2982, 2984, 2504, 281, 2985, 35240, -5973, 2988, 304, 2990, 2992, 2993, 3504, 2994, -5973, 3517, 2996, -5973, 283, 324, 3000, 3001, -5973, 3228, -5973, 320, 3006, 3007, 3009, 3010, 3011, 3012, 3014, 3015, 35240, 35240, 35240, -5973, 29405, 1951, 1237, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 325, -5973, 51451, -5973, 3061, -5973, -5973, 3235, -5973, -5973, 35240, -5973, -5973, 3392, 916, -5973, 335, -5973, -5973, -5973, 1951, 3339, 3022, -5973, 1427, 3023, -5973, 2236, -5973, 3529, -5973, 3331, 184, -5973, -5973, 3316, -5973, 93598, -5973, -5973, 1951, 209, 2093, -5973, 2391, 20870, 2123, 2635, 93598, 93598, 3531, -5973, 3042, -5973, -5973, 35240, -5973, -5973, -5973, 2903, -5973, 2726, 2726, -5973, -5973, 3544, 3135, 3138, 2903, -5973, 2903, -5973, 3051, 3052, 2903, 3140, 3141, 3144, -5973, 3054, 3147, 2903, -5973, -5973, 63902, 2291, -5973, 3414, 374, -5973, -5973, -5973, 2182, -5973, 3057, -5973, 2666, -5973, -5973, 1502, 1502, 35240, 1502, 1664, 2016, 32590, 35770, 3425, 3294, 1512, 1818, 3429, -5973, 3298, 998, 2207, 83870, 93598, 83870,108958, 3200, 35240, -5973, 3541, 3161, 3162, 3221, 59304, -5973, 3165, 3130, 3168, 3229, 3086, 3177, 3181, 3242, -5973, 3381, -5973, -5973, 3187, 3265, 3558, 3191,109470, -5973, -5973, 1057, -5973, -5973, -5973, 1057, -5973, 3114, 1872, 1498, 1573, 3193, 552, 245, 3552, -5973, 1391, -5973, -5973, 3254, -5973, 16320, 93598, 3490, 7322, 3340, 364, 3256, -5973, -5973, -5973, 3404, 3205, 93598, 3206, 3358, 364, 361,109982, -5973, -5973, 93598, -5973, -5973, -5973, -5973, 9144, 3530, 27877, -5973, -15, 3211, 3184, 3222, 93598, 75166, 2470, 3333, 3352, 1724, 2483, 824, 3283, 93598, 2216, 3361, 93598, 3129, 3223, 3224, 3479, 3139, 938, 3585, 3148, -5973, -5973, -5973, 3551, -5973, 2129, 2590, 3354, -5973, 3480, 3525, 7814, 3217, 3218,119682, -5973, 3244, 749, 55168, 93598, 93598, 3245, 3246,110494, 9144, 3568, 79774, 79774, 3248, 3249, 48858, 3586, 160, 3250, -5973, -5973, -5973, 160, 3255, 3260,111006, 9144, 3577, 93598, 3261, 3262, 93598,123666, 364, -5973, 3648, -5973, 364, 364, 2234, 3653, 3266, 482, 3437, 774, 1909, -5973, 3148, 3646, -5973, 3267, 3269, 362, -5973, 3403, 93598, 3271, 3274, 2077, 3365, 1237, -5973, 3367, -5973, 3275, 3368, 3278, 771, 2851, -5973, -5973, 3292, 83870, 3397, 3398, 2216, 284, 976, 3148, -5973, 3285, 3293, 3139, 3139, 93598, 93598, 93598, 93598, 93598, 292, 3683, 305, 3296, 576, 1304, 3192, -5973, 160, 66974, 3297, -5973, 160, 93598, 235, 1068, 3148, 1986, 2005, -5973, -5973, -5973, 1553, -5973, 35240, 35240, 35240, 3201, -5973, 2698, 20870, 109, -5973, 337, 16938, 3195, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 93598, 62877, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 93598, -5973, 93598, 3511,121674, 3515, 3431, 3523, 3524, 364, 93598, 93598, 3532, 3534, 3535,121674, 3536, 3537, 3538, 3440, 3305, 205, 3310, 3219, 3732, 3626, 93598, 63902, -5973, 1057, -5973,121674, 3475, 3628, -5973, 93598, 3494, 93, -5973, 3669, 3314, -5973, -5973, 105, 93598, 78238, 2851, -5973, -5973, 3632, 68510, 409, 3633, 1237, 3308, 3636, 3485, 1237, 68510, 3540, 93598, 93598, 93598, 93598, 531, -5973, 66974, 3505, -5973, 93598, 3508, 3646, 3509, 3759, 936, 2396,111518, 3634, -5973, 112030, 3282, 93598, 3300, 3300, 3767,121674, 1632, 3563, -5973, -5973, 2356, -5973, 3417, -5973, 72094, -5973, -5973, 72094, -5973, -5973,121674, 93598, 3304,121674,121674, -5973, -5973, 72094, 72094, -5973, 68510, 68510, 3654, 386, 3655, 3342, 3659, 3346, 55168, 55168, -5973, 402, 72094, -5973, 68510, 72094, -5973, 93598, -5973, 93598, -5973, -5973, -5973, -5973,121674,121674, -5973, 68510, 66974, 3663, 93598, 93598, -5973, 93598, 93598, -5973, 93598, 93598, 2186, 112542, 2221, -5973, 93598, -5973, 93598, -5973, 93598, -5973, 93598, -5973, 93598, -5973, -5973, -5973, 93598, -5973, 93598, 2188, -5973, -5973, 2190, 1411, 93598, 93598, 277, 72094, 93598, 3543, 93598, 72094, 72094, 93598, 93598, 93598, 93598, 93598, 3376, 3023, 176, -5973, 333, 891, 83870, 3542, -5973, -5973, -5973, 1237, -5973, -5973, -5973, -5973, -5973, 339, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 3299, -5973, -5973, -5973, -5973, 3299, -5973, -5973, 2199, 1835, 1408, 93598, -5973, 93598, 93598, 93598, -5973, 77726, 3660, 152, 79262, 93598, -5973, -5973, 7263, 35240, 1951, 31525, -5973, -5973, 20870, 3356, 35240, 35240, 3312, 2903, 2903, -5973, 1208, 35240, 35240, 35240, 28875, 35240, 35240, 33120, 35240, 35240, 35240, 35240, 35240, 35240, 2903, 2903, 3315, 35240, 8566, 35240, 55168, 35240, 41070, 25767, 35240, 35240, 29935, 988, 2943, 35240, 3565, 42124, 35240, 1972, 3575, 35240, 1972, 8566, 3841, 3841, 2577, 6783, 3317, 1951, -5973, 2903, 244, -5973, 326,121674, 35240, 35240, 35240, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 35240, -5973, 63902, -5973, -5973, -5973, -5973, -5973, -5973, 158, -5973, -5973, -5973, -5973, -5973, -5973, 3560, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 93598, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 30465, -5973, -5973, -5973, -5973, 3318, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 3336, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 30995, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 3319, -5973, -5973, 35240, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 3408, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 1318, 35240, 35240, 35240, 35240, 35240, 35240, 35240, 35240, 35240, -5973, 35240, 394, -5973, -5973, 3672, 3392, 64, 549, 3323, 3546, 88990, 32060, 3414, 24695, -5973, 299, 3414, -5973, -5973, -5973, 93598, 3529, 3411, -5973, 3325, 3674, 3676, 1075, 83870, 2771, 35240, 158, 342, 93598, 35240, 3318, 3336, 35240, 3319, 35240, 3408, -5973, 35240, -5973, 2204, 2120, 35240, 2214, 3326, -5973, -5973, 3343, 3052, 3363, 3369, 3357, 3364, 2903, 253, 3373, 965, 208, 3486, 2903, 3600, 3374, -5973, 63902, -5973, 44196, 3391, -5973, -5973, -5973, 1635, 83870, 83870, -5973, 3673, -5973, 3360, -5973, 17223, 3673, -5973, -5973, 41597, 3489, 3656, 3596, -5973, -5973, -5973, 3372, 20870, 36300, 36300, -5973, 2535, 20870, 2585, -5973, -5973, -5973, -5973, -5973, -5973, 1285, -5973, 93598, 170, 3425, 1818, 3443, 1140, 3880, 3446, 93598, -5973, 49894, 2218, -5973, 68510, 93598, 93598, 3602, -5973, 3863, -5973,123666, -5973, 3385, -5973,123168,118686, -5973, -5973, 1090, -5973, 1356, 68510, -5973, 93598, 93598, 68510, 93598, 93598, -5973, 68510, 85918, 3439, 93598, 93598, -5973, -5973, -5973, -5973, -5973, 61341, 1489, 77726, 3545, 77214, -5973, -5973, 3388, 93598, 3630, -5973, -5973,113054, -5973, 3635, 68510, 93598, 93598, 35240, 3640, 93598, 93598, -5973, 514, 3477, 3483, -5973, 93598, 3492, 72094, 3402,121674, 72094, 55699, 72094, 72094, 3762,121674, 93598, 93598, 1607, 83870, 262, 1126, 3148, 3642, -5973, 1031, -5973, 68510, -5973, 93598, 3644, -5973, -5973, -5973, 89502, -5973, -5973, -5973, 113566, -5973, -5973, 3645, -5973, 2223, -5973, 68510, 68510, 93598, 7950, 3405,114078, 93598, 754, 3703, 3652, 3658, 3716, 132, -5973, -5973, -5973,121674, -5973, 93598, 90014, 93598, 93598, 3706, 93598, 80798,114590,115102, 1654, 1793, 3707, 93598, 81310, 3708, -5973, 3576, 93598, -5973, -5973, 64414, 68510, 93598, 1375, 63902, -5973, 3690, -5973, 93598, -5973, 331, -5973, 93598, 6823, 3657, -5973, -5973, 3514, 3533, 93598, 314, 1154, 3148, 3836, 93598, 93598, 3432, 2229, 68510, 93598, 63902, -5973, 3664, 1548, 68510, 93598, 89502, -5973, 3665, -5973, 83870, 3768, -5973, 3441, 2396, 2609, 2050, 3441, 68510, 93598, -5973, 3441, 93598,104862, -5973, 68510, 947, -5973, 68510, 93598, 89502, -5973, 3671, 3619, 68510, 93598, 14041, -5973, -5973, -5973, 364, -5973, -5973, -5973, -5973, -5973, 93598, 93598, 364, 93598, 93598, 364, 344, -5973, 68510, 93598, -5973, -5973, -5973, 3583, 68510, 93598, 93598, 250, 93598, -5973, 93598, 68510, 3496, 93598, 93598, -5973, -5973, 93598, 6320, 93598, 93598, 93598, 93598, 93598, 93598, 68510, 93598, -5973, -5973, 1505, 92, 1315, 1914, 1647, 93598, 3797, 93598,115614, 1237, 68510, 93598, 93598, 1237, 93598, 63902, 1947, -5973, -5973, 3593, -5973, 68510, 947, -5973, 8222, 93598, 93598, 93598, 3547, 3548, 242, 3637, -5973, -5973, -5973, 118, 118, 3682, -5973, 35240, 35240, 33650, 3461, -5973, -5973, 35240, 2887, -5973, -5973, -5973, 1170, 3967, 1170,116126, 1170, 1170, 3781, 3539, 3549, 1170, 1170, 1170, 3763, 1170, 1170, 1170, 93598, 3662, -5973, -5973, 3662, 885, 35240,121674, 93598, -5973, 2230, -5973, 3481, -5973, -5973, 63902, 93598, 590, 1082, 3851, 3712, 75678, 1841, 3838, 93598, 3526, 93598, 3973, 3580, 1729, -5973, 1841, 93598, -5973, 1595, 77726, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 93598, -5973, -5973, 3844, 93598, 44714, 3670, -5973, 1237, 2851, 2851, 2851, 2851, 3482, 2851, 93598, 3621, 3867, 1841, 3495, 3869, -5973, 3646, 3870, 1404, 93598, 3725, 75678, 3557, 3553, 3740, 3996, 2396, 1237, 3744, 3728, -5973, 59805, -5973, 2851, 4012, 28376, 7342, 7559, 3730, 3799, -5973, -5973, 3737, 999, 93598, 3852, 3856, 3876, -5973, 266, -5973, 4018, 1916, 3877, 357, -5973, 366, -5973, 2891, -5973, 93598, -5973, 93598, 93598, 93598, 93598, 382, -5973, -5973, 366, 2891, 366, 1075, -5973, 3814, 357, 2891, 3666, 3887, 386, -5973, 392, -5973, 3750, 1075, -5973, 3770, 2396, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 2242, -5973, 93598, -5973, 3859, 3862, 3864, 3866, 3868, 3528, 3550, 3573, 93598, 3555, 3528, 364, 3556, 3554, -5973, 3555, 3555, 3528, 3023, 3023, 3528, 3550, 67486, 4014, 63902, -5973, -5973, 3627, 3562, 3899, 861, -5973, 1102, 96, 3804, -5973, -5973, -5973, -5973, 2903, 244, 61853, -5973,121674, -5973, 68510, 3588, -5973, -5973, -5973, 3769, 3561, 67486, 1075, 396, -5973, 72094, 93598,121674, 72094, 3782, 72094, 72094,121674, 93598, 93598, 2244, -5973, 2058, -5973, 2099, 35240, 211, -5973, 17972, 2253, 35240, 3567, 3569, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 3581, 3905, -5973, 2258, 2276, 18057, 2360,121674, 2284, 3572, -5973, 3584, 241, 3772, 3570, 4889, 3613, 2280, 3587, 313, -5973, 4889, 351, 3582, 7029, 3717, 3589, 2286, 3590, 3595, -5973, 6056, 6560, 3597, 18377, 3601, 3603, 3615, 3566, 41070, 41070, 29405, 1296, -5973, 41070, 3616, 3784, 2294, 17259, 3617, 3622, 18503, 34180, 35240, 34180, 34180, 18642, 3620, 3624, -5973, 3978, -5973, 2299, 63902, 3792, 18819, 2304, -5973, 35240, 63902, 6656, 35240, -5973, 35240, 3625, -5973, -5973, 3045, 3045, 3045, 8566, -5973, -5973, 3612, -5973, 41070, 41070, -5973, 1052, 29405, -5973, 3936, -5973, -5973, 629, -5973, -5973, -5973, -5973, -5973, 3618, -5973, -5973, -5973, 3839, 2360, 2481, 55168, 8610, 35240, 488, 35240, 3631, 35240, 3685, 3045, 3045, 3045, 500, 500, 272, 272, 272, 2259, 549, -5973, -5973, -5973, 3639, 3641, 3546, 3643, 35240, -5973, 3679, 50412, -5973, 2421, 2553, 93598, 255, 5496, 5590, -5973, -5973, -5973, 3391, 109, 3391, -5973, 1553, -5973, -5973, -5973, -5973, -5973, -5973, 83870, 20870, -5973, -5973, 3892, 3650, 2306, -5973, -5973, 2903, -5973, -5973, 2378, 2378, 3629, -5973, 3638, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 3647, -5973, -5973, -5973, 3678, 3680, 45232, 3986, 3686, 43678, 90526, 3651, 2672, -5973, 90526, 91038, 90526, 90526, -5973, 3661, -5973, -5973, 1951, 35240, 3985, -5973, -5973, -5973, 35240, -5973, -5973, 1084, 3688, 98, 1336, 2614, 2614, 2535, 1370, -5973, -5973, 3705, -5973, 35240, 2890, -5973, 2896, -5973, -5973, -5973, -5973, 3023, -5973, 3919, -5973, -5973, -5973, 44196, 3691, 3709, 784, 48340, 3893, -5973, 93598, 44196, -5973, 93598, 417, -5973, 3675, -5973, -5973, -5973, -5973, -5973, -5973,118686, 2247, -5973,123168, -5973,123168, -5973, 2247, 4147, -5973,118686, 1985, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 68510, 68510, 3901, 93598, 3903, 3909, 35240, 1568, -5973, 4067, 1075, -5973, -5973, 3778, -5973, 20870, -5973, -5973, -5973, -5973, -5973, 68510, 93598, -5973, 71582, -5973, -5973, 121674, -5973, -5973, 93598, 93598, -5973, -5973, -5973,121674, -5973, -5973, -5973, 93598, 1016, 3779, 3786, 93598, -5973, 1044, 3403, 8524, 93598, 93598, 93598, 4021, -5973, -5973, -5973, -5973, 3944, -5973, 4082, -5973,118686, -5973, 2891, 1345, 3795, 3148, 35240, 3961, -5973, 1506, 93598, 3721, 3724, 4109, 93598, 1532, 4061, 3735, -5973, 3845, 4064, 3872, 1014, -5973, -5973, 3878, -5973, -5973, -5973, -5973, 4119, 1075, 4121, 1075, 93598, 93598, 93598, 93598, 3884, -5973, -5973, -5973, -5973, 3885, 4030, -5973, 63902, 63902, 63902, 2330, -5973, -5973, 1237, -5973, -5973, -5973, -5973, -5973, -5973, 4076, -5973, 2331, -5973, 2044, 91550, -5973, -5973, -5973, -5973, -5973, 4123, 68510, 93598, 8990, 93598, 93598, 93598, 3975, 2066, 1407,121674, -5973,120180, -5973, -5973, 2336, -5973, 3760, 93598, 3837, 68510, 3816, -5973, -5973, -5973, 4127, 2396, 3900, 79774, 3802, 3802, 2108, -5973, -5973, -5973, -5973, -5973, 4040, 3962, -5973, 1189, 3963, 68510, 3827, -5973, -5973, -5973, -5973, 4141, 3854, -5973, -5973, 3857, 1227, 3148, 3646, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 3883, -5973, -5973, -5973, -5973, -5973, -5973, 1781, 1781, -5973, -5973, -5973, 1781, 1606, 524, 1277, 3148, -5973, 1069, 1093, 3858, -5973, 3860, -5973, -5973, -5973, 4041, 4044, 4046, 3871, 3874, 3920, 3875, 3890, 3922, -5973, 3891, 3924, 3894, 3926, 3895, 4191, 1075,121674, 4028, 1237, 3921, 4169, 1075, -5973, -5973, 3896, -5973, 3902, -5973, 2348, 4282, 4294, -5973, 93598, -5973, 528, 1343, 3148, -5973, 3904, -5973, 68510, 93598, -5973, -5973, -5973, 35240, 3810, 3811, 3812, 20870, 20870, 35240, -5973, -5973, 20870, 3806, -5973, -5973, -5973, -5973,121674, -5973, 93598, 4129, -5973, -5973, 1170, 93598, 93598, -5973, -5973, -5973, 93598, -5973, -5973, -5973, 4130, -5973, 322, 322, -5973, -5973, 4162, 7284, 3818, 168, -5973, 63902, 51982, 3203, 901, 1909, -5973, 71582, 93598, 71582, -5973, 1082, 4043, 93598, 93598, 93598, 3820, 3821, -5973, -5973, -5973, -5973, 68510, 256, 68510, 2903, -5973, -5973, 3906, -5973, 93598, 2396, 4356, 4192, 3496, -5973, 4318, 3347, 409, 1865, 219, 2938, 4254, 2666, 35240, 422, -5973, -5973, 1951, 93598, 3553, -5973, -5973, -5973, -5973, 1237, -5973, 3830, 3831, -5973, 93598, 4202, 93598, 93598, 93598, 93598, 3588, 3853, 93598, 3865,121674, 93598, 2386, 3139, 4337, 4231, 1835, 3557, 3942, 4234, 83870, 3873, 2353, -5973, -5973, 999, -5973, 2354, 212, -5973, 1237, 71582,119184, 4221, -5973, 306, 7559, -5973, -5973, 306, 1028, 93598, -5973, -5973, -5973, -5973, 4090, 2341, -5973, 4206, -5973, -5973, 1835, -5973,121674, 3861, -5973, 2364, -5973, -5973, -5973, 386, 3927, 1075, 3928, 1075, -5973, -5973, -5973, -5973, 93598, -5973, 93598, 66974, -5973, -5973, 93598, -5973, 4246, -5973, -5973, 4015, 4016, 4017, 4019, 4020, 93598, 3528, -5973, 3879, 93598, 93598, 68510, 1782, -5973, -5973, 68510, 210, -5973, 202, -5973, 83870, 4004, -5973, -5973, -5973, -5973, 4253, 4256, -5973, 3881, -5973, -5973, -5973, -5973, 1048, -5973, 78750, 457, -5973, 68510, 4188, 4189, 4193, 4196, 364, 4197, 4199, 4200, 4201, 4203, -5973, -5973, -5973, 3882, 18924, 35240, -5973, 4269, 121674, -5973, 8701, -5973, -5973, -5973, 35240, -5973, -5973, 4198, -5973, -5973, 3964, 3965, 3897, 3572, 3717, -5973, 4124, 4126, 35240, 3717, 4370, 1124, 35240, 35240, 35240, -5973, -5973, 4128, 4132, 35240, 2360, 2360, 35240, -5973, 3910, 35240, -5973, -5973, -5973, -5973, 2401, 35240, -5973, 35240, -5973, -5973, 26303, 4420, 4420, 3898,121674, 41070, 41070, 41070, 41070, 1134, 2990, 41070, 41070, 41070, 41070, 41070, 41070, 41070, 41070, 41070, 41070, 476, -5973, 4115, 35240, 35240, 34710, -5973, -5973,121674, 3911, 3620, 3912, 3913, 35240, -5973, -5973, -5973, 2369, 42642, 3915, 63902, -5973, 35240, 17628, 2374, 3959, 19538, 1951, 9272, 1237, 35240, 1868, 3301, 35240, 2375, 35240, -5973, -5973, -5973, -5973, 4276, -5973, -5973, -5973, -5973, -5973, -5973, 4155, 2360, -5973, -5973, 35240, 3929, 2777, 41070, 41070, 4433, 29405, -5973, 4569, 35240, 29405, -5973, 3682, -5973, 26839, 3916, 35240,118174, -5973, -5973, 1108, 1108, 1108, 1108, -5973, 93598, 93598, 93598, 3985, 3930, 3985, 184, -5973, -5973, 1835, -5973, 3934, -5973, -5973, -5973, -5973, -5973, 35240, 90526, 91038, 90526, 90526, 3932, 43160, 27358, 2672, 3935, 93598, -5973, -5973, 3937, 44196, 4243, 4156, -5973, 44196, 4156, 2098, 4156, 4251, 4042, 50930, -5973, -5973, 3946, -5973, -5973, 4164, -5973, -15, 20870, 4427, 4296, -5973, 3951, -5973, 3688, 1036, -5973, -5973, -5973, 1379, -5973, 4056, -5973, -5973, -5973, 3651, 36830, 4112, -5973, -5973, -5973, 4011, 2393, -5973, -5973, 4415, 4112, -5973, 2660, -5973, 2398, 49894, 3691, 35240, 1951, 2400, 2059, -5973, -5973,118686, -5973, 4047, 2891, 2891, 1562, 3528, 4336, 1562, 9635, -5973, 2206, 93598, -5973, 93598, -5973, -5973, -5973, 4471, 4036, 4039, 4271, -5973, 2765, -5973, -5973, 68510, 93598, -5973, -5973, -5973, 553, 1367, 3148, -5973, 4068, -5973, -5973, 4301, 93598, -5973, 4459, 4080, 93598, 10171, 4362, 4048, -5973, -5973, 45750, 93598, 93598, -5973, 93598, -5973, 93598, 93598, 2206, 92062, -5973, 4435, -5973, 2206, 4102, 4342, 1880, 3139, 482, 6516, -5973, 2102, -5973, -5973, 4066, -5973, 93598, -5973, 93598, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 4131, -5973, -5973, -5973, -5973, 64414, -5973, -5973, 93598, -5973, 63902, 51982, 63902, -5973, -5973, -5973, 93598, -5973, 1655, 566, 1381, 3148, -5973, 4077, -5973, 4367, 4081, 4083, 4138, 232, 1615, 4084, 4085, 4140, 3997, 3998, 3999, -5973, 63902, 52513, 4173, 93598, 2891, 4001, 4049, 93598, 3802, 92574, -5973, 4007, -5973, -5973, 3802, 375, 1237, -5973, -5973, 1237, 2891, 1237, 93598, 93598, 93598, 93598, 250, -5973, -5973, -5973, 4486, 4107, 93598, 93598, 93598, 93598, -5973, 4069, -5973, -5973, -5973, 93598, 93598, 4375, 948, 2347, 68510, 93598, 93598, 68510, 93598, 93598, 93598, 93598, 93598, 93598, 93598, 4238, -5973, 4472, 4394, 2395, 4440, 4098, 93598, -5973, 93598, 1237, -5973, 3403, 93598, 93598, 93598, 93598, -5973, -5973, -5973, -5973, -5973, 3682, -5973, 4022, 4334, 1170, -5973, 4338, 4340, 4341, 1170, -5973, -5973, 1909, -5973, 924, 93598, -5973, 2510, 93598, -5973, -5973, -5973, 3951, 2129, 2590, -5973, -5973, -5973, -5973, -5973, -5973, 4024, 93598, 93598, 41070, -5973, -5973, 471, 1790, 315, -5973, 4321, 93598, 3228, -5973, -5973, -5973, 971, 93598, -5973, -5973, -5973, -5973, 4031, -5973, 1255, 3853, -5973, 4357, 75678, 2891, 68510, 68510, 2891, -5973,121674, 4032, 3553, -5973, 319, 4134, -5973, 68510, 409,116638, 3308, 4074, 4263, 10273, 44196, 44714, 1781, -5973, 4038, 4037, -5973, -5973, 93598, 4043, 66974, 2405, 3646, 4539, 1400, 2350, -5973, 76190, 4249, 3853, 4357, -5973, 3139, 4278, 4277, -5973, 1835, 93598, 3588, 3553, 1237, 93598, 4048, 51982, -5973, 4583, 2344, -5973,118686, 35240, 35240, -5973, 4050, -5973, 4051, 7559, -5973, 4133, 4052, 4550, 35240, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 4149, 4063, 93598, 93598, 999, 93598, -5973, 4065, 3877, -5973, 3877, -5973, 93598, -5973, 93598, -5973, 1075, -5973, 4205, 1075, 93598, 93598, 93598, 93598, 93598, 93598, 3528, 364, 3554, -5973, -5973, 4405, 67486, 4419, -5973, 63902, -5973, -5973, -5973, -5973, -5973, 2409, 93598, -5973, -5973, 1237, -5973, 4494, 4430, 1075, 152, 1213, 1213, 1213, 1213, 4385, 1213, 1213, 1213, 1213, 1213, -5973, 35240, 20870, -5973, 4073, -5973, 20870, 4467, 4371, 4373, -5973, -5973, 4078, 4319, 4322, -5973, 4086, 35240, 3717, 19602, -5973, -5973, 4324, 4327, -5973, 3717, 3717, 19602, -5973, 19602, 4088, 11279, 19995, -5973, 2410, 35240, -5973, 3933, 3933, 3933, 3855, 4441, -5973, 2901, 3933, 3933, 3933, 540, 540, 271, 271, 271, 4420, 476, 20064, 20043, 20401, 4091, -5973, -5973, -5973, 3620, -5973, 37360, 107, 4573, 42124, -5973, -5973, -5973, 4142, 4144, 4095, -5973, 35240, 37890, 4096,123666, 4317, -5973, 478, 35240, 35240, 4545, -5973, 10463, 35240, -5973, -5973, 4545, 512, 35240, 3359, 3668, 35240, 2415, 35240, 4643, 11367, 4105, -5973, 2416, 35240, 11723, 4314, -5973, 93598, 93598, 93598, 93598, -5973, -5973, -5973, 4296, 1237, 4296, 4108, -5973, 4111, -5973, -5973, -5973, -5973, 64926, 4113, 3792, 90526, 4117, 93598, 2672, 44196, -5973, -5973, 2598, -5973, 44196, 4421, -5973, 44196, 72094, -5973, 93598, 4118, 93598, -5973, 1897, 35240, 4165, 55168, -5973, -5973, -5973, -5973, 4211, -5973, 4344, 20870, 4166, -5973, 1835, 2035, 93598, 1951, 106, -5973, 35240, 4137, 93598, -5973, 4112, 20870, -5973, 4207, 2427, -5973, -5973, 4358, -5973, -5973, -5973, -5973, -5973, 4210, 77726, 4487, -5973, -5973, -5973, 1817, 4460, 961, -5973, 1075, -5973,121674, 93598, 93598, 93598, 3086, -5973, -5973, 93598, 93598, 93598, 93598, -5973, -5973, 68510, 93598, -5973, -5973, 93598, 35240, 2435, -5973, 4174, 4592, 376, 4136, -5973, 2206, 2, 2206, -5973, 2, -5973, -5973, 93086, -5973, 4043, 250, 471, 4475, 4476, 4376, -5973, 364, -5973, 4635, 471, 4377, 250, -5973, -5973, -5973, -5973, 3220, -5973,121674, 1075, 1075, -5973, -5973, -5973, -5973, -5973, 4151, -5973, 4620, 4242, 93598, 93598, 93598, 93598, 93598, 68510, 93598, 93598, 2903, 2903,121674, 4148, -5973, 2903, 2903, 4150, -5973, 68510, 93598, 93598, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 4233, -5973, 35240, 4611, -5973, -5973, -5973, -5973, -5973, 35240, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 68510, 93598, 4236, -5973, 4244, -5973, 178, -5973, -5973, 93598, 93598, 93598, 93598, 4534, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 4533, 93598, -5973, -5973, 1237, 1237,121674, 1075, 1075, -5973, -5973, -5973, 4248, -5973, -5973, 4160, 4474, 1170, -5973, 1170, 1170, 1170, -5973, 4163, -5973, 1909, 4576, -5973, 2206, 2156, 4524, -5973, 35240, -5973, 1405, 3855, -5973, 4585, 4669, -5973, -5973, -5973, -5973, 4423, 3496, 2396, 3496, -5973, -5973, 72094, 440, -5973, 4506, 590, 63902, 4409, 75678, 1069, 1850, 4172, 4313, -5973, 2891, 2891, 4241, 93598, 4678, -5973, -5973, -5973, -5973, -5973, -5973, 68510, 3816, -5973, 4424, 1431, 4544, 93598, 44714, -5973, 3651, -5973, -5973, -5973, 1237, -5973, -5973, 4323, 3553, -5973, 1844, 93598, 4422, 75678, 3588, 2439, -5973, -5973, -5973, 4229, 4666, 3557, -5973, 1069, 4249, -5973, -5973, 4644, 4288, 4235, 4693, -5973, 4288, 4554, 4425, 4204, -5973, 3873, -5973, 93598, -5973, 20870, 20870, 1237,124164, 306,121674, 4561, -5973, 20870, 93598, 214, 4209, 4379, -5973, 4527, 1075, 2445, -5973, 1075, 1075, -5973, 93598, -5973, 3528, 3528, 3528, 3528, 3528, -5973, 4431, -5973, -5973, -5973, -5973, 4517, -5973, -5973, 67486, -5973, 1075, -5973, -5973, -5973, -5973, -5973, -5973, 1213, -5973, -5973, -5973, -5973, -5973, 20870, -5973, 93598, -5973, -5973, -5973, -5973, -5973, -5973, 3360, 4208, 35240, 1715, -5973, -5973, 4213, 4215, 3717, 3717, -5973, -5973, 35240, -5973, 12040, 41070, 4570, -5973, 35240, 35240, 35240, -5973, 4217, 2450, 2451, -5973, -5973, 107, -5973, 4573, -5973, -5973, -5973, 12077, 4279, 20870, 4339, 4222, 278, 4545, 4545, 10463, 4545, 35240, 35240, 4545, -5973, 4545, 35240, -5973, -5973, -5973, 12631, -5973, 4696, 3682, -5973, -5973, -5973, -5973, 4165, -5973, 4165, 4365, 35240, -5973, 2452, 4723, 40010, 4681, -5973, 93598, 2457, -5973, 35240, 4226, -5973, -5973, 44196, 2598, 4227, 2477, 93598, 2485,121674, 38420, 20870, 93598, 3682, 4230, -5973, 93598, 4228, 32060, -5973, 784, -5973, -5973, 4675, 45750, 4633, 20453, 35240, -5973, -5973, -5973, -5973, -5973, 67486, 4462, 67486, 2206, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 4237, -5973, -5973, -5973, -5973, 4325, -5973, -5973, 66, 3542, 2206, -5973, 12661, 4574, 45750, 56230, 93598, -5973, 93598, -5973,117150, 4240, 4454, 4245, 4247, -5973, -5973, -5973, -5973, 4741, 4622, 4623, -5973, -5973, 4252, -5973, -5973, -5973, 4472, -5973, -5973, 51982, 68510, 93598, -5973, 4333, -5973, -5973, -5973, -5973, -5973, -5973, 47822, 55168, -5973, 232, 4255, 4260, 1615, -5973, -5973, -5973, 93598, 13369, 4264, 13470, 762, 3542, 93598, 93598, 4267, 4268, 4272, 1827, 1971, 2027, 3528, 4614, 93598, -5973, -5973, -5973, 4472, -5973, -5973, 93598, -5973, 1170, -5973, -5973, -5973, -5973, 63902, -5973, 3454, 4163, 1237, 72094, 4750, 4750, 14406, 4492, -5973, -5973, 497, 4582, -5973, 4332, 4528, 4332, 4273, 93598, 971, 4274, 2486, -5973, 93598, 4270, 4412, 2157, 2157, 93598, 93598, 93598, 2487, 1835, 2891, 4049, 409, 4658, 75678, 4705, 4043, 450, -5973, 93598, 4781, 93598, 3588, 3853, 93598, 4283, -5973, -5973, 76190, 4510, 3203, 93598, 2386, 4249, 3557, 1616, 93598, -5973, 1530, -5973, 1835, -5973, 93598, 83870, 45750, 4642, -5973,123168, -5973, 2491, -5973, -5973, -5973, 4366, 21950, 3391, 4410, 4416, 4293, 2008, 4662, 93598, 146, -5973, -5973, -5973, -5973, -5973, -5973, 93598, 457, -5973, -5973, -5973, -5973, 4295, -5973, 4799, 35240, 350, -5973, -5973, -5973, -5973, -5973, 4529, -5973, 4300, -5973, -5973, 2575, 1715, 20532, -5973, 3966, 41070, 20870, 20870, 20870, 35240, -5973, 35240, -5973, -5973, -5973, -5973, 942, -5973, -5973, 4637, 4303, 4545, 4545, 4545, -5973, 35240, 239, -5973, -5973, 1133, 4734, 20624, 3661, 64926, 4311, -5973, 41070, 2513, -5973, 3805, 93598, 2515, -5973, 20870, 93598, -5973, -5973, 35240, -5973, 2537, -5973, 4315, 1440, 4316, 25231, 4320, -5973, -5973, -5973, -5973, -5973, 20870, 4329, -5973, 4816, 1818, -5973, -5973, 2161, 3022, 4384, 93598, 2538, -5973, 853, 1678, 1369, -5973, 4820, 4820, 20870, 1782, 1562, 438, -5973, 93598, 4426, -5973, 4592, 4331, 3496, -5973, 4335, -5973, -5973, 1144, 3139, 93598, 4495, -5973, 4574, 4574, 3203, 4671, -5973, -5973, 35240, 4399, -5973, 1153, 3542, 93598,121674, -5973, 161, 4702, -5973,121674, 121674, -5973, -5973, -5973, 35240, -5973, 4437, -5973, -5973, -5973, 35240, 35240, 74654, -5973, -5973, 93598, 93598, 93598, 93598, 93598, -5973, 1075, -5973, -5973, 2544, -5973, 46786, -5973, -5973, 3337, 1237, 3337, 1988, -5973, -5973, 3337, 3337, -5973, 3391, -5973, 4750, 398, -5973, -5973, 4423, 4343, 35240, -5973, 4670, -5973, 1303, 4575, -5973, 4345, -5973, 72094, 4881, -5973, 63902, 3853, 4357, 93598, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 2546, 4043, 4724, 3553, 4235, -5973, 93598, 4392, -5973, 44196, 4043, 1835, 2350, -5973, 4249, 3853, 4357, -5973, -5973, 4354, 4277, 3557, 2386, 4508, -5973, 4513, -5973, 4821, 4588, 4838, 3588, -5973, 4048, 2560, 93598, -5973, -5973, 7559,124164,121674, -5973, -5973, -5973, 4372, 4775, 4428, 4429, -5973, -5973, -5973, 2008, -5973, 1300, 4772, 4438, -5973, 4436, 93598, -5973, -5973, 4043, 1075, 35240, 63902, 20870, -5973, -5973, 4765, -5973, 437, 249, 1689, 4607, 4380, 35240, 3966, 2561, 2568, 4442, -5973, -5973, -5973, 3620, 38950, 38950, 38950, 4381, 4751, 4756, 93598, -5973, 93598, 4598, -5973, -5973, 93598, 3855, 4390, 40010, 63902, 2573, -5973,120678, -5973, 2583, 2588, -5973, 35240, 4398, 35240, -5973, 38420, 93598, 4401, 3425, -5973, -5973, 2595, -5973, 4898, 1835, -5973, 3391, 45750, -5973, 4535, -5973, 4677, -5973, -5973, 35240, 4499, 4500, -5973, 4768, -5973, -5973, 93598, -5973, 93598, 4332, 55168, 3688, 1144, -5973, 93598, 3496, 3496, 4343, 14778, 35240, -5973, 4511, -5973, -5973, 2608, 1373, -5973, -5973, 2610, 2612, 15612, 93598, 2616, 2617, -5973, 2618, 2903, 3550, 2027, 3550, -5973, 3528, -5973, -5973, 63902, -5973, -5973, 67998, -5973, -5973, -5973, 1237, -5973, 1237, 4649, 57768, 58280, 1237, 1237, -5973, -5973, -5973, -5973, -5973, 3646, -5973, 15689, 4512, -5973, -5973, -5973, 1007, -5973, 4646, 4647, -5973, 4434, -5973, 2629, -5973, 1069, 4557, 4043, -5973, -5973, 93598, 4921, 4922, -5973, 1438, 93598, 3651, -5973, 4235, 3588, 3557, 1069, 4249, 3203, 46268, 4288, 2386, 4277, -5973, -5973, 4655, -5973, 4657, -5973, 4439, 4769, -5973, 1740, 306, -5973, -5973, -5973, 1751, 4794, 4795, -5973, -5973, -5973, 3337, -5973, 2038, 4443, 4824, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 4479, 261, 301, -5973, 4484, -5973, 4627, 4628, 1715, 2434, -5973, 20870, -5973, -5973, -5973, 40540, 4599, 1448, 17833, 4833, -5973, 4833, 4833, -5973, 4929, 4930, 1242, -5973, 4909, 2636, 42124, -5973, -5973, -5973, 93598, 4676, 1481, 4954, 4625, 2637, 38420, 2642, -5973, -5973, -5973, -5973, -5973, 2161, 93598, -5973, -5973, -5973, 49894, 4938, 20870, 474, 1056, 67486, 3542, 2644, 3802, 4461, -5973, 3688, 4463, 4332, 4332, -5973, -5973, 20870, 93598, 72094, 4939, -5973, -5973, -5973, -5973, 3542, 4552, -5973, -5973, 74654, -5973, 93598, -5973, -5973, 2651, -5973, -5973, -5973, 58792, -5973, 4209, -5973, 4209, -5973, -5973, 2178, 1667, 93598, 1137, 1137, 4877, -5973, 4531, -5973, 4466, -5973, 4999, 4605, 93598, -5973, -5973, 232, 1835, 75678, 4043, -5973, -5973, 2386, 4249, 3557, 35240, 2657, -5973, 4592, 376, -5973, 4277, 4288, -5973, -5973, 45750, 4473, 3228, 4868, -5973, -5973, -5973, 2623, 72094, 72094, 93598, -5973, -5973, -5973, 35240, 971, -5973, 4514, -5973, 4515, -5973, -5973, 4701, 4707, 4477, 1715, -5973, 4984, -5973, -5973, -5973, -5973, -5973, 987, -5973, -5973, -5973, 93598, 93598, 93598, 4483, -5973, 3792, -5973, -5973, 41070, 41070, 4725, -5973, 41070, 1481, -5973, 93598, -5973, 4489, -5973, -5973, 2659, -5973, -5973, -5973, 1600, 2064, -5973, 4730, 4624, -5973, -5973, 4733, 606, -5973, 438, -5973, -5973, -5973, -5973, -5973, 93598, 4528, -5973, -5973, 3542, -5973, 93598, -5973, 4493, -5973, -5973, -5973, 67998, -5973, 4209, -5973, -5973, -5973, -5973, -5973, -5973, 5005, -5973, 1453, -5973, -5973, -5973, -5973, 93598, 4043, 4148, 4235, -5973, 4277, 3557, 2386, 15742, -5973, 46268, 93598, 93598, 4288, -5973, 2661, 45750, 3553, 4648, -5973, 2625, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 897, 4491, 4496, -5973, -5973, 16152, 72094, -5973, -5973, 4645, 4650, -5973, 4726, 39480, 4652, -5973, 4715, -5973, 1302, 1382, 2034,117662, 4958, 3855, 3855, -5973, 3855, -5973, -5973, 35240, -5973, -5973, -5973, -5973, -5973, 49894, -5973, 4562, 784, 4504, 93598, -5973, -5973, 2206, 4136, 4575, 2206, 2206, -5973, -5973, 35240, -5973, -5973, 2396, 2396, 4043, -5973, -5973, 4288, 2386, 4277, 4592, -5973, -5973, -5973, -5973, 4769, -5973, 2663, 4288, 4438, 2587, -5973, -5973, 2600, 2728, 4595, 4867, -5973, 4509, 4626, 4629, 4897, -5973, -5973, -5973, 93598, 93598, 65438, 93598, 1050, 2669, -5973,121176, 93598, 16555, 4516, -5973, 4571, 35240, 2673, 4521, -5973, 2685, -5973, -5973, -5973, -5973, 4277, 4288, 93598, 3228, -5973, 45750, 3391, 4894, -5973, 2625, 4638, 4639, 63390, -5973, -5973, -5973, -5973, -5973, 5054, 345, 4944, -5973, -5973, 1237, 1715,117662, 4748, 781, 2689, -5973, 4586, 2691, 134, -5973, 2206, -5973, 4288, -5973, -5973, 3553, -5973, -5973, 971, -5973, 4577, 4578, -5973, 2695, -5973, -5973, -5973, -5973, 35240, 65438, 2303, 4530, -5973, -5973, 4735, 1237, 2575, 4735, -5973, -5973, -5973, 784, -5973, -5973, 4288, 72094, 4890, 4899, -5973, 63390, 118, 4606, 93598, 4546, -5973, 1715, -5973, 1689, 2575, 4603, 3391, 4547, 72094, 72094, -5973, 4549, 93598, 5009,117662, -5973, 1715, 1689, 4586, -5973, 63390, -5973, -5973, 1237, -5973, 4555, 2696, -5973, 1715, -5973, 2697,117662, -5973, -5973, -5973, 2707, -5973 }; /* 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_int16 yydefact[] = { 1748, 1480, 685, 1569, 1568, 1480, 0, 275, 0, 1580, 0, 1480, 444, 1137, 0, 0, 0, 0, 685, 1480, 0, 1748, 0, 0, 0, 0, 0, 1761, 0, 0, 0, 0, 0, 0, 1277, 0, 0, 0, 1480, 0, 0, 1768, 0, 0, 0, 0, 1761, 0, 1582, 0, 0, 0, 0, 1768, 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, 1580, 102, 115, 101, 84, 108, 87, 112, 130, 113, 85, 126, 1712, 1711, 1772, 1715, 1747, 0, 1727, 1479, 1478, 1493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1490, 2476, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2509, 2508, 2510, 2511, 2886, 2512, 2513, 2514, 2823, 2824, 2887, 2825, 2826, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2827, 2828, 2524, 2525, 2526, 2527, 2528, 2829, 2888, 2529, 2530, 2531, 2532, 2533, 2534, 2889, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2890, 2545, 2546, 2547, 2891, 2548, 2549, 2550, 2551, 2552, 2553, 2830, 2831, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2832, 2585, 2586, 2587, 2588, 2833, 2589, 2590, 2591, 2592, 2834, 2593, 2594, 2595, 2596, 2892, 2893, 2597, 2598, 2599, 2600, 2601, 2835, 2836, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2894, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2895, 2837, 2622, 2623, 2624, 2625, 2838, 2839, 2840, 2626, 2896, 2897, 2627, 2898, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2852, 2899, 2636, 2900, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2853, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2854, 2901, 2855, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2856, 2857, 2666, 2667, 2668, 2902, 2669, 2858, 2670, 2859, 2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2860, 2903, 2683, 2904, 2861, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2862, 2699, 2863, 2702, 2700, 2701, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2864, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2905, 2732, 2733, 2734, 2735, 2736, 2865, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2866, 2754, 2755, 2906, 2756, 2757, 2867, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2868, 2774, 2775, 2776, 2777, 2907, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2869, 2870, 2785, 2786, 2871, 2787, 2872, 2788, 2789, 2790, 2791, 2792, 2793, 2795, 2794, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 2873, 2874, 2807, 2908, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2820, 2821, 2822, 146, 0, 0, 2443, 2477, 2478, 2481, 2476, 414, 413, 1701, 2440, 2477, 1579, 0, 1558, 685, 0, 1493, 443, 1748, 0, 0, 0, 0, 0, 0, 904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 140, 0, 0, 468, 467, 0, 0, 1109, 473, 0, 0, 0, 0, 0, 675, 1621, 2700, 1619, 1702, 276, 279, 280, 277, 278, 2459, 0, 1249, 1250, 1252, 0, 0, 1262, 942, 943, 0, 0, 0, 956, 0, 0, 0, 940, 0, 0, 0, 962, 0, 959, 0, 0, 963, 960, 937, 961, 944, 0, 936, 0, 0, 1262, 964, 0, 0, 938, 0, 0, 0, 0, 1493, 1618, 474, 1748, 0, 1602, 1603, 1604, 1580, 1592, 1605, 1597, 1599, 1598, 1600, 1601, 1596, 2458, 2495, 1032, 1032, 1032, 1032, 1029, 1030, 1032, 1032, 1032, 2720, 0, 0, 1011, 0, 1013, 2460, 1032, 1037, 2503, 561, 561, 561, 0, 1036, 1041, 561, 0, 1461, 1502, 2442, 1760, 0, 1012, 1460, 2522, 248, 2726, 2732, 2741, 2751, 2752, 2755, 2869, 2785, 2819, 213, 202, 0, 225, 2785, 1608, 0, 0, 0, 0, 2739, 1470, 258, 2751, 2869, 2785, 257, 251, 253, 0, 0, 1036, 561, 0, 1493, 1468, 1008, 1767, 1765, 0, 2427, 2539, 2639, 2751, 2752, 2785, 203, 208, 269, 2751, 2869, 2785, 265, 1490, 0, 1728, 1878, 1877, 2436, 0, 1463, 1462, 1581, 0, 1584, 0, 2715, 1732, 1735, 1586, 1733, 2479, 1971, 2000, 1978, 2000, 2000, 1967, 1967, 2569, 1980, 1968, 1969, 2005, 2025, 0, 2000, 1967, 1972, 0, 1970, 2008, 2008, 1995, 3, 1950, 1951, 1952, 1953, 1981, 1982, 1954, 1987, 1988, 1992, 1955, 2022, 1958, 1967, 2480, 1769, 1770, 2427, 4, 2473, 5, 2354, 2472, 6, 7, 1724, 0, 0, 1, 1748, 0, 1591, 1764, 1764, 0, 1764, 0, 1716, 1724, 1719, 1723, 0, 0, 0, 0, 0, 0, 1464, 0, 0, 0, 967, 0, 1505, 1093, 0, 0, 0, 0, 0, 1346, 0, 1146, 1145, 2482, 2465, 2466, 2467, 0, 2463, 2464, 2483, 2484, 2485, 0, 2608, 1346, 0, 0, 2272, 2283, 2284, 2285, 2526, 2589, 2280, 2281, 2282, 2274, 2275, 2276, 2277, 2278, 2279, 0, 0, 1244, 2273, 0, 2608, 0, 1346, 0, 173, 0, 150, 1346, 0, 0, 2608, 0, 0, 2608, 0, 0, 0, 0, 0, 2608, 0, 0, 0, 0, 0, 173, 2644, 0, 150, 2608, 0, 0, 1484, 0, 0, 0, 1486, 1489, 1476, 0, 2351, 0, 2352, 2444, 1573, 0, 1572, 1566, 1576, 1571, 1561, 0, 2436, 0, 0, 0, 0, 950, 0, 0, 940, 0, 0, 0, 951, 0, 952, 953, 0, 0, 0, 0, 949, 0, 1474, 1466, 0, 1610, 1612, 1611, 1613, 1609, 561, 0, 0, 0, 2608, 0, 150, 1544, 0, 2608, 150, 0, 0, 472, 471, 150, 2463, 470, 469, 2526, 2589, 0, 1136, 0, 1219, 150, 2608, 0, 194, 2608, 744, 2608, 1586, 139, 0, 688, 0, 858, 2644, 150, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, 674, 685, 1622, 1620, 0, 1253, 250, 249, 1251, 954, 2608, 1178, 145, 0, 0, 2608, 1525, 2608, 145, 971, 955, 0, 941, 2608, 145, 1142, 2608, 2468, 183, 0, 939, 2526, 2589, 2608, 145, 1246, 0, 2608, 145, 2608, 179, 2608, 145, 2608, 145, 2608, 689, 0, 0, 2608, 145, 2608, 2644, 181, 958, 2608, 145, 965, 2608, 145, 2438, 2608, 0, 1477, 0, 1614, 0, 1594, 2873, 0, 1748, 1032, 1031, 0, 1032, 0, 1032, 0, 1032, 0, 1032, 0, 0, 0, 1032, 2461, 2462, 1014, 0, 1038, 0, 1046, 0, 1045, 1044, 1043, 0, 0, 0, 1047, 0, 1882, 1656, 0, 1458, 216, 247, 218, 246, 252, 219, 217, 0, 2517, 201, 0, 264, 263, 0, 0, 0, 0, 0, 0, 0, 1473, 0, 0, 0, 142, 0, 1275, 1272, 142, 1274, 1273, 142, 142, 1469, 256, 254, 0, 0, 0, 0, 0, 1475, 0, 1467, 0, 0, 0, 2446, 2448, 2449, 2286, 2354, 0, 2824, 2825, 2826, 2343, 0, 2827, 2828, 2829, 2888, 2160, 2146, 2155, 2161, 2147, 2149, 2156, 2830, 2831, 2095, 2832, 2833, 2456, 2834, 2835, 2836, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2851, 2852, 2151, 2153, 2853, 2854, 2855, 2857, 0, 2457, 2858, 2859, 2678, 2861, 2862, 2864, 2865, 2157, 2867, 2868, 2158, 2869, 2870, 2871, 2872, 2455, 516, 2159, 2874, 2876, 2877, 2878, 2879, 2881, 2882, 2883, 2884, 0, 0, 0, 2433, 0, 2124, 0, 1959, 1960, 1983, 1984, 1961, 1989, 1990, 1962, 0, 1963, 2432, 2026, 2231, 2123, 2141, 0, 2129, 2130, 0, 2122, 2118, 2233, 1750, 2428, 0, 2119, 2445, 2447, 2344, 1750, 2426, 271, 0, 272, 2434, 2751, 204, 2524, 205, 0, 206, 268, 266, 0, 1465, 0, 1880, 1879, 2437, 976, 0, 1583, 1580, 2296, 0, 1734, 0, 0, 0, 1999, 1986, 1994, 1993, 0, 1976, 1975, 1974, 0, 1973, 2000, 2000, 1998, 1977, 1950, 0, 0, 0, 2004, 0, 2002, 1946, 1942, 0, 2011, 2012, 2013, 2010, 2023, 2009, 0, 1956, 2014, 0, 1967, 1964, 1835, 0, 1714, 1713, 8, 0, 1588, 1590, 1564, 1586, 1762, 1763, 0, 0, 0, 0, 0, 0, 0, 0, 1822, 1780, 1781, 1783, 1819, 1823, 1831, 0, 1720, 0, 0, 0, 1884, 0, 0, 1491, 0, 0, 0, 0, 0, 1177, 0, 0, 0, 0, 968, 0, 0, 0, 1511, 0, 1513, 1514, 1515, 0, 0, 0, 0, 1516, 1517, 1505, 260, 1524, 1521, 1504, 1506, 1519, 0, 0, 0, 0, 0, 0, 0, 1536, 0, 187, 188, 0, 701, 685, 0, 2608, 0, 0, 0, 0, 1187, 1194, 1345, 0, 0, 0, 0, 0, 0, 0, 0, 1188, 1186, 0, 1189, 262, 1199, 1226, 1229, 0, 0, 1144, 1147, 0, 0, 0, 0, 0, 1336, 0, 0, 0, 1336, 0, 0, 0, 1345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 289, 302, 369, 0, 666, 0, 0, 0, 669, 0, 2608, 1346, 0, 0, 0, 1248, 0, 0, 0, 0, 0, 0, 0, 0, 1229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 154, 0, 0, 0, 0, 1229, 0, 0, 0, 0, 0, 0, 0, 650, 665, 653, 0, 0, 0, 0, 0, 661, 0, 0, 150, 663, 292, 640, 646, 0, 0, 0, 751, 750, 0, 0, 0, 0, 0, 0, 1434, 0, 1433, 0, 0, 0, 0, 0, 1534, 1533, 0, 0, 0, 0, 0, 1336, 0, 281, 283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 406, 407, 0, 0, 0, 154, 0, 0, 1336, 0, 294, 0, 0, 1485, 1482, 1483, 0, 1488, 0, 0, 0, 0, 2132, 0, 2300, 1772, 2298, 1162, 2350, 0, 2486, 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, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 2347, 2346, 2441, 2487, 2488, 2489, 2490, 2353, 1556, 0, 236, 237, 235, 1574, 238, 1575, 1570, 0, 1557, 0, 0, 0, 0, 0, 0, 0, 0, 2526, 2589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 866, 1505, 1543, 0, 0, 0, 694, 0, 2608, 0, 152, 905, 0, 856, 473, 0, 0, 0, 0, 1410, 152, 0, 0, 190, 0, 0, 748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 857, 0, 0, 152, 0, 2608, 643, 2608, 0, 561, 561, 0, 0, 141, 138, 0, 0, 0, 0, 0, 0, 0, 0, 1706, 1705, 1708, 1707, 0, 1704, 0, 143, 144, 0, 1236, 1261, 0, 0, 0, 0, 0, 932, 957, 0, 0, 1230, 0, 0, 2608, 145, 2608, 0, 2608, 0, 0, 0, 1238, 145, 0, 1232, 0, 0, 1234, 0, 1436, 0, 948, 946, 945, 947, 0, 0, 930, 0, 0, 0, 0, 0, 925, 0, 0, 927, 0, 0, 0, 0, 1748, 1593, 0, 1022, 0, 1026, 0, 1017, 0, 1023, 0, 1018, 1015, 1016, 0, 1021, 0, 0, 562, 568, 0, 0, 2551, 2568, 0, 2597, 2632, 2633, 2688, 2706, 2735, 2741, 2747, 0, 2778, 2790, 0, 1052, 1090, 1042, 760, 0, 0, 1666, 1459, 221, 220, 0, 240, 244, 245, 215, 243, 0, 239, 223, 2217, 2216, 222, 214, 211, 209, 227, 229, 230, 212, 210, 226, 2305, 0, 1748, 0, 0, 1276, 0, 0, 138, 255, 0, 0, 1090, 0, 2739, 1472, 1007, 685, 0, 2120, 0, 2127, 2128, 2342, 0, 0, 0, 0, 0, 0, 2126, 0, 0, 0, 0, 2399, 0, 0, 2399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2049, 0, 0, 2304, 0, 0, 2304, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2050, 2031, 2032, 2124, 2296, 0, 2125, 2452, 0, 2022, 2491, 2286, 0, 2283, 2284, 2285, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 0, 3004, 3005, 3006, 3007, 3008, 3010, 3009, 3011, 3012, 3013, 3014, 3015, 3016, 2357, 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, 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, 2064, 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, 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, 2066, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 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, 3284, 3282, 3283, 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, 3313, 3314, 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, 3342, 3341, 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, 3370, 3371, 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, 3399, 3398, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 0, 2280, 2281, 2282, 2274, 2275, 2276, 2277, 2278, 2279, 2290, 0, 0, 2431, 2492, 0, 2233, 0, 2046, 0, 2241, 0, 0, 1835, 0, 2450, 2345, 1835, 273, 274, 270, 0, 0, 0, 267, 0, 0, 0, 145, 1591, 1578, 0, 0, 2357, 0, 2294, 0, 0, 2292, 0, 0, 0, 1832, 0, 1736, 0, 1740, 0, 0, 0, 1997, 1996, 1947, 1943, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 969, 0, 1965, 0, 1900, 2474, 2475, 2355, 1768, 1591, 0, 1587, 1731, 1730, 1773, 1774, 1128, 1729, 1802, 1803, 0, 0, 0, 0, 1828, 1826, 1793, 1784, 1792, 0, 0, 1790, 0, 1794, 2026, 1821, 1718, 1778, 1779, 1782, 1717, 0, 1824, 0, 1669, 1822, 1783, 1653, 0, 1624, 0, 0, 1885, 0, 0, 1492, 0, 0, 0, 1157, 1159, 0, 1158, 0, 1161, 0, 1170, 0, 0, 1156, 1175, 0, 1164, 1162, 0, 1532, 0, 0, 0, 0, 0, 1512, 0, 0, 0, 0, 2778, 259, 1515, 1520, 1507, 1518, 0, 0, 0, 0, 0, 1092, 1091, 0, 0, 0, 1539, 553, 0, 371, 0, 0, 0, 0, 0, 0, 0, 0, 852, 849, 0, 0, 848, 0, 699, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 724, 0, 1336, 0, 300, 0, 1196, 0, 1195, 0, 1200, 0, 0, 1197, 1192, 1193, 2741, 261, 1198, 1228, 0, 1227, 1223, 0, 1139, 0, 1140, 0, 0, 0, 0, 0, 0, 0, 2581, 0, 2608, 0, 0, 516, 308, 332, 543, 0, 1335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 355, 0, 0, 358, 357, 0, 0, 0, 0, 0, 363, 0, 341, 0, 342, 0, 362, 0, 0, 0, 667, 668, 0, 0, 0, 1336, 0, 296, 0, 0, 0, 0, 0, 0, 0, 0, 1245, 0, 777, 0, 0, 2741, 1224, 0, 1419, 0, 2777, 1420, 1423, 561, 0, 561, 1425, 0, 0, 1422, 1424, 0, 0, 176, 0, 171, 175, 0, 0, 2741, 1225, 0, 0, 0, 0, 0, 648, 649, 664, 0, 654, 655, 651, 656, 657, 0, 0, 0, 0, 0, 0, 0, 647, 0, 0, 746, 745, 749, 0, 0, 0, 0, 0, 0, 1428, 0, 0, 1219, 0, 0, 1427, 1435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1279, 1278, 0, 0, 0, 0, 1346, 0, 895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 764, 0, 763, 0, 172, 177, 0, 0, 0, 0, 0, 0, 0, 0, 234, 1481, 1487, 1772, 1772, 1772, 2138, 0, 0, 0, 0, 1771, 2348, 2351, 1561, 1567, 1560, 1559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 420, 417, 418, 420, 0, 0, 0, 0, 868, 0, 871, 874, 1503, 500, 0, 0, 691, 724, 0, 0, 476, 185, 0, 0, 0, 0, 779, 0, 1219, 1218, 147, 138, 194, 474, 0, 193, 195, 197, 198, 199, 196, 200, 0, 743, 747, 0, 0, 0, 0, 687, 0, 0, 0, 0, 0, 0, 0, 1905, 0, 0, 170, 0, 0, 638, 642, 0, 0, 0, 0, 476, 604, 382, 2608, 0, 561, 0, 2608, 0, 137, 0, 855, 0, 0, 0, 1181, 1181, 0, 0, 793, 792, 0, 0, 0, 0, 0, 0, 1703, 145, 1179, 0, 1526, 0, 145, 972, 145, 1143, 184, 2469, 0, 934, 0, 0, 0, 0, 145, 1247, 922, 145, 180, 145, 145, 690, 0, 145, 182, 0, 0, 145, 966, 145, 2439, 0, 145, 1617, 2608, 561, 1595, 1019, 1028, 1027, 1025, 1024, 1020, 0, 1039, 0, 560, 0, 0, 0, 0, 0, 1060, 1061, 0, 0, 1057, 1062, 0, 1064, 1048, 1050, 1058, 1059, 1065, 1054, 1053, 1066, 1067, 0, 0, 0, 1079, 758, 0, 0, 0, 0, 1663, 0, 1661, 0, 1883, 1665, 1654, 224, 0, 2022, 0, 1607, 0, 1606, 0, 631, 1270, 1269, 1271, 0, 1036, 0, 145, 0, 1471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2309, 0, 2310, 0, 0, 2341, 2337, 0, 0, 0, 0, 0, 2313, 2316, 2317, 2318, 2315, 2319, 2314, 0, 0, 2320, 0, 0, 2392, 2409, 0, 2124, 2392, 2420, 0, 2419, 2425, 0, 2300, 2026, 0, 0, 2416, 2410, 0, 2416, 0, 0, 2399, 0, 0, 0, 0, 2201, 0, 0, 0, 2300, 2303, 0, 0, 2865, 0, 0, 0, 0, 2096, 0, 0, 2267, 0, 2300, 0, 0, 0, 0, 0, 0, 0, 2296, 2335, 0, 514, 0, 2086, 0, 0, 0, 2215, 0, 2212, 0, 0, 0, 0, 2354, 0, 0, 2453, 2027, 2042, 2043, 2044, 2047, 2430, 2030, 0, 2356, 0, 0, 2028, 2055, 0, 2080, 0, 2087, 2070, 2400, 2321, 2322, 2323, 2324, 2089, 0, 2063, 2068, 2072, 0, 2409, 2051, 0, 2048, 0, 2357, 2295, 0, 2293, 0, 2039, 2040, 2041, 2033, 2034, 2035, 2036, 2037, 2038, 2045, 2271, 2269, 2270, 0, 0, 2241, 0, 0, 2067, 0, 0, 2140, 2600, 2639, 0, 1761, 1761, 1761, 1749, 1759, 2429, 1900, 1772, 1900, 2435, 0, 1881, 974, 975, 973, 1563, 1577, 1591, 2297, 1585, 1738, 0, 0, 0, 1966, 1979, 0, 2006, 2007, 2008, 2008, 0, 1948, 0, 1991, 2016, 2017, 2018, 2019, 2020, 2021, 0, 2015, 1957, 970, 2841, 2850, 0, 2737, 2885, 0, 1861, 1834, 1836, 1846, 1861, 1868, 1861, 1861, 2142, 1898, 2143, 2144, 2436, 0, 1805, 2471, 1565, 1589, 0, 1126, 1127, 0, 1131, 2865, 2737, 0, 0, 0, 0, 1795, 1829, 0, 1820, 0, 2446, 1796, 2445, 1797, 1800, 1801, 1791, 1830, 1667, 0, 1825, 1722, 1721, 0, 1903, 0, 0, 0, 1638, 1626, 0, 0, 1886, 0, 1835, 1671, 0, 2354, 1833, 1386, 1280, 1347, 1160, 0, 1967, 1171, 0, 1155, 0, 1154, 1967, 0, 1172, 0, 1967, 1387, 1281, 1348, 1388, 1282, 1349, 1389, 1523, 1283, 1522, 1510, 1509, 1508, 0, 0, 0, 0, 0, 0, 0, 0, 831, 2608, 145, 1537, 1390, 0, 1284, 370, 1538, 1350, 1542, 851, 850, 0, 0, 1351, 0, 700, 705, 0, 707, 708, 2526, 2589, 709, 712, 713, 0, 715, 704, 703, 0, 0, 0, 0, 0, 721, 726, 0, 0, 0, 0, 0, 0, 1190, 1191, 1391, 1287, 0, 1352, 0, 1138, 0, 1288, 186, 0, 0, 288, 0, 2608, 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 831, 498, 831, 0, 1338, 307, 339, 0, 354, 349, 350, 348, 2608, 145, 2608, 145, 0, 0, 0, 0, 0, 351, 346, 347, 343, 0, 0, 356, 2498, 2570, 2752, 0, 732, 734, 0, 739, 359, 1308, 378, 377, 376, 0, 364, 0, 383, 386, 0, 361, 340, 338, 335, 303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1240, 0, 1394, 1353, 0, 1375, 1379, 0, 0, 0, 771, 1397, 1294, 1356, 0, 561, 0, 0, 580, 580, 561, 1408, 1295, 174, 1325, 163, 0, 0, 159, 0, 0, 0, 0, 153, 1398, 1296, 1357, 0, 0, 1399, 1297, 0, 0, 293, 641, 652, 658, 1302, 662, 659, 1365, 660, 1406, 1298, 0, 1402, 1328, 1360, 396, 624, 395, 1219, 1219, 1409, 1429, 1299, 1219, 0, 1336, 0, 282, 284, 0, 142, 0, 1300, 0, 1358, 1401, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1545, 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, 1338, 2608, 145, 893, 1400, 0, 1333, 0, 1373, 0, 0, 0, 408, 0, 1326, 1336, 0, 295, 1304, 0, 1367, 0, 0, 232, 231, 233, 0, 0, 0, 0, 2301, 2302, 0, 2299, 2133, 2350, 0, 1555, 996, 982, 995, 0, 978, 2568, 0, 981, 983, 0, 0, 0, 984, 988, 989, 0, 980, 977, 979, 0, 419, 0, 0, 788, 789, 0, 0, 0, 0, 870, 0, 0, 1535, 0, 150, 698, 0, 0, 0, 693, 723, 728, 0, 0, 0, 0, 475, 479, 483, 484, 485, 0, 0, 0, 0, 164, 151, 0, 911, 0, 561, 0, 781, 1219, 1412, 0, 194, 189, 0, 0, 744, 0, 1586, 0, 0, 619, 622, 621, 0, 382, 865, 863, 862, 864, 886, 861, 0, 1904, 1906, 0, 0, 0, 0, 0, 0, 631, 478, 0, 0, 568, 0, 607, 0, 0, 0, 0, 604, 0, 0, 0, 2479, 0, 882, 854, 0, 1149, 0, 1167, 1150, 0, 0, 0, 0, 1204, 1211, 1180, 1205, 1182, 1211, 0, 0, 794, 798, 797, 801, 799, 0, 795, 672, 1709, 1710, 0, 1237, 0, 0, 1531, 0, 1529, 933, 1231, 145, 0, 145, 0, 145, 1239, 1233, 1235, 1437, 0, 931, 0, 0, 924, 926, 0, 928, 0, 1040, 563, 0, 0, 0, 0, 0, 0, 1056, 670, 1063, 0, 0, 0, 1078, 1073, 1075, 0, 1090, 1084, 0, 757, 0, 0, 1664, 1657, 1659, 1658, 0, 0, 1655, 0, 241, 228, 2306, 923, 0, 637, 0, 1090, 1081, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1766, 2307, 2308, 0, 0, 0, 2338, 0, 0, 2177, 0, 2148, 2150, 2163, 0, 2178, 2131, 0, 2391, 2388, 0, 0, 0, 2392, 2399, 2197, 0, 0, 0, 2399, 0, 2419, 0, 0, 0, 2192, 2194, 0, 0, 0, 2409, 2409, 0, 2199, 0, 0, 2179, 2152, 2154, 2164, 0, 0, 2287, 0, 2167, 2166, 0, 2098, 2099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 2168, 2266, 0, 0, 0, 2170, 2169, 0, 0, 2334, 0, 0, 0, 2175, 515, 2180, 0, 0, 0, 0, 2186, 0, 2223, 0, 0, 0, 2121, 2297, 0, 0, 0, 0, 0, 0, 0, 2402, 2403, 2404, 2401, 0, 2088, 2071, 2091, 2065, 2069, 2073, 0, 2409, 2090, 2093, 0, 0, 2059, 0, 0, 2057, 0, 2082, 2053, 0, 0, 2084, 0, 2139, 0, 0, 0, 2244, 2239, 2240, 1761, 1761, 1761, 1761, 1758, 0, 0, 0, 1805, 0, 1805, 207, 1562, 1739, 1748, 1985, 0, 2003, 2001, 1944, 1949, 2024, 0, 1861, 1868, 1861, 1861, 0, 0, 1724, 0, 1846, 0, 1860, 1844, 1859, 0, 0, 1874, 1872, 0, 1874, 0, 1874, 0, 1838, 0, 1864, 1840, 1859, 1842, 1848, 0, 1890, 2437, 1899, 0, 1818, 1775, 0, 2288, 1131, 0, 1777, 1799, 1798, 0, 1788, 0, 1827, 1785, 1668, 1652, 0, 1643, 1630, 1632, 1631, 0, 0, 1633, 2354, 0, 1643, 1625, 0, 1676, 0, 0, 1903, 0, 1675, 0, 1967, 1152, 1153, 0, 1176, 0, 1095, 1096, 0, 1094, 0, 0, 0, 552, 555, 0, 1540, 0, 1407, 1324, 702, 0, 0, 0, 0, 717, 676, 718, 720, 0, 0, 719, 722, 725, 1336, 0, 301, 1310, 0, 1371, 1184, 0, 0, 1141, 0, 0, 0, 0, 0, 1112, 542, 1111, 0, 0, 0, 831, 0, 831, 0, 0, 547, 0, 497, 494, 334, 333, 0, 0, 0, 0, 391, 0, 312, 325, 389, 331, 0, 366, 0, 337, 0, 329, 352, 344, 353, 345, 365, 367, 0, 736, 737, 735, 731, 0, 738, 740, 0, 380, 0, 0, 0, 398, 360, 397, 0, 1393, 0, 1336, 0, 297, 1306, 0, 1369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1374, 0, 0, 0, 0, 776, 0, 773, 0, 580, 0, 1421, 0, 1418, 1416, 580, 0, 0, 156, 155, 0, 162, 0, 0, 0, 0, 0, 0, 1430, 1431, 1432, 0, 0, 0, 0, 0, 0, 402, 0, 304, 306, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 409, 373, 0, 889, 0, 0, 0, 411, 0, 0, 1385, 0, 0, 0, 0, 0, 1392, 1289, 2136, 2137, 2134, 1772, 2349, 0, 0, 0, 993, 0, 0, 0, 0, 422, 423, 150, 421, 446, 0, 831, 0, 0, 867, 872, 880, 2678, 2274, 2275, 878, 873, 875, 877, 879, 876, 0, 0, 0, 0, 522, 526, 0, 0, 0, 506, 0, 0, 516, 499, 502, 503, 0, 0, 694, 697, 695, 696, 0, 716, 0, 478, 531, 594, 0, 166, 0, 0, 167, 165, 0, 0, 382, 778, 0, 775, 1411, 0, 192, 0, 748, 0, 0, 0, 0, 0, 1219, 686, 0, 885, 887, 859, 0, 728, 0, 0, 643, 0, 561, 1618, 626, 0, 596, 478, 594, 603, 0, 0, 611, 381, 0, 0, 631, 382, 0, 0, 1112, 0, 881, 0, 0, 1148, 0, 0, 0, 1201, 1206, 1202, 0, 1181, 1163, 0, 1203, 0, 0, 1209, 1134, 1183, 1135, 1453, 1454, 1451, 1452, 0, 0, 0, 0, 0, 0, 1700, 0, 0, 1527, 0, 935, 0, 918, 0, 920, 145, 765, 0, 145, 0, 0, 0, 0, 0, 0, 1055, 0, 1049, 1051, 1076, 0, 0, 1090, 1089, 0, 1080, 1088, 1086, 1087, 1085, 0, 0, 1662, 1660, 0, 629, 0, 0, 145, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2311, 0, 2340, 2336, 0, 2145, 2312, 2390, 2406, 2408, 2198, 2398, 0, 0, 0, 2421, 0, 0, 2399, 2359, 2413, 2412, 0, 0, 2411, 2399, 2399, 2359, 2200, 2359, 0, 0, 0, 2267, 0, 0, 2097, 2109, 2110, 2111, 2327, 0, 2116, 0, 2106, 2107, 2108, 2100, 2101, 2102, 2103, 2104, 2105, 2112, 2331, 2330, 0, 0, 2172, 2173, 2174, 2333, 2181, 0, 2516, 2224, 0, 2185, 2214, 2213, 0, 0, 0, 2188, 0, 0, 2210, 0, 2268, 2454, 2029, 0, 0, 2056, 2081, 2074, 0, 2092, 2094, 2052, 2287, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 2264, 0, 0, 0, 2246, 2243, 0, 0, 0, 0, 1752, 1751, 1757, 1818, 2133, 1818, 0, 1945, 0, 1845, 1841, 1843, 1849, 0, 2880, 0, 1850, 1857, 0, 1837, 0, 1873, 1869, 0, 1870, 0, 0, 1871, 0, 0, 1839, 0, 1857, 0, 1897, 1764, 0, 2235, 0, 1776, 1129, 1130, 1786, 0, 1789, 2547, 1901, 1645, 1651, 0, 0, 0, 1635, 1641, 1623, 0, 0, 0, 1672, 1643, 1673, 1173, 0, 0, 1165, 1101, 0, 1102, 1105, 1103, 1100, 1104, 0, 0, 0, 831, 834, 840, 0, 0, 0, 832, 145, 1285, 0, 0, 0, 0, 677, 1405, 1286, 0, 0, 0, 0, 1185, 1339, 0, 0, 1309, 831, 0, 0, 0, 575, 0, 1125, 1125, 565, 309, 545, 559, 549, 616, 559, 496, 495, 0, 493, 728, 0, 0, 316, 326, 0, 321, 0, 1337, 0, 0, 0, 0, 320, 323, 322, 393, 0, 390, 0, 145, 145, 368, 733, 379, 384, 385, 388, 1344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 897, 0, 0, 913, 914, 0, 0, 0, 1242, 1243, 1241, 1376, 1377, 1383, 1380, 1378, 1382, 1384, 1381, 0, 1292, 0, 0, 769, 1340, 1413, 1415, 1414, 0, 1417, 160, 157, 158, 161, 1341, 1322, 1303, 1366, 625, 0, 0, 0, 1301, 0, 1359, 0, 1318, 1312, 0, 0, 0, 0, 0, 1404, 1332, 1364, 1403, 1330, 1362, 1329, 1361, 1331, 1363, 1323, 0, 0, 1908, 894, 0, 0, 0, 145, 145, 892, 767, 1305, 0, 1368, 1314, 0, 0, 0, 985, 0, 0, 0, 987, 427, 447, 150, 0, 787, 853, 0, 0, 869, 0, 504, 0, 510, 517, 0, 0, 524, 525, 523, 527, 557, 1219, 561, 1219, 820, 821, 0, 0, 843, 0, 692, 0, 0, 476, 0, 528, 0, 0, 480, 169, 168, 0, 0, 0, 782, 786, 784, 783, 785, 780, 0, 771, 194, 2608, 0, 0, 0, 0, 623, 617, 620, 1426, 860, 0, 1907, 761, 0, 382, 639, 0, 0, 0, 476, 631, 0, 481, 486, 487, 500, 0, 604, 595, 0, 596, 605, 606, 0, 613, 1501, 0, 632, 613, 0, 0, 0, 884, 0, 883, 0, 1151, 1168, 1169, 0, 0, 1211, 0, 0, 1213, 1208, 0, 0, 800, 803, 796, 679, 145, 0, 1530, 145, 145, 1268, 0, 929, 1070, 1071, 1072, 1069, 1068, 671, 0, 1074, 1033, 1083, 759, 0, 242, 630, 0, 1034, 145, 1010, 1002, 1009, 998, 1001, 1003, 0, 1005, 1006, 1000, 997, 999, 2339, 2162, 0, 2405, 2407, 2196, 2418, 2417, 2195, 2424, 0, 0, 2387, 2415, 2414, 0, 0, 2399, 2399, 2165, 2176, 0, 2266, 2297, 0, 0, 2117, 0, 0, 0, 2171, 2875, 0, 0, 2228, 2229, 0, 2225, 2226, 2221, 2222, 2187, 0, 2665, 2205, 0, 0, 2220, 2078, 2076, 2075, 2060, 0, 0, 2058, 2083, 2054, 0, 2085, 2230, 2263, 2297, 2232, 0, 1772, 1756, 1755, 1754, 1753, 2235, 2451, 2235, 1743, 0, 1893, 0, 1896, 0, 0, 1847, 0, 0, 1851, 0, 0, 1853, 1855, 0, 0, 0, 0, 0, 0, 2440, 0, 1817, 0, 1772, 0, 1787, 0, 0, 0, 1627, 0, 1628, 1634, 0, 0, 0, 0, 0, 1677, 1670, 1166, 1174, 1106, 0, 0, 0, 554, 836, 835, 838, 833, 839, 837, 1541, 0, 710, 711, 714, 1311, 0, 1372, 1320, 0, 1666, 544, 311, 0, 570, 0, 0, 0, 1118, 140, 1117, 0, 0, 0, 0, 0, 492, 491, 500, 319, 0, 0, 0, 313, 392, 0, 394, 314, 318, 373, 336, 328, 0, 0, 0, 1307, 0, 1370, 1316, 1343, 1395, 1290, 1354, 0, 0, 903, 0, 0, 0, 0, 1396, 1291, 1355, 0, 0, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 0, 0, 0, 1550, 0, 0, 372, 891, 890, 373, 410, 1334, 0, 2135, 0, 986, 991, 992, 990, 0, 416, 424, 427, 0, 0, 1259, 1259, 0, 0, 501, 518, 0, 0, 505, 615, 574, 615, 0, 0, 0, 0, 0, 729, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 774, 773, 191, 0, 476, 0, 728, 0, 888, 0, 0, 0, 631, 478, 0, 0, 1615, 477, 0, 0, 489, 0, 607, 596, 604, 0, 0, 628, 0, 1494, 0, 634, 0, 0, 0, 830, 1207, 0, 1221, 0, 1162, 1132, 1216, 0, 1748, 1900, 0, 0, 0, 0, 813, 0, 683, 1260, 1528, 919, 921, 766, 1077, 0, 1090, 1082, 1004, 2389, 2423, 2358, 2360, 0, 0, 2381, 2374, 2377, 2375, 2376, 2378, 0, 2373, 0, 2193, 2422, 2371, 2385, 2326, 2268, 2114, 0, 2329, 2328, 2332, 0, 2182, 0, 2183, 2227, 2189, 2206, 0, 2190, 2218, 0, 0, 2079, 2077, 2062, 2265, 0, 2250, 1726, 1725, 0, 1746, 1929, 1898, 0, 0, 1892, 0, 0, 1923, 0, 0, 0, 1858, 1876, 0, 1854, 1852, 0, 1865, 0, 1867, 2546, 2836, 2734, 0, 1804, 1806, 1809, 1811, 1810, 1812, 1808, 2234, 2236, 0, 1783, 2289, 1902, 0, 1642, 0, 0, 0, 1113, 0, 0, 1643, 1679, 1691, 1691, 1674, 1078, 0, 145, 706, 0, 0, 290, 1125, 0, 1219, 576, 2678, 577, 1124, 1128, 139, 2695, 0, 558, 570, 570, 488, 0, 317, 327, 0, 375, 387, 0, 1666, 0, 0, 901, 910, 910, 898, 0, 0, 915, 1293, 770, 0, 579, 0, 285, 1319, 1313, 0, 0, 0, 1552, 1553, 0, 0, 0, 0, 0, 1342, 145, 1315, 994, 0, 449, 457, 428, 432, 1544, 0, 1544, 0, 429, 433, 1544, 1544, 426, 1900, 445, 1259, 0, 1256, 1255, 557, 645, 0, 556, 0, 508, 0, 585, 507, 0, 844, 0, 0, 727, 0, 478, 594, 0, 541, 532, 533, 534, 535, 537, 536, 538, 539, 540, 530, 529, 0, 728, 907, 382, 1501, 768, 0, 0, 741, 0, 728, 0, 1618, 627, 596, 478, 594, 482, 500, 0, 611, 604, 607, 0, 608, 0, 612, 0, 0, 0, 631, 1554, 1112, 0, 0, 831, 1220, 1181, 0, 0, 1210, 1214, 1215, 0, 0, 0, 0, 1263, 807, 808, 802, 804, 0, 815, 819, 678, 0, 0, 682, 673, 728, 145, 0, 0, 2372, 2379, 2380, 0, 2203, 0, 0, 2397, 0, 0, 0, 2115, 0, 0, 2208, 2207, 2219, 2191, 2245, 0, 0, 0, 0, 0, 0, 0, 1737, 0, 2359, 1891, 1894, 0, 1926, 0, 0, 0, 0, 1911, 0, 1856, 0, 0, 1866, 0, 0, 0, 1813, 0, 0, 0, 1822, 1650, 1649, 0, 1646, 0, 0, 1640, 1900, 0, 1637, 0, 1686, 0, 1678, 1680, 0, 0, 0, 1097, 0, 1098, 1321, 0, 1119, 0, 615, 0, 1131, 1128, 564, 0, 1219, 1219, 645, 0, 0, 330, 0, 298, 1317, 0, 0, 899, 900, 0, 0, 0, 0, 0, 0, 404, 0, 0, 1546, 0, 1547, 1548, 1551, 412, 425, 0, 455, 454, 0, 452, 451, 453, 0, 442, 0, 0, 0, 0, 0, 0, 415, 1254, 1258, 1257, 509, 0, 511, 0, 0, 571, 572, 573, 0, 513, 581, 582, 841, 0, 846, 0, 730, 0, 0, 728, 593, 752, 0, 0, 0, 1495, 0, 0, 618, 762, 1501, 631, 604, 0, 596, 490, 0, 613, 607, 611, 609, 610, 0, 1498, 0, 633, 0, 1121, 829, 0, 1211, 1222, 1217, 1212, 1457, 0, 0, 805, 810, 809, 1544, 814, 0, 0, 0, 681, 680, 756, 1035, 2361, 2362, 2386, 0, 0, 0, 2365, 0, 2363, 0, 0, 2385, 0, 2204, 2325, 2211, 2184, 2209, 2823, 2547, 2793, 0, 2262, 2251, 2262, 2262, 2242, 0, 0, 0, 1928, 0, 0, 0, 1924, 1925, 1909, 0, 0, 1913, 1863, 1889, 0, 0, 0, 1807, 2237, 2238, 2470, 1644, 0, 0, 1629, 1639, 1114, 0, 1688, 1690, 0, 0, 0, 1666, 0, 580, 0, 1115, 1131, 567, 615, 615, 324, 315, 374, 0, 0, 0, 908, 917, 916, 772, 1666, 0, 400, 399, 0, 403, 0, 450, 460, 0, 458, 430, 435, 0, 441, 440, 437, 436, 431, 434, 0, 521, 0, 0, 0, 0, 583, 0, 584, 0, 845, 0, 0, 0, 754, 906, 0, 0, 476, 728, 1496, 1616, 607, 596, 604, 0, 0, 598, 1125, 1125, 463, 611, 613, 1499, 1500, 0, 0, 516, 0, 1133, 1456, 1455, 1748, 0, 0, 0, 816, 817, 812, 0, 0, 2366, 0, 2369, 0, 2370, 2364, 2394, 2396, 0, 2382, 2383, 0, 2255, 2254, 2253, 2257, 2256, 0, 2249, 2247, 2248, 0, 0, 0, 0, 1895, 0, 1912, 1915, 0, 0, 0, 1921, 0, 1914, 1916, 0, 1875, 0, 1887, 1815, 0, 1814, 1647, 1648, 1900, 0, 1693, 0, 0, 1681, 1682, 0, 0, 1683, 145, 291, 569, 831, 578, 1116, 0, 574, 831, 831, 1666, 902, 0, 286, 0, 405, 1549, 456, 0, 439, 438, 644, 519, 520, 512, 614, 590, 0, 589, 0, 587, 586, 842, 847, 0, 728, 896, 1501, 742, 611, 604, 607, 0, 597, 0, 140, 140, 613, 461, 0, 0, 382, 0, 1439, 1748, 1438, 1440, 1448, 1445, 1447, 1446, 1444, 0, 1266, 1267, 806, 811, 0, 0, 2367, 2368, 0, 0, 2202, 0, 0, 0, 2259, 0, 2260, 0, 0, 0, 0, 0, 1918, 1919, 1920, 1922, 1917, 1862, 0, 1816, 1636, 1687, 1689, 1684, 0, 1685, 0, 0, 0, 0, 1694, 1099, 550, 565, 585, 548, 546, 299, 909, 0, 459, 588, 561, 561, 728, 753, 1497, 613, 607, 611, 1125, 599, 601, 600, 465, 1121, 1122, 0, 613, 819, 0, 1449, 1443, 1724, 1711, 0, 0, 818, 0, 0, 0, 0, 2252, 2258, 2261, 0, 0, 0, 0, 2658, 0, 1930, 0, 0, 0, 1692, 1698, 0, 0, 0, 0, 831, 0, 592, 591, 755, 464, 611, 613, 140, 516, 1120, 0, 1900, 0, 1441, 1748, 0, 0, 824, 2393, 2395, 2384, 1742, 1741, 2841, 0, 0, 1745, 1938, 0, 2387, 0, 0, 1941, 0, 1888, 0, 0, 0, 566, 551, 401, 613, 462, 602, 382, 1123, 1107, 0, 1442, 0, 0, 826, 0, 822, 825, 827, 828, 0, 0, 0, 0, 1931, 1932, 1941, 0, 2371, 1941, 1910, 1695, 1699, 0, 1696, 466, 613, 0, 0, 0, 790, 0, 1772, 0, 0, 0, 1927, 2387, 1940, 2397, 2371, 0, 1900, 0, 0, 0, 823, 0, 0, 0, 0, 1935, 2385, 2397, 0, 1108, 824, 1264, 1265, 0, 1744, 0, 0, 1933, 2385, 1697, 0, 0, 1936, 1934, 791, 0, 1937 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -5973, -5973, -5973, 4153, -442, -1752, -5179, -1158, -630, -5973, -5973, -952, 343, 3366, -1733, -5973, -5973, -5973, -506, -5973, -5973, -5973, -5973, 4139, -5973, -2984, -5973, -5973, 183, 777, 63, 62, 3826, 1848, -5973, -1015, -5973, -5973, -638, 1, -5973, 153, 733, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -857, 2115, -5973, 2213, 1442, -3190, -5973, -5973, -1556, -3809, -5973, 691, -5973, 720, -4192, -5973, -4930, -994, -5973, -5973, -5973, 2104, -5973, -5973, -5973, 2048, 1240, -340, -5973, -5973, -5973, -5973, -5973, -5973, -813, -5973, -5973, -1124, 5, -661, -2998, -4363, -5973, -5973, 541, -381, -1520, -5973, 736, -5973, 738, -5973, -4915, -5973, 36, -2800, -2486, -5973, -5973, -5973, -5973, -352, -1544, 1483, -5973, 1546, -596, 188, -780, -1151, -1199, -5973, -3104, -2691, -1099, -5973, -236, -3624, -1195, -823, -821, -983, -4423, -4956, -5973, -5973, -1128, -3842, -5258, -5518, -5001, -5215, 1493, -5973, 17, 545, -5973, 12, -3714, -3804, 34, 520, -5973, 40, 42, -5973, 536, -756, -1017, -1615, -5973, -481, -5973, -5973, -5973, -3508, -5973, -5973, -5973, 179, -5973, -5973, -5973, -5973, 581, -5973, -5973, -5973, -5973, -5973, -5973, -3247, 2078, 2079, -5973, -4475, -5973, -960, -5973, 745, -3561, 1474, -5973, -5973, 1233, 4145, 567, -5973, -5973, -5973, -5973, -5973, -5973, -1804, -5973, -5973, -5973, -5973, 32, -316, -5973, -5973, -5973, -5973, -5973, -5973, -5973, 44, -5973, 1203, 510, -5973, -5973, -633, -5973, -5973, -5973, -5973, -5973, -5973, -1183, -5278, -1318, -1292, -5973, -3532, -5973, -5973, -5973, -291, -5973, -5973, -5973, -5973, -5973, -955, -5973, 1295, -4214, -5973, -5973, 546, -5973, -5973, -5973, -5973, -5973, -953, -230, 3307, -5973, -495, -5973, -5973, -5973, -226, -5973, -5973, -5973, -5973, -5973, -509, -1290, 5176, 4532, -1166, 15810, -892, -586, -5973, -5973, -5973, -2787, -5973, -5973, -4322, -5973, 5175, 2602, 329, 45, -5973, -31, 115, 3969, -5973, 1164, -1202, -3178, 508, -446, -5973, -5973, -5973, 507, -5973, -2017, -5973, -5973, -5973, -5973, -4180, 46, -5973, -4440, -5289, -4704, -4236, -1150, -5973, -4339, -5262, -4147, -5973, 2114, -5973, -5973, -545, -141, 3306, -5973, -1508, 2459, -1425, -5973, -2645, 571, 1649, 3295, -3323, -106, 3320, -3053, -5973, -718, 1232, -5973, -315, -3870, -5973, -5973, -5973, -2861, -578, -5973, -5973, 1651, 483, -5973, -5973, -5973, -5973, -685, 3311, -209, -5973, -5973, 4505, -5973, -5066, -5973, 4478, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -1504, 1403, -5973, -845, -5973, -5973, 2217, 779, -5973, -5973, -5973, -5973, 1492, -1228, -5973, -5973, -5973, -5973, -5973, -5973, -5973, -932, -1174, -5973, -5973, -5750, -5973, -5973, -5973, -5973, -5973, 2509, -968, -760, 4378, -248, 47, -5467, -5973, -5973, -1178, -5973, 3694, -5973, -5973, -5973, -5973, -5973, 568, 565, -5973, -5973, -5973, -5973, -4504, -5973, -5973, -5105, -5973, -5973, 2198, -5973, -5973, 1066, 14, 3406, -5973, -5973, -5973, -8, -5973, -5973, -1030, 2547, -5973, -2417, -5973, -594, -5973, -5973, -1944, 52, -4426, -5973, 13, -5973, -5973, -5158, -1089, 360, -5973, -5973, -4138, -5973, -5973, -827, -5973, 56, -5973, -5973, -5973, -5973, -5093, -5973, 57, -4807, 933, -3397, -5973, 15, -5973, -396, -5973, -5973, -397, -5973, -5973, -5973, -4239, 53, 224, -5973, -5973, 11, 7001, -47, -30, -26, 7, 171, 3822, -5973, -5973, -5973, -5119, 3843, -5973, 8, -886, 5214, 5223, -5973, -879, -165, 522, 1760, -693, -2650, 3771, 3773, -5973, 1746, 2563, -2491, -2489, -5973, -1047, -795, -599, -5973, -5973, -5973, -5973, -1623, -690, -2657, -5973, 3774, -5973, -5973, -5973, -2415, -3429, -3299, 1791, -3335, -3207, -5973, 1029, 1010, -1032, -40, 20, -1505, -797, 1750, -5973, -5973, 1800, -317, -5973, -5973, -314, -3342, 972, -5973, -4652, -2860, 1805, -1096, -770, -5973, -915, -5973, -563, 1813, -5973, -4086, -1127, -5973, -3707, 4964, 3848, -836, -5973, -5973, -803, 10189, -5973, -5973, -5973, 11126, 11405, -5973, -5973, 12389, 12772, -5973, -595, 13494, 8455, -794, -1959, 24, 13758, 17367, -1945, -378, 129, -5973, -2884, -1678, -5973, -5973, -5973, -278, 1127, 664, -5973, -5973, -4703, -4484, -5973, 2680, -2058, -5973, -566, 1881, -565, -5973, -5973, -5973, -2755, -5661, -2765, 2688, -5973, -5973, -5973, -185, -5973, 18362, -3298, -5973, -748, -1031, -1622, 3189, -3069, -1955, -5973, -5973, -5973, -3164, -5973, -5973, -5973, -675, -5973, -5973, 2031, -5973, -5973, -5973, -981, 2273, -762, -1220, 1910, -4568, -5973, -505, -4405, -5068, -5973, -5607, -4728, -1861, -1106, -3081, -5972, -1964, 1925, -3153, -5973, -1960, 2009, 1214, -5973, -1054, -5973, 4402, -839, 2699, -849, 14370, -687, 10408, -1307, -5973, 4469, -5893, 3442, 6211, 39, -115, 275, -659, 2633, 3233, -5973, -5973, -6, 10092, -559, -1013, -5973, 5262, 16925, 16304, -3746, -5973 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 58, 59, 60, 61, 1119, 1124, 1930, 1949, 62, 63, 1651, 3088, 2941, 3917, 3918, 64, 65, 1647, 66, 67, 68, 69, 1561, 70, 1902, 3102, 71, 2775, 826, 863, 828, 2062, 2063, 3033, 2064, 2052, 1253, 1848, 1583, 843, 1255, 1543, 1584, 73, 74, 1417, 2641, 75, 76, 77, 1614, 1709, 1615, 1616, 1555, 5065, 5915, 3703, 2896, 3965, 3704, 3705, 4396, 4397, 3783, 4425, 4487, 5929, 5930, 78, 1725, 1726, 79, 80, 3070, 3883, 4540, 5459, 5460, 5727, 673, 5088, 5089, 5714, 5715, 5944, 6116, 6117, 3103, 704, 3960, 4625, 3908, 5160, 3909, 5161, 3910, 5162, 4955, 4956, 4385, 4386, 3894, 4572, 4573, 2128, 5101, 6257, 4574, 3911, 5121, 5762, 3912, 2862, 2790, 2791, 5472, 5389, 3137, 2021, 5387, 6240, 2019, 5662, 5741, 4940, 4941, 4461, 5967, 5968, 5969, 6263, 5123, 5166, 5167, 6153, 6154, 3963, 4631, 5173, 5519, 5739, 3661, 82, 3936, 3937, 83, 767, 1924, 4067, 768, 3140, 705, 769, 3104, 88, 3130, 5960, 3131, 1679, 2955, 4553, 4040, 89, 1147, 4348, 5544, 5822, 5823, 758, 90, 1910, 91, 92, 3083, 3901, 93, 2808, 3608, 94, 95, 3627, 3628, 3629, 96, 4582, 5480, 1617, 3692, 3693, 3694, 3695, 4417, 97, 1905, 3111, 3112, 98, 99, 100, 3242, 3243, 101, 3019, 102, 103, 104, 105, 4455, 5022, 5137, 3734, 3924, 4598, 5135, 106, 3887, 3105, 3158, 3998, 3999, 5542, 5814, 5815, 5816, 6018, 6298, 5818, 6020, 6175, 6022, 5112, 6450, 6451, 5799, 4337, 4918, 108, 5113, 5114, 5973, 109, 2806, 110, 111, 1879, 3076, 3077, 4554, 3147, 3973, 3974, 4611, 4612, 112, 3823, 113, 4998, 4999, 706, 5981, 5921, 114, 115, 5002, 5003, 116, 117, 118, 119, 120, 759, 1081, 1082, 761, 1202, 1203, 3569, 1164, 121, 2649, 122, 3863, 123, 1296, 5227, 124, 793, 1218, 1219, 3106, 126, 803, 3265, 805, 3226, 3227, 2037, 4044, 4045, 4699, 127, 128, 4048, 4049, 4706, 3239, 129, 1548, 2785, 2786, 4909, 3107, 707, 3654, 5644, 5383, 5645, 6164, 6363, 5384, 3513, 4293, 131, 708, 1589, 2845, 1170, 1171, 3151, 3978, 2754, 2755, 1748, 4652, 2757, 3980, 2758, 1521, 2759, 1157, 1158, 3986, 3987, 3988, 3989, 4648, 4658, 4659, 5536, 5807, 4655, 1898, 5530, 5531, 132, 1586, 2842, 133, 134, 135, 1630, 1005, 1180, 1181, 136, 720, 721, 137, 5732, 138, 1160, 139, 5540, 140, 141, 1282, 1283, 835, 142, 143, 2866, 4399, 144, 1587, 145, 146, 3728, 3729, 5014, 147, 148, 149, 2927, 2928, 150, 151, 152, 153, 154, 6288, 6366, 6367, 6368, 4666, 6169, 155, 1250, 156, 157, 158, 159, 197, 1046, 1047, 1048, 958, 3108, 5521, 161, 162, 1544, 1545, 1546, 1547, 2780, 163, 164, 165, 4008, 4009, 166, 167, 168, 169, 1882, 170, 171, 5705, 172, 173, 1852, 174, 175, 1055, 1056, 1057, 1058, 1850, 3457, 667, 880, 1437, 1443, 1486, 1487, 1488, 177, 771, 178, 1273, 1086, 772, 1211, 180, 773, 2736, 3543, 4308, 4309, 4310, 4313, 5347, 4885, 5340, 5881, 5882, 5883, 774, 3539, 183, 2044, 3248, 3251, 3535, 775, 3549, 3550, 3551, 4317, 776, 5648, 5649, 5650, 5651, 5895, 6228, 6229, 6232, 6336, 777, 795, 1150, 3162, 778, 1383, 189, 190, 191, 938, 883, 884, 3462, 5602, 5854, 193, 2634, 3443, 812, 1492, 926, 927, 928, 947, 3043, 2702, 2703, 2727, 2728, 1501, 1502, 2715, 2719, 2720, 3526, 3519, 2708, 4287, 5627, 5628, 5629, 5630, 5631, 5632, 4874, 2723, 2724, 1504, 1505, 1506, 2732, 194, 2692, 3492, 3493, 3494, 4263, 4264, 6215, 4278, 4274, 4859, 5323, 3495, 872, 1248, 1513, 4867, 6217, 3496, 5312, 5313, 5607, 4283, 3505, 4304, 3948, 3949, 3950, 3497, 5864, 5865, 6212, 6213, 5609, 5610, 3498, 5856, 6386, 6387, 6426, 6463, 2760, 1466, 911, 1384, 912, 1479, 1385, 1453, 914, 1386, 1387, 1388, 917, 1389, 1390, 1391, 920, 1445, 1392, 1393, 1462, 1475, 1476, 1394, 1438, 5611, 1396, 1397, 1398, 3500, 1399, 4803, 5284, 5270, 3366, 3367, 2059, 5592, 4799, 4178, 4793, 2627, 2631, 5335, 5634, 5635, 3436, 4228, 4831, 5302, 5850, 6049, 6050, 6196, 1400, 1401, 1402, 3428, 2621, 1008, 1403, 4556, 2623, 3357, 3335, 1751, 3336, 2070, 2091, 3284, 3300, 3301, 3404, 3337, 3345, 3350, 3358, 1404, 3286, 3287, 4089, 2093, 1405, 1052, 1754, 1053, 1481, 3386, 5250, 5557, 5558, 5835, 5836, 5568, 5837, 5569, 5559, 4100, 4101, 6038, 3311, 3405, 4104, 3319, 3320, 4122, 4111, 3312, 1406, 4113, 1414, 1415, 1408, 2038, 873, 5319, 1206, 1835, 809, 1409, 1410, 1411, 1412, 1623, 979, 1173, 1174, 929, 931, 932, 2696, 663, 655, 981, 3696, 2624, 664, 657, 658, 1840, 2625 }; /* 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[] = { 654, 72, 1113, 1006, 1678, 81, 846, 192, 1418, 1964, 937, 187, 84, 181, 176, 185, 1407, 806, 1750, 808, 1239, 1240, 1241, 814, 829, 948, 1245, 1007, 192, 837, 829, 848, 1478, 851, 85, 770, 829, 829, 1836, 874, 86, 877, 87, 1847, 107, 125, 130, 160, 933, 933, 933, 2861, 179, 186, 875, 2890, 182, 184, 1493, 3660, 1495, 797, 1683, 2968, 3267, 871, 971, 797, 1245, 1458, 1526, 1507, 1841, 1205, 1012, 2860, 3536, 1017, 1434, 1742, 2846, 1151, 2088, 1186, 3537, 2018, 1730, 2080, 4069, 3907, 1449, 1450, 959, 827, 1907, 2756, 2873, 1199, 842, 3990, 1457, 1425, 1015, 1212, 4238, 868, 4240, 1059, 4031, 4302, 3562, 3564, 1433, 3125, 1464, 3929, 1037, 2073, 4354, 4462, 4661, 2075, 3788, 3037, 2076, 2077, 4636, 3258, 4412, 4383, 4414, 4388, 4610, 1439, 3283, 652, 2929, 2929, 804, 4942, 2929, 5151, 1618, 3318, 4876, 3820, 1880, 4558, 3322, 5316, 1885, 4316, 847, 4623, 4911, 1889, 2998, 2999, 1892, 1080, 1153, 4277, 950, 2756, 1677, 1899, 951, 1640, 942, 1196, 2688, 1213, 1657, 1708, 1916, 4891, 5523, 3342, 3144, 1919, 1256, 233, 5567, 1735, 5642, 3192, 5255, 3375, 5256, 844, 5484, 4260, 654, 962, 962, 1184, 5159, 962, 1188, 5180, 5745, 973, 2994, 874, 5169, 5667, 1009, 1059, 4982, 973, 1953, 1590, 973, 5516, 4291, 874, 5328, 962, 5330, 3446, 874, 5120, 886, 3448, 962, 862, 874, 3528, 4106, 3026, 3938, 3531, 661, 3455, 3926, 4322, 4206, 5797, 5515, 712, 5385, 4620, 3306, 3310, 3313, 3314, 1030, 4315, 3323, 5512, 3325, 3326, 4209, 1585, 1500, -2780, 5784, 1503, -2592, 1153, 5742, 779, 4108, 5168, 779, 3866, 5995, 3869, 3870, -2634, -2660, 2819, 3874, 3875, 3876, 1059, 3878, 3879, 3880, 718, 3507, 1915, 5659, 5037, 4142, 2149, 6034, -2000, 4275, -2008, 4280, 4281, 671, -2479, 1585, -2703, 1446, 1447, 6179, 1585, 1433, 5983, -2479, -2479, 2647, -2444, 1042, 1456, 5275, -2480, -1967, 1140, 1872, -2891, -1980, 2864, -2005, 2653, -2480, -2480, 1059, 957, -2891, -2891, -2025, 3263, -1995, 3847, 718, 1946, -2008, 718, 4646, 5920, 4119, 5707, 5708, 3237, 6181, 3005, 5697, 718, 2864, -2443, 1877, 718, 4546, 1267, 5130, -2512, 2655, 718, 3008, 4087, -2780, -2272, 5436, 4656, 2042, 1468, 779, 3237, -2272, 2777, 2864, 2798, 4703, 1290, 718, 1619, 3782, 2049, 4119, 1619, 718, 779, 2992, -2596, 1220, 779, 5437, 4355, 1059, 3068, 6189, 3384, 779, 5829, 779, 2693, 3221, 2929, 5538, 1252, 2864, 3237, 5229, 5230, 5231, 5733, 5233, 5234, 5235, 5236, 5237, 5906, 1224, 3709, -2780, -1800, 718, 1043, 4995, 952, 2932, 3382, 5345, 2936, 3810, 6290, 1946, -2780, 1085, 3425, 3086, 945, 5181, -2780, 5847, 1946, 3426, 6186, 2127, -2780, 945, 5820, 785, 5104, 1469, -2780, 5956, 1291, -2780, 4589, 5131, 1946, -2780, 785, 785, 1946, 3431, -2657, 1841, 1894, 5382, 1946, 2958, 1742, 6468, 2699, 786, 3811, 1999, 5105, 1836, 1946, 3091, 3533, 669, 5272, 5658, 786, 786, 785, 6030, 5477, -2780, 1044, 5674, 6159, 3478, 5393, 4058, 980, 5590, 2834, 3240, -150, 2050, 4142, 6423, 2149, 1016, -150, 665, 1535, 3812, 786, 5388, 1153, 2695, 1946, 1007, 5099, 1026, 953, 1038, 1622, 3100, -2780, 1652, 668, 6497, 2149, 1209, 4704, 1470, 1449, 1450, 1471, 1050, 6147, -2444, 1972, 1051, 6031, 6509, 785, 5997, 1727, 5100, 3384, 1731, 36, 1956, 1027, 5132, 6290, 2799, 4109, 1960, -2291, 1045, 3212, 4996, 2653, 3602, 666, -2291, 1457, 1971, 786, 1007, 4142, 1974, 785, 2655, 954, 1977, 5785, 1979, -2780, 2149, 6478, 2938, -2780, 1987, 5591, 4059, 1464, 1107, -2780, 1993, 195, 4071, 1996, 1117, 1849, 2655, 786, 1557, 3534, 878, 2648, 2039, 2835, 5273, 3241, 1131, 5917, 899, 3092, -1800, 3101, 2653, 2691, 5848, 5478, 5957, 6225, 4607, 3432, 1294, 1472, 2864, 3383, 3659, 1962, 2864, 1841, 6226, 4120, 2959, 5106, 6334, 2072, 4481, 2960, 1268, 196, 2047, 2143, 2002, 3011, 5821, 2051, 5849, 2655, 5773, 1878, 3087, 2081, -2780, 2864, 2142, 4138, 2800, 4590, 3710, 1472, 6280, 1947, 3237, 5346, 2796, 6093, 2864, 6378, 719, 4120, 3041, 2637, 5830, 3897, 3069, 4355, 4997, 2085, 4705, 3850, 2971, 1062, 6290, 5539, 5955, 1238, 4195, 874, 3095, 962, 3238, 962, 5438, 1145, 962, 2690, 4558, 5621, 3222, 192, 3122, 1009, 4657, 1091, 3025, 1087, 1120, 1090, 962, 6090, 2935, 811, 5735, 1962, 962, 1558, 1269, 2043, 1629, 1153, 2669, 3285, 3079, 1878, 5017, 1878, 3848, 2824, 1270, 1153, 1153, 3631, 3035, 3036, 1446, 1447, 5133, 1962, 654, 937, 2963, -2780, -2657, 2966, 2973, 1741, 6332, 973, 1088, 1089, 1244, 1009, 1947, 2993, 973, 1293, 1153, 973, 6158, 4647, -2272, 1947, 2986, 2987, 4538, 4539, -2780, 6035, -2780, -2780, 2043, 4701, 1456, 962, 6353, 2666, 1473, 1947, 5351, 6180, 955, 1947, 1216, 3717, 1444, 5394, 2742, 1947, 3898, 2907, -2780, 3006, 192, 3034, 3385, 672, 5403, 1947, 791, 792, 1878, 2908, 4110, 2053, 3009, 1508, 5129, 2065, 2065, 3472, -2780, 5134, 5585, -2780, -2780, -2780, 3279, 2891, -2592, 6182, -2657, 1459, 1460, 6352, 4157, 2620, 874, 1948, 3427, -2634, -2660, 829, -2657, 1947, 2733, 829, 829, 2734, -2000, 1217, 1461, 1222, 5990, 1226, -2479, 3194, 2952, 5177, 6113, 1230, 1284, 5176, 1247, 5024, 1050, -2703, -2444, 6404, 1051, 5028, -2480, 1448, 1459, 1460, -2891, 1452, 4947, -2005, 4949, 1413, 1413, 874, 829, 829, 4121, 2103, 2874, -1995, 3220, 2671, 2672, 1463, 2145, 1863, 874, 3078, 3210, 5993, 2841, 874, 3235, 3042, 2635, 6282, -2443, 1413, 3253, 791, 792, 842, 6241, 6242, 6455, 1261, 1263, 6439, 3603, 1007, 3123, -2512, 6508, 6272, 1620, 1621, 4558, 1247, 1620, 1621, 1955, 6301, 6032, 2694, 6514, 791, 792, 791, 792, 1959, 950, 1050, 5554, 1050, 951, 1051, 3244, 1051, 4324, -2596, 4325, 4277, 4213, 2841, 1413, 1970, 4476, 4477, -2291, 1992, 1859, 4478, 6333, 4196, 1864, 1995, 1865, 6033, 874, 1244, 2841, 6461, 879, 72, 3096, 1962, 4601, 81, 6227, 192, 2916, 874, 3749, 187, 84, 181, 176, 185, 5902, 1854, 4318, 1559, 1108, 2891, 1489, 4608, 874, 1542, 1108, 4856, 4757, 4752, 4753, 4860, 4620, 4482, 85, 1512, 1649, 4519, 1108, 4698, 86, 3899, 87, 874, 107, 125, 130, 160, 962, 962, 1564, 4608, 179, 186, 6157, 6234, 182, 184, 4698, 2891, 1650, 2797, 4928, 4900, 4152, 4153, 4154, 4155, 4156, 4157, -150, -150, 5091, 3501, 6246, 4987, 6355, 4054, 1233, 4197, 829, 829, 952, 5772, 4738, 3012, 3528, 1560, 969, 4296, 2617, 2618, 2619, 2620, 5736, 5090, 6151, 2892, 3750, 4390, 4242, 1421, 1423, 1413, 1413, 6139, 4846, 3245, 4848, 4849, 6295, -448, 2818, 1440, 4815, 3013, -1939, 654, 4575, 962, 1530, 6150, 2148, 973, 4599, 2149, 1009, 973, 3124, 973, 4154, 4155, 4156, 4157, 962, 3900, 3317, 2615, 2616, 2617, 2618, 2619, 2620, 5362, 4533, 2826, 6334, 1103, 842, 1261, 6309, 2891, 3885, 3751, 990, 2833, 6403, 2653, 874, 6358, 6359, 991, 992, 993, -3018, 962, 962, 2695, 4198, 5363, 1549, 1221, 1223, 1225, 953, 6462, 1227, 1228, 1229, 6307, 5048, 2722, 1896, 3359, 3994, 2985, 1234, 874, 874, 874, 2655, 962, 6130, 654, 4319, 654, 654, 1167, 1946, 2632, 2914, 849, 5778, 6335, 4942, 4108, 3138, 5888, 1531, 2891, 6343, 5110, 5015, 4662, 4391, 3635, 3752, 3381, 6281, 3475, 1132, 4712, 1841, 5200, 1496, 2965, 5696, 6472, 6295, 962, 1497, 962, 962, 1243, 6310, 6393, 718, 2891, 5145, 1699, 1929, 1714, 2953, 3510, 3232, 3233, 2956, 2957, 1631, 4485, 1911, 5851, 6230, 5680, 6273, 718, 2875, 1133, 665, 1981, 6259, 2892, 1532, 4192, 1413, 4877, 4350, 6059, 3757, 713, 2876, 3293, 2877, 2893, 718, 5946, 3995, 5948, 4306, 718, 1659, 5952, 5953, 192, 1715, 1550, 6441, 807, 3653, 943, 2020, 5842, 2020, 1912, 3622, 1134, 874, 3476, 806, 2892, 3134, 4486, 1982, 718, 2894, 4663, 195, 1719, 4555, -3018, 2891, 941, 1498, 1720, -3018, 3636, 1842, 4307, 4056, 1843, 3540, 4488, 5852, 1660, 2068, 1244, 1632, 3135, 4055, 4768, 2895, 4769, 3622, 6231, 3511, 6223, 6311, 3246, 2878, 6360, 3753, 3360, 4878, 874, 1059, 1135, 2915, 2084, 6058, 3757, 5979, -1112, 196, 6295, 1641, 4062, 4099, 944, 3247, 5987, 2891, 1413, 3173, 1962, 1499, -3018, 1301, 3196, 1878, 4142, 6486, 2889, 1515, 4143, 4144, 4145, 3185, 1533, 3632, 5049, 5533, 3886, 5111, 3294, 5514, 5889, 1938, 5976, 1607, 3191, 3561, 2892, 3651, 3623, 3176, 937, 3219, 4713, 4653, 3280, 3224, 3282, 3183, 1413, 5502, 3231, 3927, 3289, 3234, 6025, 5989, 970, 6402, 3303, 3304, 5508, 6004, 5992, -723, 5567, 1472, 4126, 1721, 6409, 2660, 3327, 2891, 2995, 3169, 955, 3410, 3623, 1413, 1413, 1413, 3347, 1413, 2893, 2143, 3056, 5358, 3362, 3484, 2776, 6425, 1277, 5975, 4392, 4393, 2892, 2891, 4576, 945, -1967, 4139, 4140, 4289, 1413, 5087, 4159, 3190, 3718, 3295, 6440, 2891, 5376, 3566, 3203, 2894, 1642, 1104, 1551, 3754, 3171, 5567, 2893, 5991, 2892, 4394, 3857, 3755, 1716, 4109, 3756, 874, 4664, 6260, 4770, 3184, 2651, 1913, 3186, 4440, 6312, 2895, 3333, 3501, 5364, 6470, 1983, 4190, 4191, 1413, 2004, 1897, 2006, 2894, 2008, 1007, 2010, 1947, 2012, 2013, 2014, 1552, 5843, 3996, 2633, 2016, 3027, 1168, -3018, 2700, 2701, 3541, 2705, 951, 951, 3862, 951, 6487, 3997, 2895, 3136, 5898, 2889, -1967, 4559, 1278, 6131, 3296, 3223, 5963, 3297, 6207, 3229, 3230, 4466, 1413, 1553, 2892, 4943, 1413, 1413, 4351, 3699, 1539, 5350, 4146, 1540, 4665, 6317, 6141, 874, 874, 874, 2740, 2893, 1413, 4057, 5892, 5226, 6261, 2889, 6172, 3411, 2968, 3633, 5317, 714, 3412, 4147, 3626, 6391, 2802, 4562, 2709, 1235, 1468, 1512, 3804, 1512, 829, 1516, 1717, 2803, 3805, 41, 2894, 1557, 2892, 6262, 946, 1914, 811, 3719, 2003, 4441, 1722, 2005, 2639, 2007, 1984, 2009, 3700, 2011, 5481, 5916, 5320, 2015, 3626, 3956, 1554, 5324, 2895, 2893, 5326, 2830, -3018, -2440, 2787, 3413, 829, 6348, 2710, 962, 45, 3278, 2851, 715, 2615, 2616, 2617, 2618, 2619, 2620, 5118, 4565, 874, 2863, 2788, 1723, 3214, 2893, 5791, 1643, 2894, 874, 1260, 5190, 962, 6208, 5792, 3298, 3447, 2889, 2892, 1469, 4148, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 4474, 6191, 49, 716, 2895, 717, 2894, 2640, 1724, 1009, 3567, 874, 2892, 3568, 829, 5964, 50, 2931, 2931, 3502, 1644, 2931, 2787, 2837, 3979, 1939, 2892, 3806, 6201, -1801, 1542, 829, 2895, 6081, 874, 1542, 1558, 874, 1841, 1940, 51, 3155, 4372, 4558, 1279, 2889, 853, 2792, 2893, 1646, 4484, 3701, 4367, 6271, -1967, 1645, 5786, 1042, 1836, 3542, 1496, 962, 2855, 4297, 3156, 1042, 3814, 1470, 6016, -1137, 1471, 6102, 4879, 2889, 2712, 2793, 1962, 3014, 874, 2894, 5467, 6458, 5777, 2837, 832, 4568, 5156, 1280, 6381, 1281, 962, 962, 962, 962, 874, 5965, 1941, 1236, 2893, 2804, 2837, 3815, 3299, 2756, 2989, 2895, 3938, 2756, 874, 3414, 1542, 3316, 3316, 5157, 1542, 4442, 4521, 3134, 6017, 1413, 1413, 1413, 1739, 5787, 5156, 4902, 3343, 5081, 4884, 2894, 5147, 4368, 5085, 6349, 4569, 3364, 6496, 5150, 5788, 2713, 4930, 6092, 2805, 3182, 3135, 3215, 2889, 3581, 1498, 6103, 4570, 5157, 854, 5109, 4989, 2895, 6209, 833, 4443, 4555, 684, 6210, 1043, 6167, 2893, 3212, 1007, 1007, 6382, 5793, 1043, 834, 6192, 2789, 5119, 6351, 1050, 5000, 3216, 3622, 1051, 2857, -173, 41, -1110, 852, 1700, 5013, 2893, 4903, 1472, 3501, 3217, 4444, 3501, 2894, 2889, 6211, 6278, 6279, 3172, 1942, 2893, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, -1801, 3807, 1215, 2706, -2463, 5560, 874, 2894, -173, 2895, 45, 3015, 3165, 3212, 3749, 5872, 1044, 874, 3218, 3702, 3157, 2894, 686, 2858, 1044, 962, 962, 3259, 5561, 5647, 3501, 2789, 4913, 2895, 4298, 5562, 2794, 3913, 3501, -173, 3583, 962, 4571, 4880, 3808, 6401, 3706, 2895, 1301, 5563, 2889, 4142, 3532, -1967, 49, 4143, 4144, 4145, 4914, 874, 2931, -1967, 1943, 1448, -1967, 1477, 3623, -1967, 50, 41, 1276, 1139, 3730, 4808, 2889, 962, 962, 962, 962, 3809, 688, 1045, 6165, 5102, 874, 1458, 940, 3732, 2889, 1045, 3463, 874, 51, 3212, 3145, 1473, 1490, 5001, 1740, 6036, 684, 4479, 3750, 3624, 3768, 1007, 1570, 5158, 45, 654, 5359, 57, 654, 5996, 5890, 1435, 6238, 4904, 2707, 1962, 1474, 4915, 973, 973, 4905, 3, 4, 785, 5982, 1649, 5789, 4906, 3584, 1009, 1009, 1140, 5314, 973, 5496, 6168, 973, 5891, 3834, 2859, 1265, 6145, 3625, 2102, 1720, 1607, 4985, 786, 49, 1650, 1496, 962, 962, 3751, 5103, 869, 6003, 1680, 962, 3648, 874, 4555, 1944, 3733, 6037, 4907, 2793, 5503, 3730, 3020, 686, 5485, 3659, 1485, 192, 4012, 4480, 2020, 1522, 5564, -636, 5360, 3818, 6405, 962, 3454, 973, 764, 4908, 3228, 973, 973, 5617, 874, 874, 4916, 962, 4702, 1491, 4917, 1681, 5819, 697, 874, 698, 57, 4959, 15, 3677, 3914, 2781, 5552, 3813, 6362, 3264, -1137, 3752, 1523, 4715, 1141, 5486, 1524, 2782, 3309, 6484, 4986, 3502, 2001, 701, 3249, 1843, 1893, 2057, 874, 3895, 4379, 874, 3145, 1498, 806, 2783, 4960, 806, 3269, 192, 20, 6498, 1413, 1091, 1413, 1087, 3626, 1090, 3835, 1413, 1413, 1525, 3504, 6255, 4147, 3767, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 3678, 2058, 2869, 1413, 2870, 1413, 1009, 1413, 1413, 1413, 1413, 1413, 1413, 5483, 2922, 1413, 1499, 1413, 1413, 1088, 1089, 1413, 4727, 1530, 3794, 2756, 2900, 4366, 195, 1689, 6166, 2946, 779, 4318, 4739, 2756, 1413, 1413, 1413, 4743, 6149, 3742, 1682, 3743, 4186, 2968, 5494, 6256, 3851, 3852, 3853, 3819, 5507, 4751, 1413, 3942, 3943, 3944, 3945, 3841, 3947, 3744, 684, 5565, 6443, 4961, 3753, 1268, 3099, 5653, 2871, 5655, 4148, 3679, 196, 5566, 3116, 6148, 5752, 5974, 697, 3645, 698, 939, 3020, 3975, 6466, 5808, 6469, 3268, 4764, 4765, 4766, 4767, 962, 1690, 4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 5679, 4006, 1662, 702, 2756, 1531, 4684, 1153, 3915, 1897, 1142, 4050, 1132, 3204, 3857, 3205, 881, 3206, 41, 3207, 4528, 3208, 2929, 3174, 1663, 3209, 5753, 41, 3097, 5754, 686, 1691, 5473, 3680, 5475, 4742, 5755, 2784, 1692, 1269, 4747, 4748, 1693, 2709, 5711, 3938, 6510, 1143, 3127, 1133, 3020, 1270, -1724, 6007, 4819, 4820, 3741, 45, 2149, 1532, 3916, 1897, 4697, 4268, 5756, -1724, 45, 5949, 4031, 3816, 1258, -1724, 5950, 33, 4483, -1723, 1664, 5812, 3785, 5454, 3786, 5455, 5456, 5457, 3790, 3582, 4843, 4602, -1723, 956, 2653, 2710, 3754, 2643, -1723, 6274, 1413, 4269, 3028, 6024, 3755, 49, 5813, 3756, 3817, 41, 764, 5703, 1995, 4698, 49, 1144, 4862, 1145, 4913, 50, 3520, 1146, 4321, 1517, -1724, 4520, 5463, 2655, 50, 5757, 15, 6479, 5706, 5951, 5986, 5704, 2958, 943, -474, 4271, 4176, 1135, 5758, 51, 4914, 3029, 4183, -1723, 45, 5342, -1772, 3968, 51, 3030, 1413, 5759, -1772, -1724, 1995, 1527, 5464, 1710, 57, -1771, 2711, 3031, 1518, 1686, 20, -1771, 2939, 57, 965, 1665, 6480, 2942, 5954, 3460, 1533, 2881, -1723, 4845, 4437, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 49, 1649, 967, 3032, 765, 2881, 4632, 6507, 1649, 1519, 1528, 3461, 1711, 944, 50, 4915, 1712, -1724, 1687, 1413, 5067, 2712, 6173, 2882, 6516, 1650, 697, -1724, 698, 6354, 41, 3502, 1650, 4438, 3502, -1724, 1694, 3930, 51, 1666, -1723, 2882, 5879, 5068, 1667, 1529, -1772, 1713, -1724, 1668, -1723, -150, 1534, 1688, -1724, 1893, 6174, 766, 3017, -1771, 4943, 1535, 3023, 5703, 6236, 2967, 2977, 5880, 4439, 45, 5395, -474, 3769, 6364, 4393, 1695, 4273, 6327, 5401, 1696, 3772, 6383, 3502, 3775, 1050, 1917, 2713, 5704, 1051, 2148, 3502, 1536, 2149, 4916, 4943, 1537, 2978, 4917, -1772, 36, 2959, 1670, 6328, -1724, 4973, 2960, 6384, 957, 945, 1918, 1995, -1771, 234, 49, 1697, 4328, 1989, 5050, 670, 5703, 1448, 1698, 2689, 1105, 2653, 1106, 762, 50, 1459, 1460, 1538, -3018, 4004, 4038, 1459, 1460, -1724, 4010, 988, 4011, 1990, 5051, 6080, 5704, 2143, 850, 989, 1461, 2864, 4017, 1672, 51, 4018, 1463, 4019, 4020, 2074, 2655, 4022, 1843, 2865, 2864, 4025, 5908, 4026, 1539, 4239, 4028, 1540, 4422, 57, 1454, 1455, 2872, 1673, 6187, 5760, -1724, -2436, 5761, 1041, 4423, 6188, 1050, 33, 1238, 3501, 1051, -1724, 4899, 3501, 4141, 4083, 2901, 1448, 1675, 2689, 2664, -1724, 779, -1723, 1032, 3615, 4169, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 5919, 1413, 5098, 41, 4294, 5923, 5924, 1541, 1049, 794, 779, 874, 1413, 1007, 1413, 794, 2650, 4210, 6471, 1843, 4084, 874, 4070, -2437, 4489, 4085, 4193, 4943, 1050, 874, 1238, 1413, 1051, 1676, 962, 1413, 4669, 1093, 1413, 5184, 1413, 4670, 45, 1413, 4670, 946, 2663, 1413, 1639, 2664, 3456, 5713, 4323, 1656, 4356, 1489, 3612, 1095, 3616, 3617, 4247, 4248, 4168, -3018, 4170, 4171, 1100, 5217, -3018, 4225, 3503, 3395, 3396, 3397, 3398, 4241, 874, 874, 1109, 1114, 1110, 1153, 3501, 4267, 5225, -635, 49, 1413, 3609, 6338, 4398, 3477, 3479, 3480, 6341, 6342, 1413, 1413, 3039, 3040, 50, 6254, 1489, 1489, 1128, 2697, 5314, 4211, 1843, 3200, 874, 3211, 2664, 3213, 3212, -1724, 3212, 3644, 3547, -3018, 3552, 2089, 3256, 57, 51, 3257, 4284, 3459, -1724, 4039, 1995, 1136, 3544, 6008, -1724, -1724, 3585, 3464, 3588, 6482, 2664, 3553, 6485, 57, 2664, 4267, 3642, 4555, 1841, 3643, 829, 2690, 3724, 3891, 1138, 3725, 3892, 4267, 4359, 2065, 1137, 806, 4268, 806, 4972, 4030, 5248, 4082, 3212, 1448, 2664, 1477, 2148, 5253, 5254, 2149, 4091, 1413, 2660, 2664, 1155, 4097, 3368, -1724, 2664, 3371, 5904, 4618, 654, 3, 4, 973, 1009, 973, 973, 1175, 4269, 962, 5152, 4098, 874, 1159, 2664, 4117, 1050, 3499, 3850, 2653, 1051, 4128, 3748, 4270, 2664, 1448, -3018, 2689, -1724, 4161, 842, 829, 2664, 4962, 4175, 4969, 4268, 2664, 3630, 4180, 1166, 4245, 4181, 2863, 2664, 1176, 4271, 3160, 4268, 3161, 4929, 4102, 2655, 4103, 4946, 1182, 4432, 3665, 874, 4230, 1193, 4231, 6437, 4714, 3676, 4415, 4420, 1200, 4416, 4421, 4269, 4448, 665, 874, 4449, 4272, 3078, 4629, 6326, 4630, -1724, 5800, 4269, 4517, 1210, 4270, 4449, -3018, 4641, 4644, -1724, 4642, 4645, 1459, 1460, 874, 4332, 4270, 2756, 4675, 2837, 4605, 4676, 3838, 4789, 5321, 6233, 4790, 4271, 4800, 4811, 779, 4801, 2664, 6286, 29, 874, 29, 3529, 3530, 4271, 4329, 4330, 4988, 1237, 4818, 3501, 3501, 4887, 829, 1238, 4888, 4547, 4893, 1242, 4898, 4894, 4272, 3568, 1246, 5153, 4577, 3739, 3212, 5219, 5260, 1249, 2043, 2664, 4272, 5293, 5298, 962, 2664, 2664, 962, 4457, 1258, 3343, 3343, 4339, 4463, 5353, 3343, 1264, 3568, 4343, 4892, -1795, -1795, 5379, -3018, 1266, 5380, 5509, 4273, -3018, 5510, 5910, 5911, 5546, 874, 874, 4676, 5878, 5582, 5584, 5604, 5583, 2664, 5605, 4232, 5614, 4233, -3018, 1995, 3821, 1272, 3824, 3826, 4943, 5092, 1265, 5093, 3343, 3343, 2615, 2616, 2617, 2618, 2619, 2620, 5620, 1274, 3784, 4615, 3554, 41, 1285, 41, 5622, 5747, 5767, 4615, 5748, 3212, 5801, -3018, 1275, 5802, 1413, 1413, 1413, 5263, 3570, 5264, 1413, 4273, 3573, 1286, -1724, 4402, 3576, 4404, 962, 1153, 6095, 6096, 5861, 4273, 5867, 5862, 2148, 1995, 1287, 2149, 45, 962, 45, -3018, -3018, -3018, 1270, 1413, 6444, 962, 5833, 3595, 5834, 5322, 5170, 4453, 5870, 5886, 1288, 4615, 5887, 5163, 2863, 5938, 1289, 5978, 5939, 874, 2642, 1295, 2660, 2653, 4889, 3928, 6051, 6052, 806, 4469, 2654, 6005, 6042, 1297, 5887, 4181, 49, 3637, 49, 6043, 962, 3939, 2664, 6155, 6063, 1050, 1424, 6064, 1482, 1051, 50, 3821, 50, 1426, 6067, 1108, 2655, 1995, 6411, 6068, 6412, 962, 2664, 3961, 1428, 4075, 6076, 4077, 4078, 6077, 3979, 1482, 1432, -1712, 51, 4595, 51, 3957, 6500, 6101, 5507, 6104, 3257, 6105, 3257, 1427, 3257, 6108, 6109, 6110, 2664, 2664, 6111, 6287, 3697, 57, -1450, 4072, -1450, 4795, 6137, 1436, 962, 6138, 962, 3501, 962, 6203, 6218, 1441, 4615, 2664, 3501, 6220, 1451, 6235, 2664, 3501, 3212, -3018, 3501, 3726, 6250, 4507, 4840, 6251, 4842, 3735, 6276, 4514, 6325, 6277, 6361, 5875, 6407, 5887, 1442, 6408, 2695, 2020, 6427, 3745, 1444, 6428, 6435, 3502, 1448, 4888, 1108, 3502, 5307, 3758, 5309, 2756, 6075, 1007, 6438, 3763, 4945, 2664, 6465, 4948, 6467, 6064, 4951, 2664, 6475, 6513, 6515, 6476, 6428, 6476, 4861, 1452, 4864, 2656, 3499, 3776, 6517, 1465, 2657, 6428, 5599, 3779, 5600, 1467, 4609, 4588, 4707, 4591, 3787, 1662, 2735, 4578, 2738, 4580, 1482, 654, 962, 1483, 973, 1509, 973, 973, 3802, 962, 1742, 1494, 4559, -1799, -1799, 4943, 1413, 1663, 4560, -1798, -1798, 1413, 3828, 6197, 6198, 934, 935, 1510, 5572, 5573, -3018, 937, 4561, 1108, 1511, 2659, 1514, 1520, 1562, 1591, 1841, 1477, 2615, 2616, 2617, 2618, 2619, 2620, 1301, 1588, -2481, 4142, 1593, 1594, 5576, 4143, 4144, 4145, 3502, 1629, 4562, 1634, 4563, 1633, 4290, 1635, 1646, 1648, 1658, 1664, 1413, 1413, 1413, 4809, 1661, 1413, 1153, 2695, 1153, 937, 1685, 4650, 1701, 1413, 1413, 1413, 1413, 4692, 4564, 1702, 1718, 1728, 1729, 1732, 2660, 4972, 1737, 1738, 1851, 1413, 1855, 6284, 1413, 1853, 1413, 1860, 1301, 1871, 1866, 4142, 1876, 1874, 1881, 4143, 4144, 4145, 1413, 1413, 1884, 4677, 1413, 4679, 4565, 4681, 1886, 1878, 1895, 4761, 1900, 1901, 6155, 5290, -137, 1903, 1904, 1906, 4943, 1908, 1009, 4966, 1413, 1909, 1413, 1920, 1413, 3706, 1927, 4983, 1929, 4716, 1932, 4566, 1936, 1945, 1950, 5377, 214, 1951, 1952, 1954, 1153, 4788, 1665, 1413, 1957, 1958, 4229, 1961, 1969, 1962, 874, 1973, 1975, 3730, 1976, 1978, 1980, 1985, 4963, 1986, 937, 1988, 1991, 1994, 1997, 4235, 4236, 4237, 874, 1998, 2000, 2662, 2017, 2048, 4925, 2060, 2071, 2078, 2086, 2079, 2082, 796, 3501, -1971, 2087, 4822, -1978, 796, 3391, 2094, 3392, 2095, 2096, 4828, 1489, 2097, 2098, 57, 654, 2100, 1666, 3503, 4265, 2101, 2102, 1667, 4265, 4279, 4265, 4265, 1668, -1968, 937, 4567, -1969, 1413, 2104, 3393, 4568, 2105, 1413, 2106, 2107, 2108, 2109, 5717, 2967, -1972, 4046, 2110, 2111, 2112, 2113, 2114, 5197, 1413, 2115, 2690, 2116, 2117, -1970, 4943, 2119, 4147, 2120, 2127, 2121, 2122, 2123, 3503, 2124, 4065, 5825, 4311, 2125, 2126, 4314, 3503, 4046, 3552, 2129, 2130, 1670, 2131, 2132, 2133, 2134, 4569, 2135, 2136, 3502, 3502, 5718, 2626, 2628, 5073, 2630, -3017, 2611, 2632, 2633, 2642, 3394, 4570, 2644, 2645, 2667, -3018, -3018, -3018, 2615, 2616, 2617, 2618, 2619, 2620, 2668, 5719, 2673, 2675, 1413, 4147, 2676, 2679, 2680, 5086, 2682, 2683, 2685, 2691, 2684, 1672, 4721, 2686, 1497, 2698, 5720, 1499, 2729, 2731, 3384, 2741, 5721, 6442, 962, 962, 2743, 2744, 2745, 2746, 4148, 2762, 2763, 3499, 2764, 1673, 3499, 2765, 3395, 3396, 3397, 3398, 2689, 2766, 5722, 3399, 3400, 2767, 5723, 5839, 2768, 3401, 2769, 2770, 2772, 2771, 1675, 2773, 2779, 2795, 1413, 2801, 2807, 5724, 3501, 2821, 5078, 2825, 4378, 2827, 2828, 2829, 2831, 2832, 2848, 2843, -3017, 2847, 2849, 2868, 5860, 2867, 2883, 2885, 3499, 3501, 2879, 4571, 4148, 2886, 2887, 2888, 3499, 2889, 2897, 1301, 2899, 2902, 4142, 2903, 2904, 1662, 4143, 4144, 4145, 4050, 2898, 1676, 2909, 2910, 2913, 2919, 2920, 2923, 2933, 2934, 2940, 2937, 4426, 3501, 5291, 2943, 2947, 1663, 2954, 4290, 2944, 2949, 2950, 2961, -3017, 2964, 2962, 2969, 1607, 2970, 2979, 2975, 2981, 2983, 2976, 2982, 874, -3017, 2984, 2990, 2991, 3007, 2988, -3017, 3016, 2996, 2931, 3050, 3045, -3017, 3038, 3052, 3053, 2997, 3316, -3017, 3010, 3021, -3017, 3054, 3055, 3066, -3017, 5725, 4199, 3067, 4200, 3072, 3059, 1664, 3060, 3061, 3063, 3064, 3065, 5529, 3343, 3343, 3343, 3343, 3071, 3073, 3343, 3343, 3343, 3343, 3343, 3343, 3343, 3343, 3343, 3343, -3017, 4201, -3017, 3074, 3081, 3082, 3085, 3090, 679, 3098, 3109, 3402, 1682, 3113, 3114, 3502, 3133, 3126, 4792, 3117, 3129, 3132, 3502, 3403, 3153, 3142, 3159, 3502, 5726, 3163, 3502, 3175, 3177, -3017, 1301, 3178, 3179, 4142, 3146, 3180, 3193, 4143, 4144, 4145, 3236, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 3343, 3343, 3150, 3266, 3250, 3255, 3168, 3363, 5863, 1413, 3225, 3285, 3394, 3501, 3290, 1413, 1665, 3369, 3330, 2149, 3389, 3407, 3409, 3373, 3429, 3434, 962, 3450, 3451, 3465, 1301, -3017, 3435, 4142, 3452, -3017, 3453, 4143, 4144, 4145, 3482, -3017, 3467, 3466, 4341, 4852, 1472, 3504, 3468, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4147, 944, 3469, 3521, 3522, 874, 874, 874, 3509, 3470, 3395, 3396, 3397, 3398, 3523, 2695, 1666, 4202, 3474, 3483, 3524, 1667, 874, 4203, 3538, 3545, 1668, 3546, 3557, 3558, 3560, 3577, 3589, 3604, 3501, 3591, 1413, 5125, 5126, 3605, 3594, 3618, 2967, 3586, -3017, 3599, 3610, 3634, 3607, 3649, 1301, 3655, 3656, 4142, 2020, 874, 874, -3018, -3018, -3018, 874, 3639, 3641, 3657, 3658, 3668, 3681, 3686, 3707, 3687, 3714, 3720, 874, 5163, 3713, 5285, 5012, 3740, 1670, 3715, 3723, 3731, 3738, 1301, 5490, 4635, 4142, 4148, 3761, 3741, 4143, 4144, 4145, 5332, 3778, 3762, 4428, 1897, 4639, 3385, 3822, 3837, 3849, 3845, 3846, 945, 3858, 5209, 5210, 5211, 5212, 5213, 3865, 3871, 3877, 3893, 3904, 3919, 3923, 3921, 3872, 4672, 3882, 3905, 3925, 3933, 3946, 1672, 962, 3951, 3873, 3940, 3952, -3017, 3954, 3955, 3959, 4147, 3962, 3953, 3966, 3967, 3228, 4695, 3970, 3971, 3976, 3991, 3993, 5271, 3992, 1673, 4001, 874, 3964, 4003, 4002, 4007, -3017, 5206, -3017, -3017, 5208, 4005, 4826, 4021, 4024, 4027, 4032, 874, 4029, 4033, 1675, 4034, 4023, 4035, 1995, 4036, 4037, 1247, 4047, 4204, -3017, 4051, 4053, 4060, 4068, 4147, 1413, 4066, 4096, 4076, 5224, 4205, 4099, 4112, 3502, 1413, 1992, 4116, 4042, 3307, 3501, 1959, 4041, -3017, 4052, -3017, -3017, 1244, 4138, 1413, 4093, -2264, 4094, 1413, 1413, 1413, 4114, 5907, 4174, 4194, 1413, 1676, 4148, 1413, 4095, 4523, 1413, 4107, 4124, 4177, 4118, 4189, 1413, 4129, 1413, 4127, 4208, 1413, 4130, 4219, 4134, 5461, 1413, 1413, 1413, 1413, 4136, 3850, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 4137, 4160, 4165, 1413, 1413, 1413, 4243, 4166, 2664, 4173, 4188, 4257, 4249, 1413, 4148, 4216, 937, 4226, 1413, 4286, 937, 4250, 1413, 4220, 4299, 4222, 4282, 4224, 4301, 4303, 1413, 3343, 4251, 1413, 4244, 1413, 4305, 5336, -3018, 4266, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4320, 4312, 1413, 4292, 4326, 1413, 1413, 3501, 1413, 4331, 5214, 1413, 1413, 2103, 4333, 4252, 1413, 4334, 1413, 4832, 796, 4258, 796, 4338, 796, 4340, 4352, 874, 874, 874, 796, 1231, 1232, 4353, 4363, 4290, 4833, 4834, 4835, 4836, 4364, 4365, 4369, 4148, 1413, 4265, 4279, 4265, 4265, 192, 1413, 4265, 4371, 1091, 4854, 1087, 4375, 1090, 3503, 4376, 6318, 6319, 3503, 4290, 6321, 4377, 4381, 4384, 4869, 3502, 4382, 4387, 4400, 5374, 4389, 4401, 4148, 4403, 4409, 4410, 4411, 4419, 4427, 4436, 4452, 4450, 4456, 5365, 4454, 4458, 3502, 4460, 4464, 4465, 4468, 1413, 4470, 3020, 1088, 1089, 4471, 4472, 4475, 4492, 4473, 4490, 4493, 4491, 4494, 4497, 3552, 4500, 1413, 4502, 3501, 4504, 4696, 4506, 4495, 4509, 4700, 4496, 4498, 4511, 3502, 4513, 5474, 3005, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4499, 4501, 3008, 4529, 4503, 4505, 4515, 5405, 5406, 4525, 4526, 4527, 4516, 4543, 4522, 4532, 4537, 4545, 4581, 4586, 4596, 5439, 5440, 4587, 5442, 4597, 4593, 4600, 4604, 4614, 4944, 2020, 2863, 4615, 2020, 4617, 4633, 2020, 5529, 4953, 5432, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4634, 4624, 4637, 4638, 4654, 4668, 3499, 4671, 4977, 4674, 3499, 4640, 4678, 4680, 4627, 4686, 4708, 4687, 4688, 4689, 4709, 4690, 4691, 4710, 4717, 4718, 5276, 4730, 2089, 4719, 4711, 4693, 4720, 4722, 5598, 4723, 4724, 4725, 4734, 4726, 4744, 796, 4735, 4736, 4142, 4740, 4737, 4741, -2263, 4749, 4762, 5449, 5450, 4750, 2148, 4802, 5716, 2149, 4814, 4755, 4785, 4786, 4787, 5026, 4794, 4813, 4290, 5637, 4829, -3018, -3018, -3018, 4152, 4153, 4154, 4155, 4156, 4157, 4817, 4841, 4850, 4844, 4857, 3502, 4853, 4855, 653, 4858, 5492, 2653, 4865, 4866, 4871, 5399, 4870, 3501, -3018, 4872, 4873, 4875, 4884, 4886, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 796, 5641, 4881, 5029, 3499, 4890, 4901, 5070, 4910, 4921, 4922, 2655, 2968, 4923, 3784, 4924, 4932, 4931, 4934, 4935, 4938, 4954, 3653, 4957, 4958, 4975, 4990, 4978, 4991, 4994, 4992, 5006, 4993, 5004, 5005, 5007, 5008, 5009, 5020, 5932, 962, 5934, 5018, 5021, 5027, 5038, 5039, 5047, 5063, 5044, 5064, 3502, 5066, 4964, 962, 2148, 1413, 5069, 2149, 5080, 5079, 5095, 5107, 5082, 874, 5083, 5084, 5122, 5117, 5128, 5115, 5545, 5142, 5143, 5547, 5548, 5148, 5155, 5149, 2148, 5165, 2863, 2149, 5136, 4821, 5171, 5182, 5172, 5189, 5215, 2653, 5188, 5191, 5192, 5193, 5553, 874, -3018, 5195, 3501, 5196, 3503, 3939, 5201, 3237, 3501, 5207, 5222, 5223, 3821, 5232, 5239, 5240, 5241, 2653, 5242, 5243, 5244, 5164, 5262, 5245, -3018, 5251, 2655, 5246, 5252, 5257, 4926, 874, 5268, -3018, 5613, 5274, 5279, 5277, -3018, 5278, 5283, 5764, -2265, 1413, 1413, 5613, 5297, 5174, 5301, 5310, 2655, 5338, 5325, 5315, 1413, 5311, 2148, 5318, 5329, 2149, 5337, 5334, 5355, 5339, 5354, 2020, 874, 5349, 5357, 5352, 960, 5381, 5361, 5382, 5396, 5397, 5400, 5398, 5402, 972, 5386, 5407, 5408, 874, 5409, 5428, 5430, 972, 5434, -3018, 972, 2653, 5421, 1007, 5424, 5443, 5435, 5444, -3018, 5665, 5451, 5452, 5453, 5458, 5943, 6056, 5462, 5465, 5469, 796, 5470, 5479, 5487, 796, 796, 5471, 5482, 5488, 5489, 5491, 5495, 5497, 3502, 4823, 2655, 1413, 5511, 5501, 5513, 5506, 5518, 5517, 5520, 3501, 5522, 5524, 5535, 5686, 5525, 3499, 3499, 1413, 5543, 5551, 5526, -3018, 5541, 5550, 2660, 5556, -3018, 5577, 5681, 3212, 5570, 6089, 5571, 5581, 5597, 1413, 5588, 5587, 5601, 5589, 5606, 5612, 5616, 5619, 5640, -3018, 5643, 5638, 5646, 5052, -3018, 5654, 5055, 5657, 5656, 5671, 5661, 5670, 5675, 5676, 5677, 5683, 5672, 1413, 5673, 5709, 1413, 5731, 5678, 5106, 5737, 5689, 5740, 5295, 1413, 1413, 5690, -3018, 6122, 6124, 5694, 1413, 1413, 5700, 5701, 5738, 1413, 5750, 5702, 5743, 5746, 1413, 5751, 6028, 1413, 5770, 1413, 5771, 5775, 5798, 5780, -3018, 1413, 5782, 5803, 5809, 874, 874, 874, 874, 5811, 5810, 3502, 5817, 5841, 5826, 5827, 5832, 5831, -3018, 5845, -3018, 5844, 654, -3018, 5853, 4265, 5859, 5846, 6062, 3503, 5871, 5873, 5877, 5894, 3503, 2660, 5909, 3503, 654, 5875, 3821, 5884, 5331, 5901, 5912, 1413, 5903, 1009, 5876, 5869, 5905, 5914, 5920, 5138, 5926, 5962, 2142, 5356, 5959, 2660, 4311, 5970, 3343, 5966, 1413, 5972, 3552, 5980, 5985, 5994, 3020, 6000, 2670, 5998, -3018, 5341, 5343, 2148, 5999, 6001, 2149, 2677, 806, 2678, 2150, 2151, 2152, 2681, 6002, 6012, 6011, 6019, 6023, 6029, 2687, 6039, 6040, 6053, 6054, 6044, 6013, 6014, 2652, 6055, 5716, 6115, 6021, 5868, 5249, 6060, 2863, 1413, 2653, 6070, 6078, 3343, 4227, 6082, 3502, 2654, 6127, 6083, 6085, 6086, 6087, 6120, 5392, -3018, 6100, 6129, 5927, 5928, -3018, 2660, 6132, 6134, 6140, 6143, 6144, 2615, 2616, 2617, 2618, 2619, 2620, 2655, 6160, 6253, 6161, 6136, 6163, 4046, 6170, 6171, 6162, 6178, -3018, 3499, 6176, 6177, 6183, 6184, 6185, 6190, 3499, 6195, 6199, 6200, 6202, 3499, 6214, 6206, 3499, 6216, 3784, 6224, 6245, 6237, 6239, 6247, 6130, 6131, 6265, 6266, 6267, 3784, 796, 6285, 6283, 6304, 6302, 6303, 1413, 6306, 910, 6305, 796, 6308, 6316, 1413, 5936, 6320, 6329, 5899, 6324, 6331, 6330, 6347, 6345, 1565, 6371, 6380, 6365, 6375, 6377, 6372, 6379, 6389, 6376, 6394, 6392, 962, 6413, 6414, 6415, 6418, 6313, 6314, 6433, 6445, -3018, 6416, 6447, 6448, 6417, 4318, 962, 6436, -2025, -3018, 1231, 1232, 6456, 6460, 6334, 1566, 6481, 6462, 6489, 6473, 6474, 2615, 2616, 2617, 2618, 2619, 2620, 6490, 6493, 5937, 6499, 6495, 6501, -3018, 2656, 6504, 6339, 1413, 6506, 2657, 6512, 1484, 5805, 2067, 3022, 2615, 2616, 2617, 2618, 2619, 2620, 4063, 3795, 796, 654, 4395, 3502, 796, 796, 3712, 4981, 2863, 2658, 2343, 4974, 6248, 3884, 1592, 3836, 5728, 2020, 6069, 4542, 6071, 6114, 6346, 5124, 5781, 4970, 1567, 4971, 5468, 5763, 4373, 4336, 3939, 5958, 5390, 6396, 6340, 2659, 5931, 5663, 6397, 6135, 6133, 6264, 6357, 962, 4380, 3961, 5146, 5175, 5154, 6097, 1153, 5116, -3018, 5499, 4979, 3902, 3903, 4413, 4603, 5504, 1684, 1568, 5493, 5141, 2615, 2616, 2617, 2618, 2619, 2620, 5769, 874, 4643, 5199, 6015, 6410, 6511, 6491, 2410, 5744, 4548, 5183, 874, 6269, 5688, 5922, 960, 760, 6026, 1007, 3089, 5691, 3343, 1083, 2660, 972, 813, 2661, 4694, 5216, 5897, 5218, 972, 5687, 6406, 972, 2040, 3931, 3563, 5185, 4327, 1569, 4660, 6091, 5806, 4290, 3502, 6009, 1154, 3148, 4512, 5010, 3502, 3343, 1194, 3833, 4459, 1007, 5945, 6115, 6289, 6446, 2778, 3152, 5203, 5202, 1413, 3861, 3508, 6395, 1429, 5344, 3047, 6221, 4895, 5893, 1413, 5896, 855, 1413, 2638, 1570, 1413, 1413, 1413, 1571, 2665, 856, 3164, 5247, 5415, 656, 4288, 4300, 3518, 3499, 2726, 2725, 6219, 6072, 5685, 2730, 5425, 3181, 4261, 4863, 4847, 1413, 1413, 5618, 4254, 5858, 1413, 5857, 4896, 4255, 6431, 6205, 1572, 1573, 6322, 2662, 6061, 4256, 6459, 796, 5840, 1535, 1413, 2674, 3430, 4796, 1413, 6073, 4223, 6074, 3349, 925, 1413, 3433, 4088, 3860, 3503, 4214, 6027, 5730, 5331, 6464, 4207, 1413, 4745, 5636, 3506, 1480, 4123, 3445, 0, 1413, 0, 0, 0, 1574, 0, 4944, 0, 36, 1413, 0, 0, 0, 1575, 0, 0, 0, 0, 0, 0, 3502, 0, 1576, 0, 0, 0, 0, 0, 0, 0, 0, 1577, 0, 0, 0, 0, 0, 0, 0, 1578, 4944, 1009, 962, 0, 962, 0, 2020, 0, 0, 1153, 0, 0, 1579, 0, 0, 0, 0, 0, 0, 0, 0, 1580, 0, 0, 0, 0, 1581, 0, 6454, 0, 0, 2611, 0, 0, 0, 0, 0, 0, 973, 1009, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 6477, 0, 0, 0, 0, 0, 0, 4115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3499, 0, 0, 973, 1582, 0, 656, 0, 0, 6454, 0, 0, 0, 0, 0, 656, 982, 5115, 0, 0, 0, 3499, 874, 656, 0, 982, 656, 874, 0, 0, 3343, 0, 0, 0, 6454, 0, 2863, 0, 0, 982, 0, 0, -2782, 0, 4046, 0, 874, 0, 5768, 0, 5164, 0, 0, 5783, 0, 3499, 0, 0, 0, 0, 0, 0, 0, 0, 962, 874, 4944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 960, 5794, 0, 0, 0, 72, 972, 3291, 3292, 81, 972, 192, 972, 5796, 0, 187, 84, 181, 176, 185, 5931, 0, 1413, 0, 3328, 3329, 0, 0, 0, 0, 5639, 0, 0, 0, 0, 0, 6399, 6400, 85, 1413, 0, 0, 0, 1413, 86, 1413, 87, 937, 107, 125, 130, 160, 0, 0, 0, 3374, 179, 186, -2799, 1413, 182, 184, 0, -2782, 0, 6398, 6492, 654, 0, 0, 1413, 6337, 0, 0, 5866, 0, 1931, 0, 1933, 1934, 0, 1413, 0, 0, 0, 0, 0, 0, 1413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4046, 0, 4046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6434, 0, 0, -2782, 0, 0, 0, 0, 0, 3499, 0, 0, 0, 0, 0, 0, -2782, 2020, 0, 0, 0, 0, -2782, 0, 0, 0, 1413, 0, -2782, 0, 0, 0, 0, 0, -2782, 0, 6204, -2782, 0, 0, 0, -2782, 1413, -2799, 0, 0, 1153, 1165, 1413, 1413, 0, 0, 0, 962, 962, 962, 962, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2782, 0, 1165, 1007, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1413, 0, 0, 0, 3499, 0, 0, 0, 0, 654, 0, 0, 0, -2799, 0, 0, 0, 0, 0, 0, -2782, 0, 0, 0, 0, 0, -2799, 0, 0, 0, 0, 0, -2799, 0, 874, 0, 0, 3503, -2799, 0, 0, 0, 0, 0, -2799, 0, 0, -2799, 0, 0, 0, -2799, 0, 0, 0, 0, 5988, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2782, 0, 0, 0, -2782, 0, 0, 0, 0, -2799, -2782, 0, 0, 0, 0, 0, 0, 0, 1413, 0, 0, 0, 0, 0, 0, 0, 0, 3343, 3343, 0, 1413, 3343, 0, 0, 0, 0, 0, 0, 0, 1413, 1413, 1413, -2799, 0, 0, 2020, 0, 0, 0, 0, 0, 3821, 0, 0, 1413, 0, 0, 0, 0, 0, 0, 0, 0, 1413, 0, 1413, 0, 1413, 5636, 0, 0, -2782, 0, 0, 0, 0, 0, 0, 0, 4944, 0, 0, 0, 0, 0, 0, 1413, 0, 0, 0, 0, 0, 0, 6079, -2799, 2020, 0, 1009, -2799, 0, 3499, 874, 0, 0, -2799, 0, 1413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 982, 0, 0, 0, 811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1595, 0, 2020, 2020, 0, 982, 1596, 0, 0, 0, 0, 982, 0, 0, 0, 0, 0, 0, 6244, 0, -2782, 1703, 0, 982, 0, -2799, 0, 0, 0, 0, 0, 0, 962, 0, 0, 0, 0, 0, 0, 982, 0, 0, 0, 0, 656, -2782, 6156, -2782, -2782, 925, 0, 1598, 0, 656, 982, 0, 0, 0, 0, 0, 656, 0, 982, 656, 0, 0, 0, 0, 0, -2782, 0, 0, 0, 0, 3499, 925, 982, 0, 0, 0, 0, 0, 0, 0, 811, 0, 982, 6296, 6297, -2782, 1858, 0, -2782, -2782, -2782, 0, 0, 1413, 0, 0, 0, 1867, 0, 0, 0, 0, 1704, 0, 1599, 0, 0, 0, 1413, 0, -2799, 1600, 5866, 1875, 0, 1601, 0, 0, 1413, 0, 2148, 0, 0, 2149, 0, 0, 6222, 2150, 2151, 2152, 3552, 0, 0, 0, 982, -2799, 0, -2799, -2799, 0, 0, 0, 0, 0, 1602, 2652, 0, 0, 0, 973, 982, 0, 0, 0, 0, 2653, 0, 0, 0, -2799, 0, 962, 2654, 0, 0, 0, 0, 0, 2020, 0, 0, 656, 656, 0, 0, 3471, 3473, 3499, 0, -2799, 1603, 3481, -2799, -2799, -2799, 0, 0, 0, 2655, 0, 0, 0, 0, 2863, 0, 982, 0, 656, 0, 0, 1413, 0, 0, 0, 0, 0, 0, 0, 0, 6270, 4944, 0, 0, 3527, 3527, 0, 0, 0, 973, 973, 6299, 925, 0, 0, 1413, 0, 0, 0, 0, 0, 192, 0, 0, 0, 6294, 0, 6291, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 2020, 2020, 6315, 0, 0, 0, 0, 0, 1413, 1413, 982, 0, 1413, 1705, 0, 6323, 0, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1606, 796, 0, 0, 6292, 6293, 0, 722, 0, 0, 1607, 0, 2020, 0, 0, 2069, 810, 0, 962, 6370, 0, 0, 1608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6156, 962, 962, 0, 0, 0, 4944, 0, 0, 0, 2658, 2343, 0, 0, 0, 1706, 0, 0, 1610, 1611, 3499, 0, 0, 192, 654, 0, 0, 6294, 0, 6291, 0, 1413, 0, 0, 0, 0, 0, 3664, 2659, 6388, 656, 656, 1837, 0, 0, 0, 0, 1413, 0, 982, 1707, 0, 0, 3552, 656, 0, 0, 0, 4311, 925, 656, 0, 0, 0, 656, 0, 656, 0, 1413, 0, 925, 0, 6292, 6293, 1595, 0, 0, 6502, 6503, 0, 1596, 2410, 0, 0, 0, 0, 925, 0, 0, 0, 0, 4046, 0, 0, 0, 1703, 0, 2660, 0, 0, 2661, 0, 0, 0, 6419, 6420, 654, 6424, 0, 0, 0, 0, 5866, 0, 0, 0, 0, 1413, 0, 0, 0, 0, 0, 1613, 0, 1598, 796, 0, 962, 0, 656, 4944, 656, 656, 796, 3499, 0, 796, 0, 0, 0, 3499, 0, 960, 0, 0, 960, 0, 192, 796, 0, 6388, 6294, 0, 6291, 0, 972, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 972, 0, 982, 972, 0, 0, 0, 1413, 654, 1704, 0, 1599, 0, 0, 0, 0, 0, 0, 1600, 0, 0, 0, 1601, 2662, 654, 0, 6292, 6293, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 973, 973, 0, 0, 6505, 0, 6388, 0, 0, 0, 1602, 0, 972, 0, 0, 0, 972, 972, 0, 0, 0, 0, 982, 6388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 982, 0, 0, 0, 0, 0, 0, 0, 0, 1603, 982, 982, 0, 0, 925, 0, 982, 3499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 982, 0, 1662, 0, 0, 982, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 2148, 0, 2611, 2149, 0, 0, 1663, 2150, 2151, 2152, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 2912, 4131, 2652, 0, 4132, 0, 0, 0, 0, 4954, 0, 0, 2653, 0, 0, 0, 1705, 0, 656, 2654, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1606, 0, 0, 0, 1664, 4964, 0, 0, 0, 0, 1607, 0, 2798, 0, 2655, 0, 656, 656, 656, 0, 656, 0, 1608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 2148, 796, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 4965, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3792, 0, 2652, 1610, 1611, 0, 4061, 0, 796, 4966, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1665, 0, 1595, 3793, 0, 0, 0, 0, 1596, 0, 0, 0, 0, 2655, 0, 0, 0, 0, 1837, 0, 0, 0, 0, 1597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 2656, 0, 0, 656, 656, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1598, 0, 656, 0, 0, 1666, 0, 0, 925, 0, 1667, 2658, 2343, 0, 0, 1668, 0, 0, 0, 2148, 0, 0, 2149, 1613, 0, 0, 2150, 2151, 2152, 0, 0, 2967, 0, 0, 0, 4967, 0, 0, 0, 2659, 0, 0, 0, 0, 2652, 3051, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 3062, 1599, 0, 0, 0, 2654, 0, 0, 1600, 0, 0, 1670, 1601, 0, 0, 0, 3080, 0, 1595, 0, 925, 0, 0, 2656, 1596, 0, 2410, 0, 2657, 0, 0, 2655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1602, 2660, 0, 0, 2661, 0, 0, 0, 0, 1084, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 1672, 925, 0, 0, 0, 0, 0, 0, 0, 1598, 3154, 0, 0, 0, 0, 0, 0, 1603, 4246, 2659, 0, 0, 0, 0, 1673, 3166, 0, 0, 1165, 3170, 0, 0, 0, 0, 925, 0, 0, 0, 0, 0, 1152, 722, 0, 0, 0, 1675, 0, 4968, 0, 0, 4384, 0, 0, 0, 0, 0, 0, 0, 0, 3189, 1165, 0, 2410, 0, 0, 0, 1599, 0, 4295, 4295, 0, 0, 0, 1600, 0, 0, 0, 1601, 2660, 2662, 0, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 1676, 1604, 0, 0, 982, 1605, 0, 0, 0, 0, 1602, 0, 0, 0, 0, 188, 1606, 0, 0, 656, 656, 656, 2658, 2343, 0, 0, 1607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, 1608, 0, 1251, 1254, 0, 1152, 1257, 0, 1603, 0, 0, 0, 2659, 0, 0, 2148, 0, 1271, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 2889, 0, 0, 0, 0, 936, 0, 1292, 0, 0, 0, 2652, 2662, 0, 1609, 0, 0, 1610, 1611, 0, 0, 2653, 0, 2611, 0, 0, 2410, 0, 2654, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 2660, 0, 0, 2661, 0, 0, 4133, 1612, 0, 0, 982, 0, 2655, 0, 0, 0, 0, 1705, 3376, 0, 0, 1605, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1606, 925, 0, 0, 0, 0, 0, 0, 0, 0, 1607, 0, 0, 1837, 0, 0, 0, 925, 0, 0, 0, 0, 1608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 982, 0, 0, 0, 0, 0, 0, 0, 982, 2611, 0, 0, 1613, 0, 0, 0, 982, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 2662, 949, 0, 1610, 1611, 4184, 925, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 656, 0, 0, 925, 0, 0, 925, 925, 0, 0, 656, 656, 0, 982, 982, 0, 2656, 1612, 0, 0, 0, 2657, 0, 0, 0, 656, 0, 982, 656, 0, 0, 0, 0, 0, 0, 0, 0, 925, 925, 0, 982, 982, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1152, 0, 0, 0, 0, 0, 0, 0, 0, 960, 0, 0, 972, 2659, 972, 972, 0, 723, 0, 656, 0, 0, 3270, 656, 656, 2148, 0, 0, 2149, 0, 2611, 1613, 2150, 2151, 2152, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 2652, 0, 3372, 0, 0, 0, 2410, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 796, 2654, 0, 0, 1595, 0, 2660, 726, 3271, 2661, 1596, 0, 1595, 0, 656, 0, 656, 0, 1596, 0, 0, 656, 656, 4592, 727, 0, 0, 2655, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 0, 1067, 0, 656, 3981, 656, 0, 656, 656, 656, 656, 656, 656, 0, 1598, 656, 0, 656, 656, 0, 0, 656, 1598, 0, 0, 3272, 0, 0, 1565, 0, 0, 0, 0, 0, 0, 925, 656, 656, 656, 730, 0, 0, 0, 0, 0, 0, 0, 0, 731, 0, 0, 0, 0, 0, 656, 0, 1837, 0, 0, 0, 0, 732, 2662, 0, 1566, 0, 0, 3273, 0, 0, 0, 1599, 0, 0, 0, 0, 0, 0, 1600, 1599, 0, 0, 1601, 0, 2045, 0, 1600, 0, 0, 0, 1601, 0, 0, 1152, 1070, 0, 0, 0, 0, 2055, 2056, 0, 0, 1152, 1152, 2656, 0, 0, 0, 0, 2657, 1602, 0, 0, 0, 0, 0, 0, 0, 1602, 0, 0, 0, 0, 0, 0, 0, 0, 1567, 0, 1152, 0, 3274, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 796, 0, 0, 0, 0, 1603, 0, 0, 0, 0, 0, 0, 736, 1603, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 1568, 0, 0, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 4125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 2410, 0, 0, 653, 0, 0, 3982, 0, 0, 0, 0, 1569, 0, 0, 0, 2144, 2660, 3981, 0, 2661, 0, 0, 0, 1705, 2146, 0, 0, 1605, 0, 0, 0, 1705, 0, 214, 3275, 1605, 0, 741, 1606, 0, 2636, 1565, 0, 0, 0, 0, 1606, 0, 1607, 0, 0, 0, 656, 0, 0, 1571, 1607, 0, 0, 0, 1608, 0, 0, 0, 1074, 0, 0, 3276, 1608, 0, 0, 0, 0, 0, 745, 0, 0, 1566, 0, 0, 0, 746, 0, 0, 747, 0, 0, 0, 0, 1573, 0, 0, 0, 188, 0, 0, 0, 1535, 0, 0, 0, 0, 0, 1733, 748, 0, 1610, 1611, 0, 656, 0, 2822, 1076, 2662, 1610, 1611, 0, 0, 0, 750, 0, 0, 1077, 0, 0, 0, 0, 752, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 1734, 0, 3983, 1567, 3277, 0, 0, 0, 2823, 0, 0, 1576, 0, 0, 0, 0, 0, 0, 0, 0, 1577, 960, 0, 0, 972, 0, 972, 972, 2840, 0, 0, 757, 0, 0, 0, 0, 0, 0, 0, 0, 1568, 1579, 0, 0, 0, 0, 0, 0, 188, 936, 1580, 0, 0, 0, 0, 1581, 0, 3611, 0, 0, 0, 0, 0, 3619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1613, 0, 0, 3984, 0, 0, 0, 0, 1613, 2611, 0, 0, 3982, 0, 0, 0, 0, 1569, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 4544, 0, 0, 0, 0, 3662, 0, 0, 0, 1582, 0, 0, 0, 3985, 0, 0, 0, 1595, 0, 0, 0, 0, 0, 1596, 0, 0, 0, 0, 0, 0, 1571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 796, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 656, 656, 656, 656, 656, 656, 656, 656, 0, 656, 0, 1573, 0, 0, 0, 1598, 0, 796, 2972, 1535, 656, 0, 656, 0, 0, 0, 2980, 0, 0, 0, 0, 796, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 796, 656, 0, 0, 656, 0, 656, 0, 0, 656, 0, 0, 0, 656, 0, 36, 0, 0, 0, 0, 1575, 0, 949, 0, 188, 0, 0, 0, 0, 1576, 1599, 0, 0, 0, 1837, 0, 656, 1600, 1577, 653, 0, 1601, 653, 0, 0, 0, 2840, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 1595, 1579, 0, 0, 656, 656, 1596, 0, 0, 0, 1580, 0, 1602, 0, 0, 1581, 0, 0, 1231, 1232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -136, 982, 653, 0, 0, 0, 3984, 0, 925, 0, 653, 0, 925, 925, 0, 0, 0, 0, 1603, 982, 1, 1598, 0, 982, 0, 0, 0, 982, 0, 0, 0, 2, 3889, 3, 4, 0, 0, 982, 0, 0, 0, 0, 0, 1582, 0, 0, 0, 3985, 0, 0, 0, 5, 982, 0, 0, 656, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 656, 0, 925, 656, 0, 656, 656, 7, 925, 8, 9, 796, 1599, 0, 0, 0, 10, 0, 11, 1600, 982, 0, 0, 1601, 0, 0, 0, 0, 0, 0, 0, 12, 1604, 13, 0, 0, 1605, 0, 982, 982, 0, 0, 0, 0, 3110, 0, 0, 1606, 3115, 0, 14, 0, 1602, 15, 925, 0, 0, 1607, 0, 0, 0, 0, 1565, 0, 796, 0, 0, 0, 16, 1608, 17, 0, 0, 0, 18, 0, 1837, 982, 0, 0, 1837, 19, 0, 0, 0, 0, 0, 0, 1603, 0, 0, 20, 0, 21, 0, 0, 0, 0, 1566, 0, 22, 0, 0, 0, 982, 0, 1837, 0, 0, 0, 982, 0, 2905, 0, 0, 1610, 1611, 0, 23, 0, 0, 0, 0, 0, 982, 0, 0, 0, 0, 0, 0, 982, 0, 0, 982, 24, 0, 0, 0, 0, 982, 0, 0, 0, 0, 0, 188, 2906, 0, 0, 4064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 982, 0, 1567, 0, 0, 4074, 982, 0, 1705, 0, 4079, 0, 1605, 982, 0, 0, 1595, 0, 0, 0, 0, 0, 1596, 1606, 0, 0, 0, 982, 3252, 25, 26, 0, 0, 1607, 3254, 27, 0, 0, 0, 1568, 4105, 982, 0, 0, 0, 1608, 1837, 0, 0, 0, 28, 0, 982, 0, 0, 0, 0, 0, 0, 0, 1613, 0, 0, 0, 0, 0, 0, 1598, 0, 29, 656, 656, 656, 2090, 0, 0, 656, 0, 0, 0, 3302, 0, 0, 0, 0, 0, 0, 0, 3647, 1569, 0, 1610, 1611, 2099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 925, 0, 0, 0, 0, 30, 0, 0, 1837, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 1612, 1599, 0, 0, 0, 0, 1570, 0, 1600, 0, 1571, 32, 1601, 0, 0, 0, 33, 34, 0, 35, 0, 0, 656, 0, 36, 0, 0, 0, 0, 2140, 37, 0, 0, 38, 0, 0, 0, 0, 0, 0, 39, 1602, 0, 1636, 1573, 796, 0, 40, 41, 0, 0, 796, 1535, 0, 925, 42, 796, 0, 925, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 1613, 0, 0, 0, 1603, 0, 0, 0, 0, 0, 5418, 5419, 0, 1637, 45, 5422, 5423, 36, 0, 0, 0, 0, 1575, 0, 0, 0, 0, 0, 0, 0, 0, 1576, 0, 0, 0, 46, 0, 0, 0, 0, 1577, 0, 0, 0, 0, 0, 0, 47, 1638, 0, 0, 0, 0, 48, 0, 0, 0, 0, 49, 0, 0, 1579, 0, 0, 0, 0, 949, 949, 0, 949, 1580, 982, 50, 1837, 0, 1581, 0, 0, 0, 0, 922, 0, 0, 0, 1705, 0, 0, 0, 1605, 0, 982, 0, 925, 0, 982, 0, 51, 0, 0, 1606, 0, 982, 0, 0, 0, 656, 0, 925, 656, 1607, 656, 656, 925, 0, 0, 57, 0, 0, -136, 0, 656, 1608, 1595, 0, 0, 656, 0, 0, 1596, 0, 0, 0, 0, 1582, 0, 0, 0, 0, 0, 0, 0, 0, 925, 0, 0, 0, 0, 4344, 0, 2148, 0, 0, 2149, 0, 0, 4347, 2150, 2151, 2152, 0, 0, 0, 0, 0, 3839, 0, 0, 1610, 1611, 0, 0, 0, 0, 1598, 656, 656, 656, 0, 0, 656, 0, 0, 0, 0, 2653, 0, 0, 656, 656, 656, 656, 2654, 0, 2148, 0, 0, 2149, 0, 1837, 3840, 2150, 2151, 2152, 656, 1837, 0, 656, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 2652, 0, 656, 656, 0, 0, 656, 0, 0, 0, 2653, 0, 1599, 0, 0, 0, 0, 2654, 0, 1600, 0, 0, 0, 1601, 0, 0, 656, 0, 656, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4445, 2655, 4447, 0, 0, 0, 0, 656, 0, 0, 1602, 0, 1613, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1603, 0, 653, 2652, 0, 0, 653, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 656, 0, 0, 656, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 656, 0, 2657, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 0, 0, 4508, 656, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 2656, 656, 0, 0, 0, 2657, 1705, 0, 0, 0, 1605, 0, 2659, 925, 0, 0, 925, 0, 925, 0, 0, 1606, 4530, 925, 0, 0, 0, 0, 2658, 2343, 0, 1607, 0, 0, 0, 0, 0, 653, 982, 982, 0, 0, 796, 1608, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 2659, 0, 0, 982, 0, 0, 982, 0, 0, 925, 0, 0, 0, 0, 0, 2660, 0, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4357, 0, 0, 1610, 1611, 2656, 0, 0, 0, 0, 2657, 0, 925, 2410, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 3662, 2658, 2343, 4358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1837, 1837, 1837, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4673, 0, 0, 0, 0, 0, 2662, 982, 0, 0, 0, 0, 0, 0, 0, 0, 925, 0, 925, 0, 0, 0, 1152, 0, 0, 0, 982, 0, 2410, 0, 0, 0, 1613, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 1595, 2661, 982, 0, 2662, 0, 1596, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1257, 0, 0, 0, 0, 0, 0, 4731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1598, 0, 0, 0, 0, 0, 188, 0, 0, 0, 653, 653, 0, 0, 0, 0, 2611, 925, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 0, 3308, 4763, 982, 0, 0, 2662, 0, 656, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 1599, 0, 0, 2611, 925, 0, 3361, 1600, 4784, 1257, 0, 1601, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1837, 925, 1257, 0, 796, 0, 982, 0, 982, 1602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 982, 0, 982, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 1603, 0, 0, 0, 0, 0, 0, 1565, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 3827, 0, 0, 925, 3831, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 4732, 0, 0, 1566, 0, 982, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3864, 0, 3864, 0, 3864, 3864, 925, 0, 0, 3864, 3864, 3864, 0, 3864, 3864, 3864, 0, 0, 1705, 0, 0, 2148, 1605, 0, 2149, 982, 0, 0, 2150, 2151, 2152, 0, 0, 1606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1607, 982, 1567, 2652, 0, 982, 0, 0, 0, 0, 0, 0, 1608, 2653, 0, 653, 0, 0, 3390, 0, 2654, 0, 653, 0, 3941, 0, 0, 653, 0, 982, 653, 5327, 0, 0, 0, 0, 0, 0, 0, 1568, 0, 0, 0, 0, 0, 656, 2655, 0, 925, 3969, 0, 0, 0, 0, 656, 4430, 922, 0, 1610, 1611, 0, 0, 0, 0, 0, 0, 0, 0, 656, 6112, 0, 0, 656, 656, 656, 0, 0, 0, 0, 656, 0, 0, 656, 0, 0, 656, 0, 0, 1565, 1569, 4431, 656, 0, 656, 0, 0, 656, 0, 0, 0, 925, 656, 656, 656, 656, 0, 0, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 0, 0, 0, 656, 656, 656, 0, 1566, 925, 0, 0, 0, 0, 656, 0, 0, 1571, 0, 656, 0, 1837, 0, 656, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 656, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 723, 1152, 1613, 0, 2656, 724, 1573, 656, 0, 2657, 656, 656, 0, 656, 1535, 0, 656, 656, 0, 0, 0, 656, 0, 656, 0, 0, 0, 1567, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 725, 0, 0, 0, 0, 0, 656, 0, 0, 36, 0, 2839, 656, 726, 1575, 922, 0, 2659, 0, 0, 656, 1568, 0, 1576, 656, 0, 922, 0, 0, 0, 727, 0, 1577, 0, 0, 0, 0, 0, 0, 0, 2840, 0, 922, 0, 0, 0, 0, 0, 728, 5127, 0, 0, 0, 1579, 0, 0, 0, 656, 0, 0, 2410, 0, 1580, 0, 0, 0, 0, 1581, 0, 0, 0, 1569, 729, 5476, 656, 0, 2660, 0, 0, 2661, 925, 0, 0, 0, 0, 0, 730, 0, 0, 0, 0, 0, 0, 0, 0, 731, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 982, 0, 732, 0, 0, 1570, 0, 0, 733, 1571, 0, 0, 0, 0, 0, 734, 0, 0, 0, 1582, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 735, 0, 0, 2150, 2151, 2152, 0, 1653, 1573, 3390, 0, 0, 0, 0, 0, 0, 1535, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 1837, 0, 2653, 2662, 0, 1837, 925, 1837, 0, 2654, 0, 0, 0, 0, 3491, 0, 0, 0, 0, 0, 0, 1654, 0, 0, 0, 36, 0, 0, 0, 0, 1575, 736, 0, 1837, 925, 2655, 0, 0, 0, 1576, 0, 2054, 0, 0, 0, 0, 0, 0, 1577, 922, 0, 0, 0, 0, 0, 0, 1655, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1579, 0, 0, 0, 0, 0, 0, 737, 0, 1580, 982, 0, 0, 982, 1581, 0, 0, 0, 0, 0, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 739, 0, 0, 0, 0, 0, 2611, 0, 0, 0, 214, 740, 653, 0, 741, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 4805, 0, 0, 0, 0, 653, 0, 0, 1152, 1582, 0, 0, 0, 742, 656, 0, 743, 0, 0, 0, 744, 0, 2656, 745, 0, 0, 0, 2657, 0, 0, 746, 0, 0, 747, 0, 0, 0, 0, 0, 653, 0, 982, 982, 0, 0, 925, 0, 6452, 0, 0, 2658, 2343, 982, 748, 0, 0, 0, 0, 0, 656, 656, 749, 0, 0, 0, 0, 0, 0, 750, 982, 0, 751, 0, 0, 0, 5366, 752, 972, 2659, 0, 0, 0, 0, 0, 753, 0, 754, 0, 0, 0, 0, 755, 925, 0, 0, 0, 4418, 925, 656, 656, 0, 0, 0, 0, 0, 756, 0, 0, 6452, 656, 0, 0, 0, 0, 0, 0, 0, 0, 757, 0, 0, 2410, 972, 0, 0, 0, 0, 0, 0, 5404, 0, 0, 0, 6452, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 982, 5420, 0, 1837, 4467, 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, 656, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 5448, 4510, 0, 0, 0, 0, 0, 0, 0, 0, 922, 2662, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 656, 656, 0, 925, 0, 0, 0, 656, 656, 0, 0, 653, 656, 0, 0, 0, 0, 656, 0, 3864, 656, 922, 656, 0, 0, 0, 0, 0, 656, 0, 0, 4541, 4541, 0, 0, 0, 0, 0, 0, 0, 0, 4557, 0, 0, 0, 0, 1152, 0, 1152, 656, 0, 0, 0, 0, 922, 0, 656, 0, 0, 0, 0, 656, 0, 0, 656, 656, 0, 0, 0, 0, 0, 188, 656, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 656, 5534, 0, 4613, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 4912, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 925, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 4649, 1152, 0, 0, 982, 0, 0, 0, 0, 656, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 5971, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 925, 0, 0, 0, 913, 653, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 0, 982, 0, 0, 0, 0, 925, 0, 0, 0, 0, 0, 0, 982, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 2148, 0, 0, 2149, 0, 0, 656, 2150, 2151, 2152, 0, 0, 4508, 0, 0, 0, 0, 982, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 922, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 922, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 925, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 2140, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 0, 653, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 656, 0, 0, 0, 0, 1837, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2140, 922, 0, 0, 0, 0, 2658, 2343, 982, 4806, 0, 0, 0, 0, 0, 656, 922, 0, 0, 922, 922, 0, 0, 4217, 0, 0, 662, 0, 0, 0, 0, 0, 711, 662, 2659, 0, 0, 0, 763, 4221, 662, 0, 0, 0, 0, 0, 662, 0, 0, 831, 922, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 925, 0, 925, 0, 0, 0, 0, 885, 885, 0, 0, 0, 653, 0, 0, 0, 2410, 0, 0, 2656, 0, 0, 2148, 0, 2657, 2149, 0, 0, 0, 2150, 2151, 2152, 2660, 0, 982, 2661, 0, 4253, 0, 0, 4259, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 656, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 656, 0, 0, 656, 0, 2659, 656, 656, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3491, 0, 2655, 0, 936, 0, 0, 0, 3491, 0, 0, 0, 0, 656, 656, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 972, 0, 0, 656, 0, 0, 0, 656, 0, 0, 2662, 0, 0, 656, 0, 2660, 0, 656, 2661, 0, 0, 0, 0, 925, 656, 0, 0, 0, 0, 0, 0, 0, 656, 0, 922, 0, 0, 0, 656, 964, 0, 656, 0, 968, 0, 0, 0, 982, 0, 982, 0, 1011, 0, 0, 1013, 0, 0, 1018, 1019, 0, 1022, 653, 1025, 4557, 0, 1031, 0, 1033, 0, 972, 972, 0, 656, 0, 0, 0, 0, 0, 2069, 0, 0, 0, 0, 2069, 2069, 0, 0, 0, 0, 0, 2656, 5016, 0, 0, 0, 2657, 0, 0, 0, 925, 982, 0, 0, 0, 0, 0, 5030, 0, 0, 5031, 656, 5032, 2662, 0, 0, 0, 0, 2611, -3018, -3018, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 4937, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 1837, 0, 0, 0, 0, 656, 0, 5072, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3864, 0, 0, 653, 0, 3864, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, -3018, 0, 0, 0, 0, 0, 0, 0, 6010, 0, 0, 6374, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 2611, 0, 925, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 5144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 656, 0, 0, 0, 0, 0, 0, 0, 6066, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 656, 0, 656, 0, 924, 5178, 0, 0, 4557, 6422, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 656, 0, 2662, 0, 0, 0, 0, 653, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 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, 0, 0, 5221, 0, 0, 6422, 0, 0, 5228, 5228, 5228, 5228, 0, 5228, 5228, 5228, 5228, 5228, 0, 0, 656, 6488, 0, 0, 913, 0, 925, 0, 0, 0, 0, 925, 925, 0, 0, 0, 656, 0, 972, 972, 0, 0, 656, 656, 982, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 982, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 924, 656, 0, 0, 0, 0, 0, 188, 0, 0, 656, 0, 0, 1837, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 925, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 656, 1837, 1102, 0, 0, 0, 913, 0, 0, 1115, 1116, 0, 656, 1122, 0, 1126, 1127, 0, 0, 0, 0, 656, 656, 656, 0, 0, 0, 0, 0, 0, 1149, 0, 0, 0, 0, 0, 656, 1837, 0, 0, 925, 0, 0, 0, 0, 656, 0, 656, 1162, 656, 0, 0, 0, 1752, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 656, 1190, 0, 1192, 924, 0, 0, 0, 0, 0, 0, 0, 0, 1208, 0, 924, 0, 0, 0, 0, 656, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1837, 662, 0, 982, 0, 922, 0, 0, 0, 922, 922, 0, 0, 0, 0, 0, 2140, 0, 0, 0, 2140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 913, 0, 0, 0, 0, 0, 0, 0, 0, 922, 3491, 913, 0, 0, 3491, 922, 0, 0, 0, 0, 0, 5446, 5447, 0, 0, 0, 0, 913, 0, 0, 0, 0, 2148, 885, 3864, 2149, 3864, 3864, 3864, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 922, 0, 0, 0, 656, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 982, 0, 0, 6430, 0, 0, 0, 0, 2655, 0, 0, 5500, 0, 0, 656, 924, 0, 0, 0, 0, 0, 0, 0, 0, 982, 0, 1556, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5528, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 656, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 656, 656, 0, 0, 0, 0, 656, 0, 0, 0, 0, 5228, 0, 2655, 0, 0, 0, 1736, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 656, 656, 0, 0, 656, 1857, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 1869, 0, 1870, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1873, 0, 0, 2658, 2343, 0, 0, 1883, 0, 0, 0, 0, 982, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 1935, 0, 1937, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 2656, 0, 0, 0, 0, 2657, 656, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 2660, 2658, 2343, 2661, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 922, 0, 656, 3491, 0, 0, 0, 2761, 0, 0, 0, 0, 0, 4557, 0, 2659, 0, 0, 0, 0, 0, 0, 662, 0, 662, 0, 662, 0, 662, 188, 662, 662, 662, 0, 0, 0, 0, 662, 0, 0, 656, 0, 0, 0, 0, 925, 0, 0, 0, 2041, 0, 656, 0, 0, 0, 0, 0, 0, 2410, 3864, 0, 0, 0, 0, 0, 656, 0, 0, 5729, 0, 0, 0, 1837, 0, 2660, 2761, 0, 2661, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 922, 0, 0, 0, 0, 656, 656, 0, 0, 924, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 922, 2148, 656, 0, 2149, 0, 1837, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 656, 656, 0, 924, 0, 0, 0, 2652, 0, 0, 0, 922, 1837, 0, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 2662, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 0, 0, 0, 2655, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 5258, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1752, 1752, 1752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 885, 0, 913, 0, 0, 0, 915, 0, 0, 3491, 0, 0, 0, 0, 3491, 0, 0, 3491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 2611, 0, 0, 0, 188, 188, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 5296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 0, 1152, 0, 0, 0, 5947, 0, 1595, 0, 0, 0, 0, 0, 1596, 0, 0, 0, 0, 0, 0, 1662, 924, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1663, 0, 2820, 0, 0, 0, 924, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 1598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 922, 0, 922, 2410, 1664, 0, 0, 922, 0, 0, 0, 0, 924, 0, 0, 915, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 1599, 2917, 924, 913, 0, 924, 924, 1600, 0, 2148, 0, 1601, 2149, 0, 913, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 913, 0, 922, 0, 2652, 0, 924, 924, 0, 0, 1602, 0, 0, 0, 2653, 0, 2148, 0, 0, 2149, 0, 2654, 0, 2150, 2151, 2152, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 1665, 0, 0, 0, 1603, 2655, 0, 0, 0, 2653, 0, 0, 913, 0, 0, 0, 2654, 0, 0, 2662, 0, 916, 0, 0, 0, 0, 0, 913, 0, 0, 913, 913, 0, 0, 0, 0, 0, 0, 0, 0, 1152, 0, 2655, 188, 6118, 0, 6119, 916, 0, 0, 6125, 6126, 0, 0, 0, 0, 0, 0, 1666, 0, 0, 913, 913, 1667, 0, 922, 0, 922, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 1669, 0, 1752, 0, 1605, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 1606, 1752, 0, 0, 1752, 0, 0, 0, 0, 915, 1607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1670, 1608, 0, 0, 2656, 0, 2611, 0, 924, 2657, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 3048, 0, 5300, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 922, 1671, 0, 2657, 1610, 1611, 1672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2659, 3084, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 1673, 0, 0, 0, 916, 0, 1674, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 3491, 1675, 0, 0, 2659, 0, 0, 0, 0, 0, 2410, 0, 913, 0, 3149, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 3167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, -136, 0, 0, 1676, 0, 0, 0, 0, 0, 0, 1613, 3187, 0, 3188, 2660, 0, 0, 2661, 0, 0, 1, 0, 0, 915, 0, 0, 0, 0, 3197, 0, 3198, 2, 0, 3, 4, 0, 662, 0, 662, 0, 662, 922, 662, 0, 662, 0, 0, 0, 662, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 922, 0, 0, 918, 0, 0, 0, 0, 0, 0, 7, 2662, 8, 9, 0, 0, 0, 0, 0, 10, 0, 11, 922, 0, 1152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 916, 13, 0, 0, 0, 0, 0, 0, 0, 0, 3261, 916, 0, 2662, 0, 0, 0, 0, 14, 188, 0, 15, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 17, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, 188, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 21, 0, 0, 188, 0, 0, 0, 22, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 23, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 24, 0, 5575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 0, 922, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 5586, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 6453, 2140, 0, 0, 25, 26, 0, 2636, 0, 0, 27, 6457, 0, 0, 0, 2148, 0, 0, 2149, 0, 915, 0, 2150, 2151, 2152, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 29, 2148, 0, 6483, 2149, 0, 2653, 916, 2150, 2151, 2152, 0, 0, 2654, 0, 0, 0, 6453, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 2655, 30, 0, 6453, 2654, 915, 5308, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 1752, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 2655, 33, 34, 0, 35, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 37, 915, 0, 38, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 40, 41, 0, 3491, 0, 188, 0, 0, 42, 0, 922, 0, 43, 0, 0, 0, 0, 915, 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, 0, 0, 0, 0, 0, 919, 0, 0, 0, 2656, 0, 0, 0, 46, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3559, 47, 0, 0, 2761, 3565, 0, 48, 0, 0, 0, 0, 49, 2658, 2343, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 2659, 188, 2658, 2343, 0, 0, 0, 0, 0, 51, 0, 52, 53, 54, 55, 56, 0, 0, 0, 924, 0, 922, 0, 0, 0, 924, 0, 0, 57, 0, 2659, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 2660, 913, 913, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 916, 0, 0, 0, 0, 0, 0, 913, 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, 916, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 916, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 915, 0, 0, 915, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 915, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 188, 0, 2611, 0, 0, 0, 0, 0, 3555, 3556, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 924, 0, 0, 0, 5596, 188, 0, 3571, 3572, 0, 3574, 3575, 2611, 0, 0, 0, 3578, 3579, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 3590, 0, 0, 5660, 3593, 0, 0, 0, 3596, 3597, 0, 0, 3600, 3601, 0, 0, 0, 0, 0, 3606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2761, 3638, 0, 0, 2761, 0, 3640, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3646, 0, 922, 916, 3652, 913, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 3663, 0, 915, 3667, 0, 3669, 3672, 3674, 0, 0, 0, 0, 3682, 3685, 916, 6369, 0, 0, 0, 0, 0, 918, 3698, 0, 0, 0, 0, 0, 3708, 0, 0, 0, 3711, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3721, 3722, 0, 0, 0, 3727, 0, 0, 0, 0, 0, 3736, 3737, 0, 0, 0, 0, 0, 913, 0, 0, 0, 913, 0, 916, 3746, 0, 0, 3747, 0, 0, 0, 924, 0, 0, 3759, 3760, 0, 0, 916, 0, 3764, 916, 916, 0, 0, 0, 924, 0, 0, 0, 0, 924, 3771, 0, 0, 3774, 0, 0, 922, 0, 3777, 2148, 0, 0, 2149, 0, 3780, 3781, 2150, 2151, 2152, 0, 916, 916, 3789, 0, 0, 0, 3791, 0, 0, 924, 3798, 3799, 3800, 3801, 2652, 3803, 0, 0, 0, 0, 0, 0, 0, 188, 2653, 0, 0, 0, 0, 3829, 3830, 2654, 3832, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 3842, 3843, 3844, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 2655, 0, 0, 0, 0, 922, 0, 0, 0, 0, 918, 0, 0, 0, 913, 0, 0, 0, 0, 913, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 918, 0, 0, 2150, 2151, 2152, 3896, 0, 0, 0, 0, 0, 913, 0, 3920, 0, 0, 919, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 3932, 0, 0, 0, 0, 2654, 0, 922, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 2655, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 4000, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4014, 0, 4016, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 2761, 0, 0, 3565, 0, 3565, 0, 0, 0, 0, 2761, 918, 0, 0, 0, 2410, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 919, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 4081, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2761, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 913, 0, 913, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 2660, 0, 0, 2661, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 923, 0, 0, 0, 0, 924, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 2662, 0, 915, 915, 0, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 5693, 0, 918, 0, 0, 913, 924, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 1752, 915, 0, 0, 0, 0, 1752, 0, 0, 0, 0, 0, 0, 0, 0, 924, 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, 922, 3565, 2611, 0, 0, 915, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 5695, 0, 913, 0, 0, 4342, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4349, 0, 0, 0, 4349, 0, 0, 0, 0, 4360, 4361, 4362, 0, 0, 919, 0, 0, 0, 0, 0, 0, 918, 0, 924, 913, 0, 0, 0, 0, 0, 0, 4374, 0, 0, 0, 0, 1595, 0, 0, 0, 0, 0, 1596, 0, 0, 3565, 0, 0, 0, 1662, 0, 0, 913, 0, 0, 4405, 4406, 4407, 4408, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 1663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1598, 0, 0, 0, 0, 0, 4429, 0, 4433, 4434, 4435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 922, 922, 0, 0, 0, 0, 913, 0, 0, 1664, 0, 0, 916, 0, 0, 0, 916, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 1599, 0, 0, 0, 0, 0, 0, 1600, 924, 0, 0, 1601, 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, 1602, 0, 916, 0, 0, 0, 0, 0, 916, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 4518, 1665, 0, 0, 921, 1603, 0, 0, 0, 4524, 918, 0, 0, 922, 924, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 918, 915, 0, 0, 0, 915, 0, 0, 913, 4534, 4535, 0, 0, 0, 4536, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1666, 0, 0, 4579, 0, 1667, 0, 0, 0, 0, 1668, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 918, 0, 0, 0, 0, 1669, 913, 0, 0, 1605, 0, 0, 0, 0, 0, 918, 0, 0, 918, 918, 1606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1607, 913, 0, 0, 4616, 919, 0, 0, 0, 4622, 0, 1670, 1608, 0, 0, 4628, 0, 0, 0, 918, 918, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 921, 4667, 919, 0, 915, 0, 0, 0, 0, 0, 0, 3765, 0, 0, 1610, 1611, 1672, 2148, 0, 2761, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 4682, 0, 4683, 0, 915, 919, 0, 0, 0, 0, 1673, 0, 2652, 0, 0, 0, 3766, 0, 0, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 1675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 2655, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1676, 0, 923, 3565, 913, 0, 0, 1613, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 3565, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 1021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1040, 2656, 0, 0, 0, 0, 2657, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 919, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 2659, 0, 0, 916, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 916, 0, 915, 924, 0, 915, 0, 915, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 0, 919, 0, 0, 0, 916, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 919, 0, 0, 919, 919, 0, 0, 0, 0, 3565, 0, 0, 0, 915, 2761, 0, 0, 0, 0, 0, 0, 915, 0, 4919, 0, 4920, 0, 0, 0, 0, 0, 0, 0, 0, 919, 919, 0, 0, 4927, 0, 0, 0, 0, 921, 0, 0, 915, 0, 0, 0, 4933, 0, 0, 0, 4936, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 2148, 4950, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4976, 0, 0, 0, 2652, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 923, 4980, 0, 913, 2654, 0, 0, 0, 913, 4984, 0, 923, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 915, 0, 915, 0, 923, 0, 0, 2655, 0, 0, 0, 5019, 0, 0, 0, 5023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5033, 5034, 5035, 5036, 0, 0, 0, 0, 0, 0, 5040, 5041, 5042, 5043, 0, 0, 0, 924, 0, 5045, 5046, 0, 0, 0, 0, 5053, 5054, 0, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 0, 0, 0, 0, 0, 0, 0, 919, 2611, 5071, 0, 0, 0, 5074, 5075, 5076, 5077, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 5734, 0, 0, 915, 0, 0, 0, 4349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 916, 0, 916, 5097, 0, 0, 0, 916, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 924, 921, 916, 0, 0, 0, 915, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 923, 2659, 0, 0, 0, 0, 0, 1060, 0, 0, 0, 0, 0, 1092, 0, 0, 5179, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 4349, 0, 0, 921, 0, 0, 0, 5204, 915, 5205, 924, 2660, 0, 0, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 913, 0, 0, 0, 0, 0, 5220, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 916, 0, 916, 915, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 918, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 924, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 916, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 5532, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 2611, 0, 0, 0, 916, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 6098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5367, 5368, 5369, 0, 0, 0, 5370, 5371, 5372, 5373, 0, 0, 0, 5375, 0, 0, 923, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1626, 921, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 923, 916, 0, 0, 0, 0, 0, 0, 5410, 5411, 5412, 5413, 5414, 0, 5416, 5417, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 5426, 5427, 0, 0, 0, 0, 0, 923, 0, 0, 924, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 5433, 921, 921, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1888, 0, 0, 0, 0, 921, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 3565, 0, 0, 0, 1922, 1925, 1926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 919, 0, 0, 0, 919, 919, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 916, 915, 0, 5498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 923, 0, 5549, 0, 0, 0, 0, 0, 3565, 2148, 0, 923, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 919, 0, 0, 0, 0, 923, 0, 0, 921, 0, 0, 918, 2652, 5555, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 1419, 0, 918, 0, 0, 2654, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 923, 0, 918, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 923, 0, 0, 923, 923, 0, 0, 0, 0, 913, 915, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 916, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 923, 923, 0, 662, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 915, 2655, 0, 0, 0, 915, 0, 0, 0, 0, 924, 2652, 0, 0, 0, 924, 924, 0, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 5682, 0, 0, 2655, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 5692, 2658, 2343, 0, 0, 0, 5698, 5699, 0, 919, 0, 0, 0, 0, 0, 0, 5710, 0, 0, 916, 0, 0, 0, 5712, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 913, 913, 2737, 0, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 5532, 924, 5765, 5766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 2410, 5774, 0, 5776, 0, 0, 2658, 2343, 0, 0, 919, 0, 0, 0, 919, 0, 2660, 0, 5790, 2661, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 2659, 0, 2657, 0, 0, 918, 0, 0, 918, 4349, 918, 0, 0, 0, 0, 918, 924, 5824, 0, 0, 0, 0, 2850, 0, 0, 2658, 2343, 0, 0, 0, 0, 2880, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 0, 0, 913, 0, 0, 2659, 0, 0, 916, 918, 0, 2660, 0, 0, 2661, 2918, 0, 918, 0, 961, 963, 2930, 2930, 966, 0, 2930, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 2948, 919, 0, 2951, 918, 1024, 0, 0, 0, 0, 2410, 0, 1034, 0, 0, 0, 919, 916, 0, 915, 0, 919, 916, 5885, 0, 0, 2660, 913, 0, 2661, 0, 0, 0, 0, 0, 0, 0, 5900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 3004, 0, 0, 5918, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 915, 3024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 6106, 2662, 0, 0, 0, 0, 0, 0, 0, 5977, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 915, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 2611, 0, 0, 0, 916, 918, 0, 3046, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 3049, 0, 0, 0, 6128, 0, 4349, 2655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 921, 921, 0, 0, 0, 918, 0, 0, 0, 2611, 0, 0, 0, 0, 6057, 0, 3093, 2930, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 6356, 0, 918, 0, 0, 0, 0, 0, 0, 0, 3128, 0, 0, 0, 0, 0, 0, 3141, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 6088, 0, 921, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 919, 0, 0, 919, 6107, 919, 0, 0, 0, 0, 919, 0, 0, 723, 0, 0, 0, 0, 2809, 2656, 918, 0, 0, 0, 2657, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3202, 0, 918, 0, 0, 0, 0, 2658, 2343, 0, 916, 0, 919, 0, 0, 0, 2810, 0, 0, 0, 919, 0, 0, 6146, 918, 0, 0, 0, 0, 726, 0, 0, 916, 1419, 1419, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 727, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 3260, 0, 0, 3262, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 915, 2811, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 730, 0, 916, 0, 0, 0, 0, 918, 924, 731, 0, 0, 0, 1094, 0, 1097, 0, 0, 1099, 0, 0, 0, 732, 919, 0, 919, 0, 0, 2812, 0, 0, 0, 1125, 0, 0, 0, 6243, 923, 1129, 974, 984, 923, 923, 0, 0, 0, 0, 974, 0, 984, 974, 0, 0, 0, 0, 1070, 0, 0, 0, 918, 0, 915, 0, 984, 0, 6258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1752, 6268, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 2662, 0, 0, 0, 2148, 0, 921, 2149, 923, 0, 0, 2150, 2151, 2152, 923, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 736, 0, 0, 2652, 0, 0, 919, 0, 0, 916, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2813, 2655, 0, 0, 0, 919, 0, 0, 921, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 2611, 0, 214, 2814, 0, 0, 741, 6350, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 6373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1074, 0, 0, 2815, 0, 0, 0, 0, 0, 0, 745, 0, 0, 0, 918, 0, 0, 746, 0, 0, 747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 916, 0, 0, 0, 0, 748, 0, 0, 0, 0, 0, 0, 0, 1076, 0, 921, 2656, 0, 0, 919, 750, 2657, 0, 1077, 0, 0, 0, 0, 752, 0, 921, 0, 0, 0, 0, 921, 2816, 0, 0, 0, 0, 919, 0, 2817, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 1627, 1628, 757, 0, 2659, 0, 915, 918, 916, 0, 0, 915, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 1856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6494, 0, 0, 1868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 923, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 1890, 1891, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 916, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 1928, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 984, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 918, 2653, 0, 0, 0, 1966, 1968, 984, 2654, 0, 915, 0, 0, 984, 0, 0, 0, 0, 0, 0, 3444, 0, 0, 0, 0, 984, 0, 0, 0, 0, 3449, 0, 0, 923, 2655, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 918, 923, 0, 0, 0, 918, 923, 0, 974, 984, 0, 0, 0, 0, 0, 974, 0, 984, 974, 0, 0, 0, 0, 921, 0, 0, 921, 0, 921, 0, 0, 984, 0, 921, 0, 0, 923, 0, 0, 0, 0, 984, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 916, 0, 0, 0, 6432, 916, 916, 0, 0, 919, 0, 0, 1419, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 2656, 0, 921, 984, 0, 2657, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 2659, 0, 918, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 921, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2148, 2410, 0, 2149, 3666, 0, 0, 2150, 2151, 2152, 0, 0, 984, 0, 0, 0, 0, 2660, 0, 3688, 2661, 0, 0, 0, 0, 2652, 0, 0, 0, 3510, 0, 0, 0, 0, 0, 2653, 2148, 0, 916, 2149, 0, 3716, 2654, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 2653, 0, 0, 0, 0, 0, 918, 2654, 0, 0, 0, 921, 923, 0, 0, 923, 0, 923, 0, 0, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 3511, 0, 1839, 0, 0, 0, 921, 3796, 3797, 984, 0, 918, 919, 0, 0, 923, 0, 0, 0, 0, 974, 0, 0, 923, 974, 0, 974, 0, 0, 0, 0, 0, 0, 918, 921, 0, 0, 0, 2838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 2884, 919, 0, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 4162, 0, 0, 0, 0, 0, 4163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 2611, 921, 2656, 0, 918, 0, 0, 2657, 3922, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 3044, 0, 2659, 921, 0, 0, 0, 923, 0, 923, 2658, 2343, 984, 0, 0, 0, 0, 0, 0, 0, 0, 2974, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2659, 0, 915, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 3000, 3001, 3002, 3003, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 984, 984, 2661, 0, 919, 0, 984, 923, 918, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 983, 0, 0, 984, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 983, 0, 0, 0, 2662, 0, 0, 0, 921, 0, 2148, 0, 0, 2149, 0, 0, 983, 2150, 2151, 2152, 0, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 983, 0, 921, 0, 2652, 0, 0, 0, 983, 4164, 0, 0, 3057, 3058, 2653, 0, 0, 0, 0, 0, 0, 2654, 983, 0, 0, 0, 0, 0, 3075, 0, 0, 0, 983, 0, 919, 0, 0, 0, 3512, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 918, 3118, 3119, 3120, 3121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 923, 0, 983, 0, 0, 0, 919, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 983, 0, 0, 0, 923, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 2611, 0, 0, 0, 0, 0, 1839, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 916, 0, 0, 918, 0, 0, 0, 0, 0, 3195, 0, 983, 0, 0, 0, 3199, 4234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 2148, 0, 0, 2149, 0, 923, 0, 2150, 2151, 2152, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 2659, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 0, 921, 0, 918, 0, 0, 0, 0, 0, 2410, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 921, 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, 4797, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 2148, 983, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6193, 0, 0, 2652, 0, 0, 4090, 0, 0, 0, 0, 0, 0, 2653, 3387, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 2656, 0, 984, 0, 0, 2657, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 0, 0, 4798, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 918, 2150, 2151, 2152, 0, 918, 918, 0, 0, 0, 0, 923, 0, 2659, 921, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 4451, 2653, 919, 0, 0, 0, 983, 0, 2654, 0, 2930, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 921, 2655, 0, 0, 0, 921, 0, 0, 0, 0, 2611, 2660, 0, 984, 2661, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 0, 0, 983, 2656, 0, 0, 0, 0, 2657, 6194, 0, 0, 0, 919, 923, 0, 1839, 983, 0, 0, 0, 0, 0, 0, 0, 0, 918, 983, 983, 0, 0, 2658, 2343, 983, 0, 0, 0, 0, 0, 984, 0, 0, 923, 0, 0, 0, 0, 984, 0, 983, 0, 0, 0, 0, 983, 984, 1395, 1395, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 918, 0, 0, 0, 2657, 0, 0, 974, 974, 0, 984, 984, 0, 2410, 0, 0, 0, 0, 0, 4583, 4584, 4585, 974, 0, 984, 974, 0, 2658, 2343, 2660, 0, 0, 2661, 0, 0, 0, 4594, 984, 984, 0, 1395, 0, 0, 921, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4619, 4621, 0, 0, 0, 4626, 974, 0, 0, 0, 974, 974, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 923, 0, 2410, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 923, 0, 0, 0, 1838, 923, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 921, 1749, 1753, 0, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 919, 0, 0, 0, 0, 919, 919, 0, 0, 3387, 2662, 0, 0, 921, 0, 0, 0, 0, 1839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 921, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 4167, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 923, 921, 0, 0, 0, 0, 0, 0, 0, 0, 4099, 2611, 2656, 919, 0, 0, 0, 2657, 0, 2655, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 4837, 4838, 4839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3620, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2148, 983, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 2092, 0, 0, 2652, 0, 923, 0, 0, 0, 0, 0, 921, 0, 2653, 0, 2660, 0, 0, 2661, 0, 2654, 0, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 4135, 0, 2118, 0, 0, 0, 2655, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2137, 2138, 2139, 0, 2141, 0, 0, 0, 0, 0, 923, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 2629, 3770, 0, 0, 3773, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 4172, 0, 0, 0, 0, 921, 983, 923, 0, 2148, 0, 0, 2149, 0, 983, 0, 2150, 2151, 2152, 2656, 0, 0, 983, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 4179, 0, 0, 0, 2704, 0, 3868, 2653, 2716, 2721, 2658, 2343, 0, 0, 2654, 0, 0, 0, 0, 3881, 0, 0, 0, 0, 0, 0, 0, 3890, 0, 983, 983, 0, 0, 0, 0, 0, 2611, 0, 2659, 0, 2655, 0, 0, 983, 921, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 2662, 983, 983, 0, 0, 0, 0, 0, 0, 0, 0, 3934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 2410, 0, 5108, 2150, 2151, 2152, 3958, 0, 0, 0, 0, 923, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 5140, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4013, 0, 4015, 0, 0, 0, 1839, 0, 0, 0, 0, 0, 0, 0, 0, 2655, 0, 3141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 2611, 0, 2657, 0, 921, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 5198, 0, 0, 0, 0, 2658, 2343, 0, 0, 984, 0, 0, 2662, 0, 0, 0, 0, 3202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 984, 0, 2659, 0, 984, 0, 0, 0, 0, 0, 0, 4073, 0, 0, 984, 0, 0, 0, 4080, 923, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1749, 1749, 1749, 0, 0, 2410, 974, 0, 974, 974, 0, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 2660, 0, 984, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 984, 984, 0, 0, 0, 0, 0, 2611, 0, 919, 0, 0, 0, 0, 923, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 2659, 921, 0, 0, 0, 0, 921, 921, 0, 0, 0, 0, 1839, 984, 0, 0, 1839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5303, 5304, 5305, 5306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 1839, 2410, 0, 0, 984, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 2660, 984, 0, 2661, 0, 0, 0, 0, 984, 0, 0, 984, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 984, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 1839, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 4728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4345, 4346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 923, 0, 0, 0, 0, 923, 923, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 3288, 0, 0, 0, 0, 0, 0, 0, 0, 3305, 3305, 3305, 3305, 3315, 3321, 3305, 3324, 3305, 3305, 0, 0, 0, 0, 3331, 0, 3332, 0, 3334, 0, 0, 3348, 3351, 3356, 0, 0, 0, 0, 0, 3365, 0, 0, 3370, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3377, 3378, 3379, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3380, 0, 0, 0, 0, 984, 0, 1839, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 5527, 2150, 2151, 2152, 0, 984, 0, 923, 0, 984, 0, 5537, 0, 0, 0, 0, 984, 0, 0, 2652, 0, 0, 4804, 974, 0, 974, 974, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 1838, 2149, 2655, 0, 0, 2150, 2151, 2152, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1839, 0, 983, 0, 0, 0, 1839, 0, 0, 0, 4531, 0, 0, 2655, 0, 0, 3388, 0, 0, 0, 983, 0, 0, 0, 983, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 3406, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 2622, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 983, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 3408, 0, 0, 0, 0, 2656, 2622, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 1838, 983, 0, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 2410, 0, 0, 4685, 983, 0, 1838, 0, 0, 0, 983, 0, 0, 0, 0, 0, 2660, 0, 5749, 2661, 0, 2659, 0, 1419, 983, 0, 0, 0, 0, 0, 0, 983, 0, 0, 983, 0, 0, 0, 0, 0, 983, 0, 5779, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 984, 984, 0, 0, 0, 0, 0, 983, 0, 0, 0, 2410, 0, 983, 0, 0, 0, 0, 0, 0, 983, 984, 0, 0, 984, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5249, 983, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 983, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 0, 3424, 0, 0, 0, 1839, 1839, 1839, 0, 0, 0, 0, 1395, 0, 1749, 0, 0, 2148, 1838, 0, 2149, 0, 0, 2662, 2150, 2151, 2152, 0, 0, 0, 984, 3380, 0, 0, 0, 3388, 0, 0, 3406, 0, 3408, 0, 2652, 3458, 0, 0, 0, 0, 0, 984, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 2148, 2611, 0, 2149, 0, 0, 984, 2150, 2151, 2152, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 2655, 2148, 0, 0, 2149, 2652, 0, 0, 2150, 2151, 2152, 2138, 2139, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 2622, 0, 0, 0, 2622, 2654, 0, 2611, 0, 0, 2655, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 5984, 0, 2655, 0, 0, 0, 923, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 1838, 0, 3598, 0, 0, 6006, 0, 0, 0, 0, 5259, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 983, 2656, 0, 0, 0, 1839, 2657, 0, 0, 0, 0, 984, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5266, 0, 984, 0, 984, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 5265, 0, 0, 2657, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2656, 0, 0, 0, 0, 2657, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6094, 0, 0, 0, 0, 0, 0, 984, 0, 1838, 2658, 2343, 2410, 0, 0, 1838, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 984, 0, 0, 0, 2660, 5094, 0, 2661, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5096, 0, 0, 0, 0, 984, 2660, 0, 0, 2661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 3854, 3855, 1749, 0, 0, 2148, 3859, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 3888, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 2662, 2654, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 2662, 0, 0, 0, 0, 0, 2655, 2622, 0, 0, 1839, 3344, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2653, 2622, 2622, 2622, 0, 2622, 0, 2654, 0, 0, 983, 983, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 983, 0, 2655, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 5267, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 2652, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2653, 0, 0, 2611, 0, 0, 0, 2654, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 2655, 0, 0, 0, 1838, 1838, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 983, 0, 2150, 2151, 2152, 0, 0, 0, 0, 0, 0, 2656, 0, 4086, 0, 2659, 2657, 984, 4092, 983, 2652, 0, 0, 5855, 0, 0, 0, 0, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2654, 0, 2658, 2343, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 2655, 0, 5838, 0, 2659, 0, 2141, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 3356, 1839, 3356, 3356, 0, 0, 1839, 0, 1839, 0, 2656, 0, 0, 0, 0, 2657, 4182, 0, 0, 4185, 0, 4187, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 1839, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 983, 0, 0, 0, 0, 0, 4212, 0, 4215, 0, 4218, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 2656, 0, 983, 0, 983, 2657, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 983, 0, 0, 0, 2660, 0, 0, 2661, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 0, 5441, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 4285, 0, 0, 5445, 0, 2704, 2659, 0, 0, 2148, 0, 0, 2149, 0, 0, 0, 2150, 2151, 2152, 0, 2721, 0, 984, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 2652, 0, 983, 0, 0, 0, 0, 0, 0, 0, 2653, 0, 2611, 0, 0, 2410, 984, 2654, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 2660, 0, 0, 2661, 0, 2662, 0, 5647, 0, 0, 0, 0, 2655, 983, 0, 0, 0, 0, 0, 0, 4335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5505, 0, 983, 2611, 0, 0, 983, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 984, 0, 0, 1839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4370, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2622, 2656, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 2343, 0, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 2661, 0, 0, 0, 0, 0, 0, 5666, 0, 5668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1749, 0, 0, 0, 0, 0, 1749, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 4606, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5795, 0, 0, 0, 0, 0, 0, 1838, 984, 0, 0, 0, 1838, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 1839, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4729, 0, 0, 0, 0, 0, 0, 0, 0, 4733, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3305, 0, 0, 0, 4746, 3305, 3305, 0, 0, 0, 0, 3321, 0, 0, 4754, 0, 0, 4756, 0, 0, 0, 0, 0, 4758, 0, 4759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 983, 5933, 0, 5935, 0, 198, 0, 0, 0, 0, 983, 0, 984, 0, 4781, 4782, 4783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 3365, 0, 0, 0, 0, 0, 0, 0, 4807, 0, 0, 4810, 0, 4812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 4816, 0, 0, 0, 0, 0, 0, 0, 0, 4824, 4825, 200, 0, 0, 0, 0, 4830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, 3305, 0, 0, 0, 983, 0, 0, 1838, 0, 0, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 0, 0, 0, 0, 0, 2622, 0, 0, 205, 0, 0, 0, 0, 0, 984, 0, 984, 0, 0, 0, 0, 206, 2622, 0, 0, 4883, 0, 207, 0, 0, 0, 0, 2622, 0, 208, 0, 0, 0, 2622, 0, 0, 2622, 4897, 0, 0, 0, 0, 0, 2622, 2622, 0, 2622, 0, 0, 209, 0, 3344, 3344, 0, 4158, 0, 3344, 0, 0, 0, 2622, 0, 984, 2622, 0, 0, 0, 0, 2622, 0, 0, 0, 974, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 210, 0, 2622, 2622, 2622, 2622, 0, 0, 0, 0, 3344, 3344, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 1839, 0, 0, 0, 0, 974, 2622, 0, 2622, 0, 0, 0, 0, 0, 0, 2622, 2622, 2622, 2622, 2622, 2622, 2622, 2622, 2622, 2622, 0, 0, 0, 6142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 215, 0, 0, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 217, 0, 0, 218, 0, 0, 0, 219, 0, 0, 220, 0, 0, 0, 0, 0, 0, 221, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 983, 0, 0, 0, 224, 0, 6249, 0, 0, 225, 0, 226, 983, 0, 227, 0, 0, 0, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 229, 0, 0, 0, 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 983, 0, 231, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 232, 0, 0, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 6, 0, 5186, 5187, 0, 0, 0, 0, 0, 984, 0, 0, 7, 5194, 8, 9, 0, 0, 0, 0, 0, 10, 0, 11, 0, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 12, 0, 13, 0, 0, 1839, 0, 0, 6344, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 14, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 17, 0, 1125, 1125, 18, 0, 0, 0, 0, 5238, 0, 5804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 21, 0, 2704, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5261, 0, 1839, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1839, 5280, 5282, 0, 0, 0, 0, 0, 5286, 5287, 0, 0, 0, 5288, 0, 0, 0, 0, 5289, 0, 0, 5292, 0, 5294, 0, 674, 0, 0, 0, 5299, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 0, 0, 0, 675, 27, 0, 0, 0, 1125, 2622, 2622, 0, 0, 0, 2622, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 676, 0, 0, 0, 0, 5333, 0, 0, 1839, 0, 29, 984, 0, 677, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 5348, 0, 0, 0, 0, 0, -905, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 983, 678, 0, 30, 0, 0, 0, 679, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5378, 680, 0, 0, 32, 0, 0, 0, 0, 33, 34, 0, 35, 0, 0, 681, 0, 36, 0, 0, 4657, 0, 0, 37, 682, 0, 38, 983, 0, 0, 0, 0, 0, 39, 0, 0, 0, 683, 0, 0, 40, 41, 0, 0, 0, 0, 684, 0, 42, 0, 685, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, -1110, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 45, 5429, 0, 0, 0, 984, 0, 0, 5431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 974, 0, 46, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 47, 0, 0, 0, 0, 0, 48, 686, 0, 0, 0, 49, 0, 0, 0, 0, 0, -636, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 5466, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 974, 974, 0, 0, 0, 0, 0, 687, 0, 0, 688, 0, 0, 57, 0, 0, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4158, 4158, 0, 0, 3344, 3344, 3344, 3344, 689, 0, 3344, 3344, 3344, 3344, 3344, 3344, 3344, 3344, 3344, 3344, 4158, 0, 690, 0, 0, 0, 0, 0, 0, -474, 0, 0, 0, 0, 0, 0, 0, 723, 0, 0, 0, 0, 1063, 2622, 0, 0, 2622, 0, 2622, 691, 0, 4158, 4158, 0, 984, 0, 0, 0, 0, 692, 0, 0, 0, 0, 0, 0, -474, 0, 0, 693, 0, 0, 0, 2622, 3344, 3344, 2622, 0, 0, 2622, 1064, 0, 0, 0, 0, 0, 0, 0, 0, 694, 0, 0, 0, 726, 1065, 0, 0, 695, 0, 0, 0, 0, 0, 0, -474, 0, 1066, 696, 0, 697, 727, 698, 699, 0, 0, 3305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5574, 983, 700, 1067, 0, 0, 5578, 5579, 5580, 0, 701, 0, 0, 702, 0, 983, 703, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 1068, 0, -474, 0, 5593, 5594, 0, 0, 0, 5595, 0, 0, 0, 0, 730, 0, 0, 0, 0, 0, 1838, 0, 0, 731, 0, 5603, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5615, 732, 0, 0, 0, 0, 0, 1069, 0, 2622, 0, 5633, 0, 0, 0, 0, 0, 0, 0, 1395, 0, 0, 0, 0, 0, 0, 0, 0, 5652, 0, 0, 1839, 0, 0, 1070, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 1071, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1839, 0, 736, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 974, 974, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1072, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 739, 0, 0, 0, 0, 0, 0, 0, 0, 1838, 214, 1073, 983, 0, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1074, 0, 0, 1075, 0, 0, 0, 744, 0, 0, 745, 0, 0, 0, 0, 0, 0, 746, 0, 0, 747, 0, 0, 0, 0, 0, 0, 0, 3344, 0, 0, 5828, 0, 0, 0, 0, 0, 0, 0, 0, 748, 0, 0, 0, 0, 0, 0, 0, 1076, 0, 0, 0, 3365, 0, 0, 750, 0, 0, 1077, 0, 0, 0, 0, 752, 0, 0, 0, 0, 0, 0, 0, 1078, 2622, 754, 0, 0, 0, 0, 1079, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2141, 0, 0, 0, 0, 0, 0, 0, 757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 5913, 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, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 5961, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 2622, 0, 2622, 2622, 0, 0, 0, 0, 4158, 4158, 4158, 4158, 0, 0, 0, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 2622, 2622, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 2622, 0, 2622, 0, 983, 0, 2622, 0, 0, 4158, 4158, 0, 0, 0, 2622, 2622, 0, 0, 0, 0, 2622, 3305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6041, 0, 0, 0, 0, 0, 0, 0, 0, 6048, 6048, 6048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5633, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 6084, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6300, 0, 0, 0, 0, 2622, 2622, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 3344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 2622, 0, 0, 0, 2622, 2622, 2622, 2622, 0, 0, 2622, 0, 2622, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6048, 0, 3344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6390, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1749, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 4158, 3344, 2622, 2622, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 2622, 2622, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 3344, 0, 0, 4158, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4158, 0, 3344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3344, 3344, 0, 0, 3344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4158, 4158, 0, 4158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 0, 1298, 718, 0, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1743, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 2622, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 1744, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 1745, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 1746, 0, 0, 0, 0, 0, 0, 1382, 1747, 235, 0, 1298, 718, 0, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 1214, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 0, 0, 0, 0, 1382, 5874, 235, 0, 1298, 718, 0, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 0, 0, 0, 0, 1382, 3346, 235, 0, 1298, 718, 0, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 0, 0, 0, 0, 1382, 4760, 235, 0, 1298, 718, 0, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 0, 0, 0, 0, 1382, 4827, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 4262, 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, -1861, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, -1861, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, -1861, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, -1861, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, -1861, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, -1861, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, -1861, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1482, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2747, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2748, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 2750, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 2752, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 2844, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2747, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2748, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 2750, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 2752, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 235, 0, 1298, 718, 0, 1299, 1300, 1301, 779, 1302, 649, 650, 651, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 3977, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 3307, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 1214, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 1214, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 3352, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 3353, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 3354, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 3355, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, -2294, 245, 246, 247, 0, 0, 0, -2294, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, -2294, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, -2292, 245, 246, 247, 0, 0, 0, -2292, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, -2292, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 0, 0, 2089, 3281, 1382, 235, 0, 1298, 718, 0, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 1381, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2714, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 3307, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 3856, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 3353, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 3409, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2717, 2718, 0, 0, 0, 235, 0, 3525, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 4882, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 5269, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 5281, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 5623, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 5624, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 5625, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 5626, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 6045, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6046, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 6047, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6046, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 6047, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 5608, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3338, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3339, 3340, 0, 0, 0, 235, 0, 1298, 718, 3341, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, -3018, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6046, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 1322, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, -3018, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 0, 0, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, -3018, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 1349, 461, 462, 0, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1357, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, -3018, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 6047, 609, 610, 611, 0, 1367, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, -3018, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1379, 1380, 0, 0, 0, 235, 0, 1298, 718, 1382, 1299, 1300, 1301, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1353, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3338, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3339, 3340, 235, 0, 1298, 718, 0, 1299, 1300, 3341, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3514, 3515, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3516, 3517, 235, 0, 1298, 718, 0, 1299, 1300, 3341, 779, 1302, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3338, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 1298, 718, 0, 1299, 1300, 0, 779, 1302, 0, 0, 0, 0, 0, 0, 3341, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 4791, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3338, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 1298, 718, 0, 1299, 1300, 0, 779, 1302, 0, 0, 0, 0, 0, 0, 3341, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1303, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 1307, 1308, 271, 272, 1309, 1310, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 304, 305, 306, 307, 308, 309, 1320, 1321, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1323, 344, 345, 346, 347, 1324, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 1328, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 1350, 1351, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3338, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 1364, 601, 1365, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 4851, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3341, 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, 1308, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1324, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3485, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 3486, 1341, 413, 414, 415, 416, 417, 418, 419, 3487, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 0, 1351, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 870, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 3488, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1364, 601, 1365, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 1214, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 3489, 649, 650, 651, 0, 0, 0, 51, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3490, 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, 1308, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1324, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3485, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 3486, 1341, 413, 414, 415, 416, 417, 418, 419, 3487, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 0, 1351, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 870, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 3488, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1364, 601, 1365, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 3489, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3490, 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, 1308, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1324, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3485, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 0, 1351, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1364, 601, 1365, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3935, 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, 1308, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1324, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3485, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 3486, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 0, 1351, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 3488, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1364, 601, 1365, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 3489, 649, 650, 651, 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, 1308, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1324, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3485, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 0, 1351, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1364, 601, 1365, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4939, 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, 1308, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1324, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3485, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 0, 1351, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1364, 601, 1365, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 975, 0, 1619, 718, 0, 0, 0, 0, 779, 0, 0, 0, 0, 0, 0, 0, 6152, 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, 5940, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1844, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1845, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1846, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 975, 0, 0, 0, 0, 0, 0, 1620, 1621, 5941, 0, 0, 0, 0, 0, 0, 5942, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 1214, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 1054, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5684, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 45, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 1214, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 51, 0, 0, 659, 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, 2924, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 870, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 2925, 2926, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1878, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1430, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3548, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4227, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2147, 0, 0, 0, 0, 0, 0, 2148, 0, 0, 2149, 0, 0, 4868, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 0, 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, 2196, 2197, 2198, 2199, 2200, 0, 0, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 0, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 0, 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, 2275, 2276, 2277, 2278, 2279, 2280, 0, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 0, 0, 2293, 2294, 2295, 2296, 0, 2297, 2298, 2299, 2300, 2301, 0, 2302, 2303, 2304, 2305, 2306, 0, 2307, 2308, 0, 2309, 2310, 2311, 0, 2312, 2313, 0, 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, 0, 2340, 0, 2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 0, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 2387, 0, 2388, 2389, 0, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 0, 2420, 2421, 2422, 0, 2423, 2424, 2425, 2426, 2427, 0, 2428, 2429, 2430, 2431, 0, 0, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 0, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 0, 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, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 0, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 0, 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, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 0, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 0, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 0, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 0, 2593, 0, 0, 0, 0, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 0, 2609, 2610, 0, 2611, 0, 0, 0, 0, 0, 0, 0, 0, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 887, 0, 1619, 718, 0, 0, 0, 990, 779, 0, 0, 0, 0, 0, 991, 992, 993, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1756, 245, 246, 247, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 248, 249, 250, 1764, 251, 252, 253, 254, 255, 256, 257, 258, 0, 888, 261, 889, 890, 1765, 264, 265, 266, 267, 268, 269, 270, 1766, 1767, 271, 272, 891, 892, 275, 1768, 276, 277, 278, 279, 0, 1769, 281, 1770, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1771, 293, 294, 295, 296, 297, 298, 1772, 299, 300, 301, 302, 1773, 1774, 1775, 303, 1776, 1777, 1778, 304, 305, 306, 307, 308, 309, 893, 894, 312, 1779, 313, 1780, 314, 315, 316, 317, 318, 319, 320, 1781, 321, 322, 323, 324, 1782, 1783, 325, 326, 895, 328, 329, 1784, 330, 331, 332, 333, 1785, 334, 335, 336, 337, 338, 1786, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 1787, 349, 1788, 350, 351, 352, 896, 354, 1789, 355, 1790, 356, 357, 358, 1791, 359, 360, 361, 362, 363, 1792, 364, 0, 1793, 0, 367, 368, 1794, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1795, 379, 380, 381, 382, 383, 384, 385, 386, 1796, 387, 388, 0, 390, 391, 392, 393, 897, 898, 1797, 899, 1798, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 1799, 1800, 420, 0, 422, 423, 424, 1801, 425, 426, 427, 1802, 1803, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 4549, 0, 460, 1804, 461, 462, 463, 464, 1805, 0, 466, 903, 468, 469, 470, 471, 1806, 472, 473, 474, 1807, 1808, 4550, 476, 477, 1809, 1810, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1811, 497, 498, 499, 0, 501, 0, 503, 504, 505, 1812, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 1813, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1814, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1815, 553, 554, 555, 556, 557, 1816, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 1817, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 1818, 585, 586, 1819, 1820, 587, 588, 589, 590, 591, 592, 593, 594, 1821, 595, 907, 908, 1822, 1823, 598, 599, 0, 601, 0, 1824, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1825, 1826, 612, 613, 614, 615, 616, 1827, 1828, 617, 618, 619, 620, 621, 0, 909, 1829, 624, 625, 626, 627, 628, 629, 630, 1830, 1831, 631, 1832, 1833, 632, 633, 634, 635, 636, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 4551, 4552, 1001, 1002, 1003, 1004, 887, 0, 1619, 718, 0, 0, 0, 990, 779, 0, 0, 0, 0, 0, 991, 992, 993, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1756, 245, 246, 247, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 248, 249, 250, 1764, 251, 252, 253, 254, 255, 256, 257, 258, 0, 888, 261, 889, 890, 1765, 264, 265, 266, 267, 268, 269, 270, 1766, 1767, 271, 272, 891, 892, 275, 1768, 276, 277, 278, 279, 0, 1769, 281, 1770, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1771, 293, 294, 295, 296, 297, 298, 1772, 299, 300, 301, 302, 1773, 1774, 1775, 303, 1776, 1777, 1778, 304, 305, 306, 307, 308, 309, 893, 894, 312, 1779, 313, 1780, 314, 315, 316, 317, 318, 319, 320, 1781, 321, 322, 323, 324, 1782, 1783, 325, 326, 895, 328, 329, 1784, 330, 331, 332, 333, 1785, 334, 335, 336, 337, 338, 1786, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 1787, 349, 1788, 350, 351, 352, 896, 354, 1789, 355, 1790, 356, 357, 358, 1791, 359, 360, 361, 362, 363, 1792, 364, 0, 1793, 0, 367, 368, 1794, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1795, 379, 380, 381, 382, 383, 384, 385, 386, 1796, 387, 388, 0, 390, 391, 392, 393, 897, 898, 1797, 899, 1798, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 1799, 1800, 420, 0, 422, 423, 424, 1801, 425, 426, 427, 1802, 1803, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 5011, 0, 460, 1804, 461, 462, 463, 464, 1805, 0, 466, 903, 468, 469, 470, 471, 1806, 472, 473, 474, 1807, 1808, 4550, 476, 477, 1809, 1810, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1811, 497, 498, 499, 0, 501, 0, 503, 504, 505, 1812, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 1813, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1814, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1815, 553, 554, 555, 556, 557, 1816, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 1817, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 1818, 585, 586, 1819, 1820, 587, 588, 589, 590, 591, 592, 593, 594, 1821, 595, 907, 908, 1822, 1823, 598, 599, 0, 601, 0, 1824, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1825, 1826, 612, 613, 614, 615, 616, 1827, 1828, 617, 618, 619, 620, 621, 0, 909, 1829, 624, 625, 626, 627, 628, 629, 630, 1830, 1831, 631, 1832, 1833, 632, 633, 634, 635, 636, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 4551, 4552, 1001, 1002, 1003, 1004, 659, 0, 0, 0, 0, 0, 0, 990, 0, 0, 0, 0, 0, 0, 991, 992, 993, 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, 994, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 995, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 659, 0, 0, 0, 0, 0, 0, 990, 0, 0, 0, 0, 0, 0, 991, 992, 993, 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, 1111, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 1112, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 659, 0, 0, 0, 0, 0, 0, 990, 0, 0, 0, 0, 0, 0, 991, 992, 993, 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, 1177, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 1178, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1179, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 659, 0, 0, 0, 0, 0, 0, 990, 0, 0, 0, 0, 0, 0, 991, 992, 993, 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, 1861, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 1862, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 659, 0, 0, 0, 0, 0, 0, 990, 0, 0, 0, 0, 0, 0, 991, 992, 993, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 659, 0, 0, 0, 0, 0, 0, 990, 0, 0, 0, 0, 0, 0, 991, 992, 993, 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, 3613, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 3614, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 659, 0, 0, 0, 0, 0, 0, 990, 0, 0, 0, 0, 0, 0, 991, 992, 993, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 5664, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 1755, 0, 0, 0, 0, 0, 0, 0, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1756, 245, 246, 247, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 248, 249, 250, 1764, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1765, 264, 265, 266, 267, 268, 269, 270, 1766, 1767, 271, 272, 273, 274, 275, 1768, 276, 277, 278, 279, 280, 1769, 281, 1770, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1771, 293, 294, 295, 296, 297, 298, 1772, 299, 300, 301, 302, 1773, 1774, 1775, 303, 1776, 1777, 1778, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1779, 313, 1780, 314, 315, 316, 317, 318, 319, 320, 1781, 321, 322, 323, 324, 1782, 1783, 325, 326, 327, 328, 329, 1784, 330, 331, 332, 333, 1785, 334, 335, 336, 337, 338, 1786, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1787, 349, 1788, 350, 351, 352, 353, 354, 1789, 355, 1790, 356, 357, 358, 1791, 359, 360, 361, 362, 363, 1792, 364, 365, 1793, 366, 367, 368, 1794, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1795, 379, 380, 381, 382, 383, 384, 385, 386, 1796, 387, 388, 389, 390, 391, 392, 393, 394, 395, 1797, 396, 1798, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 1799, 1800, 420, 421, 422, 423, 424, 1801, 425, 426, 427, 1802, 1803, 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, 1804, 461, 462, 463, 464, 1805, 465, 466, 467, 468, 469, 470, 471, 1806, 472, 473, 474, 1807, 1808, 475, 476, 477, 1809, 1810, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1811, 497, 498, 499, 500, 501, 502, 503, 504, 505, 1812, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1813, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1814, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1815, 553, 554, 555, 556, 557, 1816, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 1817, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 1818, 585, 586, 1819, 1820, 587, 588, 589, 590, 591, 592, 593, 594, 1821, 595, 596, 597, 1822, 1823, 598, 599, 600, 601, 602, 1824, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1825, 1826, 612, 613, 614, 615, 616, 1827, 1828, 617, 618, 619, 620, 621, 622, 623, 1829, 624, 625, 626, 627, 628, 629, 630, 1830, 1831, 631, 1832, 1833, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1834, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6121, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6123, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6252, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2747, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2748, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 2749, 478, 479, 2750, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 2752, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 0, 0, 3972, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2753, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2747, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2748, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 2749, 478, 479, 2750, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 2752, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 975, 0, 1619, 718, 0, 0, 0, 0, 779, 0, 0, 0, 0, 0, 0, 2753, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1844, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1845, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1846, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 0, 1619, 718, 0, 0, 0, 0, 779, 0, 0, 0, 0, 1620, 1621, 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, 2066, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1844, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1845, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1846, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 0, 1619, 718, 0, 0, 0, 0, 779, 0, 0, 0, 0, 1620, 1621, 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, 3580, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1844, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1845, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1846, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 0, 1619, 718, 0, 0, 0, 0, 779, 0, 0, 0, 0, 1620, 1621, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1844, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1845, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1846, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 779, 0, 0, 0, 0, 1620, 1621, 0, 0, 236, 237, 780, 239, 240, 241, 242, 243, 244, 781, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 782, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 783, 353, 354, 0, 355, 0, 356, 784, 0, 785, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 786, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 787, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 788, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 789, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 790, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 791, 792, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 1054, 1755, 0, 6449, 718, 0, 0, 0, 0, 779, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1756, 245, 246, 247, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 248, 249, 250, 1764, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1765, 264, 265, 266, 267, 268, 269, 270, 1766, 1767, 271, 272, 273, 274, 275, 1768, 276, 277, 278, 279, 280, 1769, 281, 1770, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1771, 293, 294, 295, 296, 297, 298, 1772, 299, 300, 301, 302, 1773, 1774, 1775, 303, 1776, 1777, 1778, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1779, 313, 1780, 314, 315, 316, 317, 318, 319, 320, 1781, 321, 322, 323, 324, 1782, 1783, 325, 326, 327, 328, 329, 1784, 330, 331, 332, 333, 1785, 334, 335, 336, 337, 338, 1786, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1787, 349, 1788, 350, 351, 352, 353, 354, 1789, 355, 1790, 356, 357, 358, 1791, 359, 360, 361, 362, 363, 1792, 364, 365, 1793, 366, 367, 368, 1794, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1795, 379, 380, 381, 382, 383, 384, 385, 386, 1796, 387, 388, 389, 390, 391, 392, 393, 394, 395, 1797, 396, 1798, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 1799, 1800, 420, 421, 422, 423, 424, 1801, 425, 426, 427, 1802, 1803, 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, 1804, 461, 462, 463, 464, 1805, 465, 466, 467, 468, 469, 470, 471, 1806, 472, 473, 474, 1807, 1808, 475, 476, 477, 1809, 1810, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1811, 497, 498, 499, 500, 501, 502, 503, 504, 505, 1812, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1813, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1814, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1815, 553, 554, 555, 556, 557, 1816, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 1817, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 1818, 585, 586, 1819, 1820, 587, 588, 589, 590, 591, 592, 593, 594, 1821, 595, 596, 597, 1822, 1823, 598, 599, 600, 601, 602, 1824, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1825, 1826, 612, 613, 614, 615, 616, 1827, 1828, 617, 618, 619, 620, 621, 622, 623, 1829, 624, 625, 626, 627, 628, 629, 630, 1830, 1831, 631, 1832, 1833, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 1755, 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, 1756, 245, 246, 247, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 248, 249, 250, 1764, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1765, 264, 265, 266, 267, 268, 269, 270, 1766, 1767, 271, 272, 273, 274, 275, 1768, 276, 277, 278, 279, 280, 1769, 281, 1770, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1771, 293, 294, 295, 296, 297, 298, 1772, 299, 300, 301, 302, 1773, 1774, 1775, 303, 1776, 1777, 1778, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1779, 313, 1780, 314, 315, 316, 317, 318, 319, 320, 1781, 321, 322, 323, 324, 1782, 1783, 325, 326, 327, 328, 329, 1784, 330, 331, 332, 333, 1785, 334, 335, 336, 337, 338, 1786, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1787, 349, 1788, 350, 351, 352, 353, 354, 1789, 355, 1790, 356, 357, 358, 1791, 359, 360, 361, 362, 363, 1792, 364, 365, 1793, 366, 367, 368, 1794, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1795, 379, 380, 381, 382, 383, 384, 385, 386, 1796, 387, 388, 389, 390, 391, 392, 393, 394, 395, 1797, 396, 1798, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 1799, 1800, 420, 421, 422, 423, 424, 1801, 425, 426, 427, 1802, 1803, 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, 1804, 461, 462, 463, 464, 1805, 465, 466, 467, 468, 469, 470, 471, 1806, 472, 473, 474, 1807, 1808, 475, 476, 477, 1809, 1810, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1811, 497, 498, 499, 500, 501, 502, 503, 504, 505, 1812, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1813, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1814, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1815, 553, 554, 555, 556, 557, 1816, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 1817, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 1818, 585, 586, 1819, 1820, 587, 588, 589, 590, 591, 592, 593, 594, 1821, 595, 596, 597, 1822, 1823, 598, 599, 600, 601, 602, 1824, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1825, 1826, 612, 613, 614, 615, 616, 1827, 1828, 617, 618, 619, 620, 621, 622, 623, 1829, 624, 625, 626, 627, 628, 629, 630, 1830, 1831, 631, 1832, 1833, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 1755, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 3689, 242, 243, 244, 1756, 245, 246, 247, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 248, 249, 250, 1764, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1765, 264, 265, 266, 267, 268, 269, 270, 1766, 1767, 271, 272, 273, 274, 275, 1768, 276, 277, 278, 279, 280, 1769, 281, 1770, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1771, 293, 294, 295, 296, 297, 298, 1772, 299, 300, 301, 302, 1773, 1774, 1775, 303, 1776, 1777, 1778, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1779, 313, 1780, 314, 315, 316, 317, 318, 319, 320, 1781, 321, 322, 323, 324, 1782, 1783, 325, 326, 327, 3690, 329, 1784, 330, 331, 332, 333, 1785, 334, 335, 336, 337, 338, 1786, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1787, 349, 1788, 350, 351, 352, 353, 354, 1789, 355, 1790, 356, 357, 358, 1791, 359, 360, 361, 362, 363, 1792, 364, 365, 1793, 366, 367, 368, 1794, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1795, 379, 380, 381, 382, 383, 384, 385, 386, 1796, 387, 388, 389, 390, 391, 392, 393, 394, 395, 1797, 396, 1798, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 1799, 1800, 420, 421, 422, 423, 424, 1801, 425, 426, 427, 1802, 1803, 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, 1804, 461, 462, 463, 464, 1805, 465, 466, 467, 468, 469, 470, 471, 1806, 472, 473, 474, 1807, 1808, 475, 476, 477, 1809, 1810, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1811, 497, 498, 499, 500, 501, 502, 503, 504, 505, 1812, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1813, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1814, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1815, 553, 554, 555, 556, 557, 1816, 3691, 559, 560, 561, 562, 563, 564, 565, 566, 567, 1817, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 1818, 585, 586, 1819, 1820, 587, 588, 589, 590, 591, 592, 593, 594, 1821, 595, 596, 597, 1822, 1823, 598, 599, 600, 601, 602, 1824, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1825, 1826, 612, 613, 614, 615, 616, 1827, 1828, 617, 618, 619, 620, 621, 622, 623, 1829, 624, 625, 626, 627, 628, 629, 630, 1830, 1831, 631, 1832, 1833, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 1308, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1311, 0, 1312, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1324, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1327, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3485, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 411, 1341, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1342, 422, 423, 424, 0, 425, 426, 427, 1343, 1344, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1345, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1348, 460, 0, 461, 462, 463, 464, 0, 1351, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1354, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1355, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1358, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1360, 584, 0, 585, 586, 1361, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1364, 601, 1365, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1368, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1370, 1371, 1372, 1373, 643, 1374, 1375, 1376, 1377, 648, 649, 650, 651, 235, 0, 1298, 718, 0, 1299, 1300, 0, 779, 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, 1304, 261, 1305, 1306, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 1309, 1310, 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, 1320, 1321, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1325, 349, 0, 350, 351, 352, 1326, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1329, 1330, 0, 1331, 0, 397, 398, 399, 400, 401, 6421, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 1346, 448, 1347, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 463, 464, 1350, 465, 466, 1352, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1356, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 1359, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1362, 1363, 0, 0, 598, 599, 600, 601, 602, 1366, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 1369, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 1014, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 1035, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 1036, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 3018, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 4043, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 0, 0, 718, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1844, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1845, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1846, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 1130, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1172, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1185, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 976, 303, 0, 0, 977, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1197, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 1198, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 978, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 0, 0, 718, 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, 2046, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 0, 0, 718, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1156, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1169, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1183, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1187, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 975, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2851, 276, 277, 278, 279, 280, 0, 0, 2852, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2853, 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, 338, 0, 2854, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 2855, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 2856, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 2857, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 2858, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 2859, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2851, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2853, 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, 338, 0, 2854, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 2855, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 3906, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 2857, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 2858, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 2859, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2851, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2853, 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, 338, 0, 2854, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 2855, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 2857, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 2858, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 2859, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 798, 245, 799, 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, 800, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 845, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 801, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 802, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 798, 245, 799, 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, 800, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 3587, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 801, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 802, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 798, 245, 799, 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, 800, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 801, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 802, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 3094, 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, 2924, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 870, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 2925, 2926, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2022, 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, 2023, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 2024, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 2025, 356, 357, 0, 0, 0, 2026, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 2027, 2028, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 2029, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 2030, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 2031, 541, 542, 543, 544, 545, 546, 2032, 548, 549, 550, 551, 552, 0, 2033, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 2034, 587, 0, 2035, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 2036, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 799, 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, 800, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 801, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 802, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2924, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 870, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 2925, 2926, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1028, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1029, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 870, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 3670, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 3671, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 3683, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 3684, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 660, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 709, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 710, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 838, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 839, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 840, 597, 0, 0, 841, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 864, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 865, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 866, 597, 0, 0, 867, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 870, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 930, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 985, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 986, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1148, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 838, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1262, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1416, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1258, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 815, 272, 273, 274, 1422, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 819, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 1420, 0, 860, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 861, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1563, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 870, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1624, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1625, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 3437, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 3438, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 3439, 587, 0, 589, 590, 3440, 592, 3441, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 3442, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 718, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 779, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 4262, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 4276, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 4424, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 4952, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 5025, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 5391, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 815, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 817, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 819, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 820, 0, 821, 559, 560, 561, 822, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 824, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 830, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 836, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 815, 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, 857, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 858, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 819, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 859, 0, 860, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 861, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 882, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1010, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1020, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1023, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1039, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1096, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1101, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1118, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1121, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1123, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1161, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1189, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1191, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1201, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1204, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1207, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1259, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 815, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 819, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 1420, 0, 860, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 861, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1887, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1921, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1923, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1963, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1965, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1967, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 2083, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2739, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 0, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 815, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 819, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 1420, 0, 860, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 2774, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 861, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 815, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 2836, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 820, 0, 860, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 824, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 815, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 2921, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 820, 0, 860, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 824, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 815, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 2945, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 820, 0, 860, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 824, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3139, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3143, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3201, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3592, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 815, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 816, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 818, 538, 539, 540, 541, 542, 543, 544, 545, 546, 819, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 820, 0, 860, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 823, 597, 0, 0, 824, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 825, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3650, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3673, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3675, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3825, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 3867, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 5139, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 5669, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 6385, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 0, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 0, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 0, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 887, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2747, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2748, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 2750, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 2752, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 2832, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 4651, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 2911, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 905, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 4446, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 905, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 6065, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 905, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 6429, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 905, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 905, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 1163, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 905, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 1195, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 905, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2751, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 888, 261, 889, 890, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 891, 892, 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, 893, 894, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 895, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 896, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 897, 898, 0, 899, 0, 397, 398, 399, 400, 401, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 901, 448, 902, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 903, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 904, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 0, 561, 562, 563, 564, 565, 906, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 907, 908, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 909, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 0, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 0, 0, 0, 0, 0, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 0, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 0, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 0, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 0, 561, 562, 563, 564, 565, 0, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 0, 0, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 0, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651 }; static const yytype_int16 yycheck[] = { 6, 0, 687, 212, 1021, 0, 37, 0, 857, 1175, 57, 0, 0, 0, 0, 0, 855, 23, 1049, 25, 800, 801, 802, 29, 30, 190, 806, 212, 21, 35, 36, 37, 924, 39, 0, 21, 42, 43, 1051, 45, 0, 47, 0, 1058, 0, 0, 0, 0, 54, 55, 56, 1595, 0, 0, 46, 1611, 0, 0, 944, 2859, 946, 22, 1022, 1678, 2081, 45, 207, 28, 848, 905, 962, 950, 1053, 760, 215, 1595, 2733, 218, 875, 1047, 1588, 719, 1302, 742, 2734, 1236, 1038, 1289, 3266, 3087, 893, 894, 198, 30, 1124, 1520, 1600, 756, 36, 3152, 903, 861, 217, 764, 3446, 43, 3448, 666, 3212, 3538, 2755, 2756, 874, 1917, 908, 3099, 231, 1275, 3626, 3743, 3990, 1279, 2983, 1745, 1282, 1283, 3968, 2071, 3689, 3661, 3691, 3663, 3941, 881, 2089, 6, 1641, 1642, 23, 4375, 1645, 4616, 987, 2107, 4291, 3005, 1098, 3893, 2108, 4852, 1102, 3548, 37, 3957, 4334, 1107, 1712, 1713, 1113, 668, 719, 3496, 192, 1588, 1021, 1117, 192, 1012, 176, 755, 1477, 765, 1017, 1030, 1129, 4313, 5177, 2122, 1930, 1131, 818, 2, 5250, 1040, 5342, 1989, 4754, 2146, 4756, 36, 5120, 3490, 198, 199, 200, 740, 4622, 203, 743, 4639, 5478, 207, 1706, 209, 4627, 5384, 212, 766, 4422, 215, 1162, 973, 218, 5169, 3512, 221, 4868, 223, 4870, 2634, 226, 4584, 51, 2638, 230, 42, 232, 2718, 3309, 1733, 3114, 2720, 8, 2650, 3095, 3558, 3400, 5526, 5168, 15, 4944, 3955, 2103, 2104, 2105, 2106, 226, 3546, 2109, 5164, 2111, 2112, 3405, 971, 947, 0, 5514, 947, 0, 818, 5475, 11, 21, 4626, 11, 3052, 5784, 3054, 3055, 0, 0, 1561, 3059, 3060, 3061, 834, 3063, 3064, 3065, 6, 2697, 38, 5375, 4475, 13, 13, 37, 6, 3495, 6, 3497, 3498, 54, 6, 1012, 0, 891, 892, 37, 1017, 1062, 5768, 15, 16, 95, 6, 122, 902, 4792, 6, 6, 92, 1092, 6, 6, 80, 6, 45, 15, 16, 879, 35, 15, 16, 6, 2077, 6, 85, 6, 63, 6, 6, 120, 172, 21, 5440, 5441, 185, 37, 47, 5433, 6, 80, 6, 178, 6, 178, 178, 29, 0, 78, 6, 47, 142, 99, 29, 178, 51, 202, 115, 11, 185, 36, 1541, 80, 120, 164, 178, 6, 5, 120, 3, 21, 5, 6, 11, 92, 0, 29, 11, 202, 3628, 941, 178, 6045, 43, 11, 37, 11, 15, 113, 1896, 178, 120, 80, 185, 4718, 4719, 4720, 5465, 4722, 4723, 4724, 4725, 4726, 5667, 29, 76, 153, 311, 6, 227, 180, 125, 1642, 257, 310, 1645, 326, 6169, 63, 166, 670, 29, 331, 316, 4640, 172, 189, 63, 36, 6038, 300, 178, 316, 289, 178, 122, 194, 184, 42, 313, 187, 187, 125, 63, 191, 178, 178, 63, 386, 178, 1433, 1114, 78, 63, 112, 1425, 324, 1489, 202, 369, 1210, 148, 1477, 63, 361, 297, 346, 362, 404, 202, 202, 178, 37, 35, 221, 293, 5393, 5997, 272, 4956, 386, 208, 206, 124, 153, 5, 120, 13, 6383, 13, 217, 11, 484, 335, 404, 202, 496, 1058, 1481, 63, 687, 32, 373, 217, 231, 988, 99, 254, 1016, 310, 6484, 13, 762, 313, 272, 1320, 1321, 275, 535, 5988, 537, 1182, 539, 88, 6498, 178, 5786, 1035, 59, 43, 1038, 373, 1164, 404, 217, 6287, 293, 298, 1170, 29, 358, 541, 312, 45, 32, 537, 36, 1352, 1180, 202, 737, 13, 1184, 178, 78, 269, 1188, 5515, 1190, 306, 13, 6456, 404, 310, 1196, 289, 472, 1363, 685, 316, 1202, 451, 178, 1205, 691, 1058, 78, 202, 25, 411, 179, 374, 1243, 224, 479, 254, 703, 5682, 222, 486, 494, 184, 45, 178, 357, 157, 200, 125, 178, 537, 850, 395, 80, 447, 474, 541, 80, 1590, 136, 298, 268, 298, 480, 1274, 92, 273, 449, 497, 1258, 1383, 1216, 47, 478, 257, 387, 78, 178, 537, 537, 1290, 377, 80, 1382, 537, 391, 381, 307, 395, 6158, 375, 185, 537, 92, 5907, 80, 6308, 244, 298, 541, 1413, 302, 63, 449, 3902, 424, 1295, 456, 541, 298, 667, 6412, 449, 5730, 537, 37, 673, 1896, 675, 494, 677, 494, 454, 680, 1478, 4422, 5329, 401, 672, 149, 687, 376, 672, 449, 672, 692, 672, 694, 5904, 1645, 436, 195, 541, 700, 140, 527, 541, 537, 1258, 1448, 490, 1880, 537, 4450, 537, 464, 1564, 539, 1268, 1269, 449, 1743, 1744, 1309, 1310, 397, 541, 724, 766, 1672, 466, 449, 1675, 1684, 541, 120, 733, 672, 672, 541, 737, 375, 449, 740, 449, 1295, 743, 5996, 527, 414, 375, 1697, 1698, 422, 423, 491, 498, 493, 494, 541, 541, 1347, 759, 6272, 1442, 512, 375, 4896, 498, 472, 375, 770, 449, 483, 4957, 1514, 375, 178, 1626, 515, 479, 765, 1741, 432, 537, 4968, 375, 528, 529, 537, 1626, 541, 1264, 479, 950, 4595, 1268, 1269, 536, 535, 472, 5276, 538, 539, 540, 2086, 23, 540, 498, 527, 518, 519, 6270, 533, 533, 812, 541, 414, 540, 540, 817, 539, 375, 1507, 821, 822, 1507, 537, 780, 537, 782, 5778, 784, 537, 1991, 1662, 4636, 5933, 790, 836, 4635, 812, 4457, 535, 540, 537, 6355, 539, 4463, 537, 537, 518, 519, 537, 537, 4378, 537, 4380, 855, 856, 857, 858, 859, 541, 537, 32, 537, 2024, 1454, 1455, 537, 537, 1072, 870, 1878, 2017, 5782, 1586, 875, 2036, 1750, 537, 6162, 537, 881, 537, 528, 529, 817, 6095, 6096, 537, 821, 822, 6403, 372, 1072, 357, 540, 6497, 6149, 528, 529, 4640, 875, 528, 529, 541, 6177, 463, 527, 6509, 528, 529, 528, 529, 541, 938, 535, 5232, 535, 938, 539, 23, 539, 3561, 540, 3563, 4254, 432, 1639, 928, 541, 3785, 3786, 414, 541, 1069, 3790, 324, 302, 1073, 541, 1075, 498, 942, 541, 1656, 158, 537, 940, 1897, 541, 3928, 940, 472, 940, 1633, 955, 3, 940, 940, 940, 940, 940, 5660, 1063, 541, 404, 685, 23, 942, 541, 970, 964, 691, 4266, 4132, 4122, 4123, 4270, 4686, 449, 940, 955, 494, 449, 703, 541, 940, 391, 940, 989, 940, 940, 940, 940, 994, 995, 970, 541, 940, 940, 5995, 6088, 940, 940, 541, 23, 518, 449, 449, 4326, 528, 529, 530, 531, 532, 533, 528, 529, 4544, 2691, 6107, 449, 6274, 156, 794, 390, 1026, 1027, 125, 5498, 4105, 449, 3517, 472, 113, 3518, 530, 531, 532, 533, 537, 4543, 5992, 263, 91, 25, 3457, 858, 859, 1049, 1050, 5975, 4253, 156, 4255, 4256, 6169, 127, 1561, 882, 4207, 479, 6, 1063, 157, 1065, 3, 5991, 10, 1069, 3925, 13, 1072, 1073, 537, 1075, 530, 531, 532, 533, 1080, 485, 2107, 528, 529, 530, 531, 532, 533, 122, 3871, 1566, 480, 113, 1026, 1027, 103, 23, 207, 146, 10, 1576, 6354, 45, 1104, 6278, 6279, 17, 18, 19, 52, 1111, 1112, 2088, 479, 148, 25, 782, 783, 784, 217, 334, 787, 788, 789, 6187, 172, 1499, 172, 135, 125, 354, 797, 1133, 1134, 1135, 78, 1137, 125, 1139, 3549, 1141, 1142, 113, 63, 223, 391, 346, 5505, 537, 5380, 21, 1926, 294, 91, 23, 6243, 180, 4450, 125, 140, 124, 209, 2170, 6159, 194, 361, 113, 2143, 4671, 166, 391, 404, 6445, 6287, 1175, 172, 1177, 1178, 449, 187, 6333, 6, 23, 4607, 1026, 87, 89, 1663, 39, 2033, 2034, 1667, 1668, 326, 120, 89, 58, 136, 5407, 6150, 6, 372, 398, 484, 89, 63, 263, 145, 151, 1210, 169, 190, 5859, 2941, 29, 386, 3, 388, 439, 6, 5719, 217, 5721, 434, 6, 326, 5725, 5726, 1216, 132, 140, 6405, 174, 474, 153, 1236, 289, 1238, 132, 190, 436, 1242, 272, 1244, 263, 304, 172, 132, 6, 470, 217, 451, 25, 3893, 197, 23, 537, 254, 31, 202, 224, 538, 473, 156, 541, 120, 168, 129, 369, 1270, 541, 404, 331, 407, 135, 496, 137, 190, 217, 130, 6082, 289, 386, 454, 6280, 333, 293, 246, 1289, 1843, 486, 537, 1293, 5856, 3022, 5765, 537, 497, 6412, 25, 3254, 515, 221, 407, 5774, 23, 1307, 1961, 541, 306, 253, 10, 1994, 537, 13, 6468, 537, 68, 17, 18, 19, 1975, 260, 2822, 371, 5190, 436, 351, 115, 5166, 472, 1147, 5750, 314, 1988, 2755, 263, 2852, 289, 1964, 1382, 2023, 289, 3983, 2087, 2027, 2089, 1972, 1349, 5153, 2032, 3098, 2095, 2035, 5824, 5776, 436, 6353, 2101, 2102, 5159, 5796, 5780, 314, 6427, 395, 3325, 140, 6364, 312, 2113, 23, 391, 1954, 472, 52, 289, 1378, 1379, 1380, 2123, 1382, 439, 2140, 1860, 4912, 2129, 2689, 326, 334, 114, 5749, 373, 374, 263, 23, 490, 316, 37, 3339, 3340, 312, 1403, 474, 3344, 1986, 2905, 194, 6404, 23, 4937, 316, 2001, 470, 140, 436, 326, 465, 1958, 6482, 439, 5779, 263, 404, 3041, 473, 329, 298, 476, 1430, 397, 289, 293, 1973, 1437, 329, 1976, 25, 446, 496, 2120, 3114, 476, 6439, 329, 3385, 3386, 1448, 1219, 494, 1221, 470, 1223, 1633, 1225, 375, 1227, 1228, 1229, 369, 513, 457, 541, 1234, 391, 436, 409, 1492, 1493, 324, 1495, 1492, 1493, 298, 1495, 6471, 472, 496, 537, 5654, 537, 120, 72, 207, 472, 272, 2026, 179, 275, 3, 2030, 2031, 298, 1494, 404, 263, 4375, 1498, 1499, 478, 120, 439, 4894, 202, 442, 472, 6204, 5977, 1509, 1510, 1511, 1512, 439, 1514, 407, 5648, 298, 375, 537, 6018, 197, 3131, 391, 4853, 339, 202, 225, 478, 6330, 133, 120, 241, 349, 115, 1509, 25, 1511, 1538, 289, 442, 144, 31, 397, 470, 25, 263, 404, 466, 442, 436, 391, 1217, 140, 326, 1220, 123, 1222, 442, 1224, 179, 1226, 5117, 404, 4857, 1230, 478, 157, 477, 4862, 496, 439, 4865, 1573, 516, 310, 72, 253, 1578, 120, 289, 1581, 436, 2086, 72, 399, 528, 529, 530, 531, 532, 533, 331, 182, 1594, 1595, 92, 369, 181, 439, 64, 326, 470, 1603, 821, 4652, 1606, 120, 72, 395, 2635, 537, 263, 194, 312, 525, 526, 527, 528, 529, 530, 531, 532, 533, 391, 171, 480, 441, 496, 443, 470, 198, 404, 1633, 538, 1635, 263, 541, 1638, 330, 494, 1641, 1642, 2691, 369, 1645, 72, 1578, 3150, 40, 263, 140, 404, 311, 1647, 1655, 496, 5887, 1658, 1652, 140, 1661, 2637, 54, 518, 27, 154, 5407, 391, 537, 29, 92, 439, 202, 391, 294, 325, 6146, 316, 404, 5516, 122, 2689, 537, 166, 1685, 174, 311, 50, 122, 369, 272, 386, 92, 275, 316, 311, 537, 407, 120, 541, 391, 1702, 470, 293, 6427, 5504, 1638, 325, 298, 304, 434, 404, 436, 1714, 1715, 1716, 1717, 1718, 410, 111, 537, 439, 326, 1655, 404, 512, 3146, 1702, 496, 4608, 3150, 1732, 409, 1727, 2107, 2108, 331, 1731, 326, 391, 304, 436, 1743, 1744, 1745, 311, 125, 304, 181, 2122, 4532, 377, 470, 4609, 404, 4537, 298, 347, 2131, 6482, 4615, 140, 472, 391, 5906, 369, 1970, 331, 352, 537, 2780, 254, 394, 363, 331, 135, 4571, 391, 496, 293, 267, 369, 4422, 183, 298, 227, 30, 439, 541, 1969, 1970, 404, 257, 227, 537, 342, 293, 537, 6268, 535, 180, 385, 190, 539, 293, 335, 397, 207, 243, 1027, 4450, 439, 245, 395, 3487, 399, 404, 3490, 470, 537, 334, 6155, 6156, 1959, 216, 439, 525, 526, 527, 528, 529, 530, 531, 532, 533, 494, 326, 766, 169, 369, 120, 1842, 470, 373, 496, 436, 537, 1948, 541, 3, 405, 293, 1853, 437, 474, 218, 470, 257, 347, 293, 1861, 1862, 449, 143, 490, 3538, 293, 122, 496, 494, 150, 293, 26, 3546, 404, 381, 1877, 467, 494, 369, 6350, 2889, 496, 10, 164, 537, 13, 2731, 527, 480, 17, 18, 19, 148, 1895, 1896, 535, 289, 537, 538, 539, 289, 541, 494, 397, 834, 28, 2915, 35, 537, 1911, 1912, 1913, 1914, 404, 315, 358, 172, 123, 1920, 2751, 540, 369, 537, 358, 2668, 1927, 518, 541, 1930, 512, 29, 312, 499, 240, 183, 325, 91, 326, 2951, 2120, 289, 537, 436, 1945, 123, 537, 1948, 5785, 266, 879, 6093, 385, 284, 541, 537, 211, 1958, 1959, 392, 33, 34, 178, 5767, 494, 344, 399, 473, 1969, 1970, 92, 4850, 1973, 537, 218, 1976, 293, 25, 467, 413, 537, 369, 537, 31, 314, 325, 202, 480, 518, 166, 1991, 1992, 146, 198, 451, 5794, 326, 1998, 2850, 2000, 4640, 393, 449, 309, 437, 120, 157, 3015, 1728, 257, 155, 474, 941, 2001, 3175, 404, 2017, 326, 298, 267, 198, 369, 6356, 2024, 2649, 2026, 99, 460, 2029, 2030, 2031, 5325, 2033, 2034, 289, 2036, 4048, 135, 293, 369, 5543, 441, 2043, 443, 537, 160, 119, 388, 202, 172, 5223, 3001, 6283, 2079, 454, 209, 365, 4069, 180, 204, 369, 184, 2104, 6463, 404, 3114, 538, 467, 2043, 541, 470, 94, 2073, 3081, 537, 2076, 2077, 254, 2079, 202, 195, 2082, 2083, 2071, 157, 6485, 2087, 2071, 2089, 2071, 478, 2071, 140, 2094, 2095, 404, 491, 425, 225, 2951, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 454, 137, 386, 2117, 388, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 5119, 1639, 2129, 306, 2131, 2132, 2071, 2071, 2135, 4085, 3, 2989, 3558, 5, 3643, 451, 25, 6008, 1656, 11, 541, 4106, 3568, 2150, 2151, 2152, 4111, 5990, 2929, 485, 2931, 3372, 3768, 5138, 488, 3035, 3036, 3037, 3004, 5158, 4121, 2168, 3118, 3119, 3120, 3121, 3024, 3123, 2931, 183, 456, 6408, 293, 333, 449, 1901, 5355, 454, 5357, 312, 388, 497, 468, 1909, 5989, 29, 5748, 441, 2848, 443, 0, 1917, 3148, 6433, 5537, 6435, 2082, 4143, 4144, 4145, 4146, 2208, 91, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 5404, 3167, 38, 470, 3643, 91, 4024, 2780, 381, 494, 351, 3238, 361, 2003, 3850, 2005, 537, 2007, 397, 2009, 3856, 2011, 3741, 1962, 60, 2015, 83, 397, 1899, 86, 257, 133, 5107, 454, 5109, 4110, 93, 379, 140, 527, 4115, 4116, 144, 241, 5448, 5143, 6499, 388, 1919, 398, 1989, 539, 153, 5799, 4213, 4214, 541, 436, 13, 145, 433, 494, 494, 179, 121, 166, 436, 293, 5386, 369, 48, 172, 298, 365, 3792, 153, 112, 283, 2979, 5080, 2981, 5082, 5083, 5084, 2985, 2780, 4244, 436, 166, 541, 45, 289, 465, 71, 172, 6151, 2316, 213, 326, 5821, 473, 480, 308, 476, 404, 397, 99, 494, 541, 541, 480, 452, 228, 454, 122, 494, 2708, 458, 3552, 326, 221, 3839, 180, 78, 494, 182, 119, 38, 371, 355, 5773, 518, 112, 153, 361, 251, 3363, 486, 195, 518, 148, 369, 3369, 221, 436, 324, 166, 3141, 518, 358, 2370, 208, 172, 254, 541, 326, 214, 326, 537, 166, 358, 370, 369, 326, 157, 172, 1647, 537, 349, 205, 81, 1652, 5728, 267, 260, 173, 254, 4252, 326, 525, 526, 527, 528, 529, 530, 531, 532, 533, 480, 494, 454, 400, 484, 173, 3964, 6495, 494, 404, 369, 293, 369, 221, 494, 211, 373, 306, 369, 2427, 27, 407, 386, 209, 6512, 518, 441, 316, 443, 6273, 397, 3487, 518, 369, 3490, 153, 326, 3100, 518, 263, 306, 209, 283, 50, 268, 404, 254, 404, 166, 273, 316, 537, 326, 404, 172, 470, 420, 537, 1727, 254, 5346, 335, 1731, 494, 6090, 289, 391, 308, 404, 436, 4958, 486, 2955, 6284, 374, 365, 380, 415, 4966, 369, 2963, 449, 3538, 2966, 535, 172, 472, 518, 539, 10, 3546, 365, 13, 289, 5380, 369, 421, 293, 306, 373, 268, 325, 440, 221, 404, 273, 474, 35, 316, 196, 541, 306, 5, 480, 404, 532, 172, 172, 11, 494, 537, 411, 539, 441, 45, 443, 19, 494, 518, 519, 404, 52, 3164, 3222, 518, 519, 254, 3169, 302, 3171, 196, 196, 5886, 518, 3308, 38, 486, 537, 80, 3181, 374, 518, 3184, 537, 3186, 3187, 538, 78, 3190, 541, 92, 80, 3194, 5669, 3196, 439, 3447, 3199, 442, 527, 537, 69, 70, 92, 398, 143, 421, 466, 530, 424, 244, 539, 150, 535, 365, 537, 4266, 539, 306, 532, 4270, 3341, 536, 5, 537, 419, 539, 541, 316, 11, 466, 394, 2813, 3353, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 5684, 2622, 4562, 397, 5, 5689, 5690, 494, 537, 22, 11, 2632, 2633, 2813, 2635, 28, 538, 151, 6442, 541, 536, 2642, 3267, 530, 3797, 541, 3389, 5526, 535, 2650, 537, 2652, 539, 470, 2655, 2656, 310, 271, 2659, 310, 2661, 315, 436, 2664, 315, 466, 538, 2668, 1012, 541, 2651, 5453, 3559, 1017, 3629, 2650, 2812, 537, 2814, 2815, 3469, 3470, 3352, 197, 3354, 3355, 454, 4699, 202, 3432, 2691, 285, 286, 287, 288, 3450, 2697, 2698, 441, 371, 443, 3255, 4375, 100, 4716, 267, 480, 2708, 2809, 6236, 3665, 2682, 2683, 2684, 6241, 6242, 2717, 2718, 15, 16, 494, 538, 2697, 2698, 394, 538, 5605, 3407, 541, 538, 2731, 538, 541, 538, 541, 153, 541, 2847, 2739, 253, 2741, 535, 538, 537, 518, 541, 3503, 538, 166, 3225, 541, 267, 2736, 5801, 172, 466, 2782, 538, 2784, 6461, 541, 538, 6464, 537, 541, 100, 538, 5407, 3744, 541, 2771, 3569, 538, 538, 207, 541, 541, 100, 3630, 3255, 96, 2782, 179, 2784, 4394, 538, 4745, 538, 541, 537, 541, 539, 10, 4752, 4753, 13, 538, 2798, 312, 541, 271, 538, 2133, 221, 541, 2136, 5662, 3953, 2809, 33, 34, 2812, 2813, 2814, 2815, 87, 213, 2818, 4617, 538, 2821, 196, 541, 538, 535, 2691, 541, 45, 539, 538, 2940, 228, 541, 537, 52, 539, 254, 538, 2771, 2840, 541, 4392, 538, 4394, 179, 541, 2821, 538, 454, 538, 541, 2852, 541, 486, 251, 494, 179, 496, 4357, 494, 78, 496, 4377, 59, 3716, 2866, 2867, 441, 394, 443, 6397, 4068, 2873, 538, 538, 244, 541, 541, 213, 538, 484, 2882, 541, 280, 3892, 494, 6223, 496, 306, 5529, 213, 538, 537, 228, 541, 409, 538, 538, 316, 541, 541, 518, 519, 2904, 3586, 228, 4326, 538, 2840, 3934, 541, 3021, 538, 310, 6087, 541, 251, 538, 538, 11, 541, 541, 294, 295, 2925, 295, 386, 387, 251, 3583, 3584, 4430, 434, 151, 4607, 4608, 538, 2938, 537, 541, 3890, 538, 310, 538, 541, 280, 541, 391, 538, 3896, 2925, 541, 538, 538, 541, 541, 541, 280, 538, 538, 2961, 541, 541, 2964, 3739, 48, 3339, 3340, 3593, 3744, 538, 3344, 514, 541, 3607, 310, 386, 387, 538, 197, 313, 541, 538, 380, 202, 541, 5672, 5673, 538, 2990, 2991, 541, 5637, 538, 538, 538, 541, 541, 541, 441, 538, 443, 516, 541, 3005, 537, 3007, 3008, 5887, 494, 413, 496, 3385, 3386, 528, 529, 530, 531, 532, 533, 538, 59, 2978, 541, 2744, 397, 48, 397, 538, 538, 538, 541, 541, 541, 538, 253, 486, 541, 3039, 3040, 3041, 135, 2762, 137, 3045, 380, 2766, 514, 466, 3674, 2770, 3676, 3053, 3607, 5910, 5911, 538, 380, 538, 541, 10, 541, 227, 13, 436, 3066, 436, 17, 18, 19, 539, 3072, 6409, 3074, 494, 2795, 496, 474, 4629, 3733, 538, 538, 313, 541, 541, 4624, 3087, 538, 310, 538, 541, 3092, 541, 172, 312, 45, 4311, 3098, 5848, 5849, 3101, 3755, 52, 538, 538, 310, 541, 541, 480, 2829, 480, 538, 3113, 3114, 541, 5994, 538, 535, 60, 541, 538, 539, 494, 3124, 494, 48, 538, 2847, 78, 541, 538, 538, 540, 3134, 541, 3136, 227, 3273, 538, 3275, 3276, 541, 4645, 538, 530, 540, 518, 3922, 518, 3133, 6487, 538, 6145, 538, 541, 538, 541, 514, 541, 538, 538, 538, 541, 541, 541, 537, 2886, 537, 538, 3270, 540, 4179, 538, 177, 3175, 541, 3177, 4850, 3179, 538, 538, 541, 541, 541, 4857, 538, 343, 538, 541, 4862, 541, 409, 4865, 2913, 538, 3820, 4238, 541, 4240, 2919, 538, 3826, 538, 541, 538, 541, 538, 541, 537, 541, 4186, 3212, 538, 2933, 483, 541, 538, 4266, 537, 541, 2940, 4270, 4840, 2943, 4842, 4645, 5878, 3407, 538, 2949, 4376, 541, 538, 4379, 538, 541, 4382, 541, 538, 538, 538, 541, 541, 541, 4271, 537, 4273, 197, 3114, 2969, 538, 37, 202, 541, 5307, 2975, 5309, 537, 3940, 3913, 4052, 3915, 2982, 38, 1509, 3898, 1511, 3900, 538, 3270, 3271, 538, 3273, 178, 3275, 3276, 2996, 3278, 4241, 59, 72, 386, 387, 6162, 3285, 60, 78, 386, 387, 3290, 3010, 6051, 6052, 55, 56, 223, 5255, 5256, 516, 3341, 92, 3021, 223, 253, 537, 537, 498, 369, 4284, 539, 528, 529, 530, 531, 532, 533, 10, 537, 537, 13, 202, 158, 5262, 17, 18, 19, 4375, 537, 120, 158, 122, 539, 3512, 310, 202, 369, 310, 112, 3339, 3340, 3341, 35, 158, 3344, 3898, 4321, 3900, 3389, 158, 3982, 202, 3352, 3353, 3354, 3355, 4037, 148, 158, 310, 172, 369, 158, 312, 4973, 252, 122, 474, 3368, 537, 6164, 3371, 310, 3373, 302, 10, 538, 172, 13, 293, 72, 38, 17, 18, 19, 3385, 3386, 293, 4012, 3389, 4014, 182, 4016, 498, 537, 310, 4138, 293, 48, 6277, 35, 48, 293, 459, 293, 6283, 91, 3407, 182, 3409, 326, 3411, 486, 3413, 4421, 486, 4423, 87, 4071, 454, 211, 172, 158, 158, 4938, 350, 537, 158, 158, 3982, 4172, 205, 3432, 498, 158, 3435, 158, 158, 541, 3439, 158, 158, 4449, 158, 158, 158, 172, 4393, 158, 3490, 158, 158, 158, 158, 3440, 3441, 3442, 3457, 310, 436, 409, 537, 125, 4349, 103, 38, 252, 310, 172, 172, 22, 5143, 6, 537, 4216, 6, 28, 135, 537, 137, 537, 172, 4224, 3457, 537, 537, 537, 3487, 537, 263, 3490, 3491, 537, 537, 268, 3495, 3496, 3497, 3498, 273, 6, 3542, 293, 6, 3504, 537, 164, 298, 537, 3509, 537, 537, 537, 537, 54, 289, 6, 3236, 537, 537, 537, 537, 537, 4668, 3524, 537, 4323, 537, 537, 6, 6408, 537, 225, 537, 300, 537, 537, 537, 3538, 537, 3259, 5552, 3542, 537, 537, 3545, 3546, 3266, 3548, 537, 537, 325, 537, 537, 537, 537, 347, 537, 537, 4607, 4608, 101, 495, 322, 4518, 167, 0, 516, 223, 541, 541, 229, 363, 38, 252, 38, 525, 526, 527, 528, 529, 530, 531, 532, 533, 537, 126, 37, 447, 3589, 225, 447, 535, 535, 4540, 449, 449, 537, 178, 449, 374, 4076, 449, 172, 541, 145, 306, 172, 304, 43, 404, 151, 6406, 3613, 3614, 68, 449, 449, 391, 312, 449, 485, 3487, 449, 398, 3490, 391, 285, 286, 287, 288, 539, 449, 173, 292, 293, 449, 177, 5577, 391, 298, 254, 449, 79, 373, 419, 449, 527, 449, 3649, 92, 391, 192, 5325, 158, 4528, 310, 3657, 396, 249, 449, 449, 298, 473, 128, 99, 449, 439, 310, 5608, 331, 304, 537, 3538, 5346, 386, 467, 312, 449, 449, 195, 3546, 537, 92, 10, 128, 326, 13, 202, 158, 38, 17, 18, 19, 4701, 541, 470, 474, 474, 449, 449, 449, 128, 449, 449, 449, 114, 3707, 5380, 35, 449, 128, 60, 59, 3893, 449, 449, 449, 59, 153, 277, 449, 449, 314, 449, 354, 449, 354, 354, 449, 449, 3731, 166, 449, 331, 331, 47, 439, 172, 541, 449, 3741, 225, 542, 178, 538, 225, 310, 449, 4121, 184, 449, 449, 187, 225, 225, 310, 191, 298, 135, 449, 137, 537, 225, 112, 225, 225, 225, 225, 225, 5189, 4143, 4144, 4145, 4146, 459, 38, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 221, 164, 223, 158, 310, 158, 293, 474, 120, 158, 158, 456, 485, 158, 310, 4850, 38, 293, 4177, 260, 293, 293, 4857, 468, 38, 172, 244, 4862, 355, 393, 4865, 158, 158, 254, 10, 474, 158, 13, 537, 474, 158, 17, 18, 19, 449, 525, 526, 527, 528, 529, 530, 531, 532, 533, 4213, 4214, 537, 178, 297, 541, 537, 277, 38, 3850, 302, 490, 229, 5526, 537, 3856, 205, 277, 538, 13, 537, 537, 449, 541, 187, 537, 3867, 451, 538, 538, 10, 306, 321, 13, 195, 310, 195, 17, 18, 19, 275, 316, 514, 535, 3604, 4258, 395, 491, 514, 525, 526, 527, 528, 529, 530, 531, 532, 533, 225, 221, 538, 407, 241, 3904, 3905, 3906, 541, 538, 285, 286, 287, 288, 311, 4889, 263, 292, 538, 538, 541, 268, 3921, 298, 474, 38, 273, 474, 319, 59, 538, 485, 537, 449, 5605, 298, 3935, 4589, 4590, 449, 298, 172, 289, 391, 377, 298, 537, 298, 449, 537, 10, 241, 293, 13, 3953, 3954, 3955, 17, 18, 19, 3959, 310, 310, 298, 241, 252, 252, 252, 271, 386, 449, 128, 3971, 5510, 310, 4804, 4450, 202, 325, 439, 541, 310, 310, 10, 5128, 3967, 13, 312, 310, 541, 17, 18, 19, 4872, 404, 369, 3714, 494, 3971, 432, 196, 401, 358, 449, 449, 316, 538, 4687, 4688, 4689, 4690, 4691, 38, 225, 244, 527, 158, 172, 38, 486, 474, 4003, 353, 304, 437, 174, 537, 374, 4027, 401, 474, 354, 158, 466, 158, 158, 304, 225, 474, 537, 293, 38, 4041, 4042, 293, 310, 27, 310, 304, 4790, 244, 398, 193, 4052, 494, 172, 193, 173, 491, 4682, 493, 494, 4685, 38, 4222, 244, 172, 310, 202, 4068, 293, 202, 419, 202, 401, 202, 541, 202, 498, 4052, 59, 456, 515, 449, 178, 274, 310, 225, 4087, 494, 178, 302, 4715, 468, 515, 316, 5143, 4096, 541, 479, 539, 377, 5773, 541, 541, 538, 537, 540, 541, 541, 537, 4110, 538, 322, 538, 4114, 4115, 4116, 541, 5668, 135, 178, 4121, 470, 312, 4124, 538, 3845, 4127, 538, 541, 332, 538, 514, 4133, 538, 4135, 541, 292, 4138, 538, 449, 538, 5088, 4143, 4144, 4145, 4146, 538, 541, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 538, 538, 538, 4162, 4163, 4164, 267, 538, 541, 538, 538, 178, 536, 4172, 312, 537, 4216, 491, 4177, 187, 4220, 536, 4181, 537, 472, 537, 518, 537, 262, 491, 4189, 4562, 538, 4192, 537, 4194, 480, 4875, 225, 541, 525, 526, 527, 528, 529, 530, 531, 532, 533, 527, 310, 4210, 517, 59, 4213, 4214, 5887, 4216, 310, 4693, 4219, 4220, 537, 313, 537, 4224, 310, 4226, 4227, 780, 537, 782, 158, 784, 449, 449, 4235, 4236, 4237, 790, 791, 792, 449, 215, 4422, 4230, 4231, 4232, 4233, 298, 161, 449, 312, 4252, 4253, 4254, 4255, 4256, 4244, 4258, 4259, 293, 4244, 4262, 4244, 537, 4244, 4266, 537, 6207, 6208, 4270, 4450, 6211, 158, 207, 424, 4276, 5325, 537, 209, 396, 4934, 404, 158, 312, 158, 396, 396, 252, 207, 161, 310, 449, 527, 161, 4919, 474, 391, 5346, 491, 254, 333, 333, 4303, 471, 4024, 4244, 4244, 161, 449, 421, 264, 449, 449, 264, 449, 264, 391, 4318, 391, 4320, 391, 5994, 391, 4043, 128, 449, 293, 4047, 449, 449, 404, 5380, 158, 5108, 47, 525, 526, 527, 528, 529, 530, 531, 532, 533, 449, 449, 47, 536, 449, 449, 449, 4976, 4977, 538, 538, 538, 449, 190, 449, 225, 225, 538, 314, 538, 3, 5047, 5048, 541, 5050, 172, 459, 48, 113, 538, 4375, 4376, 4377, 541, 4379, 172, 38, 4382, 5802, 4384, 5038, 525, 526, 527, 528, 529, 530, 531, 532, 533, 158, 537, 449, 158, 172, 304, 4266, 190, 4403, 537, 4270, 527, 474, 474, 538, 158, 401, 391, 391, 391, 156, 391, 391, 156, 225, 225, 4793, 147, 535, 225, 538, 541, 225, 225, 5302, 225, 225, 225, 229, 225, 59, 988, 467, 467, 13, 310, 538, 310, 322, 310, 541, 5070, 5071, 310, 10, 485, 5458, 13, 292, 538, 538, 538, 538, 4458, 538, 178, 4640, 5335, 541, 525, 526, 527, 528, 529, 530, 531, 532, 533, 538, 538, 537, 536, 228, 5526, 538, 537, 6, 320, 5136, 45, 228, 438, 317, 4963, 537, 6162, 52, 59, 191, 537, 377, 479, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1058, 5340, 446, 4464, 4375, 90, 459, 4513, 172, 38, 474, 78, 6127, 474, 4475, 244, 215, 449, 59, 439, 158, 86, 474, 421, 182, 459, 449, 396, 161, 391, 449, 391, 449, 449, 449, 538, 538, 538, 537, 5705, 4546, 5707, 369, 494, 537, 59, 439, 172, 310, 480, 78, 5605, 158, 113, 4560, 10, 4562, 459, 13, 225, 538, 537, 241, 225, 4570, 225, 225, 210, 537, 537, 4576, 5201, 498, 310, 5204, 5205, 538, 38, 541, 10, 331, 4587, 13, 449, 151, 307, 3, 310, 537, 184, 45, 541, 459, 541, 44, 5225, 4602, 52, 449, 6277, 537, 4607, 4608, 538, 185, 6283, 401, 113, 178, 4615, 225, 538, 145, 242, 45, 242, 538, 298, 4624, 178, 298, 52, 298, 78, 538, 298, 538, 4352, 4634, 538, 197, 5318, 59, 538, 492, 202, 492, 541, 5487, 322, 4646, 4647, 5329, 538, 4633, 331, 538, 78, 304, 228, 537, 4657, 541, 10, 537, 537, 13, 446, 493, 449, 494, 303, 4668, 4669, 527, 178, 459, 198, 494, 209, 78, 196, 196, 38, 298, 298, 207, 541, 527, 59, 4686, 439, 449, 72, 215, 449, 253, 218, 45, 541, 4875, 541, 158, 449, 161, 52, 5381, 449, 538, 225, 537, 5716, 5853, 127, 180, 120, 1264, 38, 202, 537, 1268, 1269, 289, 304, 401, 474, 38, 293, 174, 5773, 151, 78, 4728, 494, 401, 59, 304, 439, 84, 494, 6408, 38, 178, 172, 5419, 310, 4607, 4608, 4744, 212, 223, 537, 197, 364, 313, 312, 538, 202, 178, 5408, 541, 538, 5903, 538, 537, 59, 4762, 418, 479, 394, 538, 38, 81, 537, 537, 537, 197, 92, 538, 136, 4495, 202, 310, 4498, 449, 538, 322, 203, 538, 38, 158, 158, 449, 538, 4790, 538, 172, 4793, 38, 537, 298, 209, 537, 265, 151, 4801, 4802, 537, 253, 5950, 5951, 537, 4808, 4809, 537, 537, 474, 4813, 538, 537, 537, 537, 4818, 401, 5827, 4821, 158, 4823, 113, 38, 178, 538, 253, 4829, 314, 459, 416, 4833, 4834, 4835, 4836, 538, 416, 5887, 172, 5583, 541, 38, 538, 310, 197, 538, 409, 206, 4850, 202, 112, 4853, 537, 5597, 5863, 4857, 537, 537, 38, 35, 4862, 312, 363, 4865, 4866, 541, 4868, 479, 4870, 439, 195, 4873, 537, 4875, 541, 5619, 537, 474, 172, 4600, 439, 207, 5626, 4910, 537, 312, 4888, 538, 5262, 310, 4892, 6, 4894, 165, 498, 537, 4617, 72, 1452, 387, 253, 4886, 4887, 10, 387, 313, 13, 1461, 4910, 1463, 17, 18, 19, 1467, 72, 136, 540, 141, 478, 150, 1474, 310, 538, 538, 169, 479, 494, 494, 35, 169, 5939, 5942, 490, 5616, 332, 541, 4938, 4939, 45, 537, 38, 5315, 537, 404, 5994, 52, 5959, 266, 445, 445, 178, 298, 4954, 516, 439, 439, 5700, 5701, 409, 312, 310, 310, 401, 38, 38, 528, 529, 530, 531, 532, 533, 78, 313, 6120, 313, 537, 203, 4698, 180, 180, 537, 498, 409, 4850, 537, 157, 498, 356, 356, 386, 4857, 154, 59, 59, 81, 4862, 38, 317, 4865, 370, 4957, 59, 59, 538, 537, 449, 125, 472, 538, 6, 401, 4968, 1566, 141, 537, 310, 498, 498, 5020, 538, 52, 310, 1576, 35, 537, 5027, 5709, 298, 294, 5655, 537, 294, 404, 24, 537, 62, 541, 318, 386, 390, 310, 541, 386, 81, 390, 537, 480, 5049, 449, 178, 537, 150, 6199, 6200, 479, 157, 409, 427, 416, 416, 427, 541, 5064, 538, 6, 516, 1620, 1621, 120, 317, 480, 98, 538, 334, 180, 494, 494, 528, 529, 530, 531, 532, 533, 180, 474, 5711, 479, 537, 537, 516, 197, 538, 6239, 5095, 81, 202, 537, 940, 5536, 1269, 1730, 528, 529, 530, 531, 532, 533, 3255, 2989, 1663, 5112, 3665, 6162, 1667, 1668, 2898, 4421, 5119, 225, 226, 4396, 6111, 3070, 980, 3016, 5461, 5128, 5871, 3884, 5873, 5939, 6251, 4587, 5510, 4394, 162, 4394, 5097, 5486, 3652, 3590, 5143, 5734, 4951, 6339, 6240, 253, 5702, 5380, 6340, 5969, 5968, 6131, 6277, 5156, 3658, 5158, 4608, 4634, 4619, 5912, 5716, 4577, 516, 5143, 4416, 3084, 3084, 3690, 3932, 5155, 1022, 199, 5137, 4603, 528, 529, 530, 531, 532, 533, 5493, 5184, 3976, 4670, 5814, 6365, 6501, 6476, 296, 5477, 3892, 4642, 5195, 6143, 5421, 5687, 724, 18, 5825, 5381, 1890, 5424, 5577, 668, 312, 733, 28, 315, 4041, 4698, 5653, 4701, 740, 5419, 6361, 743, 1244, 3100, 2756, 4645, 3568, 249, 3987, 5905, 5536, 5407, 6277, 5802, 720, 1931, 3824, 4449, 6283, 5608, 753, 3015, 3741, 5419, 5716, 6251, 6169, 6412, 1545, 1934, 4676, 4674, 5249, 3046, 2698, 6335, 869, 4888, 1843, 6077, 4318, 5648, 5259, 5651, 41, 5262, 1414, 289, 5265, 5266, 5267, 293, 1441, 41, 1945, 4744, 4992, 6, 3509, 3524, 2708, 5143, 1502, 1501, 6070, 5875, 5418, 1504, 5004, 1969, 3490, 4272, 4254, 5290, 5291, 5326, 3487, 5605, 5295, 5604, 4319, 3487, 6389, 6064, 326, 327, 6212, 409, 5862, 3487, 6428, 1860, 5581, 335, 5311, 1458, 2627, 4181, 5315, 5876, 3430, 5877, 2124, 52, 5321, 2628, 3286, 3045, 5325, 3410, 5826, 5463, 5329, 6430, 3400, 5332, 4113, 5334, 2696, 928, 3322, 2633, -1, 5340, -1, -1, -1, 369, -1, 5346, -1, 373, 5349, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, 6408, -1, 387, -1, -1, -1, -1, -1, -1, -1, -1, 396, -1, -1, -1, -1, -1, -1, -1, 404, 5380, 5381, 5382, -1, 5384, -1, 5386, -1, -1, 5942, -1, -1, 417, -1, -1, -1, -1, -1, -1, -1, -1, 426, -1, -1, -1, -1, 431, -1, 6415, -1, -1, 516, -1, -1, -1, -1, -1, -1, 5418, 5419, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 6455, -1, -1, -1, -1, -1, -1, 542, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5325, -1, -1, 5463, 489, -1, 198, -1, -1, 6476, -1, -1, -1, -1, -1, 207, 208, 5477, -1, -1, -1, 5346, 5482, 215, -1, 217, 218, 5487, -1, -1, 5862, -1, -1, -1, 6501, -1, 5496, -1, -1, 231, -1, -1, 0, -1, 5223, -1, 5506, -1, 5491, -1, 5510, -1, -1, 5513, -1, 5380, -1, -1, -1, -1, -1, -1, -1, -1, 5524, 5525, 5526, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1063, 5522, -1, -1, -1, 5536, 1069, 2097, 2098, 5536, 1073, 5536, 1075, 5525, -1, 5536, 5536, 5536, 5536, 5536, 6111, -1, 5560, -1, 2114, 2115, -1, -1, -1, -1, 5338, -1, -1, -1, -1, -1, 6348, 6349, 5536, 5577, -1, -1, -1, 5581, 5536, 5583, 5536, 5626, 5536, 5536, 5536, 5536, -1, -1, -1, 2145, 5536, 5536, 0, 5597, 5536, 5536, -1, 99, -1, 6345, 6477, 5605, -1, -1, 5608, 6233, -1, -1, 5612, -1, 1139, -1, 1141, 1142, -1, 5619, -1, -1, -1, -1, -1, -1, 5626, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5355, -1, 5357, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6394, -1, -1, 153, -1, -1, -1, -1, -1, 5526, -1, -1, -1, -1, -1, -1, 166, 5669, -1, -1, -1, -1, 172, -1, -1, -1, 5678, -1, 178, -1, -1, -1, -1, -1, 184, -1, 6060, 187, -1, -1, -1, 191, 5694, 99, -1, -1, 6251, 729, 5700, 5701, -1, -1, -1, 5705, 5706, 5707, 5708, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 221, -1, 755, 5905, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5736, -1, -1, -1, 5605, -1, -1, -1, -1, 5745, -1, -1, -1, 153, -1, -1, -1, -1, -1, -1, 254, -1, -1, -1, -1, -1, 166, -1, -1, -1, -1, -1, 172, -1, 5770, -1, -1, 5773, 178, -1, -1, -1, -1, -1, 184, -1, -1, 187, -1, -1, -1, 191, -1, -1, -1, -1, 5775, -1, -1, -1, -1, -1, 5798, -1, -1, -1, -1, -1, -1, -1, -1, -1, 306, -1, -1, -1, 310, -1, -1, -1, -1, 221, 316, -1, -1, -1, -1, -1, -1, -1, 5826, -1, -1, -1, -1, -1, -1, -1, -1, 6207, 6208, -1, 5838, 6211, -1, -1, -1, -1, -1, -1, -1, 5847, 5848, 5849, 254, -1, -1, 5853, -1, -1, -1, -1, -1, 5859, -1, -1, 5862, -1, -1, -1, -1, -1, -1, -1, -1, 5871, -1, 5873, -1, 5875, 5876, -1, -1, 377, -1, -1, -1, -1, -1, -1, -1, 5887, -1, -1, -1, -1, -1, -1, 5894, -1, -1, -1, -1, -1, -1, 5884, 306, 5903, -1, 5905, 310, -1, 5773, 5909, -1, -1, 316, -1, 5914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 666, -1, -1, -1, 436, -1, -1, -1, -1, -1, -1, -1, -1, -1, 25, -1, 5950, 5951, -1, 685, 31, -1, -1, -1, -1, 691, -1, -1, -1, -1, -1, -1, 6101, -1, 466, 46, -1, 703, -1, 377, -1, -1, -1, -1, -1, -1, 5980, -1, -1, -1, -1, -1, -1, 719, -1, -1, -1, -1, 724, 491, 5994, 493, 494, 729, -1, 76, -1, 733, 734, -1, -1, -1, -1, -1, 740, -1, 742, 743, -1, -1, -1, -1, -1, 515, -1, -1, -1, -1, 5887, 755, 756, -1, -1, -1, -1, -1, -1, -1, 436, -1, 766, 6170, 6171, 535, 1068, -1, 538, 539, 540, -1, -1, 6045, -1, -1, -1, 1079, -1, -1, -1, -1, 131, -1, 133, -1, -1, -1, 6060, -1, 466, 140, 6064, 1095, -1, 144, -1, -1, 6070, -1, 10, -1, -1, 13, -1, -1, 6078, 17, 18, 19, 6082, -1, -1, -1, 818, 491, -1, 493, 494, -1, -1, -1, -1, -1, 173, 35, -1, -1, -1, 6101, 834, -1, -1, -1, -1, 45, -1, -1, -1, 515, -1, 6113, 52, -1, -1, -1, -1, -1, 6120, -1, -1, 855, 856, -1, -1, 2679, 2680, 5994, -1, 535, 209, 2685, 538, 539, 540, -1, -1, -1, 78, -1, -1, -1, -1, 6145, -1, 879, -1, 881, -1, -1, 6152, -1, -1, -1, -1, -1, -1, -1, -1, 6144, 6162, -1, -1, 2717, 2718, -1, -1, -1, 6170, 6171, 6172, 905, -1, -1, 6176, -1, -1, -1, -1, -1, 6169, -1, -1, -1, 6169, -1, 6169, -1, -1, -1, -1, -1, -1, -1, 928, -1, -1, 6199, 6200, 6201, -1, -1, -1, -1, -1, 6207, 6208, 941, -1, 6211, 289, -1, 6214, -1, 293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304, 2780, -1, -1, 6169, 6169, -1, 17, -1, -1, 314, -1, 6239, -1, -1, 1272, 26, -1, 6245, 6287, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6277, 6278, 6279, -1, -1, -1, 6283, -1, -1, -1, 225, 226, -1, -1, -1, 369, -1, -1, 372, 373, 6162, -1, -1, 6287, 6301, -1, -1, 6287, -1, 6287, -1, 6308, -1, -1, -1, -1, -1, 2866, 253, 6316, 1049, 1050, 1051, -1, -1, -1, -1, 6324, -1, 1058, 404, -1, -1, 6330, 1063, -1, -1, -1, 6335, 1068, 1069, -1, -1, -1, 1073, -1, 1075, -1, 6345, -1, 1079, -1, 6287, 6287, 25, -1, -1, 6489, 6490, -1, 31, 296, -1, -1, -1, -1, 1095, -1, -1, -1, -1, 6087, -1, -1, -1, 46, -1, 312, -1, -1, 315, -1, -1, -1, 6381, 6382, 6383, 6384, -1, -1, -1, -1, 6389, -1, -1, -1, -1, 6394, -1, -1, -1, -1, -1, 477, -1, 76, 2955, -1, 6405, -1, 1139, 6408, 1141, 1142, 2963, 6277, -1, 2966, -1, -1, -1, 6283, -1, 1945, -1, -1, 1948, -1, 6412, 2978, -1, 6428, 6412, -1, 6412, -1, 1958, 1959, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1973, -1, 1182, 1976, -1, -1, -1, 6455, 6456, 131, -1, 133, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, 144, 409, 6472, -1, 6412, 6412, -1, -1, 1210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6489, 6490, -1, -1, 6493, -1, 6495, -1, -1, -1, 173, -1, 2026, -1, -1, -1, 2030, 2031, -1, -1, -1, -1, 1243, 6512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1258, -1, -1, -1, -1, -1, -1, -1, -1, 209, 1268, 1269, -1, -1, 1272, -1, 1274, 6408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1290, -1, 38, -1, -1, 1295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1307, 10, -1, 516, 13, -1, -1, 60, 17, 18, 19, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 1629, 538, 35, -1, 541, -1, -1, -1, -1, 86, -1, -1, 45, -1, -1, -1, 289, -1, 1349, 52, 293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304, -1, -1, -1, 112, 113, -1, -1, -1, -1, 314, -1, 120, -1, 78, -1, 1378, 1379, 1380, -1, 1382, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1403, 10, 3225, -1, 13, -1, -1, -1, 17, 18, 19, 160, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 369, -1, 35, 372, 373, -1, 3253, -1, 3255, 182, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, 1448, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 205, -1, 25, 404, -1, -1, -1, -1, 31, -1, -1, -1, -1, 78, -1, -1, -1, -1, 1477, -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1494, 197, -1, -1, 1498, 1499, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, 1514, -1, -1, 263, -1, -1, 1520, -1, 268, 225, 226, -1, -1, 273, -1, -1, -1, 10, -1, -1, 13, 477, -1, -1, 17, 18, 19, -1, -1, 289, -1, -1, -1, 293, -1, -1, -1, 253, -1, -1, -1, -1, 35, 1855, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 1866, 133, -1, -1, -1, 52, -1, -1, 140, -1, -1, 325, 144, -1, -1, -1, 1882, -1, 25, -1, 1588, -1, -1, 197, 31, -1, 296, -1, 202, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, 173, 312, -1, -1, 315, -1, -1, -1, -1, 669, 225, 226, -1, -1, -1, -1, -1, -1, -1, 374, 1629, -1, -1, -1, -1, -1, -1, -1, 76, 1936, -1, -1, -1, -1, -1, -1, 209, 3466, 253, -1, -1, -1, -1, 398, 1951, -1, -1, 1954, 1955, -1, -1, -1, -1, 1662, -1, -1, -1, -1, -1, 719, 720, -1, -1, -1, 419, -1, 421, -1, -1, 424, -1, -1, -1, -1, -1, -1, -1, -1, 1985, 1986, -1, 296, -1, -1, -1, 133, -1, 3516, 3517, -1, -1, -1, 140, -1, -1, -1, 144, 312, 409, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, 470, 289, -1, -1, 1728, 293, -1, -1, -1, -1, 173, -1, -1, -1, -1, 0, 304, -1, -1, 1743, 1744, 1745, 225, 226, -1, -1, 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, -1, 326, -1, 815, 816, -1, 818, 819, -1, 209, -1, -1, -1, 253, -1, -1, 10, -1, 830, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 537, -1, -1, -1, -1, 57, -1, 849, -1, -1, -1, 35, 409, -1, 369, -1, -1, 372, 373, -1, -1, 45, -1, 516, -1, -1, 296, -1, 52, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 312, -1, -1, 315, -1, -1, 541, 404, -1, -1, 1843, -1, 78, -1, -1, -1, -1, 289, 2149, -1, -1, 293, 1855, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304, 1866, -1, -1, -1, -1, -1, -1, -1, -1, 314, -1, -1, 1878, -1, -1, -1, 1882, -1, -1, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2691, -1, -1, 1901, -1, -1, -1, -1, -1, -1, -1, 1909, 516, -1, -1, 477, -1, -1, -1, 1917, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 409, 192, -1, 372, 373, 541, 1936, -1, -1, -1, -1, -1, -1, -1, -1, 1945, -1, -1, 1948, -1, -1, 1951, -1, -1, 1954, 1955, -1, -1, 1958, 1959, -1, 1961, 1962, -1, 197, 404, -1, -1, -1, 202, -1, -1, -1, 1973, -1, 1975, 1976, -1, -1, -1, -1, -1, -1, -1, -1, 1985, 1986, -1, 1988, 1989, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1058, -1, -1, -1, -1, -1, -1, -1, -1, 2809, -1, -1, 2812, 253, 2814, 2815, -1, 23, -1, 2026, -1, -1, 28, 2030, 2031, 10, -1, -1, 13, -1, 516, 477, 17, 18, 19, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 35, -1, 538, -1, -1, -1, 296, -1, -1, -1, 45, -1, -1, -1, -1, -1, 3893, 52, -1, -1, 25, -1, 312, 79, 80, 315, 31, -1, 25, -1, 2087, -1, 2089, -1, 31, -1, -1, 2094, 2095, 3916, 96, -1, -1, 78, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, -1, 114, -1, 2117, 38, 2119, -1, 2121, 2122, 2123, 2124, 2125, 2126, -1, 76, 2129, -1, 2131, 2132, -1, -1, 2135, 76, -1, -1, 138, -1, -1, 62, -1, -1, -1, -1, -1, -1, 2149, 2150, 2151, 2152, 152, -1, -1, -1, -1, -1, -1, -1, -1, 161, -1, -1, -1, -1, -1, 2168, -1, 2170, -1, -1, -1, -1, 174, 409, -1, 98, -1, -1, 180, -1, -1, -1, 133, -1, -1, -1, -1, -1, -1, 140, 133, -1, -1, 144, -1, 1249, -1, 140, -1, -1, -1, 144, -1, -1, 1258, 207, -1, -1, -1, -1, 1264, 1265, -1, -1, 1268, 1269, 197, -1, -1, -1, -1, 202, 173, -1, -1, -1, -1, -1, -1, -1, 173, -1, -1, -1, -1, -1, -1, -1, -1, 162, -1, 1295, -1, 245, 225, 226, -1, -1, -1, -1, -1, -1, -1, 4076, -1, -1, -1, -1, 209, -1, -1, -1, -1, -1, -1, 267, 209, -1, -1, -1, -1, -1, 253, -1, -1, -1, 199, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2316, -1, 296, -1, -1, 3114, -1, -1, 244, -1, -1, -1, -1, 249, -1, -1, -1, 1384, 312, 38, -1, 315, -1, -1, -1, 289, 1393, -1, -1, 293, -1, -1, -1, 289, -1, 350, 351, 293, -1, 354, 304, -1, 1409, 62, -1, -1, -1, -1, 304, -1, 314, -1, -1, -1, 2370, -1, -1, 293, 314, -1, -1, -1, 326, -1, -1, -1, 381, -1, -1, 384, 326, -1, -1, -1, -1, -1, 391, -1, -1, 98, -1, -1, -1, 398, -1, -1, 401, -1, -1, -1, -1, 327, -1, -1, -1, 672, -1, -1, -1, 335, -1, -1, -1, -1, -1, 369, 421, -1, 372, 373, -1, 2427, -1, 369, 429, 409, 372, 373, -1, -1, -1, 436, -1, -1, 439, -1, -1, -1, -1, 444, -1, -1, -1, -1, -1, -1, -1, 373, -1, -1, 404, -1, 378, 162, 459, -1, -1, -1, 404, -1, -1, 387, -1, -1, -1, -1, -1, -1, -1, -1, 396, 3270, -1, -1, 3273, -1, 3275, 3276, 404, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, -1, 199, 417, -1, -1, -1, -1, -1, -1, 765, 766, 426, -1, -1, -1, -1, 431, -1, 2811, -1, -1, -1, -1, -1, 2817, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, -1, -1, 452, -1, -1, -1, -1, 477, 516, -1, -1, 244, -1, -1, -1, -1, 249, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, 2863, -1, -1, -1, 489, -1, -1, -1, 493, -1, -1, -1, 25, -1, -1, -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, 293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4422, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, -1, 2622, -1, 327, -1, -1, -1, 76, -1, 4450, 1682, 335, 2633, -1, 2635, -1, -1, -1, 1690, -1, -1, -1, -1, 4464, -1, -1, -1, -1, -1, -1, -1, 2652, -1, -1, 4475, 2656, -1, -1, 2659, -1, 2661, -1, -1, 2664, -1, -1, -1, 2668, -1, 373, -1, -1, -1, -1, 378, -1, 938, -1, 940, -1, -1, -1, -1, 387, 133, -1, -1, -1, 2689, -1, 2691, 140, 396, 3487, -1, 144, 3490, -1, -1, -1, 404, -1, -1, -1, -1, -1, -1, 2708, -1, -1, -1, -1, 25, 417, -1, -1, 2717, 2718, 31, -1, -1, -1, 426, -1, 173, -1, -1, 431, -1, -1, 4551, 4552, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 2744, 3538, -1, -1, -1, 452, -1, 2751, -1, 3546, -1, 2755, 2756, -1, -1, -1, -1, 209, 2762, 20, 76, -1, 2766, -1, -1, -1, 2770, -1, -1, -1, 31, 3073, 33, 34, -1, -1, 2780, -1, -1, -1, -1, -1, 489, -1, -1, -1, 493, -1, -1, -1, 51, 2795, -1, -1, 2798, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, 2809, -1, 2811, 2812, -1, 2814, 2815, 73, 2817, 75, 76, 4640, 133, -1, -1, -1, 82, -1, 84, 140, 2829, -1, -1, 144, -1, -1, -1, -1, -1, -1, -1, 97, 289, 99, -1, -1, 293, -1, 2847, 2848, -1, -1, -1, -1, 1904, -1, -1, 304, 1908, -1, 116, -1, 173, 119, 2863, -1, -1, 314, -1, -1, -1, -1, 62, -1, 4693, -1, -1, -1, 134, 326, 136, -1, -1, -1, 140, -1, 2885, 2886, -1, -1, 2889, 147, -1, -1, -1, -1, -1, -1, 209, -1, -1, 157, -1, 159, -1, -1, -1, -1, 98, -1, 166, -1, -1, -1, 2913, -1, 2915, -1, -1, -1, 2919, -1, 369, -1, -1, 372, 373, -1, 184, -1, -1, -1, -1, -1, 2933, -1, -1, -1, -1, -1, -1, 2940, -1, -1, 2943, 201, -1, -1, -1, -1, 2949, -1, -1, -1, -1, -1, 1216, 404, -1, -1, 3257, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2969, -1, 162, -1, -1, 3272, 2975, -1, 289, -1, 3277, -1, 293, 2982, -1, -1, 25, -1, -1, -1, -1, -1, 31, 304, -1, -1, -1, 2996, 2048, 255, 256, -1, -1, 314, 2054, 261, -1, -1, -1, 199, 3307, 3010, -1, -1, -1, 326, 3015, -1, -1, -1, 276, -1, 3021, -1, -1, -1, -1, -1, -1, -1, 477, -1, -1, -1, -1, -1, -1, 76, -1, 295, 3039, 3040, 3041, 1303, -1, -1, 3045, -1, -1, -1, 2100, -1, -1, -1, -1, -1, -1, -1, 369, 249, -1, 372, 373, 1323, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3072, 3073, -1, -1, -1, -1, 335, -1, -1, 3081, -1, -1, -1, -1, -1, -1, 345, -1, -1, -1, 404, 133, -1, -1, -1, -1, 289, -1, 140, -1, 293, 360, 144, -1, -1, -1, 365, 366, -1, 368, -1, -1, 3114, -1, 373, -1, -1, -1, -1, 1382, 379, -1, -1, 382, -1, -1, -1, -1, -1, -1, 389, 173, -1, 326, 327, 4957, -1, 396, 397, -1, -1, 4963, 335, -1, 3146, 404, 4968, -1, 3150, 408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 419, -1, -1, 477, -1, -1, -1, 209, -1, -1, -1, -1, -1, 4995, 4996, -1, 369, 436, 5000, 5001, 373, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, 387, -1, -1, -1, 457, -1, -1, -1, -1, 396, -1, -1, -1, -1, -1, -1, 469, 404, -1, -1, -1, -1, 475, -1, -1, -1, -1, 480, -1, -1, 417, -1, -1, -1, -1, 1492, 1493, -1, 1495, 426, 3236, 494, 3238, -1, 431, -1, -1, -1, -1, 52, -1, -1, -1, 289, -1, -1, -1, 293, -1, 3255, -1, 3257, -1, 3259, -1, 518, -1, -1, 304, -1, 3266, -1, -1, -1, 3270, -1, 3272, 3273, 314, 3275, 3276, 3277, -1, -1, 537, -1, -1, 540, -1, 3285, 326, 25, -1, -1, 3290, -1, -1, 31, -1, -1, -1, -1, 489, -1, -1, -1, -1, -1, -1, -1, -1, 3307, -1, -1, -1, -1, 3610, -1, 10, -1, -1, 13, -1, -1, 3618, 17, 18, 19, -1, -1, -1, -1, -1, 369, -1, -1, 372, 373, -1, -1, -1, -1, 76, 3339, 3340, 3341, -1, -1, 3344, -1, -1, -1, -1, 45, -1, -1, 3352, 3353, 3354, 3355, 52, -1, 10, -1, -1, 13, -1, 3363, 404, 17, 18, 19, 3368, 3369, -1, 3371, -1, 3373, -1, -1, -1, -1, -1, -1, -1, -1, 78, 35, -1, 3385, 3386, -1, -1, 3389, -1, -1, -1, 45, -1, 133, -1, -1, -1, -1, 52, -1, 140, -1, -1, -1, 144, -1, -1, 3409, -1, 3411, -1, 3413, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3723, 78, 3725, -1, -1, -1, -1, 3432, -1, -1, 173, -1, 477, -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, -1, -1, -1, -1, 209, -1, 4266, 35, -1, -1, 4270, -1, -1, -1, -1, -1, -1, 45, -1, -1, 3487, -1, -1, 3490, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, 3504, -1, 202, -1, -1, 3509, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, 3821, 3524, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, 3538, -1, -1, -1, -1, -1, -1, 197, 3546, -1, -1, -1, 202, 289, -1, -1, -1, 293, -1, 253, 3558, -1, -1, 3561, -1, 3563, -1, -1, 304, 3865, 3568, -1, -1, -1, -1, 225, 226, -1, 314, -1, -1, -1, -1, -1, 4375, 3583, 3584, -1, -1, 5407, 326, 3589, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, 253, -1, -1, 3604, -1, -1, 3607, -1, -1, 3610, -1, -1, -1, -1, -1, 312, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 369, -1, -1, 372, 373, 197, -1, -1, -1, -1, 202, -1, 3643, 296, -1, -1, -1, -1, 3649, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 3961, 225, 226, 404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3689, 3690, 3691, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4005, -1, -1, -1, -1, -1, 409, 3714, -1, -1, -1, -1, -1, -1, -1, -1, 3723, -1, 3725, -1, -1, -1, 2780, -1, -1, -1, 3733, -1, 296, -1, -1, -1, 477, 2001, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, 25, 315, 3755, -1, 409, -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2836, -1, -1, -1, -1, -1, -1, 4090, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, 2071, -1, -1, -1, 4607, 4608, -1, -1, -1, -1, 516, 3821, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, 2104, 4142, 3845, -1, -1, 409, -1, 3850, -1, -1, -1, -1, -1, 3856, -1, -1, -1, -1, 133, -1, -1, 516, 3865, -1, 2128, 140, 4167, 2921, -1, 144, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3892, 3893, 2945, -1, 5716, -1, 3898, -1, 3900, 173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3913, -1, 3915, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3935, -1, 209, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 755, -1, -1, -1, -1, -1, -1, 516, -1, -1, 3009, -1, -1, 3961, 3013, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, 98, -1, 3982, 3983, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3050, -1, 3052, -1, 3054, 3055, 4005, -1, -1, 3059, 3060, 3061, -1, 3063, 3064, 3065, -1, -1, 289, -1, -1, 10, 293, -1, 13, 4024, -1, -1, 17, 18, 19, -1, -1, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, 314, 4043, 162, 35, -1, 4047, -1, -1, -1, -1, -1, -1, 326, 45, -1, 4850, -1, -1, 2321, -1, 52, -1, 4857, -1, 3117, -1, -1, 4862, -1, 4071, 4865, 4866, -1, -1, -1, -1, -1, -1, -1, 199, -1, -1, -1, -1, -1, 4087, 78, -1, 4090, 3142, -1, -1, -1, -1, 4096, 369, 905, -1, 372, 373, -1, -1, -1, -1, -1, -1, -1, -1, 4110, 5931, -1, -1, 4114, 4115, 4116, -1, -1, -1, -1, 4121, -1, -1, 4124, -1, -1, 4127, -1, -1, 62, 249, 404, 4133, -1, 4135, -1, -1, 4138, -1, -1, -1, 4142, 4143, 4144, 4145, 4146, -1, -1, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, -1, -1, -1, 4162, 4163, 4164, -1, 98, 4167, -1, -1, -1, -1, 4172, -1, -1, 293, -1, 4177, -1, 4179, -1, 4181, -1, -1, -1, -1, -1, -1, -1, 4189, -1, -1, 4192, -1, 4194, -1, -1, -1, -1, -1, -1, -1, -1, 23, 3255, 477, -1, 197, 28, 327, 4210, -1, 202, 4213, 4214, -1, 4216, 335, -1, 4219, 4220, -1, -1, -1, 4224, -1, 4226, -1, -1, -1, 162, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, 4252, -1, -1, 373, -1, 375, 4258, 79, 378, 1068, -1, 253, -1, -1, 4266, 199, -1, 387, 4270, -1, 1079, -1, -1, -1, 96, -1, 396, -1, -1, -1, -1, -1, -1, -1, 404, -1, 1095, -1, -1, -1, -1, -1, 114, 4593, -1, -1, -1, 417, -1, -1, -1, 4303, -1, -1, 296, -1, 426, -1, -1, -1, -1, 431, -1, -1, -1, 249, 138, 5112, 4320, -1, 312, -1, -1, 315, 4326, -1, -1, -1, -1, -1, 152, -1, -1, -1, -1, -1, -1, -1, -1, 161, -1, -1, -1, -1, -1, -1, -1, -1, 5143, -1, 4352, -1, 174, -1, -1, 289, -1, -1, 180, 293, -1, -1, -1, -1, -1, 187, -1, -1, -1, 489, -1, -1, -1, 4375, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 207, -1, -1, 17, 18, 19, -1, 326, 327, 2657, -1, -1, -1, -1, -1, -1, 335, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, 4416, -1, 45, 409, -1, 4421, 4422, 4423, -1, 52, -1, -1, -1, -1, 2691, -1, -1, -1, -1, -1, -1, 369, -1, -1, -1, 373, -1, -1, -1, -1, 378, 267, -1, 4449, 4450, 78, -1, -1, -1, 387, -1, 1264, -1, -1, -1, -1, -1, -1, 396, 1272, -1, -1, -1, -1, -1, -1, 404, -1, -1, 2736, -1, -1, -1, -1, -1, -1, -1, -1, -1, 417, -1, -1, -1, -1, -1, -1, 312, -1, 426, 4495, -1, -1, 4498, 431, -1, -1, -1, -1, -1, 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 340, -1, -1, -1, -1, -1, 516, -1, -1, -1, 350, 351, 5325, -1, 354, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, 5346, -1, -1, 3607, 489, -1, -1, -1, 381, 4562, -1, 384, -1, -1, -1, 388, -1, 197, 391, -1, -1, -1, 202, -1, -1, 398, -1, -1, 401, -1, -1, -1, -1, -1, 5380, -1, 4589, 4590, -1, -1, 4593, -1, 6415, -1, -1, 225, 226, 4600, 421, -1, -1, -1, -1, -1, 4607, 4608, 429, -1, -1, -1, -1, -1, -1, 436, 4617, -1, 439, -1, -1, -1, 4921, 444, 5418, 253, -1, -1, -1, -1, -1, 452, -1, 454, -1, -1, -1, -1, 459, 4640, -1, -1, -1, 3695, 4645, 4646, 4647, -1, -1, -1, -1, -1, 473, -1, -1, 6476, 4657, -1, -1, -1, -1, -1, -1, -1, -1, 486, -1, -1, 296, 5463, -1, -1, -1, -1, -1, -1, 4975, -1, -1, -1, 6501, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4698, 4997, -1, 4701, 3753, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1520, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4728, -1, -1, -1, -1, 5526, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4744, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4762, -1, -1, -1, -1, -1, -1, -1, -1, 5069, 3823, -1, -1, -1, -1, -1, -1, -1, -1, 1588, 409, -1, -1, -1, -1, -1, -1, -1, 4790, -1, -1, 4793, -1, -1, -1, -1, -1, -1, -1, 4801, 4802, -1, 4804, -1, -1, -1, 4808, 4809, -1, -1, 5605, 4813, -1, -1, -1, -1, 4818, -1, 3871, 4821, 1629, 4823, -1, -1, -1, -1, -1, 4829, -1, -1, 3883, 3884, -1, -1, -1, -1, -1, -1, -1, -1, 3893, -1, -1, -1, -1, 3898, -1, 3900, 4850, -1, -1, -1, -1, 1662, -1, 4857, -1, -1, -1, -1, 4862, -1, -1, 4865, 4866, -1, -1, -1, -1, -1, 3133, 4873, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, 516, -1, -1, 4892, 5191, -1, 3946, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, -1, 10, -1, 4921, 13, -1, -1, -1, 17, 18, 19, -1, 3981, 3982, -1, -1, 4934, -1, -1, -1, -1, 4939, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, 5745, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4975, -1, -1, -1, 52, 5773, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 4992, -1, -1, -1, -1, 4997, -1, -1, -1, -1, -1, -1, 5004, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5020, 10, -1, -1, 13, -1, -1, 5027, 17, 18, 19, -1, -1, 5331, -1, -1, -1, -1, 5038, -1, -1, -1, -1, -1, -1, -1, 35, -1, 1855, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 1866, -1, -1, -1, 52, -1, -1, -1, -1, -1, 5069, -1, -1, -1, -1, -1, 1882, -1, -1, -1, -1, 3341, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 5887, 5095, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, 5112, -1, -1, -1, -1, 5117, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3389, 1936, -1, -1, -1, -1, 225, 226, 5136, 4188, -1, -1, -1, -1, -1, 5143, 1951, -1, -1, 1954, 1955, -1, -1, 3412, -1, -1, 8, -1, -1, -1, -1, -1, 14, 15, 253, -1, -1, -1, 20, 3428, 22, -1, -1, -1, -1, -1, 28, -1, -1, 31, 1985, 1986, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5189, -1, 5191, -1, -1, -1, -1, 50, 51, -1, -1, -1, 5994, -1, -1, -1, 296, -1, -1, 197, -1, -1, 10, -1, 202, 13, -1, -1, -1, 17, 18, 19, 312, -1, 5223, 315, -1, 3487, -1, -1, 3490, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 5249, -1, -1, -1, 52, -1, -1, -1, -1, -1, 5259, -1, -1, 5262, -1, 253, 5265, 5266, 5267, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3538, -1, 78, -1, 3542, -1, -1, -1, 3546, -1, -1, -1, -1, 5290, 5291, -1, -1, -1, 5295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, 6101, -1, -1, 5311, -1, -1, -1, 5315, -1, -1, 409, -1, -1, 5321, -1, 312, -1, 5325, 315, -1, -1, -1, -1, 5331, 5332, -1, -1, -1, -1, -1, -1, -1, 5340, -1, 2149, -1, -1, -1, 5346, 201, -1, 5349, -1, 205, -1, -1, -1, 5355, -1, 5357, -1, 213, -1, -1, 216, -1, -1, 219, 220, -1, 222, 6162, 224, 4422, -1, 227, -1, 229, -1, 6170, 6171, -1, 5380, -1, -1, -1, -1, -1, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, -1, -1, -1, 197, 4450, -1, -1, -1, 202, -1, -1, -1, 5407, 5408, -1, -1, -1, -1, -1, 4465, -1, -1, 4468, 5418, 4470, 409, -1, -1, -1, -1, 516, 225, 226, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, 5458, -1, -1, -1, -1, 5463, -1, 4516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4532, -1, -1, 6277, -1, 4537, -1, -1, -1, 6283, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, 5803, -1, -1, 6301, -1, -1, -1, -1, 312, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5526, 516, -1, 5529, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, 5560, -1, -1, -1, -1, -1, -1, -1, 5866, -1, -1, -1, -1, -1, -1, -1, -1, 5577, -1, -1, -1, 5581, -1, 5583, -1, 755, 4637, -1, -1, 4640, 6383, -1, -1, -1, -1, -1, -1, 5597, -1, -1, -1, -1, -1, -1, -1, 5605, -1, -1, 5608, -1, 409, -1, -1, -1, -1, 6408, -1, -1, -1, 5619, -1, -1, -1, -1, -1, -1, 5626, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, 4711, -1, -1, 6456, -1, -1, 4717, 4718, 4719, 4720, -1, 4722, 4723, 4724, 4725, 4726, -1, -1, 5678, 6472, -1, -1, 755, -1, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, -1, 5694, -1, 6489, 6490, -1, -1, 5700, 5701, 5702, -1, -1, -1, 3967, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5716, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 905, 5736, -1, -1, -1, -1, -1, 4003, -1, -1, 5745, -1, -1, 5748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5773, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4841, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5802, 5803, -1, -1, -1, -1, -1, -1, -1, -1, -1, 667, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 678, -1, 5826, 5827, 682, -1, -1, -1, 905, -1, -1, 689, 690, -1, 5838, 693, -1, 695, 696, -1, -1, -1, -1, 5847, 5848, 5849, -1, -1, -1, -1, -1, -1, 710, -1, -1, -1, -1, -1, 5862, 5863, -1, -1, 5866, -1, -1, -1, -1, 5871, -1, 5873, 728, 5875, -1, -1, -1, 1049, -1, -1, -1, -1, -1, -1, -1, 5887, -1, -1, -1, -1, -1, -1, 5894, 749, -1, 751, 1068, -1, -1, -1, -1, -1, -1, -1, -1, 761, -1, 1079, -1, -1, -1, -1, 5914, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, 1095, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5939, 794, -1, 5942, -1, 2751, -1, -1, -1, 2755, 2756, -1, -1, -1, -1, -1, 4216, -1, -1, -1, 4220, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4244, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5994, 1068, -1, -1, -1, -1, -1, -1, -1, -1, 2811, 4266, 1079, -1, -1, 4270, 2817, -1, -1, -1, -1, -1, 5067, 5068, -1, -1, -1, -1, 1095, -1, -1, -1, -1, 10, 882, 5080, 13, 5082, 5083, 5084, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, 6045, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 2863, -1, -1, -1, 6060, -1, 45, -1, -1, -1, -1, -1, -1, 52, 6070, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6087, -1, -1, 6388, -1, -1, -1, -1, 78, -1, -1, 5149, -1, -1, 6101, 1272, -1, -1, -1, -1, -1, -1, -1, -1, 6111, -1, 967, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5188, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 6152, -1, -1, -1, -1, 52, -1, -1, -1, -1, 6162, -1, -1, -1, -1, -1, -1, -1, 6170, 6171, -1, -1, -1, -1, 6176, -1, -1, -1, -1, 5232, -1, 78, -1, -1, -1, 1041, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, 1272, -1, -1, -1, -1, -1, -1, -1, 6207, 6208, -1, -1, 6211, 1066, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, 1081, -1, 1083, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1093, -1, -1, 225, 226, -1, -1, 1100, -1, -1, -1, -1, 6251, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3073, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, 6277, -1, -1, -1, -1, -1, 6283, -1, -1, -1, -1, -1, 1143, -1, 1145, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6301, 197, -1, -1, -1, -1, 202, 6308, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6324, -1, -1, -1, -1, 312, 225, 226, 315, -1, -1, -1, -1, -1, -1, 3146, -1, -1, -1, 3150, -1, 6345, 4607, -1, -1, -1, 1520, -1, -1, -1, -1, -1, 5407, -1, 253, -1, -1, -1, -1, -1, -1, 1219, -1, 1221, -1, 1223, -1, 1225, 4633, 1227, 1228, 1229, -1, -1, -1, -1, 1234, -1, -1, 6383, -1, -1, -1, -1, 6388, -1, -1, -1, 1246, -1, 6394, -1, -1, -1, -1, -1, -1, 296, 5453, -1, -1, -1, -1, -1, 6408, -1, -1, 5462, -1, -1, -1, 6415, -1, 312, 1588, -1, 315, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1520, -1, -1, 3257, -1, -1, -1, -1, 6455, 6456, -1, -1, 1629, -1, -1, -1, -1, -1, 3272, -1, -1, -1, -1, 3277, 10, 6472, -1, 13, -1, 6476, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, 6489, 6490, -1, 1662, -1, -1, -1, 35, -1, -1, -1, 3307, 6501, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, 409, 1588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, 78, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, 1629, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1743, 1744, 1745, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1441, -1, 1662, -1, -1, -1, 729, -1, -1, 4857, -1, -1, -1, -1, 4862, -1, -1, 4865, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 755, -1, 516, -1, -1, -1, 4886, 4887, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, 5716, -1, -1, -1, 5720, -1, 25, -1, -1, -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, 38, 1855, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, 1866, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, 1562, -1, -1, -1, 1882, -1, 253, -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3558, -1, -1, 3561, -1, 3563, 296, 112, -1, -1, 3568, -1, -1, -1, -1, 1936, -1, -1, 905, -1, -1, -1, 312, -1, -1, 315, -1, -1, 133, 1634, 1951, 1855, -1, 1954, 1955, 140, -1, 10, -1, 144, 13, -1, 1866, -1, 17, 18, 19, -1, -1, -1, -1, -1, 3610, -1, -1, -1, -1, -1, 1882, -1, 3618, -1, 35, -1, 1985, 1986, -1, -1, 173, -1, -1, -1, 45, -1, 10, -1, -1, 13, -1, 52, -1, 17, 18, 19, -1, 3643, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 205, -1, -1, -1, 209, 78, -1, -1, -1, 45, -1, -1, 1936, -1, -1, -1, 52, -1, -1, 409, -1, 729, -1, -1, -1, -1, -1, 1951, -1, -1, 1954, 1955, -1, -1, -1, -1, -1, -1, -1, -1, 5942, -1, 78, 5155, 5946, -1, 5948, 755, -1, -1, 5952, 5953, -1, -1, -1, -1, -1, -1, 263, -1, -1, 1985, 1986, 268, -1, 3723, -1, 3725, 273, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1068, -1, -1, 289, -1, 2107, -1, 293, -1, -1, -1, 1079, -1, -1, -1, -1, -1, -1, 304, 2121, -1, -1, 2124, -1, -1, -1, -1, 1095, 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 325, 326, -1, -1, 197, -1, 516, -1, 2149, 202, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 1851, -1, 538, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, 197, -1, 3821, 369, -1, 202, 372, 373, 374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, 1886, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, 398, -1, -1, -1, 905, -1, 404, -1, -1, -1, -1, -1, -1, -1, 3865, -1, -1, -1, -1, -1, 5325, 419, -1, -1, 253, -1, -1, -1, -1, -1, 296, -1, 2149, -1, 1932, -1, -1, -1, -1, -1, -1, -1, 3893, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, 1952, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, 0, -1, -1, 470, -1, -1, -1, -1, -1, -1, 477, 1978, -1, 1980, 312, -1, -1, 315, -1, -1, 20, -1, -1, 1272, -1, -1, -1, -1, 1995, -1, 1997, 31, -1, 33, 34, -1, 2003, -1, 2005, -1, 2007, 3961, 2009, -1, 2011, -1, -1, -1, 2015, -1, -1, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, 3983, -1, -1, 52, -1, -1, -1, -1, -1, -1, 73, 409, 75, 76, -1, -1, -1, -1, -1, 82, -1, 84, 4005, -1, 6251, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, 1068, 99, -1, -1, -1, -1, -1, -1, -1, -1, 2075, 1079, -1, 409, -1, -1, -1, -1, 116, 5491, -1, 119, -1, -1, -1, -1, -1, 1095, -1, -1, -1, -1, -1, -1, -1, -1, 134, -1, 136, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, 147, 5522, -1, -1, -1, -1, -1, -1, -1, -1, 157, -1, 159, -1, -1, 5536, -1, -1, -1, 166, -1, -1, -1, 4090, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, 184, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 201, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, 4142, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, 4167, -1, -1, -1, 6415, 5626, -1, -1, 255, 256, -1, 6422, -1, -1, 261, 6426, -1, -1, -1, 10, -1, -1, 13, -1, 1520, -1, 17, 18, 19, 276, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 295, 10, -1, 6462, 13, -1, 45, 1272, 17, 18, 19, -1, -1, 52, -1, -1, -1, 6476, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 78, 335, -1, 6501, 52, 1588, 6504, -1, -1, -1, -1, 345, -1, -1, -1, -1, -1, -1, 2635, -1, -1, -1, -1, -1, -1, -1, 360, -1, -1, -1, 78, 365, 366, -1, 368, -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, 379, 1629, -1, 382, -1, -1, -1, -1, -1, -1, 389, -1, -1, -1, -1, -1, -1, 396, 397, -1, 5773, -1, 5775, -1, -1, 404, -1, 4326, -1, 408, -1, -1, -1, -1, 1662, -1, -1, -1, -1, -1, 419, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, 197, -1, -1, -1, 457, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2751, 469, -1, -1, 2755, 2756, -1, 475, -1, -1, -1, -1, 480, 225, 226, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, 494, -1, -1, -1, -1, -1, -1, -1, 4422, -1, -1, -1, -1, -1, -1, 253, 5884, 225, 226, -1, -1, -1, -1, -1, 518, -1, 520, 521, 522, 523, 524, -1, -1, -1, 2811, -1, 4450, -1, -1, -1, 2817, -1, -1, 537, -1, 253, 540, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1520, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2751, -1, -1, 312, 2755, 2756, 315, -1, -1, -1, -1, -1, -1, -1, -1, 2863, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, 1855, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1866, 1588, -1, -1, -1, -1, -1, -1, 2811, -1, -1, -1, -1, -1, 2817, -1, 1882, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1629, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, 4593, -1, -1, -1, 2863, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1936, -1, -1, -1, -1, 1662, -1, -1, 409, -1, -1, -1, -1, -1, -1, 1951, -1, -1, 1954, 1955, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4640, -1, -1, -1, -1, 4645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1985, 1986, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3041, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 755, 6144, -1, 516, -1, -1, -1, -1, -1, 2745, 2746, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 3073, -1, -1, -1, 538, 6169, -1, 2764, 2765, -1, 2767, 2768, 516, -1, -1, -1, 2773, 2774, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 2788, -1, -1, 538, 2792, -1, -1, -1, 2796, 2797, -1, -1, 2800, 2801, -1, -1, -1, -1, -1, 2807, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2819, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3146, 2831, -1, -1, 3150, -1, 2836, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2849, -1, 4804, 1855, 2853, 3073, -1, -1, -1, -1, -1, -1, -1, -1, 1866, -1, 2865, -1, 2149, 2868, -1, 2870, 2871, 2872, -1, -1, -1, -1, 2877, 2878, 1882, 6287, -1, -1, -1, -1, -1, 905, 2887, -1, -1, -1, -1, -1, 2893, -1, -1, -1, 2897, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2909, 2910, -1, -1, -1, 2914, -1, -1, -1, -1, -1, 2920, 2921, -1, -1, -1, -1, -1, 3146, -1, -1, -1, 3150, -1, 1936, 2934, -1, -1, 2937, -1, -1, -1, 3257, -1, -1, 2944, 2945, -1, -1, 1951, -1, 2950, 1954, 1955, -1, -1, -1, 3272, -1, -1, -1, -1, 3277, 2962, -1, -1, 2965, -1, -1, 4921, -1, 2970, 10, -1, -1, 13, -1, 2976, 2977, 17, 18, 19, -1, 1985, 1986, 2984, -1, -1, -1, 2988, -1, -1, 3307, 2992, 2993, 2994, 2995, 35, 2997, -1, -1, -1, -1, -1, -1, -1, 6412, 45, -1, -1, -1, -1, 3011, 3012, 52, 3014, -1, -1, -1, -1, -1, -1, -1, 4975, -1, -1, 3025, 3026, 3027, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3257, 78, -1, -1, -1, -1, 4997, -1, -1, -1, -1, 1068, -1, -1, -1, 3272, -1, -1, -1, -1, 3277, -1, 1079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 1095, -1, -1, 17, 18, 19, 3082, -1, -1, -1, -1, -1, 3307, -1, 3090, -1, -1, 729, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 3109, -1, -1, -1, -1, 52, -1, 5069, -1, -1, 755, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, 78, -1, -1, -1, -1, -1, 2149, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, 3159, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3178, -1, 3180, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5191, -1, -1, -1, 3558, -1, -1, 3561, -1, 3563, -1, -1, -1, -1, 3568, 1272, -1, -1, -1, 296, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, 905, -1, -1, -1, 312, -1, -1, 315, -1, -1, 3279, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, 3610, -1, -1, -1, -1, -1, -1, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3643, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3558, -1, -1, 3561, -1, 3563, -1, -1, -1, -1, 3568, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, 312, -1, -1, 315, 5331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3610, -1, -1, -1, -1, -1, -1, -1, 3618, -1, -1, 52, -1, -1, -1, -1, 3723, -1, 3725, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3643, -1, -1, -1, -1, -1, -1, -1, 1068, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5407, -1, -1, -1, -1, 1095, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2751, -1, 409, -1, 2755, 2756, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, 1520, -1, -1, 3723, 3821, 3725, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2811, -1, -1, -1, -1, 3850, 2817, -1, -1, -1, -1, 3856, -1, -1, -1, -1, -1, -1, -1, -1, 3865, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1588, -1, -1, -1, -1, -1, -1, 5529, 3893, 516, -1, -1, 2863, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, 3821, -1, -1, 3605, -1, -1, -1, -1, 1629, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3622, -1, -1, -1, 3626, -1, -1, -1, -1, 3631, 3632, 3633, -1, -1, 1272, -1, -1, -1, -1, -1, -1, 1662, -1, 3961, 3865, -1, -1, -1, -1, -1, -1, 3653, -1, -1, -1, -1, 25, -1, -1, -1, -1, -1, 31, -1, -1, 3983, -1, -1, -1, 38, -1, -1, 3893, -1, -1, 3677, 3678, 3679, 3680, -1, -1, -1, -1, -1, -1, -1, -1, 4005, -1, -1, -1, 60, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, 3715, -1, 3717, 3718, 3719, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, -1, -1, 3961, -1, -1, 112, -1, -1, 2751, -1, -1, -1, 2755, 2756, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3983, -1, 133, -1, -1, -1, -1, -1, -1, 140, 4090, -1, -1, 144, -1, -1, -1, -1, -1, -1, -1, -1, 4005, -1, -1, -1, -1, 3073, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 173, -1, 2811, -1, -1, -1, -1, -1, 2817, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4142, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1855, 3837, 205, -1, -1, 755, 209, -1, -1, -1, 3846, 1866, -1, -1, 5803, 4167, -1, -1, -1, -1, -1, -1, -1, -1, 2863, -1, -1, 1882, 3146, -1, -1, -1, 3150, -1, -1, 4090, 3872, 3873, -1, -1, -1, 3877, -1, -1, -1, -1, -1, -1, 1520, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 263, -1, -1, 3899, -1, 268, -1, -1, -1, -1, 273, -1, -1, -1, -1, -1, -1, 5866, -1, -1, -1, 1936, -1, -1, -1, -1, 289, 4142, -1, -1, 293, -1, -1, -1, -1, -1, 1951, -1, -1, 1954, 1955, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, 314, 4167, -1, -1, 3951, 1588, -1, -1, -1, 3956, -1, 325, 326, -1, -1, 3962, -1, -1, -1, 1985, 1986, -1, -1, -1, -1, -1, -1, -1, 3257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3272, 905, 3992, 1629, -1, 3277, -1, -1, -1, -1, -1, -1, 369, -1, -1, 372, 373, 374, 10, -1, 4326, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, 4021, -1, 4023, -1, 3307, 1662, -1, -1, -1, -1, 398, -1, 35, -1, -1, -1, 404, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, 419, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3073, -1, -1, -1, -1, -1, 78, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 470, -1, 755, 4422, 4326, -1, -1, 477, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2149, -1, -1, -1, 4450, -1, -1, -1, -1, -1, -1, -1, -1, 3146, -1, -1, -1, 3150, -1, -1, -1, -1, -1, -1, 1068, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1079, -1, -1, -1, -1, -1, 209, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1095, -1, 221, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 232, 197, -1, -1, -1, -1, 202, -1, -1, 4422, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1855, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, 1866, 4450, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1882, -1, -1, -1, -1, 253, -1, -1, 3257, 905, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3272, -1, -1, -1, -1, 3277, -1, 3558, 4593, -1, 3561, -1, 3563, -1, -1, -1, -1, 3568, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, 1936, -1, -1, -1, 3307, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, 1951, -1, -1, 1954, 1955, -1, -1, -1, -1, 4640, -1, -1, -1, 3610, 4645, -1, -1, -1, -1, -1, -1, 3618, -1, 4338, -1, 4340, -1, -1, -1, -1, -1, -1, -1, -1, 1985, 1986, -1, -1, 4353, -1, -1, -1, -1, 1272, -1, -1, 3643, -1, -1, -1, 4365, -1, -1, -1, 4369, -1, -1, -1, -1, 4593, -1, -1, -1, -1, -1, 10, 4381, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4401, -1, -1, -1, 35, -1, 409, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 1068, 4419, -1, 4640, 52, -1, -1, -1, 4645, 4427, -1, 1079, -1, -1, -1, -1, -1, 6388, -1, -1, -1, -1, -1, 3723, -1, 3725, -1, 1095, -1, -1, 78, -1, -1, -1, 4452, -1, -1, -1, 4456, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4471, 4472, 4473, 4474, -1, -1, -1, -1, -1, -1, 4481, 4482, 4483, 4484, -1, -1, -1, 4804, -1, 4490, 4491, -1, -1, -1, -1, 4496, 4497, -1, 4499, 4500, 4501, 4502, 4503, 4504, 4505, -1, -1, -1, -1, -1, -1, -1, 2149, 516, 4515, -1, -1, -1, 4519, 4520, 4521, 4522, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, 3821, -1, -1, -1, 4543, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3558, -1, -1, 3561, -1, 3563, 4561, -1, -1, -1, 3568, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3865, -1, 4804, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, 4921, 1520, 3610, -1, -1, -1, 3893, -1, -1, -1, 3618, -1, -1, -1, -1, -1, -1, 1272, 253, -1, -1, -1, -1, -1, 667, -1, -1, -1, -1, -1, 673, -1, -1, 4638, -1, 3643, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4975, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, 4671, -1, -1, 1588, -1, -1, -1, 4678, 3961, 4680, 4997, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3983, 4921, -1, -1, -1, -1, -1, 4708, -1, -1, -1, -1, -1, -1, 1629, -1, -1, -1, -1, 3723, -1, 3725, 4005, -1, -1, -1, -1, -1, -1, -1, -1, 2751, -1, -1, -1, 2755, 2756, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1662, -1, -1, -1, -1, 5069, -1, -1, 4975, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4997, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2811, -1, -1, -1, -1, -1, 2817, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4090, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3821, 857, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 870, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2863, -1, -1, -1, -1, -1, 5069, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4142, -1, 3865, -1, -1, -1, -1, -1, -1, -1, 1520, -1, -1, 5189, -1, 5191, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4167, 516, -1, -1, -1, 3893, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4922, 4923, 4924, -1, -1, -1, 4928, 4929, 4930, 4931, -1, -1, -1, 4935, -1, -1, 1588, -1, -1, 1855, -1, -1, -1, -1, -1, -1, -1, -1, -1, 989, 1866, -1, -1, -1, -1, -1, 3961, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1882, -1, -1, -1, 5191, -1, -1, -1, -1, -1, -1, 1629, 3983, -1, -1, -1, -1, -1, -1, 4987, 4988, 4989, 4990, 4991, -1, 4993, 4994, -1, -1, -1, -1, -1, -1, -1, 4005, -1, -1, 5005, 5006, -1, -1, -1, -1, -1, 1662, -1, -1, 5331, -1, -1, -1, -1, -1, -1, 1936, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1951, -1, 5039, 1954, 1955, -1, -1, 4326, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3073, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1104, -1, -1, -1, -1, 1985, 1986, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4090, -1, -1, -1, 5407, -1, -1, -1, 1133, 1134, 1135, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5331, -1, -1, 2751, -1, -1, -1, 2755, 2756, -1, -1, -1, -1, -1, -1, 3146, -1, -1, -1, 3150, -1, -1, -1, -1, -1, -1, -1, 4142, 4422, -1, 5142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4167, -1, -1, -1, 4450, -1, -1, -1, -1, -1, -1, 2811, -1, -1, -1, -1, -1, 2817, -1, -1, -1, -1, -1, -1, 5407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1242, 1855, -1, 5207, -1, -1, -1, -1, -1, 5529, 10, -1, 1866, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, 2863, -1, -1, -1, -1, 1882, -1, -1, 2149, -1, -1, 3257, 35, 5240, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 1289, -1, 3272, -1, -1, 52, -1, 3277, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, 1936, -1, 3307, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 1951, -1, -1, 1954, 1955, -1, -1, -1, -1, 5529, 4593, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, 4326, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, 1985, 1986, -1, 5338, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 4640, 78, -1, -1, -1, 4645, -1, -1, -1, -1, 5684, 35, -1, -1, -1, 5689, 5690, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, 1430, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, 5409, -1, -1, 78, -1, -1, -1, -1, -1, -1, 4422, -1, -1, -1, -1, -1, -1, -1, -1, 5428, 225, 226, -1, -1, -1, 5434, 5435, -1, 3073, -1, -1, -1, -1, -1, -1, 5444, -1, -1, 4450, -1, -1, -1, 5451, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, 5684, -1, -1, -1, -1, 5689, 5690, 1510, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, 5802, 5803, 5488, 5489, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2149, 296, 5501, -1, 5503, -1, -1, 225, 226, -1, -1, 3146, -1, -1, -1, 3150, -1, 312, -1, 5518, 315, -1, -1, 4804, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, 253, -1, 202, -1, -1, 3558, -1, -1, 3561, 5543, 3563, -1, -1, -1, -1, 3568, 5866, 5551, -1, -1, -1, -1, 1594, -1, -1, 225, 226, -1, -1, -1, -1, 1603, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, 5803, -1, -1, 253, -1, -1, 4593, 3610, -1, 312, -1, -1, 315, 1635, -1, 3618, -1, 199, 200, 1641, 1642, 203, -1, 1645, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, 1658, 3257, -1, 1661, 3643, 223, -1, -1, -1, -1, 296, -1, 230, -1, -1, -1, 3272, 4640, -1, 4921, -1, 3277, 4645, 5643, -1, -1, 312, 5866, -1, 315, -1, -1, -1, -1, -1, -1, -1, 5657, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3307, -1, -1, -1, -1, -1, -1, -1, -1, 1718, -1, -1, 5683, -1, -1, -1, -1, -1, -1, 409, -1, -1, 4975, 1732, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3723, -1, 3725, -1, -1, -1, -1, -1, -1, -1, -1, 4997, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, 409, -1, -1, -1, -1, -1, -1, -1, 5751, -1, -1, 10, -1, -1, 13, -1, -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, -1, -1, 5069, -1, 45, -1, -1, -1, -1, -1, -1, 52, 516, -1, -1, -1, 4804, 3821, -1, 1842, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1853, -1, -1, -1, 538, -1, 5821, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2751, -1, -1, -1, 2755, 2756, -1, -1, -1, 3865, -1, -1, -1, 516, -1, -1, -1, -1, 5855, -1, 1895, 1896, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, 3893, -1, -1, -1, -1, -1, -1, -1, 1920, -1, -1, -1, -1, -1, -1, 1927, -1, -1, -1, -1, -1, -1, -1, 2811, -1, -1, -1, 5901, -1, 2817, -1, -1, -1, -1, -1, 5191, -1, -1, -1, -1, -1, -1, -1, -1, 4921, -1, -1, -1, 3558, -1, -1, 3561, 5926, 3563, -1, -1, -1, -1, 3568, -1, -1, 23, -1, -1, -1, -1, 28, 197, 3961, -1, -1, -1, 202, -1, -1, 2863, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2000, -1, 3983, -1, -1, -1, -1, 225, 226, -1, 4975, -1, 3610, -1, -1, -1, 66, -1, -1, -1, 3618, -1, -1, 5985, 4005, -1, -1, -1, -1, 79, -1, -1, 4997, 2033, 2034, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3643, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, -1, -1, -1, -1, -1, -1, -1, -1, 2073, -1, -1, 2076, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, 5331, 138, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, 152, -1, 5069, -1, -1, -1, -1, 4090, 6388, 161, -1, -1, -1, 675, -1, 677, -1, -1, 680, -1, -1, -1, 174, 3723, -1, 3725, -1, -1, 180, -1, -1, -1, 694, -1, -1, -1, 6100, 2751, 700, 207, 208, 2755, 2756, -1, -1, -1, -1, 215, -1, 217, 218, -1, -1, -1, -1, 207, -1, -1, -1, 4142, -1, 5407, -1, 231, -1, 6129, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6455, 6140, -1, -1, -1, -1, -1, -1, -1, 4167, -1, -1, -1, -1, 409, -1, -1, -1, 10, -1, 3073, 13, 2811, -1, -1, 17, 18, 19, 2817, -1, 6388, -1, -1, -1, -1, -1, -1, -1, -1, -1, 267, -1, -1, 35, -1, -1, 3821, -1, -1, 5191, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2863, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, 78, -1, -1, -1, 3865, -1, -1, 3146, -1, -1, -1, 3150, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5529, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3893, -1, -1, 516, -1, 350, 351, -1, -1, 354, 6267, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, -1, -1, 384, -1, -1, -1, -1, -1, -1, 391, -1, -1, -1, 4326, -1, -1, 398, -1, -1, 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3961, -1, -1, 5331, -1, -1, -1, -1, 421, -1, -1, -1, -1, -1, -1, -1, 429, -1, 3257, 197, -1, -1, 3983, 436, 202, -1, 439, -1, -1, -1, -1, 444, -1, 3272, -1, -1, -1, -1, 3277, 452, -1, -1, -1, -1, 4005, -1, 459, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3307, -1, -1, 994, 995, 486, -1, 253, -1, 5684, 4422, 5407, -1, -1, 5689, 5690, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3073, -1, -1, -1, -1, -1, -1, -1, 4450, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4090, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, 1065, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6479, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3146, -1, -1, -1, 3150, -1, -1, -1, -1, -1, 4142, -1, -1, -1, -1, -1, -1, 1111, 1112, -1, -1, -1, -1, -1, -1, 5803, -1, -1, -1, -1, 5529, -1, -1, -1, -1, 4167, -1, -1, -1, -1, -1, -1, -1, 1137, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, 666, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, 4593, 45, -1, -1, -1, 1177, 1178, 685, 52, -1, 5866, -1, -1, 691, -1, -1, -1, -1, -1, -1, 2632, -1, -1, -1, -1, 703, -1, -1, -1, -1, 2642, -1, -1, 3257, 78, -1, -1, -1, -1, -1, -1, 719, -1, -1, -1, -1, -1, 4640, 3272, -1, -1, -1, 4645, 3277, -1, 733, 734, -1, -1, -1, -1, -1, 740, -1, 742, 743, -1, -1, -1, -1, 3558, -1, -1, 3561, -1, 3563, -1, -1, 756, -1, 3568, -1, -1, 3307, -1, -1, -1, -1, 766, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 5684, -1, -1, -1, 538, 5689, 5690, -1, -1, 4326, -1, -1, 2731, -1, -1, 3610, -1, -1, -1, -1, -1, -1, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, 818, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 208, -1, 197, -1, 3643, 834, -1, 202, -1, 217, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 231, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 879, -1, -1, -1, -1, -1, -1, -1, 253, -1, 4804, 4422, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5803, -1, -1, -1, -1, -1, -1, -1, -1, 3723, -1, 3725, -1, -1, 4450, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 296, -1, 13, 2867, -1, -1, 17, 18, 19, -1, -1, 941, -1, -1, -1, -1, 312, -1, 2882, 315, -1, -1, -1, -1, 35, -1, -1, -1, 39, -1, -1, -1, -1, -1, 45, 10, -1, 5866, 13, -1, 2904, 52, 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, 78, -1, -1, 45, -1, -1, -1, -1, -1, 4921, 52, -1, -1, -1, 3821, 3558, -1, -1, 3561, -1, 3563, -1, -1, -1, -1, 3568, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, 130, -1, 1051, -1, -1, -1, 3865, 2990, 2991, 1058, -1, 4975, 4593, -1, -1, 3610, -1, -1, -1, -1, 1069, -1, -1, 3618, 1073, -1, 1075, -1, -1, -1, -1, -1, -1, 4997, 3893, -1, -1, -1, 1581, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3643, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4640, -1, -1, -1, 1606, 4645, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, 172, -1, -1, -1, -1, -1, 178, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, 516, 3961, 197, -1, 5069, -1, -1, 202, 3092, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 536, -1, 253, 3983, -1, -1, -1, 3723, -1, 3725, 225, 226, 1182, -1, -1, -1, -1, -1, -1, -1, -1, 1685, -1, -1, -1, 4005, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, 6388, -1, -1, -1, -1, 296, -1, -1, -1, -1, 1714, 1715, 1716, 1717, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, 1243, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, 1258, -1, -1, -1, -1, -1, -1, -1, -1, 312, 1268, 1269, 315, -1, 4804, -1, 1274, 3821, 5191, -1, -1, -1, 4090, -1, -1, -1, -1, -1, -1, 666, -1, -1, 1290, -1, -1, -1, -1, 1295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 685, -1, -1, -1, -1, -1, 691, -1, -1, -1, -1, -1, -1, 3865, -1, -1, -1, -1, 703, -1, -1, -1, 409, -1, -1, -1, 4142, -1, 10, -1, -1, 13, -1, -1, 719, 17, 18, 19, -1, -1, -1, 3893, -1, -1, -1, -1, -1, -1, -1, 734, -1, 4167, -1, 35, -1, -1, -1, 742, 409, -1, -1, 1861, 1862, 45, -1, -1, -1, -1, -1, -1, 52, 756, -1, -1, -1, -1, -1, 1877, -1, -1, -1, 766, -1, 4921, -1, -1, -1, 474, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3961, 5331, 1911, 1912, 1913, 1914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, 3983, -1, 818, -1, -1, -1, 4975, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 834, -1, -1, -1, 4005, -1, -1, -1, -1, -1, 4997, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, 1477, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 6388, -1, -1, 5407, -1, -1, -1, -1, -1, 1992, -1, 879, -1, -1, -1, 1998, 3439, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4326, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5069, -1, 10, -1, -1, 13, -1, 4090, -1, 17, 18, 19, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 941, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 253, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 4422, -1, 5529, -1, -1, -1, -1, -1, 296, 4167, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, 4450, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5191, -1, -1, -1, -1, -1, -1, -1, -1, 344, -1, -1, -1, 1051, -1, -1, -1, -1, -1, 10, 1058, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 171, -1, -1, 35, -1, -1, 38, -1, -1, -1, -1, -1, -1, 45, 2208, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, 197, -1, 1728, -1, -1, 202, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, 428, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 5684, 17, 18, 19, -1, 5689, 5690, -1, -1, -1, -1, 4326, -1, 253, 4593, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, 3731, 45, 5331, -1, -1, -1, 1182, -1, 52, -1, 3741, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, 4640, 78, -1, -1, -1, 4645, -1, -1, -1, -1, 516, 312, -1, 1843, 315, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, 1243, 197, -1, -1, -1, -1, 202, 342, -1, -1, -1, 5407, 4422, -1, 1878, 1258, -1, -1, -1, -1, -1, -1, -1, -1, 5803, 1268, 1269, -1, -1, 225, 226, 1274, -1, -1, -1, -1, -1, 1901, -1, -1, 4450, -1, -1, -1, -1, 1909, -1, 1290, -1, -1, -1, -1, 1295, 1917, 855, 856, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, 5866, -1, -1, -1, 202, -1, -1, 1958, 1959, -1, 1961, 1962, -1, 296, -1, -1, -1, -1, -1, 3904, 3905, 3906, 1973, -1, 1975, 1976, -1, 225, 226, 312, -1, -1, 315, -1, -1, -1, 3921, 1988, 1989, -1, 928, -1, -1, 4804, -1, -1, 5529, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3954, 3955, -1, -1, -1, 3959, 2026, -1, -1, -1, 2030, 2031, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, 4593, -1, 296, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, 4640, -1, -1, -1, 1477, 4645, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, 4921, 1049, 1050, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, 4068, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, 2655, 409, -1, -1, 4975, -1, -1, -1, -1, 2170, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, 4997, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -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, -1, -1, -1, 35, -1, -1, 38, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, 4804, 5069, -1, -1, -1, -1, -1, -1, -1, -1, 515, 516, 197, 5803, -1, -1, -1, 202, -1, 78, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, 4235, 4236, 4237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2818, -1, 253, -1, -1, -1, -1, -1, -1, -1, 5866, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 1728, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, 1307, -1, -1, 35, -1, 4921, -1, -1, -1, -1, -1, 5191, -1, 45, -1, 312, -1, -1, 315, -1, 52, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, 337, -1, 1349, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, 4975, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1378, 1379, 1380, -1, 1382, -1, -1, -1, -1, -1, 4997, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1843, -1, 1403, 2961, -1, -1, 2964, -1, -1, 6388, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, 1878, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, 178, -1, -1, -1, -1, 5331, 1901, 5069, -1, 10, -1, -1, 13, -1, 1909, -1, 17, 18, 19, 197, -1, -1, 1917, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, 38, -1, -1, -1, 1494, -1, 3053, 45, 1498, 1499, 225, 226, -1, -1, 52, -1, -1, -1, -1, 3066, -1, -1, -1, -1, -1, -1, -1, 3074, -1, 1961, 1962, -1, -1, -1, -1, -1, 516, -1, 253, -1, 78, -1, -1, 1975, 5407, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 409, 1988, 1989, -1, -1, -1, -1, -1, -1, -1, -1, 3113, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 296, -1, 4570, 17, 18, 19, 3134, -1, -1, -1, -1, 5191, -1, -1, -1, -1, 312, -1, -1, 315, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 4602, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3177, -1, 3179, -1, -1, -1, 2689, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, 4634, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, 516, -1, 202, -1, 5529, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 4669, -1, -1, -1, -1, 225, 226, -1, -1, 2744, -1, -1, 409, -1, -1, -1, -1, 4686, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2762, -1, -1, -1, 2766, -1, 253, -1, 2770, -1, -1, -1, -1, -1, -1, 3271, -1, -1, 2780, -1, -1, -1, 3278, 5331, -1, -1, -1, -1, -1, 2170, -1, -1, -1, 2795, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1743, 1744, 1745, -1, -1, 296, 2812, -1, 2814, 2815, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, 312, -1, 2829, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, 2847, 2848, -1, -1, -1, -1, -1, 516, -1, 6388, -1, -1, -1, -1, 5407, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 253, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, -1, -1, 2885, 2886, -1, -1, 2889, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4833, 4834, 4835, 4836, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2913, -1, 2915, 296, -1, -1, 2919, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, 312, 2933, -1, 315, -1, -1, -1, -1, 2940, -1, -1, 2943, -1, -1, -1, -1, -1, 2949, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2969, -1, -1, -1, -1, -1, 2975, -1, -1, -1, -1, -1, -1, 2982, 5529, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5803, -1, -1, 2996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3010, -1, -1, -1, -1, 3015, -1, -1, -1, -1, -1, 3021, -1, -1, -1, -1, -1, -1, -1, 409, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, 5866, -1, -1, -1, -1, -1, -1, -1, -1, 445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3613, 3614, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, 5684, -1, -1, -1, -1, 5689, 5690, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 2094, -1, -1, -1, -1, -1, -1, -1, -1, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, -1, -1, -1, -1, 2117, -1, 2119, -1, 2121, -1, -1, 2124, 2125, 2126, -1, -1, -1, -1, -1, 2132, -1, -1, 2135, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2150, 2151, 2152, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2168, -1, -1, -1, -1, 3236, -1, 3238, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 5184, 17, 18, 19, -1, 3255, -1, 5803, -1, 3259, -1, 5195, -1, -1, -1, -1, 3266, -1, -1, 35, -1, -1, 38, 3273, -1, 3275, 3276, -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, -1, -1, -1, -1, -1, -1, 10, -1, 2689, 13, 78, -1, -1, 17, 18, 19, -1, -1, 5866, -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, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3363, -1, 2744, -1, -1, -1, 3369, -1, -1, -1, 3867, -1, -1, 78, -1, -1, 2316, -1, -1, -1, 2762, -1, -1, -1, 2766, -1, -1, -1, 2770, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2795, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, 2370, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2829, -1, -1, 1395, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, 2847, 2848, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, 2427, -1, -1, -1, -1, 197, 1438, -1, -1, -1, 202, -1, -1, -1, -1, -1, 2885, 2886, -1, -1, 2889, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, 296, -1, -1, 4027, 2913, -1, 2915, -1, -1, -1, 2919, -1, -1, -1, -1, -1, 312, -1, 5482, 315, -1, 253, -1, 5487, 2933, -1, -1, -1, -1, -1, -1, 2940, -1, -1, 2943, -1, -1, -1, -1, -1, 2949, -1, 5506, -1, -1, -1, -1, -1, 6388, -1, -1, -1, -1, 3583, 3584, -1, -1, -1, -1, -1, 2969, -1, -1, -1, 296, -1, 2975, -1, -1, -1, -1, -1, -1, 2982, 3604, -1, -1, 3607, -1, -1, 312, -1, -1, 315, -1, -1, -1, 2996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, 3010, -1, -1, -1, -1, 3015, -1, -1, -1, -1, -1, 3021, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, -1, 2622, -1, -1, -1, 3689, 3690, 3691, -1, -1, -1, -1, 2633, -1, 2635, -1, -1, 10, 3081, -1, 13, -1, -1, 409, 17, 18, 19, -1, -1, -1, 3714, 2652, -1, -1, -1, 2656, -1, -1, 2659, -1, 2661, -1, 35, 2664, -1, -1, -1, -1, -1, 3733, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, 10, 516, -1, 13, -1, -1, 3755, 17, 18, 19, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 78, 10, -1, -1, 13, 35, -1, -1, 17, 18, 19, 2717, 2718, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 1749, -1, -1, -1, 1753, 52, -1, 516, -1, -1, 78, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 5770, -1, 78, -1, -1, -1, 6388, -1, -1, 3845, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3236, -1, 3238, -1, 2798, -1, -1, 5798, -1, -1, -1, -1, 178, -1, -1, -1, -1, -1, -1, 3255, -1, -1, -1, 3259, -1, -1, -1, -1, -1, -1, 3266, 197, -1, -1, -1, 3892, 202, -1, -1, -1, -1, 3898, -1, 3900, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 172, -1, 3913, -1, 3915, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, 178, -1, -1, 202, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5909, -1, -1, -1, -1, -1, -1, 3982, -1, 3363, 225, 226, 296, -1, -1, 3369, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, 4043, -1, -1, -1, 4047, -1, -1, -1, 312, 4546, -1, 315, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4560, -1, -1, -1, -1, 4071, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, 3039, 3040, 3041, -1, -1, 10, 3045, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, 3072, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, 409, 52, 2092, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 409, -1, -1, -1, -1, -1, 78, 2118, -1, -1, 4179, 2122, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, 2137, 2138, 2139, -1, 2141, -1, 52, -1, -1, 3583, 3584, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 3604, -1, 78, 3607, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 151, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, 35, 525, 526, 527, 528, 529, 530, 531, 532, 533, 45, -1, -1, 516, -1, -1, -1, 52, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, 3689, 3690, 3691, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, 3714, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, 197, -1, 3285, -1, 253, 202, 4352, 3290, 3733, 35, -1, -1, 38, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, 225, 226, 3755, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, 78, -1, 172, -1, 253, -1, 3341, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, 3352, 4416, 3354, 3355, -1, -1, 4421, -1, 4423, -1, 197, -1, -1, -1, -1, 202, 3368, -1, -1, 3371, -1, 3373, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, 4449, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, 3845, -1, -1, -1, -1, -1, 3409, -1, 3411, -1, 3413, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4495, -1, -1, 4498, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, 3892, -1, -1, -1, 197, -1, 3898, -1, 3900, 202, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3913, -1, 3915, -1, -1, -1, 312, -1, -1, 315, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, 5049, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, 3504, -1, -1, 5064, -1, 3509, 253, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, 3524, -1, 4589, 4590, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4600, 35, -1, 3982, -1, -1, -1, -1, -1, -1, -1, 45, -1, 516, -1, -1, 296, 4617, 52, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 312, -1, -1, 315, -1, 409, -1, 490, -1, -1, -1, -1, 78, 4024, -1, -1, -1, -1, -1, -1, 3589, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5156, -1, 4043, 516, -1, -1, 4047, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 2629, -1, -1, -1, -1, 4071, -1, -1, -1, -1, -1, 4698, -1, -1, 4701, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3649, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 2704, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, 2716, -1, -1, -1, -1, 2721, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, 4179, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, 5382, -1, 5384, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3850, -1, -1, -1, -1, -1, 3856, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4934, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4352, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4992, -1, -1, -1, -1, -1, 3935, -1, -1, -1, -1, -1, 5004, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5524, -1, -1, -1, -1, -1, -1, 4416, 5038, -1, -1, -1, 4421, -1, 4423, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4449, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4495, 5117, -1, 4498, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5136, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4087, -1, -1, -1, -1, -1, -1, -1, -1, 4096, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4110, -1, -1, -1, 4114, 4115, 4116, -1, -1, -1, -1, 4121, -1, -1, 4124, -1, -1, 4127, -1, -1, -1, -1, -1, 4133, -1, 4135, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4589, 4590, 5706, -1, 5708, -1, 28, -1, -1, -1, -1, 4600, -1, 5223, -1, 4162, 4163, 4164, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4617, -1, -1, -1, -1, -1, 4181, -1, -1, -1, -1, -1, -1, -1, 4189, -1, -1, 4192, -1, 4194, -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, 4210, -1, -1, -1, -1, -1, -1, -1, -1, 4219, 4220, 96, -1, -1, -1, -1, 4226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, -1, -1, -1, -1, -1, 120, -1, -1, -1, -1, -1, -1, 4252, -1, -1, -1, 4698, -1, -1, 4701, -1, -1, -1, 138, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 152, -1, -1, -1, -1, -1, 3288, -1, -1, 161, -1, -1, -1, -1, -1, 5355, -1, 5357, -1, -1, -1, -1, 174, 3305, -1, -1, 4303, -1, 180, -1, -1, -1, -1, 3315, -1, 187, -1, -1, -1, 3321, -1, -1, 3324, 4320, -1, -1, -1, -1, -1, 3331, 3332, -1, 3334, -1, -1, 207, -1, 3339, 3340, -1, 3342, -1, 3344, -1, -1, -1, 3348, -1, 5408, 3351, -1, -1, -1, -1, 3356, -1, -1, -1, 5418, -1, -1, -1, -1, 3365, -1, -1, -1, -1, 3370, -1, -1, -1, -1, 245, -1, 3377, 3378, 3379, 3380, -1, -1, -1, -1, 3385, 3386, -1, 3388, -1, -1, -1, -1, -1, -1, -1, -1, 267, -1, -1, 5458, -1, -1, -1, -1, 5463, 3406, -1, 3408, -1, -1, -1, -1, -1, -1, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, -1, -1, -1, 5980, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3458, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4934, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, -1, -1, 384, -1, -1, -1, 388, -1, -1, 391, -1, -1, -1, -1, -1, -1, 398, -1, -1, 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 421, -1, -1, -1, 4992, -1, -1, -1, 429, -1, 6113, -1, -1, 434, -1, 436, 5004, -1, 439, -1, -1, -1, -1, 444, -1, -1, -1, -1, -1, -1, -1, -1, -1, 454, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, -1, -1, -1, 3598, -1, -1, 5038, -1, 473, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, 486, -1, -1, 31, -1, 33, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5702, -1, -1, -1, -1, 61, -1, 4646, 4647, -1, -1, -1, -1, -1, 5716, -1, -1, 73, 4657, 75, 76, -1, -1, -1, -1, -1, 82, -1, 84, -1, -1, -1, -1, -1, -1, -1, 5117, -1, -1, -1, -1, 97, -1, 99, -1, -1, 5748, -1, -1, 6245, -1, -1, -1, -1, -1, 5136, -1, -1, -1, -1, 116, -1, -1, 119, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 134, -1, 136, -1, 6278, 6279, 140, -1, -1, -1, -1, 4728, -1, 147, -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, -1, 159, -1, 4744, -1, -1, -1, -1, 166, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4762, -1, 5827, -1, -1, 184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5223, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5863, 4801, 4802, -1, -1, -1, -1, -1, 4808, 4809, -1, -1, -1, 4813, -1, -1, -1, -1, 4818, -1, -1, 4821, -1, 4823, -1, 23, -1, -1, -1, 4829, -1, -1, -1, -1, -1, -1, -1, -1, 255, 256, -1, -1, -1, 41, 261, -1, -1, -1, 6405, 3854, 3855, -1, -1, -1, 3859, -1, -1, -1, -1, 276, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, 4873, -1, -1, 5939, -1, 295, 5942, -1, 79, -1, 3888, -1, -1, -1, -1, -1, -1, -1, -1, 4892, -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5355, -1, 5357, 114, -1, 335, -1, -1, -1, 120, -1, -1, -1, -1, -1, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4939, 138, -1, -1, 360, -1, -1, -1, -1, 365, 366, -1, 368, -1, -1, 152, -1, 373, -1, -1, 376, -1, -1, 379, 161, -1, 382, 5408, -1, -1, -1, -1, -1, 389, -1, -1, -1, 174, -1, -1, 396, 397, -1, -1, -1, -1, 183, -1, 404, -1, 187, -1, 408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 419, -1, -1, -1, -1, -1, -1, 207, -1, -1, -1, -1, -1, -1, 5458, -1, -1, 436, 5020, -1, -1, -1, 6087, -1, -1, 5027, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6101, -1, 457, -1, -1, -1, -1, -1, -1, -1, 6111, -1, -1, -1, 469, -1, -1, -1, -1, -1, 475, 257, -1, -1, -1, 480, -1, -1, -1, -1, -1, 267, -1, -1, -1, -1, -1, -1, -1, 494, -1, -1, -1, 4086, -1, -1, -1, -1, -1, 4092, -1, -1, -1, -1, -1, -1, -1, 5095, -1, -1, -1, -1, -1, 518, -1, -1, -1, -1, -1, 6170, 6171, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, 537, -1, -1, 540, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4139, 4140, -1, -1, 4143, 4144, 4145, 4146, 340, -1, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, -1, 354, -1, -1, -1, -1, -1, -1, 361, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, 28, 4182, -1, -1, 4185, -1, 4187, 381, -1, 4190, 4191, -1, 6251, -1, -1, -1, -1, 391, -1, -1, -1, -1, -1, -1, 398, -1, -1, 401, -1, -1, -1, 4212, 4213, 4214, 4215, -1, -1, 4218, 66, -1, -1, -1, -1, -1, -1, -1, -1, 421, -1, -1, -1, 79, 80, -1, -1, 429, -1, -1, -1, -1, -1, -1, 436, -1, 92, 439, -1, 441, 96, 443, 444, -1, -1, 5249, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5259, 5702, 459, 114, -1, -1, 5265, 5266, 5267, -1, 467, -1, -1, 470, -1, 5716, 473, -1, -1, -1, -1, 4285, -1, -1, -1, -1, -1, 138, -1, 486, -1, 5290, 5291, -1, -1, -1, 5295, -1, -1, -1, -1, 152, -1, -1, -1, -1, -1, 5748, -1, -1, 161, -1, 5311, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5321, 174, -1, -1, -1, -1, -1, 180, -1, 4335, -1, 5332, -1, -1, -1, -1, -1, -1, -1, 5340, -1, -1, -1, -1, -1, -1, -1, -1, 5349, -1, -1, 6415, -1, -1, 207, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5827, -1, -1, -1, -1, -1, -1, -1, 245, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6476, -1, 267, -1, -1, -1, -1, -1, 5863, -1, -1, -1, -1, 6489, 6490, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6501, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 340, -1, -1, -1, -1, -1, -1, -1, -1, 5939, 350, 351, 5942, -1, 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, -1, -1, 384, -1, -1, -1, 388, -1, -1, 391, -1, -1, -1, -1, -1, -1, 398, -1, -1, 401, -1, -1, -1, -1, -1, -1, -1, 4562, -1, -1, 5560, -1, -1, -1, -1, -1, -1, -1, -1, 421, -1, -1, -1, -1, -1, -1, -1, 429, -1, -1, -1, 5581, -1, -1, 436, -1, -1, 439, -1, -1, -1, -1, 444, -1, -1, -1, -1, -1, -1, -1, 452, 4606, 454, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5626, -1, -1, -1, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6087, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6111, -1, -1, -1, -1, -1, -1, -1, -1, 5678, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4729, -1, -1, -1, 4733, -1, -1, -1, -1, -1, -1, -1, 5736, -1, -1, -1, -1, 4746, -1, -1, -1, -1, -1, -1, -1, 4754, -1, 4756, -1, 4758, 4759, -1, -1, -1, -1, 4764, 4765, 4766, 4767, -1, -1, -1, 4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4807, -1, -1, 4810, -1, 4812, -1, 6251, -1, 4816, -1, -1, 4819, 4820, -1, -1, -1, 4824, 4825, -1, -1, -1, -1, 4830, 5826, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5838, -1, -1, -1, -1, -1, -1, -1, -1, 5847, 5848, 5849, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5875, -1, -1, 4883, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4897, -1, 5894, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6415, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6476, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6045, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6501, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6070, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5098, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6152, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6176, -1, -1, -1, -1, 5186, 5187, -1, -1, -1, -1, -1, -1, 5194, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5238, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5261, 5262, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5280, -1, 5282, -1, -1, -1, 5286, 5287, 5288, 5289, -1, -1, 5292, -1, 5294, -1, -1, -1, -1, 5299, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6308, -1, 5315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6324, -1, -1, -1, 5333, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5348, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5429, -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, 6455, -1, -1, -1, -1, -1, 5466, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5574, -1, 5576, 5577, 5578, 5579, 5580, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5593, 5594, 5595, -1, -1, -1, -1, -1, -1, -1, 5603, -1, -1, -1, -1, 5608, -1, -1, 5611, -1, -1, -1, 5615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5633, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5652, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5828, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5839, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5860, -1, 5862, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5913, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5961, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6041, -1, -1, -1, -1, -1, -1, 6048, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6084, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6099, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6207, 6208, -1, -1, 6211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6275, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6300, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6318, 6319, -1, 6321, -1, -1, -1, -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, 6390, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, 530, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 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, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, 518, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, -1, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 538, 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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, 538, 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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, 512, 513, 514, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 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, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, 518, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 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, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, 518, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, 178, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 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, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 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, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 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, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, 535, 536, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, 530, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 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, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, 178, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, 449, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, 3, -1, 5, 6, -1, 8, 9, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, 3, -1, 5, 6, -1, 8, 9, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, -1, 11, 12, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, -1, 11, 12, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 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, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, 518, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 528, 529, 530, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 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, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, -1, -1, 518, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, 518, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, -1, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, -1, 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, -1, 222, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, -1, 273, 274, -1, 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, -1, 307, 308, 309, -1, 311, 312, 313, 314, 315, -1, 317, 318, 319, 320, -1, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, -1, 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, -1, 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, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, -1, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, -1, 484, 485, 486, 487, 488, 489, 490, -1, 492, -1, -1, -1, -1, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 157, -1, 159, 160, 161, 162, -1, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, -1, 187, -1, 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, -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, -1, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, -1, 292, 293, 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, -1, 342, -1, 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, -1, 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, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, -1, 454, -1, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 157, -1, 159, 160, 161, 162, -1, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, -1, 187, -1, 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, -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, -1, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, -1, 292, 293, 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, -1, 342, -1, 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, -1, 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, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, -1, 454, -1, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, 316, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 530, 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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, 316, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, 178, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 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, 333, 334, -1, 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, 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, 333, 334, -1, 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, 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, 333, 334, -1, 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, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, 187, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 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, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 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, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 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, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 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, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 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, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 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, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 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, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, -1, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, -1, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, -1, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, 172, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, 172, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, -1, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, -1, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, -1, -1, -1, -1, -1, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, -1, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, -1, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, -1, 407, 408, 409, 410, 411, -1, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, -1, -1, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, -1, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_int16 yystos[] = { 0, 20, 31, 33, 34, 51, 61, 73, 75, 76, 82, 84, 97, 99, 116, 119, 134, 136, 140, 147, 157, 159, 166, 184, 201, 255, 256, 261, 276, 295, 335, 345, 360, 365, 366, 368, 373, 379, 382, 389, 396, 397, 404, 408, 419, 436, 457, 469, 475, 480, 494, 518, 520, 521, 522, 523, 524, 537, 544, 545, 546, 547, 552, 553, 559, 560, 562, 563, 564, 565, 567, 570, 582, 587, 588, 591, 592, 593, 613, 616, 617, 632, 687, 690, 691, 694, 697, 698, 699, 707, 714, 716, 717, 720, 723, 724, 728, 737, 741, 742, 743, 746, 748, 749, 750, 751, 759, 761, 781, 785, 787, 788, 798, 800, 806, 807, 810, 811, 812, 813, 814, 823, 825, 827, 830, 834, 835, 845, 846, 851, 856, 867, 899, 902, 903, 904, 909, 912, 914, 916, 918, 919, 923, 924, 927, 929, 930, 934, 935, 936, 939, 940, 941, 942, 943, 950, 952, 953, 954, 955, 961, 963, 964, 970, 971, 972, 975, 976, 977, 978, 980, 981, 983, 984, 986, 987, 989, 1001, 1003, 1006, 1008, 1009, 1022, 1024, 1029, 1034, 1044, 1048, 1049, 1050, 1051, 1052, 1053, 1059, 1095, 451, 497, 956, 28, 79, 96, 114, 120, 138, 152, 161, 174, 180, 187, 207, 245, 267, 312, 340, 350, 351, 354, 381, 384, 388, 391, 398, 401, 421, 429, 434, 436, 439, 444, 454, 459, 473, 486, 713, 956, 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, 152, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 165, 167, 168, 169, 170, 171, 173, 175, 176, 177, 179, 180, 181, 182, 183, 185, 186, 188, 189, 190, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 209, 210, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 249, 250, 251, 252, 253, 255, 256, 257, 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, 294, 295, 296, 297, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 312, 313, 314, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 398, 399, 400, 401, 402, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 433, 434, 437, 438, 439, 440, 441, 442, 443, 444, 446, 447, 448, 451, 452, 453, 454, 455, 457, 458, 459, 460, 461, 462, 463, 464, 465, 468, 469, 470, 471, 472, 475, 476, 477, 478, 479, 480, 481, 483, 484, 485, 486, 487, 488, 489, 492, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1163, 1255, 1267, 1268, 1272, 1273, 1274, 3, 29, 1045, 1252, 1267, 1272, 484, 537, 994, 310, 346, 956, 54, 537, 624, 23, 41, 66, 79, 114, 120, 138, 152, 161, 174, 183, 187, 257, 312, 315, 340, 354, 381, 391, 401, 421, 429, 439, 441, 443, 444, 459, 467, 470, 473, 633, 696, 803, 857, 868, 29, 345, 1252, 1045, 29, 339, 399, 441, 443, 6, 244, 910, 911, 1258, 23, 28, 66, 79, 96, 114, 138, 152, 161, 174, 180, 187, 207, 267, 312, 325, 340, 351, 354, 381, 384, 388, 391, 398, 401, 421, 429, 436, 439, 444, 452, 454, 459, 473, 486, 713, 815, 817, 818, 956, 1252, 99, 484, 537, 691, 694, 697, 989, 1002, 1006, 1009, 1022, 1029, 1034, 1044, 1048, 11, 22, 29, 49, 169, 176, 178, 202, 246, 284, 348, 367, 528, 529, 831, 832, 1045, 1257, 1259, 29, 31, 99, 363, 397, 836, 837, 838, 1267, 174, 1267, 1254, 1258, 436, 1062, 831, 1267, 67, 278, 373, 381, 391, 402, 404, 408, 447, 451, 500, 572, 573, 574, 1267, 451, 1252, 325, 267, 537, 922, 389, 1267, 29, 402, 447, 451, 574, 583, 584, 184, 836, 837, 1267, 346, 956, 1267, 243, 29, 135, 1064, 1065, 93, 257, 402, 404, 451, 571, 573, 29, 402, 447, 451, 574, 451, 311, 1107, 1108, 1250, 1267, 1062, 530, 1267, 179, 537, 995, 537, 361, 1054, 1055, 1252, 1054, 3, 53, 55, 56, 69, 70, 117, 118, 139, 170, 219, 220, 222, 229, 279, 281, 301, 359, 406, 412, 447, 448, 481, 1136, 1138, 1140, 1142, 1144, 1146, 1147, 1148, 1150, 1151, 1152, 1154, 1155, 1159, 1268, 1272, 1064, 1065, 1066, 1263, 12, 1264, 1265, 1267, 1264, 1264, 1049, 1050, 1053, 0, 540, 537, 994, 153, 221, 316, 466, 1067, 1068, 1049, 1051, 1052, 125, 217, 269, 472, 541, 35, 960, 884, 1255, 820, 1267, 820, 1252, 349, 820, 454, 1252, 113, 436, 872, 1255, 1267, 1274, 3, 106, 110, 403, 1260, 1261, 1269, 1272, 1273, 1274, 29, 196, 1250, 302, 486, 10, 17, 18, 19, 74, 165, 525, 526, 527, 528, 529, 530, 531, 532, 533, 906, 908, 1194, 1195, 1267, 196, 1252, 872, 1252, 29, 1260, 1261, 872, 1252, 1252, 196, 1250, 1252, 196, 820, 1252, 373, 404, 29, 196, 1107, 1252, 394, 1252, 820, 29, 264, 1260, 1261, 196, 1250, 244, 122, 227, 293, 358, 957, 958, 959, 537, 535, 539, 1219, 1221, 515, 988, 989, 990, 991, 1269, 1250, 1252, 1267, 28, 66, 80, 92, 114, 138, 180, 207, 245, 312, 351, 381, 384, 429, 439, 452, 459, 815, 816, 817, 818, 1258, 960, 1005, 1009, 1022, 1029, 1034, 1048, 1250, 271, 820, 537, 196, 820, 1252, 820, 454, 196, 1252, 113, 436, 441, 443, 1260, 1261, 441, 443, 74, 165, 906, 371, 1252, 1252, 1260, 196, 548, 1267, 196, 1252, 196, 549, 820, 1252, 1252, 394, 820, 264, 1260, 361, 398, 436, 486, 267, 96, 207, 28, 92, 180, 351, 388, 452, 454, 458, 708, 29, 1252, 1046, 581, 1258, 1269, 911, 271, 196, 884, 885, 196, 915, 196, 1252, 196, 822, 1136, 454, 113, 436, 196, 871, 872, 196, 1261, 1262, 87, 486, 74, 165, 196, 907, 908, 59, 196, 871, 196, 1262, 196, 871, 196, 1252, 196, 1252, 394, 915, 196, 822, 196, 264, 1262, 244, 196, 819, 820, 196, 1251, 1252, 196, 1252, 960, 537, 1007, 633, 1002, 480, 988, 994, 1259, 832, 833, 29, 833, 1259, 833, 29, 833, 1259, 833, 833, 833, 1259, 1257, 1257, 1045, 833, 349, 537, 434, 537, 662, 662, 662, 310, 449, 541, 662, 391, 1107, 1109, 541, 951, 1258, 120, 580, 1258, 584, 581, 1258, 48, 60, 572, 574, 29, 574, 514, 413, 313, 178, 449, 527, 539, 1258, 537, 1004, 59, 486, 988, 114, 207, 391, 434, 436, 920, 921, 1267, 48, 514, 227, 313, 310, 178, 313, 1258, 449, 960, 172, 828, 310, 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, 158, 163, 164, 170, 186, 188, 219, 220, 222, 229, 230, 231, 232, 233, 234, 235, 236, 237, 239, 250, 258, 259, 270, 279, 281, 291, 293, 298, 299, 301, 312, 323, 341, 359, 386, 403, 412, 430, 435, 447, 448, 453, 455, 456, 467, 473, 481, 502, 503, 504, 505, 507, 508, 509, 510, 516, 528, 529, 530, 537, 1049, 1139, 1142, 1145, 1146, 1147, 1149, 1150, 1151, 1154, 1155, 1159, 1160, 1162, 1163, 1164, 1166, 1190, 1191, 1192, 1196, 1213, 1218, 1244, 1247, 1248, 1255, 1256, 1257, 1258, 1267, 1246, 1247, 29, 589, 1249, 1250, 402, 571, 71, 571, 60, 958, 48, 514, 227, 959, 537, 1250, 530, 1221, 1109, 988, 177, 996, 1160, 1199, 1054, 541, 537, 997, 483, 1153, 1153, 1153, 537, 1141, 1141, 343, 537, 1143, 69, 70, 1153, 1141, 1138, 518, 519, 537, 1156, 537, 1156, 37, 1137, 537, 115, 194, 272, 275, 395, 512, 537, 1157, 1158, 539, 821, 1141, 1246, 1222, 538, 538, 546, 988, 998, 999, 1000, 1107, 29, 135, 1063, 1063, 59, 1063, 166, 172, 254, 306, 1071, 1073, 1074, 1089, 1091, 1092, 1093, 1067, 1068, 178, 223, 223, 1107, 1110, 537, 68, 289, 326, 369, 404, 537, 882, 326, 365, 369, 404, 821, 326, 369, 404, 3, 91, 145, 260, 326, 335, 365, 369, 404, 439, 442, 494, 582, 585, 965, 966, 967, 968, 852, 25, 140, 326, 369, 404, 477, 598, 1252, 25, 140, 404, 472, 566, 498, 196, 1107, 62, 98, 162, 199, 249, 289, 293, 326, 327, 369, 378, 387, 396, 404, 417, 426, 431, 489, 582, 586, 888, 900, 928, 537, 869, 1221, 369, 566, 202, 158, 25, 31, 46, 76, 133, 140, 144, 173, 209, 289, 293, 304, 314, 326, 369, 372, 373, 404, 477, 594, 596, 597, 731, 928, 5, 528, 529, 705, 1259, 29, 196, 1250, 820, 820, 537, 905, 326, 404, 539, 158, 310, 326, 369, 404, 900, 928, 25, 140, 326, 369, 404, 202, 561, 369, 494, 518, 554, 561, 326, 369, 404, 900, 928, 310, 326, 369, 158, 38, 60, 112, 205, 263, 268, 273, 289, 325, 369, 374, 398, 404, 419, 470, 594, 702, 703, 326, 369, 485, 731, 739, 158, 326, 369, 404, 25, 91, 133, 140, 144, 326, 365, 369, 404, 411, 584, 572, 202, 158, 46, 131, 289, 369, 404, 594, 595, 326, 369, 373, 404, 89, 132, 329, 442, 310, 25, 31, 140, 326, 369, 404, 614, 615, 561, 172, 369, 554, 561, 158, 369, 404, 594, 1252, 252, 122, 311, 499, 541, 957, 29, 135, 482, 530, 538, 877, 1160, 1200, 1201, 1268, 1160, 1220, 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, 153, 164, 166, 172, 174, 178, 184, 187, 191, 202, 211, 221, 223, 247, 248, 254, 258, 259, 293, 298, 306, 310, 311, 315, 316, 337, 347, 363, 377, 397, 403, 414, 432, 435, 436, 445, 449, 450, 456, 466, 467, 473, 474, 482, 490, 491, 493, 494, 530, 1253, 1270, 1272, 1273, 1274, 1275, 1219, 538, 541, 164, 310, 456, 578, 581, 705, 992, 474, 985, 310, 884, 537, 820, 1252, 1136, 872, 302, 74, 165, 908, 872, 872, 172, 1136, 820, 1252, 1252, 538, 662, 1252, 72, 1136, 293, 178, 537, 789, 554, 38, 979, 1252, 293, 554, 498, 196, 1250, 554, 820, 820, 789, 470, 633, 310, 172, 494, 896, 554, 293, 48, 568, 293, 459, 738, 293, 997, 91, 326, 715, 89, 132, 329, 442, 38, 789, 172, 196, 554, 486, 196, 1250, 196, 692, 1250, 1250, 486, 820, 87, 550, 1255, 454, 1255, 1255, 1252, 172, 1252, 713, 40, 54, 111, 216, 289, 393, 158, 63, 375, 541, 551, 158, 537, 158, 554, 158, 541, 551, 498, 158, 541, 551, 158, 541, 196, 819, 196, 820, 196, 820, 158, 541, 551, 1262, 158, 551, 158, 158, 551, 158, 551, 158, 89, 132, 329, 442, 172, 158, 551, 158, 172, 196, 158, 541, 551, 158, 541, 551, 158, 310, 1199, 436, 538, 1002, 833, 1045, 833, 1045, 833, 1045, 833, 1045, 833, 1045, 1045, 1045, 833, 1045, 537, 663, 666, 1267, 663, 29, 114, 138, 174, 180, 244, 245, 328, 351, 384, 391, 398, 436, 439, 459, 841, 1249, 1262, 838, 1252, 202, 541, 1025, 1258, 120, 581, 125, 3, 120, 257, 579, 705, 1155, 1258, 1258, 94, 137, 1172, 103, 120, 575, 576, 578, 705, 120, 575, 1267, 1136, 1203, 38, 1262, 550, 538, 550, 550, 550, 252, 172, 841, 1262, 172, 389, 1267, 581, 310, 537, 1222, 535, 1049, 1204, 1160, 1217, 537, 537, 172, 537, 537, 1049, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 1160, 537, 537, 537, 537, 537, 537, 537, 537, 300, 649, 537, 537, 537, 537, 537, 537, 537, 537, 1160, 1160, 1160, 1049, 1160, 1199, 1221, 1258, 537, 1258, 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, 152, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 168, 169, 170, 171, 173, 174, 175, 176, 177, 179, 180, 181, 182, 183, 185, 186, 188, 189, 190, 192, 193, 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, 222, 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, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 273, 274, 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, 307, 308, 309, 311, 312, 313, 314, 315, 317, 318, 319, 320, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 336, 337, 338, 339, 340, 341, 342, 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, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 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, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 484, 485, 486, 487, 488, 489, 490, 492, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 513, 514, 516, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1194, 1196, 1198, 1271, 1276, 495, 1177, 322, 1160, 167, 1178, 223, 541, 1060, 537, 1258, 1221, 1060, 123, 198, 590, 541, 71, 38, 252, 1250, 95, 374, 824, 538, 994, 35, 45, 52, 78, 197, 202, 225, 253, 312, 315, 409, 538, 541, 1055, 1251, 38, 537, 1199, 1257, 1153, 1153, 37, 1137, 447, 447, 1257, 1257, 535, 535, 1257, 449, 449, 449, 537, 449, 1257, 1253, 539, 1141, 178, 1096, 15, 527, 1219, 1266, 538, 541, 997, 1051, 1051, 1069, 1070, 1160, 1051, 169, 284, 1080, 241, 289, 358, 407, 472, 29, 1075, 1160, 528, 529, 1076, 1077, 1160, 1162, 1089, 1090, 1074, 1073, 1071, 1072, 172, 1092, 304, 1094, 1071, 1089, 1110, 1010, 1250, 1110, 38, 1267, 404, 1199, 68, 449, 449, 391, 202, 214, 316, 319, 406, 482, 530, 875, 876, 877, 879, 881, 883, 1136, 1268, 449, 485, 449, 391, 449, 449, 391, 254, 449, 373, 79, 449, 439, 571, 326, 965, 967, 527, 969, 172, 184, 202, 379, 853, 854, 72, 92, 293, 658, 659, 92, 120, 293, 449, 92, 449, 120, 293, 391, 92, 133, 144, 326, 369, 786, 391, 721, 28, 66, 138, 180, 312, 351, 384, 452, 459, 815, 816, 1252, 158, 369, 404, 594, 310, 705, 396, 249, 449, 1267, 449, 298, 705, 124, 224, 391, 573, 820, 375, 404, 888, 901, 128, 538, 870, 875, 449, 473, 439, 1250, 72, 80, 92, 154, 174, 196, 293, 347, 467, 640, 656, 657, 1267, 80, 92, 925, 331, 310, 386, 388, 454, 92, 925, 32, 372, 386, 388, 454, 386, 1250, 173, 209, 304, 820, 537, 449, 449, 195, 537, 602, 23, 263, 439, 470, 496, 602, 92, 541, 128, 5, 5, 326, 202, 158, 369, 404, 594, 928, 474, 474, 290, 1136, 449, 391, 537, 906, 1252, 1250, 449, 449, 391, 901, 128, 107, 436, 437, 937, 938, 1108, 1250, 1267, 938, 449, 449, 789, 938, 114, 404, 585, 449, 556, 585, 449, 449, 391, 901, 128, 1250, 449, 449, 1250, 1138, 705, 59, 704, 705, 705, 112, 268, 273, 59, 449, 554, 277, 391, 554, 289, 703, 449, 449, 298, 1258, 731, 820, 449, 449, 391, 421, 354, 1258, 354, 449, 354, 449, 354, 789, 789, 439, 1107, 331, 331, 92, 449, 925, 391, 449, 449, 602, 602, 820, 820, 820, 820, 1250, 47, 479, 47, 47, 479, 449, 47, 449, 479, 391, 537, 541, 585, 473, 747, 1261, 449, 556, 585, 1250, 449, 925, 391, 326, 369, 358, 370, 400, 577, 957, 1200, 1200, 1201, 538, 15, 16, 541, 1067, 1068, 536, 542, 1250, 990, 1252, 1250, 225, 1136, 225, 310, 225, 225, 705, 820, 820, 225, 225, 225, 1136, 225, 225, 225, 310, 449, 178, 449, 618, 459, 537, 38, 158, 820, 790, 791, 1270, 965, 1136, 310, 158, 718, 1252, 293, 331, 537, 555, 803, 474, 361, 486, 1250, 29, 938, 789, 555, 158, 1261, 99, 184, 569, 632, 698, 761, 834, 856, 961, 158, 1258, 739, 740, 158, 310, 1258, 1261, 260, 820, 820, 820, 820, 149, 357, 537, 747, 293, 555, 1250, 293, 700, 702, 293, 38, 304, 331, 537, 662, 662, 196, 695, 1250, 172, 196, 548, 1267, 537, 793, 882, 1252, 537, 873, 873, 38, 1136, 27, 50, 218, 762, 244, 494, 496, 1047, 393, 885, 884, 1136, 1252, 537, 822, 1136, 871, 872, 1262, 1261, 158, 551, 158, 474, 158, 474, 907, 908, 551, 871, 1262, 871, 1252, 1252, 1136, 822, 1262, 747, 158, 819, 820, 1251, 1252, 1252, 820, 538, 196, 1250, 1002, 1045, 1045, 1045, 1045, 1045, 1045, 663, 538, 541, 538, 181, 352, 385, 399, 437, 1251, 819, 113, 401, 871, 1251, 302, 839, 840, 1267, 871, 871, 1251, 1249, 1249, 1251, 819, 449, 185, 494, 850, 153, 254, 744, 745, 23, 156, 386, 407, 1026, 1107, 297, 1027, 1258, 537, 1258, 541, 538, 541, 1005, 449, 1250, 1252, 1250, 548, 836, 837, 178, 850, 837, 1267, 28, 80, 138, 180, 245, 351, 384, 459, 815, 816, 1199, 536, 1199, 1204, 1205, 490, 1214, 1215, 1160, 1199, 537, 1257, 1257, 3, 115, 194, 272, 275, 395, 512, 1206, 1207, 1258, 1199, 1199, 1160, 1232, 377, 1049, 1050, 1232, 1236, 1243, 1232, 1232, 1160, 1162, 1200, 1236, 1239, 1240, 1160, 1240, 1232, 1160, 1232, 1232, 1199, 1257, 1257, 538, 1160, 1160, 906, 1160, 1200, 1202, 1209, 386, 528, 529, 537, 1161, 1162, 1196, 1210, 538, 1199, 1160, 1202, 1211, 1160, 57, 178, 248, 450, 1160, 1199, 1212, 135, 293, 1049, 1199, 277, 1162, 1160, 1170, 1171, 1172, 277, 1160, 1172, 538, 541, 1257, 1157, 1136, 1160, 1160, 1160, 1160, 1270, 257, 447, 43, 432, 1223, 820, 1160, 537, 1049, 135, 137, 164, 229, 285, 286, 287, 288, 292, 293, 298, 456, 468, 1208, 1237, 1160, 537, 1160, 449, 52, 197, 202, 253, 409, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 29, 36, 414, 1193, 187, 1178, 386, 537, 1190, 537, 321, 1182, 183, 257, 436, 441, 443, 470, 1061, 1250, 1248, 1096, 1200, 1096, 1250, 451, 538, 195, 195, 551, 1000, 989, 993, 1160, 538, 267, 293, 1056, 1199, 538, 538, 535, 514, 514, 538, 538, 1257, 536, 1257, 538, 194, 272, 1158, 272, 1158, 1158, 1257, 275, 538, 1253, 229, 238, 247, 387, 511, 537, 1049, 1097, 1098, 1099, 1107, 1113, 1123, 1130, 1163, 1165, 1166, 1244, 1267, 491, 1118, 1263, 1000, 998, 541, 39, 130, 474, 865, 386, 387, 528, 529, 1077, 1079, 1162, 407, 241, 311, 541, 5, 1078, 1257, 1078, 386, 387, 1079, 1249, 297, 411, 1028, 1090, 1072, 474, 1023, 120, 324, 537, 1011, 1048, 38, 474, 1267, 537, 1030, 1031, 1032, 1267, 538, 1261, 1252, 1252, 319, 59, 1268, 538, 877, 879, 876, 879, 1268, 316, 538, 541, 821, 1261, 1252, 1252, 1261, 1252, 1252, 1261, 485, 1252, 1252, 120, 578, 705, 381, 473, 836, 391, 184, 836, 537, 1252, 298, 196, 1252, 298, 1261, 1252, 1252, 1160, 298, 1252, 1252, 32, 372, 449, 449, 1252, 449, 722, 884, 537, 1136, 872, 74, 165, 908, 872, 872, 172, 1136, 820, 1252, 190, 289, 326, 369, 478, 725, 726, 727, 1107, 449, 925, 391, 298, 124, 224, 1261, 1252, 310, 1252, 310, 538, 541, 1260, 1262, 1252, 369, 594, 537, 196, 640, 1252, 474, 858, 241, 293, 298, 241, 474, 649, 686, 1136, 1252, 1257, 1267, 1250, 1252, 252, 1252, 29, 473, 1252, 196, 1252, 196, 1267, 388, 454, 388, 454, 252, 1252, 29, 473, 1252, 252, 386, 1250, 25, 140, 404, 732, 733, 734, 735, 1270, 1261, 1252, 120, 179, 294, 474, 601, 604, 605, 1270, 271, 1252, 76, 307, 1252, 597, 310, 449, 439, 1250, 449, 925, 391, 128, 1252, 1252, 541, 538, 541, 1261, 1252, 931, 932, 1270, 310, 369, 449, 755, 1261, 1252, 1252, 310, 1107, 202, 541, 662, 662, 1221, 1261, 1252, 1252, 1260, 3, 91, 146, 209, 333, 465, 473, 476, 557, 1261, 1252, 1252, 310, 369, 1261, 1252, 369, 404, 594, 702, 705, 820, 1252, 705, 820, 1252, 705, 1261, 1252, 404, 1261, 1252, 1252, 120, 608, 1259, 1251, 1251, 1261, 896, 1252, 1251, 1252, 369, 404, 594, 595, 1250, 1250, 1252, 1252, 1252, 1252, 1261, 1252, 25, 31, 140, 326, 369, 404, 326, 369, 404, 789, 369, 404, 369, 404, 369, 928, 1122, 1267, 196, 799, 1267, 196, 1267, 1258, 1261, 1252, 1252, 1258, 1252, 931, 25, 140, 615, 401, 1260, 369, 404, 594, 1252, 1252, 1252, 449, 449, 85, 464, 358, 541, 1067, 1067, 1067, 1160, 1160, 482, 1201, 538, 1160, 1220, 985, 298, 826, 1258, 38, 826, 138, 820, 826, 826, 225, 474, 474, 826, 826, 826, 244, 826, 826, 826, 820, 353, 619, 619, 207, 436, 760, 1160, 1136, 820, 538, 541, 527, 646, 1270, 1252, 63, 178, 391, 485, 719, 726, 727, 158, 304, 253, 634, 636, 638, 640, 653, 656, 26, 202, 381, 433, 557, 558, 172, 1252, 486, 1250, 38, 756, 437, 896, 548, 1267, 568, 633, 868, 1252, 174, 820, 537, 688, 689, 1165, 1267, 354, 1258, 789, 789, 789, 789, 537, 789, 1120, 1121, 1122, 401, 158, 537, 158, 158, 157, 1048, 820, 304, 634, 1267, 474, 681, 494, 603, 293, 38, 662, 1258, 293, 310, 3, 794, 795, 789, 27, 538, 874, 875, 880, 38, 244, 378, 452, 493, 886, 887, 888, 889, 886, 310, 244, 304, 125, 217, 457, 472, 763, 764, 1252, 193, 193, 172, 551, 38, 554, 173, 973, 974, 551, 551, 819, 820, 1252, 820, 1252, 551, 551, 551, 551, 244, 551, 401, 172, 551, 551, 310, 551, 293, 538, 666, 202, 202, 202, 202, 202, 498, 1251, 705, 706, 541, 539, 187, 842, 843, 1261, 59, 847, 848, 1270, 449, 537, 178, 156, 407, 156, 407, 386, 472, 274, 1257, 1157, 576, 1136, 1261, 494, 693, 310, 842, 551, 178, 884, 820, 1136, 872, 302, 872, 872, 1136, 820, 1252, 538, 536, 536, 541, 1160, 142, 1215, 1216, 38, 538, 1160, 538, 538, 538, 178, 538, 538, 515, 1233, 1234, 494, 496, 1238, 1136, 1234, 538, 21, 298, 541, 1242, 316, 1245, 541, 542, 479, 538, 538, 21, 298, 541, 1241, 1241, 541, 538, 1236, 541, 538, 538, 538, 538, 541, 541, 538, 337, 538, 538, 537, 1161, 1161, 1199, 13, 17, 18, 19, 202, 225, 312, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1196, 1161, 538, 538, 172, 178, 409, 538, 538, 38, 1212, 1199, 1212, 1212, 178, 538, 135, 538, 1270, 332, 1175, 38, 538, 541, 1160, 1270, 541, 1160, 1222, 1160, 538, 514, 1161, 1161, 151, 1199, 178, 37, 302, 390, 479, 135, 137, 164, 292, 298, 456, 468, 1208, 1237, 292, 1238, 151, 906, 1160, 432, 1223, 1160, 537, 1049, 1160, 449, 537, 1049, 537, 1182, 537, 1199, 491, 537, 1183, 1267, 441, 443, 441, 443, 1250, 1062, 1062, 1062, 1118, 1067, 1118, 958, 1000, 267, 537, 538, 1257, 1156, 1156, 536, 536, 538, 537, 1049, 1113, 1123, 1130, 178, 537, 1049, 1098, 1099, 38, 1100, 1101, 1267, 541, 100, 179, 213, 228, 251, 280, 380, 1104, 1101, 38, 1100, 1103, 1267, 1101, 1101, 518, 1117, 1221, 1160, 187, 1081, 1070, 312, 1194, 1197, 517, 866, 5, 1257, 1079, 311, 494, 472, 1076, 262, 1097, 491, 1119, 480, 434, 473, 1012, 1013, 1014, 1267, 310, 1015, 1267, 1098, 1032, 1033, 541, 1096, 527, 1222, 883, 821, 879, 879, 59, 881, 532, 1262, 1262, 310, 1251, 313, 310, 1160, 659, 779, 158, 551, 449, 1261, 1252, 581, 1136, 820, 820, 1136, 709, 1252, 190, 478, 449, 449, 709, 725, 731, 369, 404, 594, 1252, 1252, 1252, 215, 298, 161, 875, 325, 404, 449, 1160, 293, 154, 657, 1252, 537, 537, 158, 1267, 537, 686, 207, 537, 779, 424, 644, 645, 209, 779, 404, 25, 140, 373, 374, 404, 598, 606, 607, 731, 926, 396, 158, 551, 158, 551, 1252, 1252, 1252, 1252, 396, 396, 252, 734, 735, 734, 538, 541, 736, 1258, 207, 538, 541, 527, 539, 120, 609, 1267, 161, 1261, 1252, 369, 404, 594, 1252, 1252, 1252, 310, 326, 369, 404, 25, 140, 326, 369, 404, 1136, 290, 1136, 538, 541, 527, 1250, 449, 1262, 474, 752, 161, 662, 391, 937, 491, 671, 671, 662, 254, 333, 298, 1258, 333, 1262, 471, 161, 449, 449, 391, 421, 896, 896, 896, 325, 404, 92, 449, 925, 391, 120, 172, 610, 168, 550, 449, 449, 264, 264, 264, 449, 449, 391, 449, 449, 391, 449, 391, 449, 391, 449, 128, 551, 1136, 293, 1258, 404, 926, 158, 551, 449, 449, 538, 1252, 449, 925, 391, 449, 1261, 1252, 538, 538, 538, 1201, 536, 1136, 820, 225, 826, 1252, 1252, 1252, 225, 422, 423, 620, 1258, 620, 190, 538, 538, 178, 789, 791, 290, 312, 528, 529, 705, 792, 879, 1197, 1258, 1275, 72, 78, 92, 120, 122, 148, 182, 211, 293, 298, 347, 363, 467, 647, 648, 652, 157, 490, 554, 581, 1252, 581, 314, 729, 1250, 1250, 1250, 538, 541, 1262, 187, 381, 1262, 1257, 459, 1250, 662, 3, 172, 757, 896, 48, 568, 436, 738, 113, 997, 1160, 178, 541, 1251, 603, 796, 797, 1258, 538, 541, 1252, 172, 663, 1250, 692, 1250, 1252, 693, 537, 635, 1250, 538, 1252, 494, 496, 682, 602, 38, 158, 1048, 681, 449, 158, 1107, 527, 538, 541, 763, 538, 541, 120, 527, 890, 1258, 581, 436, 878, 879, 172, 895, 51, 376, 891, 892, 889, 892, 125, 217, 397, 472, 948, 1252, 304, 310, 315, 190, 1048, 1136, 537, 538, 541, 551, 474, 551, 474, 551, 1252, 1252, 747, 820, 158, 391, 391, 391, 391, 391, 1251, 541, 840, 1267, 1261, 494, 541, 844, 1261, 541, 850, 164, 313, 456, 849, 1109, 401, 156, 156, 538, 113, 289, 841, 850, 1262, 225, 225, 225, 225, 705, 225, 225, 225, 225, 225, 1204, 445, 1160, 147, 1136, 538, 1160, 229, 467, 467, 538, 1234, 1236, 310, 310, 1232, 1236, 59, 1242, 1160, 1232, 1232, 310, 310, 1240, 1238, 1238, 1160, 538, 1160, 1208, 1160, 1160, 538, 1199, 541, 1136, 1161, 1161, 1161, 1161, 135, 137, 293, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1160, 1160, 1160, 1136, 538, 538, 538, 1199, 538, 541, 59, 1162, 1176, 538, 1270, 1171, 344, 428, 1174, 538, 541, 485, 1167, 38, 538, 1258, 1160, 35, 35, 1160, 538, 1160, 178, 292, 1238, 1160, 538, 151, 1161, 1161, 151, 1199, 151, 1160, 1160, 1068, 538, 1199, 541, 1160, 1184, 1267, 1062, 1062, 1062, 1062, 1250, 1250, 1250, 1081, 538, 1081, 1005, 536, 1232, 1101, 1103, 1101, 1101, 537, 506, 1162, 538, 1267, 537, 1098, 228, 320, 1105, 1098, 1105, 228, 1104, 1105, 228, 438, 1111, 537, 1267, 537, 317, 59, 191, 1088, 537, 866, 169, 246, 311, 494, 446, 103, 1160, 377, 1017, 479, 538, 541, 1222, 90, 1017, 310, 538, 541, 1031, 1119, 1160, 538, 532, 883, 459, 181, 245, 385, 392, 399, 437, 460, 855, 172, 855, 538, 122, 148, 211, 289, 293, 780, 1252, 1252, 38, 474, 474, 244, 821, 1261, 1252, 449, 925, 391, 449, 215, 1252, 59, 439, 1252, 538, 158, 537, 669, 670, 861, 1165, 1267, 663, 640, 779, 663, 779, 1252, 663, 120, 1267, 86, 642, 643, 421, 182, 160, 195, 293, 602, 554, 113, 160, 182, 293, 421, 602, 642, 644, 703, 404, 607, 459, 1252, 1267, 396, 733, 1252, 605, 792, 1270, 1252, 325, 404, 449, 925, 391, 449, 161, 449, 449, 391, 180, 312, 424, 801, 802, 180, 312, 808, 809, 449, 449, 391, 538, 538, 538, 932, 290, 705, 879, 933, 1197, 1258, 1275, 369, 1252, 537, 494, 753, 1252, 671, 107, 1267, 537, 671, 1259, 1258, 1258, 1258, 1252, 1252, 1252, 1252, 608, 59, 439, 1252, 1252, 1252, 1252, 480, 1252, 1252, 172, 172, 371, 172, 196, 1261, 1252, 1252, 1261, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 310, 78, 599, 158, 27, 50, 459, 1267, 1252, 1258, 731, 1252, 1252, 1252, 1252, 1067, 538, 225, 826, 225, 225, 225, 826, 554, 474, 625, 626, 709, 779, 494, 496, 820, 537, 820, 1252, 1161, 32, 59, 650, 123, 198, 122, 148, 298, 241, 1250, 649, 180, 351, 775, 782, 783, 1267, 718, 537, 331, 537, 635, 654, 210, 676, 638, 1262, 1262, 1136, 537, 603, 29, 125, 217, 397, 472, 758, 449, 754, 1261, 196, 1250, 740, 498, 310, 538, 1097, 689, 896, 538, 541, 1122, 729, 747, 538, 700, 38, 304, 331, 537, 1007, 637, 639, 641, 656, 1267, 331, 677, 678, 635, 676, 602, 307, 310, 683, 1048, 695, 693, 603, 1258, 1252, 858, 792, 3, 795, 310, 880, 1160, 1160, 541, 537, 886, 459, 541, 44, 1160, 449, 537, 663, 1250, 764, 709, 538, 973, 974, 1252, 1252, 551, 401, 551, 1251, 1251, 1251, 1251, 1251, 705, 184, 843, 850, 848, 538, 1252, 1258, 113, 178, 551, 850, 298, 829, 1258, 829, 829, 829, 225, 829, 829, 829, 829, 829, 1160, 538, 145, 242, 242, 538, 298, 298, 538, 1069, 1236, 332, 1224, 298, 298, 1236, 1236, 1224, 1224, 538, 538, 178, 538, 1160, 178, 135, 137, 178, 172, 151, 538, 501, 1169, 1199, 362, 479, 59, 1176, 1162, 492, 492, 538, 1160, 289, 1160, 541, 1168, 1138, 1160, 1160, 1160, 1160, 35, 35, 1160, 538, 1160, 151, 538, 538, 538, 1160, 538, 331, 1185, 1250, 1250, 1250, 1250, 1088, 1258, 1088, 538, 541, 1114, 1115, 1165, 537, 1175, 1100, 537, 1251, 1098, 310, 474, 1106, 1098, 228, 1098, 1255, 1121, 537, 1121, 1267, 1063, 1160, 493, 1179, 906, 446, 304, 494, 1018, 1048, 324, 1048, 1014, 310, 537, 1016, 1160, 527, 1032, 1017, 459, 538, 303, 449, 836, 178, 779, 123, 198, 209, 122, 148, 476, 551, 1136, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1262, 1252, 779, 640, 1160, 538, 541, 494, 78, 860, 864, 860, 541, 664, 496, 661, 661, 120, 1267, 729, 608, 650, 196, 196, 298, 705, 38, 650, 298, 608, 1136, 551, 551, 527, 59, 439, 1252, 1252, 1252, 1252, 1252, 1261, 1252, 1252, 1257, 1257, 1136, 541, 1257, 1257, 541, 1261, 1252, 1252, 449, 1160, 72, 1160, 1262, 1252, 449, 449, 178, 202, 494, 1251, 1251, 820, 1251, 158, 161, 820, 1258, 1258, 1136, 551, 551, 449, 538, 225, 826, 826, 826, 826, 537, 621, 622, 554, 127, 180, 214, 180, 1160, 293, 648, 120, 38, 289, 660, 896, 662, 896, 1255, 35, 157, 202, 730, 734, 304, 634, 610, 155, 204, 537, 401, 474, 663, 38, 1262, 752, 568, 293, 537, 174, 1252, 688, 1258, 401, 603, 157, 1048, 820, 304, 634, 693, 538, 541, 494, 646, 59, 681, 610, 677, 84, 439, 684, 494, 962, 38, 684, 178, 310, 537, 1250, 1258, 877, 897, 898, 1268, 892, 1136, 172, 893, 1250, 178, 449, 917, 364, 765, 212, 710, 551, 538, 551, 551, 1252, 313, 223, 842, 551, 829, 1252, 538, 1225, 1226, 1232, 120, 143, 150, 164, 298, 456, 468, 1228, 1229, 1231, 538, 538, 1236, 1236, 1160, 538, 1161, 178, 1160, 1160, 1160, 537, 538, 541, 538, 1176, 538, 479, 418, 538, 206, 289, 1173, 1160, 1160, 1160, 538, 59, 1067, 1179, 1179, 394, 1057, 1160, 538, 541, 38, 1116, 120, 1128, 1129, 1161, 81, 1251, 538, 1160, 537, 1098, 1106, 537, 538, 1121, 538, 102, 188, 383, 537, 1082, 1083, 1084, 1085, 1086, 1087, 1160, 1180, 1181, 1267, 1067, 538, 1045, 537, 1247, 1012, 92, 859, 861, 136, 490, 1035, 1036, 1037, 1038, 1160, 842, 310, 842, 538, 449, 404, 1027, 538, 203, 667, 670, 312, 906, 820, 549, 820, 336, 538, 322, 538, 538, 646, 38, 158, 158, 537, 599, 792, 1262, 1252, 449, 537, 872, 906, 908, 802, 537, 537, 809, 1252, 538, 537, 538, 404, 1027, 1252, 1252, 537, 537, 537, 494, 518, 982, 371, 982, 982, 172, 1252, 599, 1252, 826, 627, 628, 1270, 54, 101, 126, 145, 151, 173, 177, 192, 298, 355, 623, 621, 1258, 872, 38, 913, 913, 538, 195, 537, 209, 474, 685, 265, 668, 685, 537, 783, 775, 537, 538, 541, 1250, 538, 401, 29, 83, 86, 93, 121, 182, 195, 208, 421, 424, 655, 655, 1249, 1252, 1252, 538, 1048, 753, 158, 113, 729, 178, 1252, 38, 1252, 693, 635, 1250, 538, 639, 314, 1267, 682, 677, 681, 125, 140, 344, 1252, 64, 72, 257, 1048, 820, 1107, 859, 178, 778, 879, 538, 541, 459, 147, 547, 891, 894, 1118, 416, 416, 538, 283, 308, 766, 767, 768, 172, 771, 709, 289, 478, 711, 712, 1252, 850, 541, 38, 1160, 37, 302, 310, 538, 494, 496, 1227, 1228, 1230, 172, 1161, 1170, 1199, 289, 513, 206, 538, 1199, 189, 357, 387, 1186, 58, 129, 112, 1058, 38, 1131, 1117, 1114, 537, 1161, 538, 541, 38, 1124, 1125, 1267, 538, 1251, 1199, 538, 537, 405, 537, 538, 541, 541, 38, 1072, 283, 308, 1019, 1020, 1021, 479, 1252, 538, 541, 294, 472, 266, 293, 1017, 1036, 35, 1039, 1039, 844, 855, 551, 1252, 439, 860, 537, 896, 537, 865, 602, 666, 363, 667, 667, 195, 1160, 474, 600, 404, 1027, 1252, 1203, 172, 805, 805, 1203, 1203, 1160, 439, 1199, 1199, 611, 612, 1269, 819, 820, 819, 820, 1251, 551, 538, 541, 120, 530, 537, 578, 629, 705, 979, 1258, 979, 293, 298, 355, 979, 979, 1118, 913, 42, 200, 660, 537, 701, 1160, 207, 179, 330, 410, 310, 672, 673, 674, 538, 1255, 6, 784, 734, 635, 676, 1252, 538, 729, 165, 804, 603, 962, 1250, 498, 1097, 729, 1048, 1007, 677, 635, 676, 646, 537, 683, 681, 682, 387, 387, 72, 313, 72, 693, 858, 538, 1250, 779, 886, 897, 1136, 540, 136, 494, 494, 767, 386, 436, 769, 141, 772, 490, 774, 478, 709, 729, 551, 1226, 1270, 150, 37, 88, 463, 498, 37, 498, 240, 309, 1235, 310, 538, 1160, 538, 538, 479, 52, 103, 462, 1160, 1187, 1188, 1187, 1187, 538, 169, 169, 663, 1252, 1224, 1121, 541, 1129, 1270, 538, 541, 172, 1136, 538, 538, 1199, 537, 1199, 1083, 1181, 1183, 1090, 538, 541, 38, 1048, 1118, 861, 404, 266, 1160, 445, 445, 178, 1252, 663, 685, 906, 866, 865, 1250, 896, 896, 701, 538, 1160, 439, 538, 316, 394, 538, 538, 538, 1252, 538, 538, 538, 541, 1257, 982, 628, 578, 630, 631, 1258, 1258, 298, 530, 663, 530, 663, 1258, 1258, 702, 538, 439, 125, 472, 310, 674, 310, 673, 537, 538, 541, 610, 401, 729, 820, 38, 38, 537, 1252, 962, 693, 681, 610, 677, 537, 679, 680, 1165, 1267, 684, 682, 683, 313, 313, 537, 203, 862, 172, 892, 30, 218, 949, 180, 180, 979, 386, 420, 773, 537, 157, 498, 37, 498, 37, 498, 498, 356, 356, 1230, 143, 150, 1188, 386, 171, 342, 171, 342, 154, 1189, 1189, 1189, 59, 59, 404, 81, 538, 1162, 1125, 317, 3, 120, 293, 298, 334, 1126, 1127, 38, 1102, 370, 1112, 538, 1082, 538, 1020, 1267, 1030, 59, 125, 136, 472, 1040, 1041, 136, 217, 1042, 842, 1027, 538, 671, 538, 866, 537, 665, 685, 685, 1252, 872, 59, 1027, 449, 611, 820, 538, 541, 530, 663, 538, 425, 488, 651, 1252, 63, 289, 375, 404, 675, 675, 538, 6, 401, 1252, 801, 1048, 729, 682, 677, 681, 1160, 538, 541, 864, 864, 683, 684, 859, 537, 649, 141, 294, 537, 944, 946, 950, 1009, 1022, 1029, 1048, 1059, 872, 872, 770, 1267, 1160, 775, 498, 498, 310, 310, 538, 1228, 35, 103, 187, 289, 446, 663, 663, 1267, 537, 1175, 1161, 1161, 298, 1161, 1127, 1267, 537, 538, 1118, 415, 440, 294, 404, 294, 120, 324, 480, 537, 1043, 551, 779, 663, 668, 779, 779, 1027, 820, 537, 631, 24, 120, 298, 1252, 729, 962, 683, 681, 682, 538, 680, 549, 549, 684, 538, 861, 863, 603, 386, 945, 946, 947, 1049, 1050, 541, 541, 538, 1255, 390, 390, 310, 1188, 386, 318, 404, 404, 449, 474, 282, 1132, 1133, 1267, 81, 1160, 1030, 480, 1012, 537, 1013, 664, 672, 1199, 662, 662, 729, 684, 682, 683, 864, 862, 538, 541, 684, 774, 538, 540, 449, 178, 537, 427, 427, 150, 1267, 1267, 229, 1255, 1256, 1267, 334, 1134, 538, 541, 172, 1136, 1124, 538, 479, 1199, 538, 538, 779, 538, 683, 684, 549, 649, 861, 1118, 157, 947, 416, 416, 5, 776, 777, 1257, 1258, 1270, 537, 120, 1258, 1231, 1133, 317, 158, 334, 1135, 1233, 538, 1043, 538, 324, 1043, 684, 603, 775, 494, 494, 538, 541, 1200, 1256, 38, 81, 538, 1135, 1258, 1227, 1135, 1012, 684, 1255, 180, 180, 777, 1067, 474, 1252, 537, 1231, 1235, 1227, 479, 1118, 537, 872, 872, 538, 1267, 81, 1132, 1230, 1235, 1043, 776, 537, 538, 1230, 538, 1132, 538 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_int16 yyr1[] = { 0, 543, 544, 544, 544, 544, 544, 544, 545, 545, 546, 546, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 548, 548, 549, 549, 550, 550, 551, 551, 551, 552, 553, 554, 554, 554, 555, 555, 556, 556, 557, 557, 557, 557, 557, 557, 557, 557, 557, 558, 558, 558, 558, 558, 558, 559, 560, 560, 561, 561, 562, 562, 562, 562, 563, 563, 563, 563, 563, 563, 564, 565, 566, 566, 567, 567, 567, 567, 568, 568, 569, 569, 569, 569, 569, 569, 570, 570, 570, 570, 570, 571, 571, 571, 572, 572, 572, 572, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 574, 574, 575, 575, 576, 576, 577, 577, 577, 577, 578, 578, 578, 578, 579, 579, 579, 579, 579, 579, 579, 580, 580, 580, 581, 581, 582, 582, 583, 583, 583, 583, 584, 584, 585, 585, 586, 586, 587, 587, 587, 587, 587, 587, 587, 588, 589, 589, 590, 590, 591, 592, 592, 592, 592, 592, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 594, 594, 595, 595, 595, 596, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 598, 598, 599, 599, 600, 600, 601, 601, 601, 601, 602, 603, 603, 604, 604, 605, 605, 605, 605, 606, 606, 607, 607, 607, 607, 608, 608, 609, 609, 610, 610, 610, 610, 611, 612, 612, 613, 614, 614, 615, 615, 615, 615, 616, 616, 617, 617, 618, 618, 619, 619, 620, 620, 620, 621, 621, 622, 622, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 624, 624, 625, 625, 626, 626, 627, 627, 628, 629, 629, 629, 629, 629, 629, 630, 630, 631, 632, 632, 632, 632, 632, 632, 633, 633, 633, 633, 633, 633, 633, 633, 634, 634, 635, 635, 636, 636, 637, 637, 638, 638, 638, 639, 639, 640, 641, 641, 642, 642, 643, 643, 644, 644, 645, 645, 646, 646, 647, 647, 647, 647, 648, 648, 648, 648, 648, 648, 648, 648, 648, 649, 649, 649, 650, 650, 651, 651, 651, 652, 652, 652, 652, 652, 652, 653, 654, 654, 654, 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, 656, 656, 657, 657, 657, 657, 657, 657, 657, 657, 658, 658, 659, 659, 660, 660, 661, 661, 662, 662, 663, 663, 664, 664, 665, 665, 666, 667, 667, 668, 668, 668, 668, 669, 669, 670, 670, 671, 671, 672, 672, 672, 672, 672, 673, 674, 675, 675, 675, 675, 675, 676, 676, 677, 677, 678, 679, 679, 680, 680, 680, 681, 681, 682, 682, 682, 683, 683, 683, 683, 684, 684, 685, 685, 686, 687, 687, 688, 688, 689, 689, 689, 690, 690, 691, 691, 692, 693, 693, 693, 694, 694, 695, 696, 696, 697, 698, 698, 699, 699, 700, 700, 701, 701, 702, 702, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 704, 704, 705, 705, 705, 705, 706, 706, 707, 707, 708, 708, 709, 709, 710, 710, 711, 711, 712, 712, 713, 713, 714, 715, 715, 716, 716, 717, 717, 718, 718, 719, 719, 719, 719, 720, 721, 721, 722, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 724, 725, 725, 725, 725, 726, 726, 727, 727, 728, 728, 729, 729, 730, 730, 731, 732, 732, 733, 733, 733, 733, 734, 735, 736, 737, 737, 738, 738, 739, 739, 740, 740, 741, 741, 741, 742, 742, 742, 742, 743, 744, 744, 745, 745, 746, 746, 747, 747, 748, 748, 749, 750, 751, 752, 752, 753, 753, 754, 754, 755, 755, 756, 756, 757, 757, 758, 758, 758, 758, 758, 759, 760, 760, 761, 761, 762, 762, 762, 763, 763, 764, 764, 764, 764, 764, 765, 765, 766, 766, 767, 768, 768, 769, 769, 770, 771, 771, 772, 772, 773, 773, 774, 774, 775, 775, 776, 776, 776, 777, 777, 777, 777, 778, 778, 779, 779, 780, 780, 780, 780, 780, 780, 780, 780, 781, 781, 782, 782, 783, 784, 784, 785, 786, 786, 786, 786, 787, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 789, 790, 790, 791, 791, 792, 792, 792, 792, 792, 792, 793, 794, 794, 795, 796, 796, 797, 797, 798, 798, 798, 798, 798, 799, 799, 800, 801, 801, 802, 802, 802, 802, 802, 803, 803, 804, 804, 805, 805, 805, 806, 807, 807, 808, 808, 809, 809, 810, 810, 811, 811, 812, 813, 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 816, 816, 816, 816, 816, 817, 817, 817, 817, 817, 817, 817, 817, 818, 818, 818, 819, 819, 820, 820, 821, 821, 822, 822, 823, 824, 824, 824, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 826, 826, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 828, 828, 829, 829, 830, 830, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 832, 832, 833, 833, 834, 835, 835, 836, 836, 836, 836, 836, 837, 837, 838, 838, 838, 838, 838, 839, 839, 840, 840, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 842, 842, 843, 843, 844, 844, 845, 845, 846, 846, 847, 847, 848, 849, 849, 849, 850, 850, 851, 852, 852, 853, 853, 853, 854, 854, 854, 855, 855, 855, 855, 855, 855, 855, 856, 856, 857, 857, 858, 858, 859, 859, 860, 860, 861, 861, 861, 862, 862, 863, 863, 864, 864, 865, 865, 865, 866, 866, 866, 867, 867, 867, 867, 868, 868, 869, 869, 870, 870, 871, 871, 872, 872, 872, 872, 873, 873, 874, 874, 875, 875, 875, 875, 875, 876, 876, 876, 876, 876, 877, 878, 879, 879, 879, 880, 880, 880, 881, 882, 882, 882, 882, 883, 883, 884, 885, 885, 886, 886, 887, 887, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 889, 889, 889, 889, 889, 890, 890, 891, 892, 892, 892, 893, 893, 894, 894, 895, 895, 896, 896, 897, 898, 898, 899, 899, 899, 900, 900, 901, 901, 902, 902, 902, 902, 902, 902, 903, 903, 904, 904, 905, 905, 905, 905, 906, 906, 907, 907, 908, 909, 910, 910, 911, 911, 912, 912, 912, 913, 913, 913, 914, 915, 915, 916, 917, 917, 917, 917, 918, 919, 919, 919, 920, 920, 921, 921, 922, 922, 923, 923, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 925, 925, 926, 926, 927, 927, 927, 927, 927, 927, 928, 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, 929, 929, 929, 930, 931, 931, 932, 932, 932, 933, 933, 933, 933, 933, 934, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 936, 936, 936, 937, 937, 937, 937, 937, 937, 937, 938, 938, 939, 939, 939, 939, 940, 941, 941, 941, 941, 941, 941, 941, 941, 941, 942, 942, 943, 944, 944, 944, 945, 945, 946, 946, 946, 946, 946, 947, 947, 948, 948, 948, 948, 949, 949, 949, 950, 951, 951, 952, 953, 953, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 955, 955, 956, 956, 956, 957, 957, 957, 957, 957, 958, 958, 958, 959, 959, 960, 960, 960, 961, 961, 961, 961, 962, 962, 962, 962, 963, 964, 965, 965, 966, 966, 967, 967, 967, 968, 968, 968, 968, 968, 968, 968, 969, 969, 970, 970, 970, 970, 971, 972, 972, 972, 972, 973, 973, 974, 975, 976, 976, 977, 978, 978, 978, 978, 978, 978, 978, 979, 979, 980, 981, 981, 981, 981, 981, 981, 982, 982, 983, 984, 984, 984, 984, 984, 985, 985, 986, 986, 987, 987, 988, 988, 989, 989, 990, 991, 991, 991, 992, 992, 992, 993, 993, 994, 994, 995, 995, 996, 996, 997, 997, 998, 999, 999, 1000, 1000, 1001, 1001, 1001, 1001, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1003, 1004, 1004, 1005, 1005, 1005, 1005, 1005, 1006, 1006, 1006, 1007, 1007, 1008, 1008, 1008, 1008, 1009, 1010, 1010, 1011, 1011, 1011, 1011, 1011, 1012, 1012, 1013, 1013, 1014, 1015, 1015, 1015, 1016, 1016, 1016, 1017, 1017, 1018, 1018, 1019, 1019, 1020, 1021, 1021, 1022, 1023, 1023, 1024, 1025, 1025, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1027, 1027, 1028, 1028, 1028, 1029, 1030, 1030, 1031, 1031, 1032, 1033, 1033, 1034, 1035, 1035, 1036, 1036, 1036, 1036, 1036, 1037, 1037, 1038, 1038, 1039, 1039, 1040, 1041, 1042, 1042, 1042, 1042, 1042, 1043, 1044, 1045, 1046, 1046, 1046, 1046, 1046, 1046, 1047, 1047, 1047, 1048, 1048, 1049, 1049, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1051, 1051, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1053, 1053, 1053, 1054, 1054, 1055, 1056, 1056, 1056, 1057, 1057, 1057, 1058, 1058, 1058, 1059, 1059, 1060, 1060, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1062, 1062, 1063, 1063, 1063, 1064, 1064, 1065, 1065, 1066, 1066, 1067, 1067, 1068, 1069, 1069, 1070, 1070, 1071, 1071, 1071, 1071, 1072, 1072, 1073, 1073, 1073, 1073, 1073, 1073, 1074, 1074, 1075, 1075, 1076, 1077, 1077, 1077, 1078, 1078, 1079, 1079, 1080, 1080, 1081, 1081, 1082, 1082, 1083, 1083, 1083, 1083, 1083, 1084, 1085, 1086, 1087, 1088, 1088, 1089, 1089, 1090, 1090, 1091, 1091, 1092, 1093, 1093, 1093, 1093, 1094, 1094, 1095, 1095, 1096, 1096, 1097, 1097, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1099, 1099, 1099, 1099, 1099, 1099, 1100, 1100, 1100, 1100, 1101, 1101, 1102, 1102, 1103, 1103, 1103, 1103, 1103, 1104, 1104, 1104, 1104, 1105, 1105, 1106, 1106, 1107, 1107, 1108, 1108, 1108, 1109, 1109, 1110, 1110, 1110, 1111, 1112, 1112, 1113, 1113, 1114, 1115, 1115, 1116, 1116, 1117, 1117, 1118, 1118, 1119, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1123, 1123, 1124, 1124, 1125, 1125, 1125, 1126, 1126, 1127, 1127, 1127, 1127, 1127, 1128, 1128, 1129, 1129, 1130, 1131, 1131, 1132, 1132, 1133, 1133, 1133, 1133, 1133, 1133, 1134, 1134, 1135, 1135, 1136, 1136, 1136, 1136, 1136, 1136, 1137, 1137, 1137, 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1139, 1139, 1139, 1139, 1139, 1140, 1140, 1141, 1141, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1143, 1143, 1144, 1144, 1145, 1145, 1146, 1147, 1148, 1148, 1149, 1149, 1150, 1151, 1152, 1152, 1152, 1152, 1152, 1152, 1153, 1153, 1154, 1154, 1154, 1154, 1155, 1156, 1156, 1156, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1158, 1158, 1159, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164, 1164, 1164, 1165, 1165, 1165, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1167, 1167, 1168, 1168, 1168, 1168, 1169, 1170, 1170, 1171, 1171, 1172, 1172, 1173, 1173, 1173, 1174, 1174, 1174, 1175, 1175, 1175, 1175, 1176, 1176, 1177, 1177, 1178, 1178, 1179, 1179, 1180, 1180, 1181, 1182, 1182, 1182, 1183, 1184, 1184, 1185, 1185, 1186, 1186, 1186, 1186, 1187, 1187, 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1189, 1189, 1189, 1190, 1190, 1190, 1191, 1191, 1192, 1193, 1193, 1193, 1194, 1194, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1196, 1196, 1197, 1197, 1198, 1198, 1198, 1198, 1198, 1198, 1199, 1199, 1200, 1200, 1201, 1201, 1201, 1202, 1202, 1203, 1203, 1204, 1204, 1204, 1205, 1205, 1206, 1207, 1207, 1207, 1207, 1207, 1207, 1207, 1207, 1208, 1208, 1208, 1208, 1209, 1209, 1210, 1211, 1211, 1211, 1211, 1211, 1212, 1212, 1212, 1213, 1214, 1214, 1215, 1216, 1216, 1217, 1217, 1218, 1218, 1219, 1219, 1219, 1219, 1220, 1220, 1221, 1221, 1222, 1222, 1223, 1223, 1224, 1224, 1225, 1225, 1226, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1228, 1228, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1230, 1230, 1230, 1230, 1231, 1231, 1232, 1233, 1233, 1234, 1234, 1235, 1235, 1235, 1235, 1235, 1236, 1236, 1237, 1237, 1237, 1237, 1237, 1238, 1238, 1238, 1238, 1238, 1239, 1239, 1240, 1240, 1241, 1241, 1241, 1242, 1242, 1242, 1243, 1243, 1244, 1244, 1245, 1245, 1246, 1246, 1247, 1247, 1248, 1248, 1248, 1248, 1249, 1249, 1250, 1250, 1251, 1251, 1252, 1253, 1254, 1255, 1255, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1257, 1258, 1259, 1259, 1259, 1260, 1261, 1261, 1261, 1261, 1262, 1262, 1263, 1264, 1265, 1265, 1266, 1266, 1267, 1267, 1267, 1268, 1268, 1268, 1269, 1269, 1269, 1269, 1270, 1270, 1270, 1270, 1270, 1271, 1271, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_int8 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, 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, 3, 1, 4, 4, 5, 2, 5, 7, 5, 2, 3, 0, 1, 2, 1, 1, 0, 1, 2, 2, 2, 1, 2, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 4, 10, 3, 10, 4, 10, 12, 3, 1, 5, 3, 2, 0, 2, 0, 3, 0, 1, 3, 3, 0, 4, 0, 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, 1, 2, 2, 2, 2, 3, 3, 3, 1, 3, 1, 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, 2, 1, 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, 4, 4, 3, 6, 2, 1, 0, 2, 0, 2, 4, 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, 2, 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, 3, 0, 4, 0, 1, 3, 3, 1, 1, 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, 5, 4, 6, 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, 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, 1, 1, 1, 1, 1, 1 }; enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #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) /* Backward compatibility with an undocumented macro. Use YYerror or YYUNDEF. */ #define YYERRCODE YYUNDEF /* 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 int yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) { int 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 /* !defined YY_LOCATION_PRINT */ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Kind, Value, Location, yyscanner); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) { FILE *yyoutput = yyo; YYUSE (yyoutput); YYUSE (yylocationp); YYUSE (yyscanner); if (!yyvaluep) return; # ifdef YYPRINT if (yykind < YYNTOKENS) YYPRINT (yyo, yytoknum[yykind], *yyvaluep); # endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) { YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); YY_LOCATION_PRINT (yyo, *yylocationp); YYFPRINTF (yyo, ": "); yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, yyscanner); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yy_state_t *yybottom, yy_state_t *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 (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, core_yyscan_t yyscanner) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, YY_ACCESSING_SYMBOL (+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) ((void) 0) # define YY_SYMBOL_PRINT(Title, Kind, 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 /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, core_yyscan_t yyscanner) { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (yyscanner); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*----------. | yyparse. | `----------*/ int yyparse (core_yyscan_t yyscanner) { /* Lookahead token kind. */ 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 = 0; yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus = 0; /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ YYPTRDIFF_T yystacksize = YYINITDEPTH; /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; yy_state_t *yyss = yyssa; yy_state_t *yyssp = yyss; /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp = yyvs; /* The location stack: array, bottom, top. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp = yyls; int yyn; /* The return value of yyparse. */ int yyresult; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[3]; #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; YYDPRINTF ((stderr, "Starting parse\n")); 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 -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined 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. */ yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; 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 * YYSIZEOF (*yyssp), &yyvs1, yysize * YYSIZEOF (*yyvsp), &yyls1, yysize * YYSIZEOF (*yylsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; yyls = yyls1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, 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 yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN YYDPRINTF ((stderr, "Stack size increased to %ld\n", YY_CAST (long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ 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 empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (&yylval, &yylloc, yyscanner); } if (yychar <= YYEOF) { yychar = YYEOF; yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else if (yychar == YYerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = YYUNDEF; yytoken = YYSYMBOL_YYerror; yyerror_range[1] = yylloc; goto yyerrlab1; } 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); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END *++yylsp = yylloc; /* Discard the shifted token. */ yychar = YYEMPTY; 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); yyerror_range[1] = yyloc; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* parse_toplevel: stmtmulti */ #line 955 "gram.y" { pg_yyget_extra(yyscanner)->parsetree = (yyvsp[0].list); (void) yynerrs; /* suppress compiler warning */ } #line 32319 "gram.c" break; case 3: /* parse_toplevel: MODE_TYPE_NAME Typename */ #line 960 "gram.y" { pg_yyget_extra(yyscanner)->parsetree = list_make1((yyvsp[0].typnam)); } #line 32327 "gram.c" break; case 4: /* parse_toplevel: MODE_PLPGSQL_EXPR PLpgSQL_Expr */ #line 964 "gram.y" { pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((yyvsp[0].node), (yylsp[0]))); } #line 32336 "gram.c" break; case 5: /* parse_toplevel: MODE_PLPGSQL_ASSIGN1 PLAssignStmt */ #line 969 "gram.y" { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 1; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, (yylsp[0]))); } #line 32348 "gram.c" break; case 6: /* parse_toplevel: MODE_PLPGSQL_ASSIGN2 PLAssignStmt */ #line 977 "gram.y" { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 2; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, (yylsp[0]))); } #line 32360 "gram.c" break; case 7: /* parse_toplevel: MODE_PLPGSQL_ASSIGN3 PLAssignStmt */ #line 985 "gram.y" { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 3; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, (yylsp[0]))); } #line 32372 "gram.c" break; case 8: /* stmtmulti: stmtmulti ';' toplevel_stmt */ #line 1001 "gram.y" { 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[0]))); else (yyval.list) = (yyvsp[-2].list); } #line 32388 "gram.c" break; case 9: /* stmtmulti: toplevel_stmt */ #line 1013 "gram.y" { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1(makeRawStmt((yyvsp[0].node), (yylsp[0]))); else (yyval.list) = NIL; } #line 32399 "gram.c" break; case 136: /* stmt: %empty */ #line 1156 "gram.y" { (yyval.node) = NULL; } #line 32405 "gram.c" break; case 137: /* opt_single_name: ColId */ #line 1163 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 32411 "gram.c" break; case 138: /* opt_single_name: %empty */ #line 1164 "gram.y" { (yyval.str) = NULL; } #line 32417 "gram.c" break; case 139: /* opt_qualified_name: any_name */ #line 1168 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 32423 "gram.c" break; case 140: /* opt_qualified_name: %empty */ #line 1169 "gram.y" { (yyval.list) = NIL; } #line 32429 "gram.c" break; case 141: /* opt_concurrently: CONCURRENTLY */ #line 1173 "gram.y" { (yyval.boolean) = true; } #line 32435 "gram.c" break; case 142: /* opt_concurrently: %empty */ #line 1174 "gram.y" { (yyval.boolean) = false; } #line 32441 "gram.c" break; case 143: /* opt_drop_behavior: CASCADE */ #line 1178 "gram.y" { (yyval.dbehavior) = DROP_CASCADE; } #line 32447 "gram.c" break; case 144: /* opt_drop_behavior: RESTRICT */ #line 1179 "gram.y" { (yyval.dbehavior) = DROP_RESTRICT; } #line 32453 "gram.c" break; case 145: /* opt_drop_behavior: %empty */ #line 1180 "gram.y" { (yyval.dbehavior) = DROP_RESTRICT; /* default */ } #line 32459 "gram.c" break; case 146: /* CallStmt: CALL func_application */ #line 1190 "gram.y" { CallStmt *n = makeNode(CallStmt); n->funccall = castNode(FuncCall, (yyvsp[0].node)); (yyval.node) = (Node *) n; } #line 32470 "gram.c" break; case 147: /* CreateRoleStmt: CREATE ROLE RoleId opt_with OptRoleList */ #line 1206 "gram.y" { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_ROLE; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32483 "gram.c" break; case 151: /* OptRoleList: OptRoleList CreateOptRoleElem */ #line 1228 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 32489 "gram.c" break; case 152: /* OptRoleList: %empty */ #line 1229 "gram.y" { (yyval.list) = NIL; } #line 32495 "gram.c" break; case 153: /* AlterOptRoleList: AlterOptRoleList AlterOptRoleElem */ #line 1233 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 32501 "gram.c" break; case 154: /* AlterOptRoleList: %empty */ #line 1234 "gram.y" { (yyval.list) = NIL; } #line 32507 "gram.c" break; case 155: /* AlterOptRoleElem: PASSWORD Sconst */ #line 1239 "gram.y" { (yyval.defelt) = makeDefElem("password", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 32516 "gram.c" break; case 156: /* AlterOptRoleElem: PASSWORD NULL_P */ #line 1244 "gram.y" { (yyval.defelt) = makeDefElem("password", NULL, (yylsp[-1])); } #line 32524 "gram.c" break; case 157: /* AlterOptRoleElem: ENCRYPTED PASSWORD Sconst */ #line 1248 "gram.y" { /* * 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 32538 "gram.c" break; case 158: /* AlterOptRoleElem: UNENCRYPTED PASSWORD Sconst */ #line 1258 "gram.y" { 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 32550 "gram.c" break; case 159: /* AlterOptRoleElem: INHERIT */ #line 1266 "gram.y" { (yyval.defelt) = makeDefElem("inherit", (Node *) makeBoolean(true), (yylsp[0])); } #line 32558 "gram.c" break; case 160: /* AlterOptRoleElem: CONNECTION LIMIT SignedIconst */ #line 1270 "gram.y" { (yyval.defelt) = makeDefElem("connectionlimit", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 32566 "gram.c" break; case 161: /* AlterOptRoleElem: VALID UNTIL Sconst */ #line 1274 "gram.y" { (yyval.defelt) = makeDefElem("validUntil", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 32574 "gram.c" break; case 162: /* AlterOptRoleElem: USER role_list */ #line 1279 "gram.y" { (yyval.defelt) = makeDefElem("rolemembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 32582 "gram.c" break; case 163: /* AlterOptRoleElem: IDENT */ #line 1283 "gram.y" { /* * 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 32631 "gram.c" break; case 164: /* CreateOptRoleElem: AlterOptRoleElem */ #line 1330 "gram.y" { (yyval.defelt) = (yyvsp[0].defelt); } #line 32637 "gram.c" break; case 165: /* CreateOptRoleElem: SYSID Iconst */ #line 1333 "gram.y" { (yyval.defelt) = makeDefElem("sysid", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 32645 "gram.c" break; case 166: /* CreateOptRoleElem: ADMIN role_list */ #line 1337 "gram.y" { (yyval.defelt) = makeDefElem("adminmembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 32653 "gram.c" break; case 167: /* CreateOptRoleElem: ROLE role_list */ #line 1341 "gram.y" { (yyval.defelt) = makeDefElem("rolemembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 32661 "gram.c" break; case 168: /* CreateOptRoleElem: IN_P ROLE role_list */ #line 1345 "gram.y" { (yyval.defelt) = makeDefElem("addroleto", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 32669 "gram.c" break; case 169: /* CreateOptRoleElem: IN_P GROUP_P role_list */ #line 1349 "gram.y" { (yyval.defelt) = makeDefElem("addroleto", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 32677 "gram.c" break; case 170: /* CreateUserStmt: CREATE USER RoleId opt_with OptRoleList */ #line 1363 "gram.y" { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_USER; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32690 "gram.c" break; case 171: /* AlterRoleStmt: ALTER ROLE RoleSpec opt_with AlterOptRoleList */ #line 1382 "gram.y" { 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 32703 "gram.c" break; case 172: /* AlterRoleStmt: ALTER USER RoleSpec opt_with AlterOptRoleList */ #line 1391 "gram.y" { 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 32716 "gram.c" break; case 173: /* opt_in_database: %empty */ #line 1402 "gram.y" { (yyval.str) = NULL; } #line 32722 "gram.c" break; case 174: /* opt_in_database: IN_P DATABASE name */ #line 1403 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 32728 "gram.c" break; case 175: /* AlterRoleSetStmt: ALTER ROLE RoleSpec opt_in_database SetResetClause */ #line 1408 "gram.y" { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].rolespec); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 32741 "gram.c" break; case 176: /* AlterRoleSetStmt: ALTER ROLE ALL opt_in_database SetResetClause */ #line 1417 "gram.y" { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = NULL; n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 32754 "gram.c" break; case 177: /* AlterRoleSetStmt: ALTER USER RoleSpec opt_in_database SetResetClause */ #line 1426 "gram.y" { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].rolespec); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 32767 "gram.c" break; case 178: /* AlterRoleSetStmt: ALTER USER ALL opt_in_database SetResetClause */ #line 1435 "gram.y" { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = NULL; n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 32780 "gram.c" break; case 179: /* DropRoleStmt: DROP ROLE role_list */ #line 1457 "gram.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32792 "gram.c" break; case 180: /* DropRoleStmt: DROP ROLE IF_P EXISTS role_list */ #line 1465 "gram.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32804 "gram.c" break; case 181: /* DropRoleStmt: DROP USER role_list */ #line 1473 "gram.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32816 "gram.c" break; case 182: /* DropRoleStmt: DROP USER IF_P EXISTS role_list */ #line 1481 "gram.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32828 "gram.c" break; case 183: /* DropRoleStmt: DROP GROUP_P role_list */ #line 1489 "gram.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32840 "gram.c" break; case 184: /* DropRoleStmt: DROP GROUP_P IF_P EXISTS role_list */ #line 1497 "gram.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32852 "gram.c" break; case 185: /* CreateGroupStmt: CREATE GROUP_P RoleId opt_with OptRoleList */ #line 1515 "gram.y" { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_GROUP; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32865 "gram.c" break; case 186: /* AlterGroupStmt: ALTER GROUP_P RoleSpec add_drop USER role_list */ #line 1534 "gram.y" { 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 32879 "gram.c" break; case 187: /* add_drop: ADD_P */ #line 1545 "gram.y" { (yyval.ival) = +1; } #line 32885 "gram.c" break; case 188: /* add_drop: DROP */ #line 1546 "gram.y" { (yyval.ival) = -1; } #line 32891 "gram.c" break; case 189: /* CreateSchemaStmt: CREATE SCHEMA opt_single_name AUTHORIZATION RoleSpec OptSchemaEltList */ #line 1558 "gram.y" { 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 32906 "gram.c" break; case 190: /* CreateSchemaStmt: CREATE SCHEMA ColId OptSchemaEltList */ #line 1569 "gram.y" { 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 32921 "gram.c" break; case 191: /* CreateSchemaStmt: CREATE SCHEMA IF_P NOT EXISTS opt_single_name AUTHORIZATION RoleSpec OptSchemaEltList */ #line 1580 "gram.y" { 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 32941 "gram.c" break; case 192: /* CreateSchemaStmt: CREATE SCHEMA IF_P NOT EXISTS ColId OptSchemaEltList */ #line 1596 "gram.y" { 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 32961 "gram.c" break; case 193: /* OptSchemaEltList: OptSchemaEltList schema_stmt */ #line 1615 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 32969 "gram.c" break; case 194: /* OptSchemaEltList: %empty */ #line 1619 "gram.y" { (yyval.list) = NIL; } #line 32975 "gram.c" break; case 201: /* VariableSetStmt: PGPOOL SET generic_set */ #line 1647 "gram.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep changes minimum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 32986 "gram.c" break; case 202: /* VariableSetStmt: PGPOOL set_rest_more */ #line 1654 "gram.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolQueryCacheStmt; /* Hack to keep changes minimum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 32997 "gram.c" break; case 203: /* VariableSetStmt: SET set_rest */ #line 1661 "gram.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 33008 "gram.c" break; case 204: /* VariableSetStmt: SET LOCAL set_rest */ #line 1668 "gram.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = true; (yyval.node) = (Node *) n; } #line 33019 "gram.c" break; case 205: /* VariableSetStmt: SET SESSION set_rest */ #line 1675 "gram.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 33030 "gram.c" break; case 206: /* set_rest: TRANSACTION transaction_mode_list */ #line 1685 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "TRANSACTION"; n->args = (yyvsp[0].list); n->jumble_args = true; n->location = -1; (yyval.vsetstmt) = n; } #line 33045 "gram.c" break; case 207: /* set_rest: SESSION CHARACTERISTICS AS TRANSACTION transaction_mode_list */ #line 1696 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "SESSION CHARACTERISTICS"; n->args = (yyvsp[0].list); n->jumble_args = true; n->location = -1; (yyval.vsetstmt) = n; } #line 33060 "gram.c" break; case 209: /* generic_set: var_name TO var_list */ #line 1711 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = (yyvsp[-2].str); n->args = (yyvsp[0].list); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33074 "gram.c" break; case 210: /* generic_set: var_name '=' var_list */ #line 1721 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = (yyvsp[-2].str); n->args = (yyvsp[0].list); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33088 "gram.c" break; case 211: /* generic_set: var_name TO DEFAULT */ #line 1731 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); n->location = -1; (yyval.vsetstmt) = n; } #line 33101 "gram.c" break; case 212: /* generic_set: var_name '=' DEFAULT */ #line 1740 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); n->location = -1; (yyval.vsetstmt) = n; } #line 33114 "gram.c" break; case 213: /* set_rest_more: generic_set */ #line 1751 "gram.y" {(yyval.vsetstmt) = (yyvsp[0].vsetstmt);} #line 33120 "gram.c" break; case 214: /* set_rest_more: var_name FROM CURRENT_P */ #line 1753 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_CURRENT; n->name = (yyvsp[-2].str); n->location = -1; (yyval.vsetstmt) = n; } #line 33133 "gram.c" break; case 215: /* set_rest_more: TIME ZONE zone_value */ #line 1763 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "timezone"; n->location = -1; n->jumble_args = true; if ((yyvsp[0].node) != NULL) n->args = list_make1((yyvsp[0].node)); else n->kind = VAR_SET_DEFAULT; (yyval.vsetstmt) = n; } #line 33151 "gram.c" break; case 216: /* set_rest_more: CATALOG_P Sconst */ #line 1777 "gram.y" { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("current database cannot be changed"), parser_errposition((yylsp[0])))); (yyval.vsetstmt) = NULL; /*not reached*/ } #line 33163 "gram.c" break; case 217: /* set_rest_more: SCHEMA Sconst */ #line 1785 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "search_path"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33177 "gram.c" break; case 218: /* set_rest_more: NAMES opt_encoding */ #line 1795 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "client_encoding"; n->location = (yylsp[0]); 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 33194 "gram.c" break; case 219: /* set_rest_more: ROLE NonReservedWord_or_Sconst */ #line 1808 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "role"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33208 "gram.c" break; case 220: /* set_rest_more: SESSION AUTHORIZATION NonReservedWord_or_Sconst */ #line 1818 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "session_authorization"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33222 "gram.c" break; case 221: /* set_rest_more: SESSION AUTHORIZATION DEFAULT */ #line 1828 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; n->location = -1; (yyval.vsetstmt) = n; } #line 33235 "gram.c" break; case 222: /* set_rest_more: XML_P OPTION document_or_content */ #line 1837 "gram.y" { 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]))); n->jumble_args = true; n->location = -1; (yyval.vsetstmt) = n; } #line 33250 "gram.c" break; case 223: /* set_rest_more: TRANSACTION SNAPSHOT Sconst */ #line 1849 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "TRANSACTION SNAPSHOT"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33264 "gram.c" break; case 224: /* set_rest_more: SET CACHE DELETE_P Sconst */ #line 1860 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->name = (yyvsp[0].str); /* query to delete query cache */ (yyval.vsetstmt) = n; } #line 33274 "gram.c" break; case 225: /* var_name: ColId */ #line 1867 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 33280 "gram.c" break; case 226: /* var_name: var_name '.' ColId */ #line 1869 "gram.y" { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 33286 "gram.c" break; case 227: /* var_list: var_value */ #line 1872 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33292 "gram.c" break; case 228: /* var_list: var_list ',' var_value */ #line 1873 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33298 "gram.c" break; case 229: /* var_value: opt_boolean_or_string */ #line 1877 "gram.y" { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 33304 "gram.c" break; case 230: /* var_value: NumericOnly */ #line 1879 "gram.y" { (yyval.node) = makeAConst((yyvsp[0].node), (yylsp[0])); } #line 33310 "gram.c" break; case 231: /* iso_level: READ UNCOMMITTED */ #line 1882 "gram.y" { (yyval.str) = "read uncommitted"; } #line 33316 "gram.c" break; case 232: /* iso_level: READ COMMITTED */ #line 1883 "gram.y" { (yyval.str) = "read committed"; } #line 33322 "gram.c" break; case 233: /* iso_level: REPEATABLE READ */ #line 1884 "gram.y" { (yyval.str) = "repeatable read"; } #line 33328 "gram.c" break; case 234: /* iso_level: SERIALIZABLE */ #line 1885 "gram.y" { (yyval.str) = "serializable"; } #line 33334 "gram.c" break; case 235: /* opt_boolean_or_string: TRUE_P */ #line 1889 "gram.y" { (yyval.str) = "true"; } #line 33340 "gram.c" break; case 236: /* opt_boolean_or_string: FALSE_P */ #line 1890 "gram.y" { (yyval.str) = "false"; } #line 33346 "gram.c" break; case 237: /* opt_boolean_or_string: ON */ #line 1891 "gram.y" { (yyval.str) = "on"; } #line 33352 "gram.c" break; case 238: /* opt_boolean_or_string: NonReservedWord_or_Sconst */ #line 1897 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 33358 "gram.c" break; case 239: /* zone_value: Sconst */ #line 1910 "gram.y" { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 33366 "gram.c" break; case 240: /* zone_value: IDENT */ #line 1914 "gram.y" { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 33374 "gram.c" break; case 241: /* zone_value: ConstInterval Sconst opt_interval */ #line 1918 "gram.y" { 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 33395 "gram.c" break; case 242: /* zone_value: ConstInterval '(' Iconst ')' Sconst */ #line 1935 "gram.y" { 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 33407 "gram.c" break; case 243: /* zone_value: NumericOnly */ #line 1942 "gram.y" { (yyval.node) = makeAConst((yyvsp[0].node), (yylsp[0])); } #line 33413 "gram.c" break; case 244: /* zone_value: DEFAULT */ #line 1943 "gram.y" { (yyval.node) = NULL; } #line 33419 "gram.c" break; case 245: /* zone_value: LOCAL */ #line 1944 "gram.y" { (yyval.node) = NULL; } #line 33425 "gram.c" break; case 246: /* opt_encoding: Sconst */ #line 1948 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 33431 "gram.c" break; case 247: /* opt_encoding: DEFAULT */ #line 1949 "gram.y" { (yyval.str) = NULL; } #line 33437 "gram.c" break; case 248: /* opt_encoding: %empty */ #line 1950 "gram.y" { (yyval.str) = NULL; } #line 33443 "gram.c" break; case 249: /* NonReservedWord_or_Sconst: NonReservedWord */ #line 1954 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 33449 "gram.c" break; case 250: /* NonReservedWord_or_Sconst: Sconst */ #line 1955 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 33455 "gram.c" break; case 251: /* VariableResetStmt: RESET reset_rest */ #line 1959 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].vsetstmt); } #line 33461 "gram.c" break; case 252: /* VariableResetStmt: PGPOOL RESET generic_reset */ #line 1961 "gram.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep the changes minimum */ (yyval.node) = (Node *) n; } #line 33471 "gram.c" break; case 253: /* reset_rest: generic_reset */ #line 1969 "gram.y" { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 33477 "gram.c" break; case 254: /* reset_rest: TIME ZONE */ #line 1971 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; n->location = -1; (yyval.vsetstmt) = n; } #line 33490 "gram.c" break; case 255: /* reset_rest: TRANSACTION ISOLATION LEVEL */ #line 1980 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; n->location = -1; (yyval.vsetstmt) = n; } #line 33503 "gram.c" break; case 256: /* reset_rest: SESSION AUTHORIZATION */ #line 1989 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; n->location = -1; (yyval.vsetstmt) = n; } #line 33516 "gram.c" break; case 257: /* generic_reset: var_name */ #line 2001 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = (yyvsp[0].str); n->location = -1; (yyval.vsetstmt) = n; } #line 33529 "gram.c" break; case 258: /* generic_reset: ALL */ #line 2010 "gram.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; n->location = -1; (yyval.vsetstmt) = n; } #line 33541 "gram.c" break; case 259: /* SetResetClause: SET set_rest */ #line 2021 "gram.y" { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 33547 "gram.c" break; case 260: /* SetResetClause: VariableResetStmt */ #line 2022 "gram.y" { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 33553 "gram.c" break; case 261: /* FunctionSetResetClause: SET set_rest_more */ #line 2027 "gram.y" { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 33559 "gram.c" break; case 262: /* FunctionSetResetClause: VariableResetStmt */ #line 2028 "gram.y" { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 33565 "gram.c" break; case 263: /* VariableShowStmt: PGPOOL SHOW var_name */ #line 2035 "gram.y" { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33575 "gram.c" break; case 264: /* VariableShowStmt: PGPOOL SHOW ALL */ #line 2041 "gram.y" { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 33585 "gram.c" break; case 265: /* VariableShowStmt: SHOW var_name */ #line 2047 "gram.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33596 "gram.c" break; case 266: /* VariableShowStmt: SHOW TIME ZONE */ #line 2054 "gram.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "timezone"; (yyval.node) = (Node *) n; } #line 33607 "gram.c" break; case 267: /* VariableShowStmt: SHOW TRANSACTION ISOLATION LEVEL */ #line 2061 "gram.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "transaction_isolation"; (yyval.node) = (Node *) n; } #line 33618 "gram.c" break; case 268: /* VariableShowStmt: SHOW SESSION AUTHORIZATION */ #line 2068 "gram.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "session_authorization"; (yyval.node) = (Node *) n; } #line 33629 "gram.c" break; case 269: /* VariableShowStmt: SHOW ALL */ #line 2075 "gram.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 33640 "gram.c" break; case 270: /* ConstraintsSetStmt: SET CONSTRAINTS constraints_set_list constraints_set_mode */ #line 2086 "gram.y" { ConstraintsSetStmt *n = makeNode(ConstraintsSetStmt); n->constraints = (yyvsp[-1].list); n->deferred = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 33652 "gram.c" break; case 271: /* constraints_set_list: ALL */ #line 2096 "gram.y" { (yyval.list) = NIL; } #line 33658 "gram.c" break; case 272: /* constraints_set_list: qualified_name_list */ #line 2097 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 33664 "gram.c" break; case 273: /* constraints_set_mode: DEFERRED */ #line 2101 "gram.y" { (yyval.boolean) = true; } #line 33670 "gram.c" break; case 274: /* constraints_set_mode: IMMEDIATE */ #line 2102 "gram.y" { (yyval.boolean) = false; } #line 33676 "gram.c" break; case 275: /* CheckPointStmt: CHECKPOINT */ #line 2111 "gram.y" { CheckPointStmt *n = makeNode(CheckPointStmt); (yyval.node) = (Node *) n; } #line 33686 "gram.c" break; case 276: /* DiscardStmt: DISCARD ALL */ #line 2127 "gram.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_ALL; (yyval.node) = (Node *) n; } #line 33697 "gram.c" break; case 277: /* DiscardStmt: DISCARD TEMP */ #line 2134 "gram.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 33708 "gram.c" break; case 278: /* DiscardStmt: DISCARD TEMPORARY */ #line 2141 "gram.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 33719 "gram.c" break; case 279: /* DiscardStmt: DISCARD PLANS */ #line 2148 "gram.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_PLANS; (yyval.node) = (Node *) n; } #line 33730 "gram.c" break; case 280: /* DiscardStmt: DISCARD SEQUENCES */ #line 2155 "gram.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_SEQUENCES; (yyval.node) = (Node *) n; } #line 33741 "gram.c" break; case 281: /* AlterTableStmt: ALTER TABLE relation_expr alter_table_cmds */ #line 2175 "gram.y" { 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 33755 "gram.c" break; case 282: /* AlterTableStmt: ALTER TABLE IF_P EXISTS relation_expr alter_table_cmds */ #line 2185 "gram.y" { 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 33769 "gram.c" break; case 283: /* AlterTableStmt: ALTER TABLE relation_expr partition_cmd */ #line 2195 "gram.y" { 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 33783 "gram.c" break; case 284: /* AlterTableStmt: ALTER TABLE IF_P EXISTS relation_expr partition_cmd */ #line 2205 "gram.y" { 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 33797 "gram.c" break; case 285: /* AlterTableStmt: ALTER TABLE ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait */ #line 2215 "gram.y" { 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 33813 "gram.c" break; case 286: /* AlterTableStmt: ALTER TABLE ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait */ #line 2227 "gram.y" { 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 33829 "gram.c" break; case 287: /* AlterTableStmt: ALTER INDEX qualified_name alter_table_cmds */ #line 2239 "gram.y" { 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 33843 "gram.c" break; case 288: /* AlterTableStmt: ALTER INDEX IF_P EXISTS qualified_name alter_table_cmds */ #line 2249 "gram.y" { 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 33857 "gram.c" break; case 289: /* AlterTableStmt: ALTER INDEX qualified_name index_partition_cmd */ #line 2259 "gram.y" { 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 33871 "gram.c" break; case 290: /* AlterTableStmt: ALTER INDEX ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait */ #line 2269 "gram.y" { 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 33887 "gram.c" break; case 291: /* AlterTableStmt: ALTER INDEX ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait */ #line 2281 "gram.y" { 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 33903 "gram.c" break; case 292: /* AlterTableStmt: ALTER SEQUENCE qualified_name alter_table_cmds */ #line 2293 "gram.y" { 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 33917 "gram.c" break; case 293: /* AlterTableStmt: ALTER SEQUENCE IF_P EXISTS qualified_name alter_table_cmds */ #line 2303 "gram.y" { 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 33931 "gram.c" break; case 294: /* AlterTableStmt: ALTER VIEW qualified_name alter_table_cmds */ #line 2313 "gram.y" { 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 33945 "gram.c" break; case 295: /* AlterTableStmt: ALTER VIEW IF_P EXISTS qualified_name alter_table_cmds */ #line 2323 "gram.y" { 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 33959 "gram.c" break; case 296: /* AlterTableStmt: ALTER MATERIALIZED VIEW qualified_name alter_table_cmds */ #line 2333 "gram.y" { 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 33973 "gram.c" break; case 297: /* AlterTableStmt: ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name alter_table_cmds */ #line 2343 "gram.y" { 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 33987 "gram.c" break; case 298: /* AlterTableStmt: ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait */ #line 2353 "gram.y" { 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 34003 "gram.c" break; case 299: /* AlterTableStmt: ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait */ #line 2365 "gram.y" { 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 34019 "gram.c" break; case 300: /* AlterTableStmt: ALTER FOREIGN TABLE relation_expr alter_table_cmds */ #line 2377 "gram.y" { 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 34033 "gram.c" break; case 301: /* AlterTableStmt: ALTER FOREIGN TABLE IF_P EXISTS relation_expr alter_table_cmds */ #line 2387 "gram.y" { 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 34047 "gram.c" break; case 302: /* alter_table_cmds: alter_table_cmd */ #line 2399 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 34053 "gram.c" break; case 303: /* alter_table_cmds: alter_table_cmds ',' alter_table_cmd */ #line 2400 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 34059 "gram.c" break; case 304: /* partition_cmd: ATTACH PARTITION qualified_name PartitionBoundSpec */ #line 2406 "gram.y" { 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 34076 "gram.c" break; case 305: /* partition_cmd: DETACH PARTITION qualified_name opt_concurrently */ #line 2420 "gram.y" { 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 34093 "gram.c" break; case 306: /* partition_cmd: DETACH PARTITION qualified_name FINALIZE */ #line 2433 "gram.y" { 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 34109 "gram.c" break; case 307: /* index_partition_cmd: ATTACH PARTITION qualified_name */ #line 2449 "gram.y" { 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 34126 "gram.c" break; case 308: /* alter_table_cmd: ADD_P columnDef */ #line 2466 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 34139 "gram.c" break; case 309: /* alter_table_cmd: ADD_P IF_P NOT EXISTS columnDef */ #line 2476 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 34152 "gram.c" break; case 310: /* alter_table_cmd: ADD_P COLUMN columnDef */ #line 2486 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 34165 "gram.c" break; case 311: /* alter_table_cmd: ADD_P COLUMN IF_P NOT EXISTS columnDef */ #line 2496 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 34178 "gram.c" break; case 312: /* alter_table_cmd: ALTER opt_column ColId alter_column_default */ #line 2506 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ColumnDefault; n->name = (yyvsp[-1].str); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 34191 "gram.c" break; case 313: /* alter_table_cmd: ALTER opt_column ColId DROP NOT NULL_P */ #line 2516 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 34203 "gram.c" break; case 314: /* alter_table_cmd: ALTER opt_column ColId SET NOT NULL_P */ #line 2525 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 34215 "gram.c" break; case 315: /* alter_table_cmd: ALTER opt_column ColId SET EXPRESSION AS '(' a_expr ')' */ #line 2534 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetExpression; n->name = (yyvsp[-6].str); n->def = (yyvsp[-1].node); (yyval.node) = (Node *) n; } #line 34228 "gram.c" break; case 316: /* alter_table_cmd: ALTER opt_column ColId DROP EXPRESSION */ #line 2544 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = (yyvsp[-2].str); (yyval.node) = (Node *) n; } #line 34240 "gram.c" break; case 317: /* alter_table_cmd: ALTER opt_column ColId DROP EXPRESSION IF_P EXISTS */ #line 2553 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 34253 "gram.c" break; case 318: /* alter_table_cmd: ALTER opt_column ColId SET STATISTICS set_statistics_value */ #line 2563 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStatistics; n->name = (yyvsp[-3].str); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 34266 "gram.c" break; case 319: /* alter_table_cmd: ALTER opt_column Iconst SET STATISTICS set_statistics_value */ #line 2573 "gram.y" { 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 34285 "gram.c" break; case 320: /* alter_table_cmd: ALTER opt_column ColId SET reloptions */ #line 2589 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetOptions; n->name = (yyvsp[-2].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34298 "gram.c" break; case 321: /* alter_table_cmd: ALTER opt_column ColId RESET reloptions */ #line 2599 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetOptions; n->name = (yyvsp[-2].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34311 "gram.c" break; case 322: /* alter_table_cmd: ALTER opt_column ColId SET column_storage */ #line 2609 "gram.y" { 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 34324 "gram.c" break; case 323: /* alter_table_cmd: ALTER opt_column ColId SET column_compression */ #line 2619 "gram.y" { 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 34337 "gram.c" break; case 324: /* alter_table_cmd: ALTER opt_column ColId ADD_P GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList */ #line 2629 "gram.y" { 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 34357 "gram.c" break; case 325: /* alter_table_cmd: ALTER opt_column ColId alter_identity_column_option_list */ #line 2646 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetIdentity; n->name = (yyvsp[-1].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34370 "gram.c" break; case 326: /* alter_table_cmd: ALTER opt_column ColId DROP IDENTITY_P */ #line 2656 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = (yyvsp[-2].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 34383 "gram.c" break; case 327: /* alter_table_cmd: ALTER opt_column ColId DROP IDENTITY_P IF_P EXISTS */ #line 2666 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 34396 "gram.c" break; case 328: /* alter_table_cmd: DROP opt_column IF_P EXISTS ColId opt_drop_behavior */ #line 2676 "gram.y" { 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 34410 "gram.c" break; case 329: /* alter_table_cmd: DROP opt_column ColId opt_drop_behavior */ #line 2687 "gram.y" { 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 34424 "gram.c" break; case 330: /* alter_table_cmd: ALTER opt_column ColId opt_set_data TYPE_P Typename opt_collate_clause alter_using */ #line 2701 "gram.y" { 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 34443 "gram.c" break; case 331: /* alter_table_cmd: ALTER opt_column ColId alter_generic_options */ #line 2717 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AlterColumnGenericOptions; n->name = (yyvsp[-1].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34455 "gram.c" break; case 332: /* alter_table_cmd: ADD_P TableConstraint */ #line 2726 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddConstraint; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 34467 "gram.c" break; case 333: /* alter_table_cmd: ALTER CONSTRAINT name ConstraintAttributeSpec */ #line 2735 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); ATAlterConstraint *c = makeNode(ATAlterConstraint); n->subtype = AT_AlterConstraint; n->def = (Node *) c; c->conname = (yyvsp[-1].str); if ((yyvsp[0].ival) & (CAS_NOT_ENFORCED | CAS_ENFORCED)) c->alterEnforceability = true; if ((yyvsp[0].ival) & (CAS_DEFERRABLE | CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED | CAS_INITIALLY_IMMEDIATE)) c->alterDeferrability = true; if ((yyvsp[0].ival) & CAS_NO_INHERIT) c->alterInheritability = true; /* handle unsupported case with specific error message */ if ((yyvsp[0].ival) & CAS_NOT_VALID) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("constraints cannot be altered to be NOT VALID"), parser_errposition((yylsp[0])))); processCASbits((yyvsp[0].ival), (yylsp[0]), "FOREIGN KEY", &c->deferrable, &c->initdeferred, &c->is_enforced, NULL, &c->noinherit, yyscanner); (yyval.node) = (Node *) n; } #line 34501 "gram.c" break; case 334: /* alter_table_cmd: ALTER CONSTRAINT name INHERIT */ #line 2766 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); ATAlterConstraint *c = makeNode(ATAlterConstraint); n->subtype = AT_AlterConstraint; n->def = (Node *) c; c->conname = (yyvsp[-1].str); c->alterInheritability = true; c->noinherit = false; (yyval.node) = (Node *) n; } #line 34518 "gram.c" break; case 335: /* alter_table_cmd: VALIDATE CONSTRAINT name */ #line 2780 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ValidateConstraint; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34530 "gram.c" break; case 336: /* alter_table_cmd: DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior */ #line 2789 "gram.y" { 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 34544 "gram.c" break; case 337: /* alter_table_cmd: DROP CONSTRAINT name opt_drop_behavior */ #line 2800 "gram.y" { 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 34558 "gram.c" break; case 338: /* alter_table_cmd: SET WITHOUT OIDS */ #line 2811 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOids; (yyval.node) = (Node *) n; } #line 34569 "gram.c" break; case 339: /* alter_table_cmd: CLUSTER ON name */ #line 2819 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ClusterOn; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34581 "gram.c" break; case 340: /* alter_table_cmd: SET WITHOUT CLUSTER */ #line 2828 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropCluster; n->name = NULL; (yyval.node) = (Node *) n; } #line 34593 "gram.c" break; case 341: /* alter_table_cmd: SET LOGGED */ #line 2837 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetLogged; (yyval.node) = (Node *) n; } #line 34604 "gram.c" break; case 342: /* alter_table_cmd: SET UNLOGGED */ #line 2845 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetUnLogged; (yyval.node) = (Node *) n; } #line 34615 "gram.c" break; case 343: /* alter_table_cmd: ENABLE_P TRIGGER name */ #line 2853 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34627 "gram.c" break; case 344: /* alter_table_cmd: ENABLE_P ALWAYS TRIGGER name */ #line 2862 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34639 "gram.c" break; case 345: /* alter_table_cmd: ENABLE_P REPLICA TRIGGER name */ #line 2871 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34651 "gram.c" break; case 346: /* alter_table_cmd: ENABLE_P TRIGGER ALL */ #line 2880 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigAll; (yyval.node) = (Node *) n; } #line 34662 "gram.c" break; case 347: /* alter_table_cmd: ENABLE_P TRIGGER USER */ #line 2888 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigUser; (yyval.node) = (Node *) n; } #line 34673 "gram.c" break; case 348: /* alter_table_cmd: DISABLE_P TRIGGER name */ #line 2896 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34685 "gram.c" break; case 349: /* alter_table_cmd: DISABLE_P TRIGGER ALL */ #line 2905 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigAll; (yyval.node) = (Node *) n; } #line 34696 "gram.c" break; case 350: /* alter_table_cmd: DISABLE_P TRIGGER USER */ #line 2913 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigUser; (yyval.node) = (Node *) n; } #line 34707 "gram.c" break; case 351: /* alter_table_cmd: ENABLE_P RULE name */ #line 2921 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34719 "gram.c" break; case 352: /* alter_table_cmd: ENABLE_P ALWAYS RULE name */ #line 2930 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34731 "gram.c" break; case 353: /* alter_table_cmd: ENABLE_P REPLICA RULE name */ #line 2939 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34743 "gram.c" break; case 354: /* alter_table_cmd: DISABLE_P RULE name */ #line 2948 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34755 "gram.c" break; case 355: /* alter_table_cmd: INHERIT qualified_name */ #line 2957 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *) n; } #line 34767 "gram.c" break; case 356: /* alter_table_cmd: NO INHERIT qualified_name */ #line 2966 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *) n; } #line 34779 "gram.c" break; case 357: /* alter_table_cmd: OF any_name */ #line 2975 "gram.y" { 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 34793 "gram.c" break; case 358: /* alter_table_cmd: NOT OF */ #line 2986 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOf; (yyval.node) = (Node *) n; } #line 34804 "gram.c" break; case 359: /* alter_table_cmd: OWNER TO RoleSpec */ #line 2994 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 34816 "gram.c" break; case 360: /* alter_table_cmd: SET ACCESS METHOD set_access_method_name */ #line 3003 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetAccessMethod; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34828 "gram.c" break; case 361: /* alter_table_cmd: SET TABLESPACE name */ #line 3012 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetTableSpace; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34840 "gram.c" break; case 362: /* alter_table_cmd: SET reloptions */ #line 3021 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetRelOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34852 "gram.c" break; case 363: /* alter_table_cmd: RESET reloptions */ #line 3030 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetRelOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34864 "gram.c" break; case 364: /* alter_table_cmd: REPLICA IDENTITY_P replica_identity */ #line 3039 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ReplicaIdentity; n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 34876 "gram.c" break; case 365: /* alter_table_cmd: ENABLE_P ROW LEVEL SECURITY */ #line 3048 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRowSecurity; (yyval.node) = (Node *) n; } #line 34887 "gram.c" break; case 366: /* alter_table_cmd: DISABLE_P ROW LEVEL SECURITY */ #line 3056 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRowSecurity; (yyval.node) = (Node *) n; } #line 34898 "gram.c" break; case 367: /* alter_table_cmd: FORCE ROW LEVEL SECURITY */ #line 3064 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ForceRowSecurity; (yyval.node) = (Node *) n; } #line 34909 "gram.c" break; case 368: /* alter_table_cmd: NO FORCE ROW LEVEL SECURITY */ #line 3072 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_NoForceRowSecurity; (yyval.node) = (Node *) n; } #line 34920 "gram.c" break; case 369: /* alter_table_cmd: alter_generic_options */ #line 3079 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_GenericOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34932 "gram.c" break; case 370: /* alter_column_default: SET DEFAULT a_expr */ #line 3089 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 34938 "gram.c" break; case 371: /* alter_column_default: DROP DEFAULT */ #line 3090 "gram.y" { (yyval.node) = NULL; } #line 34944 "gram.c" break; case 372: /* opt_collate_clause: COLLATE any_name */ #line 3095 "gram.y" { CollateClause *n = makeNode(CollateClause); n->arg = NULL; n->collname = (yyvsp[0].list); n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34957 "gram.c" break; case 373: /* opt_collate_clause: %empty */ #line 3103 "gram.y" { (yyval.node) = NULL; } #line 34963 "gram.c" break; case 374: /* alter_using: USING a_expr */ #line 3107 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 34969 "gram.c" break; case 375: /* alter_using: %empty */ #line 3108 "gram.y" { (yyval.node) = NULL; } #line 34975 "gram.c" break; case 376: /* replica_identity: NOTHING */ #line 3113 "gram.y" { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_NOTHING; n->name = NULL; (yyval.node) = (Node *) n; } #line 34987 "gram.c" break; case 377: /* replica_identity: FULL */ #line 3121 "gram.y" { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_FULL; n->name = NULL; (yyval.node) = (Node *) n; } #line 34999 "gram.c" break; case 378: /* replica_identity: DEFAULT */ #line 3129 "gram.y" { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_DEFAULT; n->name = NULL; (yyval.node) = (Node *) n; } #line 35011 "gram.c" break; case 379: /* replica_identity: USING INDEX name */ #line 3137 "gram.y" { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_INDEX; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 35023 "gram.c" break; case 380: /* reloptions: '(' reloption_list ')' */ #line 3147 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 35029 "gram.c" break; case 381: /* opt_reloptions: WITH reloptions */ #line 3150 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 35035 "gram.c" break; case 382: /* opt_reloptions: %empty */ #line 3151 "gram.y" { (yyval.list) = NIL; } #line 35041 "gram.c" break; case 383: /* reloption_list: reloption_elem */ #line 3155 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35047 "gram.c" break; case 384: /* reloption_list: reloption_list ',' reloption_elem */ #line 3156 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 35053 "gram.c" break; case 385: /* reloption_elem: ColLabel '=' def_arg */ #line 3162 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 35061 "gram.c" break; case 386: /* reloption_elem: ColLabel */ #line 3166 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 35069 "gram.c" break; case 387: /* reloption_elem: ColLabel '.' ColLabel '=' def_arg */ #line 3170 "gram.y" { (yyval.defelt) = makeDefElemExtended((yyvsp[-4].str), (yyvsp[-2].str), (Node *) (yyvsp[0].node), DEFELEM_UNSPEC, (yylsp[-4])); } #line 35078 "gram.c" break; case 388: /* reloption_elem: ColLabel '.' ColLabel */ #line 3175 "gram.y" { (yyval.defelt) = makeDefElemExtended((yyvsp[-2].str), (yyvsp[0].str), NULL, DEFELEM_UNSPEC, (yylsp[-2])); } #line 35086 "gram.c" break; case 389: /* alter_identity_column_option_list: alter_identity_column_option */ #line 3182 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35092 "gram.c" break; case 390: /* alter_identity_column_option_list: alter_identity_column_option_list alter_identity_column_option */ #line 3184 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 35098 "gram.c" break; case 391: /* alter_identity_column_option: RESTART */ #line 3189 "gram.y" { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 35106 "gram.c" break; case 392: /* alter_identity_column_option: RESTART opt_with NumericOnly */ #line 3193 "gram.y" { (yyval.defelt) = makeDefElem("restart", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 35114 "gram.c" break; case 393: /* alter_identity_column_option: SET SeqOptElem */ #line 3197 "gram.y" { 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 35129 "gram.c" break; case 394: /* alter_identity_column_option: SET GENERATED generated_when */ #line 3208 "gram.y" { (yyval.defelt) = makeDefElem("generated", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 35137 "gram.c" break; case 395: /* set_statistics_value: SignedIconst */ #line 3214 "gram.y" { (yyval.node) = (Node *) makeInteger((yyvsp[0].ival)); } #line 35143 "gram.c" break; case 396: /* set_statistics_value: DEFAULT */ #line 3215 "gram.y" { (yyval.node) = NULL; } #line 35149 "gram.c" break; case 397: /* set_access_method_name: ColId */ #line 3219 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 35155 "gram.c" break; case 398: /* set_access_method_name: DEFAULT */ #line 3220 "gram.y" { (yyval.str) = NULL; } #line 35161 "gram.c" break; case 399: /* PartitionBoundSpec: FOR VALUES WITH '(' hash_partbound ')' */ #line 3226 "gram.y" { 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"), parser_errposition((yylsp[-3])))); if (n->remainder == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("remainder for hash partition must be specified"), parser_errposition((yylsp[-3])))); n->location = (yylsp[-3]); (yyval.partboundspec) = n; } #line 35218 "gram.c" break; case 400: /* PartitionBoundSpec: FOR VALUES IN_P '(' expr_list ')' */ #line 3281 "gram.y" { 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 35233 "gram.c" break; case 401: /* PartitionBoundSpec: FOR VALUES FROM '(' expr_list ')' TO '(' expr_list ')' */ #line 3294 "gram.y" { 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 35249 "gram.c" break; case 402: /* PartitionBoundSpec: DEFAULT */ #line 3308 "gram.y" { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->is_default = true; n->location = (yylsp[0]); (yyval.partboundspec) = n; } #line 35262 "gram.c" break; case 403: /* hash_partbound_elem: NonReservedWord Iconst */ #line 3320 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 35270 "gram.c" break; case 404: /* hash_partbound: hash_partbound_elem */ #line 3327 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35278 "gram.c" break; case 405: /* hash_partbound: hash_partbound ',' hash_partbound_elem */ #line 3331 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 35286 "gram.c" break; case 406: /* AlterCompositeTypeStmt: ALTER TYPE_P any_name alter_type_cmds */ #line 3345 "gram.y" { 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 35300 "gram.c" break; case 407: /* alter_type_cmds: alter_type_cmd */ #line 3357 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 35306 "gram.c" break; case 408: /* alter_type_cmds: alter_type_cmds ',' alter_type_cmd */ #line 3358 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 35312 "gram.c" break; case 409: /* alter_type_cmd: ADD_P ATTRIBUTE TableFuncElement opt_drop_behavior */ #line 3364 "gram.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[-1].node); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 35325 "gram.c" break; case 410: /* alter_type_cmd: DROP ATTRIBUTE IF_P EXISTS ColId opt_drop_behavior */ #line 3374 "gram.y" { 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 35339 "gram.c" break; case 411: /* alter_type_cmd: DROP ATTRIBUTE ColId opt_drop_behavior */ #line 3385 "gram.y" { 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 35353 "gram.c" break; case 412: /* alter_type_cmd: ALTER ATTRIBUTE ColId opt_set_data TYPE_P Typename opt_collate_clause opt_drop_behavior */ #line 3396 "gram.y" { 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 35373 "gram.c" break; case 413: /* ClosePortalStmt: CLOSE cursor_name */ #line 3423 "gram.y" { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 35384 "gram.c" break; case 414: /* ClosePortalStmt: CLOSE ALL */ #line 3430 "gram.y" { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = NULL; (yyval.node) = (Node *) n; } #line 35395 "gram.c" break; case 415: /* CopyStmt: COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause */ #line 3466 "gram.y" { 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 35433 "gram.c" break; case 416: /* CopyStmt: COPY '(' PreparableStmt ')' TO opt_program copy_file_name opt_with copy_options */ #line 3500 "gram.y" { 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 35457 "gram.c" break; case 417: /* copy_from: FROM */ #line 3522 "gram.y" { (yyval.boolean) = true; } #line 35463 "gram.c" break; case 418: /* copy_from: TO */ #line 3523 "gram.y" { (yyval.boolean) = false; } #line 35469 "gram.c" break; case 419: /* opt_program: PROGRAM */ #line 3527 "gram.y" { (yyval.boolean) = true; } #line 35475 "gram.c" break; case 420: /* opt_program: %empty */ #line 3528 "gram.y" { (yyval.boolean) = false; } #line 35481 "gram.c" break; case 421: /* copy_file_name: Sconst */ #line 3537 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 35487 "gram.c" break; case 422: /* copy_file_name: STDIN */ #line 3538 "gram.y" { (yyval.str) = NULL; } #line 35493 "gram.c" break; case 423: /* copy_file_name: STDOUT */ #line 3539 "gram.y" { (yyval.str) = NULL; } #line 35499 "gram.c" break; case 424: /* copy_options: copy_opt_list */ #line 3542 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 35505 "gram.c" break; case 425: /* copy_options: '(' copy_generic_opt_list ')' */ #line 3543 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 35511 "gram.c" break; case 426: /* copy_opt_list: copy_opt_list copy_opt_item */ #line 3548 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 35517 "gram.c" break; case 427: /* copy_opt_list: %empty */ #line 3549 "gram.y" { (yyval.list) = NIL; } #line 35523 "gram.c" break; case 428: /* copy_opt_item: BINARY */ #line 3554 "gram.y" { (yyval.defelt) = makeDefElem("format", (Node *) makeString("binary"), (yylsp[0])); } #line 35531 "gram.c" break; case 429: /* copy_opt_item: FREEZE */ #line 3558 "gram.y" { (yyval.defelt) = makeDefElem("freeze", (Node *) makeBoolean(true), (yylsp[0])); } #line 35539 "gram.c" break; case 430: /* copy_opt_item: DELIMITER opt_as Sconst */ #line 3562 "gram.y" { (yyval.defelt) = makeDefElem("delimiter", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 35547 "gram.c" break; case 431: /* copy_opt_item: NULL_P opt_as Sconst */ #line 3566 "gram.y" { (yyval.defelt) = makeDefElem("null", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 35555 "gram.c" break; case 432: /* copy_opt_item: CSV */ #line 3570 "gram.y" { (yyval.defelt) = makeDefElem("format", (Node *) makeString("csv"), (yylsp[0])); } #line 35563 "gram.c" break; case 433: /* copy_opt_item: HEADER_P */ #line 3574 "gram.y" { (yyval.defelt) = makeDefElem("header", (Node *) makeBoolean(true), (yylsp[0])); } #line 35571 "gram.c" break; case 434: /* copy_opt_item: QUOTE opt_as Sconst */ #line 3578 "gram.y" { (yyval.defelt) = makeDefElem("quote", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 35579 "gram.c" break; case 435: /* copy_opt_item: ESCAPE opt_as Sconst */ #line 3582 "gram.y" { (yyval.defelt) = makeDefElem("escape", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 35587 "gram.c" break; case 436: /* copy_opt_item: FORCE QUOTE columnList */ #line 3586 "gram.y" { (yyval.defelt) = makeDefElem("force_quote", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 35595 "gram.c" break; case 437: /* copy_opt_item: FORCE QUOTE '*' */ #line 3590 "gram.y" { (yyval.defelt) = makeDefElem("force_quote", (Node *) makeNode(A_Star), (yylsp[-2])); } #line 35603 "gram.c" break; case 438: /* copy_opt_item: FORCE NOT NULL_P columnList */ #line 3594 "gram.y" { (yyval.defelt) = makeDefElem("force_not_null", (Node *) (yyvsp[0].list), (yylsp[-3])); } #line 35611 "gram.c" break; case 439: /* copy_opt_item: FORCE NOT NULL_P '*' */ #line 3598 "gram.y" { (yyval.defelt) = makeDefElem("force_not_null", (Node *) makeNode(A_Star), (yylsp[-3])); } #line 35619 "gram.c" break; case 440: /* copy_opt_item: FORCE NULL_P columnList */ #line 3602 "gram.y" { (yyval.defelt) = makeDefElem("force_null", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 35627 "gram.c" break; case 441: /* copy_opt_item: FORCE NULL_P '*' */ #line 3606 "gram.y" { (yyval.defelt) = makeDefElem("force_null", (Node *) makeNode(A_Star), (yylsp[-2])); } #line 35635 "gram.c" break; case 442: /* copy_opt_item: ENCODING Sconst */ #line 3610 "gram.y" { (yyval.defelt) = makeDefElem("encoding", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 35643 "gram.c" break; case 443: /* opt_binary: BINARY */ #line 3619 "gram.y" { (yyval.defelt) = makeDefElem("format", (Node *) makeString("binary"), (yylsp[0])); } #line 35651 "gram.c" break; case 444: /* opt_binary: %empty */ #line 3622 "gram.y" { (yyval.defelt) = NULL; } #line 35657 "gram.c" break; case 445: /* copy_delimiter: opt_using DELIMITERS Sconst */ #line 3627 "gram.y" { (yyval.defelt) = makeDefElem("delimiter", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 35665 "gram.c" break; case 446: /* copy_delimiter: %empty */ #line 3630 "gram.y" { (yyval.defelt) = NULL; } #line 35671 "gram.c" break; case 449: /* copy_generic_opt_list: copy_generic_opt_elem */ #line 3641 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35679 "gram.c" break; case 450: /* copy_generic_opt_list: copy_generic_opt_list ',' copy_generic_opt_elem */ #line 3645 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 35687 "gram.c" break; case 451: /* copy_generic_opt_elem: ColLabel copy_generic_opt_arg */ #line 3652 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 35695 "gram.c" break; case 452: /* copy_generic_opt_arg: opt_boolean_or_string */ #line 3658 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 35701 "gram.c" break; case 453: /* copy_generic_opt_arg: NumericOnly */ #line 3659 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].node); } #line 35707 "gram.c" break; case 454: /* copy_generic_opt_arg: '*' */ #line 3660 "gram.y" { (yyval.node) = (Node *) makeNode(A_Star); } #line 35713 "gram.c" break; case 455: /* copy_generic_opt_arg: DEFAULT */ #line 3661 "gram.y" { (yyval.node) = (Node *) makeString("default"); } #line 35719 "gram.c" break; case 456: /* copy_generic_opt_arg: '(' copy_generic_opt_arg_list ')' */ #line 3662 "gram.y" { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 35725 "gram.c" break; case 457: /* copy_generic_opt_arg: %empty */ #line 3663 "gram.y" { (yyval.node) = NULL; } #line 35731 "gram.c" break; case 458: /* copy_generic_opt_arg_list: copy_generic_opt_arg_list_item */ #line 3668 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 35739 "gram.c" break; case 459: /* copy_generic_opt_arg_list: copy_generic_opt_arg_list ',' copy_generic_opt_arg_list_item */ #line 3672 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 35747 "gram.c" break; case 460: /* copy_generic_opt_arg_list_item: opt_boolean_or_string */ #line 3679 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 35753 "gram.c" break; case 461: /* CreateStmt: CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3693 "gram.y" { 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 35775 "gram.c" break; case 462: /* CreateStmt: CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3713 "gram.y" { 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 35797 "gram.c" break; case 463: /* CreateStmt: CREATE OptTemp TABLE qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3733 "gram.y" { 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 35820 "gram.c" break; case 464: /* CreateStmt: CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3754 "gram.y" { 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 35843 "gram.c" break; case 465: /* CreateStmt: CREATE OptTemp TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3775 "gram.y" { 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 35866 "gram.c" break; case 466: /* CreateStmt: CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3796 "gram.y" { 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 35889 "gram.c" break; case 467: /* OptTemp: TEMPORARY */ #line 3827 "gram.y" { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 35895 "gram.c" break; case 468: /* OptTemp: TEMP */ #line 3828 "gram.y" { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 35901 "gram.c" break; case 469: /* OptTemp: LOCAL TEMPORARY */ #line 3829 "gram.y" { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 35907 "gram.c" break; case 470: /* OptTemp: LOCAL TEMP */ #line 3830 "gram.y" { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 35913 "gram.c" break; case 471: /* OptTemp: GLOBAL TEMPORARY */ #line 3832 "gram.y" { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 35924 "gram.c" break; case 472: /* OptTemp: GLOBAL TEMP */ #line 3839 "gram.y" { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 35935 "gram.c" break; case 473: /* OptTemp: UNLOGGED */ #line 3845 "gram.y" { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 35941 "gram.c" break; case 474: /* OptTemp: %empty */ #line 3846 "gram.y" { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 35947 "gram.c" break; case 475: /* OptTableElementList: TableElementList */ #line 3850 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 35953 "gram.c" break; case 476: /* OptTableElementList: %empty */ #line 3851 "gram.y" { (yyval.list) = NIL; } #line 35959 "gram.c" break; case 477: /* OptTypedTableElementList: '(' TypedTableElementList ')' */ #line 3855 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 35965 "gram.c" break; case 478: /* OptTypedTableElementList: %empty */ #line 3856 "gram.y" { (yyval.list) = NIL; } #line 35971 "gram.c" break; case 479: /* TableElementList: TableElement */ #line 3861 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 35979 "gram.c" break; case 480: /* TableElementList: TableElementList ',' TableElement */ #line 3865 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 35987 "gram.c" break; case 481: /* TypedTableElementList: TypedTableElement */ #line 3872 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 35995 "gram.c" break; case 482: /* TypedTableElementList: TypedTableElementList ',' TypedTableElement */ #line 3876 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36003 "gram.c" break; case 483: /* TableElement: columnDef */ #line 3882 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36009 "gram.c" break; case 484: /* TableElement: TableLikeClause */ #line 3883 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36015 "gram.c" break; case 485: /* TableElement: TableConstraint */ #line 3884 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36021 "gram.c" break; case 486: /* TypedTableElement: columnOptions */ #line 3888 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36027 "gram.c" break; case 487: /* TypedTableElement: TableConstraint */ #line 3889 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36033 "gram.c" break; case 488: /* columnDef: ColId Typename opt_column_storage opt_column_compression create_generic_options ColQualList */ #line 3893 "gram.y" { 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 36059 "gram.c" break; case 489: /* columnOptions: ColId ColQualList */ #line 3917 "gram.y" { 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 36082 "gram.c" break; case 490: /* columnOptions: ColId WITH OPTIONS ColQualList */ #line 3936 "gram.y" { 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 36105 "gram.c" break; case 491: /* column_compression: COMPRESSION ColId */ #line 3957 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 36111 "gram.c" break; case 492: /* column_compression: COMPRESSION DEFAULT */ #line 3958 "gram.y" { (yyval.str) = pstrdup("default"); } #line 36117 "gram.c" break; case 493: /* opt_column_compression: column_compression */ #line 3962 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 36123 "gram.c" break; case 494: /* opt_column_compression: %empty */ #line 3963 "gram.y" { (yyval.str) = NULL; } #line 36129 "gram.c" break; case 495: /* column_storage: STORAGE ColId */ #line 3967 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 36135 "gram.c" break; case 496: /* column_storage: STORAGE DEFAULT */ #line 3968 "gram.y" { (yyval.str) = pstrdup("default"); } #line 36141 "gram.c" break; case 497: /* opt_column_storage: column_storage */ #line 3972 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 36147 "gram.c" break; case 498: /* opt_column_storage: %empty */ #line 3973 "gram.y" { (yyval.str) = NULL; } #line 36153 "gram.c" break; case 499: /* ColQualList: ColQualList ColConstraint */ #line 3977 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 36159 "gram.c" break; case 500: /* ColQualList: %empty */ #line 3978 "gram.y" { (yyval.list) = NIL; } #line 36165 "gram.c" break; case 501: /* ColConstraint: CONSTRAINT name ColConstraintElem */ #line 3983 "gram.y" { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 36177 "gram.c" break; case 502: /* ColConstraint: ColConstraintElem */ #line 3990 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36183 "gram.c" break; case 503: /* ColConstraint: ConstraintAttr */ #line 3991 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36189 "gram.c" break; case 504: /* ColConstraint: COLLATE any_name */ #line 3993 "gram.y" { /* * 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 36207 "gram.c" break; case 505: /* ColConstraintElem: NOT NULL_P opt_no_inherit */ #line 4025 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-2]); n->is_no_inherit = (yyvsp[0].boolean); n->is_enforced = true; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *) n; } #line 36223 "gram.c" break; case 506: /* ColConstraintElem: NULL_P */ #line 4037 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 36235 "gram.c" break; case 507: /* ColConstraintElem: UNIQUE opt_unique_null_treatment opt_definition OptConsTableSpace */ #line 4045 "gram.y" { 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 36252 "gram.c" break; case 508: /* ColConstraintElem: PRIMARY KEY opt_definition OptConsTableSpace */ #line 4058 "gram.y" { 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 36268 "gram.c" break; case 509: /* ColConstraintElem: CHECK '(' a_expr ')' opt_no_inherit */ #line 4070 "gram.y" { 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->is_enforced = true; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *) n; } #line 36286 "gram.c" break; case 510: /* ColConstraintElem: DEFAULT b_expr */ #line 4084 "gram.y" { 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 36302 "gram.c" break; case 511: /* ColConstraintElem: GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList */ #line 4096 "gram.y" { 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 36316 "gram.c" break; case 512: /* ColConstraintElem: GENERATED generated_when AS '(' a_expr ')' opt_virtual_or_stored */ #line 4106 "gram.y" { 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->generated_kind = (yyvsp[0].ival); 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 36345 "gram.c" break; case 513: /* ColConstraintElem: REFERENCES qualified_name opt_column_list key_match key_actions */ #line 4131 "gram.y" { 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->is_enforced = true; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *) n; } #line 36367 "gram.c" break; case 514: /* opt_unique_null_treatment: NULLS_P DISTINCT */ #line 4151 "gram.y" { (yyval.boolean) = true; } #line 36373 "gram.c" break; case 515: /* opt_unique_null_treatment: NULLS_P NOT DISTINCT */ #line 4152 "gram.y" { (yyval.boolean) = false; } #line 36379 "gram.c" break; case 516: /* opt_unique_null_treatment: %empty */ #line 4153 "gram.y" { (yyval.boolean) = true; } #line 36385 "gram.c" break; case 517: /* generated_when: ALWAYS */ #line 4157 "gram.y" { (yyval.ival) = ATTRIBUTE_IDENTITY_ALWAYS; } #line 36391 "gram.c" break; case 518: /* generated_when: BY DEFAULT */ #line 4158 "gram.y" { (yyval.ival) = ATTRIBUTE_IDENTITY_BY_DEFAULT; } #line 36397 "gram.c" break; case 519: /* opt_virtual_or_stored: STORED */ #line 4162 "gram.y" { (yyval.ival) = ATTRIBUTE_GENERATED_STORED; } #line 36403 "gram.c" break; case 520: /* opt_virtual_or_stored: VIRTUAL */ #line 4163 "gram.y" { (yyval.ival) = ATTRIBUTE_GENERATED_VIRTUAL; } #line 36409 "gram.c" break; case 521: /* opt_virtual_or_stored: %empty */ #line 4164 "gram.y" { (yyval.ival) = ATTRIBUTE_GENERATED_VIRTUAL; } #line 36415 "gram.c" break; case 522: /* ConstraintAttr: DEFERRABLE */ #line 4184 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRABLE; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 36427 "gram.c" break; case 523: /* ConstraintAttr: NOT DEFERRABLE */ #line 4192 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_DEFERRABLE; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 36439 "gram.c" break; case 524: /* ConstraintAttr: INITIALLY DEFERRED */ #line 4200 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRED; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 36451 "gram.c" break; case 525: /* ConstraintAttr: INITIALLY IMMEDIATE */ #line 4208 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_IMMEDIATE; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 36463 "gram.c" break; case 526: /* ConstraintAttr: ENFORCED */ #line 4216 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_ENFORCED; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 36475 "gram.c" break; case 527: /* ConstraintAttr: NOT ENFORCED */ #line 4224 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_ENFORCED; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 36487 "gram.c" break; case 528: /* TableLikeClause: LIKE qualified_name TableLikeOptionList */ #line 4236 "gram.y" { TableLikeClause *n = makeNode(TableLikeClause); n->relation = (yyvsp[-1].range); n->options = (yyvsp[0].ival); n->relationOid = InvalidOid; (yyval.node) = (Node *) n; } #line 36500 "gram.c" break; case 529: /* TableLikeOptionList: TableLikeOptionList INCLUDING TableLikeOption */ #line 4247 "gram.y" { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 36506 "gram.c" break; case 530: /* TableLikeOptionList: TableLikeOptionList EXCLUDING TableLikeOption */ #line 4248 "gram.y" { (yyval.ival) = (yyvsp[-2].ival) & ~(yyvsp[0].ival); } #line 36512 "gram.c" break; case 531: /* TableLikeOptionList: %empty */ #line 4249 "gram.y" { (yyval.ival) = 0; } #line 36518 "gram.c" break; case 532: /* TableLikeOption: COMMENTS */ #line 4253 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_COMMENTS; } #line 36524 "gram.c" break; case 533: /* TableLikeOption: COMPRESSION */ #line 4254 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_COMPRESSION; } #line 36530 "gram.c" break; case 534: /* TableLikeOption: CONSTRAINTS */ #line 4255 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_CONSTRAINTS; } #line 36536 "gram.c" break; case 535: /* TableLikeOption: DEFAULTS */ #line 4256 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_DEFAULTS; } #line 36542 "gram.c" break; case 536: /* TableLikeOption: IDENTITY_P */ #line 4257 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_IDENTITY; } #line 36548 "gram.c" break; case 537: /* TableLikeOption: GENERATED */ #line 4258 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_GENERATED; } #line 36554 "gram.c" break; case 538: /* TableLikeOption: INDEXES */ #line 4259 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_INDEXES; } #line 36560 "gram.c" break; case 539: /* TableLikeOption: STATISTICS */ #line 4260 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_STATISTICS; } #line 36566 "gram.c" break; case 540: /* TableLikeOption: STORAGE */ #line 4261 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_STORAGE; } #line 36572 "gram.c" break; case 541: /* TableLikeOption: ALL */ #line 4262 "gram.y" { (yyval.ival) = CREATE_TABLE_LIKE_ALL; } #line 36578 "gram.c" break; case 542: /* TableConstraint: CONSTRAINT name ConstraintElem */ #line 4272 "gram.y" { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 36590 "gram.c" break; case 543: /* TableConstraint: ConstraintElem */ #line 4279 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36596 "gram.c" break; case 544: /* ConstraintElem: CHECK '(' a_expr ')' ConstraintAttributeSpec */ #line 4284 "gram.y" { 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->is_enforced, &n->skip_validation, &n->is_no_inherit, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (Node *) n; } #line 36614 "gram.c" break; case 545: /* ConstraintElem: NOT NULL_P ColId ConstraintAttributeSpec */ #line 4298 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-3]); n->keys = list_make1(makeString((yyvsp[-1].str))); processCASbits((yyvsp[0].ival), (yylsp[0]), "NOT NULL", NULL, NULL, NULL, &n->skip_validation, &n->is_no_inherit, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (Node *) n; } #line 36631 "gram.c" break; case 546: /* ConstraintElem: UNIQUE opt_unique_null_treatment '(' columnList opt_without_overlaps ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec */ #line 4312 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-9]); n->nulls_not_distinct = !(yyvsp[-8].boolean); n->keys = (yyvsp[-6].list); n->without_overlaps = (yyvsp[-5].boolean); 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36653 "gram.c" break; case 547: /* ConstraintElem: UNIQUE ExistingIndex ConstraintAttributeSpec */ #line 4330 "gram.y" { 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36673 "gram.c" break; case 548: /* ConstraintElem: PRIMARY KEY '(' columnList opt_without_overlaps ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec */ #line 4347 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-9]); n->keys = (yyvsp[-6].list); n->without_overlaps = (yyvsp[-5].boolean); 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36694 "gram.c" break; case 549: /* ConstraintElem: PRIMARY KEY ExistingIndex ConstraintAttributeSpec */ #line 4364 "gram.y" { 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36714 "gram.c" break; case 550: /* ConstraintElem: EXCLUDE access_method_clause '(' ExclusionConstraintList ')' opt_c_include opt_definition OptConsTableSpace OptWhereClause ConstraintAttributeSpec */ #line 4382 "gram.y" { 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36736 "gram.c" break; case 551: /* ConstraintElem: FOREIGN KEY '(' columnList optionalPeriodName ')' REFERENCES qualified_name opt_column_and_period_list key_match key_actions ConstraintAttributeSpec */ #line 4401 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_FOREIGN; n->location = (yylsp[-11]); n->pktable = (yyvsp[-4].range); n->fk_attrs = (yyvsp[-8].list); if ((yyvsp[-7].node)) { n->fk_attrs = lappend(n->fk_attrs, (yyvsp[-7].node)); n->fk_with_period = true; } n->pk_attrs = linitial((yyvsp[-3].list)); if (lsecond((yyvsp[-3].list))) { n->pk_attrs = lappend(n->pk_attrs, lsecond((yyvsp[-3].list))); n->pk_with_period = true; } 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->is_enforced, &n->skip_validation, NULL, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (Node *) n; } #line 36770 "gram.c" break; case 552: /* DomainConstraint: CONSTRAINT name DomainConstraintElem */ #line 4445 "gram.y" { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 36782 "gram.c" break; case 553: /* DomainConstraint: DomainConstraintElem */ #line 4452 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36788 "gram.c" break; case 554: /* DomainConstraintElem: CHECK '(' a_expr ')' ConstraintAttributeSpec */ #line 4457 "gram.y" { 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, NULL, &n->skip_validation, &n->is_no_inherit, yyscanner); n->is_enforced = true; n->initially_valid = !n->skip_validation; (yyval.node) = (Node *) n; } #line 36807 "gram.c" break; case 555: /* DomainConstraintElem: NOT NULL_P ConstraintAttributeSpec */ #line 4472 "gram.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-2]); n->keys = list_make1(makeString("value")); /* no NOT VALID, NO INHERIT support */ processCASbits((yyvsp[0].ival), (yylsp[0]), "NOT NULL", NULL, NULL, NULL, NULL, NULL, yyscanner); n->initially_valid = true; (yyval.node) = (Node *) n; } #line 36825 "gram.c" break; case 556: /* opt_no_inherit: NO INHERIT */ #line 4487 "gram.y" { (yyval.boolean) = true; } #line 36831 "gram.c" break; case 557: /* opt_no_inherit: %empty */ #line 4488 "gram.y" { (yyval.boolean) = false; } #line 36837 "gram.c" break; case 558: /* opt_without_overlaps: WITHOUT OVERLAPS */ #line 4492 "gram.y" { (yyval.boolean) = true; } #line 36843 "gram.c" break; case 559: /* opt_without_overlaps: %empty */ #line 4493 "gram.y" { (yyval.boolean) = false; } #line 36849 "gram.c" break; case 560: /* opt_column_list: '(' columnList ')' */ #line 4497 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 36855 "gram.c" break; case 561: /* opt_column_list: %empty */ #line 4498 "gram.y" { (yyval.list) = NIL; } #line 36861 "gram.c" break; case 562: /* columnList: columnElem */ #line 4502 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 36867 "gram.c" break; case 563: /* columnList: columnList ',' columnElem */ #line 4503 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36873 "gram.c" break; case 564: /* optionalPeriodName: ',' PERIOD columnElem */ #line 4507 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 36879 "gram.c" break; case 565: /* optionalPeriodName: %empty */ #line 4508 "gram.y" { (yyval.node) = NULL; } #line 36885 "gram.c" break; case 566: /* opt_column_and_period_list: '(' columnList optionalPeriodName ')' */ #line 4512 "gram.y" { (yyval.list) = list_make2((yyvsp[-2].list), (yyvsp[-1].node)); } #line 36891 "gram.c" break; case 567: /* opt_column_and_period_list: %empty */ #line 4513 "gram.y" { (yyval.list) = list_make2(NIL, NULL); } #line 36897 "gram.c" break; case 568: /* columnElem: ColId */ #line 4517 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 36905 "gram.c" break; case 569: /* opt_c_include: INCLUDE '(' columnList ')' */ #line 4522 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 36911 "gram.c" break; case 570: /* opt_c_include: %empty */ #line 4523 "gram.y" { (yyval.list) = NIL; } #line 36917 "gram.c" break; case 571: /* key_match: MATCH FULL */ #line 4527 "gram.y" { (yyval.ival) = FKCONSTR_MATCH_FULL; } #line 36925 "gram.c" break; case 572: /* key_match: MATCH PARTIAL */ #line 4531 "gram.y" { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("MATCH PARTIAL not yet implemented"), parser_errposition((yylsp[-1])))); (yyval.ival) = FKCONSTR_MATCH_PARTIAL; } #line 36937 "gram.c" break; case 573: /* key_match: MATCH SIMPLE */ #line 4539 "gram.y" { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 36945 "gram.c" break; case 574: /* key_match: %empty */ #line 4543 "gram.y" { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 36953 "gram.c" break; case 575: /* ExclusionConstraintList: ExclusionConstraintElem */ #line 4549 "gram.y" { (yyval.list) = list_make1((yyvsp[0].list)); } #line 36959 "gram.c" break; case 576: /* ExclusionConstraintList: ExclusionConstraintList ',' ExclusionConstraintElem */ #line 4551 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 36965 "gram.c" break; case 577: /* ExclusionConstraintElem: index_elem WITH any_operator */ #line 4555 "gram.y" { (yyval.list) = list_make2((yyvsp[-2].ielem), (yyvsp[0].list)); } #line 36973 "gram.c" break; case 578: /* ExclusionConstraintElem: index_elem WITH OPERATOR '(' any_operator ')' */ #line 4560 "gram.y" { (yyval.list) = list_make2((yyvsp[-5].ielem), (yyvsp[-1].list)); } #line 36981 "gram.c" break; case 579: /* OptWhereClause: WHERE '(' a_expr ')' */ #line 4566 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 36987 "gram.c" break; case 580: /* OptWhereClause: %empty */ #line 4567 "gram.y" { (yyval.node) = NULL; } #line 36993 "gram.c" break; case 581: /* key_actions: key_update */ #line 4572 "gram.y" { 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 37007 "gram.c" break; case 582: /* key_actions: key_delete */ #line 4582 "gram.y" { 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 37021 "gram.c" break; case 583: /* key_actions: key_update key_delete */ #line 4592 "gram.y" { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[-1].keyaction); n->deleteAction = (yyvsp[0].keyaction); (yyval.keyactions) = n; } #line 37033 "gram.c" break; case 584: /* key_actions: key_delete key_update */ #line 4600 "gram.y" { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[0].keyaction); n->deleteAction = (yyvsp[-1].keyaction); (yyval.keyactions) = n; } #line 37045 "gram.c" break; case 585: /* key_actions: %empty */ #line 4608 "gram.y" { 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 37061 "gram.c" break; case 586: /* key_update: ON UPDATE key_action */ #line 4622 "gram.y" { 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 37075 "gram.c" break; case 587: /* key_delete: ON DELETE_P key_action */ #line 4634 "gram.y" { (yyval.keyaction) = (yyvsp[0].keyaction); } #line 37083 "gram.c" break; case 588: /* key_action: NO ACTION */ #line 4641 "gram.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_NOACTION; n->cols = NIL; (yyval.keyaction) = n; } #line 37095 "gram.c" break; case 589: /* key_action: RESTRICT */ #line 4649 "gram.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_RESTRICT; n->cols = NIL; (yyval.keyaction) = n; } #line 37107 "gram.c" break; case 590: /* key_action: CASCADE */ #line 4657 "gram.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_CASCADE; n->cols = NIL; (yyval.keyaction) = n; } #line 37119 "gram.c" break; case 591: /* key_action: SET NULL_P opt_column_list */ #line 4665 "gram.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETNULL; n->cols = (yyvsp[0].list); (yyval.keyaction) = n; } #line 37131 "gram.c" break; case 592: /* key_action: SET DEFAULT opt_column_list */ #line 4673 "gram.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETDEFAULT; n->cols = (yyvsp[0].list); (yyval.keyaction) = n; } #line 37143 "gram.c" break; case 593: /* OptInherit: INHERITS '(' qualified_name_list ')' */ #line 4682 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 37149 "gram.c" break; case 594: /* OptInherit: %empty */ #line 4683 "gram.y" { (yyval.list) = NIL; } #line 37155 "gram.c" break; case 595: /* OptPartitionSpec: PartitionSpec */ #line 4687 "gram.y" { (yyval.partspec) = (yyvsp[0].partspec); } #line 37161 "gram.c" break; case 596: /* OptPartitionSpec: %empty */ #line 4688 "gram.y" { (yyval.partspec) = NULL; } #line 37167 "gram.c" break; case 597: /* PartitionSpec: PARTITION BY ColId '(' part_params ')' */ #line 4692 "gram.y" { PartitionSpec *n = makeNode(PartitionSpec); n->strategy = parsePartitionStrategy((yyvsp[-3].str), (yylsp[-3]), yyscanner); n->partParams = (yyvsp[-1].list); n->location = (yylsp[-5]); (yyval.partspec) = n; } #line 37181 "gram.c" break; case 598: /* part_params: part_elem */ #line 4703 "gram.y" { (yyval.list) = list_make1((yyvsp[0].partelem)); } #line 37187 "gram.c" break; case 599: /* part_params: part_params ',' part_elem */ #line 4704 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].partelem)); } #line 37193 "gram.c" break; case 600: /* part_elem: ColId opt_collate opt_qualified_name */ #line 4708 "gram.y" { 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 37208 "gram.c" break; case 601: /* part_elem: func_expr_windowless opt_collate opt_qualified_name */ #line 4719 "gram.y" { 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 37223 "gram.c" break; case 602: /* part_elem: '(' a_expr ')' opt_collate opt_qualified_name */ #line 4730 "gram.y" { 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 37238 "gram.c" break; case 603: /* table_access_method_clause: USING name */ #line 4743 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 37244 "gram.c" break; case 604: /* table_access_method_clause: %empty */ #line 4744 "gram.y" { (yyval.str) = NULL; } #line 37250 "gram.c" break; case 605: /* OptWith: WITH reloptions */ #line 4749 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 37256 "gram.c" break; case 606: /* OptWith: WITHOUT OIDS */ #line 4750 "gram.y" { (yyval.list) = NIL; } #line 37262 "gram.c" break; case 607: /* OptWith: %empty */ #line 4751 "gram.y" { (yyval.list) = NIL; } #line 37268 "gram.c" break; case 608: /* OnCommitOption: ON COMMIT DROP */ #line 4754 "gram.y" { (yyval.oncommit) = ONCOMMIT_DROP; } #line 37274 "gram.c" break; case 609: /* OnCommitOption: ON COMMIT DELETE_P ROWS */ #line 4755 "gram.y" { (yyval.oncommit) = ONCOMMIT_DELETE_ROWS; } #line 37280 "gram.c" break; case 610: /* OnCommitOption: ON COMMIT PRESERVE ROWS */ #line 4756 "gram.y" { (yyval.oncommit) = ONCOMMIT_PRESERVE_ROWS; } #line 37286 "gram.c" break; case 611: /* OnCommitOption: %empty */ #line 4757 "gram.y" { (yyval.oncommit) = ONCOMMIT_NOOP; } #line 37292 "gram.c" break; case 612: /* OptTableSpace: TABLESPACE name */ #line 4760 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 37298 "gram.c" break; case 613: /* OptTableSpace: %empty */ #line 4761 "gram.y" { (yyval.str) = NULL; } #line 37304 "gram.c" break; case 614: /* OptConsTableSpace: USING INDEX TABLESPACE name */ #line 4764 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 37310 "gram.c" break; case 615: /* OptConsTableSpace: %empty */ #line 4765 "gram.y" { (yyval.str) = NULL; } #line 37316 "gram.c" break; case 616: /* ExistingIndex: USING INDEX name */ #line 4768 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 37322 "gram.c" break; case 617: /* CreateStatsStmt: CREATE STATISTICS opt_qualified_name opt_name_list ON stats_params FROM from_list */ #line 4790 "gram.y" { 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 37338 "gram.c" break; case 618: /* CreateStatsStmt: CREATE STATISTICS IF_P NOT EXISTS any_name opt_name_list ON stats_params FROM from_list */ #line 4803 "gram.y" { 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 37354 "gram.c" break; case 619: /* stats_params: stats_param */ #line 4823 "gram.y" { (yyval.list) = list_make1((yyvsp[0].selem)); } #line 37360 "gram.c" break; case 620: /* stats_params: stats_params ',' stats_param */ #line 4824 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].selem)); } #line 37366 "gram.c" break; case 621: /* stats_param: ColId */ #line 4828 "gram.y" { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = (yyvsp[0].str); (yyval.selem)->expr = NULL; } #line 37376 "gram.c" break; case 622: /* stats_param: func_expr_windowless */ #line 4834 "gram.y" { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = NULL; (yyval.selem)->expr = (yyvsp[0].node); } #line 37386 "gram.c" break; case 623: /* stats_param: '(' a_expr ')' */ #line 4840 "gram.y" { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = NULL; (yyval.selem)->expr = (yyvsp[-1].node); } #line 37396 "gram.c" break; case 624: /* AlterStatsStmt: ALTER STATISTICS any_name SET STATISTICS set_statistics_value */ #line 4857 "gram.y" { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = (yyvsp[-3].list); n->missing_ok = false; n->stxstattarget = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 37409 "gram.c" break; case 625: /* AlterStatsStmt: ALTER STATISTICS IF_P EXISTS any_name SET STATISTICS set_statistics_value */ #line 4866 "gram.y" { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = (yyvsp[-3].list); n->missing_ok = true; n->stxstattarget = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 37422 "gram.c" break; case 626: /* CreateAsStmt: CREATE OptTemp TABLE create_as_target AS SelectStmt opt_with_data */ #line 4888 "gram.y" { 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 37440 "gram.c" break; case 627: /* CreateAsStmt: CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS SelectStmt opt_with_data */ #line 4902 "gram.y" { 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 37458 "gram.c" break; case 628: /* create_as_target: qualified_name opt_column_list table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 4920 "gram.y" { (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 37474 "gram.c" break; case 629: /* opt_with_data: WITH DATA_P */ #line 4934 "gram.y" { (yyval.boolean) = true; } #line 37480 "gram.c" break; case 630: /* opt_with_data: WITH NO DATA_P */ #line 4935 "gram.y" { (yyval.boolean) = false; } #line 37486 "gram.c" break; case 631: /* opt_with_data: %empty */ #line 4936 "gram.y" { (yyval.boolean) = true; } #line 37492 "gram.c" break; case 632: /* CreateMatViewStmt: CREATE OptNoLog MATERIALIZED VIEW create_mv_target AS SelectStmt opt_with_data */ #line 4949 "gram.y" { 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 37510 "gram.c" break; case 633: /* CreateMatViewStmt: CREATE OptNoLog MATERIALIZED VIEW IF_P NOT EXISTS create_mv_target AS SelectStmt opt_with_data */ #line 4963 "gram.y" { 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 37528 "gram.c" break; case 634: /* create_mv_target: qualified_name opt_column_list table_access_method_clause opt_reloptions OptTableSpace */ #line 4980 "gram.y" { (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 37544 "gram.c" break; case 635: /* OptNoLog: UNLOGGED */ #line 4993 "gram.y" { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 37550 "gram.c" break; case 636: /* OptNoLog: %empty */ #line 4994 "gram.y" { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 37556 "gram.c" break; case 637: /* RefreshMatViewStmt: REFRESH MATERIALIZED VIEW opt_concurrently qualified_name opt_with_data */ #line 5007 "gram.y" { RefreshMatViewStmt *n = makeNode(RefreshMatViewStmt); n->concurrent = (yyvsp[-2].boolean); n->relation = (yyvsp[-1].range); n->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) n; } #line 37569 "gram.c" break; case 638: /* CreateSeqStmt: CREATE OptTemp SEQUENCE qualified_name OptSeqOptList */ #line 5028 "gram.y" { 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 37584 "gram.c" break; case 639: /* CreateSeqStmt: CREATE OptTemp SEQUENCE IF_P NOT EXISTS qualified_name OptSeqOptList */ #line 5039 "gram.y" { 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 37599 "gram.c" break; case 640: /* AlterSeqStmt: ALTER SEQUENCE qualified_name SeqOptList */ #line 5053 "gram.y" { AlterSeqStmt *n = makeNode(AlterSeqStmt); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 37612 "gram.c" break; case 641: /* AlterSeqStmt: ALTER SEQUENCE IF_P EXISTS qualified_name SeqOptList */ #line 5062 "gram.y" { AlterSeqStmt *n = makeNode(AlterSeqStmt); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 37625 "gram.c" break; case 642: /* OptSeqOptList: SeqOptList */ #line 5073 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 37631 "gram.c" break; case 643: /* OptSeqOptList: %empty */ #line 5074 "gram.y" { (yyval.list) = NIL; } #line 37637 "gram.c" break; case 644: /* OptParenthesizedSeqOptList: '(' SeqOptList ')' */ #line 5077 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 37643 "gram.c" break; case 645: /* OptParenthesizedSeqOptList: %empty */ #line 5078 "gram.y" { (yyval.list) = NIL; } #line 37649 "gram.c" break; case 646: /* SeqOptList: SeqOptElem */ #line 5081 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 37655 "gram.c" break; case 647: /* SeqOptList: SeqOptList SeqOptElem */ #line 5082 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 37661 "gram.c" break; case 648: /* SeqOptElem: AS SimpleTypename */ #line 5086 "gram.y" { (yyval.defelt) = makeDefElem("as", (Node *) (yyvsp[0].typnam), (yylsp[-1])); } #line 37669 "gram.c" break; case 649: /* SeqOptElem: CACHE NumericOnly */ #line 5090 "gram.y" { (yyval.defelt) = makeDefElem("cache", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 37677 "gram.c" break; case 650: /* SeqOptElem: CYCLE */ #line 5094 "gram.y" { (yyval.defelt) = makeDefElem("cycle", (Node *) makeBoolean(true), (yylsp[0])); } #line 37685 "gram.c" break; case 651: /* SeqOptElem: NO CYCLE */ #line 5098 "gram.y" { (yyval.defelt) = makeDefElem("cycle", (Node *) makeBoolean(false), (yylsp[-1])); } #line 37693 "gram.c" break; case 652: /* SeqOptElem: INCREMENT opt_by NumericOnly */ #line 5102 "gram.y" { (yyval.defelt) = makeDefElem("increment", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37701 "gram.c" break; case 653: /* SeqOptElem: LOGGED */ #line 5106 "gram.y" { (yyval.defelt) = makeDefElem("logged", NULL, (yylsp[0])); } #line 37709 "gram.c" break; case 654: /* SeqOptElem: MAXVALUE NumericOnly */ #line 5110 "gram.y" { (yyval.defelt) = makeDefElem("maxvalue", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 37717 "gram.c" break; case 655: /* SeqOptElem: MINVALUE NumericOnly */ #line 5114 "gram.y" { (yyval.defelt) = makeDefElem("minvalue", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 37725 "gram.c" break; case 656: /* SeqOptElem: NO MAXVALUE */ #line 5118 "gram.y" { (yyval.defelt) = makeDefElem("maxvalue", NULL, (yylsp[-1])); } #line 37733 "gram.c" break; case 657: /* SeqOptElem: NO MINVALUE */ #line 5122 "gram.y" { (yyval.defelt) = makeDefElem("minvalue", NULL, (yylsp[-1])); } #line 37741 "gram.c" break; case 658: /* SeqOptElem: OWNED BY any_name */ #line 5126 "gram.y" { (yyval.defelt) = makeDefElem("owned_by", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 37749 "gram.c" break; case 659: /* SeqOptElem: SEQUENCE NAME_P any_name */ #line 5130 "gram.y" { (yyval.defelt) = makeDefElem("sequence_name", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 37757 "gram.c" break; case 660: /* SeqOptElem: START opt_with NumericOnly */ #line 5134 "gram.y" { (yyval.defelt) = makeDefElem("start", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37765 "gram.c" break; case 661: /* SeqOptElem: RESTART */ #line 5138 "gram.y" { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 37773 "gram.c" break; case 662: /* SeqOptElem: RESTART opt_with NumericOnly */ #line 5142 "gram.y" { (yyval.defelt) = makeDefElem("restart", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37781 "gram.c" break; case 663: /* SeqOptElem: UNLOGGED */ #line 5146 "gram.y" { (yyval.defelt) = makeDefElem("unlogged", NULL, (yylsp[0])); } #line 37789 "gram.c" break; case 666: /* NumericOnly: FCONST */ #line 5156 "gram.y" { (yyval.node) = (Node *) makeFloat((yyvsp[0].str)); } #line 37795 "gram.c" break; case 667: /* NumericOnly: '+' FCONST */ #line 5157 "gram.y" { (yyval.node) = (Node *) makeFloat((yyvsp[0].str)); } #line 37801 "gram.c" break; case 668: /* NumericOnly: '-' FCONST */ #line 5159 "gram.y" { Float *f = makeFloat((yyvsp[0].str)); doNegateFloat(f); (yyval.node) = (Node *) f; } #line 37812 "gram.c" break; case 669: /* NumericOnly: SignedIconst */ #line 5165 "gram.y" { (yyval.node) = (Node *) makeInteger((yyvsp[0].ival)); } #line 37818 "gram.c" break; case 670: /* NumericOnly_list: NumericOnly */ #line 5168 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37824 "gram.c" break; case 671: /* NumericOnly_list: NumericOnly_list ',' NumericOnly */ #line 5169 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 37830 "gram.c" break; case 672: /* CreatePLangStmt: CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name */ #line 5182 "gram.y" { /* * 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 37850 "gram.c" break; case 673: /* CreatePLangStmt: CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name HANDLER handler_name opt_inline_handler opt_validator */ #line 5199 "gram.y" { 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 37866 "gram.c" break; case 674: /* opt_trusted: TRUSTED */ #line 5213 "gram.y" { (yyval.boolean) = true; } #line 37872 "gram.c" break; case 675: /* opt_trusted: %empty */ #line 5214 "gram.y" { (yyval.boolean) = false; } #line 37878 "gram.c" break; case 676: /* handler_name: name */ #line 5222 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 37884 "gram.c" break; case 677: /* handler_name: name attrs */ #line 5223 "gram.y" { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 37890 "gram.c" break; case 678: /* opt_inline_handler: INLINE_P handler_name */ #line 5227 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 37896 "gram.c" break; case 679: /* opt_inline_handler: %empty */ #line 5228 "gram.y" { (yyval.list) = NIL; } #line 37902 "gram.c" break; case 680: /* validator_clause: VALIDATOR handler_name */ #line 5232 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 37908 "gram.c" break; case 681: /* validator_clause: NO VALIDATOR */ #line 5233 "gram.y" { (yyval.list) = NIL; } #line 37914 "gram.c" break; case 682: /* opt_validator: validator_clause */ #line 5237 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 37920 "gram.c" break; case 683: /* opt_validator: %empty */ #line 5238 "gram.y" { (yyval.list) = NIL; } #line 37926 "gram.c" break; case 686: /* CreateTableSpaceStmt: CREATE TABLESPACE name OptTableSpaceOwner LOCATION Sconst opt_reloptions */ #line 5254 "gram.y" { 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 37940 "gram.c" break; case 687: /* OptTableSpaceOwner: OWNER RoleSpec */ #line 5265 "gram.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 37946 "gram.c" break; case 688: /* OptTableSpaceOwner: %empty */ #line 5266 "gram.y" { (yyval.rolespec) = NULL; } #line 37952 "gram.c" break; case 689: /* DropTableSpaceStmt: DROP TABLESPACE name */ #line 5280 "gram.y" { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 37964 "gram.c" break; case 690: /* DropTableSpaceStmt: DROP TABLESPACE IF_P EXISTS name */ #line 5288 "gram.y" { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 37976 "gram.c" break; case 691: /* CreateExtensionStmt: CREATE EXTENSION name opt_with create_extension_opt_list */ #line 5306 "gram.y" { CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->extname = (yyvsp[-2].str); n->if_not_exists = false; n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 37989 "gram.c" break; case 692: /* CreateExtensionStmt: CREATE EXTENSION IF_P NOT EXISTS name opt_with create_extension_opt_list */ #line 5315 "gram.y" { CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->extname = (yyvsp[-2].str); n->if_not_exists = true; n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38002 "gram.c" break; case 693: /* create_extension_opt_list: create_extension_opt_list create_extension_opt_item */ #line 5327 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 38008 "gram.c" break; case 694: /* create_extension_opt_list: %empty */ #line 5329 "gram.y" { (yyval.list) = NIL; } #line 38014 "gram.c" break; case 695: /* create_extension_opt_item: SCHEMA name */ #line 5334 "gram.y" { (yyval.defelt) = makeDefElem("schema", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 38022 "gram.c" break; case 696: /* create_extension_opt_item: VERSION_P NonReservedWord_or_Sconst */ #line 5338 "gram.y" { (yyval.defelt) = makeDefElem("new_version", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 38030 "gram.c" break; case 697: /* create_extension_opt_item: FROM NonReservedWord_or_Sconst */ #line 5342 "gram.y" { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE EXTENSION ... FROM is no longer supported"), parser_errposition((yylsp[-1])))); } #line 38041 "gram.c" break; case 698: /* create_extension_opt_item: CASCADE */ #line 5349 "gram.y" { (yyval.defelt) = makeDefElem("cascade", (Node *) makeBoolean(true), (yylsp[0])); } #line 38049 "gram.c" break; case 699: /* AlterExtensionStmt: ALTER EXTENSION name UPDATE alter_extension_opt_list */ #line 5361 "gram.y" { AlterExtensionStmt *n = makeNode(AlterExtensionStmt); n->extname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38061 "gram.c" break; case 700: /* alter_extension_opt_list: alter_extension_opt_list alter_extension_opt_item */ #line 5372 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 38067 "gram.c" break; case 701: /* alter_extension_opt_list: %empty */ #line 5374 "gram.y" { (yyval.list) = NIL; } #line 38073 "gram.c" break; case 702: /* alter_extension_opt_item: TO NonReservedWord_or_Sconst */ #line 5379 "gram.y" { (yyval.defelt) = makeDefElem("new_version", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 38081 "gram.c" break; case 703: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop object_type_name name */ #line 5392 "gram.y" { 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 38095 "gram.c" break; case 704: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop object_type_any_name any_name */ #line 5402 "gram.y" { 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 38109 "gram.c" break; case 705: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop AGGREGATE aggregate_with_argtypes */ #line 5412 "gram.y" { 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 38123 "gram.c" break; case 706: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')' */ #line 5422 "gram.y" { 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 38137 "gram.c" break; case 707: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop DOMAIN_P Typename */ #line 5432 "gram.y" { 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 38151 "gram.c" break; case 708: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop FUNCTION function_with_argtypes */ #line 5442 "gram.y" { 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 38165 "gram.c" break; case 709: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop OPERATOR operator_with_argtypes */ #line 5452 "gram.y" { 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 38179 "gram.c" break; case 710: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING name */ #line 5462 "gram.y" { 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 38193 "gram.c" break; case 711: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop OPERATOR FAMILY any_name USING name */ #line 5472 "gram.y" { 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 38207 "gram.c" break; case 712: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop PROCEDURE function_with_argtypes */ #line 5482 "gram.y" { 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 38221 "gram.c" break; case 713: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop ROUTINE function_with_argtypes */ #line 5492 "gram.y" { 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 38235 "gram.c" break; case 714: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop TRANSFORM FOR Typename LANGUAGE name */ #line 5502 "gram.y" { 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 38249 "gram.c" break; case 715: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop TYPE_P Typename */ #line 5512 "gram.y" { 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 38263 "gram.c" break; case 716: /* CreateFdwStmt: CREATE FOREIGN DATA_P WRAPPER name opt_fdw_options create_generic_options */ #line 5531 "gram.y" { 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 38276 "gram.c" break; case 717: /* fdw_option: HANDLER handler_name */ #line 5542 "gram.y" { (yyval.defelt) = makeDefElem("handler", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 38282 "gram.c" break; case 718: /* fdw_option: NO HANDLER */ #line 5543 "gram.y" { (yyval.defelt) = makeDefElem("handler", NULL, (yylsp[-1])); } #line 38288 "gram.c" break; case 719: /* fdw_option: VALIDATOR handler_name */ #line 5544 "gram.y" { (yyval.defelt) = makeDefElem("validator", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 38294 "gram.c" break; case 720: /* fdw_option: NO VALIDATOR */ #line 5545 "gram.y" { (yyval.defelt) = makeDefElem("validator", NULL, (yylsp[-1])); } #line 38300 "gram.c" break; case 721: /* fdw_options: fdw_option */ #line 5549 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38306 "gram.c" break; case 722: /* fdw_options: fdw_options fdw_option */ #line 5550 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 38312 "gram.c" break; case 723: /* opt_fdw_options: fdw_options */ #line 5554 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 38318 "gram.c" break; case 724: /* opt_fdw_options: %empty */ #line 5555 "gram.y" { (yyval.list) = NIL; } #line 38324 "gram.c" break; case 725: /* AlterFdwStmt: ALTER FOREIGN DATA_P WRAPPER name opt_fdw_options alter_generic_options */ #line 5566 "gram.y" { 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 38337 "gram.c" break; case 726: /* AlterFdwStmt: ALTER FOREIGN DATA_P WRAPPER name fdw_options */ #line 5575 "gram.y" { AlterFdwStmt *n = makeNode(AlterFdwStmt); n->fdwname = (yyvsp[-1].str); n->func_options = (yyvsp[0].list); n->options = NIL; (yyval.node) = (Node *) n; } #line 38350 "gram.c" break; case 727: /* create_generic_options: OPTIONS '(' generic_option_list ')' */ #line 5587 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 38356 "gram.c" break; case 728: /* create_generic_options: %empty */ #line 5588 "gram.y" { (yyval.list) = NIL; } #line 38362 "gram.c" break; case 729: /* generic_option_list: generic_option_elem */ #line 5593 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38370 "gram.c" break; case 730: /* generic_option_list: generic_option_list ',' generic_option_elem */ #line 5597 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 38378 "gram.c" break; case 731: /* alter_generic_options: OPTIONS '(' alter_generic_option_list ')' */ #line 5604 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 38384 "gram.c" break; case 732: /* alter_generic_option_list: alter_generic_option_elem */ #line 5609 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38392 "gram.c" break; case 733: /* alter_generic_option_list: alter_generic_option_list ',' alter_generic_option_elem */ #line 5613 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 38400 "gram.c" break; case 734: /* alter_generic_option_elem: generic_option_elem */ #line 5620 "gram.y" { (yyval.defelt) = (yyvsp[0].defelt); } #line 38408 "gram.c" break; case 735: /* alter_generic_option_elem: SET generic_option_elem */ #line 5624 "gram.y" { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_SET; } #line 38417 "gram.c" break; case 736: /* alter_generic_option_elem: ADD_P generic_option_elem */ #line 5629 "gram.y" { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_ADD; } #line 38426 "gram.c" break; case 737: /* alter_generic_option_elem: DROP generic_option_name */ #line 5634 "gram.y" { (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[0].str), NULL, DEFELEM_DROP, (yylsp[0])); } #line 38434 "gram.c" break; case 738: /* generic_option_elem: generic_option_name generic_option_arg */ #line 5641 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 38442 "gram.c" break; case 739: /* generic_option_name: ColLabel */ #line 5647 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 38448 "gram.c" break; case 740: /* generic_option_arg: Sconst */ #line 5652 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 38454 "gram.c" break; case 741: /* CreateForeignServerStmt: CREATE SERVER name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options */ #line 5664 "gram.y" { 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 38470 "gram.c" break; case 742: /* CreateForeignServerStmt: CREATE SERVER IF_P NOT EXISTS name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options */ #line 5677 "gram.y" { 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 38486 "gram.c" break; case 743: /* opt_type: TYPE_P Sconst */ #line 5691 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 38492 "gram.c" break; case 744: /* opt_type: %empty */ #line 5692 "gram.y" { (yyval.str) = NULL; } #line 38498 "gram.c" break; case 745: /* foreign_server_version: VERSION_P Sconst */ #line 5697 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 38504 "gram.c" break; case 746: /* foreign_server_version: VERSION_P NULL_P */ #line 5698 "gram.y" { (yyval.str) = NULL; } #line 38510 "gram.c" break; case 747: /* opt_foreign_server_version: foreign_server_version */ #line 5702 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 38516 "gram.c" break; case 748: /* opt_foreign_server_version: %empty */ #line 5703 "gram.y" { (yyval.str) = NULL; } #line 38522 "gram.c" break; case 749: /* AlterForeignServerStmt: ALTER SERVER name foreign_server_version alter_generic_options */ #line 5714 "gram.y" { 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 38536 "gram.c" break; case 750: /* AlterForeignServerStmt: ALTER SERVER name foreign_server_version */ #line 5724 "gram.y" { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->version = (yyvsp[0].str); n->has_version = true; (yyval.node) = (Node *) n; } #line 38549 "gram.c" break; case 751: /* AlterForeignServerStmt: ALTER SERVER name alter_generic_options */ #line 5733 "gram.y" { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38561 "gram.c" break; case 752: /* CreateForeignTableStmt: CREATE FOREIGN TABLE qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options */ #line 5753 "gram.y" { 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 38584 "gram.c" break; case 753: /* CreateForeignTableStmt: CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options */ #line 5774 "gram.y" { 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 38607 "gram.c" break; case 754: /* CreateForeignTableStmt: CREATE FOREIGN TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options */ #line 5795 "gram.y" { 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 38631 "gram.c" break; case 755: /* CreateForeignTableStmt: CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options */ #line 5817 "gram.y" { 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 38655 "gram.c" break; case 756: /* ImportForeignSchemaStmt: IMPORT_P FOREIGN SCHEMA name import_qualification FROM SERVER name INTO name create_generic_options */ #line 5850 "gram.y" { 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 38671 "gram.c" break; case 757: /* import_qualification_type: LIMIT TO */ #line 5864 "gram.y" { (yyval.ival) = FDW_IMPORT_SCHEMA_LIMIT_TO; } #line 38677 "gram.c" break; case 758: /* import_qualification_type: EXCEPT */ #line 5865 "gram.y" { (yyval.ival) = FDW_IMPORT_SCHEMA_EXCEPT; } #line 38683 "gram.c" break; case 759: /* import_qualification: import_qualification_type '(' relation_expr_list ')' */ #line 5870 "gram.y" { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = (yyvsp[-3].ival); n->table_names = (yyvsp[-1].list); (yyval.importqual) = n; } #line 38695 "gram.c" break; case 760: /* import_qualification: %empty */ #line 5878 "gram.y" { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = FDW_IMPORT_SCHEMA_ALL; n->table_names = NIL; (yyval.importqual) = n; } #line 38706 "gram.c" break; case 761: /* CreateUserMappingStmt: CREATE USER MAPPING FOR auth_ident SERVER name create_generic_options */ #line 5894 "gram.y" { 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 38720 "gram.c" break; case 762: /* CreateUserMappingStmt: CREATE USER MAPPING IF_P NOT EXISTS FOR auth_ident SERVER name create_generic_options */ #line 5904 "gram.y" { 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 38734 "gram.c" break; case 763: /* auth_ident: RoleSpec */ #line 5916 "gram.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 38740 "gram.c" break; case 764: /* auth_ident: USER */ #line 5917 "gram.y" { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 38746 "gram.c" break; case 765: /* DropUserMappingStmt: DROP USER MAPPING FOR auth_ident SERVER name */ #line 5930 "gram.y" { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = (yyvsp[-2].rolespec); n->servername = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 38759 "gram.c" break; case 766: /* DropUserMappingStmt: DROP USER MAPPING IF_P EXISTS FOR auth_ident SERVER name */ #line 5939 "gram.y" { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = (yyvsp[-2].rolespec); n->servername = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 38772 "gram.c" break; case 767: /* AlterUserMappingStmt: ALTER USER MAPPING FOR auth_ident SERVER name alter_generic_options */ #line 5957 "gram.y" { AlterUserMappingStmt *n = makeNode(AlterUserMappingStmt); n->user = (yyvsp[-3].rolespec); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38785 "gram.c" break; case 768: /* CreatePolicyStmt: CREATE POLICY name ON qualified_name RowSecurityDefaultPermissive RowSecurityDefaultForCmd RowSecurityDefaultToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck */ #line 5984 "gram.y" { 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 38802 "gram.c" break; case 769: /* AlterPolicyStmt: ALTER POLICY name ON qualified_name RowSecurityOptionalToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck */ #line 6001 "gram.y" { 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 38817 "gram.c" break; case 770: /* RowSecurityOptionalExpr: USING '(' a_expr ')' */ #line 6014 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 38823 "gram.c" break; case 771: /* RowSecurityOptionalExpr: %empty */ #line 6015 "gram.y" { (yyval.node) = NULL; } #line 38829 "gram.c" break; case 772: /* RowSecurityOptionalWithCheck: WITH CHECK '(' a_expr ')' */ #line 6019 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 38835 "gram.c" break; case 773: /* RowSecurityOptionalWithCheck: %empty */ #line 6020 "gram.y" { (yyval.node) = NULL; } #line 38841 "gram.c" break; case 774: /* RowSecurityDefaultToRole: TO role_list */ #line 6024 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 38847 "gram.c" break; case 775: /* RowSecurityDefaultToRole: %empty */ #line 6025 "gram.y" { (yyval.list) = list_make1(makeRoleSpec(ROLESPEC_PUBLIC, -1)); } #line 38853 "gram.c" break; case 776: /* RowSecurityOptionalToRole: TO role_list */ #line 6029 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 38859 "gram.c" break; case 777: /* RowSecurityOptionalToRole: %empty */ #line 6030 "gram.y" { (yyval.list) = NULL; } #line 38865 "gram.c" break; case 778: /* RowSecurityDefaultPermissive: AS IDENT */ #line 6035 "gram.y" { 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 38883 "gram.c" break; case 779: /* RowSecurityDefaultPermissive: %empty */ #line 6048 "gram.y" { (yyval.boolean) = true; } #line 38889 "gram.c" break; case 780: /* RowSecurityDefaultForCmd: FOR row_security_cmd */ #line 6052 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 38895 "gram.c" break; case 781: /* RowSecurityDefaultForCmd: %empty */ #line 6053 "gram.y" { (yyval.str) = "all"; } #line 38901 "gram.c" break; case 782: /* row_security_cmd: ALL */ #line 6057 "gram.y" { (yyval.str) = "all"; } #line 38907 "gram.c" break; case 783: /* row_security_cmd: SELECT */ #line 6058 "gram.y" { (yyval.str) = "select"; } #line 38913 "gram.c" break; case 784: /* row_security_cmd: INSERT */ #line 6059 "gram.y" { (yyval.str) = "insert"; } #line 38919 "gram.c" break; case 785: /* row_security_cmd: UPDATE */ #line 6060 "gram.y" { (yyval.str) = "update"; } #line 38925 "gram.c" break; case 786: /* row_security_cmd: DELETE_P */ #line 6061 "gram.y" { (yyval.str) = "delete"; } #line 38931 "gram.c" break; case 787: /* CreateAmStmt: CREATE ACCESS METHOD name TYPE_P am_type HANDLER handler_name */ #line 6072 "gram.y" { 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 38944 "gram.c" break; case 788: /* am_type: INDEX */ #line 6083 "gram.y" { (yyval.chr) = AMTYPE_INDEX; } #line 38950 "gram.c" break; case 789: /* am_type: TABLE */ #line 6084 "gram.y" { (yyval.chr) = AMTYPE_TABLE; } #line 38956 "gram.c" break; case 790: /* CreateTrigStmt: CREATE opt_or_replace TRIGGER name TriggerActionTime TriggerEvents ON qualified_name TriggerReferencing TriggerForSpec TriggerWhen EXECUTE FUNCTION_or_PROCEDURE func_name '(' TriggerFuncArgs ')' */ #line 6098 "gram.y" { 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 38981 "gram.c" break; case 791: /* CreateTrigStmt: 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 ')' */ #line 6122 "gram.y" { 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"), parser_errposition((yylsp[-20])))); 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, NULL, yyscanner); n->constrrel = (yyvsp[-11].range); (yyval.node) = (Node *) n; } #line 39012 "gram.c" break; case 792: /* TriggerActionTime: BEFORE */ #line 6151 "gram.y" { (yyval.ival) = TRIGGER_TYPE_BEFORE; } #line 39018 "gram.c" break; case 793: /* TriggerActionTime: AFTER */ #line 6152 "gram.y" { (yyval.ival) = TRIGGER_TYPE_AFTER; } #line 39024 "gram.c" break; case 794: /* TriggerActionTime: INSTEAD OF */ #line 6153 "gram.y" { (yyval.ival) = TRIGGER_TYPE_INSTEAD; } #line 39030 "gram.c" break; case 795: /* TriggerEvents: TriggerOneEvent */ #line 6158 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 39036 "gram.c" break; case 796: /* TriggerEvents: TriggerEvents OR TriggerOneEvent */ #line 6160 "gram.y" { 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 39059 "gram.c" break; case 797: /* TriggerOneEvent: INSERT */ #line 6182 "gram.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); } #line 39065 "gram.c" break; case 798: /* TriggerOneEvent: DELETE_P */ #line 6184 "gram.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); } #line 39071 "gram.c" break; case 799: /* TriggerOneEvent: UPDATE */ #line 6186 "gram.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); } #line 39077 "gram.c" break; case 800: /* TriggerOneEvent: UPDATE OF columnList */ #line 6188 "gram.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), (yyvsp[0].list)); } #line 39083 "gram.c" break; case 801: /* TriggerOneEvent: TRUNCATE */ #line 6190 "gram.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); } #line 39089 "gram.c" break; case 802: /* TriggerReferencing: REFERENCING TriggerTransitions */ #line 6194 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 39095 "gram.c" break; case 803: /* TriggerReferencing: %empty */ #line 6195 "gram.y" { (yyval.list) = NIL; } #line 39101 "gram.c" break; case 804: /* TriggerTransitions: TriggerTransition */ #line 6199 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 39107 "gram.c" break; case 805: /* TriggerTransitions: TriggerTransitions TriggerTransition */ #line 6200 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 39113 "gram.c" break; case 806: /* TriggerTransition: TransitionOldOrNew TransitionRowOrTable opt_as TransitionRelName */ #line 6205 "gram.y" { TriggerTransition *n = makeNode(TriggerTransition); n->name = (yyvsp[0].str); n->isNew = (yyvsp[-3].boolean); n->isTable = (yyvsp[-2].boolean); (yyval.node) = (Node *) n; } #line 39126 "gram.c" break; case 807: /* TransitionOldOrNew: NEW */ #line 6216 "gram.y" { (yyval.boolean) = true; } #line 39132 "gram.c" break; case 808: /* TransitionOldOrNew: OLD */ #line 6217 "gram.y" { (yyval.boolean) = false; } #line 39138 "gram.c" break; case 809: /* TransitionRowOrTable: TABLE */ #line 6221 "gram.y" { (yyval.boolean) = true; } #line 39144 "gram.c" break; case 810: /* TransitionRowOrTable: ROW */ #line 6230 "gram.y" { (yyval.boolean) = false; } #line 39150 "gram.c" break; case 811: /* TransitionRelName: ColId */ #line 6234 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 39156 "gram.c" break; case 812: /* TriggerForSpec: FOR TriggerForOptEach TriggerForType */ #line 6239 "gram.y" { (yyval.boolean) = (yyvsp[0].boolean); } #line 39164 "gram.c" break; case 813: /* TriggerForSpec: %empty */ #line 6243 "gram.y" { /* * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ (yyval.boolean) = false; } #line 39176 "gram.c" break; case 816: /* TriggerForType: ROW */ #line 6258 "gram.y" { (yyval.boolean) = true; } #line 39182 "gram.c" break; case 817: /* TriggerForType: STATEMENT */ #line 6259 "gram.y" { (yyval.boolean) = false; } #line 39188 "gram.c" break; case 818: /* TriggerWhen: WHEN '(' a_expr ')' */ #line 6263 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 39194 "gram.c" break; case 819: /* TriggerWhen: %empty */ #line 6264 "gram.y" { (yyval.node) = NULL; } #line 39200 "gram.c" break; case 822: /* TriggerFuncArgs: TriggerFuncArg */ #line 6273 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 39206 "gram.c" break; case 823: /* TriggerFuncArgs: TriggerFuncArgs ',' TriggerFuncArg */ #line 6274 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 39212 "gram.c" break; case 824: /* TriggerFuncArgs: %empty */ #line 6275 "gram.y" { (yyval.list) = NIL; } #line 39218 "gram.c" break; case 825: /* TriggerFuncArg: Iconst */ #line 6280 "gram.y" { (yyval.node) = (Node *) makeString(psprintf("%d", (yyvsp[0].ival))); } #line 39226 "gram.c" break; case 826: /* TriggerFuncArg: FCONST */ #line 6283 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39232 "gram.c" break; case 827: /* TriggerFuncArg: Sconst */ #line 6284 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39238 "gram.c" break; case 828: /* TriggerFuncArg: ColLabel */ #line 6285 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39244 "gram.c" break; case 829: /* OptConstrFromTable: FROM qualified_name */ #line 6289 "gram.y" { (yyval.range) = (yyvsp[0].range); } #line 39250 "gram.c" break; case 830: /* OptConstrFromTable: %empty */ #line 6290 "gram.y" { (yyval.range) = NULL; } #line 39256 "gram.c" break; case 831: /* ConstraintAttributeSpec: %empty */ #line 6295 "gram.y" { (yyval.ival) = 0; } #line 39262 "gram.c" break; case 832: /* ConstraintAttributeSpec: ConstraintAttributeSpec ConstraintAttributeElem */ #line 6297 "gram.y" { /* * 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) || (newspec & (CAS_NOT_ENFORCED | CAS_ENFORCED)) == (CAS_NOT_ENFORCED | CAS_ENFORCED)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("conflicting constraint properties"), parser_errposition((yylsp[0])))); (yyval.ival) = newspec; } #line 39291 "gram.c" break; case 833: /* ConstraintAttributeElem: NOT DEFERRABLE */ #line 6324 "gram.y" { (yyval.ival) = CAS_NOT_DEFERRABLE; } #line 39297 "gram.c" break; case 834: /* ConstraintAttributeElem: DEFERRABLE */ #line 6325 "gram.y" { (yyval.ival) = CAS_DEFERRABLE; } #line 39303 "gram.c" break; case 835: /* ConstraintAttributeElem: INITIALLY IMMEDIATE */ #line 6326 "gram.y" { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; } #line 39309 "gram.c" break; case 836: /* ConstraintAttributeElem: INITIALLY DEFERRED */ #line 6327 "gram.y" { (yyval.ival) = CAS_INITIALLY_DEFERRED; } #line 39315 "gram.c" break; case 837: /* ConstraintAttributeElem: NOT VALID */ #line 6328 "gram.y" { (yyval.ival) = CAS_NOT_VALID; } #line 39321 "gram.c" break; case 838: /* ConstraintAttributeElem: NO INHERIT */ #line 6329 "gram.y" { (yyval.ival) = CAS_NO_INHERIT; } #line 39327 "gram.c" break; case 839: /* ConstraintAttributeElem: NOT ENFORCED */ #line 6330 "gram.y" { (yyval.ival) = CAS_NOT_ENFORCED; } #line 39333 "gram.c" break; case 840: /* ConstraintAttributeElem: ENFORCED */ #line 6331 "gram.y" { (yyval.ival) = CAS_ENFORCED; } #line 39339 "gram.c" break; case 841: /* CreateEventTrigStmt: CREATE EVENT TRIGGER name ON ColLabel EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')' */ #line 6346 "gram.y" { 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 39353 "gram.c" break; case 842: /* CreateEventTrigStmt: CREATE EVENT TRIGGER name ON ColLabel WHEN event_trigger_when_list EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')' */ #line 6358 "gram.y" { 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 39367 "gram.c" break; case 843: /* event_trigger_when_list: event_trigger_when_item */ #line 6371 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39373 "gram.c" break; case 844: /* event_trigger_when_list: event_trigger_when_list AND event_trigger_when_item */ #line 6373 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39379 "gram.c" break; case 845: /* event_trigger_when_item: ColId IN_P '(' event_trigger_value_list ')' */ #line 6378 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-4].str), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 39385 "gram.c" break; case 846: /* event_trigger_value_list: SCONST */ #line 6383 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 39391 "gram.c" break; case 847: /* event_trigger_value_list: event_trigger_value_list ',' SCONST */ #line 6385 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 39397 "gram.c" break; case 848: /* AlterEventTrigStmt: ALTER EVENT TRIGGER name enable_trigger */ #line 6390 "gram.y" { AlterEventTrigStmt *n = makeNode(AlterEventTrigStmt); n->trigname = (yyvsp[-1].str); n->tgenabled = (yyvsp[0].chr); (yyval.node) = (Node *) n; } #line 39409 "gram.c" break; case 849: /* enable_trigger: ENABLE_P */ #line 6400 "gram.y" { (yyval.chr) = TRIGGER_FIRES_ON_ORIGIN; } #line 39415 "gram.c" break; case 850: /* enable_trigger: ENABLE_P REPLICA */ #line 6401 "gram.y" { (yyval.chr) = TRIGGER_FIRES_ON_REPLICA; } #line 39421 "gram.c" break; case 851: /* enable_trigger: ENABLE_P ALWAYS */ #line 6402 "gram.y" { (yyval.chr) = TRIGGER_FIRES_ALWAYS; } #line 39427 "gram.c" break; case 852: /* enable_trigger: DISABLE_P */ #line 6403 "gram.y" { (yyval.chr) = TRIGGER_DISABLED; } #line 39433 "gram.c" break; case 853: /* CreateAssertionStmt: CREATE ASSERTION any_name CHECK '(' a_expr ')' ConstraintAttributeSpec */ #line 6415 "gram.y" { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"), parser_errposition((yylsp[-7])))); (yyval.node) = NULL; } #line 39446 "gram.c" break; case 854: /* DefineStmt: CREATE opt_or_replace AGGREGATE func_name aggr_args definition */ #line 6435 "gram.y" { 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 39462 "gram.c" break; case 855: /* DefineStmt: CREATE opt_or_replace AGGREGATE func_name old_aggr_definition */ #line 6447 "gram.y" { /* 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 39479 "gram.c" break; case 856: /* DefineStmt: CREATE OPERATOR any_operator definition */ #line 6460 "gram.y" { 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 39494 "gram.c" break; case 857: /* DefineStmt: CREATE TYPE_P any_name definition */ #line 6471 "gram.y" { 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 39509 "gram.c" break; case 858: /* DefineStmt: CREATE TYPE_P any_name */ #line 6482 "gram.y" { /* 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 39525 "gram.c" break; case 859: /* DefineStmt: CREATE TYPE_P any_name AS '(' OptTableFuncElementList ')' */ #line 6494 "gram.y" { 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 39538 "gram.c" break; case 860: /* DefineStmt: CREATE TYPE_P any_name AS ENUM_P '(' opt_enum_val_list ')' */ #line 6503 "gram.y" { CreateEnumStmt *n = makeNode(CreateEnumStmt); n->typeName = (yyvsp[-5].list); n->vals = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 39550 "gram.c" break; case 861: /* DefineStmt: CREATE TYPE_P any_name AS RANGE definition */ #line 6511 "gram.y" { CreateRangeStmt *n = makeNode(CreateRangeStmt); n->typeName = (yyvsp[-3].list); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 39562 "gram.c" break; case 862: /* DefineStmt: CREATE TEXT_P SEARCH PARSER any_name definition */ #line 6519 "gram.y" { 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 39576 "gram.c" break; case 863: /* DefineStmt: CREATE TEXT_P SEARCH DICTIONARY any_name definition */ #line 6529 "gram.y" { 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 39590 "gram.c" break; case 864: /* DefineStmt: CREATE TEXT_P SEARCH TEMPLATE any_name definition */ #line 6539 "gram.y" { 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 39604 "gram.c" break; case 865: /* DefineStmt: CREATE TEXT_P SEARCH CONFIGURATION any_name definition */ #line 6549 "gram.y" { 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 39618 "gram.c" break; case 866: /* DefineStmt: CREATE COLLATION any_name definition */ #line 6559 "gram.y" { 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 39632 "gram.c" break; case 867: /* DefineStmt: CREATE COLLATION IF_P NOT EXISTS any_name definition */ #line 6569 "gram.y" { 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 39647 "gram.c" break; case 868: /* DefineStmt: CREATE COLLATION any_name FROM any_name */ #line 6580 "gram.y" { 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 39661 "gram.c" break; case 869: /* DefineStmt: CREATE COLLATION IF_P NOT EXISTS any_name FROM any_name */ #line 6590 "gram.y" { 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 39676 "gram.c" break; case 870: /* definition: '(' def_list ')' */ #line 6602 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 39682 "gram.c" break; case 871: /* def_list: def_elem */ #line 6605 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39688 "gram.c" break; case 872: /* def_list: def_list ',' def_elem */ #line 6606 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39694 "gram.c" break; case 873: /* def_elem: ColLabel '=' def_arg */ #line 6610 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 39702 "gram.c" break; case 874: /* def_elem: ColLabel */ #line 6614 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 39710 "gram.c" break; case 875: /* def_arg: func_type */ #line 6620 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].typnam); } #line 39716 "gram.c" break; case 876: /* def_arg: reserved_keyword */ #line 6621 "gram.y" { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 39722 "gram.c" break; case 877: /* def_arg: qual_all_Op */ #line 6622 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].list); } #line 39728 "gram.c" break; case 878: /* def_arg: NumericOnly */ #line 6623 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].node); } #line 39734 "gram.c" break; case 879: /* def_arg: Sconst */ #line 6624 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39740 "gram.c" break; case 880: /* def_arg: NONE */ #line 6625 "gram.y" { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 39746 "gram.c" break; case 881: /* old_aggr_definition: '(' old_aggr_list ')' */ #line 6628 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 39752 "gram.c" break; case 882: /* old_aggr_list: old_aggr_elem */ #line 6631 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39758 "gram.c" break; case 883: /* old_aggr_list: old_aggr_list ',' old_aggr_elem */ #line 6632 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39764 "gram.c" break; case 884: /* old_aggr_elem: IDENT '=' def_arg */ #line 6641 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 39772 "gram.c" break; case 885: /* opt_enum_val_list: enum_val_list */ #line 6647 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 39778 "gram.c" break; case 886: /* opt_enum_val_list: %empty */ #line 6648 "gram.y" { (yyval.list) = NIL; } #line 39784 "gram.c" break; case 887: /* enum_val_list: Sconst */ #line 6652 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 39790 "gram.c" break; case 888: /* enum_val_list: enum_val_list ',' Sconst */ #line 6654 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 39796 "gram.c" break; case 889: /* AlterEnumStmt: ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst */ #line 6665 "gram.y" { 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 39812 "gram.c" break; case 890: /* AlterEnumStmt: ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst BEFORE Sconst */ #line 6677 "gram.y" { 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 39828 "gram.c" break; case 891: /* AlterEnumStmt: ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst AFTER Sconst */ #line 6689 "gram.y" { 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 39844 "gram.c" break; case 892: /* AlterEnumStmt: ALTER TYPE_P any_name RENAME VALUE_P Sconst TO Sconst */ #line 6701 "gram.y" { 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 39860 "gram.c" break; case 893: /* AlterEnumStmt: ALTER TYPE_P any_name DROP VALUE_P Sconst */ #line 6713 "gram.y" { /* * 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 39891 "gram.c" break; case 894: /* opt_if_not_exists: IF_P NOT EXISTS */ #line 6741 "gram.y" { (yyval.boolean) = true; } #line 39897 "gram.c" break; case 895: /* opt_if_not_exists: %empty */ #line 6742 "gram.y" { (yyval.boolean) = false; } #line 39903 "gram.c" break; case 896: /* CreateOpClassStmt: CREATE OPERATOR CLASS any_name opt_default FOR TYPE_P Typename USING name opt_opfamily AS opclass_item_list */ #line 6760 "gram.y" { 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 39919 "gram.c" break; case 897: /* opclass_item_list: opclass_item */ #line 6774 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 39925 "gram.c" break; case 898: /* opclass_item_list: opclass_item_list ',' opclass_item */ #line 6775 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 39931 "gram.c" break; case 899: /* opclass_item: OPERATOR Iconst any_operator opclass_purpose */ #line 6780 "gram.y" { CreateOpClassItem *n = makeNode(CreateOpClassItem); ObjectWithArgs *owa = makeNode(ObjectWithArgs); owa->objname = (yyvsp[-1].list); owa->objargs = NIL; n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = owa; n->number = (yyvsp[-2].ival); n->order_family = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 39948 "gram.c" break; case 900: /* opclass_item: OPERATOR Iconst operator_with_argtypes opclass_purpose */ #line 6793 "gram.y" { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = (yyvsp[-1].objwithargs); n->number = (yyvsp[-2].ival); n->order_family = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 39962 "gram.c" break; case 901: /* opclass_item: FUNCTION Iconst function_with_argtypes */ #line 6803 "gram.y" { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = (yyvsp[0].objwithargs); n->number = (yyvsp[-1].ival); (yyval.node) = (Node *) n; } #line 39975 "gram.c" break; case 902: /* opclass_item: FUNCTION Iconst '(' type_list ')' function_with_argtypes */ #line 6812 "gram.y" { 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 39989 "gram.c" break; case 903: /* opclass_item: STORAGE Typename */ #line 6822 "gram.y" { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_STORAGETYPE; n->storedtype = (yyvsp[0].typnam); (yyval.node) = (Node *) n; } #line 40001 "gram.c" break; case 904: /* opt_default: DEFAULT */ #line 6831 "gram.y" { (yyval.boolean) = true; } #line 40007 "gram.c" break; case 905: /* opt_default: %empty */ #line 6832 "gram.y" { (yyval.boolean) = false; } #line 40013 "gram.c" break; case 906: /* opt_opfamily: FAMILY any_name */ #line 6835 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 40019 "gram.c" break; case 907: /* opt_opfamily: %empty */ #line 6836 "gram.y" { (yyval.list) = NIL; } #line 40025 "gram.c" break; case 908: /* opclass_purpose: FOR SEARCH */ #line 6839 "gram.y" { (yyval.list) = NIL; } #line 40031 "gram.c" break; case 909: /* opclass_purpose: FOR ORDER BY any_name */ #line 6840 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 40037 "gram.c" break; case 910: /* opclass_purpose: %empty */ #line 6841 "gram.y" { (yyval.list) = NIL; } #line 40043 "gram.c" break; case 911: /* CreateOpFamilyStmt: CREATE OPERATOR FAMILY any_name USING name */ #line 6847 "gram.y" { CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt); n->opfamilyname = (yyvsp[-2].list); n->amname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40055 "gram.c" break; case 912: /* AlterOpFamilyStmt: ALTER OPERATOR FAMILY any_name USING name ADD_P opclass_item_list */ #line 6858 "gram.y" { 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 40069 "gram.c" break; case 913: /* AlterOpFamilyStmt: ALTER OPERATOR FAMILY any_name USING name DROP opclass_drop_list */ #line 6868 "gram.y" { 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 40083 "gram.c" break; case 914: /* opclass_drop_list: opclass_drop */ #line 6880 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 40089 "gram.c" break; case 915: /* opclass_drop_list: opclass_drop_list ',' opclass_drop */ #line 6881 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 40095 "gram.c" break; case 916: /* opclass_drop: OPERATOR Iconst '(' type_list ')' */ #line 6886 "gram.y" { 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 40108 "gram.c" break; case 917: /* opclass_drop: FUNCTION Iconst '(' type_list ')' */ #line 6895 "gram.y" { 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 40121 "gram.c" break; case 918: /* DropOpClassStmt: DROP OPERATOR CLASS any_name USING name opt_drop_behavior */ #line 6908 "gram.y" { 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 40136 "gram.c" break; case 919: /* DropOpClassStmt: DROP OPERATOR CLASS IF_P EXISTS any_name USING name opt_drop_behavior */ #line 6919 "gram.y" { 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 40151 "gram.c" break; case 920: /* DropOpFamilyStmt: DROP OPERATOR FAMILY any_name USING name opt_drop_behavior */ #line 6933 "gram.y" { 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 40166 "gram.c" break; case 921: /* DropOpFamilyStmt: DROP OPERATOR FAMILY IF_P EXISTS any_name USING name opt_drop_behavior */ #line 6944 "gram.y" { 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 40181 "gram.c" break; case 922: /* DropOwnedStmt: DROP OWNED BY role_list opt_drop_behavior */ #line 6967 "gram.y" { DropOwnedStmt *n = makeNode(DropOwnedStmt); n->roles = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 40193 "gram.c" break; case 923: /* ReassignOwnedStmt: REASSIGN OWNED BY role_list TO RoleSpec */ #line 6978 "gram.y" { ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt); n->roles = (yyvsp[-2].list); n->newrole = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 40205 "gram.c" break; case 924: /* DropStmt: DROP object_type_any_name IF_P EXISTS any_name_list opt_drop_behavior */ #line 6997 "gram.y" { 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 40220 "gram.c" break; case 925: /* DropStmt: DROP object_type_any_name any_name_list opt_drop_behavior */ #line 7008 "gram.y" { 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 40235 "gram.c" break; case 926: /* DropStmt: DROP drop_type_name IF_P EXISTS name_list opt_drop_behavior */ #line 7019 "gram.y" { 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 40250 "gram.c" break; case 927: /* DropStmt: DROP drop_type_name name_list opt_drop_behavior */ #line 7030 "gram.y" { 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 40265 "gram.c" break; case 928: /* DropStmt: DROP object_type_name_on_any_name name ON any_name opt_drop_behavior */ #line 7041 "gram.y" { 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 40280 "gram.c" break; case 929: /* DropStmt: DROP object_type_name_on_any_name IF_P EXISTS name ON any_name opt_drop_behavior */ #line 7052 "gram.y" { 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 40295 "gram.c" break; case 930: /* DropStmt: DROP TYPE_P type_name_list opt_drop_behavior */ #line 7063 "gram.y" { 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 40310 "gram.c" break; case 931: /* DropStmt: DROP TYPE_P IF_P EXISTS type_name_list opt_drop_behavior */ #line 7074 "gram.y" { 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 40325 "gram.c" break; case 932: /* DropStmt: DROP DOMAIN_P type_name_list opt_drop_behavior */ #line 7085 "gram.y" { 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 40340 "gram.c" break; case 933: /* DropStmt: DROP DOMAIN_P IF_P EXISTS type_name_list opt_drop_behavior */ #line 7096 "gram.y" { 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 40355 "gram.c" break; case 934: /* DropStmt: DROP INDEX CONCURRENTLY any_name_list opt_drop_behavior */ #line 7107 "gram.y" { 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 40370 "gram.c" break; case 935: /* DropStmt: DROP INDEX CONCURRENTLY IF_P EXISTS any_name_list opt_drop_behavior */ #line 7118 "gram.y" { 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 40385 "gram.c" break; case 936: /* object_type_any_name: TABLE */ #line 7132 "gram.y" { (yyval.objtype) = OBJECT_TABLE; } #line 40391 "gram.c" break; case 937: /* object_type_any_name: SEQUENCE */ #line 7133 "gram.y" { (yyval.objtype) = OBJECT_SEQUENCE; } #line 40397 "gram.c" break; case 938: /* object_type_any_name: VIEW */ #line 7134 "gram.y" { (yyval.objtype) = OBJECT_VIEW; } #line 40403 "gram.c" break; case 939: /* object_type_any_name: MATERIALIZED VIEW */ #line 7135 "gram.y" { (yyval.objtype) = OBJECT_MATVIEW; } #line 40409 "gram.c" break; case 940: /* object_type_any_name: INDEX */ #line 7136 "gram.y" { (yyval.objtype) = OBJECT_INDEX; } #line 40415 "gram.c" break; case 941: /* object_type_any_name: FOREIGN TABLE */ #line 7137 "gram.y" { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 40421 "gram.c" break; case 942: /* object_type_any_name: COLLATION */ #line 7138 "gram.y" { (yyval.objtype) = OBJECT_COLLATION; } #line 40427 "gram.c" break; case 943: /* object_type_any_name: CONVERSION_P */ #line 7139 "gram.y" { (yyval.objtype) = OBJECT_CONVERSION; } #line 40433 "gram.c" break; case 944: /* object_type_any_name: STATISTICS */ #line 7140 "gram.y" { (yyval.objtype) = OBJECT_STATISTIC_EXT; } #line 40439 "gram.c" break; case 945: /* object_type_any_name: TEXT_P SEARCH PARSER */ #line 7141 "gram.y" { (yyval.objtype) = OBJECT_TSPARSER; } #line 40445 "gram.c" break; case 946: /* object_type_any_name: TEXT_P SEARCH DICTIONARY */ #line 7142 "gram.y" { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 40451 "gram.c" break; case 947: /* object_type_any_name: TEXT_P SEARCH TEMPLATE */ #line 7143 "gram.y" { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 40457 "gram.c" break; case 948: /* object_type_any_name: TEXT_P SEARCH CONFIGURATION */ #line 7144 "gram.y" { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 40463 "gram.c" break; case 949: /* object_type_name: drop_type_name */ #line 7154 "gram.y" { (yyval.objtype) = (yyvsp[0].objtype); } #line 40469 "gram.c" break; case 950: /* object_type_name: DATABASE */ #line 7155 "gram.y" { (yyval.objtype) = OBJECT_DATABASE; } #line 40475 "gram.c" break; case 951: /* object_type_name: ROLE */ #line 7156 "gram.y" { (yyval.objtype) = OBJECT_ROLE; } #line 40481 "gram.c" break; case 952: /* object_type_name: SUBSCRIPTION */ #line 7157 "gram.y" { (yyval.objtype) = OBJECT_SUBSCRIPTION; } #line 40487 "gram.c" break; case 953: /* object_type_name: TABLESPACE */ #line 7158 "gram.y" { (yyval.objtype) = OBJECT_TABLESPACE; } #line 40493 "gram.c" break; case 954: /* drop_type_name: ACCESS METHOD */ #line 7162 "gram.y" { (yyval.objtype) = OBJECT_ACCESS_METHOD; } #line 40499 "gram.c" break; case 955: /* drop_type_name: EVENT TRIGGER */ #line 7163 "gram.y" { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 40505 "gram.c" break; case 956: /* drop_type_name: EXTENSION */ #line 7164 "gram.y" { (yyval.objtype) = OBJECT_EXTENSION; } #line 40511 "gram.c" break; case 957: /* drop_type_name: FOREIGN DATA_P WRAPPER */ #line 7165 "gram.y" { (yyval.objtype) = OBJECT_FDW; } #line 40517 "gram.c" break; case 958: /* drop_type_name: opt_procedural LANGUAGE */ #line 7166 "gram.y" { (yyval.objtype) = OBJECT_LANGUAGE; } #line 40523 "gram.c" break; case 959: /* drop_type_name: PUBLICATION */ #line 7167 "gram.y" { (yyval.objtype) = OBJECT_PUBLICATION; } #line 40529 "gram.c" break; case 960: /* drop_type_name: SCHEMA */ #line 7168 "gram.y" { (yyval.objtype) = OBJECT_SCHEMA; } #line 40535 "gram.c" break; case 961: /* drop_type_name: SERVER */ #line 7169 "gram.y" { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 40541 "gram.c" break; case 962: /* object_type_name_on_any_name: POLICY */ #line 7174 "gram.y" { (yyval.objtype) = OBJECT_POLICY; } #line 40547 "gram.c" break; case 963: /* object_type_name_on_any_name: RULE */ #line 7175 "gram.y" { (yyval.objtype) = OBJECT_RULE; } #line 40553 "gram.c" break; case 964: /* object_type_name_on_any_name: TRIGGER */ #line 7176 "gram.y" { (yyval.objtype) = OBJECT_TRIGGER; } #line 40559 "gram.c" break; case 965: /* any_name_list: any_name */ #line 7180 "gram.y" { (yyval.list) = list_make1((yyvsp[0].list)); } #line 40565 "gram.c" break; case 966: /* any_name_list: any_name_list ',' any_name */ #line 7181 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 40571 "gram.c" break; case 967: /* any_name: ColId */ #line 7184 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 40577 "gram.c" break; case 968: /* any_name: ColId attrs */ #line 7185 "gram.y" { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 40583 "gram.c" break; case 969: /* attrs: '.' attr_name */ #line 7189 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 40589 "gram.c" break; case 970: /* attrs: attrs '.' attr_name */ #line 7191 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 40595 "gram.c" break; case 971: /* type_name_list: Typename */ #line 7195 "gram.y" { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 40601 "gram.c" break; case 972: /* type_name_list: type_name_list ',' Typename */ #line 7196 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 40607 "gram.c" break; case 973: /* TruncateStmt: TRUNCATE opt_table relation_expr_list opt_restart_seqs opt_drop_behavior */ #line 7208 "gram.y" { 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 40620 "gram.c" break; case 974: /* opt_restart_seqs: CONTINUE_P IDENTITY_P */ #line 7219 "gram.y" { (yyval.boolean) = false; } #line 40626 "gram.c" break; case 975: /* opt_restart_seqs: RESTART IDENTITY_P */ #line 7220 "gram.y" { (yyval.boolean) = true; } #line 40632 "gram.c" break; case 976: /* opt_restart_seqs: %empty */ #line 7221 "gram.y" { (yyval.boolean) = false; } #line 40638 "gram.c" break; case 977: /* CommentStmt: COMMENT ON object_type_any_name any_name IS comment_text */ #line 7232 "gram.y" { 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 40651 "gram.c" break; case 978: /* CommentStmt: COMMENT ON COLUMN any_name IS comment_text */ #line 7241 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_COLUMN; n->object = (Node *) (yyvsp[-2].list); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40664 "gram.c" break; case 979: /* CommentStmt: COMMENT ON object_type_name name IS comment_text */ #line 7250 "gram.y" { 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 40677 "gram.c" break; case 980: /* CommentStmt: COMMENT ON TYPE_P Typename IS comment_text */ #line 7259 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TYPE; n->object = (Node *) (yyvsp[-2].typnam); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40690 "gram.c" break; case 981: /* CommentStmt: COMMENT ON DOMAIN_P Typename IS comment_text */ #line 7268 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-2].typnam); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40703 "gram.c" break; case 982: /* CommentStmt: COMMENT ON AGGREGATE aggregate_with_argtypes IS comment_text */ #line 7277 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40716 "gram.c" break; case 983: /* CommentStmt: COMMENT ON FUNCTION function_with_argtypes IS comment_text */ #line 7286 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40729 "gram.c" break; case 984: /* CommentStmt: COMMENT ON OPERATOR operator_with_argtypes IS comment_text */ #line 7295 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40742 "gram.c" break; case 985: /* CommentStmt: COMMENT ON CONSTRAINT name ON any_name IS comment_text */ #line 7304 "gram.y" { 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 40755 "gram.c" break; case 986: /* CommentStmt: COMMENT ON CONSTRAINT name ON DOMAIN_P any_name IS comment_text */ #line 7313 "gram.y" { 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 40773 "gram.c" break; case 987: /* CommentStmt: COMMENT ON object_type_name_on_any_name name ON any_name IS comment_text */ #line 7327 "gram.y" { 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 40786 "gram.c" break; case 988: /* CommentStmt: COMMENT ON PROCEDURE function_with_argtypes IS comment_text */ #line 7336 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40799 "gram.c" break; case 989: /* CommentStmt: COMMENT ON ROUTINE function_with_argtypes IS comment_text */ #line 7345 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40812 "gram.c" break; case 990: /* CommentStmt: COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text */ #line 7354 "gram.y" { 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 40825 "gram.c" break; case 991: /* CommentStmt: COMMENT ON OPERATOR CLASS any_name USING name IS comment_text */ #line 7363 "gram.y" { 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 40838 "gram.c" break; case 992: /* CommentStmt: COMMENT ON OPERATOR FAMILY any_name USING name IS comment_text */ #line 7372 "gram.y" { 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 40851 "gram.c" break; case 993: /* CommentStmt: COMMENT ON LARGE_P OBJECT_P NumericOnly IS comment_text */ #line 7381 "gram.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].node); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40864 "gram.c" break; case 994: /* CommentStmt: COMMENT ON CAST '(' Typename AS Typename ')' IS comment_text */ #line 7390 "gram.y" { 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 40877 "gram.c" break; case 995: /* comment_text: Sconst */ #line 7401 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 40883 "gram.c" break; case 996: /* comment_text: NULL_P */ #line 7402 "gram.y" { (yyval.str) = NULL; } #line 40889 "gram.c" break; case 997: /* SecLabelStmt: SECURITY LABEL opt_provider ON object_type_any_name any_name IS security_label */ #line 7418 "gram.y" { 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 40903 "gram.c" break; case 998: /* SecLabelStmt: SECURITY LABEL opt_provider ON COLUMN any_name IS security_label */ #line 7429 "gram.y" { 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 40917 "gram.c" break; case 999: /* SecLabelStmt: SECURITY LABEL opt_provider ON object_type_name name IS security_label */ #line 7440 "gram.y" { 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 40931 "gram.c" break; case 1000: /* SecLabelStmt: SECURITY LABEL opt_provider ON TYPE_P Typename IS security_label */ #line 7451 "gram.y" { 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 40945 "gram.c" break; case 1001: /* SecLabelStmt: SECURITY LABEL opt_provider ON DOMAIN_P Typename IS security_label */ #line 7462 "gram.y" { 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 40959 "gram.c" break; case 1002: /* SecLabelStmt: SECURITY LABEL opt_provider ON AGGREGATE aggregate_with_argtypes IS security_label */ #line 7473 "gram.y" { 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 40973 "gram.c" break; case 1003: /* SecLabelStmt: SECURITY LABEL opt_provider ON FUNCTION function_with_argtypes IS security_label */ #line 7484 "gram.y" { 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 40987 "gram.c" break; case 1004: /* SecLabelStmt: SECURITY LABEL opt_provider ON LARGE_P OBJECT_P NumericOnly IS security_label */ #line 7495 "gram.y" { 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 41001 "gram.c" break; case 1005: /* SecLabelStmt: SECURITY LABEL opt_provider ON PROCEDURE function_with_argtypes IS security_label */ #line 7506 "gram.y" { 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 41015 "gram.c" break; case 1006: /* SecLabelStmt: SECURITY LABEL opt_provider ON ROUTINE function_with_argtypes IS security_label */ #line 7517 "gram.y" { 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 41029 "gram.c" break; case 1007: /* opt_provider: FOR NonReservedWord_or_Sconst */ #line 7528 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 41035 "gram.c" break; case 1008: /* opt_provider: %empty */ #line 7529 "gram.y" { (yyval.str) = NULL; } #line 41041 "gram.c" break; case 1009: /* security_label: Sconst */ #line 7532 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 41047 "gram.c" break; case 1010: /* security_label: NULL_P */ #line 7533 "gram.y" { (yyval.str) = NULL; } #line 41053 "gram.c" break; case 1011: /* FetchStmt: FETCH fetch_args */ #line 7544 "gram.y" { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = false; (yyval.node) = (Node *) n; } #line 41064 "gram.c" break; case 1012: /* FetchStmt: MOVE fetch_args */ #line 7551 "gram.y" { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = true; (yyval.node) = (Node *) n; } #line 41075 "gram.c" break; case 1013: /* fetch_args: cursor_name */ #line 7560 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41088 "gram.c" break; case 1014: /* fetch_args: from_in cursor_name */ #line 7569 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41101 "gram.c" break; case 1015: /* fetch_args: NEXT opt_from_in cursor_name */ #line 7578 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41114 "gram.c" break; case 1016: /* fetch_args: PRIOR opt_from_in cursor_name */ #line 7587 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41127 "gram.c" break; case 1017: /* fetch_args: FIRST_P opt_from_in cursor_name */ #line 7596 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41140 "gram.c" break; case 1018: /* fetch_args: LAST_P opt_from_in cursor_name */ #line 7605 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = -1; (yyval.node) = (Node *) n; } #line 41153 "gram.c" break; case 1019: /* fetch_args: ABSOLUTE_P SignedIconst opt_from_in cursor_name */ #line 7614 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41166 "gram.c" break; case 1020: /* fetch_args: RELATIVE_P SignedIconst opt_from_in cursor_name */ #line 7623 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_RELATIVE; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41179 "gram.c" break; case 1021: /* fetch_args: SignedIconst opt_from_in cursor_name */ #line 7632 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41192 "gram.c" break; case 1022: /* fetch_args: ALL opt_from_in cursor_name */ #line 7641 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *) n; } #line 41205 "gram.c" break; case 1023: /* fetch_args: FORWARD opt_from_in cursor_name */ #line 7650 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41218 "gram.c" break; case 1024: /* fetch_args: FORWARD SignedIconst opt_from_in cursor_name */ #line 7659 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41231 "gram.c" break; case 1025: /* fetch_args: FORWARD ALL opt_from_in cursor_name */ #line 7668 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *) n; } #line 41244 "gram.c" break; case 1026: /* fetch_args: BACKWARD opt_from_in cursor_name */ #line 7677 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41257 "gram.c" break; case 1027: /* fetch_args: BACKWARD SignedIconst opt_from_in cursor_name */ #line 7686 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41270 "gram.c" break; case 1028: /* fetch_args: BACKWARD ALL opt_from_in cursor_name */ #line 7695 "gram.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *) n; } #line 41283 "gram.c" break; case 1033: /* GrantStmt: GRANT privileges ON privilege_target TO grantee_list opt_grant_grant_option opt_granted_by */ #line 7722 "gram.y" { 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 41301 "gram.c" break; case 1034: /* RevokeStmt: REVOKE privileges ON privilege_target FROM grantee_list opt_granted_by opt_drop_behavior */ #line 7740 "gram.y" { 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 41320 "gram.c" break; case 1035: /* RevokeStmt: REVOKE GRANT OPTION FOR privileges ON privilege_target FROM grantee_list opt_granted_by opt_drop_behavior */ #line 7756 "gram.y" { 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 41339 "gram.c" break; case 1036: /* privileges: privilege_list */ #line 7783 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 41345 "gram.c" break; case 1037: /* privileges: ALL */ #line 7785 "gram.y" { (yyval.list) = NIL; } #line 41351 "gram.c" break; case 1038: /* privileges: ALL PRIVILEGES */ #line 7787 "gram.y" { (yyval.list) = NIL; } #line 41357 "gram.c" break; case 1039: /* privileges: ALL '(' columnList ')' */ #line 7789 "gram.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 41369 "gram.c" break; case 1040: /* privileges: ALL PRIVILEGES '(' columnList ')' */ #line 7797 "gram.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 41381 "gram.c" break; case 1041: /* privilege_list: privilege */ #line 7806 "gram.y" { (yyval.list) = list_make1((yyvsp[0].accesspriv)); } #line 41387 "gram.c" break; case 1042: /* privilege_list: privilege_list ',' privilege */ #line 7807 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].accesspriv)); } #line 41393 "gram.c" break; case 1043: /* privilege: SELECT opt_column_list */ #line 7811 "gram.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 41405 "gram.c" break; case 1044: /* privilege: REFERENCES opt_column_list */ #line 7819 "gram.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 41417 "gram.c" break; case 1045: /* privilege: CREATE opt_column_list */ #line 7827 "gram.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 41429 "gram.c" break; case 1046: /* privilege: ALTER SYSTEM_P */ #line 7835 "gram.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup("alter system"); n->cols = NIL; (yyval.accesspriv) = n; } #line 41440 "gram.c" break; case 1047: /* privilege: ColId opt_column_list */ #line 7842 "gram.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = (yyvsp[-1].str); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 41452 "gram.c" break; case 1048: /* parameter_name_list: parameter_name */ #line 7853 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 41460 "gram.c" break; case 1049: /* parameter_name_list: parameter_name_list ',' parameter_name */ #line 7857 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 41468 "gram.c" break; case 1050: /* parameter_name: ColId */ #line 7864 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 41476 "gram.c" break; case 1051: /* parameter_name: parameter_name '.' ColId */ #line 7868 "gram.y" { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 41484 "gram.c" break; case 1052: /* privilege_target: qualified_name_list */ #line 7879 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41497 "gram.c" break; case 1053: /* privilege_target: TABLE qualified_name_list */ #line 7888 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41510 "gram.c" break; case 1054: /* privilege_target: SEQUENCE qualified_name_list */ #line 7897 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_SEQUENCE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41523 "gram.c" break; case 1055: /* privilege_target: FOREIGN DATA_P WRAPPER name_list */ #line 7906 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FDW; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41536 "gram.c" break; case 1056: /* privilege_target: FOREIGN SERVER name_list */ #line 7915 "gram.y" { 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 41549 "gram.c" break; case 1057: /* privilege_target: FUNCTION function_with_argtypes_list */ #line 7924 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FUNCTION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41562 "gram.c" break; case 1058: /* privilege_target: PROCEDURE function_with_argtypes_list */ #line 7933 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_PROCEDURE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41575 "gram.c" break; case 1059: /* privilege_target: ROUTINE function_with_argtypes_list */ #line 7942 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_ROUTINE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41588 "gram.c" break; case 1060: /* privilege_target: DATABASE name_list */ #line 7951 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_DATABASE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41601 "gram.c" break; case 1061: /* privilege_target: DOMAIN_P any_name_list */ #line 7960 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_DOMAIN; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41614 "gram.c" break; case 1062: /* privilege_target: LANGUAGE name_list */ #line 7969 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_LANGUAGE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41627 "gram.c" break; case 1063: /* privilege_target: LARGE_P OBJECT_P NumericOnly_list */ #line 7978 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_LARGEOBJECT; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41640 "gram.c" break; case 1064: /* privilege_target: PARAMETER parameter_name_list */ #line 7987 "gram.y" { 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 41652 "gram.c" break; case 1065: /* privilege_target: SCHEMA name_list */ #line 7995 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_SCHEMA; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41665 "gram.c" break; case 1066: /* privilege_target: TABLESPACE name_list */ #line 8004 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLESPACE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41678 "gram.c" break; case 1067: /* privilege_target: TYPE_P any_name_list */ #line 8013 "gram.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TYPE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41691 "gram.c" break; case 1068: /* privilege_target: ALL TABLES IN_P SCHEMA name_list */ #line 8022 "gram.y" { 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 41704 "gram.c" break; case 1069: /* privilege_target: ALL SEQUENCES IN_P SCHEMA name_list */ #line 8031 "gram.y" { 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 41717 "gram.c" break; case 1070: /* privilege_target: ALL FUNCTIONS IN_P SCHEMA name_list */ #line 8040 "gram.y" { 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 41730 "gram.c" break; case 1071: /* privilege_target: ALL PROCEDURES IN_P SCHEMA name_list */ #line 8049 "gram.y" { 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 41743 "gram.c" break; case 1072: /* privilege_target: ALL ROUTINES IN_P SCHEMA name_list */ #line 8058 "gram.y" { 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 41756 "gram.c" break; case 1073: /* grantee_list: grantee */ #line 8070 "gram.y" { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 41762 "gram.c" break; case 1074: /* grantee_list: grantee_list ',' grantee */ #line 8071 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 41768 "gram.c" break; case 1075: /* grantee: RoleSpec */ #line 8075 "gram.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 41774 "gram.c" break; case 1076: /* grantee: GROUP_P RoleSpec */ #line 8076 "gram.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 41780 "gram.c" break; case 1077: /* opt_grant_grant_option: WITH GRANT OPTION */ #line 8081 "gram.y" { (yyval.boolean) = true; } #line 41786 "gram.c" break; case 1078: /* opt_grant_grant_option: %empty */ #line 8082 "gram.y" { (yyval.boolean) = false; } #line 41792 "gram.c" break; case 1079: /* GrantRoleStmt: GRANT privilege_list TO role_list opt_granted_by */ #line 8093 "gram.y" { 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 41807 "gram.c" break; case 1080: /* GrantRoleStmt: GRANT privilege_list TO role_list WITH grant_role_opt_list opt_granted_by */ #line 8104 "gram.y" { 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 41822 "gram.c" break; case 1081: /* RevokeRoleStmt: REVOKE privilege_list FROM role_list opt_granted_by opt_drop_behavior */ #line 8118 "gram.y" { 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 41838 "gram.c" break; case 1082: /* RevokeRoleStmt: REVOKE ColId OPTION FOR privilege_list FROM role_list opt_granted_by opt_drop_behavior */ #line 8130 "gram.y" { 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 41857 "gram.c" break; case 1083: /* grant_role_opt_list: grant_role_opt_list ',' grant_role_opt */ #line 8147 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 41863 "gram.c" break; case 1084: /* grant_role_opt_list: grant_role_opt */ #line 8148 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 41869 "gram.c" break; case 1085: /* grant_role_opt: ColLabel grant_role_opt_value */ #line 8153 "gram.y" { (yyval.defelt) = makeDefElem(pstrdup((yyvsp[-1].str)), (yyvsp[0].node), (yylsp[-1])); } #line 41877 "gram.c" break; case 1086: /* grant_role_opt_value: OPTION */ #line 8159 "gram.y" { (yyval.node) = (Node *) makeBoolean(true); } #line 41883 "gram.c" break; case 1087: /* grant_role_opt_value: TRUE_P */ #line 8160 "gram.y" { (yyval.node) = (Node *) makeBoolean(true); } #line 41889 "gram.c" break; case 1088: /* grant_role_opt_value: FALSE_P */ #line 8161 "gram.y" { (yyval.node) = (Node *) makeBoolean(false); } #line 41895 "gram.c" break; case 1089: /* opt_granted_by: GRANTED BY RoleSpec */ #line 8164 "gram.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 41901 "gram.c" break; case 1090: /* opt_granted_by: %empty */ #line 8165 "gram.y" { (yyval.rolespec) = NULL; } #line 41907 "gram.c" break; case 1091: /* AlterDefaultPrivilegesStmt: ALTER DEFAULT PRIVILEGES DefACLOptionList DefACLAction */ #line 8176 "gram.y" { AlterDefaultPrivilegesStmt *n = makeNode(AlterDefaultPrivilegesStmt); n->options = (yyvsp[-1].list); n->action = (GrantStmt *) (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 41919 "gram.c" break; case 1092: /* DefACLOptionList: DefACLOptionList DefACLOption */ #line 8186 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 41925 "gram.c" break; case 1093: /* DefACLOptionList: %empty */ #line 8187 "gram.y" { (yyval.list) = NIL; } #line 41931 "gram.c" break; case 1094: /* DefACLOption: IN_P SCHEMA name_list */ #line 8192 "gram.y" { (yyval.defelt) = makeDefElem("schemas", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 41939 "gram.c" break; case 1095: /* DefACLOption: FOR ROLE role_list */ #line 8196 "gram.y" { (yyval.defelt) = makeDefElem("roles", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 41947 "gram.c" break; case 1096: /* DefACLOption: FOR USER role_list */ #line 8200 "gram.y" { (yyval.defelt) = makeDefElem("roles", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 41955 "gram.c" break; case 1097: /* DefACLAction: GRANT privileges ON defacl_privilege_target TO grantee_list opt_grant_grant_option */ #line 8212 "gram.y" { 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 41972 "gram.c" break; case 1098: /* DefACLAction: REVOKE privileges ON defacl_privilege_target FROM grantee_list opt_drop_behavior */ #line 8226 "gram.y" { 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 41990 "gram.c" break; case 1099: /* DefACLAction: REVOKE GRANT OPTION FOR privileges ON defacl_privilege_target FROM grantee_list opt_drop_behavior */ #line 8241 "gram.y" { 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 42008 "gram.c" break; case 1100: /* defacl_privilege_target: TABLES */ #line 8257 "gram.y" { (yyval.ival) = OBJECT_TABLE; } #line 42014 "gram.c" break; case 1101: /* defacl_privilege_target: FUNCTIONS */ #line 8258 "gram.y" { (yyval.ival) = OBJECT_FUNCTION; } #line 42020 "gram.c" break; case 1102: /* defacl_privilege_target: ROUTINES */ #line 8259 "gram.y" { (yyval.ival) = OBJECT_FUNCTION; } #line 42026 "gram.c" break; case 1103: /* defacl_privilege_target: SEQUENCES */ #line 8260 "gram.y" { (yyval.ival) = OBJECT_SEQUENCE; } #line 42032 "gram.c" break; case 1104: /* defacl_privilege_target: TYPES_P */ #line 8261 "gram.y" { (yyval.ival) = OBJECT_TYPE; } #line 42038 "gram.c" break; case 1105: /* defacl_privilege_target: SCHEMAS */ #line 8262 "gram.y" { (yyval.ival) = OBJECT_SCHEMA; } #line 42044 "gram.c" break; case 1106: /* defacl_privilege_target: LARGE_P OBJECTS_P */ #line 8263 "gram.y" { (yyval.ival) = OBJECT_LARGEOBJECT; } #line 42050 "gram.c" break; case 1107: /* IndexStmt: CREATE opt_unique INDEX opt_concurrently opt_single_name ON relation_expr access_method_clause '(' index_params ')' opt_include opt_unique_null_treatment opt_reloptions OptTableSpace where_clause */ #line 8278 "gram.y" { 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 42084 "gram.c" break; case 1108: /* IndexStmt: CREATE opt_unique INDEX opt_concurrently IF_P NOT EXISTS name ON relation_expr access_method_clause '(' index_params ')' opt_include opt_unique_null_treatment opt_reloptions OptTableSpace where_clause */ #line 8310 "gram.y" { 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 42118 "gram.c" break; case 1109: /* opt_unique: UNIQUE */ #line 8342 "gram.y" { (yyval.boolean) = true; } #line 42124 "gram.c" break; case 1110: /* opt_unique: %empty */ #line 8343 "gram.y" { (yyval.boolean) = false; } #line 42130 "gram.c" break; case 1111: /* access_method_clause: USING name */ #line 8347 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 42136 "gram.c" break; case 1112: /* access_method_clause: %empty */ #line 8348 "gram.y" { (yyval.str) = DEFAULT_INDEX_TYPE; } #line 42142 "gram.c" break; case 1113: /* index_params: index_elem */ #line 8351 "gram.y" { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 42148 "gram.c" break; case 1114: /* index_params: index_params ',' index_elem */ #line 8352 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 42154 "gram.c" break; case 1115: /* index_elem_options: opt_collate opt_qualified_name opt_asc_desc opt_nulls_order */ #line 8358 "gram.y" { (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 42170 "gram.c" break; case 1116: /* index_elem_options: opt_collate any_name reloptions opt_asc_desc opt_nulls_order */ #line 8370 "gram.y" { (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 42186 "gram.c" break; case 1117: /* index_elem: ColId index_elem_options */ #line 8389 "gram.y" { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->name = (yyvsp[-1].str); } #line 42195 "gram.c" break; case 1118: /* index_elem: func_expr_windowless index_elem_options */ #line 8394 "gram.y" { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->expr = (yyvsp[-1].node); } #line 42204 "gram.c" break; case 1119: /* index_elem: '(' a_expr ')' index_elem_options */ #line 8399 "gram.y" { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->expr = (yyvsp[-2].node); } #line 42213 "gram.c" break; case 1120: /* opt_include: INCLUDE '(' index_including_params ')' */ #line 8405 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 42219 "gram.c" break; case 1121: /* opt_include: %empty */ #line 8406 "gram.y" { (yyval.list) = NIL; } #line 42225 "gram.c" break; case 1122: /* index_including_params: index_elem */ #line 8409 "gram.y" { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 42231 "gram.c" break; case 1123: /* index_including_params: index_including_params ',' index_elem */ #line 8410 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 42237 "gram.c" break; case 1124: /* opt_collate: COLLATE any_name */ #line 8413 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 42243 "gram.c" break; case 1125: /* opt_collate: %empty */ #line 8414 "gram.y" { (yyval.list) = NIL; } #line 42249 "gram.c" break; case 1126: /* opt_asc_desc: ASC */ #line 8418 "gram.y" { (yyval.ival) = SORTBY_ASC; } #line 42255 "gram.c" break; case 1127: /* opt_asc_desc: DESC */ #line 8419 "gram.y" { (yyval.ival) = SORTBY_DESC; } #line 42261 "gram.c" break; case 1128: /* opt_asc_desc: %empty */ #line 8420 "gram.y" { (yyval.ival) = SORTBY_DEFAULT; } #line 42267 "gram.c" break; case 1129: /* opt_nulls_order: NULLS_LA FIRST_P */ #line 8423 "gram.y" { (yyval.ival) = SORTBY_NULLS_FIRST; } #line 42273 "gram.c" break; case 1130: /* opt_nulls_order: NULLS_LA LAST_P */ #line 8424 "gram.y" { (yyval.ival) = SORTBY_NULLS_LAST; } #line 42279 "gram.c" break; case 1131: /* opt_nulls_order: %empty */ #line 8425 "gram.y" { (yyval.ival) = SORTBY_NULLS_DEFAULT; } #line 42285 "gram.c" break; case 1132: /* CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args_with_defaults RETURNS func_return opt_createfunc_opt_list opt_routine_body */ #line 8443 "gram.y" { 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 42302 "gram.c" break; case 1133: /* CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args_with_defaults RETURNS TABLE '(' table_func_column_list ')' opt_createfunc_opt_list opt_routine_body */ #line 8457 "gram.y" { 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), yyscanner); 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 42320 "gram.c" break; case 1134: /* CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args_with_defaults opt_createfunc_opt_list opt_routine_body */ #line 8472 "gram.y" { 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 42337 "gram.c" break; case 1135: /* CreateFunctionStmt: CREATE opt_or_replace PROCEDURE func_name func_args_with_defaults opt_createfunc_opt_list opt_routine_body */ #line 8486 "gram.y" { 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 42354 "gram.c" break; case 1136: /* opt_or_replace: OR REPLACE */ #line 8501 "gram.y" { (yyval.boolean) = true; } #line 42360 "gram.c" break; case 1137: /* opt_or_replace: %empty */ #line 8502 "gram.y" { (yyval.boolean) = false; } #line 42366 "gram.c" break; case 1138: /* func_args: '(' func_args_list ')' */ #line 8505 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 42372 "gram.c" break; case 1139: /* func_args: '(' ')' */ #line 8506 "gram.y" { (yyval.list) = NIL; } #line 42378 "gram.c" break; case 1140: /* func_args_list: func_arg */ #line 8510 "gram.y" { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 42384 "gram.c" break; case 1141: /* func_args_list: func_args_list ',' func_arg */ #line 8511 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 42390 "gram.c" break; case 1142: /* function_with_argtypes_list: function_with_argtypes */ #line 8515 "gram.y" { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 42396 "gram.c" break; case 1143: /* function_with_argtypes_list: function_with_argtypes_list ',' function_with_argtypes */ #line 8517 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 42402 "gram.c" break; case 1144: /* function_with_argtypes: func_name func_args */ #line 8522 "gram.y" { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractArgTypes((yyvsp[0].list)); n->objfuncargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 42415 "gram.c" break; case 1145: /* function_with_argtypes: type_func_name_keyword */ #line 8536 "gram.y" { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = list_make1(makeString(pstrdup((yyvsp[0].keyword)))); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 42427 "gram.c" break; case 1146: /* function_with_argtypes: ColId */ #line 8544 "gram.y" { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = list_make1(makeString((yyvsp[0].str))); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 42439 "gram.c" break; case 1147: /* function_with_argtypes: ColId indirection */ #line 8552 "gram.y" { 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 42452 "gram.c" break; case 1148: /* func_args_with_defaults: '(' func_args_with_defaults_list ')' */ #line 8567 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 42458 "gram.c" break; case 1149: /* func_args_with_defaults: '(' ')' */ #line 8568 "gram.y" { (yyval.list) = NIL; } #line 42464 "gram.c" break; case 1150: /* func_args_with_defaults_list: func_arg_with_default */ #line 8572 "gram.y" { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 42470 "gram.c" break; case 1151: /* func_args_with_defaults_list: func_args_with_defaults_list ',' func_arg_with_default */ #line 8574 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 42476 "gram.c" break; case 1152: /* func_arg: arg_class param_name func_type */ #line 8589 "gram.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-2].fun_param_mode); n->defexpr = NULL; n->location = (yylsp[-2]); (yyval.fun_param) = n; } #line 42491 "gram.c" break; case 1153: /* func_arg: param_name arg_class func_type */ #line 8600 "gram.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-2].str); n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-1].fun_param_mode); n->defexpr = NULL; n->location = (yylsp[-2]); (yyval.fun_param) = n; } #line 42506 "gram.c" break; case 1154: /* func_arg: param_name func_type */ #line 8611 "gram.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_DEFAULT; n->defexpr = NULL; n->location = (yylsp[-1]); (yyval.fun_param) = n; } #line 42521 "gram.c" break; case 1155: /* func_arg: arg_class func_type */ #line 8622 "gram.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = NULL; n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-1].fun_param_mode); n->defexpr = NULL; n->location = (yylsp[-1]); (yyval.fun_param) = n; } #line 42536 "gram.c" break; case 1156: /* func_arg: func_type */ #line 8633 "gram.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = NULL; n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_DEFAULT; n->defexpr = NULL; n->location = (yylsp[0]); (yyval.fun_param) = n; } #line 42551 "gram.c" break; case 1157: /* arg_class: IN_P */ #line 8646 "gram.y" { (yyval.fun_param_mode) = FUNC_PARAM_IN; } #line 42557 "gram.c" break; case 1158: /* arg_class: OUT_P */ #line 8647 "gram.y" { (yyval.fun_param_mode) = FUNC_PARAM_OUT; } #line 42563 "gram.c" break; case 1159: /* arg_class: INOUT */ #line 8648 "gram.y" { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 42569 "gram.c" break; case 1160: /* arg_class: IN_P OUT_P */ #line 8649 "gram.y" { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 42575 "gram.c" break; case 1161: /* arg_class: VARIADIC */ #line 8650 "gram.y" { (yyval.fun_param_mode) = FUNC_PARAM_VARIADIC; } #line 42581 "gram.c" break; case 1163: /* func_return: func_type */ #line 8661 "gram.y" { /* 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 42593 "gram.c" break; case 1164: /* func_type: Typename */ #line 8675 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 42599 "gram.c" break; case 1165: /* func_type: type_function_name attrs '%' TYPE_P */ #line 8677 "gram.y" { (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-3].str)), (yyvsp[-2].list))); (yyval.typnam)->pct_type = true; (yyval.typnam)->location = (yylsp[-3]); } #line 42609 "gram.c" break; case 1166: /* func_type: SETOF type_function_name attrs '%' TYPE_P */ #line 8683 "gram.y" { (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 42620 "gram.c" break; case 1167: /* func_arg_with_default: func_arg */ #line 8693 "gram.y" { (yyval.fun_param) = (yyvsp[0].fun_param); } #line 42628 "gram.c" break; case 1168: /* func_arg_with_default: func_arg DEFAULT a_expr */ #line 8697 "gram.y" { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 42637 "gram.c" break; case 1169: /* func_arg_with_default: func_arg '=' a_expr */ #line 8702 "gram.y" { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 42646 "gram.c" break; case 1170: /* aggr_arg: func_arg */ #line 8710 "gram.y" { 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 42661 "gram.c" break; case 1171: /* aggr_args: '(' '*' ')' */ #line 8752 "gram.y" { (yyval.list) = list_make2(NIL, makeInteger(-1)); } #line 42669 "gram.c" break; case 1172: /* aggr_args: '(' aggr_args_list ')' */ #line 8756 "gram.y" { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(-1)); } #line 42677 "gram.c" break; case 1173: /* aggr_args: '(' ORDER BY aggr_args_list ')' */ #line 8760 "gram.y" { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(0)); } #line 42685 "gram.c" break; case 1174: /* aggr_args: '(' aggr_args_list ORDER BY aggr_args_list ')' */ #line 8764 "gram.y" { /* this is the only case requiring consistency checking */ (yyval.list) = makeOrderedSetArgs((yyvsp[-4].list), (yyvsp[-1].list), yyscanner); } #line 42694 "gram.c" break; case 1175: /* aggr_args_list: aggr_arg */ #line 8771 "gram.y" { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 42700 "gram.c" break; case 1176: /* aggr_args_list: aggr_args_list ',' aggr_arg */ #line 8772 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 42706 "gram.c" break; case 1177: /* aggregate_with_argtypes: func_name aggr_args */ #line 8777 "gram.y" { 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 42719 "gram.c" break; case 1178: /* aggregate_with_argtypes_list: aggregate_with_argtypes */ #line 8788 "gram.y" { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 42725 "gram.c" break; case 1179: /* aggregate_with_argtypes_list: aggregate_with_argtypes_list ',' aggregate_with_argtypes */ #line 8790 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 42731 "gram.c" break; case 1181: /* opt_createfunc_opt_list: %empty */ #line 8795 "gram.y" { (yyval.list) = NIL; } #line 42737 "gram.c" break; case 1182: /* createfunc_opt_list: createfunc_opt_item */ #line 8800 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 42743 "gram.c" break; case 1183: /* createfunc_opt_list: createfunc_opt_list createfunc_opt_item */ #line 8801 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 42749 "gram.c" break; case 1184: /* common_func_opt_item: CALLED ON NULL_P INPUT_P */ #line 8809 "gram.y" { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(false), (yylsp[-3])); } #line 42757 "gram.c" break; case 1185: /* common_func_opt_item: RETURNS NULL_P ON NULL_P INPUT_P */ #line 8813 "gram.y" { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(true), (yylsp[-4])); } #line 42765 "gram.c" break; case 1186: /* common_func_opt_item: STRICT_P */ #line 8817 "gram.y" { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(true), (yylsp[0])); } #line 42773 "gram.c" break; case 1187: /* common_func_opt_item: IMMUTABLE */ #line 8821 "gram.y" { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("immutable"), (yylsp[0])); } #line 42781 "gram.c" break; case 1188: /* common_func_opt_item: STABLE */ #line 8825 "gram.y" { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("stable"), (yylsp[0])); } #line 42789 "gram.c" break; case 1189: /* common_func_opt_item: VOLATILE */ #line 8829 "gram.y" { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("volatile"), (yylsp[0])); } #line 42797 "gram.c" break; case 1190: /* common_func_opt_item: EXTERNAL SECURITY DEFINER */ #line 8833 "gram.y" { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(true), (yylsp[-2])); } #line 42805 "gram.c" break; case 1191: /* common_func_opt_item: EXTERNAL SECURITY INVOKER */ #line 8837 "gram.y" { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(false), (yylsp[-2])); } #line 42813 "gram.c" break; case 1192: /* common_func_opt_item: SECURITY DEFINER */ #line 8841 "gram.y" { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(true), (yylsp[-1])); } #line 42821 "gram.c" break; case 1193: /* common_func_opt_item: SECURITY INVOKER */ #line 8845 "gram.y" { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(false), (yylsp[-1])); } #line 42829 "gram.c" break; case 1194: /* common_func_opt_item: LEAKPROOF */ #line 8849 "gram.y" { (yyval.defelt) = makeDefElem("leakproof", (Node *) makeBoolean(true), (yylsp[0])); } #line 42837 "gram.c" break; case 1195: /* common_func_opt_item: NOT LEAKPROOF */ #line 8853 "gram.y" { (yyval.defelt) = makeDefElem("leakproof", (Node *) makeBoolean(false), (yylsp[-1])); } #line 42845 "gram.c" break; case 1196: /* common_func_opt_item: COST NumericOnly */ #line 8857 "gram.y" { (yyval.defelt) = makeDefElem("cost", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 42853 "gram.c" break; case 1197: /* common_func_opt_item: ROWS NumericOnly */ #line 8861 "gram.y" { (yyval.defelt) = makeDefElem("rows", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 42861 "gram.c" break; case 1198: /* common_func_opt_item: SUPPORT any_name */ #line 8865 "gram.y" { (yyval.defelt) = makeDefElem("support", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 42869 "gram.c" break; case 1199: /* common_func_opt_item: FunctionSetResetClause */ #line 8869 "gram.y" { /* we abuse the normal content of a DefElem here */ (yyval.defelt) = makeDefElem("set", (Node *) (yyvsp[0].vsetstmt), (yylsp[0])); } #line 42878 "gram.c" break; case 1200: /* common_func_opt_item: PARALLEL ColId */ #line 8874 "gram.y" { (yyval.defelt) = makeDefElem("parallel", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 42886 "gram.c" break; case 1201: /* createfunc_opt_item: AS func_as */ #line 8881 "gram.y" { (yyval.defelt) = makeDefElem("as", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 42894 "gram.c" break; case 1202: /* createfunc_opt_item: LANGUAGE NonReservedWord_or_Sconst */ #line 8885 "gram.y" { (yyval.defelt) = makeDefElem("language", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 42902 "gram.c" break; case 1203: /* createfunc_opt_item: TRANSFORM transform_type_list */ #line 8889 "gram.y" { (yyval.defelt) = makeDefElem("transform", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 42910 "gram.c" break; case 1204: /* createfunc_opt_item: WINDOW */ #line 8893 "gram.y" { (yyval.defelt) = makeDefElem("window", (Node *) makeBoolean(true), (yylsp[0])); } #line 42918 "gram.c" break; case 1205: /* createfunc_opt_item: common_func_opt_item */ #line 8897 "gram.y" { (yyval.defelt) = (yyvsp[0].defelt); } #line 42926 "gram.c" break; case 1206: /* func_as: Sconst */ #line 8902 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 42932 "gram.c" break; case 1207: /* func_as: Sconst ',' Sconst */ #line 8904 "gram.y" { (yyval.list) = list_make2(makeString((yyvsp[-2].str)), makeString((yyvsp[0].str))); } #line 42940 "gram.c" break; case 1208: /* ReturnStmt: RETURN a_expr */ #line 8910 "gram.y" { ReturnStmt *r = makeNode(ReturnStmt); r->returnval = (Node *) (yyvsp[0].node); (yyval.node) = (Node *) r; } #line 42951 "gram.c" break; case 1209: /* opt_routine_body: ReturnStmt */ #line 8920 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 42959 "gram.c" break; case 1210: /* opt_routine_body: BEGIN_P ATOMIC routine_body_stmt_list END_P */ #line 8924 "gram.y" { /* * 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 42973 "gram.c" break; case 1211: /* opt_routine_body: %empty */ #line 8934 "gram.y" { (yyval.node) = NULL; } #line 42981 "gram.c" break; case 1212: /* routine_body_stmt_list: routine_body_stmt_list routine_body_stmt ';' */ #line 8941 "gram.y" { /* 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 42993 "gram.c" break; case 1213: /* routine_body_stmt_list: %empty */ #line 8949 "gram.y" { (yyval.list) = NIL; } #line 43001 "gram.c" break; case 1216: /* transform_type_list: FOR TYPE_P Typename */ #line 8960 "gram.y" { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 43007 "gram.c" break; case 1217: /* transform_type_list: transform_type_list ',' FOR TYPE_P Typename */ #line 8961 "gram.y" { (yyval.list) = lappend((yyvsp[-4].list), (yyvsp[0].typnam)); } #line 43013 "gram.c" break; case 1218: /* opt_definition: WITH definition */ #line 8965 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 43019 "gram.c" break; case 1219: /* opt_definition: %empty */ #line 8966 "gram.y" { (yyval.list) = NIL; } #line 43025 "gram.c" break; case 1220: /* table_func_column: param_name func_type */ #line 8970 "gram.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_TABLE; n->defexpr = NULL; n->location = (yylsp[-1]); (yyval.fun_param) = n; } #line 43040 "gram.c" break; case 1221: /* table_func_column_list: table_func_column */ #line 8984 "gram.y" { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 43048 "gram.c" break; case 1222: /* table_func_column_list: table_func_column_list ',' table_func_column */ #line 8988 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 43056 "gram.c" break; case 1223: /* AlterFunctionStmt: ALTER FUNCTION function_with_argtypes alterfunc_opt_list opt_restrict */ #line 9003 "gram.y" { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_FUNCTION; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43069 "gram.c" break; case 1224: /* AlterFunctionStmt: ALTER PROCEDURE function_with_argtypes alterfunc_opt_list opt_restrict */ #line 9012 "gram.y" { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_PROCEDURE; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43082 "gram.c" break; case 1225: /* AlterFunctionStmt: ALTER ROUTINE function_with_argtypes alterfunc_opt_list opt_restrict */ #line 9021 "gram.y" { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_ROUTINE; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43095 "gram.c" break; case 1226: /* alterfunc_opt_list: common_func_opt_item */ #line 9033 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 43101 "gram.c" break; case 1227: /* alterfunc_opt_list: alterfunc_opt_list common_func_opt_item */ #line 9034 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 43107 "gram.c" break; case 1230: /* RemoveFuncStmt: DROP FUNCTION function_with_argtypes_list opt_drop_behavior */ #line 9058 "gram.y" { 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 43122 "gram.c" break; case 1231: /* RemoveFuncStmt: DROP FUNCTION IF_P EXISTS function_with_argtypes_list opt_drop_behavior */ #line 9069 "gram.y" { 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 43137 "gram.c" break; case 1232: /* RemoveFuncStmt: DROP PROCEDURE function_with_argtypes_list opt_drop_behavior */ #line 9080 "gram.y" { 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 43152 "gram.c" break; case 1233: /* RemoveFuncStmt: DROP PROCEDURE IF_P EXISTS function_with_argtypes_list opt_drop_behavior */ #line 9091 "gram.y" { 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 43167 "gram.c" break; case 1234: /* RemoveFuncStmt: DROP ROUTINE function_with_argtypes_list opt_drop_behavior */ #line 9102 "gram.y" { 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 43182 "gram.c" break; case 1235: /* RemoveFuncStmt: DROP ROUTINE IF_P EXISTS function_with_argtypes_list opt_drop_behavior */ #line 9113 "gram.y" { 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 43197 "gram.c" break; case 1236: /* RemoveAggrStmt: DROP AGGREGATE aggregate_with_argtypes_list opt_drop_behavior */ #line 9127 "gram.y" { 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 43212 "gram.c" break; case 1237: /* RemoveAggrStmt: DROP AGGREGATE IF_P EXISTS aggregate_with_argtypes_list opt_drop_behavior */ #line 9138 "gram.y" { 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 43227 "gram.c" break; case 1238: /* RemoveOperStmt: DROP OPERATOR operator_with_argtypes_list opt_drop_behavior */ #line 9152 "gram.y" { 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 43242 "gram.c" break; case 1239: /* RemoveOperStmt: DROP OPERATOR IF_P EXISTS operator_with_argtypes_list opt_drop_behavior */ #line 9163 "gram.y" { 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 43257 "gram.c" break; case 1240: /* oper_argtypes: '(' Typename ')' */ #line 9177 "gram.y" { 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 43269 "gram.c" break; case 1241: /* oper_argtypes: '(' Typename ',' Typename ')' */ #line 9185 "gram.y" { (yyval.list) = list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); } #line 43275 "gram.c" break; case 1242: /* oper_argtypes: '(' NONE ',' Typename ')' */ #line 9187 "gram.y" { (yyval.list) = list_make2(NULL, (yyvsp[-1].typnam)); } #line 43281 "gram.c" break; case 1243: /* oper_argtypes: '(' Typename ',' NONE ')' */ #line 9189 "gram.y" { (yyval.list) = list_make2((yyvsp[-3].typnam), NULL); } #line 43287 "gram.c" break; case 1244: /* any_operator: all_Op */ #line 9194 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 43293 "gram.c" break; case 1245: /* any_operator: ColId '.' any_operator */ #line 9196 "gram.y" { (yyval.list) = lcons(makeString((yyvsp[-2].str)), (yyvsp[0].list)); } #line 43299 "gram.c" break; case 1246: /* operator_with_argtypes_list: operator_with_argtypes */ #line 9200 "gram.y" { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 43305 "gram.c" break; case 1247: /* operator_with_argtypes_list: operator_with_argtypes_list ',' operator_with_argtypes */ #line 9202 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 43311 "gram.c" break; case 1248: /* operator_with_argtypes: any_operator oper_argtypes */ #line 9207 "gram.y" { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 43323 "gram.c" break; case 1249: /* DoStmt: DO dostmt_opt_list */ #line 9226 "gram.y" { DoStmt *n = makeNode(DoStmt); n->args = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43334 "gram.c" break; case 1250: /* dostmt_opt_list: dostmt_opt_item */ #line 9235 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 43340 "gram.c" break; case 1251: /* dostmt_opt_list: dostmt_opt_list dostmt_opt_item */ #line 9236 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 43346 "gram.c" break; case 1252: /* dostmt_opt_item: Sconst */ #line 9241 "gram.y" { (yyval.defelt) = makeDefElem("as", (Node *) makeString((yyvsp[0].str)), (yylsp[0])); } #line 43354 "gram.c" break; case 1253: /* dostmt_opt_item: LANGUAGE NonReservedWord_or_Sconst */ #line 9245 "gram.y" { (yyval.defelt) = makeDefElem("language", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 43362 "gram.c" break; case 1254: /* CreateCastStmt: CREATE CAST '(' Typename AS Typename ')' WITH FUNCTION function_with_argtypes cast_context */ #line 9258 "gram.y" { 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 43377 "gram.c" break; case 1255: /* CreateCastStmt: CREATE CAST '(' Typename AS Typename ')' WITHOUT FUNCTION cast_context */ #line 9270 "gram.y" { 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 43392 "gram.c" break; case 1256: /* CreateCastStmt: CREATE CAST '(' Typename AS Typename ')' WITH INOUT cast_context */ #line 9282 "gram.y" { 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 43407 "gram.c" break; case 1257: /* cast_context: AS IMPLICIT_P */ #line 9294 "gram.y" { (yyval.ival) = COERCION_IMPLICIT; } #line 43413 "gram.c" break; case 1258: /* cast_context: AS ASSIGNMENT */ #line 9295 "gram.y" { (yyval.ival) = COERCION_ASSIGNMENT; } #line 43419 "gram.c" break; case 1259: /* cast_context: %empty */ #line 9296 "gram.y" { (yyval.ival) = COERCION_EXPLICIT; } #line 43425 "gram.c" break; case 1260: /* DropCastStmt: DROP CAST opt_if_exists '(' Typename AS Typename ')' opt_drop_behavior */ #line 9301 "gram.y" { 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 43440 "gram.c" break; case 1261: /* opt_if_exists: IF_P EXISTS */ #line 9313 "gram.y" { (yyval.boolean) = true; } #line 43446 "gram.c" break; case 1262: /* opt_if_exists: %empty */ #line 9314 "gram.y" { (yyval.boolean) = false; } #line 43452 "gram.c" break; case 1263: /* CreateTransformStmt: CREATE opt_or_replace TRANSFORM FOR Typename LANGUAGE name '(' transform_element_list ')' */ #line 9325 "gram.y" { 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 43467 "gram.c" break; case 1264: /* transform_element_list: FROM SQL_P WITH FUNCTION function_with_argtypes ',' TO SQL_P WITH FUNCTION function_with_argtypes */ #line 9338 "gram.y" { (yyval.list) = list_make2((yyvsp[-6].objwithargs), (yyvsp[0].objwithargs)); } #line 43475 "gram.c" break; case 1265: /* transform_element_list: TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes */ #line 9342 "gram.y" { (yyval.list) = list_make2((yyvsp[0].objwithargs), (yyvsp[-6].objwithargs)); } #line 43483 "gram.c" break; case 1266: /* transform_element_list: FROM SQL_P WITH FUNCTION function_with_argtypes */ #line 9346 "gram.y" { (yyval.list) = list_make2((yyvsp[0].objwithargs), NULL); } #line 43491 "gram.c" break; case 1267: /* transform_element_list: TO SQL_P WITH FUNCTION function_with_argtypes */ #line 9350 "gram.y" { (yyval.list) = list_make2(NULL, (yyvsp[0].objwithargs)); } #line 43499 "gram.c" break; case 1268: /* DropTransformStmt: DROP TRANSFORM opt_if_exists FOR Typename LANGUAGE name opt_drop_behavior */ #line 9357 "gram.y" { 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 43513 "gram.c" break; case 1269: /* ReindexStmt: REINDEX opt_reindex_option_list reindex_target_relation opt_concurrently qualified_name */ #line 9379 "gram.y" { 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 43530 "gram.c" break; case 1270: /* ReindexStmt: REINDEX opt_reindex_option_list SCHEMA opt_concurrently name */ #line 9392 "gram.y" { 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 43547 "gram.c" break; case 1271: /* ReindexStmt: REINDEX opt_reindex_option_list reindex_target_all opt_concurrently opt_single_name */ #line 9405 "gram.y" { 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 43564 "gram.c" break; case 1272: /* reindex_target_relation: INDEX */ #line 9419 "gram.y" { (yyval.ival) = REINDEX_OBJECT_INDEX; } #line 43570 "gram.c" break; case 1273: /* reindex_target_relation: TABLE */ #line 9420 "gram.y" { (yyval.ival) = REINDEX_OBJECT_TABLE; } #line 43576 "gram.c" break; case 1274: /* reindex_target_all: SYSTEM_P */ #line 9423 "gram.y" { (yyval.ival) = REINDEX_OBJECT_SYSTEM; } #line 43582 "gram.c" break; case 1275: /* reindex_target_all: DATABASE */ #line 9424 "gram.y" { (yyval.ival) = REINDEX_OBJECT_DATABASE; } #line 43588 "gram.c" break; case 1276: /* opt_reindex_option_list: '(' utility_option_list ')' */ #line 9427 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 43594 "gram.c" break; case 1277: /* opt_reindex_option_list: %empty */ #line 9428 "gram.y" { (yyval.list) = NULL; } #line 43600 "gram.c" break; case 1278: /* AlterTblSpcStmt: ALTER TABLESPACE name SET reloptions */ #line 9439 "gram.y" { AlterTableSpaceOptionsStmt *n = makeNode(AlterTableSpaceOptionsStmt); n->tablespacename = (yyvsp[-2].str); n->options = (yyvsp[0].list); n->isReset = false; (yyval.node) = (Node *) n; } #line 43614 "gram.c" break; case 1279: /* AlterTblSpcStmt: ALTER TABLESPACE name RESET reloptions */ #line 9449 "gram.y" { AlterTableSpaceOptionsStmt *n = makeNode(AlterTableSpaceOptionsStmt); n->tablespacename = (yyvsp[-2].str); n->options = (yyvsp[0].list); n->isReset = true; (yyval.node) = (Node *) n; } #line 43628 "gram.c" break; case 1280: /* RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name */ #line 9467 "gram.y" { 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 43642 "gram.c" break; case 1281: /* RenameStmt: ALTER COLLATION any_name RENAME TO name */ #line 9477 "gram.y" { 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 43656 "gram.c" break; case 1282: /* RenameStmt: ALTER CONVERSION_P any_name RENAME TO name */ #line 9487 "gram.y" { 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 43670 "gram.c" break; case 1283: /* RenameStmt: ALTER DATABASE name RENAME TO name */ #line 9497 "gram.y" { 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 43684 "gram.c" break; case 1284: /* RenameStmt: ALTER DOMAIN_P any_name RENAME TO name */ #line 9507 "gram.y" { 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 43698 "gram.c" break; case 1285: /* RenameStmt: ALTER DOMAIN_P any_name RENAME CONSTRAINT name TO name */ #line 9517 "gram.y" { 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 43712 "gram.c" break; case 1286: /* RenameStmt: ALTER FOREIGN DATA_P WRAPPER name RENAME TO name */ #line 9527 "gram.y" { 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 43726 "gram.c" break; case 1287: /* RenameStmt: ALTER FUNCTION function_with_argtypes RENAME TO name */ #line 9537 "gram.y" { 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 43740 "gram.c" break; case 1288: /* RenameStmt: ALTER GROUP_P RoleId RENAME TO RoleId */ #line 9547 "gram.y" { 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 43754 "gram.c" break; case 1289: /* RenameStmt: ALTER opt_procedural LANGUAGE name RENAME TO name */ #line 9557 "gram.y" { 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 43768 "gram.c" break; case 1290: /* RenameStmt: ALTER OPERATOR CLASS any_name USING name RENAME TO name */ #line 9567 "gram.y" { 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 43782 "gram.c" break; case 1291: /* RenameStmt: ALTER OPERATOR FAMILY any_name USING name RENAME TO name */ #line 9577 "gram.y" { 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 43796 "gram.c" break; case 1292: /* RenameStmt: ALTER POLICY name ON qualified_name RENAME TO name */ #line 9587 "gram.y" { 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 43811 "gram.c" break; case 1293: /* RenameStmt: ALTER POLICY IF_P EXISTS name ON qualified_name RENAME TO name */ #line 9598 "gram.y" { 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 43826 "gram.c" break; case 1294: /* RenameStmt: ALTER PROCEDURE function_with_argtypes RENAME TO name */ #line 9609 "gram.y" { 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 43840 "gram.c" break; case 1295: /* RenameStmt: ALTER PUBLICATION name RENAME TO name */ #line 9619 "gram.y" { 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 43854 "gram.c" break; case 1296: /* RenameStmt: ALTER ROUTINE function_with_argtypes RENAME TO name */ #line 9629 "gram.y" { 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 43868 "gram.c" break; case 1297: /* RenameStmt: ALTER SCHEMA name RENAME TO name */ #line 9639 "gram.y" { 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 43882 "gram.c" break; case 1298: /* RenameStmt: ALTER SERVER name RENAME TO name */ #line 9649 "gram.y" { 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 43896 "gram.c" break; case 1299: /* RenameStmt: ALTER SUBSCRIPTION name RENAME TO name */ #line 9659 "gram.y" { 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 43910 "gram.c" break; case 1300: /* RenameStmt: ALTER TABLE relation_expr RENAME TO name */ #line 9669 "gram.y" { 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 43925 "gram.c" break; case 1301: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME TO name */ #line 9680 "gram.y" { 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 43940 "gram.c" break; case 1302: /* RenameStmt: ALTER SEQUENCE qualified_name RENAME TO name */ #line 9691 "gram.y" { 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 43955 "gram.c" break; case 1303: /* RenameStmt: ALTER SEQUENCE IF_P EXISTS qualified_name RENAME TO name */ #line 9702 "gram.y" { 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 43970 "gram.c" break; case 1304: /* RenameStmt: ALTER VIEW qualified_name RENAME TO name */ #line 9713 "gram.y" { 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 43985 "gram.c" break; case 1305: /* RenameStmt: ALTER VIEW IF_P EXISTS qualified_name RENAME TO name */ #line 9724 "gram.y" { 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 44000 "gram.c" break; case 1306: /* RenameStmt: ALTER MATERIALIZED VIEW qualified_name RENAME TO name */ #line 9735 "gram.y" { 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 44015 "gram.c" break; case 1307: /* RenameStmt: ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name RENAME TO name */ #line 9746 "gram.y" { 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 44030 "gram.c" break; case 1308: /* RenameStmt: ALTER INDEX qualified_name RENAME TO name */ #line 9757 "gram.y" { 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 44045 "gram.c" break; case 1309: /* RenameStmt: ALTER INDEX IF_P EXISTS qualified_name RENAME TO name */ #line 9768 "gram.y" { 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 44060 "gram.c" break; case 1310: /* RenameStmt: ALTER FOREIGN TABLE relation_expr RENAME TO name */ #line 9779 "gram.y" { 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 44075 "gram.c" break; case 1311: /* RenameStmt: ALTER FOREIGN TABLE IF_P EXISTS relation_expr RENAME TO name */ #line 9790 "gram.y" { 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 44090 "gram.c" break; case 1312: /* RenameStmt: ALTER TABLE relation_expr RENAME opt_column name TO name */ #line 9801 "gram.y" { 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 44106 "gram.c" break; case 1313: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name */ #line 9813 "gram.y" { 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 44122 "gram.c" break; case 1314: /* RenameStmt: ALTER VIEW qualified_name RENAME opt_column name TO name */ #line 9825 "gram.y" { 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 44138 "gram.c" break; case 1315: /* RenameStmt: ALTER VIEW IF_P EXISTS qualified_name RENAME opt_column name TO name */ #line 9837 "gram.y" { 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 44154 "gram.c" break; case 1316: /* RenameStmt: ALTER MATERIALIZED VIEW qualified_name RENAME opt_column name TO name */ #line 9849 "gram.y" { 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 44170 "gram.c" break; case 1317: /* RenameStmt: ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name RENAME opt_column name TO name */ #line 9861 "gram.y" { 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 44186 "gram.c" break; case 1318: /* RenameStmt: ALTER TABLE relation_expr RENAME CONSTRAINT name TO name */ #line 9873 "gram.y" { 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 44201 "gram.c" break; case 1319: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME CONSTRAINT name TO name */ #line 9884 "gram.y" { 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 44216 "gram.c" break; case 1320: /* RenameStmt: ALTER FOREIGN TABLE relation_expr RENAME opt_column name TO name */ #line 9895 "gram.y" { 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 44232 "gram.c" break; case 1321: /* RenameStmt: ALTER FOREIGN TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name */ #line 9907 "gram.y" { 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 44248 "gram.c" break; case 1322: /* RenameStmt: ALTER RULE name ON qualified_name RENAME TO name */ #line 9919 "gram.y" { 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 44263 "gram.c" break; case 1323: /* RenameStmt: ALTER TRIGGER name ON qualified_name RENAME TO name */ #line 9930 "gram.y" { 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 44278 "gram.c" break; case 1324: /* RenameStmt: ALTER EVENT TRIGGER name RENAME TO name */ #line 9941 "gram.y" { 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 44291 "gram.c" break; case 1325: /* RenameStmt: ALTER ROLE RoleId RENAME TO RoleId */ #line 9950 "gram.y" { 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 44305 "gram.c" break; case 1326: /* RenameStmt: ALTER USER RoleId RENAME TO RoleId */ #line 9960 "gram.y" { 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 44319 "gram.c" break; case 1327: /* RenameStmt: ALTER TABLESPACE name RENAME TO name */ #line 9970 "gram.y" { 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 44333 "gram.c" break; case 1328: /* RenameStmt: ALTER STATISTICS any_name RENAME TO name */ #line 9980 "gram.y" { 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 44347 "gram.c" break; case 1329: /* RenameStmt: ALTER TEXT_P SEARCH PARSER any_name RENAME TO name */ #line 9990 "gram.y" { 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 44361 "gram.c" break; case 1330: /* RenameStmt: ALTER TEXT_P SEARCH DICTIONARY any_name RENAME TO name */ #line 10000 "gram.y" { 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 44375 "gram.c" break; case 1331: /* RenameStmt: ALTER TEXT_P SEARCH TEMPLATE any_name RENAME TO name */ #line 10010 "gram.y" { 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 44389 "gram.c" break; case 1332: /* RenameStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name RENAME TO name */ #line 10020 "gram.y" { 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 44403 "gram.c" break; case 1333: /* RenameStmt: ALTER TYPE_P any_name RENAME TO name */ #line 10030 "gram.y" { 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 44417 "gram.c" break; case 1334: /* RenameStmt: ALTER TYPE_P any_name RENAME ATTRIBUTE name TO name opt_drop_behavior */ #line 10040 "gram.y" { 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 44434 "gram.c" break; case 1337: /* opt_set_data: SET DATA_P */ #line 10058 "gram.y" { (yyval.ival) = 1; } #line 44440 "gram.c" break; case 1338: /* opt_set_data: %empty */ #line 10059 "gram.y" { (yyval.ival) = 0; } #line 44446 "gram.c" break; case 1339: /* AlterObjectDependsStmt: ALTER FUNCTION function_with_argtypes opt_no DEPENDS ON EXTENSION name */ #line 10070 "gram.y" { 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 44460 "gram.c" break; case 1340: /* AlterObjectDependsStmt: ALTER PROCEDURE function_with_argtypes opt_no DEPENDS ON EXTENSION name */ #line 10080 "gram.y" { 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 44474 "gram.c" break; case 1341: /* AlterObjectDependsStmt: ALTER ROUTINE function_with_argtypes opt_no DEPENDS ON EXTENSION name */ #line 10090 "gram.y" { 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 44488 "gram.c" break; case 1342: /* AlterObjectDependsStmt: ALTER TRIGGER name ON qualified_name opt_no DEPENDS ON EXTENSION name */ #line 10100 "gram.y" { 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 44503 "gram.c" break; case 1343: /* AlterObjectDependsStmt: ALTER MATERIALIZED VIEW qualified_name opt_no DEPENDS ON EXTENSION name */ #line 10111 "gram.y" { 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 44517 "gram.c" break; case 1344: /* AlterObjectDependsStmt: ALTER INDEX qualified_name opt_no DEPENDS ON EXTENSION name */ #line 10121 "gram.y" { 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 44531 "gram.c" break; case 1345: /* opt_no: NO */ #line 10132 "gram.y" { (yyval.boolean) = true; } #line 44537 "gram.c" break; case 1346: /* opt_no: %empty */ #line 10133 "gram.y" { (yyval.boolean) = false; } #line 44543 "gram.c" break; case 1347: /* AlterObjectSchemaStmt: ALTER AGGREGATE aggregate_with_argtypes SET SCHEMA name */ #line 10144 "gram.y" { 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 44557 "gram.c" break; case 1348: /* AlterObjectSchemaStmt: ALTER COLLATION any_name SET SCHEMA name */ #line 10154 "gram.y" { 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 44571 "gram.c" break; case 1349: /* AlterObjectSchemaStmt: ALTER CONVERSION_P any_name SET SCHEMA name */ #line 10164 "gram.y" { 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 44585 "gram.c" break; case 1350: /* AlterObjectSchemaStmt: ALTER DOMAIN_P any_name SET SCHEMA name */ #line 10174 "gram.y" { 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 44599 "gram.c" break; case 1351: /* AlterObjectSchemaStmt: ALTER EXTENSION name SET SCHEMA name */ #line 10184 "gram.y" { 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 44613 "gram.c" break; case 1352: /* AlterObjectSchemaStmt: ALTER FUNCTION function_with_argtypes SET SCHEMA name */ #line 10194 "gram.y" { 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 44627 "gram.c" break; case 1353: /* AlterObjectSchemaStmt: ALTER OPERATOR operator_with_argtypes SET SCHEMA name */ #line 10204 "gram.y" { 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 44641 "gram.c" break; case 1354: /* AlterObjectSchemaStmt: ALTER OPERATOR CLASS any_name USING name SET SCHEMA name */ #line 10214 "gram.y" { 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 44655 "gram.c" break; case 1355: /* AlterObjectSchemaStmt: ALTER OPERATOR FAMILY any_name USING name SET SCHEMA name */ #line 10224 "gram.y" { 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 44669 "gram.c" break; case 1356: /* AlterObjectSchemaStmt: ALTER PROCEDURE function_with_argtypes SET SCHEMA name */ #line 10234 "gram.y" { 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 44683 "gram.c" break; case 1357: /* AlterObjectSchemaStmt: ALTER ROUTINE function_with_argtypes SET SCHEMA name */ #line 10244 "gram.y" { 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 44697 "gram.c" break; case 1358: /* AlterObjectSchemaStmt: ALTER TABLE relation_expr SET SCHEMA name */ #line 10254 "gram.y" { 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 44711 "gram.c" break; case 1359: /* AlterObjectSchemaStmt: ALTER TABLE IF_P EXISTS relation_expr SET SCHEMA name */ #line 10264 "gram.y" { 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 44725 "gram.c" break; case 1360: /* AlterObjectSchemaStmt: ALTER STATISTICS any_name SET SCHEMA name */ #line 10274 "gram.y" { 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 44739 "gram.c" break; case 1361: /* AlterObjectSchemaStmt: ALTER TEXT_P SEARCH PARSER any_name SET SCHEMA name */ #line 10284 "gram.y" { 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 44753 "gram.c" break; case 1362: /* AlterObjectSchemaStmt: ALTER TEXT_P SEARCH DICTIONARY any_name SET SCHEMA name */ #line 10294 "gram.y" { 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 44767 "gram.c" break; case 1363: /* AlterObjectSchemaStmt: ALTER TEXT_P SEARCH TEMPLATE any_name SET SCHEMA name */ #line 10304 "gram.y" { 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 44781 "gram.c" break; case 1364: /* AlterObjectSchemaStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name SET SCHEMA name */ #line 10314 "gram.y" { 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 44795 "gram.c" break; case 1365: /* AlterObjectSchemaStmt: ALTER SEQUENCE qualified_name SET SCHEMA name */ #line 10324 "gram.y" { 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 44809 "gram.c" break; case 1366: /* AlterObjectSchemaStmt: ALTER SEQUENCE IF_P EXISTS qualified_name SET SCHEMA name */ #line 10334 "gram.y" { 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 44823 "gram.c" break; case 1367: /* AlterObjectSchemaStmt: ALTER VIEW qualified_name SET SCHEMA name */ #line 10344 "gram.y" { 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 44837 "gram.c" break; case 1368: /* AlterObjectSchemaStmt: ALTER VIEW IF_P EXISTS qualified_name SET SCHEMA name */ #line 10354 "gram.y" { 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 44851 "gram.c" break; case 1369: /* AlterObjectSchemaStmt: ALTER MATERIALIZED VIEW qualified_name SET SCHEMA name */ #line 10364 "gram.y" { 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 44865 "gram.c" break; case 1370: /* AlterObjectSchemaStmt: ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name SET SCHEMA name */ #line 10374 "gram.y" { 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 44879 "gram.c" break; case 1371: /* AlterObjectSchemaStmt: ALTER FOREIGN TABLE relation_expr SET SCHEMA name */ #line 10384 "gram.y" { 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 44893 "gram.c" break; case 1372: /* AlterObjectSchemaStmt: ALTER FOREIGN TABLE IF_P EXISTS relation_expr SET SCHEMA name */ #line 10394 "gram.y" { 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 44907 "gram.c" break; case 1373: /* AlterObjectSchemaStmt: ALTER TYPE_P any_name SET SCHEMA name */ #line 10404 "gram.y" { 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 44921 "gram.c" break; case 1374: /* AlterOperatorStmt: ALTER OPERATOR operator_with_argtypes SET '(' operator_def_list ')' */ #line 10423 "gram.y" { AlterOperatorStmt *n = makeNode(AlterOperatorStmt); n->opername = (yyvsp[-4].objwithargs); n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 44933 "gram.c" break; case 1375: /* operator_def_list: operator_def_elem */ #line 10432 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 44939 "gram.c" break; case 1376: /* operator_def_list: operator_def_list ',' operator_def_elem */ #line 10433 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 44945 "gram.c" break; case 1377: /* operator_def_elem: ColLabel '=' NONE */ #line 10437 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 44951 "gram.c" break; case 1378: /* operator_def_elem: ColLabel '=' operator_def_arg */ #line 10439 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 44957 "gram.c" break; case 1379: /* operator_def_elem: ColLabel */ #line 10441 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 44963 "gram.c" break; case 1380: /* operator_def_arg: func_type */ #line 10446 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].typnam); } #line 44969 "gram.c" break; case 1381: /* operator_def_arg: reserved_keyword */ #line 10447 "gram.y" { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 44975 "gram.c" break; case 1382: /* operator_def_arg: qual_all_Op */ #line 10448 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].list); } #line 44981 "gram.c" break; case 1383: /* operator_def_arg: NumericOnly */ #line 10449 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].node); } #line 44987 "gram.c" break; case 1384: /* operator_def_arg: Sconst */ #line 10450 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 44993 "gram.c" break; case 1385: /* AlterTypeStmt: ALTER TYPE_P any_name SET '(' operator_def_list ')' */ #line 10463 "gram.y" { AlterTypeStmt *n = makeNode(AlterTypeStmt); n->typeName = (yyvsp[-4].list); n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 45005 "gram.c" break; case 1386: /* AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec */ #line 10479 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45018 "gram.c" break; case 1387: /* AlterOwnerStmt: ALTER COLLATION any_name OWNER TO RoleSpec */ #line 10488 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_COLLATION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45031 "gram.c" break; case 1388: /* AlterOwnerStmt: ALTER CONVERSION_P any_name OWNER TO RoleSpec */ #line 10497 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45044 "gram.c" break; case 1389: /* AlterOwnerStmt: ALTER DATABASE name OWNER TO RoleSpec */ #line 10506 "gram.y" { 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 45057 "gram.c" break; case 1390: /* AlterOwnerStmt: ALTER DOMAIN_P any_name OWNER TO RoleSpec */ #line 10515 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45070 "gram.c" break; case 1391: /* AlterOwnerStmt: ALTER FUNCTION function_with_argtypes OWNER TO RoleSpec */ #line 10524 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45083 "gram.c" break; case 1392: /* AlterOwnerStmt: ALTER opt_procedural LANGUAGE name OWNER TO RoleSpec */ #line 10533 "gram.y" { 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 45096 "gram.c" break; case 1393: /* AlterOwnerStmt: ALTER LARGE_P OBJECT_P NumericOnly OWNER TO RoleSpec */ #line 10542 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-3].node); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45109 "gram.c" break; case 1394: /* AlterOwnerStmt: ALTER OPERATOR operator_with_argtypes OWNER TO RoleSpec */ #line 10551 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45122 "gram.c" break; case 1395: /* AlterOwnerStmt: ALTER OPERATOR CLASS any_name USING name OWNER TO RoleSpec */ #line 10560 "gram.y" { 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 45135 "gram.c" break; case 1396: /* AlterOwnerStmt: ALTER OPERATOR FAMILY any_name USING name OWNER TO RoleSpec */ #line 10569 "gram.y" { 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 45148 "gram.c" break; case 1397: /* AlterOwnerStmt: ALTER PROCEDURE function_with_argtypes OWNER TO RoleSpec */ #line 10578 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45161 "gram.c" break; case 1398: /* AlterOwnerStmt: ALTER ROUTINE function_with_argtypes OWNER TO RoleSpec */ #line 10587 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45174 "gram.c" break; case 1399: /* AlterOwnerStmt: ALTER SCHEMA name OWNER TO RoleSpec */ #line 10596 "gram.y" { 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 45187 "gram.c" break; case 1400: /* AlterOwnerStmt: ALTER TYPE_P any_name OWNER TO RoleSpec */ #line 10605 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TYPE; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45200 "gram.c" break; case 1401: /* AlterOwnerStmt: ALTER TABLESPACE name OWNER TO RoleSpec */ #line 10614 "gram.y" { 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 45213 "gram.c" break; case 1402: /* AlterOwnerStmt: ALTER STATISTICS any_name OWNER TO RoleSpec */ #line 10623 "gram.y" { 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 45226 "gram.c" break; case 1403: /* AlterOwnerStmt: ALTER TEXT_P SEARCH DICTIONARY any_name OWNER TO RoleSpec */ #line 10632 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45239 "gram.c" break; case 1404: /* AlterOwnerStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name OWNER TO RoleSpec */ #line 10641 "gram.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45252 "gram.c" break; case 1405: /* AlterOwnerStmt: ALTER FOREIGN DATA_P WRAPPER name OWNER TO RoleSpec */ #line 10650 "gram.y" { 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 45265 "gram.c" break; case 1406: /* AlterOwnerStmt: ALTER SERVER name OWNER TO RoleSpec */ #line 10659 "gram.y" { 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 45278 "gram.c" break; case 1407: /* AlterOwnerStmt: ALTER EVENT TRIGGER name OWNER TO RoleSpec */ #line 10668 "gram.y" { 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 45291 "gram.c" break; case 1408: /* AlterOwnerStmt: ALTER PUBLICATION name OWNER TO RoleSpec */ #line 10677 "gram.y" { 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 45304 "gram.c" break; case 1409: /* AlterOwnerStmt: ALTER SUBSCRIPTION name OWNER TO RoleSpec */ #line 10686 "gram.y" { 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 45317 "gram.c" break; case 1410: /* CreatePublicationStmt: CREATE PUBLICATION name opt_definition */ #line 10714 "gram.y" { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45329 "gram.c" break; case 1411: /* CreatePublicationStmt: CREATE PUBLICATION name FOR ALL TABLES opt_definition */ #line 10722 "gram.y" { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-4].str); n->options = (yyvsp[0].list); n->for_all_tables = true; (yyval.node) = (Node *) n; } #line 45342 "gram.c" break; case 1412: /* CreatePublicationStmt: CREATE PUBLICATION name FOR pub_obj_list opt_definition */ #line 10731 "gram.y" { 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 45356 "gram.c" break; case 1413: /* PublicationObjSpec: TABLE relation_expr opt_column_list OptWhereClause */ #line 10757 "gram.y" { (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 45369 "gram.c" break; case 1414: /* PublicationObjSpec: TABLES IN_P SCHEMA ColId */ #line 10766 "gram.y" { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA; (yyval.publicationobjectspec)->name = (yyvsp[0].str); (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 45380 "gram.c" break; case 1415: /* PublicationObjSpec: TABLES IN_P SCHEMA CURRENT_SCHEMA */ #line 10773 "gram.y" { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA; (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 45390 "gram.c" break; case 1416: /* PublicationObjSpec: ColId opt_column_list OptWhereClause */ #line 10779 "gram.y" { (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 45421 "gram.c" break; case 1417: /* PublicationObjSpec: ColId indirection opt_column_list OptWhereClause */ #line 10806 "gram.y" { (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 45435 "gram.c" break; case 1418: /* PublicationObjSpec: extended_relation_expr opt_column_list OptWhereClause */ #line 10817 "gram.y" { (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 45448 "gram.c" break; case 1419: /* PublicationObjSpec: CURRENT_SCHEMA */ #line 10826 "gram.y" { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 45458 "gram.c" break; case 1420: /* pub_obj_list: PublicationObjSpec */ #line 10834 "gram.y" { (yyval.list) = list_make1((yyvsp[0].publicationobjectspec)); } #line 45464 "gram.c" break; case 1421: /* pub_obj_list: pub_obj_list ',' PublicationObjSpec */ #line 10836 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].publicationobjectspec)); } #line 45470 "gram.c" break; case 1422: /* AlterPublicationStmt: ALTER PUBLICATION name SET definition */ #line 10858 "gram.y" { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45482 "gram.c" break; case 1423: /* AlterPublicationStmt: ALTER PUBLICATION name ADD_P pub_obj_list */ #line 10866 "gram.y" { 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 45496 "gram.c" break; case 1424: /* AlterPublicationStmt: ALTER PUBLICATION name SET pub_obj_list */ #line 10876 "gram.y" { 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 45510 "gram.c" break; case 1425: /* AlterPublicationStmt: ALTER PUBLICATION name DROP pub_obj_list */ #line 10886 "gram.y" { 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 45524 "gram.c" break; case 1426: /* CreateSubscriptionStmt: CREATE SUBSCRIPTION name CONNECTION Sconst PUBLICATION name_list opt_definition */ #line 10905 "gram.y" { 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 45538 "gram.c" break; case 1427: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name SET definition */ #line 10924 "gram.y" { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_OPTIONS; n->subname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45552 "gram.c" break; case 1428: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name CONNECTION Sconst */ #line 10934 "gram.y" { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_CONNECTION; n->subname = (yyvsp[-2].str); n->conninfo = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 45566 "gram.c" break; case 1429: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name REFRESH PUBLICATION opt_definition */ #line 10944 "gram.y" { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_REFRESH; n->subname = (yyvsp[-3].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45580 "gram.c" break; case 1430: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name ADD_P PUBLICATION name_list opt_definition */ #line 10954 "gram.y" { 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 45595 "gram.c" break; case 1431: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name DROP PUBLICATION name_list opt_definition */ #line 10965 "gram.y" { 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 45610 "gram.c" break; case 1432: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name SET PUBLICATION name_list opt_definition */ #line 10976 "gram.y" { 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 45625 "gram.c" break; case 1433: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name ENABLE_P */ #line 10987 "gram.y" { 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 45640 "gram.c" break; case 1434: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name DISABLE_P */ #line 10998 "gram.y" { 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 45655 "gram.c" break; case 1435: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name SKIP definition */ #line 11009 "gram.y" { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_SKIP; n->subname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45669 "gram.c" break; case 1436: /* DropSubscriptionStmt: DROP SUBSCRIPTION name opt_drop_behavior */ #line 11027 "gram.y" { DropSubscriptionStmt *n = makeNode(DropSubscriptionStmt); n->subname = (yyvsp[-1].str); n->missing_ok = false; n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 45682 "gram.c" break; case 1437: /* DropSubscriptionStmt: DROP SUBSCRIPTION IF_P EXISTS name opt_drop_behavior */ #line 11036 "gram.y" { DropSubscriptionStmt *n = makeNode(DropSubscriptionStmt); n->subname = (yyvsp[-1].str); n->missing_ok = true; n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 45695 "gram.c" break; case 1438: /* RuleStmt: CREATE opt_or_replace RULE name AS ON event TO qualified_name where_clause DO opt_instead RuleActionList */ #line 11055 "gram.y" { 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 45712 "gram.c" break; case 1439: /* RuleActionList: NOTHING */ #line 11070 "gram.y" { (yyval.list) = NIL; } #line 45718 "gram.c" break; case 1440: /* RuleActionList: RuleActionStmt */ #line 11071 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45724 "gram.c" break; case 1441: /* RuleActionList: '(' RuleActionMulti ')' */ #line 11072 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 45730 "gram.c" break; case 1442: /* RuleActionMulti: RuleActionMulti ';' RuleActionStmtOrEmpty */ #line 11078 "gram.y" { if ((yyvsp[0].node) != NULL) (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); else (yyval.list) = (yyvsp[-2].list); } #line 45740 "gram.c" break; case 1443: /* RuleActionMulti: RuleActionStmtOrEmpty */ #line 11084 "gram.y" { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1((yyvsp[0].node)); else (yyval.list) = NIL; } #line 45750 "gram.c" break; case 1449: /* RuleActionStmtOrEmpty: RuleActionStmt */ #line 11100 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 45756 "gram.c" break; case 1450: /* RuleActionStmtOrEmpty: %empty */ #line 11101 "gram.y" { (yyval.node) = NULL; } #line 45762 "gram.c" break; case 1451: /* event: SELECT */ #line 11104 "gram.y" { (yyval.ival) = CMD_SELECT; } #line 45768 "gram.c" break; case 1452: /* event: UPDATE */ #line 11105 "gram.y" { (yyval.ival) = CMD_UPDATE; } #line 45774 "gram.c" break; case 1453: /* event: DELETE_P */ #line 11106 "gram.y" { (yyval.ival) = CMD_DELETE; } #line 45780 "gram.c" break; case 1454: /* event: INSERT */ #line 11107 "gram.y" { (yyval.ival) = CMD_INSERT; } #line 45786 "gram.c" break; case 1455: /* opt_instead: INSTEAD */ #line 11111 "gram.y" { (yyval.boolean) = true; } #line 45792 "gram.c" break; case 1456: /* opt_instead: ALSO */ #line 11112 "gram.y" { (yyval.boolean) = false; } #line 45798 "gram.c" break; case 1457: /* opt_instead: %empty */ #line 11113 "gram.y" { (yyval.boolean) = false; } #line 45804 "gram.c" break; case 1458: /* NotifyStmt: NOTIFY ColId notify_payload */ #line 11126 "gram.y" { NotifyStmt *n = makeNode(NotifyStmt); n->conditionname = (yyvsp[-1].str); n->payload = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 45816 "gram.c" break; case 1459: /* notify_payload: ',' Sconst */ #line 11136 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 45822 "gram.c" break; case 1460: /* notify_payload: %empty */ #line 11137 "gram.y" { (yyval.str) = NULL; } #line 45828 "gram.c" break; case 1461: /* ListenStmt: LISTEN ColId */ #line 11141 "gram.y" { ListenStmt *n = makeNode(ListenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 45839 "gram.c" break; case 1462: /* UnlistenStmt: UNLISTEN ColId */ #line 11151 "gram.y" { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 45850 "gram.c" break; case 1463: /* UnlistenStmt: UNLISTEN '*' */ #line 11158 "gram.y" { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = NULL; (yyval.node) = (Node *) n; } #line 45861 "gram.c" break; case 1464: /* TransactionStmt: ABORT_P opt_transaction opt_transaction_chain */ #line 11178 "gram.y" { 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 45875 "gram.c" break; case 1465: /* TransactionStmt: START TRANSACTION transaction_mode_list_or_empty */ #line 11188 "gram.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_START; n->options = (yyvsp[0].list); n->location = -1; (yyval.node) = (Node *) n; } #line 45888 "gram.c" break; case 1466: /* TransactionStmt: COMMIT opt_transaction opt_transaction_chain */ #line 11197 "gram.y" { 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 45902 "gram.c" break; case 1467: /* TransactionStmt: ROLLBACK opt_transaction opt_transaction_chain */ #line 11207 "gram.y" { 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 45916 "gram.c" break; case 1468: /* TransactionStmt: SAVEPOINT ColId */ #line 11217 "gram.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_SAVEPOINT; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 45929 "gram.c" break; case 1469: /* TransactionStmt: RELEASE SAVEPOINT ColId */ #line 11226 "gram.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 45942 "gram.c" break; case 1470: /* TransactionStmt: RELEASE ColId */ #line 11235 "gram.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 45955 "gram.c" break; case 1471: /* TransactionStmt: ROLLBACK opt_transaction TO SAVEPOINT ColId */ #line 11244 "gram.y" { 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 45968 "gram.c" break; case 1472: /* TransactionStmt: ROLLBACK opt_transaction TO ColId */ #line 11253 "gram.y" { 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 45981 "gram.c" break; case 1473: /* TransactionStmt: PREPARE TRANSACTION Sconst */ #line 11262 "gram.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_PREPARE; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 45994 "gram.c" break; case 1474: /* TransactionStmt: COMMIT PREPARED Sconst */ #line 11271 "gram.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT_PREPARED; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 46007 "gram.c" break; case 1475: /* TransactionStmt: ROLLBACK PREPARED Sconst */ #line 11280 "gram.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_PREPARED; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 46020 "gram.c" break; case 1476: /* TransactionStmtLegacy: BEGIN_P opt_transaction transaction_mode_list_or_empty */ #line 11292 "gram.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_BEGIN; n->options = (yyvsp[0].list); n->location = -1; (yyval.node) = (Node *) n; } #line 46033 "gram.c" break; case 1477: /* TransactionStmtLegacy: END_P opt_transaction opt_transaction_chain */ #line 11301 "gram.y" { 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 46047 "gram.c" break; case 1481: /* transaction_mode_item: ISOLATION LEVEL iso_level */ #line 11319 "gram.y" { (yyval.defelt) = makeDefElem("transaction_isolation", makeStringConst((yyvsp[0].str), (yylsp[0])), (yylsp[-2])); } #line 46054 "gram.c" break; case 1482: /* transaction_mode_item: READ ONLY */ #line 11322 "gram.y" { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(true, (yylsp[-1])), (yylsp[-1])); } #line 46061 "gram.c" break; case 1483: /* transaction_mode_item: READ WRITE */ #line 11325 "gram.y" { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 46068 "gram.c" break; case 1484: /* transaction_mode_item: DEFERRABLE */ #line 11328 "gram.y" { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(true, (yylsp[0])), (yylsp[0])); } #line 46075 "gram.c" break; case 1485: /* transaction_mode_item: NOT DEFERRABLE */ #line 11331 "gram.y" { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 46082 "gram.c" break; case 1486: /* transaction_mode_list: transaction_mode_item */ #line 11338 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 46088 "gram.c" break; case 1487: /* transaction_mode_list: transaction_mode_list ',' transaction_mode_item */ #line 11340 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 46094 "gram.c" break; case 1488: /* transaction_mode_list: transaction_mode_list transaction_mode_item */ #line 11342 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 46100 "gram.c" break; case 1490: /* transaction_mode_list_or_empty: %empty */ #line 11348 "gram.y" { (yyval.list) = NIL; } #line 46106 "gram.c" break; case 1491: /* opt_transaction_chain: AND CHAIN */ #line 11352 "gram.y" { (yyval.boolean) = true; } #line 46112 "gram.c" break; case 1492: /* opt_transaction_chain: AND NO CHAIN */ #line 11353 "gram.y" { (yyval.boolean) = false; } #line 46118 "gram.c" break; case 1493: /* opt_transaction_chain: %empty */ #line 11354 "gram.y" { (yyval.boolean) = false; } #line 46124 "gram.c" break; case 1494: /* ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option */ #line 11368 "gram.y" { 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 46141 "gram.c" break; case 1495: /* ViewStmt: CREATE OR REPLACE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option */ #line 11382 "gram.y" { 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 46158 "gram.c" break; case 1496: /* ViewStmt: CREATE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option */ #line 11396 "gram.y" { 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 46180 "gram.c" break; case 1497: /* ViewStmt: CREATE OR REPLACE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option */ #line 11415 "gram.y" { 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 46202 "gram.c" break; case 1498: /* opt_check_option: WITH CHECK OPTION */ #line 11435 "gram.y" { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 46208 "gram.c" break; case 1499: /* opt_check_option: WITH CASCADED CHECK OPTION */ #line 11436 "gram.y" { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 46214 "gram.c" break; case 1500: /* opt_check_option: WITH LOCAL CHECK OPTION */ #line 11437 "gram.y" { (yyval.ival) = LOCAL_CHECK_OPTION; } #line 46220 "gram.c" break; case 1501: /* opt_check_option: %empty */ #line 11438 "gram.y" { (yyval.ival) = NO_CHECK_OPTION; } #line 46226 "gram.c" break; case 1502: /* LoadStmt: LOAD file_name */ #line 11449 "gram.y" { LoadStmt *n = makeNode(LoadStmt); n->filename = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 46237 "gram.c" break; case 1503: /* CreatedbStmt: CREATE DATABASE name opt_with createdb_opt_list */ #line 11466 "gram.y" { CreatedbStmt *n = makeNode(CreatedbStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46249 "gram.c" break; case 1504: /* createdb_opt_list: createdb_opt_items */ #line 11476 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 46255 "gram.c" break; case 1505: /* createdb_opt_list: %empty */ #line 11477 "gram.y" { (yyval.list) = NIL; } #line 46261 "gram.c" break; case 1506: /* createdb_opt_items: createdb_opt_item */ #line 11481 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 46267 "gram.c" break; case 1507: /* createdb_opt_items: createdb_opt_items createdb_opt_item */ #line 11482 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 46273 "gram.c" break; case 1508: /* createdb_opt_item: createdb_opt_name opt_equal NumericOnly */ #line 11487 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (yyvsp[0].node), (yylsp[-2])); } #line 46281 "gram.c" break; case 1509: /* createdb_opt_item: createdb_opt_name opt_equal opt_boolean_or_string */ #line 11491 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 46289 "gram.c" break; case 1510: /* createdb_opt_item: createdb_opt_name opt_equal DEFAULT */ #line 11495 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 46297 "gram.c" break; case 1511: /* createdb_opt_name: IDENT */ #line 11512 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 46303 "gram.c" break; case 1512: /* createdb_opt_name: CONNECTION LIMIT */ #line 11513 "gram.y" { (yyval.str) = pstrdup("connection_limit"); } #line 46309 "gram.c" break; case 1513: /* createdb_opt_name: ENCODING */ #line 11514 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46315 "gram.c" break; case 1514: /* createdb_opt_name: LOCATION */ #line 11515 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46321 "gram.c" break; case 1515: /* createdb_opt_name: OWNER */ #line 11516 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46327 "gram.c" break; case 1516: /* createdb_opt_name: TABLESPACE */ #line 11517 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46333 "gram.c" break; case 1517: /* createdb_opt_name: TEMPLATE */ #line 11518 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46339 "gram.c" break; case 1520: /* AlterDatabaseStmt: ALTER DATABASE name WITH createdb_opt_list */ #line 11538 "gram.y" { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46351 "gram.c" break; case 1521: /* AlterDatabaseStmt: ALTER DATABASE name createdb_opt_list */ #line 11546 "gram.y" { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46363 "gram.c" break; case 1522: /* AlterDatabaseStmt: ALTER DATABASE name SET TABLESPACE name */ #line 11554 "gram.y" { 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 46376 "gram.c" break; case 1523: /* AlterDatabaseStmt: ALTER DATABASE name REFRESH COLLATION VERSION_P */ #line 11563 "gram.y" { AlterDatabaseRefreshCollStmt *n = makeNode(AlterDatabaseRefreshCollStmt); n->dbname = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 46387 "gram.c" break; case 1524: /* AlterDatabaseSetStmt: ALTER DATABASE name SetResetClause */ #line 11573 "gram.y" { AlterDatabaseSetStmt *n = makeNode(AlterDatabaseSetStmt); n->dbname = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 46399 "gram.c" break; case 1525: /* DropdbStmt: DROP DATABASE name */ #line 11591 "gram.y" { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = false; n->options = NULL; (yyval.node) = (Node *) n; } #line 46412 "gram.c" break; case 1526: /* DropdbStmt: DROP DATABASE IF_P EXISTS name */ #line 11600 "gram.y" { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = true; n->options = NULL; (yyval.node) = (Node *) n; } #line 46425 "gram.c" break; case 1527: /* DropdbStmt: DROP DATABASE name opt_with '(' drop_option_list ')' */ #line 11609 "gram.y" { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[-4].str); n->missing_ok = false; n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 46438 "gram.c" break; case 1528: /* DropdbStmt: DROP DATABASE IF_P EXISTS name opt_with '(' drop_option_list ')' */ #line 11618 "gram.y" { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[-4].str); n->missing_ok = true; n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 46451 "gram.c" break; case 1529: /* drop_option_list: drop_option */ #line 11630 "gram.y" { (yyval.list) = list_make1((Node *) (yyvsp[0].defelt)); } #line 46459 "gram.c" break; case 1530: /* drop_option_list: drop_option_list ',' drop_option */ #line 11634 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (Node *) (yyvsp[0].defelt)); } #line 46467 "gram.c" break; case 1531: /* drop_option: FORCE */ #line 11645 "gram.y" { (yyval.defelt) = makeDefElem("force", NULL, (yylsp[0])); } #line 46475 "gram.c" break; case 1532: /* AlterCollationStmt: ALTER COLLATION any_name REFRESH VERSION_P */ #line 11657 "gram.y" { AlterCollationStmt *n = makeNode(AlterCollationStmt); n->collname = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 46486 "gram.c" break; case 1533: /* AlterSystemStmt: ALTER SYSTEM_P SET generic_set */ #line 11675 "gram.y" { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 46497 "gram.c" break; case 1534: /* AlterSystemStmt: ALTER SYSTEM_P RESET generic_reset */ #line 11682 "gram.y" { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 46508 "gram.c" break; case 1535: /* CreateDomainStmt: CREATE DOMAIN_P any_name opt_as Typename ColQualList */ #line 11699 "gram.y" { 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 46522 "gram.c" break; case 1536: /* AlterDomainStmt: ALTER DOMAIN_P any_name alter_column_default */ #line 11713 "gram.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'T'; n->typeName = (yyvsp[-1].list); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 46535 "gram.c" break; case 1537: /* AlterDomainStmt: ALTER DOMAIN_P any_name DROP NOT NULL_P */ #line 11723 "gram.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'N'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 46547 "gram.c" break; case 1538: /* AlterDomainStmt: ALTER DOMAIN_P any_name SET NOT NULL_P */ #line 11732 "gram.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'O'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 46559 "gram.c" break; case 1539: /* AlterDomainStmt: ALTER DOMAIN_P any_name ADD_P DomainConstraint */ #line 11741 "gram.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'C'; n->typeName = (yyvsp[-2].list); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 46572 "gram.c" break; case 1540: /* AlterDomainStmt: ALTER DOMAIN_P any_name DROP CONSTRAINT name opt_drop_behavior */ #line 11751 "gram.y" { 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 46587 "gram.c" break; case 1541: /* AlterDomainStmt: ALTER DOMAIN_P any_name DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior */ #line 11763 "gram.y" { 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 46602 "gram.c" break; case 1542: /* AlterDomainStmt: ALTER DOMAIN_P any_name VALIDATE CONSTRAINT name */ #line 11775 "gram.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'V'; n->typeName = (yyvsp[-3].list); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 46615 "gram.c" break; case 1545: /* AlterTSDictionaryStmt: ALTER TEXT_P SEARCH DICTIONARY any_name definition */ #line 11798 "gram.y" { AlterTSDictionaryStmt *n = makeNode(AlterTSDictionaryStmt); n->dictname = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46627 "gram.c" break; case 1546: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name ADD_P MAPPING FOR name_list any_with any_name_list */ #line 11809 "gram.y" { 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 46643 "gram.c" break; case 1547: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list any_with any_name_list */ #line 11821 "gram.y" { 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 46659 "gram.c" break; case 1548: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING REPLACE any_name any_with any_name */ #line 11833 "gram.y" { 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 46675 "gram.c" break; case 1549: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list REPLACE any_name any_with any_name */ #line 11845 "gram.y" { 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 46691 "gram.c" break; case 1550: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING FOR name_list */ #line 11857 "gram.y" { 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 46705 "gram.c" break; case 1551: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING IF_P EXISTS FOR name_list */ #line 11867 "gram.y" { 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 46719 "gram.c" break; case 1554: /* CreateConversionStmt: CREATE opt_default CONVERSION_P any_name FOR Sconst TO Sconst FROM any_name */ #line 11896 "gram.y" { 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 46734 "gram.c" break; case 1555: /* ClusterStmt: CLUSTER '(' utility_option_list ')' qualified_name cluster_index_specification */ #line 11919 "gram.y" { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->params = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 46747 "gram.c" break; case 1556: /* ClusterStmt: CLUSTER '(' utility_option_list ')' */ #line 11928 "gram.y" { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->params = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 46760 "gram.c" break; case 1557: /* ClusterStmt: CLUSTER opt_verbose qualified_name cluster_index_specification */ #line 11938 "gram.y" { 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 46775 "gram.c" break; case 1558: /* ClusterStmt: CLUSTER opt_verbose */ #line 11950 "gram.y" { 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 46790 "gram.c" break; case 1559: /* ClusterStmt: CLUSTER opt_verbose name ON qualified_name */ #line 11962 "gram.y" { 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 46805 "gram.c" break; case 1560: /* cluster_index_specification: USING name */ #line 11975 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 46811 "gram.c" break; case 1561: /* cluster_index_specification: %empty */ #line 11976 "gram.y" { (yyval.str) = NULL; } #line 46817 "gram.c" break; case 1562: /* VacuumStmt: VACUUM opt_full opt_freeze opt_verbose opt_analyze opt_vacuum_relation_list */ #line 11989 "gram.y" { 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 46842 "gram.c" break; case 1563: /* VacuumStmt: VACUUM '(' utility_option_list ')' opt_vacuum_relation_list */ #line 12010 "gram.y" { VacuumStmt *n = makeNode(VacuumStmt); n->options = (yyvsp[-2].list); n->rels = (yyvsp[0].list); n->is_vacuumcmd = true; (yyval.node) = (Node *) n; } #line 46855 "gram.c" break; case 1564: /* AnalyzeStmt: analyze_keyword opt_verbose opt_vacuum_relation_list */ #line 12021 "gram.y" { 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 46871 "gram.c" break; case 1565: /* AnalyzeStmt: analyze_keyword '(' utility_option_list ')' opt_vacuum_relation_list */ #line 12033 "gram.y" { VacuumStmt *n = makeNode(VacuumStmt); n->options = (yyvsp[-2].list); n->rels = (yyvsp[0].list); n->is_vacuumcmd = false; (yyval.node) = (Node *) n; } #line 46884 "gram.c" break; case 1566: /* utility_option_list: utility_option_elem */ #line 12045 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 46892 "gram.c" break; case 1567: /* utility_option_list: utility_option_list ',' utility_option_elem */ #line 12049 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 46900 "gram.c" break; case 1570: /* utility_option_elem: utility_option_name utility_option_arg */ #line 12061 "gram.y" { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 46908 "gram.c" break; case 1571: /* utility_option_name: NonReservedWord */ #line 12067 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 46914 "gram.c" break; case 1572: /* utility_option_name: analyze_keyword */ #line 12068 "gram.y" { (yyval.str) = "analyze"; } #line 46920 "gram.c" break; case 1573: /* utility_option_name: FORMAT_LA */ #line 12069 "gram.y" { (yyval.str) = "format"; } #line 46926 "gram.c" break; case 1574: /* utility_option_arg: opt_boolean_or_string */ #line 12073 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 46932 "gram.c" break; case 1575: /* utility_option_arg: NumericOnly */ #line 12074 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].node); } #line 46938 "gram.c" break; case 1576: /* utility_option_arg: %empty */ #line 12075 "gram.y" { (yyval.node) = NULL; } #line 46944 "gram.c" break; case 1577: /* opt_analyze: analyze_keyword */ #line 12079 "gram.y" { (yyval.boolean) = true; } #line 46950 "gram.c" break; case 1578: /* opt_analyze: %empty */ #line 12080 "gram.y" { (yyval.boolean) = false; } #line 46956 "gram.c" break; case 1579: /* opt_verbose: VERBOSE */ #line 12084 "gram.y" { (yyval.boolean) = true; } #line 46962 "gram.c" break; case 1580: /* opt_verbose: %empty */ #line 12085 "gram.y" { (yyval.boolean) = false; } #line 46968 "gram.c" break; case 1581: /* opt_full: FULL */ #line 12088 "gram.y" { (yyval.boolean) = true; } #line 46974 "gram.c" break; case 1582: /* opt_full: %empty */ #line 12089 "gram.y" { (yyval.boolean) = false; } #line 46980 "gram.c" break; case 1583: /* opt_freeze: FREEZE */ #line 12092 "gram.y" { (yyval.boolean) = true; } #line 46986 "gram.c" break; case 1584: /* opt_freeze: %empty */ #line 12093 "gram.y" { (yyval.boolean) = false; } #line 46992 "gram.c" break; case 1585: /* opt_name_list: '(' name_list ')' */ #line 12097 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 46998 "gram.c" break; case 1586: /* opt_name_list: %empty */ #line 12098 "gram.y" { (yyval.list) = NIL; } #line 47004 "gram.c" break; case 1587: /* vacuum_relation: relation_expr opt_name_list */ #line 12103 "gram.y" { (yyval.node) = (Node *) makeVacuumRelation((yyvsp[-1].range), InvalidOid, (yyvsp[0].list)); } #line 47012 "gram.c" break; case 1588: /* vacuum_relation_list: vacuum_relation */ #line 12110 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47018 "gram.c" break; case 1589: /* vacuum_relation_list: vacuum_relation_list ',' vacuum_relation */ #line 12112 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 47024 "gram.c" break; case 1590: /* opt_vacuum_relation_list: vacuum_relation_list */ #line 12116 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 47030 "gram.c" break; case 1591: /* opt_vacuum_relation_list: %empty */ #line 12117 "gram.y" { (yyval.list) = NIL; } #line 47036 "gram.c" break; case 1592: /* ExplainStmt: EXPLAIN ExplainableStmt */ #line 12131 "gram.y" { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = NIL; (yyval.node) = (Node *) n; } #line 47048 "gram.c" break; case 1593: /* ExplainStmt: EXPLAIN analyze_keyword opt_verbose ExplainableStmt */ #line 12139 "gram.y" { 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 47063 "gram.c" break; case 1594: /* ExplainStmt: EXPLAIN VERBOSE ExplainableStmt */ #line 12150 "gram.y" { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = list_make1(makeDefElem("verbose", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 47075 "gram.c" break; case 1595: /* ExplainStmt: EXPLAIN '(' utility_option_list ')' ExplainableStmt */ #line 12158 "gram.y" { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 47087 "gram.c" break; case 1606: /* PrepareStmt: PREPARE name prep_type_clause AS PreparableStmt */ #line 12188 "gram.y" { PrepareStmt *n = makeNode(PrepareStmt); n->name = (yyvsp[-3].str); n->argtypes = (yyvsp[-2].list); n->query = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 47100 "gram.c" break; case 1607: /* prep_type_clause: '(' type_list ')' */ #line 12198 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 47106 "gram.c" break; case 1608: /* prep_type_clause: %empty */ #line 12199 "gram.y" { (yyval.list) = NIL; } #line 47112 "gram.c" break; case 1614: /* ExecuteStmt: EXECUTE name execute_param_clause */ #line 12218 "gram.y" { ExecuteStmt *n = makeNode(ExecuteStmt); n->name = (yyvsp[-1].str); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 47124 "gram.c" break; case 1615: /* ExecuteStmt: CREATE OptTemp TABLE create_as_target AS EXECUTE name execute_param_clause opt_with_data */ #line 12227 "gram.y" { 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 47145 "gram.c" break; case 1616: /* ExecuteStmt: CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS EXECUTE name execute_param_clause opt_with_data */ #line 12245 "gram.y" { 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 47166 "gram.c" break; case 1617: /* execute_param_clause: '(' expr_list ')' */ #line 12263 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 47172 "gram.c" break; case 1618: /* execute_param_clause: %empty */ #line 12264 "gram.y" { (yyval.list) = NIL; } #line 47178 "gram.c" break; case 1619: /* DeallocateStmt: DEALLOCATE name */ #line 12275 "gram.y" { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); n->isall = false; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 47191 "gram.c" break; case 1620: /* DeallocateStmt: DEALLOCATE PREPARE name */ #line 12284 "gram.y" { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); n->isall = false; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 47204 "gram.c" break; case 1621: /* DeallocateStmt: DEALLOCATE ALL */ #line 12293 "gram.y" { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; n->isall = true; n->location = -1; (yyval.node) = (Node *) n; } #line 47217 "gram.c" break; case 1622: /* DeallocateStmt: DEALLOCATE PREPARE ALL */ #line 12302 "gram.y" { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; n->isall = true; n->location = -1; (yyval.node) = (Node *) n; } #line 47230 "gram.c" break; case 1623: /* InsertStmt: opt_with_clause INSERT INTO insert_target insert_rest opt_on_conflict returning_clause */ #line 12322 "gram.y" { (yyvsp[-2].istmt)->relation = (yyvsp[-3].range); (yyvsp[-2].istmt)->onConflictClause = (yyvsp[-1].onconflict); (yyvsp[-2].istmt)->returningClause = (yyvsp[0].retclause); (yyvsp[-2].istmt)->withClause = (yyvsp[-6].with); (yyval.node) = (Node *) (yyvsp[-2].istmt); } #line 47242 "gram.c" break; case 1624: /* insert_target: qualified_name */ #line 12339 "gram.y" { (yyval.range) = (yyvsp[0].range); } #line 47250 "gram.c" break; case 1625: /* insert_target: qualified_name AS ColId */ #line 12343 "gram.y" { (yyvsp[-2].range)->alias = makeAlias((yyvsp[0].str), NIL); (yyval.range) = (yyvsp[-2].range); } #line 47259 "gram.c" break; case 1626: /* insert_rest: SelectStmt */ #line 12351 "gram.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 47269 "gram.c" break; case 1627: /* insert_rest: OVERRIDING override_kind VALUE_P SelectStmt */ #line 12357 "gram.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->override = (yyvsp[-2].ival); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 47280 "gram.c" break; case 1628: /* insert_rest: '(' insert_column_list ')' SelectStmt */ #line 12364 "gram.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-2].list); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 47290 "gram.c" break; case 1629: /* insert_rest: '(' insert_column_list ')' OVERRIDING override_kind VALUE_P SelectStmt */ #line 12370 "gram.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-5].list); (yyval.istmt)->override = (yyvsp[-2].ival); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 47301 "gram.c" break; case 1630: /* insert_rest: DEFAULT VALUES */ #line 12377 "gram.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = NULL; } #line 47311 "gram.c" break; case 1631: /* override_kind: USER */ #line 12385 "gram.y" { (yyval.ival) = OVERRIDING_USER_VALUE; } #line 47317 "gram.c" break; case 1632: /* override_kind: SYSTEM_P */ #line 12386 "gram.y" { (yyval.ival) = OVERRIDING_SYSTEM_VALUE; } #line 47323 "gram.c" break; case 1633: /* insert_column_list: insert_column_item */ #line 12391 "gram.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 47329 "gram.c" break; case 1634: /* insert_column_list: insert_column_list ',' insert_column_item */ #line 12393 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 47335 "gram.c" break; case 1635: /* insert_column_item: ColId opt_indirection */ #line 12398 "gram.y" { (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 47347 "gram.c" break; case 1636: /* opt_on_conflict: ON CONFLICT opt_conf_expr DO UPDATE SET set_clause_list where_clause */ #line 12409 "gram.y" { (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 47360 "gram.c" break; case 1637: /* opt_on_conflict: ON CONFLICT opt_conf_expr DO NOTHING */ #line 12419 "gram.y" { (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 47373 "gram.c" break; case 1638: /* opt_on_conflict: %empty */ #line 12428 "gram.y" { (yyval.onconflict) = NULL; } #line 47381 "gram.c" break; case 1639: /* opt_conf_expr: '(' index_params ')' where_clause */ #line 12435 "gram.y" { (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 47393 "gram.c" break; case 1640: /* opt_conf_expr: ON CONSTRAINT name */ #line 12444 "gram.y" { (yyval.infer) = makeNode(InferClause); (yyval.infer)->indexElems = NIL; (yyval.infer)->whereClause = NULL; (yyval.infer)->conname = (yyvsp[0].str); (yyval.infer)->location = (yylsp[-2]); } #line 47405 "gram.c" break; case 1641: /* opt_conf_expr: %empty */ #line 12452 "gram.y" { (yyval.infer) = NULL; } #line 47413 "gram.c" break; case 1642: /* returning_clause: RETURNING returning_with_clause target_list */ #line 12459 "gram.y" { ReturningClause *n = makeNode(ReturningClause); n->options = (yyvsp[-1].list); n->exprs = (yyvsp[0].list); (yyval.retclause) = n; } #line 47425 "gram.c" break; case 1643: /* returning_clause: %empty */ #line 12467 "gram.y" { (yyval.retclause) = NULL; } #line 47433 "gram.c" break; case 1644: /* returning_with_clause: WITH '(' returning_options ')' */ #line 12473 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 47439 "gram.c" break; case 1645: /* returning_with_clause: %empty */ #line 12474 "gram.y" { (yyval.list) = NIL; } #line 47445 "gram.c" break; case 1646: /* returning_options: returning_option */ #line 12478 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47451 "gram.c" break; case 1647: /* returning_options: returning_options ',' returning_option */ #line 12479 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 47457 "gram.c" break; case 1648: /* returning_option: returning_option_kind AS ColId */ #line 12484 "gram.y" { ReturningOption *n = makeNode(ReturningOption); n->option = (yyvsp[-2].retoptionkind); n->value = (yyvsp[0].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 47470 "gram.c" break; case 1649: /* returning_option_kind: OLD */ #line 12495 "gram.y" { (yyval.retoptionkind) = RETURNING_OPTION_OLD; } #line 47476 "gram.c" break; case 1650: /* returning_option_kind: NEW */ #line 12496 "gram.y" { (yyval.retoptionkind) = RETURNING_OPTION_NEW; } #line 47482 "gram.c" break; case 1651: /* DeleteStmt: opt_with_clause DELETE_P FROM relation_expr_opt_alias using_clause where_or_current_clause returning_clause */ #line 12509 "gram.y" { DeleteStmt *n = makeNode(DeleteStmt); n->relation = (yyvsp[-3].range); n->usingClause = (yyvsp[-2].list); n->whereClause = (yyvsp[-1].node); n->returningClause = (yyvsp[0].retclause); n->withClause = (yyvsp[-6].with); (yyval.node) = (Node *) n; } #line 47497 "gram.c" break; case 1652: /* using_clause: USING from_list */ #line 12522 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 47503 "gram.c" break; case 1653: /* using_clause: %empty */ #line 12523 "gram.y" { (yyval.list) = NIL; } #line 47509 "gram.c" break; case 1654: /* LockStmt: LOCK_P opt_table relation_expr_list opt_lock opt_nowait */ #line 12535 "gram.y" { LockStmt *n = makeNode(LockStmt); n->relations = (yyvsp[-2].list); n->mode = (yyvsp[-1].ival); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 47522 "gram.c" break; case 1655: /* opt_lock: IN_P lock_type MODE */ #line 12545 "gram.y" { (yyval.ival) = (yyvsp[-1].ival); } #line 47528 "gram.c" break; case 1656: /* opt_lock: %empty */ #line 12546 "gram.y" { (yyval.ival) = AccessExclusiveLock; } #line 47534 "gram.c" break; case 1657: /* lock_type: ACCESS SHARE */ #line 12549 "gram.y" { (yyval.ival) = AccessShareLock; } #line 47540 "gram.c" break; case 1658: /* lock_type: ROW SHARE */ #line 12550 "gram.y" { (yyval.ival) = RowShareLock; } #line 47546 "gram.c" break; case 1659: /* lock_type: ROW EXCLUSIVE */ #line 12551 "gram.y" { (yyval.ival) = RowExclusiveLock; } #line 47552 "gram.c" break; case 1660: /* lock_type: SHARE UPDATE EXCLUSIVE */ #line 12552 "gram.y" { (yyval.ival) = ShareUpdateExclusiveLock; } #line 47558 "gram.c" break; case 1661: /* lock_type: SHARE */ #line 12553 "gram.y" { (yyval.ival) = ShareLock; } #line 47564 "gram.c" break; case 1662: /* lock_type: SHARE ROW EXCLUSIVE */ #line 12554 "gram.y" { (yyval.ival) = ShareRowExclusiveLock; } #line 47570 "gram.c" break; case 1663: /* lock_type: EXCLUSIVE */ #line 12555 "gram.y" { (yyval.ival) = ExclusiveLock; } #line 47576 "gram.c" break; case 1664: /* lock_type: ACCESS EXCLUSIVE */ #line 12556 "gram.y" { (yyval.ival) = AccessExclusiveLock; } #line 47582 "gram.c" break; case 1665: /* opt_nowait: NOWAIT */ #line 12559 "gram.y" { (yyval.boolean) = true; } #line 47588 "gram.c" break; case 1666: /* opt_nowait: %empty */ #line 12560 "gram.y" { (yyval.boolean) = false; } #line 47594 "gram.c" break; case 1667: /* opt_nowait_or_skip: NOWAIT */ #line 12564 "gram.y" { (yyval.ival) = LockWaitError; } #line 47600 "gram.c" break; case 1668: /* opt_nowait_or_skip: SKIP LOCKED */ #line 12565 "gram.y" { (yyval.ival) = LockWaitSkip; } #line 47606 "gram.c" break; case 1669: /* opt_nowait_or_skip: %empty */ #line 12566 "gram.y" { (yyval.ival) = LockWaitBlock; } #line 47612 "gram.c" break; case 1670: /* UpdateStmt: opt_with_clause UPDATE relation_expr_opt_alias SET set_clause_list from_clause where_or_current_clause returning_clause */ #line 12582 "gram.y" { 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->returningClause = (yyvsp[0].retclause); n->withClause = (yyvsp[-7].with); (yyval.node) = (Node *) n; } #line 47628 "gram.c" break; case 1671: /* set_clause_list: set_clause */ #line 12595 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 47634 "gram.c" break; case 1672: /* set_clause_list: set_clause_list ',' set_clause */ #line 12596 "gram.y" { (yyval.list) = list_concat((yyvsp[-2].list),(yyvsp[0].list)); } #line 47640 "gram.c" break; case 1673: /* set_clause: set_target '=' a_expr */ #line 12601 "gram.y" { (yyvsp[-2].target)->val = (Node *) (yyvsp[0].node); (yyval.list) = list_make1((yyvsp[-2].target)); } #line 47649 "gram.c" break; case 1674: /* set_clause: '(' set_target_list ')' '=' a_expr */ #line 12606 "gram.y" { 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 47674 "gram.c" break; case 1675: /* set_target: ColId opt_indirection */ #line 12630 "gram.y" { (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 47686 "gram.c" break; case 1676: /* set_target_list: set_target */ #line 12640 "gram.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 47692 "gram.c" break; case 1677: /* set_target_list: set_target_list ',' set_target */ #line 12641 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].target)); } #line 47698 "gram.c" break; case 1678: /* MergeStmt: opt_with_clause MERGE INTO relation_expr_opt_alias USING table_ref ON a_expr merge_when_list returning_clause */ #line 12658 "gram.y" { 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->returningClause = (yyvsp[0].retclause); (yyval.node) = (Node *) m; } #line 47715 "gram.c" break; case 1679: /* merge_when_list: merge_when_clause */ #line 12673 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47721 "gram.c" break; case 1680: /* merge_when_list: merge_when_list merge_when_clause */ #line 12674 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list),(yyvsp[0].node)); } #line 47727 "gram.c" break; case 1681: /* merge_when_clause: merge_when_tgt_matched opt_merge_when_condition THEN merge_update */ #line 12685 "gram.y" { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 47738 "gram.c" break; case 1682: /* merge_when_clause: merge_when_tgt_matched opt_merge_when_condition THEN merge_delete */ #line 12692 "gram.y" { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 47749 "gram.c" break; case 1683: /* merge_when_clause: merge_when_tgt_not_matched opt_merge_when_condition THEN merge_insert */ #line 12699 "gram.y" { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 47760 "gram.c" break; case 1684: /* merge_when_clause: merge_when_tgt_matched opt_merge_when_condition THEN DO NOTHING */ #line 12706 "gram.y" { MergeWhenClause *m = makeNode(MergeWhenClause); m->matchKind = (yyvsp[-4].mergematch); m->commandType = CMD_NOTHING; m->condition = (yyvsp[-3].node); (yyval.node) = (Node *) m; } #line 47774 "gram.c" break; case 1685: /* merge_when_clause: merge_when_tgt_not_matched opt_merge_when_condition THEN DO NOTHING */ #line 12716 "gram.y" { MergeWhenClause *m = makeNode(MergeWhenClause); m->matchKind = (yyvsp[-4].mergematch); m->commandType = CMD_NOTHING; m->condition = (yyvsp[-3].node); (yyval.node) = (Node *) m; } #line 47788 "gram.c" break; case 1686: /* merge_when_tgt_matched: WHEN MATCHED */ #line 12728 "gram.y" { (yyval.mergematch) = MERGE_WHEN_MATCHED; } #line 47794 "gram.c" break; case 1687: /* merge_when_tgt_matched: WHEN NOT MATCHED BY SOURCE */ #line 12729 "gram.y" { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_SOURCE; } #line 47800 "gram.c" break; case 1688: /* merge_when_tgt_not_matched: WHEN NOT MATCHED */ #line 12733 "gram.y" { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_TARGET; } #line 47806 "gram.c" break; case 1689: /* merge_when_tgt_not_matched: WHEN NOT MATCHED BY TARGET */ #line 12734 "gram.y" { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_TARGET; } #line 47812 "gram.c" break; case 1690: /* opt_merge_when_condition: AND a_expr */ #line 12738 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 47818 "gram.c" break; case 1691: /* opt_merge_when_condition: %empty */ #line 12739 "gram.y" { (yyval.node) = NULL; } #line 47824 "gram.c" break; case 1692: /* merge_update: UPDATE SET set_clause_list */ #line 12744 "gram.y" { 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 47838 "gram.c" break; case 1693: /* merge_delete: DELETE_P */ #line 12757 "gram.y" { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_DELETE; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = NIL; (yyval.mergewhen) = n; } #line 47852 "gram.c" break; case 1694: /* merge_insert: INSERT merge_values_clause */ #line 12770 "gram.y" { 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 47865 "gram.c" break; case 1695: /* merge_insert: INSERT OVERRIDING override_kind VALUE_P merge_values_clause */ #line 12779 "gram.y" { 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 47878 "gram.c" break; case 1696: /* merge_insert: INSERT '(' insert_column_list ')' merge_values_clause */ #line 12788 "gram.y" { 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 47891 "gram.c" break; case 1697: /* merge_insert: INSERT '(' insert_column_list ')' OVERRIDING override_kind VALUE_P merge_values_clause */ #line 12797 "gram.y" { 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 47904 "gram.c" break; case 1698: /* merge_insert: INSERT DEFAULT VALUES */ #line 12806 "gram.y" { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = NIL; (yyval.mergewhen) = n; } #line 47917 "gram.c" break; case 1699: /* merge_values_clause: VALUES '(' expr_list ')' */ #line 12818 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 47925 "gram.c" break; case 1700: /* DeclareCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR SelectStmt */ #line 12830 "gram.y" { 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 47939 "gram.c" break; case 1701: /* cursor_name: name */ #line 12841 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 47945 "gram.c" break; case 1702: /* cursor_options: %empty */ #line 12844 "gram.y" { (yyval.ival) = 0; } #line 47951 "gram.c" break; case 1703: /* cursor_options: cursor_options NO SCROLL */ #line 12845 "gram.y" { (yyval.ival) = (yyvsp[-2].ival) | CURSOR_OPT_NO_SCROLL; } #line 47957 "gram.c" break; case 1704: /* cursor_options: cursor_options SCROLL */ #line 12846 "gram.y" { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_SCROLL; } #line 47963 "gram.c" break; case 1705: /* cursor_options: cursor_options BINARY */ #line 12847 "gram.y" { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_BINARY; } #line 47969 "gram.c" break; case 1706: /* cursor_options: cursor_options ASENSITIVE */ #line 12848 "gram.y" { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_ASENSITIVE; } #line 47975 "gram.c" break; case 1707: /* cursor_options: cursor_options INSENSITIVE */ #line 12849 "gram.y" { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_INSENSITIVE; } #line 47981 "gram.c" break; case 1708: /* opt_hold: %empty */ #line 12852 "gram.y" { (yyval.ival) = 0; } #line 47987 "gram.c" break; case 1709: /* opt_hold: WITH HOLD */ #line 12853 "gram.y" { (yyval.ival) = CURSOR_OPT_HOLD; } #line 47993 "gram.c" break; case 1710: /* opt_hold: WITHOUT HOLD */ #line 12854 "gram.y" { (yyval.ival) = 0; } #line 47999 "gram.c" break; case 1713: /* select_with_parens: '(' select_no_parens ')' */ #line 12907 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 48005 "gram.c" break; case 1714: /* select_with_parens: '(' select_with_parens ')' */ #line 12908 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 48011 "gram.c" break; case 1715: /* select_no_parens: simple_select */ #line 12923 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48017 "gram.c" break; case 1716: /* select_no_parens: select_clause sort_clause */ #line 12925 "gram.y" { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 48028 "gram.c" break; case 1717: /* select_no_parens: select_clause opt_sort_clause for_locking_clause opt_select_limit */ #line 12932 "gram.y" { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), (yyvsp[0].selectlimit), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 48040 "gram.c" break; case 1718: /* select_no_parens: select_clause opt_sort_clause select_limit opt_for_locking_clause */ #line 12940 "gram.y" { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), (yyvsp[-1].selectlimit), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 48052 "gram.c" break; case 1719: /* select_no_parens: with_clause select_clause */ #line 12948 "gram.y" { insertSelectOptions((SelectStmt *) (yyvsp[0].node), NULL, NIL, NULL, (yyvsp[-1].with), yyscanner); (yyval.node) = (yyvsp[0].node); } #line 48064 "gram.c" break; case 1720: /* select_no_parens: with_clause select_clause sort_clause */ #line 12956 "gram.y" { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, (yyvsp[-2].with), yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 48076 "gram.c" break; case 1721: /* select_no_parens: with_clause select_clause opt_sort_clause for_locking_clause opt_select_limit */ #line 12964 "gram.y" { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), (yyvsp[0].selectlimit), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 48088 "gram.c" break; case 1722: /* select_no_parens: with_clause select_clause opt_sort_clause select_limit opt_for_locking_clause */ #line 12972 "gram.y" { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), (yyvsp[-1].selectlimit), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 48100 "gram.c" break; case 1723: /* select_clause: simple_select */ #line 12982 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48106 "gram.c" break; case 1724: /* select_clause: select_with_parens */ #line 12983 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48112 "gram.c" break; case 1725: /* simple_select: SELECT opt_all_clause opt_target_list into_clause from_clause where_clause group_clause having_clause window_clause */ #line 13018 "gram.y" { 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 48130 "gram.c" break; case 1726: /* simple_select: SELECT distinct_clause target_list into_clause from_clause where_clause group_clause having_clause window_clause */ #line 13034 "gram.y" { 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 48149 "gram.c" break; case 1727: /* simple_select: values_clause */ #line 13048 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48155 "gram.c" break; case 1728: /* simple_select: TABLE relation_expr */ #line 13050 "gram.y" { /* 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 48178 "gram.c" break; case 1729: /* simple_select: select_clause UNION set_quantifier select_clause */ #line 13069 "gram.y" { (yyval.node) = makeSetOp(SETOP_UNION, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 48186 "gram.c" break; case 1730: /* simple_select: select_clause INTERSECT set_quantifier select_clause */ #line 13073 "gram.y" { (yyval.node) = makeSetOp(SETOP_INTERSECT, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 48194 "gram.c" break; case 1731: /* simple_select: select_clause EXCEPT set_quantifier select_clause */ #line 13077 "gram.y" { (yyval.node) = makeSetOp(SETOP_EXCEPT, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 48202 "gram.c" break; case 1732: /* with_clause: WITH cte_list */ #line 13092 "gram.y" { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; (yyval.with)->location = (yylsp[-1]); } #line 48213 "gram.c" break; case 1733: /* with_clause: WITH_LA cte_list */ #line 13099 "gram.y" { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; (yyval.with)->location = (yylsp[-1]); } #line 48224 "gram.c" break; case 1734: /* with_clause: WITH RECURSIVE cte_list */ #line 13106 "gram.y" { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = true; (yyval.with)->location = (yylsp[-2]); } #line 48235 "gram.c" break; case 1735: /* cte_list: common_table_expr */ #line 13115 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 48241 "gram.c" break; case 1736: /* cte_list: cte_list ',' common_table_expr */ #line 13116 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 48247 "gram.c" break; case 1737: /* common_table_expr: name opt_name_list AS opt_materialized '(' PreparableStmt ')' opt_search_clause opt_cycle_clause */ #line 13120 "gram.y" { 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 48264 "gram.c" break; case 1738: /* opt_materialized: MATERIALIZED */ #line 13135 "gram.y" { (yyval.ival) = CTEMaterializeAlways; } #line 48270 "gram.c" break; case 1739: /* opt_materialized: NOT MATERIALIZED */ #line 13136 "gram.y" { (yyval.ival) = CTEMaterializeNever; } #line 48276 "gram.c" break; case 1740: /* opt_materialized: %empty */ #line 13137 "gram.y" { (yyval.ival) = CTEMaterializeDefault; } #line 48282 "gram.c" break; case 1741: /* opt_search_clause: SEARCH DEPTH FIRST_P BY columnList SET ColId */ #line 13142 "gram.y" { 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 48296 "gram.c" break; case 1742: /* opt_search_clause: SEARCH BREADTH FIRST_P BY columnList SET ColId */ #line 13152 "gram.y" { 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 48310 "gram.c" break; case 1743: /* opt_search_clause: %empty */ #line 13162 "gram.y" { (yyval.node) = NULL; } #line 48318 "gram.c" break; case 1744: /* opt_cycle_clause: CYCLE columnList SET ColId TO AexprConst DEFAULT AexprConst USING ColId */ #line 13169 "gram.y" { 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 48334 "gram.c" break; case 1745: /* opt_cycle_clause: CYCLE columnList SET ColId USING ColId */ #line 13181 "gram.y" { 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 48350 "gram.c" break; case 1746: /* opt_cycle_clause: %empty */ #line 13193 "gram.y" { (yyval.node) = NULL; } #line 48358 "gram.c" break; case 1747: /* opt_with_clause: with_clause */ #line 13199 "gram.y" { (yyval.with) = (yyvsp[0].with); } #line 48364 "gram.c" break; case 1748: /* opt_with_clause: %empty */ #line 13200 "gram.y" { (yyval.with) = NULL; } #line 48370 "gram.c" break; case 1749: /* into_clause: INTO OptTempTableName */ #line 13205 "gram.y" { (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 48385 "gram.c" break; case 1750: /* into_clause: %empty */ #line 13216 "gram.y" { (yyval.into) = NULL; } #line 48391 "gram.c" break; case 1751: /* OptTempTableName: TEMPORARY opt_table qualified_name */ #line 13225 "gram.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 48400 "gram.c" break; case 1752: /* OptTempTableName: TEMP opt_table qualified_name */ #line 13230 "gram.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 48409 "gram.c" break; case 1753: /* OptTempTableName: LOCAL TEMPORARY opt_table qualified_name */ #line 13235 "gram.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 48418 "gram.c" break; case 1754: /* OptTempTableName: LOCAL TEMP opt_table qualified_name */ #line 13240 "gram.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 48427 "gram.c" break; case 1755: /* OptTempTableName: GLOBAL TEMPORARY opt_table qualified_name */ #line 13245 "gram.y" { 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 48439 "gram.c" break; case 1756: /* OptTempTableName: GLOBAL TEMP opt_table qualified_name */ #line 13253 "gram.y" { 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 48451 "gram.c" break; case 1757: /* OptTempTableName: UNLOGGED opt_table qualified_name */ #line 13261 "gram.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_UNLOGGED; } #line 48460 "gram.c" break; case 1758: /* OptTempTableName: TABLE qualified_name */ #line 13266 "gram.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 48469 "gram.c" break; case 1759: /* OptTempTableName: qualified_name */ #line 13271 "gram.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 48478 "gram.c" break; case 1762: /* set_quantifier: ALL */ #line 13282 "gram.y" { (yyval.setquantifier) = SET_QUANTIFIER_ALL; } #line 48484 "gram.c" break; case 1763: /* set_quantifier: DISTINCT */ #line 13283 "gram.y" { (yyval.setquantifier) = SET_QUANTIFIER_DISTINCT; } #line 48490 "gram.c" break; case 1764: /* set_quantifier: %empty */ #line 13284 "gram.y" { (yyval.setquantifier) = SET_QUANTIFIER_DEFAULT; } #line 48496 "gram.c" break; case 1765: /* distinct_clause: DISTINCT */ #line 13291 "gram.y" { (yyval.list) = list_make1(NIL); } #line 48502 "gram.c" break; case 1766: /* distinct_clause: DISTINCT ON '(' expr_list ')' */ #line 13292 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 48508 "gram.c" break; case 1769: /* opt_distinct_clause: distinct_clause */ #line 13301 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 48514 "gram.c" break; case 1770: /* opt_distinct_clause: opt_all_clause */ #line 13302 "gram.y" { (yyval.list) = NIL; } #line 48520 "gram.c" break; case 1771: /* opt_sort_clause: sort_clause */ #line 13306 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 48526 "gram.c" break; case 1772: /* opt_sort_clause: %empty */ #line 13307 "gram.y" { (yyval.list) = NIL; } #line 48532 "gram.c" break; case 1773: /* sort_clause: ORDER BY sortby_list */ #line 13311 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 48538 "gram.c" break; case 1774: /* sortby_list: sortby */ #line 13315 "gram.y" { (yyval.list) = list_make1((yyvsp[0].sortby)); } #line 48544 "gram.c" break; case 1775: /* sortby_list: sortby_list ',' sortby */ #line 13316 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].sortby)); } #line 48550 "gram.c" break; case 1776: /* sortby: a_expr USING qual_all_Op opt_nulls_order */ #line 13320 "gram.y" { (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 48563 "gram.c" break; case 1777: /* sortby: a_expr opt_asc_desc opt_nulls_order */ #line 13329 "gram.y" { (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 48576 "gram.c" break; case 1778: /* select_limit: limit_clause offset_clause */ #line 13342 "gram.y" { (yyval.selectlimit) = (yyvsp[-1].selectlimit); ((yyval.selectlimit))->limitOffset = (yyvsp[0].node); ((yyval.selectlimit))->offsetLoc = (yylsp[0]); } #line 48586 "gram.c" break; case 1779: /* select_limit: offset_clause limit_clause */ #line 13348 "gram.y" { (yyval.selectlimit) = (yyvsp[0].selectlimit); ((yyval.selectlimit))->limitOffset = (yyvsp[-1].node); ((yyval.selectlimit))->offsetLoc = (yylsp[-1]); } #line 48596 "gram.c" break; case 1780: /* select_limit: limit_clause */ #line 13354 "gram.y" { (yyval.selectlimit) = (yyvsp[0].selectlimit); } #line 48604 "gram.c" break; case 1781: /* select_limit: offset_clause */ #line 13358 "gram.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = (yyvsp[0].node); n->limitCount = NULL; n->limitOption = LIMIT_OPTION_COUNT; n->offsetLoc = (yylsp[0]); n->countLoc = -1; n->optionLoc = -1; (yyval.selectlimit) = n; } #line 48620 "gram.c" break; case 1782: /* opt_select_limit: select_limit */ #line 13372 "gram.y" { (yyval.selectlimit) = (yyvsp[0].selectlimit); } #line 48626 "gram.c" break; case 1783: /* opt_select_limit: %empty */ #line 13373 "gram.y" { (yyval.selectlimit) = NULL; } #line 48632 "gram.c" break; case 1784: /* limit_clause: LIMIT select_limit_value */ #line 13378 "gram.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[0].node); n->limitOption = LIMIT_OPTION_COUNT; n->offsetLoc = -1; n->countLoc = (yylsp[-1]); n->optionLoc = -1; (yyval.selectlimit) = n; } #line 48648 "gram.c" break; case 1785: /* limit_clause: LIMIT select_limit_value ',' select_offset_value */ #line 13390 "gram.y" { /* 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 48661 "gram.c" break; case 1786: /* limit_clause: FETCH first_or_next select_fetch_first_value row_or_rows ONLY */ #line 13406 "gram.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[-2].node); n->limitOption = LIMIT_OPTION_COUNT; n->offsetLoc = -1; n->countLoc = (yylsp[-4]); n->optionLoc = -1; (yyval.selectlimit) = n; } #line 48677 "gram.c" break; case 1787: /* limit_clause: FETCH first_or_next select_fetch_first_value row_or_rows WITH TIES */ #line 13418 "gram.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[-3].node); n->limitOption = LIMIT_OPTION_WITH_TIES; n->offsetLoc = -1; n->countLoc = (yylsp[-5]); n->optionLoc = (yylsp[-1]); (yyval.selectlimit) = n; } #line 48693 "gram.c" break; case 1788: /* limit_clause: FETCH first_or_next row_or_rows ONLY */ #line 13430 "gram.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = makeIntConst(1, -1); n->limitOption = LIMIT_OPTION_COUNT; n->offsetLoc = -1; n->countLoc = (yylsp[-3]); n->optionLoc = -1; (yyval.selectlimit) = n; } #line 48709 "gram.c" break; case 1789: /* limit_clause: FETCH first_or_next row_or_rows WITH TIES */ #line 13442 "gram.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = makeIntConst(1, -1); n->limitOption = LIMIT_OPTION_WITH_TIES; n->offsetLoc = -1; n->countLoc = (yylsp[-4]); n->optionLoc = (yylsp[-1]); (yyval.selectlimit) = n; } #line 48725 "gram.c" break; case 1790: /* offset_clause: OFFSET select_offset_value */ #line 13457 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48731 "gram.c" break; case 1791: /* offset_clause: OFFSET select_fetch_first_value row_or_rows */ #line 13460 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 48737 "gram.c" break; case 1792: /* select_limit_value: a_expr */ #line 13464 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48743 "gram.c" break; case 1793: /* select_limit_value: ALL */ #line 13466 "gram.y" { /* LIMIT ALL is represented as a NULL constant */ (yyval.node) = makeNullAConst((yylsp[0])); } #line 48752 "gram.c" break; case 1794: /* select_offset_value: a_expr */ #line 13473 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48758 "gram.c" break; case 1795: /* select_fetch_first_value: c_expr */ #line 13493 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48764 "gram.c" break; case 1796: /* select_fetch_first_value: '+' I_or_F_const */ #line 13495 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 48770 "gram.c" break; case 1797: /* select_fetch_first_value: '-' I_or_F_const */ #line 13497 "gram.y" { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 48776 "gram.c" break; case 1798: /* I_or_F_const: Iconst */ #line 13501 "gram.y" { (yyval.node) = makeIntConst((yyvsp[0].ival),(yylsp[0])); } #line 48782 "gram.c" break; case 1799: /* I_or_F_const: FCONST */ #line 13502 "gram.y" { (yyval.node) = makeFloatConst((yyvsp[0].str),(yylsp[0])); } #line 48788 "gram.c" break; case 1800: /* row_or_rows: ROW */ #line 13506 "gram.y" { (yyval.ival) = 0; } #line 48794 "gram.c" break; case 1801: /* row_or_rows: ROWS */ #line 13507 "gram.y" { (yyval.ival) = 0; } #line 48800 "gram.c" break; case 1802: /* first_or_next: FIRST_P */ #line 13510 "gram.y" { (yyval.ival) = 0; } #line 48806 "gram.c" break; case 1803: /* first_or_next: NEXT */ #line 13511 "gram.y" { (yyval.ival) = 0; } #line 48812 "gram.c" break; case 1804: /* group_clause: GROUP_P BY set_quantifier group_by_list */ #line 13537 "gram.y" { GroupClause *n = (GroupClause *) palloc(sizeof(GroupClause)); n->distinct = (yyvsp[-1].setquantifier) == SET_QUANTIFIER_DISTINCT; n->list = (yyvsp[0].list); (yyval.groupclause) = n; } #line 48824 "gram.c" break; case 1805: /* group_clause: %empty */ #line 13545 "gram.y" { GroupClause *n = (GroupClause *) palloc(sizeof(GroupClause)); n->distinct = false; n->list = NIL; (yyval.groupclause) = n; } #line 48836 "gram.c" break; case 1806: /* group_by_list: group_by_item */ #line 13555 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 48842 "gram.c" break; case 1807: /* group_by_list: group_by_list ',' group_by_item */ #line 13556 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].node)); } #line 48848 "gram.c" break; case 1808: /* group_by_item: a_expr */ #line 13560 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48854 "gram.c" break; case 1809: /* group_by_item: empty_grouping_set */ #line 13561 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48860 "gram.c" break; case 1810: /* group_by_item: cube_clause */ #line 13562 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48866 "gram.c" break; case 1811: /* group_by_item: rollup_clause */ #line 13563 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48872 "gram.c" break; case 1812: /* group_by_item: grouping_sets_clause */ #line 13564 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48878 "gram.c" break; case 1813: /* empty_grouping_set: '(' ')' */ #line 13569 "gram.y" { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[-1])); } #line 48886 "gram.c" break; case 1814: /* rollup_clause: ROLLUP '(' expr_list ')' */ #line 13582 "gram.y" { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[-1].list), (yylsp[-3])); } #line 48894 "gram.c" break; case 1815: /* cube_clause: CUBE '(' expr_list ')' */ #line 13589 "gram.y" { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[-1].list), (yylsp[-3])); } #line 48902 "gram.c" break; case 1816: /* grouping_sets_clause: GROUPING SETS '(' group_by_list ')' */ #line 13596 "gram.y" { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[-1].list), (yylsp[-4])); } #line 48910 "gram.c" break; case 1817: /* having_clause: HAVING a_expr */ #line 13602 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 48916 "gram.c" break; case 1818: /* having_clause: %empty */ #line 13603 "gram.y" { (yyval.node) = NULL; } #line 48922 "gram.c" break; case 1819: /* for_locking_clause: for_locking_items */ #line 13607 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 48928 "gram.c" break; case 1820: /* for_locking_clause: FOR READ ONLY */ #line 13608 "gram.y" { (yyval.list) = NIL; } #line 48934 "gram.c" break; case 1821: /* opt_for_locking_clause: for_locking_clause */ #line 13612 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 48940 "gram.c" break; case 1822: /* opt_for_locking_clause: %empty */ #line 13613 "gram.y" { (yyval.list) = NIL; } #line 48946 "gram.c" break; case 1823: /* for_locking_items: for_locking_item */ #line 13617 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 48952 "gram.c" break; case 1824: /* for_locking_items: for_locking_items for_locking_item */ #line 13618 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 48958 "gram.c" break; case 1825: /* for_locking_item: for_locking_strength locked_rels_list opt_nowait_or_skip */ #line 13623 "gram.y" { LockingClause *n = makeNode(LockingClause); n->lockedRels = (yyvsp[-1].list); n->strength = (yyvsp[-2].ival); n->waitPolicy = (yyvsp[0].ival); (yyval.node) = (Node *) n; } #line 48971 "gram.c" break; case 1826: /* for_locking_strength: FOR UPDATE */ #line 13634 "gram.y" { (yyval.ival) = LCS_FORUPDATE; } #line 48977 "gram.c" break; case 1827: /* for_locking_strength: FOR NO KEY UPDATE */ #line 13635 "gram.y" { (yyval.ival) = LCS_FORNOKEYUPDATE; } #line 48983 "gram.c" break; case 1828: /* for_locking_strength: FOR SHARE */ #line 13636 "gram.y" { (yyval.ival) = LCS_FORSHARE; } #line 48989 "gram.c" break; case 1829: /* for_locking_strength: FOR KEY SHARE */ #line 13637 "gram.y" { (yyval.ival) = LCS_FORKEYSHARE; } #line 48995 "gram.c" break; case 1830: /* locked_rels_list: OF qualified_name_list */ #line 13641 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 49001 "gram.c" break; case 1831: /* locked_rels_list: %empty */ #line 13642 "gram.y" { (yyval.list) = NIL; } #line 49007 "gram.c" break; case 1832: /* values_clause: VALUES '(' expr_list ')' */ #line 13653 "gram.y" { SelectStmt *n = makeNode(SelectStmt); n->valuesLists = list_make1((yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 49018 "gram.c" break; case 1833: /* values_clause: values_clause ',' '(' expr_list ')' */ #line 13660 "gram.y" { SelectStmt *n = (SelectStmt *) (yyvsp[-4].node); n->valuesLists = lappend(n->valuesLists, (yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 49029 "gram.c" break; case 1834: /* from_clause: FROM from_list */ #line 13678 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 49035 "gram.c" break; case 1835: /* from_clause: %empty */ #line 13679 "gram.y" { (yyval.list) = NIL; } #line 49041 "gram.c" break; case 1836: /* from_list: table_ref */ #line 13683 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49047 "gram.c" break; case 1837: /* from_list: from_list ',' table_ref */ #line 13684 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 49053 "gram.c" break; case 1838: /* table_ref: relation_expr opt_alias_clause */ #line 13691 "gram.y" { (yyvsp[-1].range)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-1].range); } #line 49062 "gram.c" break; case 1839: /* table_ref: relation_expr opt_alias_clause tablesample_clause */ #line 13696 "gram.y" { 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 49075 "gram.c" break; case 1840: /* table_ref: func_table func_alias_clause */ #line 13705 "gram.y" { RangeFunction *n = (RangeFunction *) (yyvsp[-1].node); n->alias = linitial((yyvsp[0].list)); n->coldeflist = lsecond((yyvsp[0].list)); (yyval.node) = (Node *) n; } #line 49087 "gram.c" break; case 1841: /* table_ref: LATERAL_P func_table func_alias_clause */ #line 13713 "gram.y" { 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 49100 "gram.c" break; case 1842: /* table_ref: xmltable opt_alias_clause */ #line 13722 "gram.y" { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 49111 "gram.c" break; case 1843: /* table_ref: LATERAL_P xmltable opt_alias_clause */ #line 13729 "gram.y" { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->lateral = true; n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 49123 "gram.c" break; case 1844: /* table_ref: select_with_parens opt_alias_clause */ #line 13737 "gram.y" { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = false; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 49136 "gram.c" break; case 1845: /* table_ref: LATERAL_P select_with_parens opt_alias_clause */ #line 13746 "gram.y" { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = true; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 49149 "gram.c" break; case 1846: /* table_ref: joined_table */ #line 13755 "gram.y" { (yyval.node) = (Node *) (yyvsp[0].jexpr); } #line 49157 "gram.c" break; case 1847: /* table_ref: '(' joined_table ')' alias_clause */ #line 13759 "gram.y" { (yyvsp[-2].jexpr)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-2].jexpr); } #line 49166 "gram.c" break; case 1848: /* table_ref: json_table opt_alias_clause */ #line 13764 "gram.y" { JsonTable *jt = castNode(JsonTable, (yyvsp[-1].node)); jt->alias = (yyvsp[0].alias); (yyval.node) = (Node *) jt; } #line 49177 "gram.c" break; case 1849: /* table_ref: LATERAL_P json_table opt_alias_clause */ #line 13771 "gram.y" { JsonTable *jt = castNode(JsonTable, (yyvsp[-1].node)); jt->alias = (yyvsp[0].alias); jt->lateral = true; (yyval.node) = (Node *) jt; } #line 49189 "gram.c" break; case 1850: /* joined_table: '(' joined_table ')' */ #line 13800 "gram.y" { (yyval.jexpr) = (yyvsp[-1].jexpr); } #line 49197 "gram.c" break; case 1851: /* joined_table: table_ref CROSS JOIN table_ref */ #line 13804 "gram.y" { /* 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 49215 "gram.c" break; case 1852: /* joined_table: table_ref join_type JOIN table_ref join_qual */ #line 13818 "gram.y" { 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 49240 "gram.c" break; case 1853: /* joined_table: table_ref JOIN table_ref join_qual */ #line 13839 "gram.y" { /* 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 49266 "gram.c" break; case 1854: /* joined_table: table_ref NATURAL join_type JOIN table_ref */ #line 13861 "gram.y" { 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 49283 "gram.c" break; case 1855: /* joined_table: table_ref NATURAL JOIN table_ref */ #line 13874 "gram.y" { /* 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 49301 "gram.c" break; case 1856: /* alias_clause: AS ColId '(' name_list ')' */ #line 13891 "gram.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 49311 "gram.c" break; case 1857: /* alias_clause: AS ColId */ #line 13897 "gram.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 49320 "gram.c" break; case 1858: /* alias_clause: ColId '(' name_list ')' */ #line 13902 "gram.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 49330 "gram.c" break; case 1859: /* alias_clause: ColId */ #line 13908 "gram.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 49339 "gram.c" break; case 1860: /* opt_alias_clause: alias_clause */ #line 13914 "gram.y" { (yyval.alias) = (yyvsp[0].alias); } #line 49345 "gram.c" break; case 1861: /* opt_alias_clause: %empty */ #line 13915 "gram.y" { (yyval.alias) = NULL; } #line 49351 "gram.c" break; case 1862: /* opt_alias_clause_for_join_using: AS ColId */ #line 13926 "gram.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); /* the column name list will be inserted later */ } #line 49361 "gram.c" break; case 1863: /* opt_alias_clause_for_join_using: %empty */ #line 13931 "gram.y" { (yyval.alias) = NULL; } #line 49367 "gram.c" break; case 1864: /* func_alias_clause: alias_clause */ #line 13940 "gram.y" { (yyval.list) = list_make2((yyvsp[0].alias), NIL); } #line 49375 "gram.c" break; case 1865: /* func_alias_clause: AS '(' TableFuncElementList ')' */ #line 13944 "gram.y" { (yyval.list) = list_make2(NULL, (yyvsp[-1].list)); } #line 49383 "gram.c" break; case 1866: /* func_alias_clause: AS ColId '(' TableFuncElementList ')' */ #line 13948 "gram.y" { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 49394 "gram.c" break; case 1867: /* func_alias_clause: ColId '(' TableFuncElementList ')' */ #line 13955 "gram.y" { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 49405 "gram.c" break; case 1868: /* func_alias_clause: %empty */ #line 13962 "gram.y" { (yyval.list) = list_make2(NULL, NIL); } #line 49413 "gram.c" break; case 1869: /* join_type: FULL opt_outer */ #line 13967 "gram.y" { (yyval.jtype) = JOIN_FULL; } #line 49419 "gram.c" break; case 1870: /* join_type: LEFT opt_outer */ #line 13968 "gram.y" { (yyval.jtype) = JOIN_LEFT; } #line 49425 "gram.c" break; case 1871: /* join_type: RIGHT opt_outer */ #line 13969 "gram.y" { (yyval.jtype) = JOIN_RIGHT; } #line 49431 "gram.c" break; case 1872: /* join_type: INNER_P */ #line 13970 "gram.y" { (yyval.jtype) = JOIN_INNER; } #line 49437 "gram.c" break; case 1875: /* join_qual: USING '(' name_list ')' opt_alias_clause_for_join_using */ #line 13991 "gram.y" { (yyval.node) = (Node *) list_make2((yyvsp[-2].list), (yyvsp[0].alias)); } #line 49445 "gram.c" break; case 1876: /* join_qual: ON a_expr */ #line 13995 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 49453 "gram.c" break; case 1877: /* relation_expr: qualified_name */ #line 14003 "gram.y" { /* inheritance query, implicitly */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 49464 "gram.c" break; case 1878: /* relation_expr: extended_relation_expr */ #line 14010 "gram.y" { (yyval.range) = (yyvsp[0].range); } #line 49472 "gram.c" break; case 1879: /* extended_relation_expr: qualified_name '*' */ #line 14017 "gram.y" { /* inheritance query, explicitly */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 49483 "gram.c" break; case 1880: /* extended_relation_expr: ONLY qualified_name */ #line 14024 "gram.y" { /* no inheritance */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 49494 "gram.c" break; case 1881: /* extended_relation_expr: ONLY '(' qualified_name ')' */ #line 14031 "gram.y" { /* no inheritance, SQL99-style syntax */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 49505 "gram.c" break; case 1882: /* relation_expr_list: relation_expr */ #line 14041 "gram.y" { (yyval.list) = list_make1((yyvsp[0].range)); } #line 49511 "gram.c" break; case 1883: /* relation_expr_list: relation_expr_list ',' relation_expr */ #line 14042 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 49517 "gram.c" break; case 1884: /* relation_expr_opt_alias: relation_expr */ #line 14056 "gram.y" { (yyval.range) = (yyvsp[0].range); } #line 49525 "gram.c" break; case 1885: /* relation_expr_opt_alias: relation_expr ColId */ #line 14060 "gram.y" { Alias *alias = makeNode(Alias); alias->aliasname = (yyvsp[0].str); (yyvsp[-1].range)->alias = alias; (yyval.range) = (yyvsp[-1].range); } #line 49537 "gram.c" break; case 1886: /* relation_expr_opt_alias: relation_expr AS ColId */ #line 14068 "gram.y" { Alias *alias = makeNode(Alias); alias->aliasname = (yyvsp[0].str); (yyvsp[-2].range)->alias = alias; (yyval.range) = (yyvsp[-2].range); } #line 49549 "gram.c" break; case 1887: /* tablesample_clause: TABLESAMPLE func_name '(' expr_list ')' opt_repeatable_clause */ #line 14082 "gram.y" { 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 49564 "gram.c" break; case 1888: /* opt_repeatable_clause: REPEATABLE '(' a_expr ')' */ #line 14095 "gram.y" { (yyval.node) = (Node *) (yyvsp[-1].node); } #line 49570 "gram.c" break; case 1889: /* opt_repeatable_clause: %empty */ #line 14096 "gram.y" { (yyval.node) = NULL; } #line 49576 "gram.c" break; case 1890: /* func_table: func_expr_windowless opt_ordinality */ #line 14112 "gram.y" { 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 49591 "gram.c" break; case 1891: /* func_table: ROWS FROM '(' rowsfrom_list ')' opt_ordinality */ #line 14123 "gram.y" { 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 49606 "gram.c" break; case 1892: /* rowsfrom_item: func_expr_windowless opt_col_def_list */ #line 14136 "gram.y" { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].list)); } #line 49612 "gram.c" break; case 1893: /* rowsfrom_list: rowsfrom_item */ #line 14140 "gram.y" { (yyval.list) = list_make1((yyvsp[0].list)); } #line 49618 "gram.c" break; case 1894: /* rowsfrom_list: rowsfrom_list ',' rowsfrom_item */ #line 14141 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 49624 "gram.c" break; case 1895: /* opt_col_def_list: AS '(' TableFuncElementList ')' */ #line 14144 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 49630 "gram.c" break; case 1896: /* opt_col_def_list: %empty */ #line 14145 "gram.y" { (yyval.list) = NIL; } #line 49636 "gram.c" break; case 1897: /* opt_ordinality: WITH_LA ORDINALITY */ #line 14148 "gram.y" { (yyval.boolean) = true; } #line 49642 "gram.c" break; case 1898: /* opt_ordinality: %empty */ #line 14149 "gram.y" { (yyval.boolean) = false; } #line 49648 "gram.c" break; case 1899: /* where_clause: WHERE a_expr */ #line 14154 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 49654 "gram.c" break; case 1900: /* where_clause: %empty */ #line 14155 "gram.y" { (yyval.node) = NULL; } #line 49660 "gram.c" break; case 1901: /* where_or_current_clause: WHERE a_expr */ #line 14160 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 49666 "gram.c" break; case 1902: /* where_or_current_clause: WHERE CURRENT_P OF cursor_name */ #line 14162 "gram.y" { 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 49679 "gram.c" break; case 1903: /* where_or_current_clause: %empty */ #line 14170 "gram.y" { (yyval.node) = NULL; } #line 49685 "gram.c" break; case 1904: /* OptTableFuncElementList: TableFuncElementList */ #line 14175 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 49691 "gram.c" break; case 1905: /* OptTableFuncElementList: %empty */ #line 14176 "gram.y" { (yyval.list) = NIL; } #line 49697 "gram.c" break; case 1906: /* TableFuncElementList: TableFuncElement */ #line 14181 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49705 "gram.c" break; case 1907: /* TableFuncElementList: TableFuncElementList ',' TableFuncElement */ #line 14185 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 49713 "gram.c" break; case 1908: /* TableFuncElement: ColId Typename opt_collate_clause */ #line 14191 "gram.y" { 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 49736 "gram.c" break; case 1909: /* xmltable: XMLTABLE '(' c_expr xmlexists_argument COLUMNS xmltable_column_list ')' */ #line 14216 "gram.y" { 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 49751 "gram.c" break; case 1910: /* xmltable: XMLTABLE '(' XMLNAMESPACES '(' xml_namespace_list ')' ',' c_expr xmlexists_argument COLUMNS xmltable_column_list ')' */ #line 14228 "gram.y" { 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 49766 "gram.c" break; case 1911: /* xmltable_column_list: xmltable_column_el */ #line 14240 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49772 "gram.c" break; case 1912: /* xmltable_column_list: xmltable_column_list ',' xmltable_column_el */ #line 14241 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 49778 "gram.c" break; case 1913: /* xmltable_column_el: ColId Typename */ #line 14246 "gram.y" { 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 49796 "gram.c" break; case 1914: /* xmltable_column_el: ColId Typename xmltable_column_option_list */ #line 14260 "gram.y" { 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, "__pg__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 49857 "gram.c" break; case 1915: /* xmltable_column_el: ColId FOR ORDINALITY */ #line 14317 "gram.y" { 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 49872 "gram.c" break; case 1916: /* xmltable_column_option_list: xmltable_column_option_el */ #line 14331 "gram.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 49878 "gram.c" break; case 1917: /* xmltable_column_option_list: xmltable_column_option_list xmltable_column_option_el */ #line 14333 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 49884 "gram.c" break; case 1918: /* xmltable_column_option_el: IDENT b_expr */ #line 14338 "gram.y" { if (strcmp((yyvsp[-1].str), "__pg__is_not_null") == 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("option name \"%s\" cannot be used in XMLTABLE", (yyvsp[-1].str)), parser_errposition((yylsp[-1])))); (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 49897 "gram.c" break; case 1919: /* xmltable_column_option_el: DEFAULT b_expr */ #line 14347 "gram.y" { (yyval.defelt) = makeDefElem("default", (yyvsp[0].node), (yylsp[-1])); } #line 49903 "gram.c" break; case 1920: /* xmltable_column_option_el: NOT NULL_P */ #line 14349 "gram.y" { (yyval.defelt) = makeDefElem("__pg__is_not_null", (Node *) makeBoolean(true), (yylsp[-1])); } #line 49909 "gram.c" break; case 1921: /* xmltable_column_option_el: NULL_P */ #line 14351 "gram.y" { (yyval.defelt) = makeDefElem("__pg__is_not_null", (Node *) makeBoolean(false), (yylsp[0])); } #line 49915 "gram.c" break; case 1922: /* xmltable_column_option_el: PATH b_expr */ #line 14353 "gram.y" { (yyval.defelt) = makeDefElem("path", (yyvsp[0].node), (yylsp[-1])); } #line 49921 "gram.c" break; case 1923: /* xml_namespace_list: xml_namespace_el */ #line 14358 "gram.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 49927 "gram.c" break; case 1924: /* xml_namespace_list: xml_namespace_list ',' xml_namespace_el */ #line 14360 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 49933 "gram.c" break; case 1925: /* xml_namespace_el: b_expr AS ColLabel */ #line 14365 "gram.y" { (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 49945 "gram.c" break; case 1926: /* xml_namespace_el: DEFAULT b_expr */ #line 14373 "gram.y" { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = NULL; (yyval.target)->indirection = NIL; (yyval.target)->val = (yyvsp[0].node); (yyval.target)->location = (yylsp[-1]); } #line 49957 "gram.c" break; case 1927: /* json_table: JSON_TABLE '(' json_value_expr ',' a_expr json_table_path_name_opt json_passing_clause_opt COLUMNS '(' json_table_column_definition_list ')' json_on_error_clause_opt ')' */ #line 14389 "gram.y" { 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 49981 "gram.c" break; case 1928: /* json_table_path_name_opt: AS name */ #line 14411 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 49987 "gram.c" break; case 1929: /* json_table_path_name_opt: %empty */ #line 14412 "gram.y" { (yyval.str) = NULL; } #line 49993 "gram.c" break; case 1930: /* json_table_column_definition_list: json_table_column_definition */ #line 14417 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49999 "gram.c" break; case 1931: /* json_table_column_definition_list: json_table_column_definition_list ',' json_table_column_definition */ #line 14419 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 50005 "gram.c" break; case 1932: /* json_table_column_definition: ColId FOR ORDINALITY */ #line 14424 "gram.y" { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_FOR_ORDINALITY; n->name = (yyvsp[-2].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 50018 "gram.c" break; case 1933: /* json_table_column_definition: ColId Typename json_table_column_path_clause_opt json_wrapper_behavior json_quotes_clause_opt json_behavior_clause_opt */ #line 14437 "gram.y" { 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 50038 "gram.c" break; case 1934: /* json_table_column_definition: ColId Typename json_format_clause json_table_column_path_clause_opt json_wrapper_behavior json_quotes_clause_opt json_behavior_clause_opt */ #line 14457 "gram.y" { 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 50058 "gram.c" break; case 1935: /* json_table_column_definition: ColId Typename EXISTS json_table_column_path_clause_opt json_on_error_clause_opt */ #line 14475 "gram.y" { 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 50078 "gram.c" break; case 1936: /* json_table_column_definition: NESTED path_opt Sconst COLUMNS '(' json_table_column_definition_list ')' */ #line 14492 "gram.y" { 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 50093 "gram.c" break; case 1937: /* json_table_column_definition: NESTED path_opt Sconst AS name COLUMNS '(' json_table_column_definition_list ')' */ #line 14504 "gram.y" { 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 50108 "gram.c" break; case 1940: /* json_table_column_path_clause_opt: PATH Sconst */ #line 14523 "gram.y" { (yyval.node) = (Node *) makeJsonTablePathSpec((yyvsp[0].str), NULL, (yylsp[0]), -1); } #line 50114 "gram.c" break; case 1941: /* json_table_column_path_clause_opt: %empty */ #line 14525 "gram.y" { (yyval.node) = NULL; } #line 50120 "gram.c" break; case 1942: /* Typename: SimpleTypename opt_array_bounds */ #line 14539 "gram.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); } #line 50129 "gram.c" break; case 1943: /* Typename: SETOF SimpleTypename opt_array_bounds */ #line 14544 "gram.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); (yyval.typnam)->setof = true; } #line 50139 "gram.c" break; case 1944: /* Typename: SimpleTypename ARRAY '[' Iconst ']' */ #line 14551 "gram.y" { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); } #line 50148 "gram.c" break; case 1945: /* Typename: SETOF SimpleTypename ARRAY '[' Iconst ']' */ #line 14556 "gram.y" { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); (yyval.typnam)->setof = true; } #line 50158 "gram.c" break; case 1946: /* Typename: SimpleTypename ARRAY */ #line 14562 "gram.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); } #line 50167 "gram.c" break; case 1947: /* Typename: SETOF SimpleTypename ARRAY */ #line 14567 "gram.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); (yyval.typnam)->setof = true; } #line 50177 "gram.c" break; case 1948: /* opt_array_bounds: opt_array_bounds '[' ']' */ #line 14576 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), makeInteger(-1)); } #line 50183 "gram.c" break; case 1949: /* opt_array_bounds: opt_array_bounds '[' Iconst ']' */ #line 14578 "gram.y" { (yyval.list) = lappend((yyvsp[-3].list), makeInteger((yyvsp[-1].ival))); } #line 50189 "gram.c" break; case 1950: /* opt_array_bounds: %empty */ #line 14580 "gram.y" { (yyval.list) = NIL; } #line 50195 "gram.c" break; case 1951: /* SimpleTypename: GenericType */ #line 14584 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50201 "gram.c" break; case 1952: /* SimpleTypename: Numeric */ #line 14585 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50207 "gram.c" break; case 1953: /* SimpleTypename: Bit */ #line 14586 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50213 "gram.c" break; case 1954: /* SimpleTypename: Character */ #line 14587 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50219 "gram.c" break; case 1955: /* SimpleTypename: ConstDatetime */ #line 14588 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50225 "gram.c" break; case 1956: /* SimpleTypename: ConstInterval opt_interval */ #line 14590 "gram.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->typmods = (yyvsp[0].list); } #line 50234 "gram.c" break; case 1957: /* SimpleTypename: ConstInterval '(' Iconst ')' */ #line 14595 "gram.y" { (yyval.typnam) = (yyvsp[-3].typnam); (yyval.typnam)->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 50244 "gram.c" break; case 1958: /* SimpleTypename: JsonType */ #line 14600 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50250 "gram.c" break; case 1959: /* ConstTypename: Numeric */ #line 14615 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50256 "gram.c" break; case 1960: /* ConstTypename: ConstBit */ #line 14616 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50262 "gram.c" break; case 1961: /* ConstTypename: ConstCharacter */ #line 14617 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50268 "gram.c" break; case 1962: /* ConstTypename: ConstDatetime */ #line 14618 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50274 "gram.c" break; case 1963: /* ConstTypename: JsonType */ #line 14619 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50280 "gram.c" break; case 1964: /* GenericType: type_function_name opt_type_modifiers */ #line 14631 "gram.y" { (yyval.typnam) = makeTypeName((yyvsp[-1].str)); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 50290 "gram.c" break; case 1965: /* GenericType: type_function_name attrs opt_type_modifiers */ #line 14637 "gram.y" { (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-2].str)), (yyvsp[-1].list))); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-2]); } #line 50300 "gram.c" break; case 1966: /* opt_type_modifiers: '(' expr_list ')' */ #line 14644 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 50306 "gram.c" break; case 1967: /* opt_type_modifiers: %empty */ #line 14645 "gram.y" { (yyval.list) = NIL; } #line 50312 "gram.c" break; case 1968: /* Numeric: INT_P */ #line 14652 "gram.y" { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 50321 "gram.c" break; case 1969: /* Numeric: INTEGER */ #line 14657 "gram.y" { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 50330 "gram.c" break; case 1970: /* Numeric: SMALLINT */ #line 14662 "gram.y" { (yyval.typnam) = SystemTypeName("int2"); (yyval.typnam)->location = (yylsp[0]); } #line 50339 "gram.c" break; case 1971: /* Numeric: BIGINT */ #line 14667 "gram.y" { (yyval.typnam) = SystemTypeName("int8"); (yyval.typnam)->location = (yylsp[0]); } #line 50348 "gram.c" break; case 1972: /* Numeric: REAL */ #line 14672 "gram.y" { (yyval.typnam) = SystemTypeName("float4"); (yyval.typnam)->location = (yylsp[0]); } #line 50357 "gram.c" break; case 1973: /* Numeric: FLOAT_P opt_float */ #line 14677 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->location = (yylsp[-1]); } #line 50366 "gram.c" break; case 1974: /* Numeric: DOUBLE_P PRECISION */ #line 14682 "gram.y" { (yyval.typnam) = SystemTypeName("float8"); (yyval.typnam)->location = (yylsp[-1]); } #line 50375 "gram.c" break; case 1975: /* Numeric: DECIMAL_P opt_type_modifiers */ #line 14687 "gram.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 50385 "gram.c" break; case 1976: /* Numeric: DEC opt_type_modifiers */ #line 14693 "gram.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 50395 "gram.c" break; case 1977: /* Numeric: NUMERIC opt_type_modifiers */ #line 14699 "gram.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 50405 "gram.c" break; case 1978: /* Numeric: BOOLEAN_P */ #line 14705 "gram.y" { (yyval.typnam) = SystemTypeName("bool"); (yyval.typnam)->location = (yylsp[0]); } #line 50414 "gram.c" break; case 1979: /* opt_float: '(' Iconst ')' */ #line 14712 "gram.y" { /* * 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 50439 "gram.c" break; case 1980: /* opt_float: %empty */ #line 14733 "gram.y" { (yyval.typnam) = SystemTypeName("float8"); } #line 50447 "gram.c" break; case 1981: /* Bit: BitWithLength */ #line 14743 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50455 "gram.c" break; case 1982: /* Bit: BitWithoutLength */ #line 14747 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50463 "gram.c" break; case 1983: /* ConstBit: BitWithLength */ #line 14755 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50471 "gram.c" break; case 1984: /* ConstBit: BitWithoutLength */ #line 14759 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; } #line 50480 "gram.c" break; case 1985: /* BitWithLength: BIT opt_varying '(' expr_list ')' */ #line 14767 "gram.y" { char *typname; typname = (yyvsp[-3].boolean) ? "varbit" : "bit"; (yyval.typnam) = SystemTypeName(typname); (yyval.typnam)->typmods = (yyvsp[-1].list); (yyval.typnam)->location = (yylsp[-4]); } #line 50493 "gram.c" break; case 1986: /* BitWithoutLength: BIT opt_varying */ #line 14779 "gram.y" { /* 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 50511 "gram.c" break; case 1987: /* Character: CharacterWithLength */ #line 14800 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50519 "gram.c" break; case 1988: /* Character: CharacterWithoutLength */ #line 14804 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50527 "gram.c" break; case 1989: /* ConstCharacter: CharacterWithLength */ #line 14810 "gram.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50535 "gram.c" break; case 1990: /* ConstCharacter: CharacterWithoutLength */ #line 14814 "gram.y" { /* 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 50550 "gram.c" break; case 1991: /* CharacterWithLength: character '(' Iconst ')' */ #line 14827 "gram.y" { (yyval.typnam) = SystemTypeName((yyvsp[-3].str)); (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); (yyval.typnam)->location = (yylsp[-3]); } #line 50560 "gram.c" break; case 1992: /* CharacterWithoutLength: character */ #line 14835 "gram.y" { (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 50572 "gram.c" break; case 1993: /* character: CHARACTER opt_varying */ #line 14845 "gram.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50578 "gram.c" break; case 1994: /* character: CHAR_P opt_varying */ #line 14847 "gram.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50584 "gram.c" break; case 1995: /* character: VARCHAR */ #line 14849 "gram.y" { (yyval.str) = "varchar"; } #line 50590 "gram.c" break; case 1996: /* character: NATIONAL CHARACTER opt_varying */ #line 14851 "gram.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50596 "gram.c" break; case 1997: /* character: NATIONAL CHAR_P opt_varying */ #line 14853 "gram.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50602 "gram.c" break; case 1998: /* character: NCHAR opt_varying */ #line 14855 "gram.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50608 "gram.c" break; case 1999: /* opt_varying: VARYING */ #line 14859 "gram.y" { (yyval.boolean) = true; } #line 50614 "gram.c" break; case 2000: /* opt_varying: %empty */ #line 14860 "gram.y" { (yyval.boolean) = false; } #line 50620 "gram.c" break; case 2001: /* ConstDatetime: TIMESTAMP '(' Iconst ')' opt_timezone */ #line 14868 "gram.y" { 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 50633 "gram.c" break; case 2002: /* ConstDatetime: TIMESTAMP opt_timezone */ #line 14877 "gram.y" { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); (yyval.typnam)->location = (yylsp[-1]); } #line 50645 "gram.c" break; case 2003: /* ConstDatetime: TIME '(' Iconst ')' opt_timezone */ #line 14885 "gram.y" { 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 50658 "gram.c" break; case 2004: /* ConstDatetime: TIME opt_timezone */ #line 14894 "gram.y" { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); (yyval.typnam)->location = (yylsp[-1]); } #line 50670 "gram.c" break; case 2005: /* ConstInterval: INTERVAL */ #line 14905 "gram.y" { (yyval.typnam) = SystemTypeName("interval"); (yyval.typnam)->location = (yylsp[0]); } #line 50679 "gram.c" break; case 2006: /* opt_timezone: WITH_LA TIME ZONE */ #line 14912 "gram.y" { (yyval.boolean) = true; } #line 50685 "gram.c" break; case 2007: /* opt_timezone: WITHOUT_LA TIME ZONE */ #line 14913 "gram.y" { (yyval.boolean) = false; } #line 50691 "gram.c" break; case 2008: /* opt_timezone: %empty */ #line 14914 "gram.y" { (yyval.boolean) = false; } #line 50697 "gram.c" break; case 2009: /* opt_interval: YEAR_P */ #line 14919 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[0]))); } #line 50703 "gram.c" break; case 2010: /* opt_interval: MONTH_P */ #line 14921 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[0]))); } #line 50709 "gram.c" break; case 2011: /* opt_interval: DAY_P */ #line 14923 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[0]))); } #line 50715 "gram.c" break; case 2012: /* opt_interval: HOUR_P */ #line 14925 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[0]))); } #line 50721 "gram.c" break; case 2013: /* opt_interval: MINUTE_P */ #line 14927 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[0]))); } #line 50727 "gram.c" break; case 2014: /* opt_interval: interval_second */ #line 14929 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 50733 "gram.c" break; case 2015: /* opt_interval: YEAR_P TO MONTH_P */ #line 14931 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH), (yylsp[-2]))); } #line 50742 "gram.c" break; case 2016: /* opt_interval: DAY_P TO HOUR_P */ #line 14936 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR), (yylsp[-2]))); } #line 50751 "gram.c" break; case 2017: /* opt_interval: DAY_P TO MINUTE_P */ #line 14941 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 50761 "gram.c" break; case 2018: /* opt_interval: DAY_P TO interval_second */ #line 14947 "gram.y" { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 50773 "gram.c" break; case 2019: /* opt_interval: HOUR_P TO MINUTE_P */ #line 14955 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 50782 "gram.c" break; case 2020: /* opt_interval: HOUR_P TO interval_second */ #line 14960 "gram.y" { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 50793 "gram.c" break; case 2021: /* opt_interval: MINUTE_P TO interval_second */ #line 14967 "gram.y" { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 50803 "gram.c" break; case 2022: /* opt_interval: %empty */ #line 14973 "gram.y" { (yyval.list) = NIL; } #line 50809 "gram.c" break; case 2023: /* interval_second: SECOND_P */ #line 14978 "gram.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[0]))); } #line 50817 "gram.c" break; case 2024: /* interval_second: SECOND_P '(' Iconst ')' */ #line 14982 "gram.y" { (yyval.list) = list_make2(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[-3])), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 50826 "gram.c" break; case 2025: /* JsonType: JSON */ #line 14990 "gram.y" { (yyval.typnam) = SystemTypeName("json"); (yyval.typnam)->location = (yylsp[0]); } #line 50835 "gram.c" break; case 2026: /* a_expr: c_expr */ #line 15024 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 50841 "gram.c" break; case 2027: /* a_expr: a_expr TYPECAST Typename */ #line 15026 "gram.y" { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 50847 "gram.c" break; case 2028: /* a_expr: a_expr COLLATE any_name */ #line 15028 "gram.y" { CollateClause *n = makeNode(CollateClause); n->arg = (yyvsp[-2].node); n->collname = (yyvsp[0].list); n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 50860 "gram.c" break; case 2029: /* a_expr: a_expr AT TIME ZONE a_expr */ #line 15037 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make2((yyvsp[0].node), (yyvsp[-4].node)), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50871 "gram.c" break; case 2030: /* a_expr: a_expr AT LOCAL */ #line 15044 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make1((yyvsp[-2].node)), COERCE_SQL_SYNTAX, -1); } #line 50882 "gram.c" break; case 2031: /* a_expr: '+' a_expr */ #line 15060 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 50888 "gram.c" break; case 2032: /* a_expr: '-' a_expr */ #line 15062 "gram.y" { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 50894 "gram.c" break; case 2033: /* a_expr: a_expr '+' a_expr */ #line 15064 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50900 "gram.c" break; case 2034: /* a_expr: a_expr '-' a_expr */ #line 15066 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50906 "gram.c" break; case 2035: /* a_expr: a_expr '*' a_expr */ #line 15068 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50912 "gram.c" break; case 2036: /* a_expr: a_expr '/' a_expr */ #line 15070 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50918 "gram.c" break; case 2037: /* a_expr: a_expr '%' a_expr */ #line 15072 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50924 "gram.c" break; case 2038: /* a_expr: a_expr '^' a_expr */ #line 15074 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50930 "gram.c" break; case 2039: /* a_expr: a_expr '<' a_expr */ #line 15076 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50936 "gram.c" break; case 2040: /* a_expr: a_expr '>' a_expr */ #line 15078 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50942 "gram.c" break; case 2041: /* a_expr: a_expr '=' a_expr */ #line 15080 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50948 "gram.c" break; case 2042: /* a_expr: a_expr LESS_EQUALS a_expr */ #line 15082 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50954 "gram.c" break; case 2043: /* a_expr: a_expr GREATER_EQUALS a_expr */ #line 15084 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50960 "gram.c" break; case 2044: /* a_expr: a_expr NOT_EQUALS a_expr */ #line 15086 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50966 "gram.c" break; case 2045: /* a_expr: a_expr qual_Op a_expr */ #line 15089 "gram.y" { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50972 "gram.c" break; case 2046: /* a_expr: qual_Op a_expr */ #line 15091 "gram.y" { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 50978 "gram.c" break; case 2047: /* a_expr: a_expr AND a_expr */ #line 15094 "gram.y" { (yyval.node) = makeAndExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50984 "gram.c" break; case 2048: /* a_expr: a_expr OR a_expr */ #line 15096 "gram.y" { (yyval.node) = makeOrExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 50990 "gram.c" break; case 2049: /* a_expr: NOT a_expr */ #line 15098 "gram.y" { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 50996 "gram.c" break; case 2050: /* a_expr: NOT_LA a_expr */ #line 15100 "gram.y" { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 51002 "gram.c" break; case 2051: /* a_expr: a_expr LIKE a_expr */ #line 15103 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "~~", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51011 "gram.c" break; case 2052: /* a_expr: a_expr LIKE a_expr ESCAPE a_expr */ #line 15108 "gram.y" { 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 51024 "gram.c" break; case 2053: /* a_expr: a_expr NOT_LA LIKE a_expr */ #line 15117 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "!~~", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 51033 "gram.c" break; case 2054: /* a_expr: a_expr NOT_LA LIKE a_expr ESCAPE a_expr */ #line 15122 "gram.y" { 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 51046 "gram.c" break; case 2055: /* a_expr: a_expr ILIKE a_expr */ #line 15131 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "~~*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51055 "gram.c" break; case 2056: /* a_expr: a_expr ILIKE a_expr ESCAPE a_expr */ #line 15136 "gram.y" { 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 51068 "gram.c" break; case 2057: /* a_expr: a_expr NOT_LA ILIKE a_expr */ #line 15145 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "!~~*", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 51077 "gram.c" break; case 2058: /* a_expr: a_expr NOT_LA ILIKE a_expr ESCAPE a_expr */ #line 15150 "gram.y" { 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 51090 "gram.c" break; case 2059: /* a_expr: a_expr SIMILAR TO a_expr */ #line 15160 "gram.y" { 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 51103 "gram.c" break; case 2060: /* a_expr: a_expr SIMILAR TO a_expr ESCAPE a_expr */ #line 15169 "gram.y" { 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 51116 "gram.c" break; case 2061: /* a_expr: a_expr NOT_LA SIMILAR TO a_expr */ #line 15178 "gram.y" { 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 51129 "gram.c" break; case 2062: /* a_expr: a_expr NOT_LA SIMILAR TO a_expr ESCAPE a_expr */ #line 15187 "gram.y" { 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 51142 "gram.c" break; case 2063: /* a_expr: a_expr IS NULL_P */ #line 15206 "gram.y" { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-2].node); n->nulltesttype = IS_NULL; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 51155 "gram.c" break; case 2064: /* a_expr: a_expr ISNULL */ #line 15215 "gram.y" { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 51168 "gram.c" break; case 2065: /* a_expr: a_expr IS NOT NULL_P */ #line 15224 "gram.y" { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-3].node); n->nulltesttype = IS_NOT_NULL; n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 51181 "gram.c" break; case 2066: /* a_expr: a_expr NOTNULL */ #line 15233 "gram.y" { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NOT_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 51194 "gram.c" break; case 2067: /* a_expr: row OVERLAPS row */ #line 15242 "gram.y" { 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 51215 "gram.c" break; case 2068: /* a_expr: a_expr IS TRUE_P */ #line 15259 "gram.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_TRUE; b->location = (yylsp[-1]); (yyval.node) = (Node *) b; } #line 51228 "gram.c" break; case 2069: /* a_expr: a_expr IS NOT TRUE_P */ #line 15268 "gram.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_TRUE; b->location = (yylsp[-2]); (yyval.node) = (Node *) b; } #line 51241 "gram.c" break; case 2070: /* a_expr: a_expr IS FALSE_P */ #line 15277 "gram.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_FALSE; b->location = (yylsp[-1]); (yyval.node) = (Node *) b; } #line 51254 "gram.c" break; case 2071: /* a_expr: a_expr IS NOT FALSE_P */ #line 15286 "gram.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_FALSE; b->location = (yylsp[-2]); (yyval.node) = (Node *) b; } #line 51267 "gram.c" break; case 2072: /* a_expr: a_expr IS UNKNOWN */ #line 15295 "gram.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_UNKNOWN; b->location = (yylsp[-1]); (yyval.node) = (Node *) b; } #line 51280 "gram.c" break; case 2073: /* a_expr: a_expr IS NOT UNKNOWN */ #line 15304 "gram.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_UNKNOWN; b->location = (yylsp[-2]); (yyval.node) = (Node *) b; } #line 51293 "gram.c" break; case 2074: /* a_expr: a_expr IS DISTINCT FROM a_expr */ #line 15313 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 51301 "gram.c" break; case 2075: /* a_expr: a_expr IS NOT DISTINCT FROM a_expr */ #line 15317 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 51309 "gram.c" break; case 2076: /* a_expr: a_expr BETWEEN opt_asymmetric b_expr AND a_expr */ #line 15321 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_BETWEEN, "BETWEEN", (yyvsp[-5].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); } #line 51321 "gram.c" break; case 2077: /* a_expr: a_expr NOT_LA BETWEEN opt_asymmetric b_expr AND a_expr */ #line 15329 "gram.y" { (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 51333 "gram.c" break; case 2078: /* a_expr: a_expr BETWEEN SYMMETRIC b_expr AND a_expr */ #line 15337 "gram.y" { (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 51345 "gram.c" break; case 2079: /* a_expr: a_expr NOT_LA BETWEEN SYMMETRIC b_expr AND a_expr */ #line 15345 "gram.y" { (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 51357 "gram.c" break; case 2080: /* a_expr: a_expr IN_P select_with_parens */ #line 15353 "gram.y" { /* generate foo = ANY (subquery) */ SubLink *n = makeNode(SubLink); n->subselect = (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; } #line 51374 "gram.c" break; case 2081: /* a_expr: a_expr IN_P '(' expr_list ')' */ #line 15366 "gram.y" { /* generate scalar IN expression */ A_Expr *n = makeSimpleA_Expr(AEXPR_IN, "=", (yyvsp[-4].node), (Node *) (yyvsp[-1].list), (yylsp[-3])); n->rexpr_list_start = (yylsp[-2]); n->rexpr_list_end = (yylsp[0]); (yyval.node) = (Node *) n; } #line 51387 "gram.c" break; case 2082: /* a_expr: a_expr NOT_LA IN_P select_with_parens */ #line 15375 "gram.y" { /* generate NOT (foo = ANY (subquery)) */ SubLink *n = makeNode(SubLink); n->subselect = (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])); } #line 51405 "gram.c" break; case 2083: /* a_expr: a_expr NOT_LA IN_P '(' expr_list ')' */ #line 15389 "gram.y" { /* generate scalar NOT IN expression */ A_Expr *n = makeSimpleA_Expr(AEXPR_IN, "<>", (yyvsp[-5].node), (Node *) (yyvsp[-1].list), (yylsp[-4])); n->rexpr_list_start = (yylsp[-2]); n->rexpr_list_end = (yylsp[0]); (yyval.node) = (Node *) n; } #line 51418 "gram.c" break; case 2084: /* a_expr: a_expr subquery_Op sub_type select_with_parens */ #line 15398 "gram.y" { 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 51434 "gram.c" break; case 2085: /* a_expr: a_expr subquery_Op sub_type '(' a_expr ')' */ #line 15410 "gram.y" { 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 51445 "gram.c" break; case 2086: /* a_expr: UNIQUE opt_unique_null_treatment select_with_parens */ #line 15417 "gram.y" { /* 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 51465 "gram.c" break; case 2087: /* a_expr: a_expr IS DOCUMENT_P */ #line 15433 "gram.y" { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 51474 "gram.c" break; case 2088: /* a_expr: a_expr IS NOT DOCUMENT_P */ #line 15438 "gram.y" { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 51484 "gram.c" break; case 2089: /* a_expr: a_expr IS NORMALIZED */ #line 15444 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make1((yyvsp[-2].node)), COERCE_SQL_SYNTAX, (yylsp[-1])); } #line 51495 "gram.c" break; case 2090: /* a_expr: a_expr IS unicode_normal_form NORMALIZED */ #line 15451 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make2((yyvsp[-3].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-2])); } #line 51506 "gram.c" break; case 2091: /* a_expr: a_expr IS NOT NORMALIZED */ #line 15458 "gram.y" { (yyval.node) = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make1((yyvsp[-3].node)), COERCE_SQL_SYNTAX, (yylsp[-2])), (yylsp[-2])); } #line 51518 "gram.c" break; case 2092: /* a_expr: a_expr IS NOT unicode_normal_form NORMALIZED */ #line 15466 "gram.y" { (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 51530 "gram.c" break; case 2093: /* a_expr: a_expr IS json_predicate_type_constraint json_key_uniqueness_constraint_opt */ #line 15475 "gram.y" { 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 51540 "gram.c" break; case 2094: /* a_expr: a_expr IS NOT json_predicate_type_constraint json_key_uniqueness_constraint_opt */ #line 15493 "gram.y" { 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 51550 "gram.c" break; case 2095: /* a_expr: DEFAULT */ #line 15510 "gram.y" { /* * 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 51569 "gram.c" break; case 2096: /* b_expr: c_expr */ #line 15536 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 51575 "gram.c" break; case 2097: /* b_expr: b_expr TYPECAST Typename */ #line 15538 "gram.y" { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 51581 "gram.c" break; case 2098: /* b_expr: '+' b_expr */ #line 15540 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 51587 "gram.c" break; case 2099: /* b_expr: '-' b_expr */ #line 15542 "gram.y" { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 51593 "gram.c" break; case 2100: /* b_expr: b_expr '+' b_expr */ #line 15544 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51599 "gram.c" break; case 2101: /* b_expr: b_expr '-' b_expr */ #line 15546 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51605 "gram.c" break; case 2102: /* b_expr: b_expr '*' b_expr */ #line 15548 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51611 "gram.c" break; case 2103: /* b_expr: b_expr '/' b_expr */ #line 15550 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51617 "gram.c" break; case 2104: /* b_expr: b_expr '%' b_expr */ #line 15552 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51623 "gram.c" break; case 2105: /* b_expr: b_expr '^' b_expr */ #line 15554 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51629 "gram.c" break; case 2106: /* b_expr: b_expr '<' b_expr */ #line 15556 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51635 "gram.c" break; case 2107: /* b_expr: b_expr '>' b_expr */ #line 15558 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51641 "gram.c" break; case 2108: /* b_expr: b_expr '=' b_expr */ #line 15560 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51647 "gram.c" break; case 2109: /* b_expr: b_expr LESS_EQUALS b_expr */ #line 15562 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51653 "gram.c" break; case 2110: /* b_expr: b_expr GREATER_EQUALS b_expr */ #line 15564 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51659 "gram.c" break; case 2111: /* b_expr: b_expr NOT_EQUALS b_expr */ #line 15566 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51665 "gram.c" break; case 2112: /* b_expr: b_expr qual_Op b_expr */ #line 15568 "gram.y" { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51671 "gram.c" break; case 2113: /* b_expr: qual_Op b_expr */ #line 15570 "gram.y" { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 51677 "gram.c" break; case 2114: /* b_expr: b_expr IS DISTINCT FROM b_expr */ #line 15572 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 51685 "gram.c" break; case 2115: /* b_expr: b_expr IS NOT DISTINCT FROM b_expr */ #line 15576 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 51693 "gram.c" break; case 2116: /* b_expr: b_expr IS DOCUMENT_P */ #line 15580 "gram.y" { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 51702 "gram.c" break; case 2117: /* b_expr: b_expr IS NOT DOCUMENT_P */ #line 15585 "gram.y" { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 51712 "gram.c" break; case 2118: /* c_expr: columnref */ #line 15600 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 51718 "gram.c" break; case 2119: /* c_expr: AexprConst */ #line 15601 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 51724 "gram.c" break; case 2120: /* c_expr: PARAM opt_indirection */ #line 15603 "gram.y" { 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 51745 "gram.c" break; case 2121: /* c_expr: '(' a_expr ')' opt_indirection */ #line 15620 "gram.y" { 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 51762 "gram.c" break; case 2122: /* c_expr: case_expr */ #line 15633 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 51768 "gram.c" break; case 2123: /* c_expr: func_expr */ #line 15635 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 51774 "gram.c" break; case 2124: /* c_expr: select_with_parens */ #line 15637 "gram.y" { 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 51790 "gram.c" break; case 2125: /* c_expr: select_with_parens indirection */ #line 15649 "gram.y" { /* * 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 51819 "gram.c" break; case 2126: /* c_expr: EXISTS select_with_parens */ #line 15674 "gram.y" { 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 51835 "gram.c" break; case 2127: /* c_expr: ARRAY select_with_parens */ #line 15686 "gram.y" { 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 51851 "gram.c" break; case 2128: /* c_expr: ARRAY array_expr */ #line 15698 "gram.y" { 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 51863 "gram.c" break; case 2129: /* c_expr: explicit_row */ #line 15706 "gram.y" { 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 51878 "gram.c" break; case 2130: /* c_expr: implicit_row */ #line 15717 "gram.y" { 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 51893 "gram.c" break; case 2131: /* c_expr: GROUPING '(' expr_list ')' */ #line 15728 "gram.y" { GroupingFunc *g = makeNode(GroupingFunc); g->args = (yyvsp[-1].list); g->location = (yylsp[-3]); (yyval.node) = (Node *) g; } #line 51905 "gram.c" break; case 2132: /* func_application: func_name '(' ')' */ #line 15738 "gram.y" { (yyval.node) = (Node *) makeFuncCall((yyvsp[-2].list), NIL, COERCE_EXPLICIT_CALL, (yylsp[-2])); } #line 51915 "gram.c" break; case 2133: /* func_application: func_name '(' func_arg_list opt_sort_clause ')' */ #line 15744 "gram.y" { 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 51928 "gram.c" break; case 2134: /* func_application: func_name '(' VARIADIC func_arg_expr opt_sort_clause ')' */ #line 15753 "gram.y" { 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 51942 "gram.c" break; case 2135: /* func_application: func_name '(' func_arg_list ',' VARIADIC func_arg_expr opt_sort_clause ')' */ #line 15763 "gram.y" { 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 51956 "gram.c" break; case 2136: /* func_application: func_name '(' ALL func_arg_list opt_sort_clause ')' */ #line 15773 "gram.y" { 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 51973 "gram.c" break; case 2137: /* func_application: func_name '(' DISTINCT func_arg_list opt_sort_clause ')' */ #line 15786 "gram.y" { 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 51987 "gram.c" break; case 2138: /* func_application: func_name '(' '*' ')' */ #line 15796 "gram.y" { /* * 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 52010 "gram.c" break; case 2139: /* func_expr: func_application within_group_clause filter_clause over_clause */ #line 15827 "gram.y" { 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 52050 "gram.c" break; case 2140: /* func_expr: json_aggregate_func filter_clause over_clause */ #line 15863 "gram.y" { 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 52064 "gram.c" break; case 2141: /* func_expr: func_expr_common_subexpr */ #line 15873 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 52070 "gram.c" break; case 2142: /* func_expr_windowless: func_application */ #line 15883 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 52076 "gram.c" break; case 2143: /* func_expr_windowless: func_expr_common_subexpr */ #line 15884 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 52082 "gram.c" break; case 2144: /* func_expr_windowless: json_aggregate_func */ #line 15885 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 52088 "gram.c" break; case 2145: /* func_expr_common_subexpr: COLLATION FOR '(' a_expr ')' */ #line 15893 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"), list_make1((yyvsp[-1].node)), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 52099 "gram.c" break; case 2146: /* func_expr_common_subexpr: CURRENT_DATE */ #line 15900 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_DATE, -1, (yylsp[0])); } #line 52107 "gram.c" break; case 2147: /* func_expr_common_subexpr: CURRENT_TIME */ #line 15904 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME, -1, (yylsp[0])); } #line 52115 "gram.c" break; case 2148: /* func_expr_common_subexpr: CURRENT_TIME '(' Iconst ')' */ #line 15908 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 52123 "gram.c" break; case 2149: /* func_expr_common_subexpr: CURRENT_TIMESTAMP */ #line 15912 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP, -1, (yylsp[0])); } #line 52131 "gram.c" break; case 2150: /* func_expr_common_subexpr: CURRENT_TIMESTAMP '(' Iconst ')' */ #line 15916 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 52139 "gram.c" break; case 2151: /* func_expr_common_subexpr: LOCALTIME */ #line 15920 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME, -1, (yylsp[0])); } #line 52147 "gram.c" break; case 2152: /* func_expr_common_subexpr: LOCALTIME '(' Iconst ')' */ #line 15924 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 52155 "gram.c" break; case 2153: /* func_expr_common_subexpr: LOCALTIMESTAMP */ #line 15928 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP, -1, (yylsp[0])); } #line 52163 "gram.c" break; case 2154: /* func_expr_common_subexpr: LOCALTIMESTAMP '(' Iconst ')' */ #line 15932 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 52171 "gram.c" break; case 2155: /* func_expr_common_subexpr: CURRENT_ROLE */ #line 15936 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_ROLE, -1, (yylsp[0])); } #line 52179 "gram.c" break; case 2156: /* func_expr_common_subexpr: CURRENT_USER */ #line 15940 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_USER, -1, (yylsp[0])); } #line 52187 "gram.c" break; case 2157: /* func_expr_common_subexpr: SESSION_USER */ #line 15944 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_SESSION_USER, -1, (yylsp[0])); } #line 52195 "gram.c" break; case 2158: /* func_expr_common_subexpr: SYSTEM_USER */ #line 15948 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("system_user"), NIL, COERCE_SQL_SYNTAX, (yylsp[0])); } #line 52206 "gram.c" break; case 2159: /* func_expr_common_subexpr: USER */ #line 15955 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_USER, -1, (yylsp[0])); } #line 52214 "gram.c" break; case 2160: /* func_expr_common_subexpr: CURRENT_CATALOG */ #line 15959 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_CATALOG, -1, (yylsp[0])); } #line 52222 "gram.c" break; case 2161: /* func_expr_common_subexpr: CURRENT_SCHEMA */ #line 15963 "gram.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_SCHEMA, -1, (yylsp[0])); } #line 52230 "gram.c" break; case 2162: /* func_expr_common_subexpr: CAST '(' a_expr AS Typename ')' */ #line 15967 "gram.y" { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), (yylsp[-5])); } #line 52236 "gram.c" break; case 2163: /* func_expr_common_subexpr: EXTRACT '(' extract_list ')' */ #line 15969 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("extract"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 52247 "gram.c" break; case 2164: /* func_expr_common_subexpr: NORMALIZE '(' a_expr ')' */ #line 15976 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("normalize"), list_make1((yyvsp[-1].node)), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 52258 "gram.c" break; case 2165: /* func_expr_common_subexpr: NORMALIZE '(' a_expr ',' unicode_normal_form ')' */ #line 15983 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("normalize"), list_make2((yyvsp[-3].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-5])); } #line 52269 "gram.c" break; case 2166: /* func_expr_common_subexpr: OVERLAY '(' overlay_list ')' */ #line 15990 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("overlay"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 52280 "gram.c" break; case 2167: /* func_expr_common_subexpr: OVERLAY '(' func_arg_list_opt ')' */ #line 15997 "gram.y" { /* * 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 52295 "gram.c" break; case 2168: /* func_expr_common_subexpr: POSITION '(' position_list ')' */ #line 16008 "gram.y" { /* * 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 52313 "gram.c" break; case 2169: /* func_expr_common_subexpr: SUBSTRING '(' substr_list ')' */ #line 16022 "gram.y" { /* 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 52327 "gram.c" break; case 2170: /* func_expr_common_subexpr: SUBSTRING '(' func_arg_list_opt ')' */ #line 16032 "gram.y" { /* * 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 52342 "gram.c" break; case 2171: /* func_expr_common_subexpr: TREAT '(' a_expr AS Typename ')' */ #line 16043 "gram.y" { /* 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 52362 "gram.c" break; case 2172: /* func_expr_common_subexpr: TRIM '(' BOTH trim_list ')' */ #line 16059 "gram.y" { /* 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 52376 "gram.c" break; case 2173: /* func_expr_common_subexpr: TRIM '(' LEADING trim_list ')' */ #line 16069 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 52387 "gram.c" break; case 2174: /* func_expr_common_subexpr: TRIM '(' TRAILING trim_list ')' */ #line 16076 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 52398 "gram.c" break; case 2175: /* func_expr_common_subexpr: TRIM '(' trim_list ')' */ #line 16083 "gram.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("btrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 52409 "gram.c" break; case 2176: /* func_expr_common_subexpr: NULLIF '(' a_expr ',' a_expr ')' */ #line 16090 "gram.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NULLIF, "=", (yyvsp[-3].node), (yyvsp[-1].node), (yylsp[-5])); } #line 52417 "gram.c" break; case 2177: /* func_expr_common_subexpr: COALESCE '(' expr_list ')' */ #line 16094 "gram.y" { CoalesceExpr *c = makeNode(CoalesceExpr); c->args = (yyvsp[-1].list); c->location = (yylsp[-3]); (yyval.node) = (Node *) c; } #line 52429 "gram.c" break; case 2178: /* func_expr_common_subexpr: GREATEST '(' expr_list ')' */ #line 16102 "gram.y" { MinMaxExpr *v = makeNode(MinMaxExpr); v->args = (yyvsp[-1].list); v->op = IS_GREATEST; v->location = (yylsp[-3]); (yyval.node) = (Node *) v; } #line 52442 "gram.c" break; case 2179: /* func_expr_common_subexpr: LEAST '(' expr_list ')' */ #line 16111 "gram.y" { MinMaxExpr *v = makeNode(MinMaxExpr); v->args = (yyvsp[-1].list); v->op = IS_LEAST; v->location = (yylsp[-3]); (yyval.node) = (Node *) v; } #line 52455 "gram.c" break; case 2180: /* func_expr_common_subexpr: XMLCONCAT '(' expr_list ')' */ #line 16120 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLCONCAT, NULL, NIL, (yyvsp[-1].list), (yylsp[-3])); } #line 52463 "gram.c" break; case 2181: /* func_expr_common_subexpr: XMLELEMENT '(' NAME_P ColLabel ')' */ #line 16124 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-1].str), NIL, NIL, (yylsp[-4])); } #line 52471 "gram.c" break; case 2182: /* func_expr_common_subexpr: XMLELEMENT '(' NAME_P ColLabel ',' xml_attributes ')' */ #line 16128 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), (yyvsp[-1].list), NIL, (yylsp[-6])); } #line 52479 "gram.c" break; case 2183: /* func_expr_common_subexpr: XMLELEMENT '(' NAME_P ColLabel ',' expr_list ')' */ #line 16132 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), NIL, (yyvsp[-1].list), (yylsp[-6])); } #line 52487 "gram.c" break; case 2184: /* func_expr_common_subexpr: XMLELEMENT '(' NAME_P ColLabel ',' xml_attributes ',' expr_list ')' */ #line 16136 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-5].str), (yyvsp[-3].list), (yyvsp[-1].list), (yylsp[-8])); } #line 52495 "gram.c" break; case 2185: /* func_expr_common_subexpr: XMLEXISTS '(' c_expr xmlexists_argument ')' */ #line 16140 "gram.y" { /* 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 52508 "gram.c" break; case 2186: /* func_expr_common_subexpr: XMLFOREST '(' xml_attribute_list ')' */ #line 16149 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLFOREST, NULL, (yyvsp[-1].list), NIL, (yylsp[-3])); } #line 52516 "gram.c" break; case 2187: /* func_expr_common_subexpr: XMLPARSE '(' document_or_content a_expr xml_whitespace_option ')' */ #line 16153 "gram.y" { 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 52530 "gram.c" break; case 2188: /* func_expr_common_subexpr: XMLPI '(' NAME_P ColLabel ')' */ #line 16163 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-1].str), NULL, NIL, (yylsp[-4])); } #line 52538 "gram.c" break; case 2189: /* func_expr_common_subexpr: XMLPI '(' NAME_P ColLabel ',' a_expr ')' */ #line 16167 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-3].str), NULL, list_make1((yyvsp[-1].node)), (yylsp[-6])); } #line 52546 "gram.c" break; case 2190: /* func_expr_common_subexpr: XMLROOT '(' a_expr ',' xml_root_version opt_xml_root_standalone ')' */ #line 16171 "gram.y" { (yyval.node) = makeXmlExpr(IS_XMLROOT, NULL, NIL, list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node)), (yylsp[-6])); } #line 52555 "gram.c" break; case 2191: /* func_expr_common_subexpr: XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')' */ #line 16176 "gram.y" { 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 52570 "gram.c" break; case 2192: /* func_expr_common_subexpr: JSON_OBJECT '(' func_arg_list ')' */ #line 16187 "gram.y" { /* Support for legacy (non-standard) json_object() */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("json_object"), (yyvsp[-1].list), COERCE_EXPLICIT_CALL, (yylsp[-3])); } #line 52580 "gram.c" break; case 2193: /* func_expr_common_subexpr: JSON_OBJECT '(' json_name_and_value_list json_object_constructor_null_clause_opt json_key_uniqueness_constraint_opt json_returning_clause_opt ')' */ #line 16196 "gram.y" { 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 52595 "gram.c" break; case 2194: /* func_expr_common_subexpr: JSON_OBJECT '(' json_returning_clause_opt ')' */ #line 16207 "gram.y" { 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 52610 "gram.c" break; case 2195: /* func_expr_common_subexpr: JSON_ARRAY '(' json_value_expr_list json_array_constructor_null_clause_opt json_returning_clause_opt ')' */ #line 16222 "gram.y" { 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 52624 "gram.c" break; case 2196: /* func_expr_common_subexpr: JSON_ARRAY '(' select_no_parens json_format_clause_opt json_returning_clause_opt ')' */ #line 16237 "gram.y" { 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 52639 "gram.c" break; case 2197: /* func_expr_common_subexpr: JSON_ARRAY '(' json_returning_clause_opt ')' */ #line 16250 "gram.y" { 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 52653 "gram.c" break; case 2198: /* func_expr_common_subexpr: JSON '(' json_value_expr json_key_uniqueness_constraint_opt ')' */ #line 16260 "gram.y" { 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 52667 "gram.c" break; case 2199: /* func_expr_common_subexpr: JSON_SCALAR '(' a_expr ')' */ #line 16270 "gram.y" { JsonScalarExpr *n = makeNode(JsonScalarExpr); n->expr = (Expr *) (yyvsp[-1].node); n->output = NULL; n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 52680 "gram.c" break; case 2200: /* func_expr_common_subexpr: JSON_SERIALIZE '(' json_value_expr json_returning_clause_opt ')' */ #line 16279 "gram.y" { 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 52693 "gram.c" break; case 2201: /* func_expr_common_subexpr: MERGE_ACTION '(' ')' */ #line 16288 "gram.y" { MergeSupportFunc *m = makeNode(MergeSupportFunc); m->msftype = TEXTOID; m->location = (yylsp[-2]); (yyval.node) = (Node *) m; } #line 52705 "gram.c" break; case 2202: /* func_expr_common_subexpr: JSON_QUERY '(' json_value_expr ',' a_expr json_passing_clause_opt json_returning_clause_opt json_wrapper_behavior json_quotes_clause_opt json_behavior_clause_opt ')' */ #line 16302 "gram.y" { 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 52725 "gram.c" break; case 2203: /* func_expr_common_subexpr: JSON_EXISTS '(' json_value_expr ',' a_expr json_passing_clause_opt json_on_error_clause_opt ')' */ #line 16321 "gram.y" { 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 52742 "gram.c" break; case 2204: /* func_expr_common_subexpr: JSON_VALUE '(' json_value_expr ',' a_expr json_passing_clause_opt json_returning_clause_opt json_behavior_clause_opt ')' */ #line 16338 "gram.y" { 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 52760 "gram.c" break; case 2205: /* xml_root_version: VERSION_P a_expr */ #line 16358 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 52766 "gram.c" break; case 2206: /* xml_root_version: VERSION_P NO VALUE_P */ #line 16360 "gram.y" { (yyval.node) = makeNullAConst(-1); } #line 52772 "gram.c" break; case 2207: /* opt_xml_root_standalone: ',' STANDALONE_P YES_P */ #line 16364 "gram.y" { (yyval.node) = makeIntConst(XML_STANDALONE_YES, -1); } #line 52778 "gram.c" break; case 2208: /* opt_xml_root_standalone: ',' STANDALONE_P NO */ #line 16366 "gram.y" { (yyval.node) = makeIntConst(XML_STANDALONE_NO, -1); } #line 52784 "gram.c" break; case 2209: /* opt_xml_root_standalone: ',' STANDALONE_P NO VALUE_P */ #line 16368 "gram.y" { (yyval.node) = makeIntConst(XML_STANDALONE_NO_VALUE, -1); } #line 52790 "gram.c" break; case 2210: /* opt_xml_root_standalone: %empty */ #line 16370 "gram.y" { (yyval.node) = makeIntConst(XML_STANDALONE_OMITTED, -1); } #line 52796 "gram.c" break; case 2211: /* xml_attributes: XMLATTRIBUTES '(' xml_attribute_list ')' */ #line 16373 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 52802 "gram.c" break; case 2212: /* xml_attribute_list: xml_attribute_el */ #line 16376 "gram.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 52808 "gram.c" break; case 2213: /* xml_attribute_list: xml_attribute_list ',' xml_attribute_el */ #line 16377 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 52814 "gram.c" break; case 2214: /* xml_attribute_el: a_expr AS ColLabel */ #line 16381 "gram.y" { (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 52826 "gram.c" break; case 2215: /* xml_attribute_el: a_expr */ #line 16389 "gram.y" { (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 52838 "gram.c" break; case 2216: /* document_or_content: DOCUMENT_P */ #line 16398 "gram.y" { (yyval.ival) = XMLOPTION_DOCUMENT; } #line 52844 "gram.c" break; case 2217: /* document_or_content: CONTENT_P */ #line 16399 "gram.y" { (yyval.ival) = XMLOPTION_CONTENT; } #line 52850 "gram.c" break; case 2218: /* xml_indent_option: INDENT */ #line 16402 "gram.y" { (yyval.boolean) = true; } #line 52856 "gram.c" break; case 2219: /* xml_indent_option: NO INDENT */ #line 16403 "gram.y" { (yyval.boolean) = false; } #line 52862 "gram.c" break; case 2220: /* xml_indent_option: %empty */ #line 16404 "gram.y" { (yyval.boolean) = false; } #line 52868 "gram.c" break; case 2221: /* xml_whitespace_option: PRESERVE WHITESPACE_P */ #line 16407 "gram.y" { (yyval.boolean) = true; } #line 52874 "gram.c" break; case 2222: /* xml_whitespace_option: STRIP_P WHITESPACE_P */ #line 16408 "gram.y" { (yyval.boolean) = false; } #line 52880 "gram.c" break; case 2223: /* xml_whitespace_option: %empty */ #line 16409 "gram.y" { (yyval.boolean) = false; } #line 52886 "gram.c" break; case 2224: /* xmlexists_argument: PASSING c_expr */ #line 16415 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 52894 "gram.c" break; case 2225: /* xmlexists_argument: PASSING c_expr xml_passing_mech */ #line 16419 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 52902 "gram.c" break; case 2226: /* xmlexists_argument: PASSING xml_passing_mech c_expr */ #line 16423 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 52910 "gram.c" break; case 2227: /* xmlexists_argument: PASSING xml_passing_mech c_expr xml_passing_mech */ #line 16427 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 52918 "gram.c" break; case 2230: /* within_group_clause: WITHIN GROUP_P '(' sort_clause ')' */ #line 16442 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 52924 "gram.c" break; case 2231: /* within_group_clause: %empty */ #line 16443 "gram.y" { (yyval.list) = NIL; } #line 52930 "gram.c" break; case 2232: /* filter_clause: FILTER '(' WHERE a_expr ')' */ #line 16447 "gram.y" { (yyval.node) = (yyvsp[-1].node); } #line 52936 "gram.c" break; case 2233: /* filter_clause: %empty */ #line 16448 "gram.y" { (yyval.node) = NULL; } #line 52942 "gram.c" break; case 2234: /* window_clause: WINDOW window_definition_list */ #line 16456 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 52948 "gram.c" break; case 2235: /* window_clause: %empty */ #line 16457 "gram.y" { (yyval.list) = NIL; } #line 52954 "gram.c" break; case 2236: /* window_definition_list: window_definition */ #line 16461 "gram.y" { (yyval.list) = list_make1((yyvsp[0].windef)); } #line 52960 "gram.c" break; case 2237: /* window_definition_list: window_definition_list ',' window_definition */ #line 16463 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].windef)); } #line 52966 "gram.c" break; case 2238: /* window_definition: ColId AS window_specification */ #line 16468 "gram.y" { WindowDef *n = (yyvsp[0].windef); n->name = (yyvsp[-2].str); (yyval.windef) = n; } #line 52977 "gram.c" break; case 2239: /* over_clause: OVER window_specification */ #line 16477 "gram.y" { (yyval.windef) = (yyvsp[0].windef); } #line 52983 "gram.c" break; case 2240: /* over_clause: OVER ColId */ #line 16479 "gram.y" { 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 53001 "gram.c" break; case 2241: /* over_clause: %empty */ #line 16493 "gram.y" { (yyval.windef) = NULL; } #line 53007 "gram.c" break; case 2242: /* window_specification: '(' opt_existing_window_name opt_partition_clause opt_sort_clause opt_frame_clause ')' */ #line 16498 "gram.y" { 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 53026 "gram.c" break; case 2243: /* opt_existing_window_name: ColId */ #line 16524 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 53032 "gram.c" break; case 2244: /* opt_existing_window_name: %empty */ #line 16525 "gram.y" { (yyval.str) = NULL; } #line 53038 "gram.c" break; case 2245: /* opt_partition_clause: PARTITION BY expr_list */ #line 16528 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 53044 "gram.c" break; case 2246: /* opt_partition_clause: %empty */ #line 16529 "gram.y" { (yyval.list) = NIL; } #line 53050 "gram.c" break; case 2247: /* opt_frame_clause: RANGE frame_extent opt_window_exclusion_clause */ #line 16538 "gram.y" { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_RANGE; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 53062 "gram.c" break; case 2248: /* opt_frame_clause: ROWS frame_extent opt_window_exclusion_clause */ #line 16546 "gram.y" { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_ROWS; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 53074 "gram.c" break; case 2249: /* opt_frame_clause: GROUPS frame_extent opt_window_exclusion_clause */ #line 16554 "gram.y" { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_GROUPS; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 53086 "gram.c" break; case 2250: /* opt_frame_clause: %empty */ #line 16562 "gram.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 53099 "gram.c" break; case 2251: /* frame_extent: frame_bound */ #line 16573 "gram.y" { 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 53121 "gram.c" break; case 2252: /* frame_extent: BETWEEN frame_bound AND frame_bound */ #line 16591 "gram.y" { 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 53163 "gram.c" break; case 2253: /* frame_bound: UNBOUNDED PRECEDING */ #line 16637 "gram.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_PRECEDING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 53176 "gram.c" break; case 2254: /* frame_bound: UNBOUNDED FOLLOWING */ #line 16646 "gram.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_FOLLOWING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 53189 "gram.c" break; case 2255: /* frame_bound: CURRENT_P ROW */ #line 16655 "gram.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_CURRENT_ROW; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 53202 "gram.c" break; case 2256: /* frame_bound: a_expr PRECEDING */ #line 16664 "gram.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_PRECEDING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 53215 "gram.c" break; case 2257: /* frame_bound: a_expr FOLLOWING */ #line 16673 "gram.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_FOLLOWING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 53228 "gram.c" break; case 2258: /* opt_window_exclusion_clause: EXCLUDE CURRENT_P ROW */ #line 16684 "gram.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; } #line 53234 "gram.c" break; case 2259: /* opt_window_exclusion_clause: EXCLUDE GROUP_P */ #line 16685 "gram.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; } #line 53240 "gram.c" break; case 2260: /* opt_window_exclusion_clause: EXCLUDE TIES */ #line 16686 "gram.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; } #line 53246 "gram.c" break; case 2261: /* opt_window_exclusion_clause: EXCLUDE NO OTHERS */ #line 16687 "gram.y" { (yyval.ival) = 0; } #line 53252 "gram.c" break; case 2262: /* opt_window_exclusion_clause: %empty */ #line 16688 "gram.y" { (yyval.ival) = 0; } #line 53258 "gram.c" break; case 2263: /* row: ROW '(' expr_list ')' */ #line 16702 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 53264 "gram.c" break; case 2264: /* row: ROW '(' ')' */ #line 16703 "gram.y" { (yyval.list) = NIL; } #line 53270 "gram.c" break; case 2265: /* row: '(' expr_list ',' a_expr ')' */ #line 16704 "gram.y" { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 53276 "gram.c" break; case 2266: /* explicit_row: ROW '(' expr_list ')' */ #line 16707 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 53282 "gram.c" break; case 2267: /* explicit_row: ROW '(' ')' */ #line 16708 "gram.y" { (yyval.list) = NIL; } #line 53288 "gram.c" break; case 2268: /* implicit_row: '(' expr_list ',' a_expr ')' */ #line 16711 "gram.y" { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 53294 "gram.c" break; case 2269: /* sub_type: ANY */ #line 16714 "gram.y" { (yyval.ival) = ANY_SUBLINK; } #line 53300 "gram.c" break; case 2270: /* sub_type: SOME */ #line 16715 "gram.y" { (yyval.ival) = ANY_SUBLINK; } #line 53306 "gram.c" break; case 2271: /* sub_type: ALL */ #line 16716 "gram.y" { (yyval.ival) = ALL_SUBLINK; } #line 53312 "gram.c" break; case 2272: /* all_Op: Op */ #line 16719 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 53318 "gram.c" break; case 2273: /* all_Op: MathOp */ #line 16720 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 53324 "gram.c" break; case 2274: /* MathOp: '+' */ #line 16723 "gram.y" { (yyval.str) = "+"; } #line 53330 "gram.c" break; case 2275: /* MathOp: '-' */ #line 16724 "gram.y" { (yyval.str) = "-"; } #line 53336 "gram.c" break; case 2276: /* MathOp: '*' */ #line 16725 "gram.y" { (yyval.str) = "*"; } #line 53342 "gram.c" break; case 2277: /* MathOp: '/' */ #line 16726 "gram.y" { (yyval.str) = "/"; } #line 53348 "gram.c" break; case 2278: /* MathOp: '%' */ #line 16727 "gram.y" { (yyval.str) = "%"; } #line 53354 "gram.c" break; case 2279: /* MathOp: '^' */ #line 16728 "gram.y" { (yyval.str) = "^"; } #line 53360 "gram.c" break; case 2280: /* MathOp: '<' */ #line 16729 "gram.y" { (yyval.str) = "<"; } #line 53366 "gram.c" break; case 2281: /* MathOp: '>' */ #line 16730 "gram.y" { (yyval.str) = ">"; } #line 53372 "gram.c" break; case 2282: /* MathOp: '=' */ #line 16731 "gram.y" { (yyval.str) = "="; } #line 53378 "gram.c" break; case 2283: /* MathOp: LESS_EQUALS */ #line 16732 "gram.y" { (yyval.str) = "<="; } #line 53384 "gram.c" break; case 2284: /* MathOp: GREATER_EQUALS */ #line 16733 "gram.y" { (yyval.str) = ">="; } #line 53390 "gram.c" break; case 2285: /* MathOp: NOT_EQUALS */ #line 16734 "gram.y" { (yyval.str) = "<>"; } #line 53396 "gram.c" break; case 2286: /* qual_Op: Op */ #line 16738 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 53402 "gram.c" break; case 2287: /* qual_Op: OPERATOR '(' any_operator ')' */ #line 16740 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 53408 "gram.c" break; case 2288: /* qual_all_Op: all_Op */ #line 16745 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 53414 "gram.c" break; case 2289: /* qual_all_Op: OPERATOR '(' any_operator ')' */ #line 16747 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 53420 "gram.c" break; case 2290: /* subquery_Op: all_Op */ #line 16752 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 53426 "gram.c" break; case 2291: /* subquery_Op: OPERATOR '(' any_operator ')' */ #line 16754 "gram.y" { (yyval.list) = (yyvsp[-1].list); } #line 53432 "gram.c" break; case 2292: /* subquery_Op: LIKE */ #line 16756 "gram.y" { (yyval.list) = list_make1(makeString("~~")); } #line 53438 "gram.c" break; case 2293: /* subquery_Op: NOT_LA LIKE */ #line 16758 "gram.y" { (yyval.list) = list_make1(makeString("!~~")); } #line 53444 "gram.c" break; case 2294: /* subquery_Op: ILIKE */ #line 16760 "gram.y" { (yyval.list) = list_make1(makeString("~~*")); } #line 53450 "gram.c" break; case 2295: /* subquery_Op: NOT_LA ILIKE */ #line 16762 "gram.y" { (yyval.list) = list_make1(makeString("!~~*")); } #line 53456 "gram.c" break; case 2296: /* expr_list: a_expr */ #line 16774 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53464 "gram.c" break; case 2297: /* expr_list: expr_list ',' a_expr */ #line 16778 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 53472 "gram.c" break; case 2298: /* func_arg_list: func_arg_expr */ #line 16785 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53480 "gram.c" break; case 2299: /* func_arg_list: func_arg_list ',' func_arg_expr */ #line 16789 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 53488 "gram.c" break; case 2300: /* func_arg_expr: a_expr */ #line 16795 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 53496 "gram.c" break; case 2301: /* func_arg_expr: param_name COLON_EQUALS a_expr */ #line 16799 "gram.y" { 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 53510 "gram.c" break; case 2302: /* func_arg_expr: param_name EQUALS_GREATER a_expr */ #line 16809 "gram.y" { 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 53524 "gram.c" break; case 2303: /* func_arg_list_opt: func_arg_list */ #line 16820 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 53530 "gram.c" break; case 2304: /* func_arg_list_opt: %empty */ #line 16821 "gram.y" { (yyval.list) = NIL; } #line 53536 "gram.c" break; case 2305: /* type_list: Typename */ #line 16824 "gram.y" { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 53542 "gram.c" break; case 2306: /* type_list: type_list ',' Typename */ #line 16825 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 53548 "gram.c" break; case 2307: /* array_expr: '[' expr_list ']' */ #line 16829 "gram.y" { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2]), (yylsp[0])); } #line 53556 "gram.c" break; case 2308: /* array_expr: '[' array_expr_list ']' */ #line 16833 "gram.y" { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2]), (yylsp[0])); } #line 53564 "gram.c" break; case 2309: /* array_expr: '[' ']' */ #line 16837 "gram.y" { (yyval.node) = makeAArrayExpr(NIL, (yylsp[-1]), (yylsp[0])); } #line 53572 "gram.c" break; case 2310: /* array_expr_list: array_expr */ #line 16842 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53578 "gram.c" break; case 2311: /* array_expr_list: array_expr_list ',' array_expr */ #line 16843 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 53584 "gram.c" break; case 2312: /* extract_list: extract_arg FROM a_expr */ #line 16849 "gram.y" { (yyval.list) = list_make2(makeStringConst((yyvsp[-2].str), (yylsp[-2])), (yyvsp[0].node)); } #line 53592 "gram.c" break; case 2313: /* extract_arg: IDENT */ #line 16858 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 53598 "gram.c" break; case 2314: /* extract_arg: YEAR_P */ #line 16859 "gram.y" { (yyval.str) = "year"; } #line 53604 "gram.c" break; case 2315: /* extract_arg: MONTH_P */ #line 16860 "gram.y" { (yyval.str) = "month"; } #line 53610 "gram.c" break; case 2316: /* extract_arg: DAY_P */ #line 16861 "gram.y" { (yyval.str) = "day"; } #line 53616 "gram.c" break; case 2317: /* extract_arg: HOUR_P */ #line 16862 "gram.y" { (yyval.str) = "hour"; } #line 53622 "gram.c" break; case 2318: /* extract_arg: MINUTE_P */ #line 16863 "gram.y" { (yyval.str) = "minute"; } #line 53628 "gram.c" break; case 2319: /* extract_arg: SECOND_P */ #line 16864 "gram.y" { (yyval.str) = "second"; } #line 53634 "gram.c" break; case 2320: /* extract_arg: Sconst */ #line 16865 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 53640 "gram.c" break; case 2321: /* unicode_normal_form: NFC */ #line 16869 "gram.y" { (yyval.str) = "NFC"; } #line 53646 "gram.c" break; case 2322: /* unicode_normal_form: NFD */ #line 16870 "gram.y" { (yyval.str) = "NFD"; } #line 53652 "gram.c" break; case 2323: /* unicode_normal_form: NFKC */ #line 16871 "gram.y" { (yyval.str) = "NFKC"; } #line 53658 "gram.c" break; case 2324: /* unicode_normal_form: NFKD */ #line 16872 "gram.y" { (yyval.str) = "NFKD"; } #line 53664 "gram.c" break; case 2325: /* overlay_list: a_expr PLACING a_expr FROM a_expr FOR a_expr */ #line 16878 "gram.y" { /* 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 53673 "gram.c" break; case 2326: /* overlay_list: a_expr PLACING a_expr FROM a_expr */ #line 16883 "gram.y" { /* 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 53682 "gram.c" break; case 2327: /* position_list: b_expr IN_P b_expr */ #line 16891 "gram.y" { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-2].node)); } #line 53688 "gram.c" break; case 2328: /* substr_list: a_expr FROM a_expr FOR a_expr */ #line 16913 "gram.y" { (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 53696 "gram.c" break; case 2329: /* substr_list: a_expr FOR a_expr FROM a_expr */ #line 16917 "gram.y" { /* not legal per SQL, but might as well allow it */ (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[0].node), (yyvsp[-2].node)); } #line 53705 "gram.c" break; case 2330: /* substr_list: a_expr FROM a_expr */ #line 16922 "gram.y" { /* * 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 53720 "gram.c" break; case 2331: /* substr_list: a_expr FOR a_expr */ #line 16933 "gram.y" { /* 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 53741 "gram.c" break; case 2332: /* substr_list: a_expr SIMILAR a_expr ESCAPE a_expr */ #line 16950 "gram.y" { (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 53749 "gram.c" break; case 2333: /* trim_list: a_expr FROM expr_list */ #line 16955 "gram.y" { (yyval.list) = lappend((yyvsp[0].list), (yyvsp[-2].node)); } #line 53755 "gram.c" break; case 2334: /* trim_list: FROM expr_list */ #line 16956 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 53761 "gram.c" break; case 2335: /* trim_list: expr_list */ #line 16957 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 53767 "gram.c" break; case 2336: /* case_expr: CASE case_arg when_clause_list case_default END_P */ #line 16968 "gram.y" { 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 53782 "gram.c" break; case 2337: /* when_clause_list: when_clause */ #line 16982 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53788 "gram.c" break; case 2338: /* when_clause_list: when_clause_list when_clause */ #line 16983 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 53794 "gram.c" break; case 2339: /* when_clause: WHEN a_expr THEN a_expr */ #line 16988 "gram.y" { 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 53807 "gram.c" break; case 2340: /* case_default: ELSE a_expr */ #line 16999 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 53813 "gram.c" break; case 2341: /* case_default: %empty */ #line 17000 "gram.y" { (yyval.node) = NULL; } #line 53819 "gram.c" break; case 2342: /* case_arg: a_expr */ #line 17003 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 53825 "gram.c" break; case 2343: /* case_arg: %empty */ #line 17004 "gram.y" { (yyval.node) = NULL; } #line 53831 "gram.c" break; case 2344: /* columnref: ColId */ #line 17008 "gram.y" { (yyval.node) = makeColumnRef((yyvsp[0].str), NIL, (yylsp[0]), yyscanner); } #line 53839 "gram.c" break; case 2345: /* columnref: ColId indirection */ #line 17012 "gram.y" { (yyval.node) = makeColumnRef((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 53847 "gram.c" break; case 2346: /* indirection_el: '.' attr_name */ #line 17019 "gram.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 53855 "gram.c" break; case 2347: /* indirection_el: '.' '*' */ #line 17023 "gram.y" { (yyval.node) = (Node *) makeNode(A_Star); } #line 53863 "gram.c" break; case 2348: /* indirection_el: '[' a_expr ']' */ #line 17027 "gram.y" { A_Indices *ai = makeNode(A_Indices); ai->is_slice = false; ai->lidx = NULL; ai->uidx = (yyvsp[-1].node); (yyval.node) = (Node *) ai; } #line 53876 "gram.c" break; case 2349: /* indirection_el: '[' opt_slice_bound ':' opt_slice_bound ']' */ #line 17036 "gram.y" { 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 53889 "gram.c" break; case 2350: /* opt_slice_bound: a_expr */ #line 17047 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 53895 "gram.c" break; case 2351: /* opt_slice_bound: %empty */ #line 17048 "gram.y" { (yyval.node) = NULL; } #line 53901 "gram.c" break; case 2352: /* indirection: indirection_el */ #line 17052 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53907 "gram.c" break; case 2353: /* indirection: indirection indirection_el */ #line 17053 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 53913 "gram.c" break; case 2354: /* opt_indirection: %empty */ #line 17057 "gram.y" { (yyval.list) = NIL; } #line 53919 "gram.c" break; case 2355: /* opt_indirection: opt_indirection indirection_el */ #line 17058 "gram.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 53925 "gram.c" break; case 2358: /* json_passing_clause_opt: PASSING json_arguments */ #line 17067 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 53931 "gram.c" break; case 2359: /* json_passing_clause_opt: %empty */ #line 17068 "gram.y" { (yyval.list) = NIL; } #line 53937 "gram.c" break; case 2360: /* json_arguments: json_argument */ #line 17072 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53943 "gram.c" break; case 2361: /* json_arguments: json_arguments ',' json_argument */ #line 17073 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 53949 "gram.c" break; case 2362: /* json_argument: json_value_expr AS ColLabel */ #line 17078 "gram.y" { JsonArgument *n = makeNode(JsonArgument); n->val = (JsonValueExpr *) (yyvsp[-2].node); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 53961 "gram.c" break; case 2363: /* json_wrapper_behavior: WITHOUT WRAPPER */ #line 17089 "gram.y" { (yyval.ival) = JSW_NONE; } #line 53967 "gram.c" break; case 2364: /* json_wrapper_behavior: WITHOUT ARRAY WRAPPER */ #line 17090 "gram.y" { (yyval.ival) = JSW_NONE; } #line 53973 "gram.c" break; case 2365: /* json_wrapper_behavior: WITH WRAPPER */ #line 17091 "gram.y" { (yyval.ival) = JSW_UNCONDITIONAL; } #line 53979 "gram.c" break; case 2366: /* json_wrapper_behavior: WITH ARRAY WRAPPER */ #line 17092 "gram.y" { (yyval.ival) = JSW_UNCONDITIONAL; } #line 53985 "gram.c" break; case 2367: /* json_wrapper_behavior: WITH CONDITIONAL ARRAY WRAPPER */ #line 17093 "gram.y" { (yyval.ival) = JSW_CONDITIONAL; } #line 53991 "gram.c" break; case 2368: /* json_wrapper_behavior: WITH UNCONDITIONAL ARRAY WRAPPER */ #line 17094 "gram.y" { (yyval.ival) = JSW_UNCONDITIONAL; } #line 53997 "gram.c" break; case 2369: /* json_wrapper_behavior: WITH CONDITIONAL WRAPPER */ #line 17095 "gram.y" { (yyval.ival) = JSW_CONDITIONAL; } #line 54003 "gram.c" break; case 2370: /* json_wrapper_behavior: WITH UNCONDITIONAL WRAPPER */ #line 17096 "gram.y" { (yyval.ival) = JSW_UNCONDITIONAL; } #line 54009 "gram.c" break; case 2371: /* json_wrapper_behavior: %empty */ #line 17097 "gram.y" { (yyval.ival) = JSW_UNSPEC; } #line 54015 "gram.c" break; case 2372: /* json_behavior: DEFAULT a_expr */ #line 17102 "gram.y" { (yyval.node) = (Node *) makeJsonBehavior(JSON_BEHAVIOR_DEFAULT, (yyvsp[0].node), (yylsp[-1])); } #line 54021 "gram.c" break; case 2373: /* json_behavior: json_behavior_type */ #line 17104 "gram.y" { (yyval.node) = (Node *) makeJsonBehavior((yyvsp[0].ival), NULL, (yylsp[0])); } #line 54027 "gram.c" break; case 2374: /* json_behavior_type: ERROR_P */ #line 17108 "gram.y" { (yyval.ival) = JSON_BEHAVIOR_ERROR; } #line 54033 "gram.c" break; case 2375: /* json_behavior_type: NULL_P */ #line 17109 "gram.y" { (yyval.ival) = JSON_BEHAVIOR_NULL; } #line 54039 "gram.c" break; case 2376: /* json_behavior_type: TRUE_P */ #line 17110 "gram.y" { (yyval.ival) = JSON_BEHAVIOR_TRUE; } #line 54045 "gram.c" break; case 2377: /* json_behavior_type: FALSE_P */ #line 17111 "gram.y" { (yyval.ival) = JSON_BEHAVIOR_FALSE; } #line 54051 "gram.c" break; case 2378: /* json_behavior_type: UNKNOWN */ #line 17112 "gram.y" { (yyval.ival) = JSON_BEHAVIOR_UNKNOWN; } #line 54057 "gram.c" break; case 2379: /* json_behavior_type: EMPTY_P ARRAY */ #line 17113 "gram.y" { (yyval.ival) = JSON_BEHAVIOR_EMPTY_ARRAY; } #line 54063 "gram.c" break; case 2380: /* json_behavior_type: EMPTY_P OBJECT_P */ #line 17114 "gram.y" { (yyval.ival) = JSON_BEHAVIOR_EMPTY_OBJECT; } #line 54069 "gram.c" break; case 2381: /* json_behavior_type: EMPTY_P */ #line 17116 "gram.y" { (yyval.ival) = JSON_BEHAVIOR_EMPTY_ARRAY; } #line 54075 "gram.c" break; case 2382: /* json_behavior_clause_opt: json_behavior ON EMPTY_P */ #line 17121 "gram.y" { (yyval.list) = list_make2((yyvsp[-2].node), NULL); } #line 54081 "gram.c" break; case 2383: /* json_behavior_clause_opt: json_behavior ON ERROR_P */ #line 17123 "gram.y" { (yyval.list) = list_make2(NULL, (yyvsp[-2].node)); } #line 54087 "gram.c" break; case 2384: /* json_behavior_clause_opt: json_behavior ON EMPTY_P json_behavior ON ERROR_P */ #line 17125 "gram.y" { (yyval.list) = list_make2((yyvsp[-5].node), (yyvsp[-2].node)); } #line 54093 "gram.c" break; case 2385: /* json_behavior_clause_opt: %empty */ #line 17127 "gram.y" { (yyval.list) = list_make2(NULL, NULL); } #line 54099 "gram.c" break; case 2386: /* json_on_error_clause_opt: json_behavior ON ERROR_P */ #line 17132 "gram.y" { (yyval.node) = (yyvsp[-2].node); } #line 54105 "gram.c" break; case 2387: /* json_on_error_clause_opt: %empty */ #line 17134 "gram.y" { (yyval.node) = NULL; } #line 54111 "gram.c" break; case 2388: /* json_value_expr: a_expr json_format_clause_opt */ #line 17139 "gram.y" { /* formatted_expr will be set during parse-analysis. */ (yyval.node) = (Node *) makeJsonValueExpr((Expr *) (yyvsp[-1].node), NULL, castNode(JsonFormat, (yyvsp[0].node))); } #line 54121 "gram.c" break; case 2389: /* json_format_clause: FORMAT_LA JSON ENCODING name */ #line 17148 "gram.y" { 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)), parser_errposition((yylsp[0])))); (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_JSON, encoding, (yylsp[-3])); } #line 54143 "gram.c" break; case 2390: /* json_format_clause: FORMAT_LA JSON */ #line 17166 "gram.y" { (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_JSON, JS_ENC_DEFAULT, (yylsp[-1])); } #line 54151 "gram.c" break; case 2391: /* json_format_clause_opt: json_format_clause */ #line 17173 "gram.y" { (yyval.node) = (yyvsp[0].node); } #line 54159 "gram.c" break; case 2392: /* json_format_clause_opt: %empty */ #line 17177 "gram.y" { (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); } #line 54167 "gram.c" break; case 2393: /* json_quotes_clause_opt: KEEP QUOTES ON SCALAR STRING_P */ #line 17183 "gram.y" { (yyval.ival) = JS_QUOTES_KEEP; } #line 54173 "gram.c" break; case 2394: /* json_quotes_clause_opt: KEEP QUOTES */ #line 17184 "gram.y" { (yyval.ival) = JS_QUOTES_KEEP; } #line 54179 "gram.c" break; case 2395: /* json_quotes_clause_opt: OMIT QUOTES ON SCALAR STRING_P */ #line 17185 "gram.y" { (yyval.ival) = JS_QUOTES_OMIT; } #line 54185 "gram.c" break; case 2396: /* json_quotes_clause_opt: OMIT QUOTES */ #line 17186 "gram.y" { (yyval.ival) = JS_QUOTES_OMIT; } #line 54191 "gram.c" break; case 2397: /* json_quotes_clause_opt: %empty */ #line 17187 "gram.y" { (yyval.ival) = JS_QUOTES_UNSPEC; } #line 54197 "gram.c" break; case 2398: /* json_returning_clause_opt: RETURNING Typename json_format_clause_opt */ #line 17192 "gram.y" { 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 54210 "gram.c" break; case 2399: /* json_returning_clause_opt: %empty */ #line 17200 "gram.y" { (yyval.node) = NULL; } #line 54216 "gram.c" break; case 2400: /* json_predicate_type_constraint: JSON */ #line 17214 "gram.y" { (yyval.ival) = JS_TYPE_ANY; } #line 54222 "gram.c" break; case 2401: /* json_predicate_type_constraint: JSON VALUE_P */ #line 17215 "gram.y" { (yyval.ival) = JS_TYPE_ANY; } #line 54228 "gram.c" break; case 2402: /* json_predicate_type_constraint: JSON ARRAY */ #line 17216 "gram.y" { (yyval.ival) = JS_TYPE_ARRAY; } #line 54234 "gram.c" break; case 2403: /* json_predicate_type_constraint: JSON OBJECT_P */ #line 17217 "gram.y" { (yyval.ival) = JS_TYPE_OBJECT; } #line 54240 "gram.c" break; case 2404: /* json_predicate_type_constraint: JSON SCALAR */ #line 17218 "gram.y" { (yyval.ival) = JS_TYPE_SCALAR; } #line 54246 "gram.c" break; case 2405: /* json_key_uniqueness_constraint_opt: WITH UNIQUE KEYS */ #line 17227 "gram.y" { (yyval.boolean) = true; } #line 54252 "gram.c" break; case 2406: /* json_key_uniqueness_constraint_opt: WITH UNIQUE */ #line 17228 "gram.y" { (yyval.boolean) = true; } #line 54258 "gram.c" break; case 2407: /* json_key_uniqueness_constraint_opt: WITHOUT UNIQUE KEYS */ #line 17229 "gram.y" { (yyval.boolean) = false; } #line 54264 "gram.c" break; case 2408: /* json_key_uniqueness_constraint_opt: WITHOUT UNIQUE */ #line 17230 "gram.y" { (yyval.boolean) = false; } #line 54270 "gram.c" break; case 2409: /* json_key_uniqueness_constraint_opt: %empty */ #line 17231 "gram.y" { (yyval.boolean) = false; } #line 54276 "gram.c" break; case 2410: /* json_name_and_value_list: json_name_and_value */ #line 17236 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 54282 "gram.c" break; case 2411: /* json_name_and_value_list: json_name_and_value_list ',' json_name_and_value */ #line 17238 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 54288 "gram.c" break; case 2412: /* json_name_and_value: c_expr VALUE_P json_value_expr */ #line 17248 "gram.y" { (yyval.node) = makeJsonKeyValue((yyvsp[-2].node), (yyvsp[0].node)); } #line 54294 "gram.c" break; case 2413: /* json_name_and_value: a_expr ':' json_value_expr */ #line 17251 "gram.y" { (yyval.node) = makeJsonKeyValue((yyvsp[-2].node), (yyvsp[0].node)); } #line 54300 "gram.c" break; case 2414: /* json_object_constructor_null_clause_opt: NULL_P ON NULL_P */ #line 17256 "gram.y" { (yyval.boolean) = false; } #line 54306 "gram.c" break; case 2415: /* json_object_constructor_null_clause_opt: ABSENT ON NULL_P */ #line 17257 "gram.y" { (yyval.boolean) = true; } #line 54312 "gram.c" break; case 2416: /* json_object_constructor_null_clause_opt: %empty */ #line 17258 "gram.y" { (yyval.boolean) = false; } #line 54318 "gram.c" break; case 2417: /* json_array_constructor_null_clause_opt: NULL_P ON NULL_P */ #line 17262 "gram.y" { (yyval.boolean) = false; } #line 54324 "gram.c" break; case 2418: /* json_array_constructor_null_clause_opt: ABSENT ON NULL_P */ #line 17263 "gram.y" { (yyval.boolean) = true; } #line 54330 "gram.c" break; case 2419: /* json_array_constructor_null_clause_opt: %empty */ #line 17264 "gram.y" { (yyval.boolean) = true; } #line 54336 "gram.c" break; case 2420: /* json_value_expr_list: json_value_expr */ #line 17268 "gram.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 54342 "gram.c" break; case 2421: /* json_value_expr_list: json_value_expr_list ',' json_value_expr */ #line 17269 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node));} #line 54348 "gram.c" break; case 2422: /* json_aggregate_func: JSON_OBJECTAGG '(' json_name_and_value json_object_constructor_null_clause_opt json_key_uniqueness_constraint_opt json_returning_clause_opt ')' */ #line 17279 "gram.y" { 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 54365 "gram.c" break; case 2423: /* json_aggregate_func: JSON_ARRAYAGG '(' json_value_expr json_array_aggregate_order_by_clause_opt json_array_constructor_null_clause_opt json_returning_clause_opt ')' */ #line 17297 "gram.y" { 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 54381 "gram.c" break; case 2424: /* json_array_aggregate_order_by_clause_opt: ORDER BY sortby_list */ #line 17311 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 54387 "gram.c" break; case 2425: /* json_array_aggregate_order_by_clause_opt: %empty */ #line 17312 "gram.y" { (yyval.list) = NIL; } #line 54393 "gram.c" break; case 2426: /* opt_target_list: target_list */ #line 17321 "gram.y" { (yyval.list) = (yyvsp[0].list); } #line 54399 "gram.c" break; case 2427: /* opt_target_list: %empty */ #line 17322 "gram.y" { (yyval.list) = NIL; } #line 54405 "gram.c" break; case 2428: /* target_list: target_el */ #line 17326 "gram.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 54411 "gram.c" break; case 2429: /* target_list: target_list ',' target_el */ #line 17327 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 54417 "gram.c" break; case 2430: /* target_el: a_expr AS ColLabel */ #line 17331 "gram.y" { (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 54429 "gram.c" break; case 2431: /* target_el: a_expr BareColLabel */ #line 17339 "gram.y" { (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 54441 "gram.c" break; case 2432: /* target_el: a_expr */ #line 17347 "gram.y" { (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 54453 "gram.c" break; case 2433: /* target_el: '*' */ #line 17355 "gram.y" { 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 54470 "gram.c" break; case 2434: /* qualified_name_list: qualified_name */ #line 17377 "gram.y" { (yyval.list) = list_make1((yyvsp[0].range)); } #line 54476 "gram.c" break; case 2435: /* qualified_name_list: qualified_name_list ',' qualified_name */ #line 17378 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 54482 "gram.c" break; case 2436: /* qualified_name: ColId */ #line 17390 "gram.y" { (yyval.range) = makeRangeVar(NULL, (yyvsp[0].str), (yylsp[0])); } #line 54490 "gram.c" break; case 2437: /* qualified_name: ColId indirection */ #line 17394 "gram.y" { (yyval.range) = makeRangeVarFromQualifiedName((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 54498 "gram.c" break; case 2438: /* name_list: name */ #line 17400 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 54504 "gram.c" break; case 2439: /* name_list: name_list ',' name */ #line 17402 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 54510 "gram.c" break; case 2440: /* name: ColId */ #line 17406 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54516 "gram.c" break; case 2441: /* attr_name: ColLabel */ #line 17408 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54522 "gram.c" break; case 2442: /* file_name: Sconst */ #line 17410 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54528 "gram.c" break; case 2443: /* func_name: type_function_name */ #line 17421 "gram.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 54534 "gram.c" break; case 2444: /* func_name: ColId indirection */ #line 17423 "gram.y" { (yyval.list) = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); } #line 54543 "gram.c" break; case 2445: /* AexprConst: Iconst */ #line 17434 "gram.y" { (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); } #line 54551 "gram.c" break; case 2446: /* AexprConst: FCONST */ #line 17438 "gram.y" { (yyval.node) = makeFloatConst((yyvsp[0].str), (yylsp[0])); } #line 54559 "gram.c" break; case 2447: /* AexprConst: Sconst */ #line 17442 "gram.y" { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 54567 "gram.c" break; case 2448: /* AexprConst: BCONST */ #line 17446 "gram.y" { (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); } #line 54575 "gram.c" break; case 2449: /* AexprConst: XCONST */ #line 17450 "gram.y" { /* 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 54588 "gram.c" break; case 2450: /* AexprConst: func_name Sconst */ #line 17459 "gram.y" { /* generic type 'literal' syntax */ TypeName *t = makeTypeNameFromNameList((yyvsp[-1].list)); t->location = (yylsp[-1]); (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); } #line 54600 "gram.c" break; case 2451: /* AexprConst: func_name '(' func_arg_list opt_sort_clause ')' Sconst */ #line 17467 "gram.y" { /* 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 54636 "gram.c" break; case 2452: /* AexprConst: ConstTypename Sconst */ #line 17499 "gram.y" { (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), (yyvsp[-1].typnam)); } #line 54644 "gram.c" break; case 2453: /* AexprConst: ConstInterval Sconst opt_interval */ #line 17503 "gram.y" { TypeName *t = (yyvsp[-2].typnam); t->typmods = (yyvsp[0].list); (yyval.node) = makeStringConstCast((yyvsp[-1].str), (yylsp[-1]), t); } #line 54655 "gram.c" break; case 2454: /* AexprConst: ConstInterval '(' Iconst ')' Sconst */ #line 17510 "gram.y" { 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 54667 "gram.c" break; case 2455: /* AexprConst: TRUE_P */ #line 17518 "gram.y" { (yyval.node) = makeBoolAConst(true, (yylsp[0])); } #line 54675 "gram.c" break; case 2456: /* AexprConst: FALSE_P */ #line 17522 "gram.y" { (yyval.node) = makeBoolAConst(false, (yylsp[0])); } #line 54683 "gram.c" break; case 2457: /* AexprConst: NULL_P */ #line 17526 "gram.y" { (yyval.node) = makeNullAConst((yylsp[0])); } #line 54691 "gram.c" break; case 2458: /* Iconst: ICONST */ #line 17531 "gram.y" { (yyval.ival) = (yyvsp[0].ival); } #line 54697 "gram.c" break; case 2459: /* Sconst: SCONST */ #line 17532 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54703 "gram.c" break; case 2460: /* SignedIconst: Iconst */ #line 17534 "gram.y" { (yyval.ival) = (yyvsp[0].ival); } #line 54709 "gram.c" break; case 2461: /* SignedIconst: '+' Iconst */ #line 17535 "gram.y" { (yyval.ival) = + (yyvsp[0].ival); } #line 54715 "gram.c" break; case 2462: /* SignedIconst: '-' Iconst */ #line 17536 "gram.y" { (yyval.ival) = - (yyvsp[0].ival); } #line 54721 "gram.c" break; case 2463: /* RoleId: RoleSpec */ #line 17541 "gram.y" { 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 54764 "gram.c" break; case 2464: /* RoleSpec: NonReservedWord */ #line 17582 "gram.y" { /* * "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 54796 "gram.c" break; case 2465: /* RoleSpec: CURRENT_ROLE */ #line 17610 "gram.y" { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_ROLE, (yylsp[0])); } #line 54804 "gram.c" break; case 2466: /* RoleSpec: CURRENT_USER */ #line 17614 "gram.y" { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 54812 "gram.c" break; case 2467: /* RoleSpec: SESSION_USER */ #line 17618 "gram.y" { (yyval.rolespec) = makeRoleSpec(ROLESPEC_SESSION_USER, (yylsp[0])); } #line 54820 "gram.c" break; case 2468: /* role_list: RoleSpec */ #line 17624 "gram.y" { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 54826 "gram.c" break; case 2469: /* role_list: role_list ',' RoleSpec */ #line 17626 "gram.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 54832 "gram.c" break; case 2470: /* PLpgSQL_Expr: opt_distinct_clause opt_target_list from_clause where_clause group_clause having_clause window_clause opt_sort_clause opt_select_limit opt_for_locking_clause */ #line 17643 "gram.y" { 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"), parser_errposition((yyvsp[-1].selectlimit)->optionLoc))); n->limitOption = (yyvsp[-1].selectlimit)->limitOption; } n->lockingClause = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 54864 "gram.c" break; case 2471: /* PLAssignStmt: plassign_target opt_indirection plassign_equals PLpgSQL_Expr */ #line 17677 "gram.y" { 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 54879 "gram.c" break; case 2472: /* plassign_target: ColId */ #line 17689 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54885 "gram.c" break; case 2473: /* plassign_target: PARAM */ #line 17690 "gram.y" { (yyval.str) = psprintf("$%d", (yyvsp[0].ival)); } #line 54891 "gram.c" break; case 2476: /* ColId: IDENT */ #line 17711 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54897 "gram.c" break; case 2477: /* ColId: unreserved_keyword */ #line 17712 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54903 "gram.c" break; case 2478: /* ColId: col_name_keyword */ #line 17713 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54909 "gram.c" break; case 2479: /* type_function_name: IDENT */ #line 17718 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54915 "gram.c" break; case 2480: /* type_function_name: unreserved_keyword */ #line 17719 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54921 "gram.c" break; case 2481: /* type_function_name: type_func_name_keyword */ #line 17720 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54927 "gram.c" break; case 2482: /* NonReservedWord: IDENT */ #line 17725 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54933 "gram.c" break; case 2483: /* NonReservedWord: unreserved_keyword */ #line 17726 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54939 "gram.c" break; case 2484: /* NonReservedWord: col_name_keyword */ #line 17727 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54945 "gram.c" break; case 2485: /* NonReservedWord: type_func_name_keyword */ #line 17728 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54951 "gram.c" break; case 2486: /* ColLabel: IDENT */ #line 17734 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54957 "gram.c" break; case 2487: /* ColLabel: unreserved_keyword */ #line 17735 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54963 "gram.c" break; case 2488: /* ColLabel: col_name_keyword */ #line 17736 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54969 "gram.c" break; case 2489: /* ColLabel: type_func_name_keyword */ #line 17737 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54975 "gram.c" break; case 2490: /* ColLabel: reserved_keyword */ #line 17738 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54981 "gram.c" break; case 2491: /* BareColLabel: IDENT */ #line 17744 "gram.y" { (yyval.str) = (yyvsp[0].str); } #line 54987 "gram.c" break; case 2492: /* BareColLabel: bare_label_keyword */ #line 17745 "gram.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 54993 "gram.c" break; #line 54997 "gram.c" 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 ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; *++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. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } 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 ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; yyerror (&yylloc, yyscanner, YY_("syntax error")); } 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 when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; /* 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. */ /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYSYMBOL_YYerror; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { 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", YY_ACCESSING_SYMBOL (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; ++yylsp; YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (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 /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (&yylloc, yyscanner, YY_("memory exhausted")); yyresult = 2; goto yyreturn; #endif /*-------------------------------------------------------. | yyreturn -- parsing is finished, clean up and return. | `-------------------------------------------------------*/ 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", YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, yyscanner); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 18763 "gram.y" /* * 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(firsto->location))); /* 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(limitClause->offsetLoc))); 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(limitClause->countLoc))); stmt->limitCount = limitClause->limitCount; } if (limitClause) { /* If there was a conflict, we must have detected it above */ Assert(!stmt->limitOption); 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"), parser_errposition(limitClause->optionLoc))); 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"), parser_errposition(limitClause->optionLoc))); } } 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, int location_end) { A_ArrayExpr *n = makeNode(A_ArrayExpr); n->elements = elements; n->location = location; n->list_start = location; n->list_end = location_end; 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, core_yyscan_t yyscanner) { 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"), parser_errposition(p->location))); } 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 *is_enforced, 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 (is_enforced) *is_enforced = true; 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))); } if (cas_bits & CAS_NOT_ENFORCED) { if (is_enforced) *is_enforced = false; else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), /* translator: %s is CHECK, UNIQUE, or similar */ errmsg("%s constraints cannot be marked NOT ENFORCED", constrType), parser_errposition(location))); /* * NB: The validated status is irrelevant when the constraint is set to * NOT ENFORCED, but for consistency, it should be set accordingly. * This ensures that if the constraint is later changed to ENFORCED, it * will automatically be in the correct NOT VALIDATED state. */ if (not_valid) *not_valid = true; } if (cas_bits & CAS_ENFORCED) { if (is_enforced) *is_enforced = true; else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), /* translator: %s is CHECK, UNIQUE, or similar */ errmsg("%s constraints cannot be marked ENFORCED", constrType), parser_errposition(location))); } } /* * Parse a user-supplied partition strategy string into parse node * PartitionStrategy representation, or die trying. */ static PartitionStrategy parsePartitionStrategy(char *strategy, int location, core_yyscan_t yyscanner) { 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), parser_errposition(location))); 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.7.0/src/parser/gram.h0000644000175000017500000011771515120733626013445 00000000000000/* A Bison parser, made by GNU Bison 3.7.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 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. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ #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 kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ IDENT = 258, /* IDENT */ UIDENT = 259, /* UIDENT */ FCONST = 260, /* FCONST */ SCONST = 261, /* SCONST */ USCONST = 262, /* USCONST */ BCONST = 263, /* BCONST */ XCONST = 264, /* XCONST */ Op = 265, /* Op */ ICONST = 266, /* ICONST */ PARAM = 267, /* PARAM */ TYPECAST = 268, /* TYPECAST */ DOT_DOT = 269, /* DOT_DOT */ COLON_EQUALS = 270, /* COLON_EQUALS */ EQUALS_GREATER = 271, /* EQUALS_GREATER */ LESS_EQUALS = 272, /* LESS_EQUALS */ GREATER_EQUALS = 273, /* GREATER_EQUALS */ NOT_EQUALS = 274, /* NOT_EQUALS */ ABORT_P = 275, /* ABORT_P */ ABSENT = 276, /* ABSENT */ ABSOLUTE_P = 277, /* ABSOLUTE_P */ ACCESS = 278, /* ACCESS */ ACTION = 279, /* ACTION */ ADD_P = 280, /* ADD_P */ ADMIN = 281, /* ADMIN */ AFTER = 282, /* AFTER */ AGGREGATE = 283, /* AGGREGATE */ ALL = 284, /* ALL */ ALSO = 285, /* ALSO */ ALTER = 286, /* ALTER */ ALWAYS = 287, /* ALWAYS */ ANALYSE = 288, /* ANALYSE */ ANALYZE = 289, /* ANALYZE */ AND = 290, /* AND */ ANY = 291, /* ANY */ ARRAY = 292, /* ARRAY */ AS = 293, /* AS */ ASC = 294, /* ASC */ ASENSITIVE = 295, /* ASENSITIVE */ ASSERTION = 296, /* ASSERTION */ ASSIGNMENT = 297, /* ASSIGNMENT */ ASYMMETRIC = 298, /* ASYMMETRIC */ ATOMIC = 299, /* ATOMIC */ AT = 300, /* AT */ ATTACH = 301, /* ATTACH */ ATTRIBUTE = 302, /* ATTRIBUTE */ AUTHORIZATION = 303, /* AUTHORIZATION */ BACKWARD = 304, /* BACKWARD */ BEFORE = 305, /* BEFORE */ BEGIN_P = 306, /* BEGIN_P */ BETWEEN = 307, /* BETWEEN */ BIGINT = 308, /* BIGINT */ BINARY = 309, /* BINARY */ BIT = 310, /* BIT */ BOOLEAN_P = 311, /* BOOLEAN_P */ BOTH = 312, /* BOTH */ BREADTH = 313, /* BREADTH */ BY = 314, /* BY */ CACHE = 315, /* CACHE */ CALL = 316, /* CALL */ CALLED = 317, /* CALLED */ CASCADE = 318, /* CASCADE */ CASCADED = 319, /* CASCADED */ CASE = 320, /* CASE */ CAST = 321, /* CAST */ CATALOG_P = 322, /* CATALOG_P */ CHAIN = 323, /* CHAIN */ CHAR_P = 324, /* CHAR_P */ CHARACTER = 325, /* CHARACTER */ CHARACTERISTICS = 326, /* CHARACTERISTICS */ CHECK = 327, /* CHECK */ CHECKPOINT = 328, /* CHECKPOINT */ CLASS = 329, /* CLASS */ CLOSE = 330, /* CLOSE */ CLUSTER = 331, /* CLUSTER */ COALESCE = 332, /* COALESCE */ COLLATE = 333, /* COLLATE */ COLLATION = 334, /* COLLATION */ COLUMN = 335, /* COLUMN */ COLUMNS = 336, /* COLUMNS */ COMMENT = 337, /* COMMENT */ COMMENTS = 338, /* COMMENTS */ COMMIT = 339, /* COMMIT */ COMMITTED = 340, /* COMMITTED */ COMPRESSION = 341, /* COMPRESSION */ CONCURRENTLY = 342, /* CONCURRENTLY */ CONDITIONAL = 343, /* CONDITIONAL */ CONFIGURATION = 344, /* CONFIGURATION */ CONFLICT = 345, /* CONFLICT */ CONNECTION = 346, /* CONNECTION */ CONSTRAINT = 347, /* CONSTRAINT */ CONSTRAINTS = 348, /* CONSTRAINTS */ CONTENT_P = 349, /* CONTENT_P */ CONTINUE_P = 350, /* CONTINUE_P */ CONVERSION_P = 351, /* CONVERSION_P */ COPY = 352, /* COPY */ COST = 353, /* COST */ CREATE = 354, /* CREATE */ CROSS = 355, /* CROSS */ CSV = 356, /* CSV */ CUBE = 357, /* CUBE */ CURRENT_P = 358, /* CURRENT_P */ CURRENT_CATALOG = 359, /* CURRENT_CATALOG */ CURRENT_DATE = 360, /* CURRENT_DATE */ CURRENT_ROLE = 361, /* CURRENT_ROLE */ CURRENT_SCHEMA = 362, /* CURRENT_SCHEMA */ CURRENT_TIME = 363, /* CURRENT_TIME */ CURRENT_TIMESTAMP = 364, /* CURRENT_TIMESTAMP */ CURRENT_USER = 365, /* CURRENT_USER */ CURSOR = 366, /* CURSOR */ CYCLE = 367, /* CYCLE */ DATA_P = 368, /* DATA_P */ DATABASE = 369, /* DATABASE */ DAY_P = 370, /* DAY_P */ DEALLOCATE = 371, /* DEALLOCATE */ DEC = 372, /* DEC */ DECIMAL_P = 373, /* DECIMAL_P */ DECLARE = 374, /* DECLARE */ DEFAULT = 375, /* DEFAULT */ DEFAULTS = 376, /* DEFAULTS */ DEFERRABLE = 377, /* DEFERRABLE */ DEFERRED = 378, /* DEFERRED */ DEFINER = 379, /* DEFINER */ DELETE_P = 380, /* DELETE_P */ DELIMITER = 381, /* DELIMITER */ DELIMITERS = 382, /* DELIMITERS */ DEPENDS = 383, /* DEPENDS */ DEPTH = 384, /* DEPTH */ DESC = 385, /* DESC */ DETACH = 386, /* DETACH */ DICTIONARY = 387, /* DICTIONARY */ DISABLE_P = 388, /* DISABLE_P */ DISCARD = 389, /* DISCARD */ DISTINCT = 390, /* DISTINCT */ DO = 391, /* DO */ DOCUMENT_P = 392, /* DOCUMENT_P */ DOMAIN_P = 393, /* DOMAIN_P */ DOUBLE_P = 394, /* DOUBLE_P */ DROP = 395, /* DROP */ EACH = 396, /* EACH */ ELSE = 397, /* ELSE */ EMPTY_P = 398, /* EMPTY_P */ ENABLE_P = 399, /* ENABLE_P */ ENCODING = 400, /* ENCODING */ ENCRYPTED = 401, /* ENCRYPTED */ END_P = 402, /* END_P */ ENFORCED = 403, /* ENFORCED */ ENUM_P = 404, /* ENUM_P */ ERROR_P = 405, /* ERROR_P */ ESCAPE = 406, /* ESCAPE */ EVENT = 407, /* EVENT */ EXCEPT = 408, /* EXCEPT */ EXCLUDE = 409, /* EXCLUDE */ EXCLUDING = 410, /* EXCLUDING */ EXCLUSIVE = 411, /* EXCLUSIVE */ EXECUTE = 412, /* EXECUTE */ EXISTS = 413, /* EXISTS */ EXPLAIN = 414, /* EXPLAIN */ EXPRESSION = 415, /* EXPRESSION */ EXTENSION = 416, /* EXTENSION */ EXTERNAL = 417, /* EXTERNAL */ EXTRACT = 418, /* EXTRACT */ FALSE_P = 419, /* FALSE_P */ FAMILY = 420, /* FAMILY */ FETCH = 421, /* FETCH */ FILTER = 422, /* FILTER */ FINALIZE = 423, /* FINALIZE */ FIRST_P = 424, /* FIRST_P */ FLOAT_P = 425, /* FLOAT_P */ FOLLOWING = 426, /* FOLLOWING */ FOR = 427, /* FOR */ FORCE = 428, /* FORCE */ FOREIGN = 429, /* FOREIGN */ FORMAT = 430, /* FORMAT */ FORWARD = 431, /* FORWARD */ FREEZE = 432, /* FREEZE */ FROM = 433, /* FROM */ FULL = 434, /* FULL */ FUNCTION = 435, /* FUNCTION */ FUNCTIONS = 436, /* FUNCTIONS */ GENERATED = 437, /* GENERATED */ GLOBAL = 438, /* GLOBAL */ GRANT = 439, /* GRANT */ GRANTED = 440, /* GRANTED */ GREATEST = 441, /* GREATEST */ GROUP_P = 442, /* GROUP_P */ GROUPING = 443, /* GROUPING */ GROUPS = 444, /* GROUPS */ HANDLER = 445, /* HANDLER */ HAVING = 446, /* HAVING */ HEADER_P = 447, /* HEADER_P */ HOLD = 448, /* HOLD */ HOUR_P = 449, /* HOUR_P */ IDENTITY_P = 450, /* IDENTITY_P */ IF_P = 451, /* IF_P */ ILIKE = 452, /* ILIKE */ IMMEDIATE = 453, /* IMMEDIATE */ IMMUTABLE = 454, /* IMMUTABLE */ IMPLICIT_P = 455, /* IMPLICIT_P */ IMPORT_P = 456, /* IMPORT_P */ IN_P = 457, /* IN_P */ INCLUDE = 458, /* INCLUDE */ INCLUDING = 459, /* INCLUDING */ INCREMENT = 460, /* INCREMENT */ INDENT = 461, /* INDENT */ INDEX = 462, /* INDEX */ INDEXES = 463, /* INDEXES */ INHERIT = 464, /* INHERIT */ INHERITS = 465, /* INHERITS */ INITIALLY = 466, /* INITIALLY */ INLINE_P = 467, /* INLINE_P */ INNER_P = 468, /* INNER_P */ INOUT = 469, /* INOUT */ INPUT_P = 470, /* INPUT_P */ INSENSITIVE = 471, /* INSENSITIVE */ INSERT = 472, /* INSERT */ INSTEAD = 473, /* INSTEAD */ INT_P = 474, /* INT_P */ INTEGER = 475, /* INTEGER */ INTERSECT = 476, /* INTERSECT */ INTERVAL = 477, /* INTERVAL */ INTO = 478, /* INTO */ INVOKER = 479, /* INVOKER */ IS = 480, /* IS */ ISNULL = 481, /* ISNULL */ ISOLATION = 482, /* ISOLATION */ JOIN = 483, /* JOIN */ JSON = 484, /* JSON */ JSON_ARRAY = 485, /* JSON_ARRAY */ JSON_ARRAYAGG = 486, /* JSON_ARRAYAGG */ JSON_EXISTS = 487, /* JSON_EXISTS */ JSON_OBJECT = 488, /* JSON_OBJECT */ JSON_OBJECTAGG = 489, /* JSON_OBJECTAGG */ JSON_QUERY = 490, /* JSON_QUERY */ JSON_SCALAR = 491, /* JSON_SCALAR */ JSON_SERIALIZE = 492, /* JSON_SERIALIZE */ JSON_TABLE = 493, /* JSON_TABLE */ JSON_VALUE = 494, /* JSON_VALUE */ KEEP = 495, /* KEEP */ KEY = 496, /* KEY */ KEYS = 497, /* KEYS */ LABEL = 498, /* LABEL */ LANGUAGE = 499, /* LANGUAGE */ LARGE_P = 500, /* LARGE_P */ LAST_P = 501, /* LAST_P */ LATERAL_P = 502, /* LATERAL_P */ LEADING = 503, /* LEADING */ LEAKPROOF = 504, /* LEAKPROOF */ LEAST = 505, /* LEAST */ LEFT = 506, /* LEFT */ LEVEL = 507, /* LEVEL */ LIKE = 508, /* LIKE */ LIMIT = 509, /* LIMIT */ LISTEN = 510, /* LISTEN */ LOAD = 511, /* LOAD */ LOCAL = 512, /* LOCAL */ LOCALTIME = 513, /* LOCALTIME */ LOCALTIMESTAMP = 514, /* LOCALTIMESTAMP */ LOCATION = 515, /* LOCATION */ LOCK_P = 516, /* LOCK_P */ LOCKED = 517, /* LOCKED */ LOGGED = 518, /* LOGGED */ MAPPING = 519, /* MAPPING */ MATCH = 520, /* MATCH */ MATCHED = 521, /* MATCHED */ MATERIALIZED = 522, /* MATERIALIZED */ MAXVALUE = 523, /* MAXVALUE */ MERGE = 524, /* MERGE */ MERGE_ACTION = 525, /* MERGE_ACTION */ METHOD = 526, /* METHOD */ MINUTE_P = 527, /* MINUTE_P */ MINVALUE = 528, /* MINVALUE */ MODE = 529, /* MODE */ MONTH_P = 530, /* MONTH_P */ MOVE = 531, /* MOVE */ NAME_P = 532, /* NAME_P */ NAMES = 533, /* NAMES */ NATIONAL = 534, /* NATIONAL */ NATURAL = 535, /* NATURAL */ NCHAR = 536, /* NCHAR */ NESTED = 537, /* NESTED */ NEW = 538, /* NEW */ NEXT = 539, /* NEXT */ NFC = 540, /* NFC */ NFD = 541, /* NFD */ NFKC = 542, /* NFKC */ NFKD = 543, /* NFKD */ NO = 544, /* NO */ NONE = 545, /* NONE */ NORMALIZE = 546, /* NORMALIZE */ NORMALIZED = 547, /* NORMALIZED */ NOT = 548, /* NOT */ NOTHING = 549, /* NOTHING */ NOTIFY = 550, /* NOTIFY */ NOTNULL = 551, /* NOTNULL */ NOWAIT = 552, /* NOWAIT */ NULL_P = 553, /* NULL_P */ NULLIF = 554, /* NULLIF */ NULLS_P = 555, /* NULLS_P */ NUMERIC = 556, /* NUMERIC */ OBJECT_P = 557, /* OBJECT_P */ OBJECTS_P = 558, /* OBJECTS_P */ OF = 559, /* OF */ OFF = 560, /* OFF */ OFFSET = 561, /* OFFSET */ OIDS = 562, /* OIDS */ OLD = 563, /* OLD */ OMIT = 564, /* OMIT */ ON = 565, /* ON */ ONLY = 566, /* ONLY */ OPERATOR = 567, /* OPERATOR */ OPTION = 568, /* OPTION */ OPTIONS = 569, /* OPTIONS */ OR = 570, /* OR */ ORDER = 571, /* ORDER */ ORDINALITY = 572, /* ORDINALITY */ OTHERS = 573, /* OTHERS */ OUT_P = 574, /* OUT_P */ OUTER_P = 575, /* OUTER_P */ OVER = 576, /* OVER */ OVERLAPS = 577, /* OVERLAPS */ OVERLAY = 578, /* OVERLAY */ OVERRIDING = 579, /* OVERRIDING */ OWNED = 580, /* OWNED */ OWNER = 581, /* OWNER */ PARALLEL = 582, /* PARALLEL */ PARAMETER = 583, /* PARAMETER */ PARSER = 584, /* PARSER */ PARTIAL = 585, /* PARTIAL */ PARTITION = 586, /* PARTITION */ PASSING = 587, /* PASSING */ PASSWORD = 588, /* PASSWORD */ PATH = 589, /* PATH */ PGPOOL = 590, /* PGPOOL */ PERIOD = 591, /* PERIOD */ PLACING = 592, /* PLACING */ PLAN = 593, /* PLAN */ PLANS = 594, /* PLANS */ POLICY = 595, /* POLICY */ POSITION = 596, /* POSITION */ PRECEDING = 597, /* PRECEDING */ PRECISION = 598, /* PRECISION */ PRESERVE = 599, /* PRESERVE */ PREPARE = 600, /* PREPARE */ PREPARED = 601, /* PREPARED */ PRIMARY = 602, /* PRIMARY */ PRIOR = 603, /* PRIOR */ PRIVILEGES = 604, /* PRIVILEGES */ PROCEDURAL = 605, /* PROCEDURAL */ PROCEDURE = 606, /* PROCEDURE */ PROCEDURES = 607, /* PROCEDURES */ PROGRAM = 608, /* PROGRAM */ PUBLICATION = 609, /* PUBLICATION */ QUOTE = 610, /* QUOTE */ QUOTES = 611, /* QUOTES */ RANGE = 612, /* RANGE */ READ = 613, /* READ */ REAL = 614, /* REAL */ REASSIGN = 615, /* REASSIGN */ RECURSIVE = 616, /* RECURSIVE */ REF_P = 617, /* REF_P */ REFERENCES = 618, /* REFERENCES */ REFERENCING = 619, /* REFERENCING */ REFRESH = 620, /* REFRESH */ REINDEX = 621, /* REINDEX */ RELATIVE_P = 622, /* RELATIVE_P */ RELEASE = 623, /* RELEASE */ RENAME = 624, /* RENAME */ REPEATABLE = 625, /* REPEATABLE */ REPLACE = 626, /* REPLACE */ REPLICA = 627, /* REPLICA */ RESET = 628, /* RESET */ RESTART = 629, /* RESTART */ RESTRICT = 630, /* RESTRICT */ RETURN = 631, /* RETURN */ RETURNING = 632, /* RETURNING */ RETURNS = 633, /* RETURNS */ REVOKE = 634, /* REVOKE */ RIGHT = 635, /* RIGHT */ ROLE = 636, /* ROLE */ ROLLBACK = 637, /* ROLLBACK */ ROLLUP = 638, /* ROLLUP */ ROUTINE = 639, /* ROUTINE */ ROUTINES = 640, /* ROUTINES */ ROW = 641, /* ROW */ ROWS = 642, /* ROWS */ RULE = 643, /* RULE */ SAVEPOINT = 644, /* SAVEPOINT */ SCALAR = 645, /* SCALAR */ SCHEMA = 646, /* SCHEMA */ SCHEMAS = 647, /* SCHEMAS */ SCROLL = 648, /* SCROLL */ SEARCH = 649, /* SEARCH */ SECOND_P = 650, /* SECOND_P */ SECURITY = 651, /* SECURITY */ SELECT = 652, /* SELECT */ SEQUENCE = 653, /* SEQUENCE */ SEQUENCES = 654, /* SEQUENCES */ SERIALIZABLE = 655, /* SERIALIZABLE */ SERVER = 656, /* SERVER */ SESSION = 657, /* SESSION */ SESSION_USER = 658, /* SESSION_USER */ SET = 659, /* SET */ SETS = 660, /* SETS */ SETOF = 661, /* SETOF */ SHARE = 662, /* SHARE */ SHOW = 663, /* SHOW */ SIMILAR = 664, /* SIMILAR */ SIMPLE = 665, /* SIMPLE */ SKIP = 666, /* SKIP */ SMALLINT = 667, /* SMALLINT */ SNAPSHOT = 668, /* SNAPSHOT */ SOME = 669, /* SOME */ SOURCE = 670, /* SOURCE */ SQL_P = 671, /* SQL_P */ STABLE = 672, /* STABLE */ STANDALONE_P = 673, /* STANDALONE_P */ START = 674, /* START */ STATEMENT = 675, /* STATEMENT */ STATISTICS = 676, /* STATISTICS */ STDIN = 677, /* STDIN */ STDOUT = 678, /* STDOUT */ STORAGE = 679, /* STORAGE */ STORED = 680, /* STORED */ STRICT_P = 681, /* STRICT_P */ STRING_P = 682, /* STRING_P */ STRIP_P = 683, /* STRIP_P */ SUBSCRIPTION = 684, /* SUBSCRIPTION */ SUBSTRING = 685, /* SUBSTRING */ SUPPORT = 686, /* SUPPORT */ SYMMETRIC = 687, /* SYMMETRIC */ SYSID = 688, /* SYSID */ SYSTEM_P = 689, /* SYSTEM_P */ SYSTEM_USER = 690, /* SYSTEM_USER */ TABLE = 691, /* TABLE */ TABLES = 692, /* TABLES */ TABLESAMPLE = 693, /* TABLESAMPLE */ TABLESPACE = 694, /* TABLESPACE */ TARGET = 695, /* TARGET */ TEMP = 696, /* TEMP */ TEMPLATE = 697, /* TEMPLATE */ TEMPORARY = 698, /* TEMPORARY */ TEXT_P = 699, /* TEXT_P */ THEN = 700, /* THEN */ TIES = 701, /* TIES */ TIME = 702, /* TIME */ TIMESTAMP = 703, /* TIMESTAMP */ TO = 704, /* TO */ TRAILING = 705, /* TRAILING */ TRANSACTION = 706, /* TRANSACTION */ TRANSFORM = 707, /* TRANSFORM */ TREAT = 708, /* TREAT */ TRIGGER = 709, /* TRIGGER */ TRIM = 710, /* TRIM */ TRUE_P = 711, /* TRUE_P */ TRUNCATE = 712, /* TRUNCATE */ TRUSTED = 713, /* TRUSTED */ TYPE_P = 714, /* TYPE_P */ TYPES_P = 715, /* TYPES_P */ UESCAPE = 716, /* UESCAPE */ UNBOUNDED = 717, /* UNBOUNDED */ UNCONDITIONAL = 718, /* UNCONDITIONAL */ UNCOMMITTED = 719, /* UNCOMMITTED */ UNENCRYPTED = 720, /* UNENCRYPTED */ UNION = 721, /* UNION */ UNIQUE = 722, /* UNIQUE */ UNKNOWN = 723, /* UNKNOWN */ UNLISTEN = 724, /* UNLISTEN */ UNLOGGED = 725, /* UNLOGGED */ UNTIL = 726, /* UNTIL */ UPDATE = 727, /* UPDATE */ USER = 728, /* USER */ USING = 729, /* USING */ VACUUM = 730, /* VACUUM */ VALID = 731, /* VALID */ VALIDATE = 732, /* VALIDATE */ VALIDATOR = 733, /* VALIDATOR */ VALUE_P = 734, /* VALUE_P */ VALUES = 735, /* VALUES */ VARCHAR = 736, /* VARCHAR */ VARIADIC = 737, /* VARIADIC */ VARYING = 738, /* VARYING */ VERBOSE = 739, /* VERBOSE */ VERSION_P = 740, /* VERSION_P */ VIEW = 741, /* VIEW */ VIEWS = 742, /* VIEWS */ VIRTUAL = 743, /* VIRTUAL */ VOLATILE = 744, /* VOLATILE */ WHEN = 745, /* WHEN */ WHERE = 746, /* WHERE */ WHITESPACE_P = 747, /* WHITESPACE_P */ WINDOW = 748, /* WINDOW */ WITH = 749, /* WITH */ WITHIN = 750, /* WITHIN */ WITHOUT = 751, /* WITHOUT */ WORK = 752, /* WORK */ WRAPPER = 753, /* WRAPPER */ WRITE = 754, /* WRITE */ XML_P = 755, /* XML_P */ XMLATTRIBUTES = 756, /* XMLATTRIBUTES */ XMLCONCAT = 757, /* XMLCONCAT */ XMLELEMENT = 758, /* XMLELEMENT */ XMLEXISTS = 759, /* XMLEXISTS */ XMLFOREST = 760, /* XMLFOREST */ XMLNAMESPACES = 761, /* XMLNAMESPACES */ XMLPARSE = 762, /* XMLPARSE */ XMLPI = 763, /* XMLPI */ XMLROOT = 764, /* XMLROOT */ XMLSERIALIZE = 765, /* XMLSERIALIZE */ XMLTABLE = 766, /* XMLTABLE */ YEAR_P = 767, /* YEAR_P */ YES_P = 768, /* YES_P */ ZONE = 769, /* ZONE */ FORMAT_LA = 770, /* FORMAT_LA */ NOT_LA = 771, /* NOT_LA */ NULLS_LA = 772, /* NULLS_LA */ WITH_LA = 773, /* WITH_LA */ WITHOUT_LA = 774, /* WITHOUT_LA */ MODE_TYPE_NAME = 775, /* MODE_TYPE_NAME */ MODE_PLPGSQL_EXPR = 776, /* MODE_PLPGSQL_EXPR */ MODE_PLPGSQL_ASSIGN1 = 777, /* MODE_PLPGSQL_ASSIGN1 */ MODE_PLPGSQL_ASSIGN2 = 778, /* MODE_PLPGSQL_ASSIGN2 */ MODE_PLPGSQL_ASSIGN3 = 779, /* MODE_PLPGSQL_ASSIGN3 */ UMINUS = 780 /* UMINUS */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #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 ENFORCED 403 #define ENUM_P 404 #define ERROR_P 405 #define ESCAPE 406 #define EVENT 407 #define EXCEPT 408 #define EXCLUDE 409 #define EXCLUDING 410 #define EXCLUSIVE 411 #define EXECUTE 412 #define EXISTS 413 #define EXPLAIN 414 #define EXPRESSION 415 #define EXTENSION 416 #define EXTERNAL 417 #define EXTRACT 418 #define FALSE_P 419 #define FAMILY 420 #define FETCH 421 #define FILTER 422 #define FINALIZE 423 #define FIRST_P 424 #define FLOAT_P 425 #define FOLLOWING 426 #define FOR 427 #define FORCE 428 #define FOREIGN 429 #define FORMAT 430 #define FORWARD 431 #define FREEZE 432 #define FROM 433 #define FULL 434 #define FUNCTION 435 #define FUNCTIONS 436 #define GENERATED 437 #define GLOBAL 438 #define GRANT 439 #define GRANTED 440 #define GREATEST 441 #define GROUP_P 442 #define GROUPING 443 #define GROUPS 444 #define HANDLER 445 #define HAVING 446 #define HEADER_P 447 #define HOLD 448 #define HOUR_P 449 #define IDENTITY_P 450 #define IF_P 451 #define ILIKE 452 #define IMMEDIATE 453 #define IMMUTABLE 454 #define IMPLICIT_P 455 #define IMPORT_P 456 #define IN_P 457 #define INCLUDE 458 #define INCLUDING 459 #define INCREMENT 460 #define INDENT 461 #define INDEX 462 #define INDEXES 463 #define INHERIT 464 #define INHERITS 465 #define INITIALLY 466 #define INLINE_P 467 #define INNER_P 468 #define INOUT 469 #define INPUT_P 470 #define INSENSITIVE 471 #define INSERT 472 #define INSTEAD 473 #define INT_P 474 #define INTEGER 475 #define INTERSECT 476 #define INTERVAL 477 #define INTO 478 #define INVOKER 479 #define IS 480 #define ISNULL 481 #define ISOLATION 482 #define JOIN 483 #define JSON 484 #define JSON_ARRAY 485 #define JSON_ARRAYAGG 486 #define JSON_EXISTS 487 #define JSON_OBJECT 488 #define JSON_OBJECTAGG 489 #define JSON_QUERY 490 #define JSON_SCALAR 491 #define JSON_SERIALIZE 492 #define JSON_TABLE 493 #define JSON_VALUE 494 #define KEEP 495 #define KEY 496 #define KEYS 497 #define LABEL 498 #define LANGUAGE 499 #define LARGE_P 500 #define LAST_P 501 #define LATERAL_P 502 #define LEADING 503 #define LEAKPROOF 504 #define LEAST 505 #define LEFT 506 #define LEVEL 507 #define LIKE 508 #define LIMIT 509 #define LISTEN 510 #define LOAD 511 #define LOCAL 512 #define LOCALTIME 513 #define LOCALTIMESTAMP 514 #define LOCATION 515 #define LOCK_P 516 #define LOCKED 517 #define LOGGED 518 #define MAPPING 519 #define MATCH 520 #define MATCHED 521 #define MATERIALIZED 522 #define MAXVALUE 523 #define MERGE 524 #define MERGE_ACTION 525 #define METHOD 526 #define MINUTE_P 527 #define MINVALUE 528 #define MODE 529 #define MONTH_P 530 #define MOVE 531 #define NAME_P 532 #define NAMES 533 #define NATIONAL 534 #define NATURAL 535 #define NCHAR 536 #define NESTED 537 #define NEW 538 #define NEXT 539 #define NFC 540 #define NFD 541 #define NFKC 542 #define NFKD 543 #define NO 544 #define NONE 545 #define NORMALIZE 546 #define NORMALIZED 547 #define NOT 548 #define NOTHING 549 #define NOTIFY 550 #define NOTNULL 551 #define NOWAIT 552 #define NULL_P 553 #define NULLIF 554 #define NULLS_P 555 #define NUMERIC 556 #define OBJECT_P 557 #define OBJECTS_P 558 #define OF 559 #define OFF 560 #define OFFSET 561 #define OIDS 562 #define OLD 563 #define OMIT 564 #define ON 565 #define ONLY 566 #define OPERATOR 567 #define OPTION 568 #define OPTIONS 569 #define OR 570 #define ORDER 571 #define ORDINALITY 572 #define OTHERS 573 #define OUT_P 574 #define OUTER_P 575 #define OVER 576 #define OVERLAPS 577 #define OVERLAY 578 #define OVERRIDING 579 #define OWNED 580 #define OWNER 581 #define PARALLEL 582 #define PARAMETER 583 #define PARSER 584 #define PARTIAL 585 #define PARTITION 586 #define PASSING 587 #define PASSWORD 588 #define PATH 589 #define PGPOOL 590 #define PERIOD 591 #define PLACING 592 #define PLAN 593 #define PLANS 594 #define POLICY 595 #define POSITION 596 #define PRECEDING 597 #define PRECISION 598 #define PRESERVE 599 #define PREPARE 600 #define PREPARED 601 #define PRIMARY 602 #define PRIOR 603 #define PRIVILEGES 604 #define PROCEDURAL 605 #define PROCEDURE 606 #define PROCEDURES 607 #define PROGRAM 608 #define PUBLICATION 609 #define QUOTE 610 #define QUOTES 611 #define RANGE 612 #define READ 613 #define REAL 614 #define REASSIGN 615 #define RECURSIVE 616 #define REF_P 617 #define REFERENCES 618 #define REFERENCING 619 #define REFRESH 620 #define REINDEX 621 #define RELATIVE_P 622 #define RELEASE 623 #define RENAME 624 #define REPEATABLE 625 #define REPLACE 626 #define REPLICA 627 #define RESET 628 #define RESTART 629 #define RESTRICT 630 #define RETURN 631 #define RETURNING 632 #define RETURNS 633 #define REVOKE 634 #define RIGHT 635 #define ROLE 636 #define ROLLBACK 637 #define ROLLUP 638 #define ROUTINE 639 #define ROUTINES 640 #define ROW 641 #define ROWS 642 #define RULE 643 #define SAVEPOINT 644 #define SCALAR 645 #define SCHEMA 646 #define SCHEMAS 647 #define SCROLL 648 #define SEARCH 649 #define SECOND_P 650 #define SECURITY 651 #define SELECT 652 #define SEQUENCE 653 #define SEQUENCES 654 #define SERIALIZABLE 655 #define SERVER 656 #define SESSION 657 #define SESSION_USER 658 #define SET 659 #define SETS 660 #define SETOF 661 #define SHARE 662 #define SHOW 663 #define SIMILAR 664 #define SIMPLE 665 #define SKIP 666 #define SMALLINT 667 #define SNAPSHOT 668 #define SOME 669 #define SOURCE 670 #define SQL_P 671 #define STABLE 672 #define STANDALONE_P 673 #define START 674 #define STATEMENT 675 #define STATISTICS 676 #define STDIN 677 #define STDOUT 678 #define STORAGE 679 #define STORED 680 #define STRICT_P 681 #define STRING_P 682 #define STRIP_P 683 #define SUBSCRIPTION 684 #define SUBSTRING 685 #define SUPPORT 686 #define SYMMETRIC 687 #define SYSID 688 #define SYSTEM_P 689 #define SYSTEM_USER 690 #define TABLE 691 #define TABLES 692 #define TABLESAMPLE 693 #define TABLESPACE 694 #define TARGET 695 #define TEMP 696 #define TEMPLATE 697 #define TEMPORARY 698 #define TEXT_P 699 #define THEN 700 #define TIES 701 #define TIME 702 #define TIMESTAMP 703 #define TO 704 #define TRAILING 705 #define TRANSACTION 706 #define TRANSFORM 707 #define TREAT 708 #define TRIGGER 709 #define TRIM 710 #define TRUE_P 711 #define TRUNCATE 712 #define TRUSTED 713 #define TYPE_P 714 #define TYPES_P 715 #define UESCAPE 716 #define UNBOUNDED 717 #define UNCONDITIONAL 718 #define UNCOMMITTED 719 #define UNENCRYPTED 720 #define UNION 721 #define UNIQUE 722 #define UNKNOWN 723 #define UNLISTEN 724 #define UNLOGGED 725 #define UNTIL 726 #define UPDATE 727 #define USER 728 #define USING 729 #define VACUUM 730 #define VALID 731 #define VALIDATE 732 #define VALIDATOR 733 #define VALUE_P 734 #define VALUES 735 #define VARCHAR 736 #define VARIADIC 737 #define VARYING 738 #define VERBOSE 739 #define VERSION_P 740 #define VIEW 741 #define VIEWS 742 #define VIRTUAL 743 #define VOLATILE 744 #define WHEN 745 #define WHERE 746 #define WHITESPACE_P 747 #define WINDOW 748 #define WITH 749 #define WITHIN 750 #define WITHOUT 751 #define WORK 752 #define WRAPPER 753 #define WRITE 754 #define XML_P 755 #define XMLATTRIBUTES 756 #define XMLCONCAT 757 #define XMLELEMENT 758 #define XMLEXISTS 759 #define XMLFOREST 760 #define XMLNAMESPACES 761 #define XMLPARSE 762 #define XMLPI 763 #define XMLROOT 764 #define XMLSERIALIZE 765 #define XMLTABLE 766 #define YEAR_P 767 #define YES_P 768 #define ZONE 769 #define FORMAT_LA 770 #define NOT_LA 771 #define NULLS_LA 772 #define WITH_LA 773 #define WITHOUT_LA 774 #define MODE_TYPE_NAME 775 #define MODE_PLPGSQL_EXPR 776 #define MODE_PLPGSQL_ASSIGN1 777 #define MODE_PLPGSQL_ASSIGN2 778 #define MODE_PLPGSQL_ASSIGN3 779 #define UMINUS 780 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 257 "gram.y" 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; ReturningClause *retclause; ReturningOptionKind retoptionkind; #line 1171 "gram.h" }; 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.7.0/src/parser/gram_minimal.c0000644000175000017500001347356415120733657015165 00000000000000/* A Bison parser, made by GNU Bison 3.7.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 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. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* 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, and Bison version. */ #define YYBISON 30704 /* Bison version string. */ #define YYBISON_VERSION "3.7.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 /* First part of user prologue. */ #line 1 "gram_minimal.y" /*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y * POSTGRESQL BISON rules/actions * * Portions Copyright (c) 2003-2025, PgPool Global Development Group * Portions Copyright (c) 1996-2025, 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' #define ATTRIBUTE_GENERATED_STORED 's' #define ATTRIBUTE_GENERATED_VIRTUAL 'v' /* * 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. Unlike bison's default, we only want * to track the start position not the end position of each nonterminal. * Nonterminals that reduce to empty receive position "-1". Since a * production's leading RHS nonterminal(s) may have reduced to empty, * we have to scan to find the first one that's not -1. */ #define YYLLOC_DEFAULT(Current, Rhs, N) \ do { \ (Current) = (-1); \ for (int _i = 1; _i <= (N); _i++) \ { \ if ((Rhs)[_i] >= 0) \ { \ (Current) = (Rhs)[_i]; \ break; \ } \ } \ } while (0) /* * 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 select_limit & limit_clause productions */ typedef struct SelectLimit { Node *limitOffset; Node *limitCount; LimitOption limitOption; /* indicates presence of WITH TIES */ ParseLoc offsetLoc; /* location of OFFSET token, if present */ ParseLoc countLoc; /* location of LIMIT/FETCH token, if present */ ParseLoc optionLoc; /* location of WITH TIES, if present */ } 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 CAS_NOT_ENFORCED 0x40 #define CAS_ENFORCED 0x80 #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, int end_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, core_yyscan_t yyscanner); 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 *is_enforced, bool *not_valid, bool *no_inherit, core_yyscan_t yyscanner); static PartitionStrategy parsePartitionStrategy(char *strategy, int location, core_yyscan_t yyscanner); static void preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner); static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); #line 323 "gram_minimal.c" # ifndef YY_CAST # ifdef __cplusplus # define YY_CAST(Type, Val) static_cast (Val) # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else # define YY_CAST(Type, Val) ((Type) (Val)) # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Use api.header.include to #include this header instead of duplicating it here. */ #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 kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ IDENT = 258, /* IDENT */ UIDENT = 259, /* UIDENT */ FCONST = 260, /* FCONST */ SCONST = 261, /* SCONST */ USCONST = 262, /* USCONST */ BCONST = 263, /* BCONST */ XCONST = 264, /* XCONST */ Op = 265, /* Op */ ICONST = 266, /* ICONST */ PARAM = 267, /* PARAM */ TYPECAST = 268, /* TYPECAST */ DOT_DOT = 269, /* DOT_DOT */ COLON_EQUALS = 270, /* COLON_EQUALS */ EQUALS_GREATER = 271, /* EQUALS_GREATER */ LESS_EQUALS = 272, /* LESS_EQUALS */ GREATER_EQUALS = 273, /* GREATER_EQUALS */ NOT_EQUALS = 274, /* NOT_EQUALS */ ABORT_P = 275, /* ABORT_P */ ABSENT = 276, /* ABSENT */ ABSOLUTE_P = 277, /* ABSOLUTE_P */ ACCESS = 278, /* ACCESS */ ACTION = 279, /* ACTION */ ADD_P = 280, /* ADD_P */ ADMIN = 281, /* ADMIN */ AFTER = 282, /* AFTER */ AGGREGATE = 283, /* AGGREGATE */ ALL = 284, /* ALL */ ALSO = 285, /* ALSO */ ALTER = 286, /* ALTER */ ALWAYS = 287, /* ALWAYS */ ANALYSE = 288, /* ANALYSE */ ANALYZE = 289, /* ANALYZE */ AND = 290, /* AND */ ANY = 291, /* ANY */ ARRAY = 292, /* ARRAY */ AS = 293, /* AS */ ASC = 294, /* ASC */ ASENSITIVE = 295, /* ASENSITIVE */ ASSERTION = 296, /* ASSERTION */ ASSIGNMENT = 297, /* ASSIGNMENT */ ASYMMETRIC = 298, /* ASYMMETRIC */ ATOMIC = 299, /* ATOMIC */ AT = 300, /* AT */ ATTACH = 301, /* ATTACH */ ATTRIBUTE = 302, /* ATTRIBUTE */ AUTHORIZATION = 303, /* AUTHORIZATION */ BACKWARD = 304, /* BACKWARD */ BEFORE = 305, /* BEFORE */ BEGIN_P = 306, /* BEGIN_P */ BETWEEN = 307, /* BETWEEN */ BIGINT = 308, /* BIGINT */ BINARY = 309, /* BINARY */ BIT = 310, /* BIT */ BOOLEAN_P = 311, /* BOOLEAN_P */ BOTH = 312, /* BOTH */ BREADTH = 313, /* BREADTH */ BY = 314, /* BY */ CACHE = 315, /* CACHE */ CALL = 316, /* CALL */ CALLED = 317, /* CALLED */ CASCADE = 318, /* CASCADE */ CASCADED = 319, /* CASCADED */ CASE = 320, /* CASE */ CAST = 321, /* CAST */ CATALOG_P = 322, /* CATALOG_P */ CHAIN = 323, /* CHAIN */ CHAR_P = 324, /* CHAR_P */ CHARACTER = 325, /* CHARACTER */ CHARACTERISTICS = 326, /* CHARACTERISTICS */ CHECK = 327, /* CHECK */ CHECKPOINT = 328, /* CHECKPOINT */ CLASS = 329, /* CLASS */ CLOSE = 330, /* CLOSE */ CLUSTER = 331, /* CLUSTER */ COALESCE = 332, /* COALESCE */ COLLATE = 333, /* COLLATE */ COLLATION = 334, /* COLLATION */ COLUMN = 335, /* COLUMN */ COLUMNS = 336, /* COLUMNS */ COMMENT = 337, /* COMMENT */ COMMENTS = 338, /* COMMENTS */ COMMIT = 339, /* COMMIT */ COMMITTED = 340, /* COMMITTED */ COMPRESSION = 341, /* COMPRESSION */ CONCURRENTLY = 342, /* CONCURRENTLY */ CONDITIONAL = 343, /* CONDITIONAL */ CONFIGURATION = 344, /* CONFIGURATION */ CONFLICT = 345, /* CONFLICT */ CONNECTION = 346, /* CONNECTION */ CONSTRAINT = 347, /* CONSTRAINT */ CONSTRAINTS = 348, /* CONSTRAINTS */ CONTENT_P = 349, /* CONTENT_P */ CONTINUE_P = 350, /* CONTINUE_P */ CONVERSION_P = 351, /* CONVERSION_P */ COPY = 352, /* COPY */ COST = 353, /* COST */ CREATE = 354, /* CREATE */ CROSS = 355, /* CROSS */ CSV = 356, /* CSV */ CUBE = 357, /* CUBE */ CURRENT_P = 358, /* CURRENT_P */ CURRENT_CATALOG = 359, /* CURRENT_CATALOG */ CURRENT_DATE = 360, /* CURRENT_DATE */ CURRENT_ROLE = 361, /* CURRENT_ROLE */ CURRENT_SCHEMA = 362, /* CURRENT_SCHEMA */ CURRENT_TIME = 363, /* CURRENT_TIME */ CURRENT_TIMESTAMP = 364, /* CURRENT_TIMESTAMP */ CURRENT_USER = 365, /* CURRENT_USER */ CURSOR = 366, /* CURSOR */ CYCLE = 367, /* CYCLE */ DATA_P = 368, /* DATA_P */ DATABASE = 369, /* DATABASE */ DAY_P = 370, /* DAY_P */ DEALLOCATE = 371, /* DEALLOCATE */ DEC = 372, /* DEC */ DECIMAL_P = 373, /* DECIMAL_P */ DECLARE = 374, /* DECLARE */ DEFAULT = 375, /* DEFAULT */ DEFAULTS = 376, /* DEFAULTS */ DEFERRABLE = 377, /* DEFERRABLE */ DEFERRED = 378, /* DEFERRED */ DEFINER = 379, /* DEFINER */ DELETE_P = 380, /* DELETE_P */ DELIMITER = 381, /* DELIMITER */ DELIMITERS = 382, /* DELIMITERS */ DEPENDS = 383, /* DEPENDS */ DEPTH = 384, /* DEPTH */ DESC = 385, /* DESC */ DETACH = 386, /* DETACH */ DICTIONARY = 387, /* DICTIONARY */ DISABLE_P = 388, /* DISABLE_P */ DISCARD = 389, /* DISCARD */ DISTINCT = 390, /* DISTINCT */ DO = 391, /* DO */ DOCUMENT_P = 392, /* DOCUMENT_P */ DOMAIN_P = 393, /* DOMAIN_P */ DOUBLE_P = 394, /* DOUBLE_P */ DROP = 395, /* DROP */ EACH = 396, /* EACH */ ELSE = 397, /* ELSE */ EMPTY_P = 398, /* EMPTY_P */ ENABLE_P = 399, /* ENABLE_P */ ENCODING = 400, /* ENCODING */ ENCRYPTED = 401, /* ENCRYPTED */ END_P = 402, /* END_P */ ENFORCED = 403, /* ENFORCED */ ENUM_P = 404, /* ENUM_P */ ERROR_P = 405, /* ERROR_P */ ESCAPE = 406, /* ESCAPE */ EVENT = 407, /* EVENT */ EXCEPT = 408, /* EXCEPT */ EXCLUDE = 409, /* EXCLUDE */ EXCLUDING = 410, /* EXCLUDING */ EXCLUSIVE = 411, /* EXCLUSIVE */ EXECUTE = 412, /* EXECUTE */ EXISTS = 413, /* EXISTS */ EXPLAIN = 414, /* EXPLAIN */ EXPRESSION = 415, /* EXPRESSION */ EXTENSION = 416, /* EXTENSION */ EXTERNAL = 417, /* EXTERNAL */ EXTRACT = 418, /* EXTRACT */ FALSE_P = 419, /* FALSE_P */ FAMILY = 420, /* FAMILY */ FETCH = 421, /* FETCH */ FILTER = 422, /* FILTER */ FINALIZE = 423, /* FINALIZE */ FIRST_P = 424, /* FIRST_P */ FLOAT_P = 425, /* FLOAT_P */ FOLLOWING = 426, /* FOLLOWING */ FOR = 427, /* FOR */ FORCE = 428, /* FORCE */ FOREIGN = 429, /* FOREIGN */ FORMAT = 430, /* FORMAT */ FORWARD = 431, /* FORWARD */ FREEZE = 432, /* FREEZE */ FROM = 433, /* FROM */ FULL = 434, /* FULL */ FUNCTION = 435, /* FUNCTION */ FUNCTIONS = 436, /* FUNCTIONS */ GENERATED = 437, /* GENERATED */ GLOBAL = 438, /* GLOBAL */ GRANT = 439, /* GRANT */ GRANTED = 440, /* GRANTED */ GREATEST = 441, /* GREATEST */ GROUP_P = 442, /* GROUP_P */ GROUPING = 443, /* GROUPING */ GROUPS = 444, /* GROUPS */ HANDLER = 445, /* HANDLER */ HAVING = 446, /* HAVING */ HEADER_P = 447, /* HEADER_P */ HOLD = 448, /* HOLD */ HOUR_P = 449, /* HOUR_P */ IDENTITY_P = 450, /* IDENTITY_P */ IF_P = 451, /* IF_P */ ILIKE = 452, /* ILIKE */ IMMEDIATE = 453, /* IMMEDIATE */ IMMUTABLE = 454, /* IMMUTABLE */ IMPLICIT_P = 455, /* IMPLICIT_P */ IMPORT_P = 456, /* IMPORT_P */ IN_P = 457, /* IN_P */ INCLUDE = 458, /* INCLUDE */ INCLUDING = 459, /* INCLUDING */ INCREMENT = 460, /* INCREMENT */ INDENT = 461, /* INDENT */ INDEX = 462, /* INDEX */ INDEXES = 463, /* INDEXES */ INHERIT = 464, /* INHERIT */ INHERITS = 465, /* INHERITS */ INITIALLY = 466, /* INITIALLY */ INLINE_P = 467, /* INLINE_P */ INNER_P = 468, /* INNER_P */ INOUT = 469, /* INOUT */ INPUT_P = 470, /* INPUT_P */ INSENSITIVE = 471, /* INSENSITIVE */ INSERT = 472, /* INSERT */ INSTEAD = 473, /* INSTEAD */ INT_P = 474, /* INT_P */ INTEGER = 475, /* INTEGER */ INTERSECT = 476, /* INTERSECT */ INTERVAL = 477, /* INTERVAL */ INTO = 478, /* INTO */ INVOKER = 479, /* INVOKER */ IS = 480, /* IS */ ISNULL = 481, /* ISNULL */ ISOLATION = 482, /* ISOLATION */ JOIN = 483, /* JOIN */ JSON = 484, /* JSON */ JSON_ARRAY = 485, /* JSON_ARRAY */ JSON_ARRAYAGG = 486, /* JSON_ARRAYAGG */ JSON_EXISTS = 487, /* JSON_EXISTS */ JSON_OBJECT = 488, /* JSON_OBJECT */ JSON_OBJECTAGG = 489, /* JSON_OBJECTAGG */ JSON_QUERY = 490, /* JSON_QUERY */ JSON_SCALAR = 491, /* JSON_SCALAR */ JSON_SERIALIZE = 492, /* JSON_SERIALIZE */ JSON_TABLE = 493, /* JSON_TABLE */ JSON_VALUE = 494, /* JSON_VALUE */ KEEP = 495, /* KEEP */ KEY = 496, /* KEY */ KEYS = 497, /* KEYS */ LABEL = 498, /* LABEL */ LANGUAGE = 499, /* LANGUAGE */ LARGE_P = 500, /* LARGE_P */ LAST_P = 501, /* LAST_P */ LATERAL_P = 502, /* LATERAL_P */ LEADING = 503, /* LEADING */ LEAKPROOF = 504, /* LEAKPROOF */ LEAST = 505, /* LEAST */ LEFT = 506, /* LEFT */ LEVEL = 507, /* LEVEL */ LIKE = 508, /* LIKE */ LIMIT = 509, /* LIMIT */ LISTEN = 510, /* LISTEN */ LOAD = 511, /* LOAD */ LOCAL = 512, /* LOCAL */ LOCALTIME = 513, /* LOCALTIME */ LOCALTIMESTAMP = 514, /* LOCALTIMESTAMP */ LOCATION = 515, /* LOCATION */ LOCK_P = 516, /* LOCK_P */ LOCKED = 517, /* LOCKED */ LOGGED = 518, /* LOGGED */ MAPPING = 519, /* MAPPING */ MATCH = 520, /* MATCH */ MATCHED = 521, /* MATCHED */ MATERIALIZED = 522, /* MATERIALIZED */ MAXVALUE = 523, /* MAXVALUE */ MERGE = 524, /* MERGE */ MERGE_ACTION = 525, /* MERGE_ACTION */ METHOD = 526, /* METHOD */ MINUTE_P = 527, /* MINUTE_P */ MINVALUE = 528, /* MINVALUE */ MODE = 529, /* MODE */ MONTH_P = 530, /* MONTH_P */ MOVE = 531, /* MOVE */ NAME_P = 532, /* NAME_P */ NAMES = 533, /* NAMES */ NATIONAL = 534, /* NATIONAL */ NATURAL = 535, /* NATURAL */ NCHAR = 536, /* NCHAR */ NESTED = 537, /* NESTED */ NEW = 538, /* NEW */ NEXT = 539, /* NEXT */ NFC = 540, /* NFC */ NFD = 541, /* NFD */ NFKC = 542, /* NFKC */ NFKD = 543, /* NFKD */ NO = 544, /* NO */ NONE = 545, /* NONE */ NORMALIZE = 546, /* NORMALIZE */ NORMALIZED = 547, /* NORMALIZED */ NOT = 548, /* NOT */ NOTHING = 549, /* NOTHING */ NOTIFY = 550, /* NOTIFY */ NOTNULL = 551, /* NOTNULL */ NOWAIT = 552, /* NOWAIT */ NULL_P = 553, /* NULL_P */ NULLIF = 554, /* NULLIF */ NULLS_P = 555, /* NULLS_P */ NUMERIC = 556, /* NUMERIC */ OBJECT_P = 557, /* OBJECT_P */ OBJECTS_P = 558, /* OBJECTS_P */ OF = 559, /* OF */ OFF = 560, /* OFF */ OFFSET = 561, /* OFFSET */ OIDS = 562, /* OIDS */ OLD = 563, /* OLD */ OMIT = 564, /* OMIT */ ON = 565, /* ON */ ONLY = 566, /* ONLY */ OPERATOR = 567, /* OPERATOR */ OPTION = 568, /* OPTION */ OPTIONS = 569, /* OPTIONS */ OR = 570, /* OR */ ORDER = 571, /* ORDER */ ORDINALITY = 572, /* ORDINALITY */ OTHERS = 573, /* OTHERS */ OUT_P = 574, /* OUT_P */ OUTER_P = 575, /* OUTER_P */ OVER = 576, /* OVER */ OVERLAPS = 577, /* OVERLAPS */ OVERLAY = 578, /* OVERLAY */ OVERRIDING = 579, /* OVERRIDING */ OWNED = 580, /* OWNED */ OWNER = 581, /* OWNER */ PARALLEL = 582, /* PARALLEL */ PARAMETER = 583, /* PARAMETER */ PARSER = 584, /* PARSER */ PARTIAL = 585, /* PARTIAL */ PARTITION = 586, /* PARTITION */ PASSING = 587, /* PASSING */ PASSWORD = 588, /* PASSWORD */ PATH = 589, /* PATH */ PGPOOL = 590, /* PGPOOL */ PERIOD = 591, /* PERIOD */ PLACING = 592, /* PLACING */ PLAN = 593, /* PLAN */ PLANS = 594, /* PLANS */ POLICY = 595, /* POLICY */ POSITION = 596, /* POSITION */ PRECEDING = 597, /* PRECEDING */ PRECISION = 598, /* PRECISION */ PRESERVE = 599, /* PRESERVE */ PREPARE = 600, /* PREPARE */ PREPARED = 601, /* PREPARED */ PRIMARY = 602, /* PRIMARY */ PRIOR = 603, /* PRIOR */ PRIVILEGES = 604, /* PRIVILEGES */ PROCEDURAL = 605, /* PROCEDURAL */ PROCEDURE = 606, /* PROCEDURE */ PROCEDURES = 607, /* PROCEDURES */ PROGRAM = 608, /* PROGRAM */ PUBLICATION = 609, /* PUBLICATION */ QUOTE = 610, /* QUOTE */ QUOTES = 611, /* QUOTES */ RANGE = 612, /* RANGE */ READ = 613, /* READ */ REAL = 614, /* REAL */ REASSIGN = 615, /* REASSIGN */ RECURSIVE = 616, /* RECURSIVE */ REF_P = 617, /* REF_P */ REFERENCES = 618, /* REFERENCES */ REFERENCING = 619, /* REFERENCING */ REFRESH = 620, /* REFRESH */ REINDEX = 621, /* REINDEX */ RELATIVE_P = 622, /* RELATIVE_P */ RELEASE = 623, /* RELEASE */ RENAME = 624, /* RENAME */ REPEATABLE = 625, /* REPEATABLE */ REPLACE = 626, /* REPLACE */ REPLICA = 627, /* REPLICA */ RESET = 628, /* RESET */ RESTART = 629, /* RESTART */ RESTRICT = 630, /* RESTRICT */ RETURN = 631, /* RETURN */ RETURNING = 632, /* RETURNING */ RETURNS = 633, /* RETURNS */ REVOKE = 634, /* REVOKE */ RIGHT = 635, /* RIGHT */ ROLE = 636, /* ROLE */ ROLLBACK = 637, /* ROLLBACK */ ROLLUP = 638, /* ROLLUP */ ROUTINE = 639, /* ROUTINE */ ROUTINES = 640, /* ROUTINES */ ROW = 641, /* ROW */ ROWS = 642, /* ROWS */ RULE = 643, /* RULE */ SAVEPOINT = 644, /* SAVEPOINT */ SCALAR = 645, /* SCALAR */ SCHEMA = 646, /* SCHEMA */ SCHEMAS = 647, /* SCHEMAS */ SCROLL = 648, /* SCROLL */ SEARCH = 649, /* SEARCH */ SECOND_P = 650, /* SECOND_P */ SECURITY = 651, /* SECURITY */ SELECT = 652, /* SELECT */ SEQUENCE = 653, /* SEQUENCE */ SEQUENCES = 654, /* SEQUENCES */ SERIALIZABLE = 655, /* SERIALIZABLE */ SERVER = 656, /* SERVER */ SESSION = 657, /* SESSION */ SESSION_USER = 658, /* SESSION_USER */ SET = 659, /* SET */ SETS = 660, /* SETS */ SETOF = 661, /* SETOF */ SHARE = 662, /* SHARE */ SHOW = 663, /* SHOW */ SIMILAR = 664, /* SIMILAR */ SIMPLE = 665, /* SIMPLE */ SKIP = 666, /* SKIP */ SMALLINT = 667, /* SMALLINT */ SNAPSHOT = 668, /* SNAPSHOT */ SOME = 669, /* SOME */ SOURCE = 670, /* SOURCE */ SQL_P = 671, /* SQL_P */ STABLE = 672, /* STABLE */ STANDALONE_P = 673, /* STANDALONE_P */ START = 674, /* START */ STATEMENT = 675, /* STATEMENT */ STATISTICS = 676, /* STATISTICS */ STDIN = 677, /* STDIN */ STDOUT = 678, /* STDOUT */ STORAGE = 679, /* STORAGE */ STORED = 680, /* STORED */ STRICT_P = 681, /* STRICT_P */ STRING_P = 682, /* STRING_P */ STRIP_P = 683, /* STRIP_P */ SUBSCRIPTION = 684, /* SUBSCRIPTION */ SUBSTRING = 685, /* SUBSTRING */ SUPPORT = 686, /* SUPPORT */ SYMMETRIC = 687, /* SYMMETRIC */ SYSID = 688, /* SYSID */ SYSTEM_P = 689, /* SYSTEM_P */ SYSTEM_USER = 690, /* SYSTEM_USER */ TABLE = 691, /* TABLE */ TABLES = 692, /* TABLES */ TABLESAMPLE = 693, /* TABLESAMPLE */ TABLESPACE = 694, /* TABLESPACE */ TARGET = 695, /* TARGET */ TEMP = 696, /* TEMP */ TEMPLATE = 697, /* TEMPLATE */ TEMPORARY = 698, /* TEMPORARY */ TEXT_P = 699, /* TEXT_P */ THEN = 700, /* THEN */ TIES = 701, /* TIES */ TIME = 702, /* TIME */ TIMESTAMP = 703, /* TIMESTAMP */ TO = 704, /* TO */ TRAILING = 705, /* TRAILING */ TRANSACTION = 706, /* TRANSACTION */ TRANSFORM = 707, /* TRANSFORM */ TREAT = 708, /* TREAT */ TRIGGER = 709, /* TRIGGER */ TRIM = 710, /* TRIM */ TRUE_P = 711, /* TRUE_P */ TRUNCATE = 712, /* TRUNCATE */ TRUSTED = 713, /* TRUSTED */ TYPE_P = 714, /* TYPE_P */ TYPES_P = 715, /* TYPES_P */ UESCAPE = 716, /* UESCAPE */ UNBOUNDED = 717, /* UNBOUNDED */ UNCONDITIONAL = 718, /* UNCONDITIONAL */ UNCOMMITTED = 719, /* UNCOMMITTED */ UNENCRYPTED = 720, /* UNENCRYPTED */ UNION = 721, /* UNION */ UNIQUE = 722, /* UNIQUE */ UNKNOWN = 723, /* UNKNOWN */ UNLISTEN = 724, /* UNLISTEN */ UNLOGGED = 725, /* UNLOGGED */ UNTIL = 726, /* UNTIL */ UPDATE = 727, /* UPDATE */ USER = 728, /* USER */ USING = 729, /* USING */ VACUUM = 730, /* VACUUM */ VALID = 731, /* VALID */ VALIDATE = 732, /* VALIDATE */ VALIDATOR = 733, /* VALIDATOR */ VALUE_P = 734, /* VALUE_P */ VALUES = 735, /* VALUES */ VARCHAR = 736, /* VARCHAR */ VARIADIC = 737, /* VARIADIC */ VARYING = 738, /* VARYING */ VERBOSE = 739, /* VERBOSE */ VERSION_P = 740, /* VERSION_P */ VIEW = 741, /* VIEW */ VIEWS = 742, /* VIEWS */ VIRTUAL = 743, /* VIRTUAL */ VOLATILE = 744, /* VOLATILE */ WHEN = 745, /* WHEN */ WHERE = 746, /* WHERE */ WHITESPACE_P = 747, /* WHITESPACE_P */ WINDOW = 748, /* WINDOW */ WITH = 749, /* WITH */ WITHIN = 750, /* WITHIN */ WITHOUT = 751, /* WITHOUT */ WORK = 752, /* WORK */ WRAPPER = 753, /* WRAPPER */ WRITE = 754, /* WRITE */ XML_P = 755, /* XML_P */ XMLATTRIBUTES = 756, /* XMLATTRIBUTES */ XMLCONCAT = 757, /* XMLCONCAT */ XMLELEMENT = 758, /* XMLELEMENT */ XMLEXISTS = 759, /* XMLEXISTS */ XMLFOREST = 760, /* XMLFOREST */ XMLNAMESPACES = 761, /* XMLNAMESPACES */ XMLPARSE = 762, /* XMLPARSE */ XMLPI = 763, /* XMLPI */ XMLROOT = 764, /* XMLROOT */ XMLSERIALIZE = 765, /* XMLSERIALIZE */ XMLTABLE = 766, /* XMLTABLE */ YEAR_P = 767, /* YEAR_P */ YES_P = 768, /* YES_P */ ZONE = 769, /* ZONE */ FORMAT_LA = 770, /* FORMAT_LA */ NOT_LA = 771, /* NOT_LA */ NULLS_LA = 772, /* NULLS_LA */ WITH_LA = 773, /* WITH_LA */ WITHOUT_LA = 774, /* WITHOUT_LA */ MODE_TYPE_NAME = 775, /* MODE_TYPE_NAME */ MODE_PLPGSQL_EXPR = 776, /* MODE_PLPGSQL_EXPR */ MODE_PLPGSQL_ASSIGN1 = 777, /* MODE_PLPGSQL_ASSIGN1 */ MODE_PLPGSQL_ASSIGN2 = 778, /* MODE_PLPGSQL_ASSIGN2 */ MODE_PLPGSQL_ASSIGN3 = 779, /* MODE_PLPGSQL_ASSIGN3 */ UMINUS = 780 /* UMINUS */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #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 ENFORCED 403 #define ENUM_P 404 #define ERROR_P 405 #define ESCAPE 406 #define EVENT 407 #define EXCEPT 408 #define EXCLUDE 409 #define EXCLUDING 410 #define EXCLUSIVE 411 #define EXECUTE 412 #define EXISTS 413 #define EXPLAIN 414 #define EXPRESSION 415 #define EXTENSION 416 #define EXTERNAL 417 #define EXTRACT 418 #define FALSE_P 419 #define FAMILY 420 #define FETCH 421 #define FILTER 422 #define FINALIZE 423 #define FIRST_P 424 #define FLOAT_P 425 #define FOLLOWING 426 #define FOR 427 #define FORCE 428 #define FOREIGN 429 #define FORMAT 430 #define FORWARD 431 #define FREEZE 432 #define FROM 433 #define FULL 434 #define FUNCTION 435 #define FUNCTIONS 436 #define GENERATED 437 #define GLOBAL 438 #define GRANT 439 #define GRANTED 440 #define GREATEST 441 #define GROUP_P 442 #define GROUPING 443 #define GROUPS 444 #define HANDLER 445 #define HAVING 446 #define HEADER_P 447 #define HOLD 448 #define HOUR_P 449 #define IDENTITY_P 450 #define IF_P 451 #define ILIKE 452 #define IMMEDIATE 453 #define IMMUTABLE 454 #define IMPLICIT_P 455 #define IMPORT_P 456 #define IN_P 457 #define INCLUDE 458 #define INCLUDING 459 #define INCREMENT 460 #define INDENT 461 #define INDEX 462 #define INDEXES 463 #define INHERIT 464 #define INHERITS 465 #define INITIALLY 466 #define INLINE_P 467 #define INNER_P 468 #define INOUT 469 #define INPUT_P 470 #define INSENSITIVE 471 #define INSERT 472 #define INSTEAD 473 #define INT_P 474 #define INTEGER 475 #define INTERSECT 476 #define INTERVAL 477 #define INTO 478 #define INVOKER 479 #define IS 480 #define ISNULL 481 #define ISOLATION 482 #define JOIN 483 #define JSON 484 #define JSON_ARRAY 485 #define JSON_ARRAYAGG 486 #define JSON_EXISTS 487 #define JSON_OBJECT 488 #define JSON_OBJECTAGG 489 #define JSON_QUERY 490 #define JSON_SCALAR 491 #define JSON_SERIALIZE 492 #define JSON_TABLE 493 #define JSON_VALUE 494 #define KEEP 495 #define KEY 496 #define KEYS 497 #define LABEL 498 #define LANGUAGE 499 #define LARGE_P 500 #define LAST_P 501 #define LATERAL_P 502 #define LEADING 503 #define LEAKPROOF 504 #define LEAST 505 #define LEFT 506 #define LEVEL 507 #define LIKE 508 #define LIMIT 509 #define LISTEN 510 #define LOAD 511 #define LOCAL 512 #define LOCALTIME 513 #define LOCALTIMESTAMP 514 #define LOCATION 515 #define LOCK_P 516 #define LOCKED 517 #define LOGGED 518 #define MAPPING 519 #define MATCH 520 #define MATCHED 521 #define MATERIALIZED 522 #define MAXVALUE 523 #define MERGE 524 #define MERGE_ACTION 525 #define METHOD 526 #define MINUTE_P 527 #define MINVALUE 528 #define MODE 529 #define MONTH_P 530 #define MOVE 531 #define NAME_P 532 #define NAMES 533 #define NATIONAL 534 #define NATURAL 535 #define NCHAR 536 #define NESTED 537 #define NEW 538 #define NEXT 539 #define NFC 540 #define NFD 541 #define NFKC 542 #define NFKD 543 #define NO 544 #define NONE 545 #define NORMALIZE 546 #define NORMALIZED 547 #define NOT 548 #define NOTHING 549 #define NOTIFY 550 #define NOTNULL 551 #define NOWAIT 552 #define NULL_P 553 #define NULLIF 554 #define NULLS_P 555 #define NUMERIC 556 #define OBJECT_P 557 #define OBJECTS_P 558 #define OF 559 #define OFF 560 #define OFFSET 561 #define OIDS 562 #define OLD 563 #define OMIT 564 #define ON 565 #define ONLY 566 #define OPERATOR 567 #define OPTION 568 #define OPTIONS 569 #define OR 570 #define ORDER 571 #define ORDINALITY 572 #define OTHERS 573 #define OUT_P 574 #define OUTER_P 575 #define OVER 576 #define OVERLAPS 577 #define OVERLAY 578 #define OVERRIDING 579 #define OWNED 580 #define OWNER 581 #define PARALLEL 582 #define PARAMETER 583 #define PARSER 584 #define PARTIAL 585 #define PARTITION 586 #define PASSING 587 #define PASSWORD 588 #define PATH 589 #define PGPOOL 590 #define PERIOD 591 #define PLACING 592 #define PLAN 593 #define PLANS 594 #define POLICY 595 #define POSITION 596 #define PRECEDING 597 #define PRECISION 598 #define PRESERVE 599 #define PREPARE 600 #define PREPARED 601 #define PRIMARY 602 #define PRIOR 603 #define PRIVILEGES 604 #define PROCEDURAL 605 #define PROCEDURE 606 #define PROCEDURES 607 #define PROGRAM 608 #define PUBLICATION 609 #define QUOTE 610 #define QUOTES 611 #define RANGE 612 #define READ 613 #define REAL 614 #define REASSIGN 615 #define RECURSIVE 616 #define REF_P 617 #define REFERENCES 618 #define REFERENCING 619 #define REFRESH 620 #define REINDEX 621 #define RELATIVE_P 622 #define RELEASE 623 #define RENAME 624 #define REPEATABLE 625 #define REPLACE 626 #define REPLICA 627 #define RESET 628 #define RESTART 629 #define RESTRICT 630 #define RETURN 631 #define RETURNING 632 #define RETURNS 633 #define REVOKE 634 #define RIGHT 635 #define ROLE 636 #define ROLLBACK 637 #define ROLLUP 638 #define ROUTINE 639 #define ROUTINES 640 #define ROW 641 #define ROWS 642 #define RULE 643 #define SAVEPOINT 644 #define SCALAR 645 #define SCHEMA 646 #define SCHEMAS 647 #define SCROLL 648 #define SEARCH 649 #define SECOND_P 650 #define SECURITY 651 #define SELECT 652 #define SEQUENCE 653 #define SEQUENCES 654 #define SERIALIZABLE 655 #define SERVER 656 #define SESSION 657 #define SESSION_USER 658 #define SET 659 #define SETS 660 #define SETOF 661 #define SHARE 662 #define SHOW 663 #define SIMILAR 664 #define SIMPLE 665 #define SKIP 666 #define SMALLINT 667 #define SNAPSHOT 668 #define SOME 669 #define SOURCE 670 #define SQL_P 671 #define STABLE 672 #define STANDALONE_P 673 #define START 674 #define STATEMENT 675 #define STATISTICS 676 #define STDIN 677 #define STDOUT 678 #define STORAGE 679 #define STORED 680 #define STRICT_P 681 #define STRING_P 682 #define STRIP_P 683 #define SUBSCRIPTION 684 #define SUBSTRING 685 #define SUPPORT 686 #define SYMMETRIC 687 #define SYSID 688 #define SYSTEM_P 689 #define SYSTEM_USER 690 #define TABLE 691 #define TABLES 692 #define TABLESAMPLE 693 #define TABLESPACE 694 #define TARGET 695 #define TEMP 696 #define TEMPLATE 697 #define TEMPORARY 698 #define TEXT_P 699 #define THEN 700 #define TIES 701 #define TIME 702 #define TIMESTAMP 703 #define TO 704 #define TRAILING 705 #define TRANSACTION 706 #define TRANSFORM 707 #define TREAT 708 #define TRIGGER 709 #define TRIM 710 #define TRUE_P 711 #define TRUNCATE 712 #define TRUSTED 713 #define TYPE_P 714 #define TYPES_P 715 #define UESCAPE 716 #define UNBOUNDED 717 #define UNCONDITIONAL 718 #define UNCOMMITTED 719 #define UNENCRYPTED 720 #define UNION 721 #define UNIQUE 722 #define UNKNOWN 723 #define UNLISTEN 724 #define UNLOGGED 725 #define UNTIL 726 #define UPDATE 727 #define USER 728 #define USING 729 #define VACUUM 730 #define VALID 731 #define VALIDATE 732 #define VALIDATOR 733 #define VALUE_P 734 #define VALUES 735 #define VARCHAR 736 #define VARIADIC 737 #define VARYING 738 #define VERBOSE 739 #define VERSION_P 740 #define VIEW 741 #define VIEWS 742 #define VIRTUAL 743 #define VOLATILE 744 #define WHEN 745 #define WHERE 746 #define WHITESPACE_P 747 #define WINDOW 748 #define WITH 749 #define WITHIN 750 #define WITHOUT 751 #define WORK 752 #define WRAPPER 753 #define WRITE 754 #define XML_P 755 #define XMLATTRIBUTES 756 #define XMLCONCAT 757 #define XMLELEMENT 758 #define XMLEXISTS 759 #define XMLFOREST 760 #define XMLNAMESPACES 761 #define XMLPARSE 762 #define XMLPI 763 #define XMLROOT 764 #define XMLSERIALIZE 765 #define XMLTABLE 766 #define YEAR_P 767 #define YES_P 768 #define ZONE 769 #define FORMAT_LA 770 #define NOT_LA 771 #define NULLS_LA 772 #define WITH_LA 773 #define WITHOUT_LA 774 #define MODE_TYPE_NAME 775 #define MODE_PLPGSQL_EXPR 776 #define MODE_PLPGSQL_ASSIGN1 777 #define MODE_PLPGSQL_ASSIGN2 778 #define MODE_PLPGSQL_ASSIGN3 779 #define UMINUS 780 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 257 "gram_minimal.y" 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; ReturningClause *retclause; ReturningOptionKind retoptionkind; #line 1480 "gram_minimal.c" }; 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 */ /* Symbol kind. */ enum yysymbol_kind_t { YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEOF = 0, /* "end of file" */ YYSYMBOL_YYerror = 1, /* error */ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ YYSYMBOL_IDENT = 3, /* IDENT */ YYSYMBOL_UIDENT = 4, /* UIDENT */ YYSYMBOL_FCONST = 5, /* FCONST */ YYSYMBOL_SCONST = 6, /* SCONST */ YYSYMBOL_USCONST = 7, /* USCONST */ YYSYMBOL_BCONST = 8, /* BCONST */ YYSYMBOL_XCONST = 9, /* XCONST */ YYSYMBOL_Op = 10, /* Op */ YYSYMBOL_ICONST = 11, /* ICONST */ YYSYMBOL_PARAM = 12, /* PARAM */ YYSYMBOL_TYPECAST = 13, /* TYPECAST */ YYSYMBOL_DOT_DOT = 14, /* DOT_DOT */ YYSYMBOL_COLON_EQUALS = 15, /* COLON_EQUALS */ YYSYMBOL_EQUALS_GREATER = 16, /* EQUALS_GREATER */ YYSYMBOL_LESS_EQUALS = 17, /* LESS_EQUALS */ YYSYMBOL_GREATER_EQUALS = 18, /* GREATER_EQUALS */ YYSYMBOL_NOT_EQUALS = 19, /* NOT_EQUALS */ YYSYMBOL_ABORT_P = 20, /* ABORT_P */ YYSYMBOL_ABSENT = 21, /* ABSENT */ YYSYMBOL_ABSOLUTE_P = 22, /* ABSOLUTE_P */ YYSYMBOL_ACCESS = 23, /* ACCESS */ YYSYMBOL_ACTION = 24, /* ACTION */ YYSYMBOL_ADD_P = 25, /* ADD_P */ YYSYMBOL_ADMIN = 26, /* ADMIN */ YYSYMBOL_AFTER = 27, /* AFTER */ YYSYMBOL_AGGREGATE = 28, /* AGGREGATE */ YYSYMBOL_ALL = 29, /* ALL */ YYSYMBOL_ALSO = 30, /* ALSO */ YYSYMBOL_ALTER = 31, /* ALTER */ YYSYMBOL_ALWAYS = 32, /* ALWAYS */ YYSYMBOL_ANALYSE = 33, /* ANALYSE */ YYSYMBOL_ANALYZE = 34, /* ANALYZE */ YYSYMBOL_AND = 35, /* AND */ YYSYMBOL_ANY = 36, /* ANY */ YYSYMBOL_ARRAY = 37, /* ARRAY */ YYSYMBOL_AS = 38, /* AS */ YYSYMBOL_ASC = 39, /* ASC */ YYSYMBOL_ASENSITIVE = 40, /* ASENSITIVE */ YYSYMBOL_ASSERTION = 41, /* ASSERTION */ YYSYMBOL_ASSIGNMENT = 42, /* ASSIGNMENT */ YYSYMBOL_ASYMMETRIC = 43, /* ASYMMETRIC */ YYSYMBOL_ATOMIC = 44, /* ATOMIC */ YYSYMBOL_AT = 45, /* AT */ YYSYMBOL_ATTACH = 46, /* ATTACH */ YYSYMBOL_ATTRIBUTE = 47, /* ATTRIBUTE */ YYSYMBOL_AUTHORIZATION = 48, /* AUTHORIZATION */ YYSYMBOL_BACKWARD = 49, /* BACKWARD */ YYSYMBOL_BEFORE = 50, /* BEFORE */ YYSYMBOL_BEGIN_P = 51, /* BEGIN_P */ YYSYMBOL_BETWEEN = 52, /* BETWEEN */ YYSYMBOL_BIGINT = 53, /* BIGINT */ YYSYMBOL_BINARY = 54, /* BINARY */ YYSYMBOL_BIT = 55, /* BIT */ YYSYMBOL_BOOLEAN_P = 56, /* BOOLEAN_P */ YYSYMBOL_BOTH = 57, /* BOTH */ YYSYMBOL_BREADTH = 58, /* BREADTH */ YYSYMBOL_BY = 59, /* BY */ YYSYMBOL_CACHE = 60, /* CACHE */ YYSYMBOL_CALL = 61, /* CALL */ YYSYMBOL_CALLED = 62, /* CALLED */ YYSYMBOL_CASCADE = 63, /* CASCADE */ YYSYMBOL_CASCADED = 64, /* CASCADED */ YYSYMBOL_CASE = 65, /* CASE */ YYSYMBOL_CAST = 66, /* CAST */ YYSYMBOL_CATALOG_P = 67, /* CATALOG_P */ YYSYMBOL_CHAIN = 68, /* CHAIN */ YYSYMBOL_CHAR_P = 69, /* CHAR_P */ YYSYMBOL_CHARACTER = 70, /* CHARACTER */ YYSYMBOL_CHARACTERISTICS = 71, /* CHARACTERISTICS */ YYSYMBOL_CHECK = 72, /* CHECK */ YYSYMBOL_CHECKPOINT = 73, /* CHECKPOINT */ YYSYMBOL_CLASS = 74, /* CLASS */ YYSYMBOL_CLOSE = 75, /* CLOSE */ YYSYMBOL_CLUSTER = 76, /* CLUSTER */ YYSYMBOL_COALESCE = 77, /* COALESCE */ YYSYMBOL_COLLATE = 78, /* COLLATE */ YYSYMBOL_COLLATION = 79, /* COLLATION */ YYSYMBOL_COLUMN = 80, /* COLUMN */ YYSYMBOL_COLUMNS = 81, /* COLUMNS */ YYSYMBOL_COMMENT = 82, /* COMMENT */ YYSYMBOL_COMMENTS = 83, /* COMMENTS */ YYSYMBOL_COMMIT = 84, /* COMMIT */ YYSYMBOL_COMMITTED = 85, /* COMMITTED */ YYSYMBOL_COMPRESSION = 86, /* COMPRESSION */ YYSYMBOL_CONCURRENTLY = 87, /* CONCURRENTLY */ YYSYMBOL_CONDITIONAL = 88, /* CONDITIONAL */ YYSYMBOL_CONFIGURATION = 89, /* CONFIGURATION */ YYSYMBOL_CONFLICT = 90, /* CONFLICT */ YYSYMBOL_CONNECTION = 91, /* CONNECTION */ YYSYMBOL_CONSTRAINT = 92, /* CONSTRAINT */ YYSYMBOL_CONSTRAINTS = 93, /* CONSTRAINTS */ YYSYMBOL_CONTENT_P = 94, /* CONTENT_P */ YYSYMBOL_CONTINUE_P = 95, /* CONTINUE_P */ YYSYMBOL_CONVERSION_P = 96, /* CONVERSION_P */ YYSYMBOL_COPY = 97, /* COPY */ YYSYMBOL_COST = 98, /* COST */ YYSYMBOL_CREATE = 99, /* CREATE */ YYSYMBOL_CROSS = 100, /* CROSS */ YYSYMBOL_CSV = 101, /* CSV */ YYSYMBOL_CUBE = 102, /* CUBE */ YYSYMBOL_CURRENT_P = 103, /* CURRENT_P */ YYSYMBOL_CURRENT_CATALOG = 104, /* CURRENT_CATALOG */ YYSYMBOL_CURRENT_DATE = 105, /* CURRENT_DATE */ YYSYMBOL_CURRENT_ROLE = 106, /* CURRENT_ROLE */ YYSYMBOL_CURRENT_SCHEMA = 107, /* CURRENT_SCHEMA */ YYSYMBOL_CURRENT_TIME = 108, /* CURRENT_TIME */ YYSYMBOL_CURRENT_TIMESTAMP = 109, /* CURRENT_TIMESTAMP */ YYSYMBOL_CURRENT_USER = 110, /* CURRENT_USER */ YYSYMBOL_CURSOR = 111, /* CURSOR */ YYSYMBOL_CYCLE = 112, /* CYCLE */ YYSYMBOL_DATA_P = 113, /* DATA_P */ YYSYMBOL_DATABASE = 114, /* DATABASE */ YYSYMBOL_DAY_P = 115, /* DAY_P */ YYSYMBOL_DEALLOCATE = 116, /* DEALLOCATE */ YYSYMBOL_DEC = 117, /* DEC */ YYSYMBOL_DECIMAL_P = 118, /* DECIMAL_P */ YYSYMBOL_DECLARE = 119, /* DECLARE */ YYSYMBOL_DEFAULT = 120, /* DEFAULT */ YYSYMBOL_DEFAULTS = 121, /* DEFAULTS */ YYSYMBOL_DEFERRABLE = 122, /* DEFERRABLE */ YYSYMBOL_DEFERRED = 123, /* DEFERRED */ YYSYMBOL_DEFINER = 124, /* DEFINER */ YYSYMBOL_DELETE_P = 125, /* DELETE_P */ YYSYMBOL_DELIMITER = 126, /* DELIMITER */ YYSYMBOL_DELIMITERS = 127, /* DELIMITERS */ YYSYMBOL_DEPENDS = 128, /* DEPENDS */ YYSYMBOL_DEPTH = 129, /* DEPTH */ YYSYMBOL_DESC = 130, /* DESC */ YYSYMBOL_DETACH = 131, /* DETACH */ YYSYMBOL_DICTIONARY = 132, /* DICTIONARY */ YYSYMBOL_DISABLE_P = 133, /* DISABLE_P */ YYSYMBOL_DISCARD = 134, /* DISCARD */ YYSYMBOL_DISTINCT = 135, /* DISTINCT */ YYSYMBOL_DO = 136, /* DO */ YYSYMBOL_DOCUMENT_P = 137, /* DOCUMENT_P */ YYSYMBOL_DOMAIN_P = 138, /* DOMAIN_P */ YYSYMBOL_DOUBLE_P = 139, /* DOUBLE_P */ YYSYMBOL_DROP = 140, /* DROP */ YYSYMBOL_EACH = 141, /* EACH */ YYSYMBOL_ELSE = 142, /* ELSE */ YYSYMBOL_EMPTY_P = 143, /* EMPTY_P */ YYSYMBOL_ENABLE_P = 144, /* ENABLE_P */ YYSYMBOL_ENCODING = 145, /* ENCODING */ YYSYMBOL_ENCRYPTED = 146, /* ENCRYPTED */ YYSYMBOL_END_P = 147, /* END_P */ YYSYMBOL_ENFORCED = 148, /* ENFORCED */ YYSYMBOL_ENUM_P = 149, /* ENUM_P */ YYSYMBOL_ERROR_P = 150, /* ERROR_P */ YYSYMBOL_ESCAPE = 151, /* ESCAPE */ YYSYMBOL_EVENT = 152, /* EVENT */ YYSYMBOL_EXCEPT = 153, /* EXCEPT */ YYSYMBOL_EXCLUDE = 154, /* EXCLUDE */ YYSYMBOL_EXCLUDING = 155, /* EXCLUDING */ YYSYMBOL_EXCLUSIVE = 156, /* EXCLUSIVE */ YYSYMBOL_EXECUTE = 157, /* EXECUTE */ YYSYMBOL_EXISTS = 158, /* EXISTS */ YYSYMBOL_EXPLAIN = 159, /* EXPLAIN */ YYSYMBOL_EXPRESSION = 160, /* EXPRESSION */ YYSYMBOL_EXTENSION = 161, /* EXTENSION */ YYSYMBOL_EXTERNAL = 162, /* EXTERNAL */ YYSYMBOL_EXTRACT = 163, /* EXTRACT */ YYSYMBOL_FALSE_P = 164, /* FALSE_P */ YYSYMBOL_FAMILY = 165, /* FAMILY */ YYSYMBOL_FETCH = 166, /* FETCH */ YYSYMBOL_FILTER = 167, /* FILTER */ YYSYMBOL_FINALIZE = 168, /* FINALIZE */ YYSYMBOL_FIRST_P = 169, /* FIRST_P */ YYSYMBOL_FLOAT_P = 170, /* FLOAT_P */ YYSYMBOL_FOLLOWING = 171, /* FOLLOWING */ YYSYMBOL_FOR = 172, /* FOR */ YYSYMBOL_FORCE = 173, /* FORCE */ YYSYMBOL_FOREIGN = 174, /* FOREIGN */ YYSYMBOL_FORMAT = 175, /* FORMAT */ YYSYMBOL_FORWARD = 176, /* FORWARD */ YYSYMBOL_FREEZE = 177, /* FREEZE */ YYSYMBOL_FROM = 178, /* FROM */ YYSYMBOL_FULL = 179, /* FULL */ YYSYMBOL_FUNCTION = 180, /* FUNCTION */ YYSYMBOL_FUNCTIONS = 181, /* FUNCTIONS */ YYSYMBOL_GENERATED = 182, /* GENERATED */ YYSYMBOL_GLOBAL = 183, /* GLOBAL */ YYSYMBOL_GRANT = 184, /* GRANT */ YYSYMBOL_GRANTED = 185, /* GRANTED */ YYSYMBOL_GREATEST = 186, /* GREATEST */ YYSYMBOL_GROUP_P = 187, /* GROUP_P */ YYSYMBOL_GROUPING = 188, /* GROUPING */ YYSYMBOL_GROUPS = 189, /* GROUPS */ YYSYMBOL_HANDLER = 190, /* HANDLER */ YYSYMBOL_HAVING = 191, /* HAVING */ YYSYMBOL_HEADER_P = 192, /* HEADER_P */ YYSYMBOL_HOLD = 193, /* HOLD */ YYSYMBOL_HOUR_P = 194, /* HOUR_P */ YYSYMBOL_IDENTITY_P = 195, /* IDENTITY_P */ YYSYMBOL_IF_P = 196, /* IF_P */ YYSYMBOL_ILIKE = 197, /* ILIKE */ YYSYMBOL_IMMEDIATE = 198, /* IMMEDIATE */ YYSYMBOL_IMMUTABLE = 199, /* IMMUTABLE */ YYSYMBOL_IMPLICIT_P = 200, /* IMPLICIT_P */ YYSYMBOL_IMPORT_P = 201, /* IMPORT_P */ YYSYMBOL_IN_P = 202, /* IN_P */ YYSYMBOL_INCLUDE = 203, /* INCLUDE */ YYSYMBOL_INCLUDING = 204, /* INCLUDING */ YYSYMBOL_INCREMENT = 205, /* INCREMENT */ YYSYMBOL_INDENT = 206, /* INDENT */ YYSYMBOL_INDEX = 207, /* INDEX */ YYSYMBOL_INDEXES = 208, /* INDEXES */ YYSYMBOL_INHERIT = 209, /* INHERIT */ YYSYMBOL_INHERITS = 210, /* INHERITS */ YYSYMBOL_INITIALLY = 211, /* INITIALLY */ YYSYMBOL_INLINE_P = 212, /* INLINE_P */ YYSYMBOL_INNER_P = 213, /* INNER_P */ YYSYMBOL_INOUT = 214, /* INOUT */ YYSYMBOL_INPUT_P = 215, /* INPUT_P */ YYSYMBOL_INSENSITIVE = 216, /* INSENSITIVE */ YYSYMBOL_INSERT = 217, /* INSERT */ YYSYMBOL_INSTEAD = 218, /* INSTEAD */ YYSYMBOL_INT_P = 219, /* INT_P */ YYSYMBOL_INTEGER = 220, /* INTEGER */ YYSYMBOL_INTERSECT = 221, /* INTERSECT */ YYSYMBOL_INTERVAL = 222, /* INTERVAL */ YYSYMBOL_INTO = 223, /* INTO */ YYSYMBOL_INVOKER = 224, /* INVOKER */ YYSYMBOL_IS = 225, /* IS */ YYSYMBOL_ISNULL = 226, /* ISNULL */ YYSYMBOL_ISOLATION = 227, /* ISOLATION */ YYSYMBOL_JOIN = 228, /* JOIN */ YYSYMBOL_JSON = 229, /* JSON */ YYSYMBOL_JSON_ARRAY = 230, /* JSON_ARRAY */ YYSYMBOL_JSON_ARRAYAGG = 231, /* JSON_ARRAYAGG */ YYSYMBOL_JSON_EXISTS = 232, /* JSON_EXISTS */ YYSYMBOL_JSON_OBJECT = 233, /* JSON_OBJECT */ YYSYMBOL_JSON_OBJECTAGG = 234, /* JSON_OBJECTAGG */ YYSYMBOL_JSON_QUERY = 235, /* JSON_QUERY */ YYSYMBOL_JSON_SCALAR = 236, /* JSON_SCALAR */ YYSYMBOL_JSON_SERIALIZE = 237, /* JSON_SERIALIZE */ YYSYMBOL_JSON_TABLE = 238, /* JSON_TABLE */ YYSYMBOL_JSON_VALUE = 239, /* JSON_VALUE */ YYSYMBOL_KEEP = 240, /* KEEP */ YYSYMBOL_KEY = 241, /* KEY */ YYSYMBOL_KEYS = 242, /* KEYS */ YYSYMBOL_LABEL = 243, /* LABEL */ YYSYMBOL_LANGUAGE = 244, /* LANGUAGE */ YYSYMBOL_LARGE_P = 245, /* LARGE_P */ YYSYMBOL_LAST_P = 246, /* LAST_P */ YYSYMBOL_LATERAL_P = 247, /* LATERAL_P */ YYSYMBOL_LEADING = 248, /* LEADING */ YYSYMBOL_LEAKPROOF = 249, /* LEAKPROOF */ YYSYMBOL_LEAST = 250, /* LEAST */ YYSYMBOL_LEFT = 251, /* LEFT */ YYSYMBOL_LEVEL = 252, /* LEVEL */ YYSYMBOL_LIKE = 253, /* LIKE */ YYSYMBOL_LIMIT = 254, /* LIMIT */ YYSYMBOL_LISTEN = 255, /* LISTEN */ YYSYMBOL_LOAD = 256, /* LOAD */ YYSYMBOL_LOCAL = 257, /* LOCAL */ YYSYMBOL_LOCALTIME = 258, /* LOCALTIME */ YYSYMBOL_LOCALTIMESTAMP = 259, /* LOCALTIMESTAMP */ YYSYMBOL_LOCATION = 260, /* LOCATION */ YYSYMBOL_LOCK_P = 261, /* LOCK_P */ YYSYMBOL_LOCKED = 262, /* LOCKED */ YYSYMBOL_LOGGED = 263, /* LOGGED */ YYSYMBOL_MAPPING = 264, /* MAPPING */ YYSYMBOL_MATCH = 265, /* MATCH */ YYSYMBOL_MATCHED = 266, /* MATCHED */ YYSYMBOL_MATERIALIZED = 267, /* MATERIALIZED */ YYSYMBOL_MAXVALUE = 268, /* MAXVALUE */ YYSYMBOL_MERGE = 269, /* MERGE */ YYSYMBOL_MERGE_ACTION = 270, /* MERGE_ACTION */ YYSYMBOL_METHOD = 271, /* METHOD */ YYSYMBOL_MINUTE_P = 272, /* MINUTE_P */ YYSYMBOL_MINVALUE = 273, /* MINVALUE */ YYSYMBOL_MODE = 274, /* MODE */ YYSYMBOL_MONTH_P = 275, /* MONTH_P */ YYSYMBOL_MOVE = 276, /* MOVE */ YYSYMBOL_NAME_P = 277, /* NAME_P */ YYSYMBOL_NAMES = 278, /* NAMES */ YYSYMBOL_NATIONAL = 279, /* NATIONAL */ YYSYMBOL_NATURAL = 280, /* NATURAL */ YYSYMBOL_NCHAR = 281, /* NCHAR */ YYSYMBOL_NESTED = 282, /* NESTED */ YYSYMBOL_NEW = 283, /* NEW */ YYSYMBOL_NEXT = 284, /* NEXT */ YYSYMBOL_NFC = 285, /* NFC */ YYSYMBOL_NFD = 286, /* NFD */ YYSYMBOL_NFKC = 287, /* NFKC */ YYSYMBOL_NFKD = 288, /* NFKD */ YYSYMBOL_NO = 289, /* NO */ YYSYMBOL_NONE = 290, /* NONE */ YYSYMBOL_NORMALIZE = 291, /* NORMALIZE */ YYSYMBOL_NORMALIZED = 292, /* NORMALIZED */ YYSYMBOL_NOT = 293, /* NOT */ YYSYMBOL_NOTHING = 294, /* NOTHING */ YYSYMBOL_NOTIFY = 295, /* NOTIFY */ YYSYMBOL_NOTNULL = 296, /* NOTNULL */ YYSYMBOL_NOWAIT = 297, /* NOWAIT */ YYSYMBOL_NULL_P = 298, /* NULL_P */ YYSYMBOL_NULLIF = 299, /* NULLIF */ YYSYMBOL_NULLS_P = 300, /* NULLS_P */ YYSYMBOL_NUMERIC = 301, /* NUMERIC */ YYSYMBOL_OBJECT_P = 302, /* OBJECT_P */ YYSYMBOL_OBJECTS_P = 303, /* OBJECTS_P */ YYSYMBOL_OF = 304, /* OF */ YYSYMBOL_OFF = 305, /* OFF */ YYSYMBOL_OFFSET = 306, /* OFFSET */ YYSYMBOL_OIDS = 307, /* OIDS */ YYSYMBOL_OLD = 308, /* OLD */ YYSYMBOL_OMIT = 309, /* OMIT */ YYSYMBOL_ON = 310, /* ON */ YYSYMBOL_ONLY = 311, /* ONLY */ YYSYMBOL_OPERATOR = 312, /* OPERATOR */ YYSYMBOL_OPTION = 313, /* OPTION */ YYSYMBOL_OPTIONS = 314, /* OPTIONS */ YYSYMBOL_OR = 315, /* OR */ YYSYMBOL_ORDER = 316, /* ORDER */ YYSYMBOL_ORDINALITY = 317, /* ORDINALITY */ YYSYMBOL_OTHERS = 318, /* OTHERS */ YYSYMBOL_OUT_P = 319, /* OUT_P */ YYSYMBOL_OUTER_P = 320, /* OUTER_P */ YYSYMBOL_OVER = 321, /* OVER */ YYSYMBOL_OVERLAPS = 322, /* OVERLAPS */ YYSYMBOL_OVERLAY = 323, /* OVERLAY */ YYSYMBOL_OVERRIDING = 324, /* OVERRIDING */ YYSYMBOL_OWNED = 325, /* OWNED */ YYSYMBOL_OWNER = 326, /* OWNER */ YYSYMBOL_PARALLEL = 327, /* PARALLEL */ YYSYMBOL_PARAMETER = 328, /* PARAMETER */ YYSYMBOL_PARSER = 329, /* PARSER */ YYSYMBOL_PARTIAL = 330, /* PARTIAL */ YYSYMBOL_PARTITION = 331, /* PARTITION */ YYSYMBOL_PASSING = 332, /* PASSING */ YYSYMBOL_PASSWORD = 333, /* PASSWORD */ YYSYMBOL_PATH = 334, /* PATH */ YYSYMBOL_PGPOOL = 335, /* PGPOOL */ YYSYMBOL_PERIOD = 336, /* PERIOD */ YYSYMBOL_PLACING = 337, /* PLACING */ YYSYMBOL_PLAN = 338, /* PLAN */ YYSYMBOL_PLANS = 339, /* PLANS */ YYSYMBOL_POLICY = 340, /* POLICY */ YYSYMBOL_POSITION = 341, /* POSITION */ YYSYMBOL_PRECEDING = 342, /* PRECEDING */ YYSYMBOL_PRECISION = 343, /* PRECISION */ YYSYMBOL_PRESERVE = 344, /* PRESERVE */ YYSYMBOL_PREPARE = 345, /* PREPARE */ YYSYMBOL_PREPARED = 346, /* PREPARED */ YYSYMBOL_PRIMARY = 347, /* PRIMARY */ YYSYMBOL_PRIOR = 348, /* PRIOR */ YYSYMBOL_PRIVILEGES = 349, /* PRIVILEGES */ YYSYMBOL_PROCEDURAL = 350, /* PROCEDURAL */ YYSYMBOL_PROCEDURE = 351, /* PROCEDURE */ YYSYMBOL_PROCEDURES = 352, /* PROCEDURES */ YYSYMBOL_PROGRAM = 353, /* PROGRAM */ YYSYMBOL_PUBLICATION = 354, /* PUBLICATION */ YYSYMBOL_QUOTE = 355, /* QUOTE */ YYSYMBOL_QUOTES = 356, /* QUOTES */ YYSYMBOL_RANGE = 357, /* RANGE */ YYSYMBOL_READ = 358, /* READ */ YYSYMBOL_REAL = 359, /* REAL */ YYSYMBOL_REASSIGN = 360, /* REASSIGN */ YYSYMBOL_RECURSIVE = 361, /* RECURSIVE */ YYSYMBOL_REF_P = 362, /* REF_P */ YYSYMBOL_REFERENCES = 363, /* REFERENCES */ YYSYMBOL_REFERENCING = 364, /* REFERENCING */ YYSYMBOL_REFRESH = 365, /* REFRESH */ YYSYMBOL_REINDEX = 366, /* REINDEX */ YYSYMBOL_RELATIVE_P = 367, /* RELATIVE_P */ YYSYMBOL_RELEASE = 368, /* RELEASE */ YYSYMBOL_RENAME = 369, /* RENAME */ YYSYMBOL_REPEATABLE = 370, /* REPEATABLE */ YYSYMBOL_REPLACE = 371, /* REPLACE */ YYSYMBOL_REPLICA = 372, /* REPLICA */ YYSYMBOL_RESET = 373, /* RESET */ YYSYMBOL_RESTART = 374, /* RESTART */ YYSYMBOL_RESTRICT = 375, /* RESTRICT */ YYSYMBOL_RETURN = 376, /* RETURN */ YYSYMBOL_RETURNING = 377, /* RETURNING */ YYSYMBOL_RETURNS = 378, /* RETURNS */ YYSYMBOL_REVOKE = 379, /* REVOKE */ YYSYMBOL_RIGHT = 380, /* RIGHT */ YYSYMBOL_ROLE = 381, /* ROLE */ YYSYMBOL_ROLLBACK = 382, /* ROLLBACK */ YYSYMBOL_ROLLUP = 383, /* ROLLUP */ YYSYMBOL_ROUTINE = 384, /* ROUTINE */ YYSYMBOL_ROUTINES = 385, /* ROUTINES */ YYSYMBOL_ROW = 386, /* ROW */ YYSYMBOL_ROWS = 387, /* ROWS */ YYSYMBOL_RULE = 388, /* RULE */ YYSYMBOL_SAVEPOINT = 389, /* SAVEPOINT */ YYSYMBOL_SCALAR = 390, /* SCALAR */ YYSYMBOL_SCHEMA = 391, /* SCHEMA */ YYSYMBOL_SCHEMAS = 392, /* SCHEMAS */ YYSYMBOL_SCROLL = 393, /* SCROLL */ YYSYMBOL_SEARCH = 394, /* SEARCH */ YYSYMBOL_SECOND_P = 395, /* SECOND_P */ YYSYMBOL_SECURITY = 396, /* SECURITY */ YYSYMBOL_SELECT = 397, /* SELECT */ YYSYMBOL_SEQUENCE = 398, /* SEQUENCE */ YYSYMBOL_SEQUENCES = 399, /* SEQUENCES */ YYSYMBOL_SERIALIZABLE = 400, /* SERIALIZABLE */ YYSYMBOL_SERVER = 401, /* SERVER */ YYSYMBOL_SESSION = 402, /* SESSION */ YYSYMBOL_SESSION_USER = 403, /* SESSION_USER */ YYSYMBOL_SET = 404, /* SET */ YYSYMBOL_SETS = 405, /* SETS */ YYSYMBOL_SETOF = 406, /* SETOF */ YYSYMBOL_SHARE = 407, /* SHARE */ YYSYMBOL_SHOW = 408, /* SHOW */ YYSYMBOL_SIMILAR = 409, /* SIMILAR */ YYSYMBOL_SIMPLE = 410, /* SIMPLE */ YYSYMBOL_SKIP = 411, /* SKIP */ YYSYMBOL_SMALLINT = 412, /* SMALLINT */ YYSYMBOL_SNAPSHOT = 413, /* SNAPSHOT */ YYSYMBOL_SOME = 414, /* SOME */ YYSYMBOL_SOURCE = 415, /* SOURCE */ YYSYMBOL_SQL_P = 416, /* SQL_P */ YYSYMBOL_STABLE = 417, /* STABLE */ YYSYMBOL_STANDALONE_P = 418, /* STANDALONE_P */ YYSYMBOL_START = 419, /* START */ YYSYMBOL_STATEMENT = 420, /* STATEMENT */ YYSYMBOL_STATISTICS = 421, /* STATISTICS */ YYSYMBOL_STDIN = 422, /* STDIN */ YYSYMBOL_STDOUT = 423, /* STDOUT */ YYSYMBOL_STORAGE = 424, /* STORAGE */ YYSYMBOL_STORED = 425, /* STORED */ YYSYMBOL_STRICT_P = 426, /* STRICT_P */ YYSYMBOL_STRING_P = 427, /* STRING_P */ YYSYMBOL_STRIP_P = 428, /* STRIP_P */ YYSYMBOL_SUBSCRIPTION = 429, /* SUBSCRIPTION */ YYSYMBOL_SUBSTRING = 430, /* SUBSTRING */ YYSYMBOL_SUPPORT = 431, /* SUPPORT */ YYSYMBOL_SYMMETRIC = 432, /* SYMMETRIC */ YYSYMBOL_SYSID = 433, /* SYSID */ YYSYMBOL_SYSTEM_P = 434, /* SYSTEM_P */ YYSYMBOL_SYSTEM_USER = 435, /* SYSTEM_USER */ YYSYMBOL_TABLE = 436, /* TABLE */ YYSYMBOL_TABLES = 437, /* TABLES */ YYSYMBOL_TABLESAMPLE = 438, /* TABLESAMPLE */ YYSYMBOL_TABLESPACE = 439, /* TABLESPACE */ YYSYMBOL_TARGET = 440, /* TARGET */ YYSYMBOL_TEMP = 441, /* TEMP */ YYSYMBOL_TEMPLATE = 442, /* TEMPLATE */ YYSYMBOL_TEMPORARY = 443, /* TEMPORARY */ YYSYMBOL_TEXT_P = 444, /* TEXT_P */ YYSYMBOL_THEN = 445, /* THEN */ YYSYMBOL_TIES = 446, /* TIES */ YYSYMBOL_TIME = 447, /* TIME */ YYSYMBOL_TIMESTAMP = 448, /* TIMESTAMP */ YYSYMBOL_TO = 449, /* TO */ YYSYMBOL_TRAILING = 450, /* TRAILING */ YYSYMBOL_TRANSACTION = 451, /* TRANSACTION */ YYSYMBOL_TRANSFORM = 452, /* TRANSFORM */ YYSYMBOL_TREAT = 453, /* TREAT */ YYSYMBOL_TRIGGER = 454, /* TRIGGER */ YYSYMBOL_TRIM = 455, /* TRIM */ YYSYMBOL_TRUE_P = 456, /* TRUE_P */ YYSYMBOL_TRUNCATE = 457, /* TRUNCATE */ YYSYMBOL_TRUSTED = 458, /* TRUSTED */ YYSYMBOL_TYPE_P = 459, /* TYPE_P */ YYSYMBOL_TYPES_P = 460, /* TYPES_P */ YYSYMBOL_UESCAPE = 461, /* UESCAPE */ YYSYMBOL_UNBOUNDED = 462, /* UNBOUNDED */ YYSYMBOL_UNCONDITIONAL = 463, /* UNCONDITIONAL */ YYSYMBOL_UNCOMMITTED = 464, /* UNCOMMITTED */ YYSYMBOL_UNENCRYPTED = 465, /* UNENCRYPTED */ YYSYMBOL_UNION = 466, /* UNION */ YYSYMBOL_UNIQUE = 467, /* UNIQUE */ YYSYMBOL_UNKNOWN = 468, /* UNKNOWN */ YYSYMBOL_UNLISTEN = 469, /* UNLISTEN */ YYSYMBOL_UNLOGGED = 470, /* UNLOGGED */ YYSYMBOL_UNTIL = 471, /* UNTIL */ YYSYMBOL_UPDATE = 472, /* UPDATE */ YYSYMBOL_USER = 473, /* USER */ YYSYMBOL_USING = 474, /* USING */ YYSYMBOL_VACUUM = 475, /* VACUUM */ YYSYMBOL_VALID = 476, /* VALID */ YYSYMBOL_VALIDATE = 477, /* VALIDATE */ YYSYMBOL_VALIDATOR = 478, /* VALIDATOR */ YYSYMBOL_VALUE_P = 479, /* VALUE_P */ YYSYMBOL_VALUES = 480, /* VALUES */ YYSYMBOL_VARCHAR = 481, /* VARCHAR */ YYSYMBOL_VARIADIC = 482, /* VARIADIC */ YYSYMBOL_VARYING = 483, /* VARYING */ YYSYMBOL_VERBOSE = 484, /* VERBOSE */ YYSYMBOL_VERSION_P = 485, /* VERSION_P */ YYSYMBOL_VIEW = 486, /* VIEW */ YYSYMBOL_VIEWS = 487, /* VIEWS */ YYSYMBOL_VIRTUAL = 488, /* VIRTUAL */ YYSYMBOL_VOLATILE = 489, /* VOLATILE */ YYSYMBOL_WHEN = 490, /* WHEN */ YYSYMBOL_WHERE = 491, /* WHERE */ YYSYMBOL_WHITESPACE_P = 492, /* WHITESPACE_P */ YYSYMBOL_WINDOW = 493, /* WINDOW */ YYSYMBOL_WITH = 494, /* WITH */ YYSYMBOL_WITHIN = 495, /* WITHIN */ YYSYMBOL_WITHOUT = 496, /* WITHOUT */ YYSYMBOL_WORK = 497, /* WORK */ YYSYMBOL_WRAPPER = 498, /* WRAPPER */ YYSYMBOL_WRITE = 499, /* WRITE */ YYSYMBOL_XML_P = 500, /* XML_P */ YYSYMBOL_XMLATTRIBUTES = 501, /* XMLATTRIBUTES */ YYSYMBOL_XMLCONCAT = 502, /* XMLCONCAT */ YYSYMBOL_XMLELEMENT = 503, /* XMLELEMENT */ YYSYMBOL_XMLEXISTS = 504, /* XMLEXISTS */ YYSYMBOL_XMLFOREST = 505, /* XMLFOREST */ YYSYMBOL_XMLNAMESPACES = 506, /* XMLNAMESPACES */ YYSYMBOL_XMLPARSE = 507, /* XMLPARSE */ YYSYMBOL_XMLPI = 508, /* XMLPI */ YYSYMBOL_XMLROOT = 509, /* XMLROOT */ YYSYMBOL_XMLSERIALIZE = 510, /* XMLSERIALIZE */ YYSYMBOL_XMLTABLE = 511, /* XMLTABLE */ YYSYMBOL_YEAR_P = 512, /* YEAR_P */ YYSYMBOL_YES_P = 513, /* YES_P */ YYSYMBOL_ZONE = 514, /* ZONE */ YYSYMBOL_FORMAT_LA = 515, /* FORMAT_LA */ YYSYMBOL_NOT_LA = 516, /* NOT_LA */ YYSYMBOL_NULLS_LA = 517, /* NULLS_LA */ YYSYMBOL_WITH_LA = 518, /* WITH_LA */ YYSYMBOL_WITHOUT_LA = 519, /* WITHOUT_LA */ YYSYMBOL_MODE_TYPE_NAME = 520, /* MODE_TYPE_NAME */ YYSYMBOL_MODE_PLPGSQL_EXPR = 521, /* MODE_PLPGSQL_EXPR */ YYSYMBOL_MODE_PLPGSQL_ASSIGN1 = 522, /* MODE_PLPGSQL_ASSIGN1 */ YYSYMBOL_MODE_PLPGSQL_ASSIGN2 = 523, /* MODE_PLPGSQL_ASSIGN2 */ YYSYMBOL_MODE_PLPGSQL_ASSIGN3 = 524, /* MODE_PLPGSQL_ASSIGN3 */ YYSYMBOL_525_ = 525, /* '<' */ YYSYMBOL_526_ = 526, /* '>' */ YYSYMBOL_527_ = 527, /* '=' */ YYSYMBOL_528_ = 528, /* '+' */ YYSYMBOL_529_ = 529, /* '-' */ YYSYMBOL_530_ = 530, /* '*' */ YYSYMBOL_531_ = 531, /* '/' */ YYSYMBOL_532_ = 532, /* '%' */ YYSYMBOL_533_ = 533, /* '^' */ YYSYMBOL_UMINUS = 534, /* UMINUS */ YYSYMBOL_535_ = 535, /* '[' */ YYSYMBOL_536_ = 536, /* ']' */ YYSYMBOL_537_ = 537, /* '(' */ YYSYMBOL_538_ = 538, /* ')' */ YYSYMBOL_539_ = 539, /* '.' */ YYSYMBOL_540_ = 540, /* ';' */ YYSYMBOL_541_ = 541, /* ',' */ YYSYMBOL_542_ = 542, /* ':' */ YYSYMBOL_YYACCEPT = 543, /* $accept */ YYSYMBOL_parse_toplevel = 544, /* parse_toplevel */ YYSYMBOL_stmtmulti = 545, /* stmtmulti */ YYSYMBOL_toplevel_stmt = 546, /* toplevel_stmt */ YYSYMBOL_stmt = 547, /* stmt */ YYSYMBOL_opt_single_name = 548, /* opt_single_name */ YYSYMBOL_opt_qualified_name = 549, /* opt_qualified_name */ YYSYMBOL_opt_concurrently = 550, /* opt_concurrently */ YYSYMBOL_opt_drop_behavior = 551, /* opt_drop_behavior */ YYSYMBOL_CallStmt = 552, /* CallStmt */ YYSYMBOL_CreateRoleStmt = 553, /* CreateRoleStmt */ YYSYMBOL_opt_with = 554, /* opt_with */ YYSYMBOL_OptRoleList = 555, /* OptRoleList */ YYSYMBOL_AlterOptRoleList = 556, /* AlterOptRoleList */ YYSYMBOL_AlterOptRoleElem = 557, /* AlterOptRoleElem */ YYSYMBOL_CreateOptRoleElem = 558, /* CreateOptRoleElem */ YYSYMBOL_CreateUserStmt = 559, /* CreateUserStmt */ YYSYMBOL_AlterRoleStmt = 560, /* AlterRoleStmt */ YYSYMBOL_opt_in_database = 561, /* opt_in_database */ YYSYMBOL_AlterRoleSetStmt = 562, /* AlterRoleSetStmt */ YYSYMBOL_DropRoleStmt = 563, /* DropRoleStmt */ YYSYMBOL_CreateGroupStmt = 564, /* CreateGroupStmt */ YYSYMBOL_AlterGroupStmt = 565, /* AlterGroupStmt */ YYSYMBOL_add_drop = 566, /* add_drop */ YYSYMBOL_CreateSchemaStmt = 567, /* CreateSchemaStmt */ YYSYMBOL_OptSchemaEltList = 568, /* OptSchemaEltList */ YYSYMBOL_schema_stmt = 569, /* schema_stmt */ YYSYMBOL_VariableSetStmt = 570, /* VariableSetStmt */ YYSYMBOL_set_rest = 571, /* set_rest */ YYSYMBOL_generic_set = 572, /* generic_set */ YYSYMBOL_set_rest_more = 573, /* set_rest_more */ YYSYMBOL_var_name = 574, /* var_name */ YYSYMBOL_var_list = 575, /* var_list */ YYSYMBOL_var_value = 576, /* var_value */ YYSYMBOL_iso_level = 577, /* iso_level */ YYSYMBOL_opt_boolean_or_string = 578, /* opt_boolean_or_string */ YYSYMBOL_zone_value = 579, /* zone_value */ YYSYMBOL_opt_encoding = 580, /* opt_encoding */ YYSYMBOL_NonReservedWord_or_Sconst = 581, /* NonReservedWord_or_Sconst */ YYSYMBOL_VariableResetStmt = 582, /* VariableResetStmt */ YYSYMBOL_reset_rest = 583, /* reset_rest */ YYSYMBOL_generic_reset = 584, /* generic_reset */ YYSYMBOL_SetResetClause = 585, /* SetResetClause */ YYSYMBOL_FunctionSetResetClause = 586, /* FunctionSetResetClause */ YYSYMBOL_VariableShowStmt = 587, /* VariableShowStmt */ YYSYMBOL_ConstraintsSetStmt = 588, /* ConstraintsSetStmt */ YYSYMBOL_constraints_set_list = 589, /* constraints_set_list */ YYSYMBOL_constraints_set_mode = 590, /* constraints_set_mode */ YYSYMBOL_CheckPointStmt = 591, /* CheckPointStmt */ YYSYMBOL_DiscardStmt = 592, /* DiscardStmt */ YYSYMBOL_AlterTableStmt = 593, /* AlterTableStmt */ YYSYMBOL_alter_table_cmds = 594, /* alter_table_cmds */ YYSYMBOL_partition_cmd = 595, /* partition_cmd */ YYSYMBOL_index_partition_cmd = 596, /* index_partition_cmd */ YYSYMBOL_alter_table_cmd = 597, /* alter_table_cmd */ YYSYMBOL_alter_column_default = 598, /* alter_column_default */ YYSYMBOL_opt_collate_clause = 599, /* opt_collate_clause */ YYSYMBOL_alter_using = 600, /* alter_using */ YYSYMBOL_replica_identity = 601, /* replica_identity */ YYSYMBOL_reloptions = 602, /* reloptions */ YYSYMBOL_opt_reloptions = 603, /* opt_reloptions */ YYSYMBOL_reloption_list = 604, /* reloption_list */ YYSYMBOL_reloption_elem = 605, /* reloption_elem */ YYSYMBOL_alter_identity_column_option_list = 606, /* alter_identity_column_option_list */ YYSYMBOL_alter_identity_column_option = 607, /* alter_identity_column_option */ YYSYMBOL_set_statistics_value = 608, /* set_statistics_value */ YYSYMBOL_set_access_method_name = 609, /* set_access_method_name */ YYSYMBOL_PartitionBoundSpec = 610, /* PartitionBoundSpec */ YYSYMBOL_hash_partbound_elem = 611, /* hash_partbound_elem */ YYSYMBOL_hash_partbound = 612, /* hash_partbound */ YYSYMBOL_AlterCompositeTypeStmt = 613, /* AlterCompositeTypeStmt */ YYSYMBOL_alter_type_cmds = 614, /* alter_type_cmds */ YYSYMBOL_alter_type_cmd = 615, /* alter_type_cmd */ YYSYMBOL_ClosePortalStmt = 616, /* ClosePortalStmt */ YYSYMBOL_CopyStmt = 617, /* CopyStmt */ YYSYMBOL_copy_from = 618, /* copy_from */ YYSYMBOL_opt_program = 619, /* opt_program */ YYSYMBOL_copy_file_name = 620, /* copy_file_name */ YYSYMBOL_copy_options = 621, /* copy_options */ YYSYMBOL_copy_opt_list = 622, /* copy_opt_list */ YYSYMBOL_copy_opt_item = 623, /* copy_opt_item */ YYSYMBOL_opt_binary = 624, /* opt_binary */ YYSYMBOL_copy_delimiter = 625, /* copy_delimiter */ YYSYMBOL_opt_using = 626, /* opt_using */ YYSYMBOL_copy_generic_opt_list = 627, /* copy_generic_opt_list */ YYSYMBOL_copy_generic_opt_elem = 628, /* copy_generic_opt_elem */ YYSYMBOL_copy_generic_opt_arg = 629, /* copy_generic_opt_arg */ YYSYMBOL_copy_generic_opt_arg_list = 630, /* copy_generic_opt_arg_list */ YYSYMBOL_copy_generic_opt_arg_list_item = 631, /* copy_generic_opt_arg_list_item */ YYSYMBOL_CreateStmt = 632, /* CreateStmt */ YYSYMBOL_OptTemp = 633, /* OptTemp */ YYSYMBOL_OptTableElementList = 634, /* OptTableElementList */ YYSYMBOL_OptTypedTableElementList = 635, /* OptTypedTableElementList */ YYSYMBOL_TableElementList = 636, /* TableElementList */ YYSYMBOL_TypedTableElementList = 637, /* TypedTableElementList */ YYSYMBOL_TableElement = 638, /* TableElement */ YYSYMBOL_TypedTableElement = 639, /* TypedTableElement */ YYSYMBOL_columnDef = 640, /* columnDef */ YYSYMBOL_columnOptions = 641, /* columnOptions */ YYSYMBOL_column_compression = 642, /* column_compression */ YYSYMBOL_opt_column_compression = 643, /* opt_column_compression */ YYSYMBOL_column_storage = 644, /* column_storage */ YYSYMBOL_opt_column_storage = 645, /* opt_column_storage */ YYSYMBOL_ColQualList = 646, /* ColQualList */ YYSYMBOL_ColConstraint = 647, /* ColConstraint */ YYSYMBOL_ColConstraintElem = 648, /* ColConstraintElem */ YYSYMBOL_opt_unique_null_treatment = 649, /* opt_unique_null_treatment */ YYSYMBOL_generated_when = 650, /* generated_when */ YYSYMBOL_opt_virtual_or_stored = 651, /* opt_virtual_or_stored */ YYSYMBOL_ConstraintAttr = 652, /* ConstraintAttr */ YYSYMBOL_TableLikeClause = 653, /* TableLikeClause */ YYSYMBOL_TableLikeOptionList = 654, /* TableLikeOptionList */ YYSYMBOL_TableLikeOption = 655, /* TableLikeOption */ YYSYMBOL_TableConstraint = 656, /* TableConstraint */ YYSYMBOL_ConstraintElem = 657, /* ConstraintElem */ YYSYMBOL_DomainConstraint = 658, /* DomainConstraint */ YYSYMBOL_DomainConstraintElem = 659, /* DomainConstraintElem */ YYSYMBOL_opt_no_inherit = 660, /* opt_no_inherit */ YYSYMBOL_opt_without_overlaps = 661, /* opt_without_overlaps */ YYSYMBOL_opt_column_list = 662, /* opt_column_list */ YYSYMBOL_columnList = 663, /* columnList */ YYSYMBOL_optionalPeriodName = 664, /* optionalPeriodName */ YYSYMBOL_opt_column_and_period_list = 665, /* opt_column_and_period_list */ YYSYMBOL_columnElem = 666, /* columnElem */ YYSYMBOL_opt_c_include = 667, /* opt_c_include */ YYSYMBOL_key_match = 668, /* key_match */ YYSYMBOL_ExclusionConstraintList = 669, /* ExclusionConstraintList */ YYSYMBOL_ExclusionConstraintElem = 670, /* ExclusionConstraintElem */ YYSYMBOL_OptWhereClause = 671, /* OptWhereClause */ YYSYMBOL_key_actions = 672, /* key_actions */ YYSYMBOL_key_update = 673, /* key_update */ YYSYMBOL_key_delete = 674, /* key_delete */ YYSYMBOL_key_action = 675, /* key_action */ YYSYMBOL_OptInherit = 676, /* OptInherit */ YYSYMBOL_OptPartitionSpec = 677, /* OptPartitionSpec */ YYSYMBOL_PartitionSpec = 678, /* PartitionSpec */ YYSYMBOL_part_params = 679, /* part_params */ YYSYMBOL_part_elem = 680, /* part_elem */ YYSYMBOL_table_access_method_clause = 681, /* table_access_method_clause */ YYSYMBOL_OptWith = 682, /* OptWith */ YYSYMBOL_OnCommitOption = 683, /* OnCommitOption */ YYSYMBOL_OptTableSpace = 684, /* OptTableSpace */ YYSYMBOL_OptConsTableSpace = 685, /* OptConsTableSpace */ YYSYMBOL_ExistingIndex = 686, /* ExistingIndex */ YYSYMBOL_CreateStatsStmt = 687, /* CreateStatsStmt */ YYSYMBOL_stats_params = 688, /* stats_params */ YYSYMBOL_stats_param = 689, /* stats_param */ YYSYMBOL_AlterStatsStmt = 690, /* AlterStatsStmt */ YYSYMBOL_CreateAsStmt = 691, /* CreateAsStmt */ YYSYMBOL_create_as_target = 692, /* create_as_target */ YYSYMBOL_opt_with_data = 693, /* opt_with_data */ YYSYMBOL_CreateMatViewStmt = 694, /* CreateMatViewStmt */ YYSYMBOL_create_mv_target = 695, /* create_mv_target */ YYSYMBOL_OptNoLog = 696, /* OptNoLog */ YYSYMBOL_RefreshMatViewStmt = 697, /* RefreshMatViewStmt */ YYSYMBOL_CreateSeqStmt = 698, /* CreateSeqStmt */ YYSYMBOL_AlterSeqStmt = 699, /* AlterSeqStmt */ YYSYMBOL_OptSeqOptList = 700, /* OptSeqOptList */ YYSYMBOL_OptParenthesizedSeqOptList = 701, /* OptParenthesizedSeqOptList */ YYSYMBOL_SeqOptList = 702, /* SeqOptList */ YYSYMBOL_SeqOptElem = 703, /* SeqOptElem */ YYSYMBOL_opt_by = 704, /* opt_by */ YYSYMBOL_NumericOnly = 705, /* NumericOnly */ YYSYMBOL_NumericOnly_list = 706, /* NumericOnly_list */ YYSYMBOL_CreatePLangStmt = 707, /* CreatePLangStmt */ YYSYMBOL_opt_trusted = 708, /* opt_trusted */ YYSYMBOL_handler_name = 709, /* handler_name */ YYSYMBOL_opt_inline_handler = 710, /* opt_inline_handler */ YYSYMBOL_validator_clause = 711, /* validator_clause */ YYSYMBOL_opt_validator = 712, /* opt_validator */ YYSYMBOL_opt_procedural = 713, /* opt_procedural */ YYSYMBOL_CreateTableSpaceStmt = 714, /* CreateTableSpaceStmt */ YYSYMBOL_OptTableSpaceOwner = 715, /* OptTableSpaceOwner */ YYSYMBOL_DropTableSpaceStmt = 716, /* DropTableSpaceStmt */ YYSYMBOL_CreateExtensionStmt = 717, /* CreateExtensionStmt */ YYSYMBOL_create_extension_opt_list = 718, /* create_extension_opt_list */ YYSYMBOL_create_extension_opt_item = 719, /* create_extension_opt_item */ YYSYMBOL_AlterExtensionStmt = 720, /* AlterExtensionStmt */ YYSYMBOL_alter_extension_opt_list = 721, /* alter_extension_opt_list */ YYSYMBOL_alter_extension_opt_item = 722, /* alter_extension_opt_item */ YYSYMBOL_AlterExtensionContentsStmt = 723, /* AlterExtensionContentsStmt */ YYSYMBOL_CreateFdwStmt = 724, /* CreateFdwStmt */ YYSYMBOL_fdw_option = 725, /* fdw_option */ YYSYMBOL_fdw_options = 726, /* fdw_options */ YYSYMBOL_opt_fdw_options = 727, /* opt_fdw_options */ YYSYMBOL_AlterFdwStmt = 728, /* AlterFdwStmt */ YYSYMBOL_create_generic_options = 729, /* create_generic_options */ YYSYMBOL_generic_option_list = 730, /* generic_option_list */ YYSYMBOL_alter_generic_options = 731, /* alter_generic_options */ YYSYMBOL_alter_generic_option_list = 732, /* alter_generic_option_list */ YYSYMBOL_alter_generic_option_elem = 733, /* alter_generic_option_elem */ YYSYMBOL_generic_option_elem = 734, /* generic_option_elem */ YYSYMBOL_generic_option_name = 735, /* generic_option_name */ YYSYMBOL_generic_option_arg = 736, /* generic_option_arg */ YYSYMBOL_CreateForeignServerStmt = 737, /* CreateForeignServerStmt */ YYSYMBOL_opt_type = 738, /* opt_type */ YYSYMBOL_foreign_server_version = 739, /* foreign_server_version */ YYSYMBOL_opt_foreign_server_version = 740, /* opt_foreign_server_version */ YYSYMBOL_AlterForeignServerStmt = 741, /* AlterForeignServerStmt */ YYSYMBOL_CreateForeignTableStmt = 742, /* CreateForeignTableStmt */ YYSYMBOL_ImportForeignSchemaStmt = 743, /* ImportForeignSchemaStmt */ YYSYMBOL_import_qualification_type = 744, /* import_qualification_type */ YYSYMBOL_import_qualification = 745, /* import_qualification */ YYSYMBOL_CreateUserMappingStmt = 746, /* CreateUserMappingStmt */ YYSYMBOL_auth_ident = 747, /* auth_ident */ YYSYMBOL_DropUserMappingStmt = 748, /* DropUserMappingStmt */ YYSYMBOL_AlterUserMappingStmt = 749, /* AlterUserMappingStmt */ YYSYMBOL_CreatePolicyStmt = 750, /* CreatePolicyStmt */ YYSYMBOL_AlterPolicyStmt = 751, /* AlterPolicyStmt */ YYSYMBOL_RowSecurityOptionalExpr = 752, /* RowSecurityOptionalExpr */ YYSYMBOL_RowSecurityOptionalWithCheck = 753, /* RowSecurityOptionalWithCheck */ YYSYMBOL_RowSecurityDefaultToRole = 754, /* RowSecurityDefaultToRole */ YYSYMBOL_RowSecurityOptionalToRole = 755, /* RowSecurityOptionalToRole */ YYSYMBOL_RowSecurityDefaultPermissive = 756, /* RowSecurityDefaultPermissive */ YYSYMBOL_RowSecurityDefaultForCmd = 757, /* RowSecurityDefaultForCmd */ YYSYMBOL_row_security_cmd = 758, /* row_security_cmd */ YYSYMBOL_CreateAmStmt = 759, /* CreateAmStmt */ YYSYMBOL_am_type = 760, /* am_type */ YYSYMBOL_CreateTrigStmt = 761, /* CreateTrigStmt */ YYSYMBOL_TriggerActionTime = 762, /* TriggerActionTime */ YYSYMBOL_TriggerEvents = 763, /* TriggerEvents */ YYSYMBOL_TriggerOneEvent = 764, /* TriggerOneEvent */ YYSYMBOL_TriggerReferencing = 765, /* TriggerReferencing */ YYSYMBOL_TriggerTransitions = 766, /* TriggerTransitions */ YYSYMBOL_TriggerTransition = 767, /* TriggerTransition */ YYSYMBOL_TransitionOldOrNew = 768, /* TransitionOldOrNew */ YYSYMBOL_TransitionRowOrTable = 769, /* TransitionRowOrTable */ YYSYMBOL_TransitionRelName = 770, /* TransitionRelName */ YYSYMBOL_TriggerForSpec = 771, /* TriggerForSpec */ YYSYMBOL_TriggerForOptEach = 772, /* TriggerForOptEach */ YYSYMBOL_TriggerForType = 773, /* TriggerForType */ YYSYMBOL_TriggerWhen = 774, /* TriggerWhen */ YYSYMBOL_FUNCTION_or_PROCEDURE = 775, /* FUNCTION_or_PROCEDURE */ YYSYMBOL_TriggerFuncArgs = 776, /* TriggerFuncArgs */ YYSYMBOL_TriggerFuncArg = 777, /* TriggerFuncArg */ YYSYMBOL_OptConstrFromTable = 778, /* OptConstrFromTable */ YYSYMBOL_ConstraintAttributeSpec = 779, /* ConstraintAttributeSpec */ YYSYMBOL_ConstraintAttributeElem = 780, /* ConstraintAttributeElem */ YYSYMBOL_CreateEventTrigStmt = 781, /* CreateEventTrigStmt */ YYSYMBOL_event_trigger_when_list = 782, /* event_trigger_when_list */ YYSYMBOL_event_trigger_when_item = 783, /* event_trigger_when_item */ YYSYMBOL_event_trigger_value_list = 784, /* event_trigger_value_list */ YYSYMBOL_AlterEventTrigStmt = 785, /* AlterEventTrigStmt */ YYSYMBOL_enable_trigger = 786, /* enable_trigger */ YYSYMBOL_CreateAssertionStmt = 787, /* CreateAssertionStmt */ YYSYMBOL_DefineStmt = 788, /* DefineStmt */ YYSYMBOL_definition = 789, /* definition */ YYSYMBOL_def_list = 790, /* def_list */ YYSYMBOL_def_elem = 791, /* def_elem */ YYSYMBOL_def_arg = 792, /* def_arg */ YYSYMBOL_old_aggr_definition = 793, /* old_aggr_definition */ YYSYMBOL_old_aggr_list = 794, /* old_aggr_list */ YYSYMBOL_old_aggr_elem = 795, /* old_aggr_elem */ YYSYMBOL_opt_enum_val_list = 796, /* opt_enum_val_list */ YYSYMBOL_enum_val_list = 797, /* enum_val_list */ YYSYMBOL_AlterEnumStmt = 798, /* AlterEnumStmt */ YYSYMBOL_opt_if_not_exists = 799, /* opt_if_not_exists */ YYSYMBOL_CreateOpClassStmt = 800, /* CreateOpClassStmt */ YYSYMBOL_opclass_item_list = 801, /* opclass_item_list */ YYSYMBOL_opclass_item = 802, /* opclass_item */ YYSYMBOL_opt_default = 803, /* opt_default */ YYSYMBOL_opt_opfamily = 804, /* opt_opfamily */ YYSYMBOL_opclass_purpose = 805, /* opclass_purpose */ YYSYMBOL_CreateOpFamilyStmt = 806, /* CreateOpFamilyStmt */ YYSYMBOL_AlterOpFamilyStmt = 807, /* AlterOpFamilyStmt */ YYSYMBOL_opclass_drop_list = 808, /* opclass_drop_list */ YYSYMBOL_opclass_drop = 809, /* opclass_drop */ YYSYMBOL_DropOpClassStmt = 810, /* DropOpClassStmt */ YYSYMBOL_DropOpFamilyStmt = 811, /* DropOpFamilyStmt */ YYSYMBOL_DropOwnedStmt = 812, /* DropOwnedStmt */ YYSYMBOL_ReassignOwnedStmt = 813, /* ReassignOwnedStmt */ YYSYMBOL_DropStmt = 814, /* DropStmt */ YYSYMBOL_object_type_any_name = 815, /* object_type_any_name */ YYSYMBOL_object_type_name = 816, /* object_type_name */ YYSYMBOL_drop_type_name = 817, /* drop_type_name */ YYSYMBOL_object_type_name_on_any_name = 818, /* object_type_name_on_any_name */ YYSYMBOL_any_name_list = 819, /* any_name_list */ YYSYMBOL_any_name = 820, /* any_name */ YYSYMBOL_attrs = 821, /* attrs */ YYSYMBOL_type_name_list = 822, /* type_name_list */ YYSYMBOL_TruncateStmt = 823, /* TruncateStmt */ YYSYMBOL_opt_restart_seqs = 824, /* opt_restart_seqs */ YYSYMBOL_CommentStmt = 825, /* CommentStmt */ YYSYMBOL_comment_text = 826, /* comment_text */ YYSYMBOL_SecLabelStmt = 827, /* SecLabelStmt */ YYSYMBOL_opt_provider = 828, /* opt_provider */ YYSYMBOL_security_label = 829, /* security_label */ YYSYMBOL_FetchStmt = 830, /* FetchStmt */ YYSYMBOL_fetch_args = 831, /* fetch_args */ YYSYMBOL_from_in = 832, /* from_in */ YYSYMBOL_opt_from_in = 833, /* opt_from_in */ YYSYMBOL_GrantStmt = 834, /* GrantStmt */ YYSYMBOL_RevokeStmt = 835, /* RevokeStmt */ YYSYMBOL_privileges = 836, /* privileges */ YYSYMBOL_privilege_list = 837, /* privilege_list */ YYSYMBOL_privilege = 838, /* privilege */ YYSYMBOL_parameter_name_list = 839, /* parameter_name_list */ YYSYMBOL_parameter_name = 840, /* parameter_name */ YYSYMBOL_privilege_target = 841, /* privilege_target */ YYSYMBOL_grantee_list = 842, /* grantee_list */ YYSYMBOL_grantee = 843, /* grantee */ YYSYMBOL_opt_grant_grant_option = 844, /* opt_grant_grant_option */ YYSYMBOL_GrantRoleStmt = 845, /* GrantRoleStmt */ YYSYMBOL_RevokeRoleStmt = 846, /* RevokeRoleStmt */ YYSYMBOL_grant_role_opt_list = 847, /* grant_role_opt_list */ YYSYMBOL_grant_role_opt = 848, /* grant_role_opt */ YYSYMBOL_grant_role_opt_value = 849, /* grant_role_opt_value */ YYSYMBOL_opt_granted_by = 850, /* opt_granted_by */ YYSYMBOL_AlterDefaultPrivilegesStmt = 851, /* AlterDefaultPrivilegesStmt */ YYSYMBOL_DefACLOptionList = 852, /* DefACLOptionList */ YYSYMBOL_DefACLOption = 853, /* DefACLOption */ YYSYMBOL_DefACLAction = 854, /* DefACLAction */ YYSYMBOL_defacl_privilege_target = 855, /* defacl_privilege_target */ YYSYMBOL_IndexStmt = 856, /* IndexStmt */ YYSYMBOL_opt_unique = 857, /* opt_unique */ YYSYMBOL_access_method_clause = 858, /* access_method_clause */ YYSYMBOL_index_params = 859, /* index_params */ YYSYMBOL_index_elem_options = 860, /* index_elem_options */ YYSYMBOL_index_elem = 861, /* index_elem */ YYSYMBOL_opt_include = 862, /* opt_include */ YYSYMBOL_index_including_params = 863, /* index_including_params */ YYSYMBOL_opt_collate = 864, /* opt_collate */ YYSYMBOL_opt_asc_desc = 865, /* opt_asc_desc */ YYSYMBOL_opt_nulls_order = 866, /* opt_nulls_order */ YYSYMBOL_CreateFunctionStmt = 867, /* CreateFunctionStmt */ YYSYMBOL_opt_or_replace = 868, /* opt_or_replace */ YYSYMBOL_func_args = 869, /* func_args */ YYSYMBOL_func_args_list = 870, /* func_args_list */ YYSYMBOL_function_with_argtypes_list = 871, /* function_with_argtypes_list */ YYSYMBOL_function_with_argtypes = 872, /* function_with_argtypes */ YYSYMBOL_func_args_with_defaults = 873, /* func_args_with_defaults */ YYSYMBOL_func_args_with_defaults_list = 874, /* func_args_with_defaults_list */ YYSYMBOL_func_arg = 875, /* func_arg */ YYSYMBOL_arg_class = 876, /* arg_class */ YYSYMBOL_param_name = 877, /* param_name */ YYSYMBOL_func_return = 878, /* func_return */ YYSYMBOL_func_type = 879, /* func_type */ YYSYMBOL_func_arg_with_default = 880, /* func_arg_with_default */ YYSYMBOL_aggr_arg = 881, /* aggr_arg */ YYSYMBOL_aggr_args = 882, /* aggr_args */ YYSYMBOL_aggr_args_list = 883, /* aggr_args_list */ YYSYMBOL_aggregate_with_argtypes = 884, /* aggregate_with_argtypes */ YYSYMBOL_aggregate_with_argtypes_list = 885, /* aggregate_with_argtypes_list */ YYSYMBOL_opt_createfunc_opt_list = 886, /* opt_createfunc_opt_list */ YYSYMBOL_createfunc_opt_list = 887, /* createfunc_opt_list */ YYSYMBOL_common_func_opt_item = 888, /* common_func_opt_item */ YYSYMBOL_createfunc_opt_item = 889, /* createfunc_opt_item */ YYSYMBOL_func_as = 890, /* func_as */ YYSYMBOL_ReturnStmt = 891, /* ReturnStmt */ YYSYMBOL_opt_routine_body = 892, /* opt_routine_body */ YYSYMBOL_routine_body_stmt_list = 893, /* routine_body_stmt_list */ YYSYMBOL_routine_body_stmt = 894, /* routine_body_stmt */ YYSYMBOL_transform_type_list = 895, /* transform_type_list */ YYSYMBOL_opt_definition = 896, /* opt_definition */ YYSYMBOL_table_func_column = 897, /* table_func_column */ YYSYMBOL_table_func_column_list = 898, /* table_func_column_list */ YYSYMBOL_AlterFunctionStmt = 899, /* AlterFunctionStmt */ YYSYMBOL_alterfunc_opt_list = 900, /* alterfunc_opt_list */ YYSYMBOL_opt_restrict = 901, /* opt_restrict */ YYSYMBOL_RemoveFuncStmt = 902, /* RemoveFuncStmt */ YYSYMBOL_RemoveAggrStmt = 903, /* RemoveAggrStmt */ YYSYMBOL_RemoveOperStmt = 904, /* RemoveOperStmt */ YYSYMBOL_oper_argtypes = 905, /* oper_argtypes */ YYSYMBOL_any_operator = 906, /* any_operator */ YYSYMBOL_operator_with_argtypes_list = 907, /* operator_with_argtypes_list */ YYSYMBOL_operator_with_argtypes = 908, /* operator_with_argtypes */ YYSYMBOL_DoStmt = 909, /* DoStmt */ YYSYMBOL_dostmt_opt_list = 910, /* dostmt_opt_list */ YYSYMBOL_dostmt_opt_item = 911, /* dostmt_opt_item */ YYSYMBOL_CreateCastStmt = 912, /* CreateCastStmt */ YYSYMBOL_cast_context = 913, /* cast_context */ YYSYMBOL_DropCastStmt = 914, /* DropCastStmt */ YYSYMBOL_opt_if_exists = 915, /* opt_if_exists */ YYSYMBOL_CreateTransformStmt = 916, /* CreateTransformStmt */ YYSYMBOL_transform_element_list = 917, /* transform_element_list */ YYSYMBOL_DropTransformStmt = 918, /* DropTransformStmt */ YYSYMBOL_ReindexStmt = 919, /* ReindexStmt */ YYSYMBOL_reindex_target_relation = 920, /* reindex_target_relation */ YYSYMBOL_reindex_target_all = 921, /* reindex_target_all */ YYSYMBOL_opt_reindex_option_list = 922, /* opt_reindex_option_list */ YYSYMBOL_AlterTblSpcStmt = 923, /* AlterTblSpcStmt */ YYSYMBOL_RenameStmt = 924, /* RenameStmt */ YYSYMBOL_opt_column = 925, /* opt_column */ YYSYMBOL_opt_set_data = 926, /* opt_set_data */ YYSYMBOL_AlterObjectDependsStmt = 927, /* AlterObjectDependsStmt */ YYSYMBOL_opt_no = 928, /* opt_no */ YYSYMBOL_AlterObjectSchemaStmt = 929, /* AlterObjectSchemaStmt */ YYSYMBOL_AlterOperatorStmt = 930, /* AlterOperatorStmt */ YYSYMBOL_operator_def_list = 931, /* operator_def_list */ YYSYMBOL_operator_def_elem = 932, /* operator_def_elem */ YYSYMBOL_operator_def_arg = 933, /* operator_def_arg */ YYSYMBOL_AlterTypeStmt = 934, /* AlterTypeStmt */ YYSYMBOL_AlterOwnerStmt = 935, /* AlterOwnerStmt */ YYSYMBOL_CreatePublicationStmt = 936, /* CreatePublicationStmt */ YYSYMBOL_PublicationObjSpec = 937, /* PublicationObjSpec */ YYSYMBOL_pub_obj_list = 938, /* pub_obj_list */ YYSYMBOL_AlterPublicationStmt = 939, /* AlterPublicationStmt */ YYSYMBOL_CreateSubscriptionStmt = 940, /* CreateSubscriptionStmt */ YYSYMBOL_AlterSubscriptionStmt = 941, /* AlterSubscriptionStmt */ YYSYMBOL_DropSubscriptionStmt = 942, /* DropSubscriptionStmt */ YYSYMBOL_RuleStmt = 943, /* RuleStmt */ YYSYMBOL_RuleActionList = 944, /* RuleActionList */ YYSYMBOL_RuleActionMulti = 945, /* RuleActionMulti */ YYSYMBOL_RuleActionStmt = 946, /* RuleActionStmt */ YYSYMBOL_RuleActionStmtOrEmpty = 947, /* RuleActionStmtOrEmpty */ YYSYMBOL_event = 948, /* event */ YYSYMBOL_opt_instead = 949, /* opt_instead */ YYSYMBOL_NotifyStmt = 950, /* NotifyStmt */ YYSYMBOL_notify_payload = 951, /* notify_payload */ YYSYMBOL_ListenStmt = 952, /* ListenStmt */ YYSYMBOL_UnlistenStmt = 953, /* UnlistenStmt */ YYSYMBOL_TransactionStmt = 954, /* TransactionStmt */ YYSYMBOL_TransactionStmtLegacy = 955, /* TransactionStmtLegacy */ YYSYMBOL_opt_transaction = 956, /* opt_transaction */ YYSYMBOL_transaction_mode_item = 957, /* transaction_mode_item */ YYSYMBOL_transaction_mode_list = 958, /* transaction_mode_list */ YYSYMBOL_transaction_mode_list_or_empty = 959, /* transaction_mode_list_or_empty */ YYSYMBOL_opt_transaction_chain = 960, /* opt_transaction_chain */ YYSYMBOL_ViewStmt = 961, /* ViewStmt */ YYSYMBOL_opt_check_option = 962, /* opt_check_option */ YYSYMBOL_LoadStmt = 963, /* LoadStmt */ YYSYMBOL_CreatedbStmt = 964, /* CreatedbStmt */ YYSYMBOL_createdb_opt_list = 965, /* createdb_opt_list */ YYSYMBOL_createdb_opt_items = 966, /* createdb_opt_items */ YYSYMBOL_createdb_opt_item = 967, /* createdb_opt_item */ YYSYMBOL_createdb_opt_name = 968, /* createdb_opt_name */ YYSYMBOL_opt_equal = 969, /* opt_equal */ YYSYMBOL_AlterDatabaseStmt = 970, /* AlterDatabaseStmt */ YYSYMBOL_AlterDatabaseSetStmt = 971, /* AlterDatabaseSetStmt */ YYSYMBOL_DropdbStmt = 972, /* DropdbStmt */ YYSYMBOL_drop_option_list = 973, /* drop_option_list */ YYSYMBOL_drop_option = 974, /* drop_option */ YYSYMBOL_AlterCollationStmt = 975, /* AlterCollationStmt */ YYSYMBOL_AlterSystemStmt = 976, /* AlterSystemStmt */ YYSYMBOL_CreateDomainStmt = 977, /* CreateDomainStmt */ YYSYMBOL_AlterDomainStmt = 978, /* AlterDomainStmt */ YYSYMBOL_opt_as = 979, /* opt_as */ YYSYMBOL_AlterTSDictionaryStmt = 980, /* AlterTSDictionaryStmt */ YYSYMBOL_AlterTSConfigurationStmt = 981, /* AlterTSConfigurationStmt */ YYSYMBOL_any_with = 982, /* any_with */ YYSYMBOL_CreateConversionStmt = 983, /* CreateConversionStmt */ YYSYMBOL_ClusterStmt = 984, /* ClusterStmt */ YYSYMBOL_cluster_index_specification = 985, /* cluster_index_specification */ YYSYMBOL_VacuumStmt = 986, /* VacuumStmt */ YYSYMBOL_AnalyzeStmt = 987, /* AnalyzeStmt */ YYSYMBOL_utility_option_list = 988, /* utility_option_list */ YYSYMBOL_analyze_keyword = 989, /* analyze_keyword */ YYSYMBOL_utility_option_elem = 990, /* utility_option_elem */ YYSYMBOL_utility_option_name = 991, /* utility_option_name */ YYSYMBOL_utility_option_arg = 992, /* utility_option_arg */ YYSYMBOL_opt_analyze = 993, /* opt_analyze */ YYSYMBOL_opt_verbose = 994, /* opt_verbose */ YYSYMBOL_opt_full = 995, /* opt_full */ YYSYMBOL_opt_freeze = 996, /* opt_freeze */ YYSYMBOL_opt_name_list = 997, /* opt_name_list */ YYSYMBOL_vacuum_relation = 998, /* vacuum_relation */ YYSYMBOL_vacuum_relation_list = 999, /* vacuum_relation_list */ YYSYMBOL_opt_vacuum_relation_list = 1000, /* opt_vacuum_relation_list */ YYSYMBOL_ExplainStmt = 1001, /* ExplainStmt */ YYSYMBOL_ExplainableStmt = 1002, /* ExplainableStmt */ YYSYMBOL_PrepareStmt = 1003, /* PrepareStmt */ YYSYMBOL_prep_type_clause = 1004, /* prep_type_clause */ YYSYMBOL_PreparableStmt = 1005, /* PreparableStmt */ YYSYMBOL_ExecuteStmt = 1006, /* ExecuteStmt */ YYSYMBOL_execute_param_clause = 1007, /* execute_param_clause */ YYSYMBOL_DeallocateStmt = 1008, /* DeallocateStmt */ YYSYMBOL_InsertStmt = 1009, /* InsertStmt */ YYSYMBOL_InsertStmtShort = 1010, /* InsertStmtShort */ YYSYMBOL_insert_target = 1011, /* insert_target */ YYSYMBOL_insert_rest = 1012, /* insert_rest */ YYSYMBOL_override_kind = 1013, /* override_kind */ YYSYMBOL_insert_column_list = 1014, /* insert_column_list */ YYSYMBOL_insert_column_item = 1015, /* insert_column_item */ YYSYMBOL_opt_on_conflict = 1016, /* opt_on_conflict */ YYSYMBOL_opt_conf_expr = 1017, /* opt_conf_expr */ YYSYMBOL_returning_clause = 1018, /* returning_clause */ YYSYMBOL_returning_with_clause = 1019, /* returning_with_clause */ YYSYMBOL_returning_options = 1020, /* returning_options */ YYSYMBOL_returning_option = 1021, /* returning_option */ YYSYMBOL_returning_option_kind = 1022, /* returning_option_kind */ YYSYMBOL_DeleteStmt = 1023, /* DeleteStmt */ YYSYMBOL_using_clause = 1024, /* using_clause */ YYSYMBOL_LockStmt = 1025, /* LockStmt */ YYSYMBOL_opt_lock = 1026, /* opt_lock */ YYSYMBOL_lock_type = 1027, /* lock_type */ YYSYMBOL_opt_nowait = 1028, /* opt_nowait */ YYSYMBOL_opt_nowait_or_skip = 1029, /* opt_nowait_or_skip */ YYSYMBOL_UpdateStmt = 1030, /* UpdateStmt */ YYSYMBOL_UpdateStmtShort = 1031, /* UpdateStmtShort */ YYSYMBOL_set_clause_list = 1032, /* set_clause_list */ YYSYMBOL_set_clause = 1033, /* set_clause */ YYSYMBOL_set_target = 1034, /* set_target */ YYSYMBOL_set_target_list = 1035, /* set_target_list */ YYSYMBOL_MergeStmt = 1036, /* MergeStmt */ YYSYMBOL_merge_when_list = 1037, /* merge_when_list */ YYSYMBOL_merge_when_clause = 1038, /* merge_when_clause */ YYSYMBOL_merge_when_tgt_matched = 1039, /* merge_when_tgt_matched */ YYSYMBOL_merge_when_tgt_not_matched = 1040, /* merge_when_tgt_not_matched */ YYSYMBOL_opt_merge_when_condition = 1041, /* opt_merge_when_condition */ YYSYMBOL_merge_update = 1042, /* merge_update */ YYSYMBOL_merge_delete = 1043, /* merge_delete */ YYSYMBOL_merge_insert = 1044, /* merge_insert */ YYSYMBOL_merge_values_clause = 1045, /* merge_values_clause */ YYSYMBOL_DeclareCursorStmt = 1046, /* DeclareCursorStmt */ YYSYMBOL_cursor_name = 1047, /* cursor_name */ YYSYMBOL_cursor_options = 1048, /* cursor_options */ YYSYMBOL_opt_hold = 1049, /* opt_hold */ YYSYMBOL_SelectStmt = 1050, /* SelectStmt */ YYSYMBOL_select_with_parens = 1051, /* select_with_parens */ YYSYMBOL_select_no_parens = 1052, /* select_no_parens */ YYSYMBOL_select_clause = 1053, /* select_clause */ YYSYMBOL_simple_select = 1054, /* simple_select */ YYSYMBOL_with_clause = 1055, /* with_clause */ YYSYMBOL_cte_list = 1056, /* cte_list */ YYSYMBOL_common_table_expr = 1057, /* common_table_expr */ YYSYMBOL_opt_materialized = 1058, /* opt_materialized */ YYSYMBOL_opt_search_clause = 1059, /* opt_search_clause */ YYSYMBOL_opt_cycle_clause = 1060, /* opt_cycle_clause */ YYSYMBOL_opt_with_clause = 1061, /* opt_with_clause */ YYSYMBOL_into_clause = 1062, /* into_clause */ YYSYMBOL_OptTempTableName = 1063, /* OptTempTableName */ YYSYMBOL_opt_table = 1064, /* opt_table */ YYSYMBOL_set_quantifier = 1065, /* set_quantifier */ YYSYMBOL_distinct_clause = 1066, /* distinct_clause */ YYSYMBOL_opt_all_clause = 1067, /* opt_all_clause */ YYSYMBOL_opt_distinct_clause = 1068, /* opt_distinct_clause */ YYSYMBOL_opt_sort_clause = 1069, /* opt_sort_clause */ YYSYMBOL_sort_clause = 1070, /* sort_clause */ YYSYMBOL_sortby_list = 1071, /* sortby_list */ YYSYMBOL_sortby = 1072, /* sortby */ YYSYMBOL_select_limit = 1073, /* select_limit */ YYSYMBOL_opt_select_limit = 1074, /* opt_select_limit */ YYSYMBOL_limit_clause = 1075, /* limit_clause */ YYSYMBOL_offset_clause = 1076, /* offset_clause */ YYSYMBOL_select_limit_value = 1077, /* select_limit_value */ YYSYMBOL_select_offset_value = 1078, /* select_offset_value */ YYSYMBOL_select_fetch_first_value = 1079, /* select_fetch_first_value */ YYSYMBOL_I_or_F_const = 1080, /* I_or_F_const */ YYSYMBOL_row_or_rows = 1081, /* row_or_rows */ YYSYMBOL_first_or_next = 1082, /* first_or_next */ YYSYMBOL_group_clause = 1083, /* group_clause */ YYSYMBOL_group_by_list = 1084, /* group_by_list */ YYSYMBOL_group_by_item = 1085, /* group_by_item */ YYSYMBOL_empty_grouping_set = 1086, /* empty_grouping_set */ YYSYMBOL_rollup_clause = 1087, /* rollup_clause */ YYSYMBOL_cube_clause = 1088, /* cube_clause */ YYSYMBOL_grouping_sets_clause = 1089, /* grouping_sets_clause */ YYSYMBOL_having_clause = 1090, /* having_clause */ YYSYMBOL_for_locking_clause = 1091, /* for_locking_clause */ YYSYMBOL_opt_for_locking_clause = 1092, /* opt_for_locking_clause */ YYSYMBOL_for_locking_items = 1093, /* for_locking_items */ YYSYMBOL_for_locking_item = 1094, /* for_locking_item */ YYSYMBOL_for_locking_strength = 1095, /* for_locking_strength */ YYSYMBOL_locked_rels_list = 1096, /* locked_rels_list */ YYSYMBOL_values_clause = 1097, /* values_clause */ YYSYMBOL_from_clause = 1098, /* from_clause */ YYSYMBOL_from_list = 1099, /* from_list */ YYSYMBOL_table_ref = 1100, /* table_ref */ YYSYMBOL_joined_table = 1101, /* joined_table */ YYSYMBOL_alias_clause = 1102, /* alias_clause */ YYSYMBOL_opt_alias_clause = 1103, /* opt_alias_clause */ YYSYMBOL_opt_alias_clause_for_join_using = 1104, /* opt_alias_clause_for_join_using */ YYSYMBOL_func_alias_clause = 1105, /* func_alias_clause */ YYSYMBOL_join_type = 1106, /* join_type */ YYSYMBOL_opt_outer = 1107, /* opt_outer */ YYSYMBOL_join_qual = 1108, /* join_qual */ YYSYMBOL_relation_expr = 1109, /* relation_expr */ YYSYMBOL_extended_relation_expr = 1110, /* extended_relation_expr */ YYSYMBOL_relation_expr_list = 1111, /* relation_expr_list */ YYSYMBOL_relation_expr_opt_alias = 1112, /* relation_expr_opt_alias */ YYSYMBOL_tablesample_clause = 1113, /* tablesample_clause */ YYSYMBOL_opt_repeatable_clause = 1114, /* opt_repeatable_clause */ YYSYMBOL_func_table = 1115, /* func_table */ YYSYMBOL_rowsfrom_item = 1116, /* rowsfrom_item */ YYSYMBOL_rowsfrom_list = 1117, /* rowsfrom_list */ YYSYMBOL_opt_col_def_list = 1118, /* opt_col_def_list */ YYSYMBOL_opt_ordinality = 1119, /* opt_ordinality */ YYSYMBOL_where_clause = 1120, /* where_clause */ YYSYMBOL_where_or_current_clause = 1121, /* where_or_current_clause */ YYSYMBOL_OptTableFuncElementList = 1122, /* OptTableFuncElementList */ YYSYMBOL_TableFuncElementList = 1123, /* TableFuncElementList */ YYSYMBOL_TableFuncElement = 1124, /* TableFuncElement */ YYSYMBOL_xmltable = 1125, /* xmltable */ YYSYMBOL_xmltable_column_list = 1126, /* xmltable_column_list */ YYSYMBOL_xmltable_column_el = 1127, /* xmltable_column_el */ YYSYMBOL_xmltable_column_option_list = 1128, /* xmltable_column_option_list */ YYSYMBOL_xmltable_column_option_el = 1129, /* xmltable_column_option_el */ YYSYMBOL_xml_namespace_list = 1130, /* xml_namespace_list */ YYSYMBOL_xml_namespace_el = 1131, /* xml_namespace_el */ YYSYMBOL_json_table = 1132, /* json_table */ YYSYMBOL_json_table_path_name_opt = 1133, /* json_table_path_name_opt */ YYSYMBOL_json_table_column_definition_list = 1134, /* json_table_column_definition_list */ YYSYMBOL_json_table_column_definition = 1135, /* json_table_column_definition */ YYSYMBOL_path_opt = 1136, /* path_opt */ YYSYMBOL_json_table_column_path_clause_opt = 1137, /* json_table_column_path_clause_opt */ YYSYMBOL_Typename = 1138, /* Typename */ YYSYMBOL_opt_array_bounds = 1139, /* opt_array_bounds */ YYSYMBOL_SimpleTypename = 1140, /* SimpleTypename */ YYSYMBOL_ConstTypename = 1141, /* ConstTypename */ YYSYMBOL_GenericType = 1142, /* GenericType */ YYSYMBOL_opt_type_modifiers = 1143, /* opt_type_modifiers */ YYSYMBOL_Numeric = 1144, /* Numeric */ YYSYMBOL_opt_float = 1145, /* opt_float */ YYSYMBOL_Bit = 1146, /* Bit */ YYSYMBOL_ConstBit = 1147, /* ConstBit */ YYSYMBOL_BitWithLength = 1148, /* BitWithLength */ YYSYMBOL_BitWithoutLength = 1149, /* BitWithoutLength */ YYSYMBOL_Character = 1150, /* Character */ YYSYMBOL_ConstCharacter = 1151, /* ConstCharacter */ YYSYMBOL_CharacterWithLength = 1152, /* CharacterWithLength */ YYSYMBOL_CharacterWithoutLength = 1153, /* CharacterWithoutLength */ YYSYMBOL_character = 1154, /* character */ YYSYMBOL_opt_varying = 1155, /* opt_varying */ YYSYMBOL_ConstDatetime = 1156, /* ConstDatetime */ YYSYMBOL_ConstInterval = 1157, /* ConstInterval */ YYSYMBOL_opt_timezone = 1158, /* opt_timezone */ YYSYMBOL_opt_interval = 1159, /* opt_interval */ YYSYMBOL_interval_second = 1160, /* interval_second */ YYSYMBOL_JsonType = 1161, /* JsonType */ YYSYMBOL_a_expr = 1162, /* a_expr */ YYSYMBOL_b_expr = 1163, /* b_expr */ YYSYMBOL_c_expr = 1164, /* c_expr */ YYSYMBOL_func_application = 1165, /* func_application */ YYSYMBOL_func_expr = 1166, /* func_expr */ YYSYMBOL_func_expr_windowless = 1167, /* func_expr_windowless */ YYSYMBOL_func_expr_common_subexpr = 1168, /* func_expr_common_subexpr */ YYSYMBOL_xml_root_version = 1169, /* xml_root_version */ YYSYMBOL_opt_xml_root_standalone = 1170, /* opt_xml_root_standalone */ YYSYMBOL_xml_attributes = 1171, /* xml_attributes */ YYSYMBOL_xml_attribute_list = 1172, /* xml_attribute_list */ YYSYMBOL_xml_attribute_el = 1173, /* xml_attribute_el */ YYSYMBOL_document_or_content = 1174, /* document_or_content */ YYSYMBOL_xml_indent_option = 1175, /* xml_indent_option */ YYSYMBOL_xml_whitespace_option = 1176, /* xml_whitespace_option */ YYSYMBOL_xmlexists_argument = 1177, /* xmlexists_argument */ YYSYMBOL_xml_passing_mech = 1178, /* xml_passing_mech */ YYSYMBOL_within_group_clause = 1179, /* within_group_clause */ YYSYMBOL_filter_clause = 1180, /* filter_clause */ YYSYMBOL_window_clause = 1181, /* window_clause */ YYSYMBOL_window_definition_list = 1182, /* window_definition_list */ YYSYMBOL_window_definition = 1183, /* window_definition */ YYSYMBOL_over_clause = 1184, /* over_clause */ YYSYMBOL_window_specification = 1185, /* window_specification */ YYSYMBOL_opt_existing_window_name = 1186, /* opt_existing_window_name */ YYSYMBOL_opt_partition_clause = 1187, /* opt_partition_clause */ YYSYMBOL_opt_frame_clause = 1188, /* opt_frame_clause */ YYSYMBOL_frame_extent = 1189, /* frame_extent */ YYSYMBOL_frame_bound = 1190, /* frame_bound */ YYSYMBOL_opt_window_exclusion_clause = 1191, /* opt_window_exclusion_clause */ YYSYMBOL_row = 1192, /* row */ YYSYMBOL_explicit_row = 1193, /* explicit_row */ YYSYMBOL_implicit_row = 1194, /* implicit_row */ YYSYMBOL_sub_type = 1195, /* sub_type */ YYSYMBOL_all_Op = 1196, /* all_Op */ YYSYMBOL_MathOp = 1197, /* MathOp */ YYSYMBOL_qual_Op = 1198, /* qual_Op */ YYSYMBOL_qual_all_Op = 1199, /* qual_all_Op */ YYSYMBOL_subquery_Op = 1200, /* subquery_Op */ YYSYMBOL_expr_list = 1201, /* expr_list */ YYSYMBOL_func_arg_list = 1202, /* func_arg_list */ YYSYMBOL_func_arg_expr = 1203, /* func_arg_expr */ YYSYMBOL_func_arg_list_opt = 1204, /* func_arg_list_opt */ YYSYMBOL_type_list = 1205, /* type_list */ YYSYMBOL_array_expr = 1206, /* array_expr */ YYSYMBOL_array_expr_list = 1207, /* array_expr_list */ YYSYMBOL_extract_list = 1208, /* extract_list */ YYSYMBOL_extract_arg = 1209, /* extract_arg */ YYSYMBOL_unicode_normal_form = 1210, /* unicode_normal_form */ YYSYMBOL_overlay_list = 1211, /* overlay_list */ YYSYMBOL_position_list = 1212, /* position_list */ YYSYMBOL_substr_list = 1213, /* substr_list */ YYSYMBOL_trim_list = 1214, /* trim_list */ YYSYMBOL_case_expr = 1215, /* case_expr */ YYSYMBOL_when_clause_list = 1216, /* when_clause_list */ YYSYMBOL_when_clause = 1217, /* when_clause */ YYSYMBOL_case_default = 1218, /* case_default */ YYSYMBOL_case_arg = 1219, /* case_arg */ YYSYMBOL_columnref = 1220, /* columnref */ YYSYMBOL_indirection_el = 1221, /* indirection_el */ YYSYMBOL_opt_slice_bound = 1222, /* opt_slice_bound */ YYSYMBOL_indirection = 1223, /* indirection */ YYSYMBOL_opt_indirection = 1224, /* opt_indirection */ YYSYMBOL_opt_asymmetric = 1225, /* opt_asymmetric */ YYSYMBOL_json_passing_clause_opt = 1226, /* json_passing_clause_opt */ YYSYMBOL_json_arguments = 1227, /* json_arguments */ YYSYMBOL_json_argument = 1228, /* json_argument */ YYSYMBOL_json_wrapper_behavior = 1229, /* json_wrapper_behavior */ YYSYMBOL_json_behavior = 1230, /* json_behavior */ YYSYMBOL_json_behavior_type = 1231, /* json_behavior_type */ YYSYMBOL_json_behavior_clause_opt = 1232, /* json_behavior_clause_opt */ YYSYMBOL_json_on_error_clause_opt = 1233, /* json_on_error_clause_opt */ YYSYMBOL_json_value_expr = 1234, /* json_value_expr */ YYSYMBOL_json_format_clause = 1235, /* json_format_clause */ YYSYMBOL_json_format_clause_opt = 1236, /* json_format_clause_opt */ YYSYMBOL_json_quotes_clause_opt = 1237, /* json_quotes_clause_opt */ YYSYMBOL_json_returning_clause_opt = 1238, /* json_returning_clause_opt */ YYSYMBOL_json_predicate_type_constraint = 1239, /* json_predicate_type_constraint */ YYSYMBOL_json_key_uniqueness_constraint_opt = 1240, /* json_key_uniqueness_constraint_opt */ YYSYMBOL_json_name_and_value_list = 1241, /* json_name_and_value_list */ YYSYMBOL_json_name_and_value = 1242, /* json_name_and_value */ YYSYMBOL_json_object_constructor_null_clause_opt = 1243, /* json_object_constructor_null_clause_opt */ YYSYMBOL_json_array_constructor_null_clause_opt = 1244, /* json_array_constructor_null_clause_opt */ YYSYMBOL_json_value_expr_list = 1245, /* json_value_expr_list */ YYSYMBOL_json_aggregate_func = 1246, /* json_aggregate_func */ YYSYMBOL_json_array_aggregate_order_by_clause_opt = 1247, /* json_array_aggregate_order_by_clause_opt */ YYSYMBOL_opt_target_list = 1248, /* opt_target_list */ YYSYMBOL_target_list = 1249, /* target_list */ YYSYMBOL_target_el = 1250, /* target_el */ YYSYMBOL_qualified_name_list = 1251, /* qualified_name_list */ YYSYMBOL_qualified_name = 1252, /* qualified_name */ YYSYMBOL_name_list = 1253, /* name_list */ YYSYMBOL_name = 1254, /* name */ YYSYMBOL_attr_name = 1255, /* attr_name */ YYSYMBOL_file_name = 1256, /* file_name */ YYSYMBOL_func_name = 1257, /* func_name */ YYSYMBOL_AexprConst = 1258, /* AexprConst */ YYSYMBOL_Iconst = 1259, /* Iconst */ YYSYMBOL_Sconst = 1260, /* Sconst */ YYSYMBOL_SignedIconst = 1261, /* SignedIconst */ YYSYMBOL_RoleId = 1262, /* RoleId */ YYSYMBOL_RoleSpec = 1263, /* RoleSpec */ YYSYMBOL_role_list = 1264, /* role_list */ YYSYMBOL_PLpgSQL_Expr = 1265, /* PLpgSQL_Expr */ YYSYMBOL_PLAssignStmt = 1266, /* PLAssignStmt */ YYSYMBOL_plassign_target = 1267, /* plassign_target */ YYSYMBOL_plassign_equals = 1268, /* plassign_equals */ YYSYMBOL_ColId = 1269, /* ColId */ YYSYMBOL_type_function_name = 1270, /* type_function_name */ YYSYMBOL_NonReservedWord = 1271, /* NonReservedWord */ YYSYMBOL_ColLabel = 1272, /* ColLabel */ YYSYMBOL_BareColLabel = 1273, /* BareColLabel */ YYSYMBOL_unreserved_keyword = 1274, /* unreserved_keyword */ YYSYMBOL_col_name_keyword = 1275, /* col_name_keyword */ YYSYMBOL_type_func_name_keyword = 1276, /* type_func_name_keyword */ YYSYMBOL_reserved_keyword = 1277, /* reserved_keyword */ YYSYMBOL_bare_label_keyword = 1278 /* bare_label_keyword */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure and (if available) are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YY_STDINT_H # endif #endif /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ #ifdef __INT_LEAST8_MAX__ typedef __INT_LEAST8_TYPE__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ typedef __INT_LEAST16_TYPE__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; #else typedef short yytype_uint8; #endif #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; #else typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ # define YYPTRDIFF_T __PTRDIFF_TYPE__ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include /* INFRINGES ON USER NAME SPACE */ # endif # define YYPTRDIFF_T ptrdiff_t # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX # else # define YYPTRDIFF_T long # define YYPTRDIFF_MAXIMUM LONG_MAX # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ ? YYPTRDIFF_MAXIMUM \ : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; /* State numbers in computations. */ typedef int yy_state_fast_t; #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_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define YY_ATTRIBUTE_PURE # endif #endif #ifndef YY_ATTRIBUTE_UNUSED # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define YY_ATTRIBUTE_UNUSED # 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__ && ! defined __ICC && 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 __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if !defined yyoverflow /* 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 */ #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 { yy_state_t 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 (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + YYSIZEOF (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 \ { \ YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / YYSIZEOF (*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, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYPTRDIFF_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 940 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 125448 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 543 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 736 /* YYNRULES -- Number of rules. */ #define YYNRULES 3443 /* YYNSTATES -- Number of states. */ #define YYNSTATES 6524 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 780 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int16 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, 532, 2, 2, 537, 538, 530, 528, 541, 529, 539, 531, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 542, 540, 525, 527, 526, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 535, 2, 536, 533, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 522, 523, 524, 534 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 956, 956, 961, 965, 970, 978, 986, 1002, 1014, 1028, 1029, 1033, 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, 1158, 1165, 1166, 1170, 1171, 1175, 1176, 1180, 1181, 1182, 1191, 1207, 1219, 1220, 1221, 1230, 1231, 1235, 1236, 1240, 1245, 1249, 1259, 1267, 1271, 1275, 1280, 1284, 1332, 1334, 1338, 1342, 1346, 1350, 1364, 1383, 1392, 1404, 1405, 1409, 1418, 1427, 1436, 1458, 1466, 1474, 1482, 1490, 1498, 1516, 1535, 1547, 1548, 1559, 1570, 1581, 1597, 1616, 1621, 1629, 1630, 1631, 1632, 1633, 1634, 1648, 1655, 1662, 1669, 1676, 1686, 1697, 1708, 1712, 1722, 1732, 1741, 1753, 1754, 1764, 1778, 1786, 1796, 1809, 1819, 1829, 1838, 1850, 1861, 1869, 1870, 1874, 1875, 1878, 1880, 1884, 1885, 1886, 1887, 1891, 1892, 1893, 1899, 1911, 1915, 1919, 1936, 1944, 1945, 1946, 1950, 1951, 1952, 1956, 1957, 1961, 1962, 1971, 1972, 1981, 1990, 2002, 2011, 2023, 2024, 2029, 2030, 2036, 2042, 2048, 2055, 2062, 2069, 2076, 2087, 2098, 2099, 2103, 2104, 2112, 2128, 2135, 2142, 2149, 2156, 2176, 2186, 2196, 2206, 2216, 2228, 2240, 2250, 2260, 2270, 2282, 2294, 2304, 2314, 2324, 2334, 2344, 2354, 2366, 2378, 2388, 2401, 2402, 2407, 2421, 2434, 2450, 2467, 2477, 2487, 2497, 2507, 2517, 2526, 2535, 2545, 2554, 2564, 2574, 2590, 2600, 2610, 2620, 2630, 2647, 2657, 2667, 2677, 2688, 2702, 2718, 2727, 2736, 2767, 2781, 2790, 2801, 2812, 2820, 2829, 2838, 2846, 2854, 2863, 2872, 2881, 2889, 2897, 2906, 2914, 2922, 2931, 2940, 2949, 2958, 2967, 2976, 2987, 2995, 3004, 3013, 3022, 3031, 3040, 3049, 3057, 3065, 3073, 3080, 3091, 3092, 3096, 3105, 3109, 3110, 3114, 3122, 3130, 3138, 3149, 3152, 3153, 3157, 3158, 3163, 3167, 3171, 3176, 3183, 3185, 3190, 3194, 3198, 3209, 3216, 3217, 3221, 3222, 3227, 3282, 3295, 3309, 3321, 3328, 3332, 3346, 3359, 3360, 3365, 3375, 3386, 3397, 3424, 3431, 3465, 3501, 3524, 3525, 3529, 3530, 3539, 3540, 3541, 3544, 3545, 3550, 3551, 3555, 3559, 3563, 3567, 3571, 3575, 3579, 3583, 3587, 3591, 3595, 3599, 3603, 3607, 3611, 3620, 3624, 3628, 3632, 3636, 3637, 3642, 3646, 3653, 3660, 3661, 3662, 3663, 3664, 3665, 3669, 3673, 3681, 3692, 3712, 3732, 3753, 3774, 3795, 3829, 3830, 3831, 3832, 3833, 3840, 3847, 3848, 3852, 3853, 3857, 3858, 3862, 3866, 3873, 3877, 3884, 3885, 3886, 3890, 3891, 3894, 3918, 3937, 3959, 3960, 3964, 3965, 3969, 3970, 3974, 3975, 3979, 3980, 3984, 3992, 3993, 3994, 4026, 4038, 4046, 4059, 4071, 4085, 4097, 4107, 4132, 4153, 4154, 4155, 4159, 4160, 4164, 4165, 4166, 4185, 4193, 4201, 4209, 4217, 4225, 4237, 4249, 4250, 4251, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4273, 4281, 4285, 4299, 4312, 4331, 4347, 4365, 4381, 4401, 4446, 4454, 4458, 4473, 4489, 4490, 4494, 4495, 4499, 4500, 4504, 4505, 4509, 4510, 4514, 4515, 4518, 4524, 4525, 4528, 4532, 4540, 4545, 4551, 4552, 4556, 4561, 4568, 4569, 4573, 4583, 4593, 4601, 4610, 4623, 4635, 4642, 4650, 4658, 4666, 4674, 4684, 4685, 4689, 4690, 4693, 4705, 4706, 4709, 4720, 4731, 4745, 4746, 4751, 4752, 4753, 4756, 4757, 4758, 4759, 4762, 4763, 4766, 4767, 4770, 4790, 4803, 4825, 4826, 4829, 4835, 4841, 4858, 4867, 4889, 4903, 4920, 4936, 4937, 4938, 4950, 4964, 4981, 4995, 4996, 5008, 5029, 5040, 5054, 5063, 5075, 5076, 5079, 5080, 5083, 5084, 5087, 5091, 5095, 5099, 5103, 5107, 5111, 5115, 5119, 5123, 5127, 5131, 5135, 5139, 5143, 5147, 5153, 5154, 5158, 5159, 5160, 5167, 5170, 5171, 5183, 5199, 5215, 5216, 5224, 5225, 5229, 5230, 5234, 5235, 5239, 5240, 5244, 5245, 5255, 5267, 5268, 5281, 5289, 5307, 5316, 5328, 5331, 5335, 5339, 5343, 5350, 5362, 5373, 5376, 5380, 5393, 5403, 5413, 5423, 5433, 5443, 5453, 5463, 5473, 5483, 5493, 5503, 5513, 5532, 5544, 5545, 5546, 5547, 5551, 5552, 5556, 5557, 5567, 5576, 5589, 5590, 5594, 5598, 5606, 5610, 5614, 5621, 5625, 5630, 5635, 5642, 5649, 5654, 5664, 5677, 5693, 5694, 5699, 5700, 5704, 5705, 5715, 5725, 5734, 5752, 5773, 5794, 5816, 5850, 5866, 5867, 5871, 5880, 5895, 5905, 5918, 5919, 5931, 5940, 5958, 5983, 6001, 6016, 6017, 6021, 6022, 6026, 6027, 6031, 6032, 6036, 6050, 6054, 6055, 6059, 6060, 6061, 6062, 6063, 6073, 6085, 6086, 6097, 6120, 6153, 6154, 6155, 6159, 6161, 6183, 6185, 6187, 6189, 6191, 6196, 6197, 6201, 6202, 6206, 6218, 6219, 6223, 6232, 6236, 6240, 6245, 6255, 6256, 6260, 6261, 6265, 6266, 6270, 6271, 6275, 6276, 6277, 6281, 6285, 6286, 6287, 6291, 6292, 6297, 6298, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6346, 6357, 6372, 6374, 6379, 6384, 6386, 6391, 6402, 6403, 6404, 6405, 6416, 6436, 6448, 6461, 6472, 6483, 6495, 6504, 6512, 6520, 6530, 6540, 6550, 6560, 6570, 6581, 6591, 6604, 6607, 6608, 6611, 6615, 6622, 6623, 6624, 6625, 6626, 6627, 6630, 6633, 6634, 6642, 6649, 6650, 6653, 6655, 6666, 6678, 6690, 6702, 6714, 6743, 6744, 6760, 6776, 6777, 6781, 6794, 6804, 6813, 6823, 6833, 6834, 6837, 6838, 6841, 6842, 6843, 6848, 6859, 6869, 6882, 6883, 6887, 6896, 6909, 6920, 6934, 6945, 6968, 6979, 6998, 7009, 7020, 7031, 7042, 7053, 7064, 7075, 7086, 7097, 7108, 7119, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 7156, 7157, 7158, 7159, 7160, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7176, 7177, 7178, 7182, 7183, 7186, 7187, 7190, 7192, 7197, 7198, 7209, 7221, 7222, 7223, 7233, 7242, 7251, 7260, 7269, 7278, 7287, 7296, 7305, 7314, 7328, 7337, 7346, 7355, 7364, 7373, 7382, 7391, 7403, 7404, 7418, 7429, 7440, 7451, 7462, 7473, 7484, 7495, 7506, 7517, 7530, 7531, 7534, 7535, 7545, 7552, 7561, 7570, 7579, 7588, 7597, 7606, 7615, 7624, 7633, 7642, 7651, 7660, 7669, 7678, 7687, 7696, 7707, 7708, 7711, 7712, 7722, 7740, 7756, 7784, 7786, 7788, 7790, 7798, 7808, 7809, 7812, 7820, 7828, 7836, 7843, 7854, 7858, 7865, 7869, 7880, 7889, 7898, 7907, 7916, 7925, 7934, 7943, 7952, 7961, 7970, 7979, 7988, 7996, 8005, 8014, 8023, 8032, 8041, 8050, 8059, 8072, 8073, 8077, 8078, 8083, 8084, 8094, 8105, 8119, 8131, 8149, 8150, 8154, 8161, 8162, 8163, 8166, 8167, 8177, 8188, 8189, 8193, 8197, 8201, 8212, 8226, 8241, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8277, 8309, 8344, 8345, 8349, 8350, 8353, 8354, 8359, 8371, 8390, 8395, 8400, 8407, 8408, 8411, 8412, 8415, 8416, 8420, 8421, 8422, 8425, 8426, 8427, 8443, 8457, 8472, 8486, 8503, 8504, 8507, 8508, 8512, 8513, 8517, 8518, 8523, 8537, 8545, 8553, 8569, 8570, 8574, 8575, 8590, 8601, 8612, 8623, 8634, 8648, 8649, 8650, 8651, 8652, 8658, 8662, 8677, 8678, 8684, 8694, 8698, 8703, 8711, 8753, 8757, 8761, 8765, 8773, 8774, 8778, 8790, 8791, 8796, 8797, 8802, 8803, 8810, 8814, 8818, 8822, 8826, 8830, 8834, 8838, 8842, 8846, 8850, 8854, 8858, 8862, 8866, 8870, 8875, 8882, 8886, 8890, 8894, 8898, 8904, 8905, 8911, 8921, 8925, 8936, 8942, 8951, 8957, 8958, 8962, 8963, 8967, 8968, 8971, 8985, 8989, 9004, 9013, 9022, 9035, 9036, 9041, 9042, 9059, 9070, 9081, 9092, 9103, 9114, 9128, 9139, 9153, 9164, 9178, 9186, 9188, 9190, 9195, 9197, 9202, 9203, 9208, 9227, 9237, 9238, 9242, 9246, 9258, 9270, 9282, 9296, 9297, 9298, 9302, 9315, 9316, 9326, 9339, 9343, 9347, 9351, 9358, 9380, 9393, 9406, 9421, 9422, 9425, 9426, 9429, 9430, 9440, 9450, 9468, 9478, 9488, 9498, 9508, 9518, 9528, 9538, 9548, 9558, 9568, 9578, 9588, 9599, 9610, 9620, 9630, 9640, 9650, 9660, 9670, 9681, 9692, 9703, 9714, 9725, 9736, 9747, 9758, 9769, 9780, 9791, 9802, 9814, 9826, 9838, 9850, 9862, 9874, 9885, 9896, 9908, 9920, 9931, 9942, 9951, 9961, 9971, 9981, 9991, 10001, 10011, 10021, 10031, 10041, 10056, 10057, 10060, 10061, 10071, 10081, 10091, 10101, 10112, 10122, 10134, 10135, 10145, 10155, 10165, 10175, 10185, 10195, 10205, 10215, 10225, 10235, 10245, 10255, 10265, 10275, 10285, 10295, 10305, 10315, 10325, 10335, 10345, 10355, 10365, 10375, 10385, 10395, 10405, 10424, 10434, 10435, 10438, 10440, 10442, 10448, 10449, 10450, 10451, 10452, 10464, 10480, 10489, 10498, 10507, 10516, 10525, 10534, 10543, 10552, 10561, 10570, 10579, 10588, 10597, 10606, 10615, 10624, 10633, 10642, 10651, 10660, 10669, 10678, 10687, 10715, 10723, 10732, 10758, 10767, 10774, 10780, 10807, 10818, 10827, 10835, 10837, 10859, 10867, 10877, 10887, 10906, 10925, 10935, 10945, 10955, 10966, 10977, 10988, 10999, 11010, 11028, 11037, 11054, 11072, 11073, 11074, 11079, 11085, 11094, 11095, 11096, 11097, 11098, 11102, 11103, 11106, 11107, 11108, 11109, 11113, 11114, 11115, 11127, 11138, 11139, 11142, 11152, 11159, 11179, 11189, 11198, 11208, 11218, 11227, 11236, 11245, 11254, 11263, 11272, 11281, 11293, 11302, 11314, 11315, 11316, 11320, 11323, 11326, 11329, 11332, 11339, 11341, 11343, 11348, 11350, 11354, 11355, 11356, 11368, 11382, 11396, 11415, 11437, 11438, 11439, 11440, 11450, 11467, 11478, 11479, 11483, 11484, 11488, 11492, 11496, 11514, 11515, 11516, 11517, 11518, 11519, 11520, 11527, 11528, 11539, 11547, 11555, 11564, 11574, 11592, 11601, 11610, 11619, 11631, 11635, 11646, 11658, 11676, 11683, 11700, 11714, 11724, 11733, 11742, 11752, 11764, 11776, 11787, 11788, 11799, 11810, 11822, 11834, 11846, 11858, 11868, 11881, 11882, 11896, 11920, 11929, 11939, 11951, 11963, 11977, 11978, 11990, 12011, 12022, 12034, 12046, 12050, 12057, 12058, 12062, 12069, 12070, 12071, 12075, 12076, 12077, 12081, 12082, 12086, 12087, 12090, 12091, 12094, 12095, 12099, 12100, 12104, 12111, 12113, 12118, 12119, 12132, 12140, 12151, 12159, 12170, 12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12189, 12200, 12201, 12205, 12206, 12207, 12208, 12209, 12219, 12227, 12245, 12265, 12266, 12276, 12285, 12294, 12303, 12322, 12333, 12354, 12358, 12366, 12372, 12379, 12385, 12392, 12401, 12402, 12406, 12408, 12413, 12424, 12434, 12444, 12450, 12459, 12468, 12474, 12483, 12489, 12490, 12494, 12495, 12499, 12511, 12512, 12523, 12538, 12539, 12550, 12561, 12562, 12565, 12566, 12567, 12568, 12569, 12570, 12571, 12572, 12575, 12576, 12580, 12581, 12582, 12593, 12610, 12625, 12626, 12630, 12635, 12659, 12670, 12671, 12683, 12703, 12704, 12714, 12721, 12728, 12735, 12745, 12758, 12759, 12763, 12764, 12768, 12769, 12773, 12786, 12799, 12808, 12817, 12826, 12835, 12847, 12859, 12871, 12874, 12875, 12876, 12877, 12878, 12879, 12882, 12883, 12884, 12932, 12933, 12937, 12938, 12953, 12954, 12961, 12969, 12977, 12985, 12993, 13001, 13012, 13013, 13045, 13061, 13078, 13079, 13098, 13102, 13106, 13121, 13128, 13135, 13145, 13146, 13149, 13165, 13166, 13167, 13171, 13181, 13192, 13198, 13210, 13223, 13229, 13230, 13234, 13246, 13254, 13259, 13264, 13269, 13274, 13282, 13290, 13295, 13300, 13307, 13308, 13312, 13313, 13314, 13321, 13322, 13326, 13327, 13331, 13332, 13336, 13337, 13341, 13345, 13346, 13349, 13358, 13371, 13377, 13383, 13387, 13402, 13403, 13407, 13419, 13435, 13447, 13459, 13471, 13486, 13489, 13494, 13495, 13503, 13523, 13524, 13526, 13531, 13532, 13536, 13537, 13540, 13541, 13566, 13575, 13585, 13586, 13590, 13591, 13592, 13593, 13594, 13598, 13611, 13618, 13625, 13632, 13633, 13637, 13638, 13642, 13643, 13647, 13648, 13652, 13664, 13665, 13666, 13667, 13671, 13672, 13682, 13689, 13708, 13709, 13713, 13714, 13720, 13725, 13734, 13742, 13751, 13758, 13766, 13775, 13784, 13788, 13793, 13800, 13829, 13833, 13847, 13868, 13890, 13903, 13920, 13926, 13931, 13937, 13944, 13945, 13955, 13961, 13969, 13973, 13977, 13984, 13992, 13997, 13998, 13999, 14000, 14004, 14005, 14020, 14024, 14032, 14039, 14046, 14053, 14060, 14071, 14072, 14085, 14089, 14097, 14111, 14125, 14126, 14141, 14152, 14165, 14170, 14171, 14174, 14175, 14178, 14179, 14184, 14185, 14190, 14191, 14200, 14205, 14206, 14210, 14214, 14220, 14245, 14256, 14270, 14271, 14275, 14289, 14346, 14360, 14362, 14367, 14376, 14378, 14380, 14382, 14387, 14389, 14394, 14402, 14413, 14441, 14442, 14446, 14448, 14453, 14462, 14482, 14502, 14520, 14532, 14547, 14548, 14552, 14555, 14568, 14573, 14580, 14585, 14591, 14596, 14605, 14607, 14610, 14614, 14615, 14616, 14617, 14618, 14619, 14624, 14630, 14645, 14646, 14647, 14648, 14649, 14660, 14666, 14674, 14675, 14681, 14686, 14691, 14696, 14701, 14706, 14711, 14716, 14722, 14728, 14734, 14741, 14763, 14772, 14776, 14784, 14788, 14796, 14808, 14829, 14833, 14839, 14843, 14856, 14864, 14874, 14876, 14878, 14880, 14882, 14884, 14889, 14890, 14897, 14906, 14914, 14923, 14934, 14942, 14943, 14944, 14948, 14950, 14952, 14954, 14956, 14958, 14960, 14965, 14970, 14976, 14984, 14989, 14996, 15003, 15007, 15011, 15019, 15054, 15055, 15057, 15066, 15073, 15089, 15091, 15093, 15095, 15097, 15099, 15101, 15103, 15105, 15107, 15109, 15111, 15113, 15115, 15118, 15120, 15123, 15125, 15127, 15129, 15132, 15137, 15146, 15151, 15160, 15165, 15174, 15179, 15189, 15198, 15207, 15216, 15235, 15244, 15253, 15262, 15271, 15288, 15297, 15306, 15315, 15324, 15333, 15342, 15346, 15350, 15358, 15366, 15374, 15382, 15395, 15404, 15418, 15427, 15439, 15446, 15462, 15467, 15473, 15480, 15487, 15495, 15503, 15520, 15539, 15565, 15567, 15569, 15571, 15573, 15575, 15577, 15579, 15581, 15583, 15585, 15587, 15589, 15591, 15593, 15595, 15597, 15599, 15601, 15605, 15609, 15614, 15630, 15631, 15632, 15649, 15662, 15664, 15666, 15678, 15703, 15715, 15727, 15735, 15746, 15757, 15767, 15773, 15782, 15792, 15802, 15815, 15825, 15856, 15892, 15902, 15913, 15914, 15915, 15922, 15929, 15933, 15937, 15941, 15945, 15949, 15953, 15957, 15961, 15965, 15969, 15973, 15977, 15984, 15988, 15992, 15996, 15998, 16005, 16012, 16019, 16026, 16037, 16051, 16061, 16072, 16088, 16098, 16105, 16112, 16119, 16123, 16131, 16140, 16149, 16153, 16157, 16161, 16165, 16169, 16178, 16182, 16192, 16196, 16200, 16205, 16216, 16222, 16236, 16247, 16261, 16277, 16289, 16299, 16308, 16317, 16325, 16347, 16363, 16387, 16389, 16393, 16395, 16397, 16400, 16403, 16406, 16407, 16410, 16418, 16428, 16429, 16432, 16433, 16434, 16437, 16438, 16439, 16444, 16448, 16452, 16456, 16463, 16464, 16472, 16473, 16477, 16478, 16486, 16487, 16491, 16492, 16497, 16506, 16508, 16523, 16526, 16554, 16555, 16558, 16559, 16567, 16575, 16583, 16592, 16602, 16620, 16666, 16675, 16684, 16693, 16702, 16714, 16715, 16716, 16717, 16718, 16732, 16733, 16734, 16737, 16738, 16741, 16744, 16745, 16746, 16749, 16750, 16753, 16754, 16755, 16756, 16757, 16758, 16759, 16760, 16761, 16762, 16763, 16764, 16767, 16769, 16774, 16776, 16781, 16783, 16785, 16787, 16789, 16791, 16803, 16807, 16814, 16818, 16824, 16828, 16838, 16850, 16851, 16854, 16855, 16858, 16862, 16866, 16872, 16873, 16878, 16888, 16889, 16890, 16891, 16892, 16893, 16894, 16895, 16899, 16900, 16901, 16902, 16907, 16912, 16921, 16942, 16946, 16951, 16962, 16979, 16985, 16986, 16987, 16997, 17012, 17013, 17017, 17029, 17030, 17033, 17034, 17037, 17041, 17048, 17052, 17056, 17065, 17077, 17078, 17082, 17083, 17087, 17088, 17091, 17092, 17097, 17098, 17102, 17103, 17107, 17119, 17120, 17121, 17122, 17123, 17124, 17125, 17126, 17127, 17131, 17133, 17138, 17139, 17140, 17141, 17142, 17143, 17144, 17146, 17150, 17152, 17154, 17157, 17161, 17164, 17168, 17177, 17195, 17202, 17207, 17213, 17214, 17215, 17216, 17217, 17221, 17230, 17244, 17245, 17246, 17247, 17248, 17257, 17258, 17259, 17260, 17261, 17265, 17267, 17277, 17280, 17286, 17287, 17288, 17292, 17293, 17294, 17298, 17299, 17303, 17321, 17341, 17342, 17351, 17352, 17356, 17357, 17360, 17368, 17376, 17384, 17407, 17408, 17419, 17423, 17429, 17431, 17436, 17438, 17440, 17450, 17452, 17463, 17467, 17471, 17475, 17479, 17488, 17496, 17528, 17532, 17539, 17547, 17551, 17555, 17561, 17562, 17564, 17565, 17566, 17570, 17611, 17639, 17643, 17647, 17653, 17655, 17669, 17706, 17719, 17720, 17723, 17724, 17741, 17742, 17743, 17748, 17749, 17750, 17755, 17756, 17757, 17758, 17764, 17765, 17766, 17767, 17768, 17774, 17775, 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, 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, 17990, 17991, 17992, 17993, 17994, 17995, 17996, 17997, 17998, 17999, 18000, 18001, 18002, 18003, 18004, 18005, 18006, 18007, 18008, 18009, 18010, 18011, 18012, 18013, 18014, 18015, 18016, 18017, 18018, 18019, 18020, 18021, 18022, 18023, 18024, 18025, 18026, 18027, 18028, 18029, 18030, 18031, 18032, 18033, 18034, 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, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120, 18121, 18122, 18123, 18124, 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, 18214, 18215, 18216, 18217, 18218, 18219, 18220, 18221, 18222, 18223, 18224, 18225, 18226, 18227, 18228, 18229, 18230, 18231, 18232, 18233, 18234, 18235, 18236, 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, 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, 18593, 18594, 18595, 18596, 18597, 18598, 18599, 18600, 18601, 18602, 18603, 18604, 18605, 18606, 18607, 18608, 18609, 18610, 18611, 18612, 18613, 18614, 18615, 18616, 18617, 18618, 18619, 18620, 18621, 18622, 18623, 18624, 18625, 18626, 18627, 18628, 18629, 18630, 18631, 18632, 18633, 18634, 18635, 18636, 18637, 18638, 18639, 18640, 18641, 18642, 18643, 18644, 18645, 18646, 18647, 18648, 18649, 18650, 18651, 18652, 18653, 18654, 18655, 18656, 18657, 18658, 18659, 18660, 18661, 18662, 18663, 18664, 18665, 18666, 18667, 18668, 18669, 18670, 18671, 18672, 18673, 18674, 18675, 18676, 18677, 18678, 18679, 18680, 18681, 18682, 18683, 18684, 18685, 18686, 18687, 18688, 18689, 18690, 18691, 18692, 18693, 18694, 18695, 18696, 18697, 18698, 18699, 18700, 18701, 18702, 18703, 18704, 18705, 18706, 18707, 18708, 18709, 18710, 18711, 18712, 18713, 18714, 18715, 18716, 18717, 18718, 18719, 18720, 18721, 18722, 18723, 18724, 18725, 18726, 18727, 18728, 18729, 18730, 18731, 18732, 18733, 18734, 18735, 18736, 18737, 18738, 18739, 18740, 18741, 18742, 18743, 18744, 18745, 18746, 18747, 18748, 18749, 18750, 18751, 18752, 18753, 18754, 18755, 18756, 18757, 18758, 18759, 18760, 18761, 18762, 18763, 18764, 18765, 18766, 18767, 18768, 18769, 18770, 18771, 18772, 18773, 18774, 18775, 18776, 18777, 18778, 18779, 18780, 18781, 18782, 18783, 18784, 18785, 18786, 18787, 18788, 18789, 18790 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if YYDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "\"end of file\"", "error", "\"invalid token\"", "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", "ENFORCED", "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", "OBJECTS_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", "PERIOD", "PLACING", "PLAN", "PLANS", "POLICY", "POSITION", "PRECEDING", "PRECISION", "PRESERVE", "PREPARE", "PREPARED", "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PROCEDURES", "PROGRAM", "PUBLICATION", "QUOTE", "QUOTES", "RANGE", "READ", "REAL", "REASSIGN", "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", "VIRTUAL", "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", "opt_virtual_or_stored", "ConstraintAttr", "TableLikeClause", "TableLikeOptionList", "TableLikeOption", "TableConstraint", "ConstraintElem", "DomainConstraint", "DomainConstraintElem", "opt_no_inherit", "opt_without_overlaps", "opt_column_list", "columnList", "optionalPeriodName", "opt_column_and_period_list", "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", "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", "returning_with_clause", "returning_options", "returning_option", "returning_option_kind", "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", "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 }; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } #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_int16 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, 777, 778, 779, 60, 62, 61, 43, 45, 42, 47, 37, 94, 780, 91, 93, 40, 41, 46, 59, 44, 58 }; #endif #define YYPACT_NINF (-5961) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-3020) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const int yypact[] = { 9621, 1419, 21353, -5961, -5961, 1419, 72864, -5961, 82592, 684, 231, 1502, 225, 20961, 83104, 94368, 285, 1173, 13027, 1419, 94368, 2303, 63135, 78496, 358, 94368, 1195, 1081, 63135, 94368, 94880, 95392, 1277, 1719, 1534, 95904, 83616, 77472, 1688, 94368, 1796, 458, 96416, 84128, 1628, 84640, 1081, 58026, 162, 1552, 96928, 94368,122444, 458, 85152, 85152, 85152, 2128, 2175, 1875, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 1499, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 1669, -5961, 1094, 2415, 1880, 1072, 1727, -5961, -5961, 2419, 72864, 94368, 94368, 94368, 2162, 94368, 1775, 94368, 923, 72864, 69280, 85664, 2246, 2066, 53814, 97440, -5961, 72864, 94368, 66720, 72864, 94368, 94368, 97952, 94368, 98464, 94368, 1511, 81056, 94368, 2164, 94368, 94368, 67232, 98976, 2332, 1410, 266, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 2059, 1944, -5961, 318, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 63647, 94368, 21171, 1195, 2419, -5961, 2128, 94368, 2362, 94368, 2138, 99488, 94368, -5961, 94368, 2185,100000, 934, 1279, 69280, 1597, 54345, 2281, 94368, 94368, 69280,100512,101024,101536, 94368, 94368, -5961, -5961, 2272, 94368, -5961, 2422, 69792, 110, 2441, 2603, 2508, 1358, -5961, 86176, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 72352, 1173, -5961, -5961, 2449, 73376, 2532, -5961, -5961,102048,122942, 2366, -5961, 946, 73888, 70304, 2737, 2361, 54876, 2776, -5961, 74400, -5961, 70816, 74912, -5961, -5961, -5961, -5961, -5961,102560, -5961,103072, 2467, 2532, -5961,123440, 71328, -5961, 2634,103584, 104096,104608, 2419, 2337, 2004, 2357, 48074, -5961, -5961, -5961, 2416, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 1132, -5961, 312, 2148, 280, 261, 317, -5961, -5961, 270, 273, 274, 312, 2893, 2893, -5961, 94368, -5961, -5961, 2148, 78, 2486, 2393, 2393, 2393, 2650, 43, -5961, 2393, 2574, -5961, -5961, -5961, -5961, 84640, -5961, 2407, 1195, 254, 86688, 72352, 1195, 2923,105120, 87200, 2483, 2589, 2698, -5961, -5961, 898, -5961, 1195, 2494, 2981, 2581, 63647, 1383, 94368, -5961, -5961, 2997, 2566, 2865, 2610, -5961, -5961, 2789, 2849, 184, 941, 1195, 372, -5961, 3002, -5961, 2890, 32830, 32830, 87712,105632, 88224, 3148, 1491, -5961, -5961, -5961, 3174, 2712, 3006, 2610, 1410, 50146, -5961, -5961, 2707, 1944, 84640, -5961, -5961, -5961, 63647, 3066, 36010, 94368, 2709, -5961, 2711, 2709, -5961, -5961, 2779, -5961, 2779, 2779, 2729, 2729, 2925, 2746, -5961, -5961, -5961, -5961, 2616, 2779, 2729, -5961,124436, -5961, 2014, 2019, -5961, -5961, 3247, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 2750, -5961, 1283, -5961, 2043, -5961, -5961, -5961, 32830, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 2751, 2753, 1880, -5961, 12196, 63647, 84640, 1528, 1528, 3229, 1528, 298, 2046, -5961, 2815, -5961, 3114, 3070, 3071, 84640, 2758, 356, -5961, 849, 2759, 2017, 2760, 1919, 2007, -5961, 283, 94368, 294, 2800, 88736, 4905, 2765, 1944, 2766, -5961, -5961, -5961, -5961, 2935, 448, -5961, -5961, -5961, -5961, 3103, 3157, 7954, 382, 89248, -5961, -5961, -5961, -5961, 94368, 94368, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 2780, 174, -5961, -5961, 2782, 3158, 3008, 5588, 1253, 3117, 2954, 1807, 8047, 3014, 1256, 3168, 8884, 1464, 3169, 1936, 1639, 86688, 94368, 3126, 3171, 2784, 1909, 1106, 3021, 1531, 3117, 3160, 2966, 1807, 3178, 7085, 94368, -5961, 3085, 3220, 786, -5961, 204, -5961, 25465, 36010, 57514, -5961, 1944, -5961, 2064, -5961, -5961, 62623, -5961, 2869, 3036, 1002, 72864, 2812, 94368, 94368, -5961,122444, 72864, -5961, 3048, 55407, 72864, -5961, 72864, -5961, -5961, 3184, 122444, 94368, 94368, -5961, 94368, -5961, -5961, 2819, -5961, -5961, -5961, -5961, -5961, 2393, 94368, 3286,122444, 3067, 165, 1902, 3321, 94368, 3068, 1902, 2864,106144, -5961, -5961, 1902, -5961, -5961, -5961, 94368, 94368, 2826, 1403, 3054, 238, 1902, 3073, 3319, 3326, 3076, 2916, 3083, 2711, -5961, 3289, 3051, 1126, 240, 2269, 1902, 2892,106656,107168, 94368, 2895, 94368, 3296, 72864, 2930, 72864, 72864, 94368, 3215, 94368, -5961, 3038, -5961, -5961, 1345, -5961, -5961, -5961, -5961, -5961, 3232, -5961, 223, 3235, 2855, 3237, 1922, 3239, 243, -5961, -5961, 2902, -5961, 3243, 373, -5961, 3244, -5961, 2863,107680, -5961,108192,108704, 3250, 377, -5961, 69280, 3252, 373, 3257, 2863, 3258, 373, 3259, 314, 3260, -5961, 1176, 3233, 3261, 243, 3262, 2308, 2863, -5961, 3266, 415, -5961, 3267, 570, -5961, 3268, 3118, -5961, 36010, -5961, 2991, -5961, 1552, 2086, 2357, 3206, 84640, 2148, -5961, 94368, 2148, 94368, 2148, 94368, 2148, 94368, 2148, 94368, 94368, 94368, 2148, -5961, -5961, -5961, 94368, 2896, 94368, -5961, 94368, -5961, -5961, -5961, 79520, 69280, 80032, -5961, 94368, -5961, 468, 1195, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 71840, 3305, -5961, 1715, -5961, 2610, 379, 1195, 427, 3331, 61087, 61599, 94368, -5961,122444, 3398, 69280, 3296, 2097, -5961, -5961, 3296, -5961, -5961, 3296, 3296, -5961, -5961, -5961, 3185, 3269, 79520, 69280, 3270, -5961,109216, -5961, 72352, 3130, 2906, -5961, -5961, -5961, -5961, -5961, 2069, 3438, 297, 3439, 36010, 2909, 297, 297, 2911, 3278, -5961, -5961, -5961, 321, 2914, 2915, -5961, 301, 301, -5961, 2917, 2918, -5961, 319, 2919, 2921, 3454, 3455, 329, 332, 2927, 2928, 2929, 2931, 2933, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2616, 297, 2944, 36010, -5961, 2947, 301, 2949, 2952, 2956, 3456, 2957, -5961, 3466, 2965, -5961, 342, 353, 2969, 2974, -5961, 3203, -5961, 336, 2975, 2976, 2978, 2979, 2982, 2984, 2986, 2988, 36010, 36010, 36010, -5961, 30175, 1944, 1195, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 338, -5961, 52221, -5961, 3023, -5961, -5961, 3204, -5961, -5961, 36010, -5961, -5961, 3360, 810, -5961, 341, -5961, -5961, -5961, 1944, 3307, 2992, -5961, 1728, 2993, -5961, 2379, -5961, 3494, -5961, 3305, 204, -5961, -5961, 3290, -5961, 94368, -5961, -5961, 1944, 411, 2102, -5961, 2416, 20296, 2107, 2709, 94368, 94368, 3501, -5961, 3007, -5961, -5961, 36010, -5961, -5961, -5961, 2893, -5961, 2779, 2779, -5961, -5961, 3506, 3098, 3100, 2893, -5961, 2893, -5961, 3016, 3017, 2893, 3109, 3113, 3115, -5961, 3012, 3116, 2893, -5961, -5961, 64672, 2120, -5961, 3385, 385, -5961, -5961, -5961, 2115, -5961, 3028, -5961, 2711, -5961, -5961, 1880, 1880, 36010, 1880, 324, 1596, 33360, 36540, 3400, 3271, 328, 1637, 3402, -5961, 3274, 298, 2046, 84640, 94368, 84640,109728, -5961, 36010, -5961, 3507, 3131, 3132, 3192, 60074, -5961, 3135, 3101, 3141, 3200, 3053, 3145, 3147, 3207, -5961, 3343, -5961, -5961, 3150, 3227, 3522, 3153,110240, -5961, -5961, 1259, -5961, -5961, -5961, 1259, -5961, 3078, 1695, 345, 337, 3159, 568, 1452, 3514, -5961, 1465, -5961, -5961, 3216, -5961, 13401, 94368, 3451, 8086, 3300, 382, 3217, -5961, -5961, -5961, 3362, 3165, 94368, 3166, 3322, 382, 362,110752, -5961, -5961, 94368, -5961, -5961, -5961, -5961, 5534, 3489, 28647, -5961, 2056, 3176, 3155, 3179, 94368, 75936, 446, 3292, 3316, 1795, 453, 706, 3245, 94368, 1882, 3325, 94368, 3093, 3187, 3189, 3445, 3097, 584, 3552, 3104, -5961, -5961, -5961, 3520, -5961, 2225, 2462, 3323, -5961, 3444, 3492, 9266, 3177, 3180,120452, -5961, 3208, 709, 55938, 94368, 94368, 3209, 3210,111264, 5534, 3527, 80544, 80544, 3211, 3213, 49628, 3542, 1985, 3214, -5961, -5961, -5961, 1985, 3222, 3223,111776, 5534, 3537, 94368, 3225, 3228, 94368,124436, 382, -5961, 3607, -5961, 382, 382, 1965, 3610, 3230, 398, 3399, 723, 1902, -5961, 3104, 3447, -5961, 3231, 3238, 1042, -5961, 3368, 94368, 3241, 3242, 132, 3329, 1195, -5961, 3330, -5961, 3246, 3332, 3249, 1147, 2826, -5961, -5961, 3254, 84640, 3357, 3365, 1882, 300, 747, 3104, -5961, 3253, 3255, 3097, 3097, 94368, 94368, 94368, 94368, 94368, 316, 3652, 326, 3256, 275, 750, 3167, -5961, 1985, 67744, 3263, -5961, 1985, 94368, 376, 841, 3104, 1865, 1983, -5961, -5961, -5961, 1410, -5961, 36010, 36010, 36010, 3163, -5961, 2688, 20296, 109, -5961, 346, 10449, 3172, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 94368, 63647, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 94368, -5961, 94368, 3482,122444, 3484, 3403, 3491, 3498, 382, 94368, 94368, 3500, 3502, 3503,122444, 3505, 3508, 3509, 3407, 3277, 192, 3273, 3198, 3699, 3580, 94368, 64672, -5961, 1259, -5961,122444, 3429, 3583, -5961, 94368, 3449, 80, -5961, 3624, 3272, -5961, -5961, 113, 94368, 79008, 2826, -5961, -5961, 3589, 69280, 1032, 3590, 1195, 3265, 3593, 3442, 1195, 69280, 3493, 94368, 94368, 94368, 94368, 183, -5961, 67744, 3461, -5961, 94368, 3462, 3447, 3463, 3720, 895, 2393, 112288, 3596, -5961,112800, 3251, 94368, 3279, 3279, 3731,122444, 1620, 3526, -5961, -5961, 2129, -5961, 3378, -5961, 72864, -5961, -5961, 72864, -5961, -5961,122444, 94368, 3282,122444,122444, -5961, -5961, 72864, 72864, -5961, 69280, 69280, 3616, 415, 3617, 3302, 3623, 3308, 55938, 55938, -5961, 574, 72864, -5961, 69280, 72864, -5961, 94368, -5961, 94368, -5961, -5961, -5961, -5961,122444,122444, -5961, 69280, 67744, 3625, 94368, 94368, -5961, 94368, 94368, -5961, 94368, 94368, 2153,113312, 2357, -5961, 94368, 3380, 94368, -5961, 94368, -5961, 94368, -5961, 94368, -5961, 94368, -5961, -5961, -5961, 94368, -5961, 94368, 2168, -5961, -5961, 2186, 1608, 94368, 94368, 265, 72864, 94368, 3485, 94368, 72864, 72864, 94368, 94368, 94368, 94368, 94368, 3340, 2993, 169, -5961, 331, 335, 84640, 3495, -5961, -5961, -5961, 1195, -5961, -5961, -5961, -5961, -5961, 347, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 3281, -5961, -5961, -5961, -5961, 3281, -5961, -5961, 2194, 2128, 1422, 94368, -5961, 94368, 94368, 94368, -5961, 78496, 3608, 175, 80032, 94368, -5961, -5961, 16013, 36010, 1944, 32295, -5961, -5961, 20296, 3301, 36010, 36010, 3283, 2893, 2893, -5961, 1258, 36010, 36010, 36010, 29645, 36010, 36010, 33890, 36010, 36010, 36010, 36010, 36010, 36010, 2893, 2893, 3285, 36010, 7649, 36010, 55938, 36010, 41840, 26537, 36010, 36010, 30705, 1664, 2917, 36010, 3513, 42894, 36010, 427, 3516, 36010, 427, 7649, 3781, 3781, 2091, 8343, 3284, 1944, -5961, 2893, 948, -5961, 499,122444, 36010, 36010, 36010, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 36010, -5961, 64672, -5961, -5961, -5961, -5961, -5961, -5961, 173, -5961, -5961, -5961, -5961, -5961, -5961, 5590, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 94368, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 31235, -5961, -5961, -5961, -5961, 3291, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 2106, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 31765, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 3294, -5961, -5961, 36010, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 3346, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 1409, 36010, 36010, 36010, 36010, 36010, 36010, 36010, 36010, 36010, -5961, 36010, 519, -5961, -5961, 3611, 3360, 722, 498, 3295, 3476, 89760, 32830, 3385, 25465, -5961, 263, 3385, -5961, -5961, -5961, 94368, 3494, 3352, -5961, 3288, 3609, 3620, 314, 84640, 2700, 36010, 173, 258, 94368, 36010, 3291, 2106, 36010, 3294, 36010, 3346, -5961, 36010, -5961, 2202, 2145, 36010, 2203, 3299, -5961, -5961, 3303, 3017, 3310, 3313, 3304, 3306, 2893, 260, 3309, 1414, 195, 3434, 2893, 3559, 3318, -5961, 64672, -5961, 44966, 3348, -5961, -5961, -5961, 458, 84640, 84640, -5961, 3622, -5961, 3317, -5961, 11642, 3622, -5961, -5961, 42367, 3452, 3600, 3549, -5961, -5961, -5961, 3324, 20296, 37070, 37070, -5961, 2370, 20296, 2482, -5961, -5961, -5961, -5961, -5961, -5961, 1487, -5961, 94368, 1257, 3400, 1637, 3387, -5961, 3816, 3388, 94368, -5961, 2204, -5961, 69280, 94368, 94368, 3544, -5961, 3805, -5961,124436, -5961, 3333, -5961,123938, 119456, -5961, -5961, 1108, -5961, 669, 69280, -5961, 94368, 94368, 69280, 94368, 94368, -5961, 69280, 86688, 3382, 94368, 94368, -5961, -5961, -5961, -5961, -5961, 62111, 1517, 78496, 3477, 77984, -5961, -5961, 3335, 94368, 3575, -5961, -5961,113824, -5961, 3576, 69280, 94368, 94368, 36010, 3578, 94368, 94368, -5961, 677, 3431, 3432, -5961, 94368, 3433, 72864, 3341,122444, 72864, 56469, 72864, 72864, 3711,122444, 94368, 94368, 1536, 84640, 445, 951, 3104, 3588, -5961, 1003, -5961, 69280, -5961, 94368, 3577, -5961, -5961, -5961, 90272, -5961, -5961, -5961,114336, -5961, -5961, 3579, -5961, 2226, -5961, 69280, 69280, 94368, 9318, 3351,114848, 94368, 30, 3649, 3598, 3594, 3662, 782, -5961, -5961, -5961,122444, -5961, 94368, 90784, 94368, 94368, 3641, 94368, 81568,115360,115872, 1599, 1770, 3653, 94368, 82080, 3654, -5961, 3521, 94368, -5961, -5961, 65184, 69280, 94368, 937, 64672, -5961, 3633, -5961, 94368, -5961, 996, -5961, 94368, 4915, 3599, -5961, -5961, 3459, 3471, 94368, 515, 1014, 3104, 3784, 94368, 94368, 3372, 2230, 69280, 94368, 64672, -5961, 3605, 1381, 69280, 94368, 90272, -5961, 3606, -5961, 84640, 3716, -5961, 3379, 2393, 2707, 2036, 3379, 69280, 94368, -5961, 3379, 94368,105632, -5961, 69280, 1098, -5961, 69280, 94368, 90272, -5961, 3612, 3550, 69280, 94368, 13665, -5961, -5961, -5961, 382, -5961, -5961, -5961, -5961, -5961, 94368, 94368, 382, 94368, 94368, 382, 1900, -5961, 69280, 94368, -5961, -5961, -5961, 3517, 69280, 94368, 94368, 393, 94368, -5961, 94368, 69280, 3430, 94368, 94368, -5961, -5961, 94368, 7441, 94368, 94368, 94368, 94368, 94368, 94368, 69280, 94368, -5961, -5961, 1723, 1427, 153, 1813, 1592, 94368, 3727, 94368,116384, 1195, 69280, 94368, 94368, 1195, 94368, 64672, 2141, -5961, -5961, 3525, -5961, 69280, 1098, -5961, 9805, 94368, 94368, 94368, 3478, 3479, 287, 3571, -5961, -5961, -5961, 1018, 1018, 3614, -5961, 36010, 36010, 34420, 3393, -5961, -5961, 36010, 2869, -5961, -5961, -5961, 1097, 3894, 1097,116896, 1097, 1097, 3708, 3464, 3465, 1097, 1097, 1097, 3692, 1097, 1097, 1097, 94368, 3584, -5961, -5961, 3584, 926, 36010,122444, 94368, -5961, 2232, -5961, 3413, -5961, -5961, 64672, 94368, 248, 903, 3783, 3638, 76448, 2070, 3774, 94368, 3467, 94368, 3909, 3511, 1525, -5961, 2070, 94368, -5961, 1551, 78496, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 94368, -5961, -5961, 3776, 94368, 45484, 3597, -5961, 1195, 2826, 2826, 2826, 2826, 3417, 2826, 94368, 3554, 3798, 2070, 3420, 3800, -5961, 3447, 3801, 1308, 94368, 3656, 76448, 3488, 3469, 3671, 3928, 2393, 1195, 3674, 3658, -5961, 60575, -5961, 2826, 3943, 29146, 8066, 10438, 3661, 3728, -5961, -5961, 3672, 1127, 94368, 3782, 3785, 3807, -5961, 223, -5961, 3939, 1922, 3809, 243, -5961, 373, -5961, 2863, -5961, 94368, -5961, 94368, 94368, 94368, 94368, 377, -5961, -5961, 373, 2863, 373, 314, -5961, 3736, 243, 2863, 3582, 3817, 415, -5961, 570, -5961, 3680, 314, -5961, 3698, 2393, -5961, 1243, 50664, -5961, -5961, -5961, -5961, -5961, -5961, 2236, -5961, 94368, -5961, 3790, 3791, 3792, 3793, 3797, 3468, 3470, 3504, 94368, 3472, 3468, 382, 3473, 3480, -5961, 3472, 3472, 3468, 2993, 2993, 3468, 3470, 68256, 3941, 64672, -5961, -5961, 3556, 3475, 3825, 227, -5961, 257, 117, 3732, -5961, -5961, -5961, -5961, 2893, 948, 62623, -5961,122444, -5961, 69280, 3524, -5961, -5961, -5961, 3697, 3474, 68256, 314, 189, -5961, 72864, 94368,122444, 72864, 3706, 72864, 72864,122444, 94368, 94368, 2247, -5961, -5, -5961, 1778, 36010, 534, -5961, 17692, 2264, 36010, 3483, 3486, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 3490, 3832, -5961, 2276, 2291, 17742, 2177,122444, 2356, 3512, -5961, 3496, 256, 3700, 3497, 6414, 3541, 2293, 3499, 348, -5961, 6414, 1118, 3519, 8590, 3646, 3523, 2301, 3515, 3529, -5961, 6553, 7159, 3531, 17780, 3538, 3532, 3540, 3545, 41840, 41840, 30175, 769, -5961, 41840, 3546, 3704, 2305, 12553, 3547, 3548, 17843, 34950, 36010, 34950, 34950, 18161, 3539, 3551, -5961, 3895, -5961, 2311, 64672, 3703, 18450, 2315, -5961, 36010, 64672, 7408, 36010, -5961, 36010, 3553, -5961, -5961, 2781, 2781, 2781, 7649, -5961, -5961, 3567, -5961, 41840, 41840, -5961, 3320, 30175, -5961, 3851, -5961, -5961, 292, -5961, -5961, -5961, -5961, -5961, 2761, -5961, -5961, -5961, 3739, 2177, 3369, 55938, 20431, 36010, 272, 36010, 3557, 36010, 3587, 2781, 2781, 2781, 399, 399, 363, 363, 363, 494, 498, -5961, -5961, -5961, 3558, 3560, 3476, 3561, 36010, -5961, 3564, 51182, -5961, 2335, 2343, 94368, 4260, 6518, 6819, -5961, -5961, -5961, 3348, 109, 3348, -5961, 1410, -5961, -5961, -5961, -5961, -5961, -5961, 84640, 20296, -5961, -5961, 3765, 3562, 2317, -5961, -5961, 2893, -5961, -5961, 2374, 2374, 3565, -5961, 3566, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 3555, -5961, -5961, -5961, 3568, 3569, 46002, 3861, 3570, 44448, 91296, 3563, 2728, -5961, 91296, 91808, 91296, 91296, -5961, 3572, -5961, -5961, 1944, 36010, 3870, -5961, -5961, -5961, 36010, -5961, -5961, 1903, 3586, 86, 1304, 2510, 2510, 2370, 1317, -5961, -5961, 3591, -5961, 36010, 2557, -5961, 2567, -5961, -5961, -5961, -5961, 2993, -5961, 3796, -5961, -5961, -5961, 44966, 3592, 94368, 44966, -5961, -5961, -5961, -5961, -5961, -5961,119456, 2043, -5961,123938, -5961,123938, -5961, 2043, 4002, -5961,119456, 1931, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 69280, 69280, 3778, 94368, 3799, 3803, 36010, 1357, -5961, 3959, 314, -5961, -5961, 3669, -5961, 20296, -5961, -5961, -5961, -5961, -5961, 69280, 94368, -5961, 72352, -5961, -5961,122444, -5961, -5961, 94368, 94368, -5961, -5961, -5961,122444, -5961, -5961, -5961, 94368, 976, 3670, 3676, 94368, -5961, 1386, 3368, 10290, 94368, 94368, 94368, 3905, -5961, -5961, -5961, -5961, 3828, -5961, 3962, -5961,119456, -5961, 2863, 1540, 3679, 3104, 36010, 3836, -5961, 1076, 94368, 3595, 3603, 3972, 94368, 675, 3924, 3604, -5961, 3710, 3933, 3733, 1220, -5961, -5961, 3751, -5961, -5961, -5961, -5961, 3990, 314, 4001, 314, 94368, 94368, 94368, 94368, 3764, -5961, -5961, -5961, -5961, 3769, 3914, -5961, 64672, 64672, 64672, 2325, -5961, -5961, 1195, -5961, -5961, -5961, -5961, -5961, -5961, 3954, -5961, 2338, -5961, 1255, 92320, -5961, -5961, -5961, -5961, -5961, 4006, 69280, 94368, 11016, 94368, 94368, 94368, 3859, 2001, 1300,122444, -5961,120950, -5961, -5961, 2345, -5961, 3644, 94368, 3719, 69280, 3696, -5961, -5961, -5961, 4012, 2393, 3787, 80544, 3685, 3685, 2049, -5961, -5961, -5961, -5961, -5961, 3926, 3849, -5961, 1114, 3850, 69280, 3713, -5961, -5961, -5961, -5961, 4025, 3738, -5961, -5961, 3742, 1028, 3104, 3447, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 3767, -5961, -5961, -5961, -5961, -5961, -5961, 1684, 1684, -5961, -5961, -5961, 1684, 1622, 476, 1029, 3104, -5961, 1513, 1396, 3744, -5961, 3746, -5961, -5961, -5961, 3932, 3934, 3935, 3748, 3752, 3811, 3755, 3756, 3815, -5961, 3759, 3818, 3762, 3821, 3766, 4072, 314,122444, 3925, 1195, 3813, 4063, 314, -5961, -5961, 3773, -5961, 3779, -5961, 2349, 4176, 4178, -5961, 94368, -5961, 546, 1043, 3104, -5961, 3780, -5961, 69280, 94368, -5961, -5961, -5961, 36010, 3693, 3694, 3695, 20296, 20296, 36010, -5961, -5961, 20296, 3702, -5961, -5961, -5961, -5961,122444, -5961, 94368, 4005, -5961, -5961, 1097, 94368, 94368, -5961, -5961, -5961, 94368, -5961, -5961, -5961, 4009, -5961, 569, 569, -5961, -5961, 4050, 9203, 3705, 351, -5961, 64672, 52752, 4189, 211, 1902, -5961, 72352, 94368, 72352, -5961, 903, 3930, 94368, 94368, 94368, 3707, 3701, -5961, -5961, -5961, -5961, 69280, 1068, 69280, 2893, -5961, -5961, 3788, -5961, 94368, 2393, 4245, 4078, 3430, -5961, 4215, 3326, 1032, 1816, 259, 2916, 4151, 2711, 36010, 428, -5961, -5961, 1944, 94368, 3469, -5961, -5961, -5961, -5961, 1195, -5961, 3730, 3734, -5961, 94368, 4097, 94368, 94368, 94368, 94368, 3524, 3735, 94368, 3740,122444, 94368, 2296, 3097, 4235, 4119, 2128, 3488, 3830, 4122, 84640, 3757, 2367, -5961, -5961, 1127, -5961, 2375, 241, -5961, 1195, 72352,119954, 4110, -5961, 1033, 10438, -5961, -5961, 1033, 1031, 94368, -5961, -5961, -5961, -5961, 3982, 2216, -5961, 4098, -5961, -5961, 2128, -5961,122444, 3750, -5961, 2380, -5961, -5961, -5961, 415, 3819, 314, 3820, 314, -5961, -5961, -5961, -5961, 94368, -5961, 94368, 67744, -5961, -5961, 94368, -5961, 4137, 3824, 90, 49110, 3986, -5961, 94368, 466, -5961, 3770, -5961, -5961, -5961, 3907, 3908, 3910, 3915, 3917, 94368, 3468, -5961, 3771, 94368, 94368, 69280, 1710, -5961, -5961, 69280, 194, -5961, 201, -5961, 84640, 3904, -5961, -5961, -5961, -5961, 4154, 4157, -5961, 3786, -5961, -5961, -5961, -5961, 330, -5961, 79520, 477, -5961, 69280, 4091, 4092, 4093, 4094, 382, 4095, 4096, 4102, 4103, 4107, -5961, -5961, -5961, 3804, 18502, 36010, -5961, 4188,122444, -5961, 10024, -5961, -5961, -5961, 36010, -5961, -5961, 4109, -5961, -5961, 3856, 3873, 3806, 3512, 3646, -5961, 4031, 4032, 36010, 3646, 4286, 1146, 36010, 36010, 36010, -5961, -5961, 4036, 4041, 36010, 2177, 2177, 36010, -5961, 3827, 36010, -5961, -5961, -5961, -5961, 2313, 36010, -5961, 36010, -5961, -5961, 27073, 4340, 4340, 3814,122444, 41840, 41840, 41840, 41840, 1494, 2949, 41840, 41840, 41840, 41840, 41840, 41840, 41840, 41840, 41840, 41840, 558, -5961, 4035, 36010, 36010, 35480, -5961, -5961,122444, 3835, 3539, 3837, 3838, 36010, -5961, -5961, -5961, 2381, 43412, 3839, 64672, -5961, 36010, 17065, 2391, 3878, 18604, 1944, 10580, 1195, 36010, 1961, 2489, 36010, 2397, 36010, -5961, -5961, -5961, -5961, 4180, -5961, -5961, -5961, -5961, -5961, -5961, 4074, 2177, -5961, -5961, 36010, 3840, 3543, 41840, 41840, 3988, 30175, -5961, 4867, 36010, 30175, -5961, 3614, -5961, 27609, 3829, 36010,118944, -5961, -5961, 1081, 1081, 1081, 1081, -5961, 94368, 94368, 94368, 3870, 3841, 3870, 204, -5961, -5961, 2128, -5961, 3844, -5961, -5961, -5961, -5961, -5961, 36010, 91296, 91808, 91296, 91296, 3831, 43930, 28128, 2728, 3843, 94368, -5961, -5961, 3846, 44966, 4146, 4064, -5961, 44966, 4064, 1690, 4064, 4162, 3947, 51700, -5961, -5961, 3862, -5961, -5961, 4079, -5961, 2056, 20296, 4339, 4210, -5961, 3865, -5961, 3586, 1756, -5961, -5961, -5961, 1362, -5961, 3958, -5961, -5961, -5961, 3563, 37600, 4028, -5961, 2675, 2399, 2053, -5961, -5961,119456, -5961, 3951, 2863, 2863, 2079, 3468, 4234, 2079, 10818, -5961, 2072, 94368, -5961, 94368, -5961, -5961, -5961, 4374, 3940, 3942, 4173, -5961, 2760, -5961, -5961, 69280, 94368, -5961, -5961, -5961, 548, 1050, 3104, -5961, 3969, -5961, -5961, 4205, 94368, -5961, 4362, 3984, 94368, 11004, 4269, 3955, -5961, -5961, 46520, 94368, 94368, -5961, 94368, -5961, 94368, 94368, 2072, 92832, -5961, 4342, -5961, 2072, 4010, 4248, 1647, 3097, 398, 8359, -5961, 1849, -5961, -5961, 3974, -5961, 94368, -5961, 94368, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 4038, -5961, -5961, -5961, -5961, 65184, -5961, -5961, 94368, -5961, 64672, 52752, 64672, -5961, -5961, -5961, 94368, -5961, 1644, 563, 1051, 3104, -5961, 3991, -5961, 4274, 3992, 3993, 4046, 967, 1556, 3996, 3997, 4048, 3912, 3916, 3918, -5961, 64672, 53283, 4083, 94368, 2863, 3911, 3961, 94368, 3685, 93344, -5961, 3920, -5961, -5961, 3685, 312, 1195, -5961, -5961, 1195, 2863, 1195, 94368, 94368, 94368, 94368, 393, -5961, -5961, -5961, 4394, 4019, 94368, 94368, 94368, 94368, -5961, 3979, -5961, -5961, -5961, 94368, 94368, 4288, 1133, 2333, 69280, 94368, 94368, 69280, 94368, 94368, 94368, 94368, 94368, 94368, 94368, 4152, -5961, 4383, 4305, 2468, 4352, 4007, 94368, -5961, 94368, 1195, -5961, 3368, 94368, 94368, 94368, 94368, -5961, -5961, -5961, -5961, -5961, 3614, -5961, 3929, 4243, 1097, -5961, 4244, 4246, 4247, 1097, -5961, -5961, 1902, -5961, 222, 94368, -5961, 2312, 94368, -5961, -5961, -5961, 3865, 2225, 2462, -5961, -5961, -5961, -5961, -5961, -5961, 3936, 94368, 94368, 41840, -5961, -5961, 2181, 1901, 313, -5961, 4229, 94368, 3203, -5961, -5961, -5961, 1441, 94368, -5961, -5961, -5961, -5961, 3937, -5961, 920, 3735, -5961, 4265, 76448, 2863, 69280, 69280, 2863, -5961,122444, 3946, 3469, -5961, 271, 4027, -5961, 69280, 1032,117408, 3265, 3980, 4167, 11232, 44966, 45484, 1684, -5961, 3950, 3938, -5961, -5961, 94368, 3930, 67744, 2401, 3447, 4442, 1238, 2337, -5961, 76960, 4153, 3735, 4265, -5961, 3097, 4182, 4181, -5961, 2128, 94368, 3524, 3469, 1195, 94368, 3955, 52752, -5961, 4487, 2245, -5961,119456, 36010, 36010, -5961, 3952, -5961, 3957, 10438, -5961, 4033, 3960, 4451, 36010, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 4051, 3965, 94368, 94368, 1127, 94368, -5961, 3967, 3809, -5961, 3809, -5961, 94368, -5961, 94368, -5961, 314, -5961, 4108, 314, 94368, -5961, -5961, -5961, 4020, 2411, -5961, -5961, 4413, 4028, -5961, 2426, 50664, 3592, 36010, 1944, 94368, 94368, 94368, 94368, 94368, 3468, 382, 3480, -5961, -5961, 4324, 68256, 4325, -5961, 64672, -5961, -5961, -5961, -5961, -5961, 2431, 94368, -5961, -5961, 1195, -5961, 4398, 4334, 314, 175, 1116, 1116, 1116, 1116, 4290, 1116, 1116, 1116, 1116, 1116, -5961, 36010, 20296, -5961, 3985, -5961, 20296, 4377, 4282, 4283, -5961, -5961, 3994, 4228, 4230, -5961, 3995, 36010, 3646, 18759, -5961, -5961, 4231, 4232, -5961, 3646, 3646, 18759, -5961, 18759, 4003, 11374, 19028, -5961, 2432, 36010, -5961, 1164, 1164, 1164, 3518, 4356, -5961, 2777, 1164, 1164, 1164, 470, 470, 286, 286, 286, 4340, 558, 19069, 19615, 19656, 4004, -5961, -5961, -5961, 3539, -5961, 38130, 118, 4476, 42894, -5961, -5961, -5961, 4047, 4052, 4008, -5961, 36010, 38660, 3999, 124436, 4226, -5961, 496, 36010, 36010, 5478, -5961, 11542, 36010, -5961, -5961, 5478, 522, 36010, 3234, 4376, 36010, 2439, 36010, 5631, 12460, 4011, -5961, 2453, 36010, 12599, 4219, -5961, 94368, 94368, 94368, 94368, -5961, -5961, -5961, 4210, 1195, 4210, 4013, -5961, 4015, -5961, -5961, -5961, -5961, 65696, 4016, 3703, 91296, 4017, 94368, 2728, 44966, -5961, -5961, 1572, -5961, 44966, 4329, -5961, 44966, 72864, -5961, 94368, 4021, 94368, -5961, 1528, 36010, 4066, 55938, -5961, -5961, -5961, -5961, 4114, -5961, 4258, 20296, 4070, -5961, 36010, -5961, 4106, 2460, -5961, -5961, 4266, -5961, -5961, -5961, -5961, -5961, 4125, 78496, 4390, -5961, -5961, -5961, 1962, 4370, 921, -5961, 314, -5961,122444, 94368, 94368, 94368, 3053, -5961, -5961, 94368, 94368, 94368, 94368, -5961, -5961, 69280, 94368, -5961, -5961, 94368, 36010, 2469, -5961, 4077, 4502, 420, 4040, -5961, 2072, 9, 2072, -5961, 9, -5961, -5961, 93856, -5961, 3930, 393, 2181, 4387, 4389, 4291, -5961, 382, -5961, 4548, 2181, 4292, 393, -5961, -5961, -5961, -5961, 3287, -5961, 122444, 314, 314, -5961, -5961, -5961, -5961, -5961, 4061, -5961, 4532, 4155, 94368, 94368, 94368, 94368, 94368, 69280, 94368, 94368, 2893, 2893,122444, 4054, -5961, 2893, 2893, 4055, -5961, 69280, 94368, 94368, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 4148, -5961, 36010, 4526, -5961, -5961, -5961, -5961, -5961, 36010, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 69280, 94368, 4150, -5961, 4156, -5961, 197, -5961, -5961, 94368, 94368, 94368, 94368, 4444, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 4443, 94368, -5961, -5961, 1195, 1195,122444, 314, 314, -5961, -5961, -5961, 4158, -5961, -5961, 4065, 4381, 1097, -5961, 1097, 1097, 1097, -5961, 4071, -5961, 1902, 4483, -5961, 2072, 2210, 4431, -5961, 36010, -5961, 1153, 3518, -5961, 4492, 4575, -5961, -5961, -5961, -5961, 4327, 3430, 2393, 3430, -5961, -5961, 72864, 434, -5961, 4412, 248, 64672, 4316, 76448, 1513, 1747, 4084, 4221, -5961, 2863, 2863, 4149, 94368, 4587, -5961, -5961, -5961, -5961, -5961, -5961, 69280, 3696, -5961, 4335, 1310, 4453, 94368, 45484, -5961, 3563, -5961, -5961, -5961, 1195, -5961, -5961, 4233, 3469, -5961, 1335, 94368, 4326, 76448, 3524, 2471, -5961, -5961, -5961, 4135, 4574, 3488, -5961, 1513, 4153, -5961, -5961, 4551, 4197, 4144, 4601, -5961, 4197, 4462, 4331, 4111, -5961, 3757, -5961, 94368, -5961, 20296, 20296, 1195,124934, 1033,122444, 4471, -5961, 20296, 94368, 224, 4104, 4280, -5961, 4434, 314, 2488, -5961, 314, 314, -5961, 94368, -5961, 2128, 2060, 94368, 1944, 95, -5961, 4120, 94368, -5961, 4028, 20296, 3468, 3468, 3468, 3468, 3468, -5961, 4336, -5961, -5961, -5961, -5961, 4427, -5961, -5961, 68256, -5961, 314, -5961, -5961, -5961, -5961, -5961, -5961, 1116, -5961, -5961, -5961, -5961, -5961, 20296, -5961, 94368, -5961, -5961, -5961, -5961, -5961, -5961, 3317, 4113, 36010, 1516, -5961, -5961, 4117, 4121, 3646, 3646, -5961, -5961, 36010, -5961, 12629, 41840, 4474, -5961, 36010, 36010, 36010, -5961, 4123, 2520, 2524, -5961, -5961, 118, -5961, 4476, -5961, -5961, -5961, 13369, 4179, 20296, 4239, 4124, 940, 5478, 5478, 11542, 5478, 36010, 36010, 5478, -5961, 5478, 36010, -5961, -5961, -5961, 13711, -5961, 4602, 3614, -5961, -5961, -5961, -5961, 4066, -5961, 4066, 4270, 36010, -5961, 2525, 4625, 40780, 4584, -5961, 94368, 2537, -5961, 36010, 4129, -5961, -5961, 44966, 1572, 4130, 2538, 94368, 2543,122444, 39190, 20296, 94368, 3614, 4131, -5961, 94368, 4133, 32830, 19756, -5961, -5961, -5961, 68256, 4358, 68256, 2072, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 4134, -5961, -5961, -5961, -5961, 4224, -5961, -5961, 61, 3495, 2072, -5961, 14144, 4473, 46520, 57000, 94368, -5961, 94368, -5961,117920, 4141, 4360, 4142, 4160, -5961, -5961, -5961, -5961, 4646, 4528, 4529, -5961, -5961, 4163, -5961, -5961, -5961, 4383, -5961, -5961, 52752, 69280, 94368, -5961, 4241, -5961, -5961, -5961, -5961, -5961, -5961, 48592, 55938, -5961, 967, 4164, 4165, 1556, -5961, -5961, -5961, 94368, 14502, 4166, 14547, 701, 3495, 94368, 94368, 4169, 4170, 4172, 1907, 1389, 2018, 3468, 4519, 94368, -5961, -5961, -5961, 4383, -5961, -5961, 94368, -5961, 1097, -5961, -5961, -5961, -5961, 64672, -5961, 3337, 4071, 1195, 72864, 4654, 4654, 14961, 4395, -5961, -5961, 160, 4485, -5961, 4225, 4430, 4225, 4174, 94368, 1441, 4175, 2548, -5961, 94368, 4177, 4303, 2302, 2302, 94368, 94368, 94368, 2553, 2128, 2863, 3961, 1032, 4552, 76448, 4600, 3930, 475, -5961, 94368, 4678, 94368, 3524, 3735, 94368, 4183, -5961, -5961, 76960, 4404, 4189, 94368, 2296, 4153, 3488, 973, 94368, -5961, 1638, -5961, 2128, -5961, 94368, 84640, 46520, 4541, -5961,123938, -5961, 2559, -5961, -5961, -5961, 4261, 20635, 3348, 4306, 4307, 4187, 1232, 4555, 94368, 149, -5961, -5961, -5961, -5961, -5961, -5961, 90, -5961, -5961, 4639, 46520, 4596, 36010, -5961, -5961, -5961, 94368, 477, -5961, -5961, -5961, -5961, 4192, -5961, 4696, 36010, 354, -5961, -5961, -5961, -5961, -5961, 4425, -5961, 4198, -5961, -5961, 2539, 1516, 19881, -5961, 4912, 41840, 20296, 20296, 20296, 36010, -5961, 36010, -5961, -5961, -5961, -5961, 945, -5961, -5961, 4531, 4200, 5478, 5478, 5478, -5961, 36010, 906, -5961, -5961, 444, 4627, 20009, 3572, 65696, 4203, -5961, 41840, 2563, -5961, 4312, 94368, 2565, -5961, 20296, 94368, -5961, -5961, 36010, -5961, 2575, -5961, 4204, 50, 4206, 26001, 4201, -5961, -5961, -5961, -5961, -5961, 20296, 4207, -5961, 4708, 1637, -5961, -5961, 2026, 2992, 2045, 1478, -5961, 4712, 4712, 1710, 2079, 585, -5961, 94368, 4311, -5961, 4502, 4218, 3430, -5961, 4220, -5961, -5961, 451, 3097, 94368, 4393, -5961, 4473, 4473, 4189, 4557, -5961, -5961, 36010, 4285, -5961, 1206, 3495, 94368,122444, -5961, 178, 4588, -5961,122444, 122444, -5961, -5961, -5961, 36010, -5961, 4322, -5961, -5961, -5961, 36010, 36010, 75424, -5961, -5961, 94368, 94368, 94368, 94368, 94368, -5961, 314, -5961, -5961, 2582, -5961, 47556, -5961, -5961, 3321, 1195, 3321, 1895, -5961, -5961, 3321, 3321, -5961, 3348, -5961, 4654, 405, -5961, -5961, 4327, 4227, 36010, -5961, 4556, -5961, 1092, 4455, -5961, 4236, -5961, 72864, 4760, -5961, 64672, 3735, 4265, 94368, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 2586, 3930, 4603, 3469, 4144, -5961, 94368, 4271, -5961, 44966, 3930, 2128, 2337, -5961, 4153, 3735, 4265, -5961, -5961, 4240, 4181, 3488, 2296, 4380, -5961, 4384, -5961, 4698, 4459, 4701, 3524, -5961, 3955, 2587, -5961, 94368, -5961, -5961, 10438,124934,122444, -5961, -5961, -5961, 4238, 4640, 4287, 4293, -5961, -5961, -5961, 1232, -5961, 767, 4638, 4294, -5961, 4302, 94368, -5961, -5961, 4309, 94368, 2592, 882, 20296, 3930, 314, 36010, 64672, 20296, -5961, -5961, 4632, -5961, 293, 252, 1689, 4475, 4251, 36010, 4912, 2597, 2599, 4313, -5961, -5961, -5961, 3539, 39720, 39720, 39720, 4253, 4617, 4634, 94368, -5961, 94368, 4472, -5961, -5961, 94368, 3518, 4264, 40780, 64672, 2601, -5961,121448, -5961, 2607, 2613, -5961, 36010, 4273, 36010, -5961, 39190, 94368, 4275, 3400, -5961, -5961, 2617, -5961, 4768, -5961, 4545, -5961, -5961, 36010, 4369, 4371, -5961, 4629, -5961, -5961, 94368, -5961, 94368, 4225, 55938, 3586, 451, -5961, 94368, 3430, 3430, 4227, 15311, 36010, -5961, 4378, -5961, -5961, 2622, 185, -5961, -5961, 2623, 2628, 15420, 94368, 2630, 2638, -5961, 2640, 2893, 3470, 2018, 3470, -5961, 3468, -5961, -5961, 64672, -5961, -5961, 68768, -5961, -5961, -5961, 1195, -5961, 1195, 4521, 58538, 59050, 1195, 1195, -5961, -5961, -5961, -5961, -5961, 3447, -5961, 15686, 4385, -5961, -5961, -5961, 560, -5961, 4510, 4512, -5961, 4289, -5961, 2642, -5961, 1513, 4424, 3930, -5961, -5961, 94368, 4789, 4790, -5961, 1323, 94368, 3563, -5961, 4144, 3524, 3488, 1513, 4153, 4189, 47038, 4197, 2296, 4181, -5961, -5961, 4517, -5961, 4518, -5961, 4295, 4643, 46520, -5961, 2117, 1033, -5961, -5961, -5961, 1443, 4667, 4668, -5961, -5961, -5961, 3321, -5961, 2022, 4315, 4692, -5961, -5961, 2128, -5961, 3348, -5961, 4450, -5961, -5961, -5961, -5961, -5961, 4357, 276, 320, -5961, 4361, -5961, 4500, 4505, 1516, 1044, -5961, 20296, -5961, -5961, -5961, 41310, 4477, 1535, 17149, 4704, -5961, 4704, 4704, -5961, 4805, 4808, 1215, -5961, 4788, 2644, 42894, -5961, -5961, -5961, 94368, 4554, 361, 4836, 4506, 2646, 39190, 2648, -5961, -5961, -5961, -5961, -5961, 2026, 94368, 4819, 20296, 547, 349, 68256, 3495, 2653, 3685, 4341, -5961, 3586, 4344, 4225, 4225, -5961, -5961, 20296, 94368, 72864, 4824, -5961, -5961, -5961, -5961, 3495, 4435, -5961, -5961, 75424, -5961, 94368, -5961, -5961, 2654, -5961, -5961, -5961, 59562, -5961, 4104, -5961, 4104, -5961, -5961, 2209, 1581, 94368, 303, 303, 4764, -5961, 4418, -5961, 4353, -5961, 4886, 4494, 94368, -5961, -5961, 967, 2128, 76448, 3930, -5961, -5961, 2296, 4153, 3488, 36010, 2655, -5961, 4502, 420, -5961, 4181, 4197, -5961, -5961, 46520, 4359, 3203, -5961, 4752, -5961, -5961, -5961, 2550, 72864, 72864, 94368, -5961, -5961, -5961, 36010, 1441, -5961, -5961, 50664, -5961, 4399, -5961, 4400, -5961, -5961, 4590, 4604, 4372, 1516, -5961, 4876, -5961, -5961, -5961, -5961, -5961, 1041, -5961, -5961, -5961, 94368, 94368, 94368, 4379, -5961, 3703, -5961, -5961, 41840, 41840, 4622, -5961, 41840, 361, -5961, 94368, -5961, 4396, -5961, -5961, 2661, -5961, -5961, -5961, 2029, -5961, 4621, 4520, -5961, -5961, 4642, 847, -5961, 585, -5961, -5961, -5961, -5961, -5961, 94368, 4430, -5961, -5961, 3495, -5961, 94368, -5961, 4397, -5961, -5961, -5961, 68768, -5961, 4104, -5961, -5961, -5961, -5961, -5961, -5961, 4902, -5961, 1429, -5961, -5961, -5961, -5961, 94368, 3930, 4054, 4144, -5961, 4181, 3488, 2296, 15768, -5961, 47038, 94368, 94368, 4197, -5961, 2663, 46520, 3469, 4546, -5961, 2577, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 1144, 4401, 4403, -5961, -5961, 16355, 72864, 1546, -5961, -5961, 4547, 4549, -5961, 4628, 40250, 4561, -5961, 4623, -5961, 1320, 1365, 1988,118432, 4869, 3518, 3518, -5961, 3518, -5961, -5961, 36010, -5961, -5961, -5961, -5961, 50664, -5961, 4468, 90, 4414, 94368, -5961, -5961, 2072, 4040, 4455, 2072, 2072, -5961, -5961, 36010, -5961, -5961, 2393, 2393, 3930, -5961, -5961, 4197, 2296, 4181, 4502, -5961, -5961, -5961, -5961, 4643, -5961, 2668, 4197, 4294, 2444, -5961, -5961, 2512, 2753, 4503, 4775, -5961, 4417, -5961, 4530, 4533, 4806, -5961, -5961, -5961, 94368, 94368, 66208, 94368, 1049, 2669, -5961,121946, 94368, 16488, 4420, -5961, 4479, 36010, 2680, 4421, -5961, 2682, -5961, -5961, -5961, -5961, 4181, 4197, 94368, 3203, -5961, 46520, 3348, 4798, -5961, 2577, 4550, 4559, 64160, -5961, -5961, -5961, -5961, -5961, 4956, 350, 4843, -5961, -5961, 1195, 1516,118432, 4647, 877, 2693, -5961, 4490, 2694, 130, -5961, 2072, -5961, 4197, -5961, -5961, 3469, -5961, -5961, 1441, -5961, 4478, 4482, -5961, 2717, -5961, -5961, -5961, -5961, 36010, 66208, 2165, 4439, -5961, -5961, 4631, 1195, 2539, 4631, -5961, -5961, -5961, 90, -5961, -5961, 4197, 72864, 4793, 4799, -5961, 64160, 1018, 4504, 94368, 4445, -5961, 1516, -5961, 1689, 2539, 4507, 3348, 4446, 72864, 72864, -5961, 4447, 94368, 4900,118432, -5961, 1516, 1689, 4490, -5961, 64160, -5961, -5961, 1195, -5961, 4452, 2726, -5961, 1516, -5961, 2736,118432, -5961, -5961, -5961, 2741, -5961 }; /* 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_int16 yydefact[] = { 1750, 1480, 685, 1569, 1568, 1480, 0, 275, 0, 1580, 0, 1480, 444, 1137, 0, 0, 0, 0, 685, 1480, 0, 1750, 0, 0, 0, 0, 0, 1763, 0, 0, 0, 0, 0, 0, 1277, 0, 0, 0, 1480, 0, 0, 1770, 0, 0, 0, 0, 1763, 0, 1582, 0, 0, 0, 0, 1770, 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, 1580, 102, 115, 101, 84, 108, 87, 112, 130, 113, 85, 126, 1714, 1713, 1774, 1717, 1749, 0, 1729, 1479, 1478, 1493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1490, 2478, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2511, 2510, 2512, 2513, 2888, 2514, 2515, 2516, 2825, 2826, 2889, 2827, 2828, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2829, 2830, 2526, 2527, 2528, 2529, 2530, 2831, 2890, 2531, 2532, 2533, 2534, 2535, 2536, 2891, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 2892, 2547, 2548, 2549, 2893, 2550, 2551, 2552, 2553, 2554, 2555, 2832, 2833, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 2834, 2587, 2588, 2589, 2590, 2835, 2591, 2592, 2593, 2594, 2836, 2595, 2596, 2597, 2598, 2894, 2895, 2599, 2600, 2601, 2602, 2603, 2837, 2838, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2896, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2897, 2839, 2624, 2625, 2626, 2627, 2840, 2841, 2842, 2628, 2898, 2899, 2629, 2900, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 2637, 2854, 2901, 2638, 2902, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2855, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2856, 2903, 2857, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2858, 2859, 2668, 2669, 2670, 2904, 2671, 2860, 2672, 2861, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2862, 2905, 2685, 2906, 2863, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2864, 2701, 2865, 2704, 2702, 2703, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2866, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2907, 2734, 2735, 2736, 2737, 2738, 2867, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2868, 2756, 2757, 2908, 2758, 2759, 2869, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2870, 2776, 2777, 2778, 2779, 2909, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 2871, 2872, 2787, 2788, 2873, 2789, 2874, 2790, 2791, 2792, 2793, 2794, 2795, 2797, 2796, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2875, 2876, 2809, 2910, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 2887, 2822, 2823, 2824, 146, 0, 0, 2445, 2479, 2480, 2483, 2478, 414, 413, 1703, 2442, 2479, 1579, 0, 1558, 685, 0, 1493, 443, 1750, 0, 0, 0, 0, 0, 0, 904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 140, 0, 0, 468, 467, 0, 0, 1109, 473, 0, 0, 0, 0, 0, 675, 1621, 2702, 1619, 1704, 276, 279, 280, 277, 278, 2461, 0, 1249, 1250, 1252, 0, 0, 1262, 942, 943, 0, 0, 0, 956, 0, 0, 0, 940, 0, 0, 0, 962, 0, 959, 0, 0, 963, 960, 937, 961, 944, 0, 936, 0, 0, 1262, 964, 0, 0, 938, 0, 0, 0, 0, 1493, 1618, 474, 1750, 0, 1602, 1603, 1604, 1580, 1592, 1605, 1597, 1599, 1598, 1600, 1601, 1596, 0, 2460, 2497, 1032, 1032, 1032, 1032, 1029, 1030, 1032, 1032, 1032, 2722, 0, 0, 1011, 0, 1013, 2462, 1032, 1037, 2505, 561, 561, 561, 0, 1036, 1041, 561, 0, 1461, 1502, 2444, 1762, 0, 1012, 1460, 2524, 248, 2728, 2734, 2743, 2753, 2754, 2757, 2871, 2787, 2821, 213, 202, 0, 225, 2787, 1608, 0, 0, 0, 0, 2741, 1470, 258, 2753, 2871, 2787, 257, 251, 253, 0, 0, 1036, 561, 0, 1493, 1468, 1008, 1769, 1767, 0, 2429, 2541, 2641, 2753, 2754, 2787, 203, 208, 269, 2753, 2871, 2787, 265, 1490, 0, 1730, 1880, 1879, 2438, 0, 1463, 1462, 1581, 0, 1584, 0, 2717, 1734, 1737, 1586, 1735, 2481, 1973, 2002, 1980, 2002, 2002, 1969, 1969, 2571, 1982, 1970, 1971, 2007, 2027, 0, 2002, 1969, 1974, 0, 1972, 2010, 2010, 1997, 3, 1952, 1953, 1954, 1955, 1983, 1984, 1956, 1989, 1990, 1994, 1957, 2024, 1960, 1969, 2482, 1771, 1772, 2429, 4, 2475, 5, 2356, 2474, 6, 7, 1726, 0, 0, 1, 1750, 0, 1591, 1766, 1766, 0, 1766, 0, 1718, 1726, 1721, 1725, 0, 0, 0, 0, 0, 0, 1464, 0, 0, 0, 967, 0, 1505, 1093, 0, 0, 0, 0, 0, 1346, 0, 1146, 1145, 2484, 2467, 2468, 2469, 0, 2465, 2466, 2485, 2486, 2487, 0, 2610, 1346, 0, 0, 2274, 2285, 2286, 2287, 2528, 2591, 2282, 2283, 2284, 2276, 2277, 2278, 2279, 2280, 2281, 0, 0, 1244, 2275, 0, 2610, 0, 1346, 0, 173, 0, 150, 1346, 0, 0, 2610, 0, 0, 2610, 0, 0, 0, 0, 0, 2610, 0, 0, 0, 0, 0, 173, 2646, 0, 150, 2610, 0, 0, 1484, 0, 0, 0, 1486, 1489, 1476, 0, 2353, 0, 2354, 2446, 1573, 0, 1572, 1566, 1576, 1571, 1561, 0, 2438, 0, 0, 0, 0, 950, 0, 0, 940, 0, 0, 0, 951, 0, 952, 953, 0, 0, 0, 0, 949, 0, 1474, 1466, 0, 1610, 1612, 1611, 1613, 1609, 561, 0, 0, 0, 2610, 0, 150, 1544, 0, 2610, 150, 0, 0, 472, 471, 150, 2465, 470, 469, 2528, 2591, 0, 1136, 0, 1219, 150, 2610, 0, 194, 2610, 744, 2610, 1586, 139, 0, 688, 0, 858, 2646, 150, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, 674, 685, 1622, 1620, 0, 1253, 250, 249, 1251, 954, 2610, 1178, 145, 0, 0, 2610, 1525, 2610, 145, 971, 955, 0, 941, 2610, 145, 1142, 2610, 2470, 183, 0, 939, 2528, 2591, 2610, 145, 1246, 0, 2610, 145, 2610, 179, 2610, 145, 2610, 145, 2610, 689, 0, 0, 2610, 145, 2610, 2646, 181, 958, 2610, 145, 965, 2610, 145, 2440, 2610, 0, 1477, 0, 1614, 0, 1594, 2875, 0, 1750, 0, 0, 1032, 1031, 0, 1032, 0, 1032, 0, 1032, 0, 1032, 0, 0, 0, 1032, 2463, 2464, 1014, 0, 1038, 0, 1046, 0, 1045, 1044, 1043, 0, 0, 0, 1047, 0, 1884, 1657, 0, 1458, 216, 247, 218, 246, 252, 219, 217, 0, 2519, 201, 0, 264, 263, 0, 0, 0, 0, 0, 0, 0, 1473, 0, 0, 0, 142, 0, 1275, 1272, 142, 1274, 1273, 142, 142, 1469, 256, 254, 0, 0, 0, 0, 0, 1475, 0, 1467, 0, 0, 0, 2448, 2450, 2451, 2288, 2356, 0, 2826, 2827, 2828, 2345, 0, 2829, 2830, 2831, 2890, 2162, 2148, 2157, 2163, 2149, 2151, 2158, 2832, 2833, 2097, 2834, 2835, 2458, 2836, 2837, 2838, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2853, 2854, 2153, 2155, 2855, 2856, 2857, 2859, 0, 2459, 2860, 2861, 2680, 2863, 2864, 2866, 2867, 2159, 2869, 2870, 2160, 2871, 2872, 2873, 2874, 2457, 516, 2161, 2876, 2878, 2879, 2880, 2881, 2883, 2884, 2885, 2886, 0, 0, 0, 2435, 0, 2126, 0, 1961, 1962, 1985, 1986, 1963, 1991, 1992, 1964, 0, 1965, 2434, 2028, 2233, 2125, 2143, 0, 2131, 2132, 0, 2124, 2120, 2235, 1752, 2430, 0, 2121, 2447, 2449, 2346, 1752, 2428, 271, 0, 272, 2436, 2753, 204, 2526, 205, 0, 206, 268, 266, 0, 1465, 0, 1882, 1881, 2439, 976, 0, 1583, 1580, 2298, 0, 1736, 0, 0, 0, 2001, 1988, 1996, 1995, 0, 1978, 1977, 1976, 0, 1975, 2002, 2002, 2000, 1979, 1952, 0, 0, 0, 2006, 0, 2004, 1948, 1944, 0, 2013, 2014, 2015, 2012, 2025, 2011, 0, 1958, 2016, 0, 1969, 1966, 1837, 0, 1716, 1715, 8, 0, 1588, 1590, 1564, 1586, 1764, 1765, 0, 0, 0, 0, 0, 0, 0, 0, 1824, 1782, 1783, 1785, 1821, 1825, 1833, 0, 1722, 0, 0, 0, 1886, 1672, 0, 1491, 0, 0, 0, 0, 0, 1177, 0, 0, 0, 0, 968, 0, 0, 0, 1511, 0, 1513, 1514, 1515, 0, 0, 0, 0, 1516, 1517, 1505, 260, 1524, 1521, 1504, 1506, 1519, 0, 0, 0, 0, 0, 0, 0, 1536, 0, 187, 188, 0, 701, 685, 0, 2610, 0, 0, 0, 0, 1187, 1194, 1345, 0, 0, 0, 0, 0, 0, 0, 0, 1188, 1186, 0, 1189, 262, 1199, 1226, 1229, 0, 0, 1144, 1147, 0, 0, 0, 0, 0, 1336, 0, 0, 0, 1336, 0, 0, 0, 1345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 289, 302, 369, 0, 666, 0, 0, 0, 669, 0, 2610, 1346, 0, 0, 0, 1248, 0, 0, 0, 0, 0, 0, 0, 0, 1229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 154, 0, 0, 0, 0, 1229, 0, 0, 0, 0, 0, 0, 0, 650, 665, 653, 0, 0, 0, 0, 0, 661, 0, 0, 150, 663, 292, 640, 646, 0, 0, 0, 751, 750, 0, 0, 0, 0, 0, 0, 1434, 0, 1433, 0, 0, 0, 0, 0, 1534, 1533, 0, 0, 0, 0, 0, 1336, 0, 281, 283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 406, 407, 0, 0, 0, 154, 0, 0, 1336, 0, 294, 0, 0, 1485, 1482, 1483, 0, 1488, 0, 0, 0, 0, 2134, 0, 2302, 1774, 2300, 1162, 2352, 0, 2488, 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, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2349, 2348, 2443, 2489, 2490, 2491, 2492, 2355, 1556, 0, 236, 237, 235, 1574, 238, 1575, 1570, 0, 1557, 0, 0, 0, 0, 0, 0, 0, 0, 2528, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 866, 1505, 1543, 0, 0, 0, 694, 0, 2610, 0, 152, 905, 0, 856, 473, 0, 0, 0, 0, 1410, 152, 0, 0, 190, 0, 0, 748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 857, 0, 0, 152, 0, 2610, 643, 2610, 0, 561, 561, 0, 0, 141, 138, 0, 0, 0, 0, 0, 0, 0, 0, 1708, 1707, 1710, 1709, 0, 1706, 0, 143, 144, 0, 1236, 1261, 0, 0, 0, 0, 0, 932, 957, 0, 0, 1230, 0, 0, 2610, 145, 2610, 0, 2610, 0, 0, 0, 1238, 145, 0, 1232, 0, 0, 1234, 0, 1436, 0, 948, 946, 945, 947, 0, 0, 930, 0, 0, 0, 0, 0, 925, 0, 0, 927, 0, 0, 0, 0, 1750, 1593, 0, 0, 0, 1022, 0, 1026, 0, 1017, 0, 1023, 0, 1018, 1015, 1016, 0, 1021, 0, 0, 562, 568, 0, 0, 2553, 2570, 0, 2599, 2634, 2635, 2690, 2708, 2737, 2743, 2749, 0, 2780, 2792, 0, 1052, 1090, 1042, 760, 0, 0, 1667, 1459, 221, 220, 0, 240, 244, 245, 215, 243, 0, 239, 223, 2219, 2218, 222, 214, 211, 209, 227, 229, 230, 212, 210, 226, 2307, 0, 1750, 0, 0, 1276, 0, 0, 138, 255, 0, 0, 1090, 0, 2741, 1472, 1007, 685, 0, 2122, 0, 2129, 2130, 2344, 0, 0, 0, 0, 0, 0, 2128, 0, 0, 0, 0, 2401, 0, 0, 2401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2051, 0, 0, 2306, 0, 0, 2306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2052, 2033, 2034, 2126, 2298, 0, 2127, 2454, 0, 2024, 2493, 2288, 0, 2285, 2286, 2287, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 0, 3006, 3007, 3008, 3009, 3010, 3012, 3011, 3013, 3014, 3015, 3016, 3017, 3018, 2359, 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, 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, 2066, 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, 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, 2068, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 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, 3286, 3284, 3285, 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, 3313, 3314, 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, 3344, 3343, 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, 3370, 3371, 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, 3401, 3400, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 0, 2282, 2283, 2284, 2276, 2277, 2278, 2279, 2280, 2281, 2292, 0, 0, 2433, 2494, 0, 2235, 0, 2048, 0, 2243, 0, 0, 1837, 0, 2452, 2347, 1837, 273, 274, 270, 0, 0, 0, 267, 0, 0, 0, 145, 1591, 1578, 0, 0, 2359, 0, 2296, 0, 0, 2294, 0, 0, 0, 1834, 0, 1738, 0, 1742, 0, 0, 0, 1999, 1998, 1949, 1945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 969, 0, 1967, 0, 1902, 2476, 2477, 2357, 1770, 1591, 0, 1587, 1733, 1732, 1775, 1776, 1128, 1731, 1804, 1805, 0, 0, 0, 0, 1830, 1828, 1795, 1786, 1794, 0, 0, 1792, 0, 1796, 2028, 1823, 1720, 1780, 1781, 1784, 1719, 0, 1826, 0, 1670, 1824, 1785, 1654, 1624, 1625, 0, 0, 1887, 0, 1492, 0, 0, 0, 1157, 1159, 0, 1158, 0, 1161, 0, 1170, 0, 0, 1156, 1175, 0, 1164, 1162, 0, 1532, 0, 0, 0, 0, 0, 1512, 0, 0, 0, 0, 2780, 259, 1515, 1520, 1507, 1518, 0, 0, 0, 0, 0, 1092, 1091, 0, 0, 0, 1539, 553, 0, 371, 0, 0, 0, 0, 0, 0, 0, 0, 852, 849, 0, 0, 848, 0, 699, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 724, 0, 1336, 0, 300, 0, 1196, 0, 1195, 0, 1200, 0, 0, 1197, 1192, 1193, 2743, 261, 1198, 1228, 0, 1227, 1223, 0, 1139, 0, 1140, 0, 0, 0, 0, 0, 0, 0, 2583, 0, 2610, 0, 0, 516, 308, 332, 543, 0, 1335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 355, 0, 0, 358, 357, 0, 0, 0, 0, 0, 363, 0, 341, 0, 342, 0, 362, 0, 0, 0, 667, 668, 0, 0, 0, 1336, 0, 296, 0, 0, 0, 0, 0, 0, 0, 0, 1245, 0, 777, 0, 0, 2743, 1224, 0, 1419, 0, 2779, 1420, 1423, 561, 0, 561, 1425, 0, 0, 1422, 1424, 0, 0, 176, 0, 171, 175, 0, 0, 2743, 1225, 0, 0, 0, 0, 0, 648, 649, 664, 0, 654, 655, 651, 656, 657, 0, 0, 0, 0, 0, 0, 0, 647, 0, 0, 746, 745, 749, 0, 0, 0, 0, 0, 0, 1428, 0, 0, 1219, 0, 0, 1427, 1435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1279, 1278, 0, 0, 0, 0, 1346, 0, 895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 764, 0, 763, 0, 172, 177, 0, 0, 0, 0, 0, 0, 0, 0, 234, 1481, 1487, 1774, 1774, 1774, 2140, 0, 0, 0, 0, 1773, 2350, 2353, 1561, 1567, 1560, 1559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 420, 417, 418, 420, 0, 0, 0, 0, 868, 0, 871, 874, 1503, 500, 0, 0, 691, 724, 0, 0, 476, 185, 0, 0, 0, 0, 779, 0, 1219, 1218, 147, 138, 194, 474, 0, 193, 195, 197, 198, 199, 196, 200, 0, 743, 747, 0, 0, 0, 0, 687, 0, 0, 0, 0, 0, 0, 0, 1907, 0, 0, 170, 0, 0, 638, 642, 0, 0, 0, 0, 476, 604, 382, 2610, 0, 561, 0, 2610, 0, 137, 0, 855, 0, 0, 0, 1181, 1181, 0, 0, 793, 792, 0, 0, 0, 0, 0, 0, 1705, 145, 1179, 0, 1526, 0, 145, 972, 145, 1143, 184, 2471, 0, 934, 0, 0, 0, 0, 145, 1247, 922, 145, 180, 145, 145, 690, 0, 145, 182, 0, 0, 145, 966, 145, 2441, 0, 145, 1617, 2610, 561, 1595, 0, 0, 1019, 1028, 1027, 1025, 1024, 1020, 0, 1039, 0, 560, 0, 0, 0, 0, 0, 1060, 1061, 0, 0, 1057, 1062, 0, 1064, 1048, 1050, 1058, 1059, 1065, 1054, 1053, 1066, 1067, 0, 0, 0, 1079, 758, 0, 0, 0, 0, 1664, 0, 1662, 0, 1885, 1666, 1655, 224, 0, 2024, 0, 1607, 0, 1606, 0, 631, 1270, 1269, 1271, 0, 1036, 0, 145, 0, 1471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2311, 0, 2312, 0, 0, 2343, 2339, 0, 0, 0, 0, 0, 2315, 2318, 2319, 2320, 2317, 2321, 2316, 0, 0, 2322, 0, 0, 2394, 2411, 0, 2126, 2394, 2422, 0, 2421, 2427, 0, 2302, 2028, 0, 0, 2418, 2412, 0, 2418, 0, 0, 2401, 0, 0, 0, 0, 2203, 0, 0, 0, 2302, 2305, 0, 0, 2867, 0, 0, 0, 0, 2098, 0, 0, 2269, 0, 2302, 0, 0, 0, 0, 0, 0, 0, 2298, 2337, 0, 514, 0, 2088, 0, 0, 0, 2217, 0, 2214, 0, 0, 0, 0, 2356, 0, 0, 2455, 2029, 2044, 2045, 2046, 2049, 2432, 2032, 0, 2358, 0, 0, 2030, 2057, 0, 2082, 0, 2089, 2072, 2402, 2323, 2324, 2325, 2326, 2091, 0, 2065, 2070, 2074, 0, 2411, 2053, 0, 2050, 0, 2359, 2297, 0, 2295, 0, 2041, 2042, 2043, 2035, 2036, 2037, 2038, 2039, 2040, 2047, 2273, 2271, 2272, 0, 0, 2243, 0, 0, 2069, 0, 0, 2142, 2602, 2641, 0, 1763, 1763, 1763, 1751, 1761, 2431, 1902, 1774, 1902, 2437, 0, 1883, 974, 975, 973, 1563, 1577, 1591, 2299, 1585, 1740, 0, 0, 0, 1968, 1981, 0, 2008, 2009, 2010, 2010, 0, 1950, 0, 1993, 2018, 2019, 2020, 2021, 2022, 2023, 0, 2017, 1959, 970, 2843, 2852, 0, 2739, 2887, 0, 1863, 1836, 1838, 1848, 1863, 1870, 1863, 1863, 2144, 1900, 2145, 2146, 2438, 0, 1807, 2473, 1565, 1589, 0, 1126, 1127, 0, 1131, 2867, 2739, 0, 0, 0, 0, 1797, 1831, 0, 1822, 0, 2448, 1798, 2447, 1799, 1802, 1803, 1793, 1832, 1668, 0, 1827, 1724, 1723, 0, 1905, 0, 0, 1888, 1835, 1386, 1280, 1347, 1160, 0, 1969, 1171, 0, 1155, 0, 1154, 1969, 0, 1172, 0, 1969, 1387, 1281, 1348, 1388, 1282, 1349, 1389, 1523, 1283, 1522, 1510, 1509, 1508, 0, 0, 0, 0, 0, 0, 0, 0, 831, 2610, 145, 1537, 1390, 0, 1284, 370, 1538, 1350, 1542, 851, 850, 0, 0, 1351, 0, 700, 705, 0, 707, 708, 2528, 2591, 709, 712, 713, 0, 715, 704, 703, 0, 0, 0, 0, 0, 721, 726, 0, 0, 0, 0, 0, 0, 1190, 1191, 1391, 1287, 0, 1352, 0, 1138, 0, 1288, 186, 0, 0, 288, 0, 2610, 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 831, 498, 831, 0, 1338, 307, 339, 0, 354, 349, 350, 348, 2610, 145, 2610, 145, 0, 0, 0, 0, 0, 351, 346, 347, 343, 0, 0, 356, 2500, 2572, 2754, 0, 732, 734, 0, 739, 359, 1308, 378, 377, 376, 0, 364, 0, 383, 386, 0, 361, 340, 338, 335, 303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1240, 0, 1394, 1353, 0, 1375, 1379, 0, 0, 0, 771, 1397, 1294, 1356, 0, 561, 0, 0, 580, 580, 561, 1408, 1295, 174, 1325, 163, 0, 0, 159, 0, 0, 0, 0, 153, 1398, 1296, 1357, 0, 0, 1399, 1297, 0, 0, 293, 641, 652, 658, 1302, 662, 659, 1365, 660, 1406, 1298, 0, 1402, 1328, 1360, 396, 624, 395, 1219, 1219, 1409, 1429, 1299, 1219, 0, 1336, 0, 282, 284, 0, 142, 0, 1300, 0, 1358, 1401, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1545, 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, 1338, 2610, 145, 893, 1400, 0, 1333, 0, 1373, 0, 0, 0, 408, 0, 1326, 1336, 0, 295, 1304, 0, 1367, 0, 0, 232, 231, 233, 0, 0, 0, 0, 2303, 2304, 0, 2301, 2135, 2352, 0, 1555, 996, 982, 995, 0, 978, 2570, 0, 981, 983, 0, 0, 0, 984, 988, 989, 0, 980, 977, 979, 0, 419, 0, 0, 788, 789, 0, 0, 0, 0, 870, 0, 0, 1535, 0, 150, 698, 0, 0, 0, 693, 723, 728, 0, 0, 0, 0, 475, 479, 483, 484, 485, 0, 0, 0, 0, 164, 151, 0, 911, 0, 561, 0, 781, 1219, 1412, 0, 194, 189, 0, 0, 744, 0, 1586, 0, 0, 619, 622, 621, 0, 382, 865, 863, 862, 864, 886, 861, 0, 1906, 1908, 0, 0, 0, 0, 0, 0, 631, 478, 0, 0, 568, 0, 607, 0, 0, 0, 0, 604, 0, 0, 0, 2481, 0, 882, 854, 0, 1149, 0, 1167, 1150, 0, 0, 0, 0, 1204, 1211, 1180, 1205, 1182, 1211, 0, 0, 794, 798, 797, 801, 799, 0, 795, 672, 1711, 1712, 0, 1237, 0, 0, 1531, 0, 1529, 933, 1231, 145, 0, 145, 0, 145, 1239, 1233, 1235, 1437, 0, 931, 0, 0, 924, 926, 0, 928, 0, 0, 0, 0, 1639, 1627, 0, 1837, 1673, 0, 2356, 1040, 563, 0, 0, 0, 0, 0, 0, 1056, 670, 1063, 0, 0, 0, 1078, 1073, 1075, 0, 1090, 1084, 0, 757, 0, 0, 1665, 1658, 1660, 1659, 0, 0, 1656, 0, 241, 228, 2308, 923, 0, 637, 0, 1090, 1081, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1768, 2309, 2310, 0, 0, 0, 2340, 0, 0, 2179, 0, 2150, 2152, 2165, 0, 2180, 2133, 0, 2393, 2390, 0, 0, 0, 2394, 2401, 2199, 0, 0, 0, 2401, 0, 2421, 0, 0, 0, 2194, 2196, 0, 0, 0, 2411, 2411, 0, 2201, 0, 0, 2181, 2154, 2156, 2166, 0, 0, 2289, 0, 2169, 2168, 0, 2100, 2101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2115, 2170, 2268, 0, 0, 0, 2172, 2171, 0, 0, 2336, 0, 0, 0, 2177, 515, 2182, 0, 0, 0, 0, 2188, 0, 2225, 0, 0, 0, 2123, 2299, 0, 0, 0, 0, 0, 0, 0, 2404, 2405, 2406, 2403, 0, 2090, 2073, 2093, 2067, 2071, 2075, 0, 2411, 2092, 2095, 0, 0, 2061, 0, 0, 2059, 0, 2084, 2055, 0, 0, 2086, 0, 2141, 0, 0, 0, 2246, 2241, 2242, 1763, 1763, 1763, 1763, 1760, 0, 0, 0, 1807, 0, 1807, 207, 1562, 1741, 1750, 1987, 0, 2005, 2003, 1946, 1951, 2026, 0, 1863, 1870, 1863, 1863, 0, 0, 1726, 0, 1848, 0, 1862, 1846, 1861, 0, 0, 1876, 1874, 0, 1876, 0, 1876, 0, 1840, 0, 1866, 1842, 1861, 1844, 1850, 0, 1892, 2439, 1901, 0, 1820, 1777, 0, 2290, 1131, 0, 1779, 1801, 1800, 0, 1790, 0, 1829, 1787, 1669, 1653, 0, 1644, 1626, 0, 0, 1969, 1152, 1153, 0, 1176, 0, 1095, 1096, 0, 1094, 0, 0, 0, 552, 555, 0, 1540, 0, 1407, 1324, 702, 0, 0, 0, 0, 717, 676, 718, 720, 0, 0, 719, 722, 725, 1336, 0, 301, 1310, 0, 1371, 1184, 0, 0, 1141, 0, 0, 0, 0, 0, 1112, 542, 1111, 0, 0, 0, 831, 0, 831, 0, 0, 547, 0, 497, 494, 334, 333, 0, 0, 0, 0, 391, 0, 312, 325, 389, 331, 0, 366, 0, 337, 0, 329, 352, 344, 353, 345, 365, 367, 0, 736, 737, 735, 731, 0, 738, 740, 0, 380, 0, 0, 0, 398, 360, 397, 0, 1393, 0, 1336, 0, 297, 1306, 0, 1369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1374, 0, 0, 0, 0, 776, 0, 773, 0, 580, 0, 1421, 0, 1418, 1416, 580, 0, 0, 156, 155, 0, 162, 0, 0, 0, 0, 0, 0, 1430, 1431, 1432, 0, 0, 0, 0, 0, 0, 402, 0, 304, 306, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 409, 373, 0, 889, 0, 0, 0, 411, 0, 0, 1385, 0, 0, 0, 0, 0, 1392, 1289, 2138, 2139, 2136, 1774, 2351, 0, 0, 0, 993, 0, 0, 0, 0, 422, 423, 150, 421, 446, 0, 831, 0, 0, 867, 872, 880, 2680, 2276, 2277, 878, 873, 875, 877, 879, 876, 0, 0, 0, 0, 522, 526, 0, 0, 0, 506, 0, 0, 516, 499, 502, 503, 0, 0, 694, 697, 695, 696, 0, 716, 0, 478, 531, 594, 0, 166, 0, 0, 167, 165, 0, 0, 382, 778, 0, 775, 1411, 0, 192, 0, 748, 0, 0, 0, 0, 0, 1219, 686, 0, 885, 887, 859, 0, 728, 0, 0, 643, 0, 561, 1618, 626, 0, 596, 478, 594, 603, 0, 0, 611, 381, 0, 0, 631, 382, 0, 0, 1112, 0, 881, 0, 0, 1148, 0, 0, 0, 1201, 1206, 1202, 0, 1181, 1163, 0, 1203, 0, 0, 1209, 1134, 1183, 1135, 1453, 1454, 1451, 1452, 0, 0, 0, 0, 0, 0, 1702, 0, 0, 1527, 0, 935, 0, 918, 0, 920, 145, 765, 0, 145, 0, 1631, 1633, 1632, 0, 0, 1634, 2356, 0, 1644, 1678, 0, 0, 1905, 0, 1677, 0, 0, 0, 0, 0, 1055, 0, 1049, 1051, 1076, 0, 0, 1090, 1089, 0, 1080, 1088, 1086, 1087, 1085, 0, 0, 1663, 1661, 0, 629, 0, 0, 145, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2313, 0, 2342, 2338, 0, 2147, 2314, 2392, 2408, 2410, 2200, 2400, 0, 0, 0, 2423, 0, 0, 2401, 2361, 2415, 2414, 0, 0, 2413, 2401, 2401, 2361, 2202, 2361, 0, 0, 0, 2269, 0, 0, 2099, 2111, 2112, 2113, 2329, 0, 2118, 0, 2108, 2109, 2110, 2102, 2103, 2104, 2105, 2106, 2107, 2114, 2333, 2332, 0, 0, 2174, 2175, 2176, 2335, 2183, 0, 2518, 2226, 0, 2187, 2216, 2215, 0, 0, 0, 2190, 0, 0, 2212, 0, 2270, 2456, 2031, 0, 0, 2058, 2083, 2076, 0, 2094, 2096, 2054, 2289, 0, 0, 0, 0, 0, 0, 2063, 0, 0, 2266, 0, 0, 0, 2248, 2245, 0, 0, 0, 0, 1754, 1753, 1759, 1820, 2135, 1820, 0, 1947, 0, 1847, 1843, 1845, 1851, 0, 2882, 0, 1852, 1859, 0, 1839, 0, 1875, 1871, 0, 1872, 0, 0, 1873, 0, 0, 1841, 0, 1859, 0, 1899, 1766, 0, 2237, 0, 1778, 1129, 1130, 1788, 0, 1791, 2549, 1903, 1646, 1652, 0, 1173, 0, 0, 1165, 1101, 0, 1102, 1105, 1103, 1100, 1104, 0, 0, 0, 831, 834, 840, 0, 0, 0, 832, 145, 1285, 0, 0, 0, 0, 677, 1405, 1286, 0, 0, 0, 0, 1185, 1339, 0, 0, 1309, 831, 0, 0, 0, 575, 0, 1125, 1125, 565, 309, 545, 559, 549, 616, 559, 496, 495, 0, 493, 728, 0, 0, 316, 326, 0, 321, 0, 1337, 0, 0, 0, 0, 320, 323, 322, 393, 0, 390, 0, 145, 145, 368, 733, 379, 384, 385, 388, 1344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 897, 0, 0, 913, 914, 0, 0, 0, 1242, 1243, 1241, 1376, 1377, 1383, 1380, 1378, 1382, 1384, 1381, 0, 1292, 0, 0, 769, 1340, 1413, 1415, 1414, 0, 1417, 160, 157, 158, 161, 1341, 1322, 1303, 1366, 625, 0, 0, 0, 1301, 0, 1359, 0, 1318, 1312, 0, 0, 0, 0, 0, 1404, 1332, 1364, 1403, 1330, 1362, 1329, 1361, 1331, 1363, 1323, 0, 0, 1910, 894, 0, 0, 0, 145, 145, 892, 767, 1305, 0, 1368, 1314, 0, 0, 0, 985, 0, 0, 0, 987, 427, 447, 150, 0, 787, 853, 0, 0, 869, 0, 504, 0, 510, 517, 0, 0, 524, 525, 523, 527, 557, 1219, 561, 1219, 820, 821, 0, 0, 843, 0, 692, 0, 0, 476, 0, 528, 0, 0, 480, 169, 168, 0, 0, 0, 782, 786, 784, 783, 785, 780, 0, 771, 194, 2610, 0, 0, 0, 0, 623, 617, 620, 1426, 860, 0, 1909, 761, 0, 382, 639, 0, 0, 0, 476, 631, 0, 481, 486, 487, 500, 0, 604, 595, 0, 596, 605, 606, 0, 613, 1501, 0, 632, 613, 0, 0, 0, 884, 0, 883, 0, 1151, 1168, 1169, 0, 0, 1211, 0, 0, 1213, 1208, 0, 0, 800, 803, 796, 679, 145, 0, 1530, 145, 145, 1268, 0, 929, 0, 0, 0, 1636, 1642, 1623, 0, 0, 1674, 1644, 1675, 1070, 1071, 1072, 1069, 1068, 671, 0, 1074, 1033, 1083, 759, 0, 242, 630, 0, 1034, 145, 1010, 1002, 1009, 998, 1001, 1003, 0, 1005, 1006, 1000, 997, 999, 2341, 2164, 0, 2407, 2409, 2198, 2420, 2419, 2197, 2426, 0, 0, 2389, 2417, 2416, 0, 0, 2401, 2401, 2167, 2178, 0, 2268, 2299, 0, 0, 2119, 0, 0, 0, 2173, 2877, 0, 0, 2230, 2231, 0, 2227, 2228, 2223, 2224, 2189, 0, 2667, 2207, 0, 0, 2222, 2080, 2078, 2077, 2062, 0, 0, 2060, 2085, 2056, 0, 2087, 2232, 2265, 2299, 2234, 0, 1774, 1758, 1757, 1756, 1755, 2237, 2453, 2237, 1745, 0, 1895, 0, 1898, 0, 0, 1849, 0, 0, 1853, 0, 0, 1855, 1857, 0, 0, 0, 0, 0, 0, 2442, 0, 1819, 0, 1774, 0, 1789, 0, 0, 0, 0, 1166, 1174, 1106, 0, 0, 0, 554, 836, 835, 838, 833, 839, 837, 1541, 0, 710, 711, 714, 1311, 0, 1372, 1320, 0, 1667, 544, 311, 0, 570, 0, 0, 0, 1118, 140, 1117, 0, 0, 0, 0, 0, 492, 491, 500, 319, 0, 0, 0, 313, 392, 0, 394, 314, 318, 373, 336, 328, 0, 0, 0, 1307, 0, 1370, 1316, 1343, 1395, 1290, 1354, 0, 0, 903, 0, 0, 0, 0, 1396, 1291, 1355, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 1550, 0, 0, 372, 891, 890, 373, 410, 1334, 0, 2137, 0, 986, 991, 992, 990, 0, 416, 424, 427, 0, 0, 1259, 1259, 0, 0, 501, 518, 0, 0, 505, 615, 574, 615, 0, 0, 0, 0, 0, 729, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 774, 773, 191, 0, 476, 0, 728, 0, 888, 0, 0, 0, 631, 478, 0, 0, 1615, 477, 0, 0, 489, 0, 607, 596, 604, 0, 0, 628, 0, 1494, 0, 634, 0, 0, 0, 830, 1207, 0, 1221, 0, 1162, 1132, 1216, 0, 1750, 1902, 0, 0, 0, 0, 813, 0, 683, 1260, 1528, 919, 921, 766, 1628, 0, 1629, 1635, 0, 0, 0, 0, 1679, 1671, 1077, 0, 1090, 1082, 1004, 2391, 2425, 2360, 2362, 0, 0, 2383, 2376, 2379, 2377, 2378, 2380, 0, 2375, 0, 2195, 2424, 2373, 2387, 2328, 2270, 2116, 0, 2331, 2330, 2334, 0, 2184, 0, 2185, 2229, 2191, 2208, 0, 2192, 2220, 0, 0, 2081, 2079, 2064, 2267, 0, 2252, 1728, 1727, 0, 1748, 1931, 1900, 0, 0, 1894, 0, 0, 1925, 0, 0, 0, 1860, 1878, 0, 1856, 1854, 0, 1867, 0, 1869, 2548, 2838, 2736, 0, 1806, 1808, 1811, 1813, 1812, 1814, 1810, 2236, 2238, 0, 1785, 2291, 1904, 0, 1643, 0, 1644, 1681, 1693, 1693, 1078, 0, 145, 706, 0, 0, 290, 1125, 0, 1219, 576, 2680, 577, 1124, 1128, 139, 2697, 0, 558, 570, 570, 488, 0, 317, 327, 0, 375, 387, 0, 1667, 0, 0, 901, 910, 910, 898, 0, 0, 915, 1293, 770, 0, 579, 0, 285, 1319, 1313, 0, 0, 0, 1552, 1553, 0, 0, 0, 0, 0, 1342, 145, 1315, 994, 0, 449, 457, 428, 432, 1544, 0, 1544, 0, 429, 433, 1544, 1544, 426, 1902, 445, 1259, 0, 1256, 1255, 557, 645, 0, 556, 0, 508, 0, 585, 507, 0, 844, 0, 0, 727, 0, 478, 594, 0, 541, 532, 533, 534, 535, 537, 536, 538, 539, 540, 530, 529, 0, 728, 907, 382, 1501, 768, 0, 0, 741, 0, 728, 0, 1618, 627, 596, 478, 594, 482, 500, 0, 611, 604, 607, 0, 608, 0, 612, 0, 0, 0, 631, 1554, 1112, 0, 1113, 0, 831, 1220, 1181, 0, 0, 1210, 1214, 1215, 0, 0, 0, 0, 1263, 807, 808, 802, 804, 0, 815, 819, 678, 0, 0, 682, 673, 0, 0, 0, 0, 1676, 728, 145, 0, 0, 2374, 2381, 2382, 0, 2205, 0, 0, 2399, 0, 0, 0, 2117, 0, 0, 2210, 2209, 2221, 2193, 2247, 0, 0, 0, 0, 0, 0, 0, 1739, 0, 2361, 1893, 1896, 0, 1928, 0, 0, 0, 0, 1913, 0, 1858, 0, 0, 1868, 0, 0, 0, 1815, 0, 0, 0, 1824, 1651, 1650, 0, 1647, 0, 1688, 0, 1680, 1682, 0, 0, 0, 1097, 0, 1098, 1321, 0, 1119, 0, 615, 0, 1131, 1128, 564, 0, 1219, 1219, 645, 0, 0, 330, 0, 298, 1317, 0, 0, 899, 900, 0, 0, 0, 0, 0, 0, 404, 0, 0, 1546, 0, 1547, 1548, 1551, 412, 425, 0, 455, 454, 0, 452, 451, 453, 0, 442, 0, 0, 0, 0, 0, 0, 415, 1254, 1258, 1257, 509, 0, 511, 0, 0, 571, 572, 573, 0, 513, 581, 582, 841, 0, 846, 0, 730, 0, 0, 728, 593, 752, 0, 0, 0, 1495, 0, 0, 618, 762, 1501, 631, 604, 0, 596, 490, 0, 613, 607, 611, 609, 610, 0, 1498, 0, 633, 0, 1121, 0, 829, 0, 1211, 1222, 1217, 1212, 1457, 0, 0, 805, 810, 809, 1544, 814, 0, 0, 0, 681, 680, 0, 1641, 1902, 1638, 0, 756, 1035, 2363, 2364, 2388, 0, 0, 0, 2367, 0, 2365, 0, 0, 2387, 0, 2206, 2327, 2213, 2186, 2211, 2825, 2549, 2795, 0, 2264, 2253, 2264, 2264, 2244, 0, 0, 0, 1930, 0, 0, 0, 1926, 1927, 1911, 0, 0, 1915, 1865, 1891, 0, 0, 0, 1809, 2239, 2240, 2472, 1645, 0, 0, 1690, 1692, 0, 0, 0, 1667, 0, 580, 0, 1115, 1131, 567, 615, 615, 324, 315, 374, 0, 0, 0, 908, 917, 916, 772, 1667, 0, 400, 399, 0, 403, 0, 450, 460, 0, 458, 430, 435, 0, 441, 440, 437, 436, 431, 434, 0, 521, 0, 0, 0, 0, 583, 0, 584, 0, 845, 0, 0, 0, 754, 906, 0, 0, 476, 728, 1496, 1616, 607, 596, 604, 0, 0, 598, 1125, 1125, 463, 611, 613, 1499, 1500, 0, 0, 516, 1114, 0, 1133, 1456, 1455, 1750, 0, 0, 0, 816, 817, 812, 0, 0, 1630, 1640, 0, 2368, 0, 2371, 0, 2372, 2366, 2396, 2398, 0, 2384, 2385, 0, 2257, 2256, 2255, 2259, 2258, 0, 2251, 2249, 2250, 0, 0, 0, 0, 1897, 0, 1914, 1917, 0, 0, 0, 1923, 0, 1916, 1918, 0, 1877, 0, 1889, 1817, 0, 1816, 1648, 1649, 0, 1695, 0, 0, 1683, 1684, 0, 0, 1685, 145, 291, 569, 831, 578, 1116, 0, 574, 831, 831, 1667, 902, 0, 286, 0, 405, 1549, 456, 0, 439, 438, 644, 519, 520, 512, 614, 590, 0, 589, 0, 587, 586, 842, 847, 0, 728, 896, 1501, 742, 611, 604, 607, 0, 597, 0, 140, 140, 613, 461, 0, 0, 382, 0, 1439, 1750, 1438, 1440, 1448, 1445, 1447, 1446, 1444, 0, 1266, 1267, 806, 811, 0, 0, 1902, 2369, 2370, 0, 0, 2204, 0, 0, 0, 2261, 0, 2262, 0, 0, 0, 0, 0, 1920, 1921, 1922, 1924, 1919, 1864, 0, 1818, 1689, 1691, 1686, 0, 1687, 0, 0, 0, 0, 1696, 1099, 550, 565, 585, 548, 546, 299, 909, 0, 459, 588, 561, 561, 728, 753, 1497, 613, 607, 611, 1125, 599, 601, 600, 465, 1121, 1122, 0, 613, 819, 0, 1449, 1443, 1726, 1713, 0, 0, 818, 0, 1637, 0, 0, 0, 2254, 2260, 2263, 0, 0, 0, 0, 2660, 0, 1932, 0, 0, 0, 1694, 1700, 0, 0, 0, 0, 831, 0, 592, 591, 755, 464, 611, 613, 140, 516, 1120, 0, 1902, 0, 1441, 1750, 0, 0, 824, 2395, 2397, 2386, 1744, 1743, 2843, 0, 0, 1747, 1940, 0, 2389, 0, 0, 1943, 0, 1890, 0, 0, 0, 566, 551, 401, 613, 462, 602, 382, 1123, 1107, 0, 1442, 0, 0, 826, 0, 822, 825, 827, 828, 0, 0, 0, 0, 1933, 1934, 1943, 0, 2373, 1943, 1912, 1697, 1701, 0, 1698, 466, 613, 0, 0, 0, 790, 0, 1774, 0, 0, 0, 1929, 2389, 1942, 2399, 2373, 0, 1902, 0, 0, 0, 823, 0, 0, 0, 0, 1937, 2387, 2399, 0, 1108, 824, 1264, 1265, 0, 1746, 0, 0, 1935, 2387, 1699, 0, 0, 1938, 1936, 791, 0, 1939 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -5961, -5961, -5961, 4049, -544, -1737, -5129, -1151, 5651, -5961, -5961, -961, -1375, 3264, -1229, -5961, -5961, -5961, 1506, -5961, -5961, -5961, -5961, 4014, -5961, -2954, -5961, -5961, 202, 617, 67, 82, 3724, 1731, -5961, -1019, -5961, -5961, -640, 1, -5961, 171, 327, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -823, 2005, -5961, 2099, 1344, -3385, -5961, -5961, -1560, -3828, -5961, 594, -5961, 621, -4148, -5961, -4873, -1103, -5961, -5961, -5961, 1991, -5961, -5961, -5961, 1938, 1134, -444, -5961, -5961, -5961, -5961, -5961, -5961, -924, -5961, -5961, -1239, 3, -649, -2997, -4377, -5961, -5961, 441, -486, -1527, -5961, 636, -5961, 637, -5961, -4900, -5961, -69, -2796, -4419, -5961, -5961, -5961, -5961, -458, -1533, 1377, -5961, 1440, -707, 83, -789, -1154, -1314, -5961, -3116, -2697, -1214, -5961, -344, -3611, -1312, -935, -933, -1097, -4414, -4950, -5961, -5961, -1245, -3835, -5274, -5518, -5002, -5196, 1385, -5961, -98, 442, -5961, 6, -3704, -3767, 16, 417, -5961, 20, 22, -5961, 433, -867, -979, -1623, -5961, -822, -5961, -5961, -5961, -3519, -5961, -5961, -5961, 209, -5961, -5961, -5961, -5961, 478, -5961, -5961, -5961, -5961, -5961, -5961, -3218, 1959, 1966, -5961, -4441, -5961, -948, -5961, 642, -3539, 1364, -5961, -5961, 1128, 4034, 467, -5961, -5961, -5961, -5961, -5961, -5961, -1819, -5961, -5961, -5961, -5961, -72, -427, -5961, -5961, -5961, -5961, -5961, -5961, -5961, 27, -5961, 1091, 404, -5961, -5961, -749, -5961, -5961, -5961, -5961, -5961, -5961, -1302, -5242, -1437, -1410, -5961, -3536, -5961, -5961, -5961, -402, -5961, -5961, -5961, -5961, -5961, -925, -5961, 1185, -4203, -5961, -5961, 443, -5961, -5961, -5961, -5961, -5961, -1071, -342, 3188, -5961, -610, -5961, -5961, -5961, -341, -5961, -5961, -5961, -5961, -5961, -514, -1297, 5062, 4415, -1132, 16347, -857, -583, -5961, -5961, -5961, -2771, -5961, -5961, -4310, -5961, 5054, 2519, 1148, 35, -5961, -33, 121, 3847, -5961, 1038, -1192, -3188, 383, -567, -5961, -5961, -5961, 384, -5961, -2010, -5961, -5961, -5961, -5961, -4160, 38, -5961, -4443, -5297, -4682, -4225, -1273, -5961, -4993, -5278, -4147, -5961, 1992, -5961, -5961, -513, -135, 3170, -5961, -1510, 2340, -1411, -5961, -2640, 459, 1533, 3175, -3309, -111, 3183, -3042, -5961, -708, 1120, -5961, -426, -3869, -5961, -5961, -5961, -2883, -698, -5961, -5961, 1576, 858, -5961, -5961, -5961, -5961, -632, 3139, -180, -5961, -5961, 4402, -5961, -5075, -5961, 4363, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -1471, 1293, -5961, -837, -5961, -5961, 2096, 678, -5961, -5961, -5961, -5961, 1390, -1250, -5961, -5961, -5961, -5961, -5961, -5961, -5961, -1049, -1290, -5961, -5961, -4982, -5961, -5961, -5961, -5961, -5961, 2447, -975, -755, 4263, 1166, 42, -5492, -5961, -5961, -465, -5961, 3601, -5961, -5961, -5961, -5961, -5961, 469, 473, -5961, -5961, -5961, -5961, -4038, -5961, -5961, -5097, -5961, -5961, 2085, -5961, -5961, -320, 5, 3297, -5961, -5961, -5961, -7, -5961, -5961, -1033, 2433, -5961, -2407, -5961, -601, -5961, -5961, -1940, 46, -4418, -5961, -663, -5961, 3136, -5961, -5313, -1196, -60, -5961, -5961, -4458, -5961, -5961, -932, -5961, 57, -5961, -5961, -5961, -5961, -5113, -5961, -661, -5961, -5723, 463, -3831, -5961, 21, -5961, -501, -5961, -5961, -497, -5961, -5961, -5961, -4183, 47, 44, -5961, -5961, 93, 3643, -47, -24, 33, 7, 188, 3714, -5961, -5961, -5961, 2, 3743, -5961, 53, -881, 5116, 5118, -5961, -926, -128, 412, 1646, -699, -2644, 3659, 3663, -5961, 1633, 2452, -2477, -2484, -5961, -1190, -910, -713, -5961, -5961, -5961, -5961, -1739, -680, -2656, -5961, 3664, -5961, -5961, -5961, -2480, -3414, -3318, 1674, -3380, -3248, -5961, 914, 897, -1136, -156, 207, -1505, -799, -50, -5961, -5961, 1685, -431, -5961, -5961, -429, -3341, 492, -5961, -4643, -2857, 1692, -1212, -884, -5961, -1031, -5961, -677, 1699, -5961, -3988, -1246, -5961, -4571, 390, 3741, -836, -5961, -5961, -806, 10471, -5961, -5961, -5961, 10945, 11455, -5961, -5961, 12183, 12912, -5961, -572, 13212, 9537, -783, -1938, 63, 13662, 18139, -1865, -350, 131, -5961, -3002, 1676, -5961, -5961, -5961, -394, 1008, 506, -5961, -5961, -4696, -4515, -5961, 2564, -2143, -5961, -685, 1763, -682, -5961, -5961, -5961, -2830, -5663, -2939, 2570, -5961, -5961, -5961, -167, -5961, 19126, -3283, -5961, -511, -1035, -1615, 3077, -3271, -1934, -5961, -5961, -5961, -3156, -5961, -5961, -5961, -791, -5961, -5961, 1915, -5961, -5961, -5961, -968, 2160, -751, -1231, 1797, -4541, -5961, -621, -4016, -5081, -5961, -5742, -5248, -1926, -1224, -3072, -5960, -2022, 1808, -3148, -5961, -1968, 1887, 1099, -5961, 1817, -5961, 4296, -803, 2578, -802, 15199, -709, 9164, -1306, -5961, 1606, -4634, 1095, 3858, 41, -126, 4881, -646, 2516, 3186, -5961, -5961, -6, 9623, -658, -1018, -5961, 5384, 16753, 15935, -3736, -5961 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 58, 59, 60, 61, 1120, 1125, 1933, 1952, 62, 63, 1654, 3092, 2945, 3913, 3914, 64, 65, 1650, 66, 67, 68, 69, 1564, 70, 1905, 3106, 71, 2779, 827, 864, 829, 2067, 2068, 3037, 2069, 2057, 1256, 1851, 1586, 844, 1258, 1546, 1587, 73, 74, 1420, 2646, 75, 76, 77, 1617, 1712, 1618, 1619, 1558, 5060, 5915, 3699, 2900, 3961, 3700, 3701, 4387, 4388, 3779, 4416, 4478, 5929, 5930, 78, 1728, 1729, 79, 80, 3074, 3879, 4531, 5455, 5456, 5727, 673, 5083, 5084, 5714, 5715, 5944, 6118, 6119, 3107, 704, 3956, 4616, 3904, 5155, 3905, 5156, 3906, 5157, 4950, 4951, 4376, 4377, 3890, 4563, 4564, 2133, 5096, 6262, 4565, 3907, 5116, 5762, 3908, 2866, 2794, 2795, 5468, 5385, 3141, 2026, 5383, 6245, 2024, 5662, 5741, 4935, 4936, 4452, 5967, 5968, 5969, 6268, 5118, 5161, 5162, 6155, 6156, 3959, 4622, 5168, 5515, 5739, 3657, 82, 3932, 3933, 83, 767, 1927, 4073, 768, 3144, 705, 769, 3108, 88, 3134, 5960, 3135, 1682, 2959, 4544, 4046, 89, 1148, 4339, 5540, 5823, 5824, 758, 90, 1913, 91, 92, 3087, 3897, 93, 2812, 3604, 94, 95, 3623, 3624, 3625, 96, 4573, 5476, 1620, 3688, 3689, 3690, 3691, 4408, 97, 1908, 3115, 3116, 98, 99, 100, 3248, 3249, 101, 3023, 102, 103, 104, 105, 4446, 5017, 5132, 3730, 3920, 4589, 5130, 106, 3883, 3109, 3162, 3994, 3995, 5538, 5815, 5816, 5817, 6019, 6303, 5819, 6021, 6178, 6023, 5107, 6456, 6457, 5800, 4328, 4913, 108, 5108, 5109, 5973, 109, 2810, 110, 111, 1882, 3080, 3081, 4545, 3151, 3969, 3970, 4602, 4603, 112, 3819, 113, 4993, 4994, 706, 5981, 5921, 114, 115, 4997, 4998, 116, 117, 118, 119, 120, 759, 1082, 1083, 761, 1203, 1204, 3565, 1165, 121, 2654, 122, 3859, 123, 1299, 5233, 124, 794, 1221, 1222, 3110, 126, 804, 3271, 806, 3232, 3233, 2042, 4050, 4051, 4705, 127, 128, 4054, 4055, 4712, 3245, 129, 1551, 2789, 2790, 4904, 3111, 707, 3650, 5797, 5379, 5798, 6166, 6368, 5380, 3519, 4299, 131, 708, 1592, 2849, 1171, 1172, 3155, 3974, 2758, 2759, 1751, 4643, 2761, 3976, 2762, 1524, 2763, 1158, 1159, 3982, 3983, 3984, 3985, 4639, 4649, 4650, 5532, 5808, 4646, 1901, 5526, 5527, 132, 1589, 2846, 133, 134, 135, 1633, 1006, 1181, 1182, 136, 720, 721, 137, 5732, 138, 1161, 139, 5536, 140, 141, 1285, 1286, 836, 142, 143, 2870, 4390, 144, 1590, 145, 146, 3724, 3725, 5009, 147, 148, 149, 2931, 2932, 150, 151, 152, 153, 154, 6293, 6371, 6372, 6373, 4657, 6172, 155, 1253, 156, 157, 158, 159, 197, 1047, 1048, 1049, 959, 3112, 5517, 161, 162, 1547, 1548, 1549, 1550, 2784, 163, 164, 165, 4004, 4005, 166, 167, 168, 169, 1885, 170, 171, 5705, 172, 173, 1855, 174, 175, 1056, 1057, 1058, 1059, 1853, 3463, 667, 881, 1440, 1446, 1489, 1490, 1491, 177, 771, 178, 1276, 1087, 772, 1212, 180, 773, 181, 2741, 4029, 4681, 4682, 4683, 4686, 5552, 4891, 5346, 5887, 5888, 5889, 774, 3545, 183, 2049, 3254, 3257, 3541, 775, 184, 4032, 4033, 4034, 4688, 776, 5649, 5650, 5651, 5652, 5895, 6233, 6234, 6237, 6341, 777, 796, 1151, 3166, 778, 1386, 189, 190, 191, 939, 884, 885, 3468, 5608, 5860, 779, 2639, 3449, 813, 1495, 927, 928, 929, 948, 3047, 2707, 2708, 2732, 2733, 1504, 1505, 2720, 2724, 2725, 3532, 3525, 2713, 4293, 5633, 5634, 5635, 5636, 5637, 5638, 4880, 2728, 2729, 1507, 1508, 1509, 2737, 194, 2697, 3498, 3499, 3500, 4269, 4270, 6221, 4284, 4280, 4865, 5329, 3501, 873, 1251, 1516, 4873, 6223, 3502, 5318, 5319, 5613, 4289, 3511, 4310, 3944, 3945, 3946, 3503, 5870, 5871, 6218, 6219, 5615, 5616, 3504, 5862, 6392, 6393, 6432, 6469, 2764, 1469, 912, 1387, 913, 1482, 1388, 1456, 915, 1389, 1390, 1391, 918, 1392, 1393, 1394, 921, 1448, 1395, 1396, 1465, 1478, 1479, 1397, 1441, 5617, 1399, 1400, 1401, 3506, 1402, 4809, 5290, 5276, 3372, 3373, 2064, 5598, 4805, 4184, 4799, 2632, 2636, 5341, 5640, 5641, 3442, 4234, 4837, 5308, 5856, 6055, 6056, 6202, 1403, 1404, 1405, 3434, 2626, 1009, 1406, 4547, 2628, 3363, 3341, 1754, 3342, 2075, 2096, 3290, 3306, 3307, 3410, 3343, 3351, 3356, 3364, 1407, 3292, 3293, 4095, 2098, 1408, 1053, 1757, 1054, 1484, 3392, 5256, 5563, 5564, 5841, 5842, 5574, 5843, 5575, 5565, 4106, 4107, 6044, 3317, 3411, 4110, 3325, 3326, 4128, 4117, 3318, 1409, 4119, 1417, 1418, 1411, 2043, 874, 5325, 1207, 1838, 810, 1412, 1413, 1414, 1415, 1626, 980, 1174, 1175, 930, 932, 933, 2701, 663, 655, 982, 3692, 2629, 664, 657, 658, 1843, 2630 }; /* 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[] = { 654, 72, 193, 81, 847, 176, 84, 192, 1060, 1088, 938, 1090, 1242, 1243, 1244, 1753, 85, 807, 1248, 809, 86, 185, 87, 815, 830, 1510, 770, 107, 192, 838, 830, 849, 1007, 852, 1839, 125, 830, 830, 130, 875, 1850, 878, 160, 1681, 1967, 1008, 179, 186, 934, 934, 934, 1206, 661, 1410, 2894, 1114, 1421, 182, 2972, 712, 1248, 1154, 949, 798, 1496, 2865, 1498, 3656, 1481, 798, 1461, 2864, 972, 1745, 2093, 1686, 3273, 1437, 1733, 1152, 1013, 2850, 3542, 1018, 4075, 2023, 1844, 960, 1452, 1453, 3324, 1016, 1910, 187, 3903, 3543, 1187, 828, 1460, 876, 2085, 3129, 4037, 4345, 3784, 1038, 1529, 1428, 1060, 4601, 1200, 4244, 2760, 4246, 3986, 1213, 3934, 4652, 843, 3558, 3560, 4374, 4283, 4379, 1436, 869, 1467, 2078, 4453, 4627, 4308, 2080, 2877, 3041, 2081, 2082, 3264, 652, 1883, 2933, 2933, 4937, 1888, 2933, 805, 3328, 4403, 1892, 4405, 3925, 4882, 1621, 3816, 4549, 1081, 3002, 3003, 1902, 848, 3452, 3289, 1154, 5322, 3454, 1214, 4906, 5146, 1625, 951, 943, 5519, 1922, 1197, 3196, 2693, 5573, 1643, 1060, 4266, 1259, 2760, 1660, 3312, 3316, 3319, 3320, 4614, 5175, 3329, 1895, 3331, 3332, 654, 963, 963, 5154, 3148, 963, 5115, 1680, 4687, 974, 1956, 875, 5164, 1919, 1010, 845, 1711, 974, 4977, 233, 974, 3381, 5512, 875, 3922, 963, 1738, 5261, 875, 5262, 1060, 1593, 963, 952, 875, 1185, 5209, 4312, 1189, 5334, 5745, 5336, 5825, 4297, 5784, 1852, 2998, 887, 5163, 3537, 5480, 4112, 863, 4313, 3534, 4611, 3461, 1503, 4212, 5667, 872, 4281, 5827, 4286, 4287, 5381, 5659, 5508, 718, -2594, 3348, 4215, 1588, 3030, 5995, 2823, 1506, -2446, -2636, 780, -2481, -2662, -2705, 5742, 5983, 4114, 1918, 671, -2514, -2481, -2481, 5281, 1060, 3862, 1949, 3865, 3866, 6040, 5511, 780, 3870, 3871, 3872, 3513, 3874, 3875, 3876, 4148, 5125, 3390, 6192, -2002, 1875, 1588, 1949, -1969, 1552, 1223, 1588, 3893, 1436, 6185, 713, 3390, 5697, -2598, 5032, 1560, 1449, 1450, 3015, 780, -2482, -1982, 1043, -2893, 780, 4201, 6036, 1459, 3126, -2482, -2482, -2007, -2893, -2893, -2027, 5707, 5708, 879, -1997, 1880, 718, 3269, 1227, 718, -2010, -448, 5920, 1141, -2445, 718, 3243, 5735, 718, 6187, 3250, -2010, 3243, 4637, 1293, 3009, 6213, 4709, 6264, 4077, 4566, 4125, 3072, 1442, 3843, 3012, 1255, 5432, 2154, 1949, 3227, 3243, 2868, 6037, 2054, 4060, 1622, 718, 5733, 1622, 6195, 5906, 780, 5835, 2996, 780, 2933, 2936, 5126, -1802, 2940, 5433, 2698, 1154, 5534, -150, 780, 5550, 4346, 958, 2658, -150, 1899, 3090, 2154, 4062, 5235, 5236, 5237, 2791, 5239, 5240, 5241, 5242, 5243, 1553, 1518, 946, 3894, 1238, 5176, 2796, 3388, 1044, -2659, 1031, 1561, 5099, 1949, 2792, 5821, 786, 1949, 2660, 911, 4718, 2658, 2058, 1216, 5956, 786, 2070, 2070, 786, 786, 1745, 6474, 5878, 2868, 2797, 786, 2704, 6307, 5100, 1839, 787, 1499, 5658, 1897, 3484, 1844, 5473, 1500, 1133, 787, 1560, 3095, 787, 787, 2660, 1949, 6161, 5278, 6214, 787, 4148, 3246, 6235, 2838, 854, 5127, 5674, 3516, 3251, 1246, 2711, 1499, 786, 6149, 1045, 5378, 2055, 1634, 6104, 5857, 4064, 3649, 5384, 2652, 2154, 1134, 2154, 5389, 2154, 5997, 3778, 4710, 1279, 2700, 1452, 1453, 787, 1008, 2062, 3810, 2981, 4679, 2868, 2868, 3101, -2274, 4537, 6503, 4089, 808, 2868, 5391, -2274, 2669, 1975, 2869, 2658, 3127, 668, 5397, 2658, 6515, 2876, 1135, 3131, 3431, 1460, 3218, -2293, 1501, 2982, 4115, 3432, 2868, 3811, -2293, 1108, 1438, 5785, 1046, 4680, 2063, 1118, 6236, -1112, 4472, 5917, 1008, 4148, 2660, 5858, 2660, 718, 2660, 1132, 1635, 6105, -1802, 3517, 1501, 1467, 1247, 3247, 2839, 2107, 1561, 4065, 1475, 5474, 6265, 855, 4202, 2868, 1136, 5279, 1950, 3096, 2044, 900, 1965, 1154, 1502, 5957, 4598, 2895, 2712, 1554, 6339, 5101, 6397, 1154, 1154, 1239, 2005, 3091, 1950, 4719, 3389, 2052, 1488, 4144, 714, 1844, 2868, 5822, 2868, 6095, 2798, 2077, 5551, 1949, 4061, 2148, 2056, 1949, 2793, 3895, 1154, 3073, 6285, 2868, 2696, 1519, 4126, 2086, 1949, 3099, 3045, 6384, 1555, 5773, 6215, 5955, 5836, 4711, 2090, 6216, 2800, 1063, 3243, 3244, 4063, 2642, 3228, 875, 5128, 963, 2047, 963, 6230, 5535, 963, 2695, 4093, 4549, 6266, 192, 4346, 1010, 4203, 6231, 715, 6132, 1121, 1556, 963, 1950, 3391, 5434, 5627, 1091, 963, 6217, 5082, 5736, 1562, 880, 2002, 4567, 1881, -2659, 4219, 5012, -1969, 6267, 6092, 3598, 1965, 3039, 3040, 1146, 2967, 1632, 1965, 2970, 654, 938, 3128, 3252, 6160, 2939, 3016, 1247, 716, 974, 717, 1089, 1247, 1010, 1900, 3896, 974, 4707, 2671, 974, 2878, 2977, 1449, 1450, 3253, 5129, 2828, 1744, 2895, 2830, 1950, 2997, 6041, 3844, 1950, 963, 3017, 5555, 6038, 2837, 5124, 6358, 1557, 6514, 672, 1217, 1951, 1092, 1563, 5591, 4638, 3038, 2895, 4204, 192, 6520, 6186, 2990, 2991, 1881, 1459, 1304, 1447, -2659, 4148, 6357, 1958, 2653, 4149, 4150, 4151, -1969, 1950, 6039, 2912, -2659, 3285, 3010, 3478, 4116, 1051, 5172, -2446, -2594, 1052, -2481, 5390, 3013, 2911, 875, 792, 793, -2636, 2738, 830, -2662, -2705, 5399, 830, 830, 6188, 4163, -2514, 1296, 1220, 1511, 1225, 3029, 1229, 3046, 5990, 2956, 2739, 1287, 1233, 4942, -2002, 4944, 6115, 5019, 1451, 1236, 792, 793, 6410, 5023, 2957, 792, 793, 2896, 2960, 2961, 1416, 1416, 875, 830, 830, -2482, 1455, -2598, -2893, 5171, 1462, 1463, 3198, 3082, 2895, 875, -2007, 6287, 3216, 2108, 875, 1462, 1463, -1997, 2147, 2150, 1416, 6277, 2640, 1464, 4283, 2845, 5993, -2445, 3259, 2676, 2677, 6461, 1881, 4127, 1466, 6445, 1652, 1866, 3627, 4549, 2625, 3226, 4467, 4468, 843, 6246, 6247, 4469, 1264, 1266, 1008, 1623, 1624, 3241, 1623, 1624, 2699, -2274, 1962, 951, 1653, 4315, 1973, 4316, 1051, 792, 793, 1416, 1052, 4473, -150, -150, 5560, 2622, 2623, 2624, 2625, 3433, 2845, 1862, -2293, 875, 6306, 1867, 2674, 1868, 72, 193, 81, 1950, 176, 84, 192, 1950, 875, 2845, 2048, 1857, 4862, 1051, 1995, 85, 4866, 1052, 1950, 86, 185, 87, 3713, 875, 1545, 6337, 107, 4599, 4592, 4152, 952, 4611, 2895, 3100, 125, 6239, 5902, 130, 4758, 4759, 4763, 160, 875, -1969, 2896, 179, 186, 963, 963, 4529, 4530, 6159, 4153, 4510, 6251, 4923, 182, 5086, 4160, 4161, 4162, 4163, 2920, 6360, 2746, 4689, 4895, 2048, 2896, 4852, 4982, 4854, 4855, 5085, 4599, 2801, 4704, 6232, 1250, 830, 830, 2897, 3291, 6399, 2620, 2621, 2622, 2623, 2624, 2625, 6133, 2637, 187, 6467, 970, 2895, 4590, 4744, 4302, 3060, 6153, 5358, 1416, 1416, 3534, 1104, 718, 3599, 2822, 2895, 2895, 5772, 2898, -1941, 4248, 3695, 654, 1168, 963, 1424, 1426, 1471, 974, 4821, 2895, 1010, 974, 5359, 974, 1443, 3705, 2895, 2895, 963, 1270, 3323, 2879, 2781, 2899, 4154, 2132, 1250, 4647, 6409, 4158, 4159, 4160, 4161, 4162, 4163, 2880, 3618, 2881, 5853, 4524, 1742, 5787, 875, 2918, 3745, 6141, 718, 2896, 5696, 963, 963, 3437, 843, 1264, 1998, 6313, 5788, 2969, 1965, 3696, 797, 6152, 1166, 718, 2893, 718, 797, 5778, 2700, 4704, 3631, 875, 875, 875, 3104, 963, 3881, 654, 6348, 654, 654, 2999, 4125, 3142, 3018, 1472, 5195, 6315, 1166, 5596, 4990, 2855, 3655, 1492, 4937, 2727, 6017, 6363, 6364, 4653, 3387, 5010, 6286, 2882, 6492, 2897, 1515, 6283, 6284, 4341, 4114, 665, 2007, 963, 6338, 963, 963, 1304, 1520, 6029, 4148, 1567, 718, 1844, -3020, -3020, -3020, 5140, 6464, 2897, 6193, 1060, 3746, 6295, 5892, 3619, 2898, 6194, 1717, -1969, 953, 1702, 3138, 5680, 718, 6278, 6018, -1969, 1416, 1451, -1969, 1480, 6478, -1969, 6468, 4370, 875, 2896, 1914, 3105, 2898, 1521, 2899, 1473, 666, 6065, 1474, 192, 4550, 3139, 3632, 6316, 5597, 4363, 3697, 3031, 2025, 5848, 2025, 3238, 3239, 1718, 875, 6502, 807, 1965, 2899, 3747, 4381, 2919, 944, 4654, 4546, 2859, 5113, 3990, 1522, 1294, 4580, 3655, 953, 1915, 3438, 2893, 3299, 1533, 5854, 718, 1984, 2009, 2073, 2011, 953, 2013, 5963, 2015, 4553, 2017, 2018, 2019, 2896, 1644, 4991, 2897, 2021, 6447, 6365, 2893, 1743, 875, 3019, 3200, 954, 2089, 2896, 2896, 5855, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 3706, 1416, 5043, 2896, 3748, 1985, 4132, 6295, 2898, -2442, 2896, 2896, 945, 5529, 5789, 3177, 3225, 5498, 6064, 4068, 3230, 5979, 4431, 5510, 6339, 3237, 3647, 6317, 3240, 3189, 5987, 946, 4556, 5976, 2899, 938, 4644, 2975, 955, 3629, 1475, 3991, 3195, 1416, 1271, 3557, 1218, 1534, 2638, 5573, 6004, 6030, 3628, 6408, 1941, 5989, 971, 4382, 1218, 3882, 4026, 4938, 3923, 5992, 6415, 6411, 2861, 1105, 5354, 5975, 3300, 3173, 1416, 1416, 1416, 2893, 1416, 5554, 3622, 1169, 6431, 6340, 1942, 1140, 5504, 3490, 6031, 2897, 4992, 4105, 1645, 2148, 3858, 5372, 5360, 1471, 1943, 1416, 955, 5991, 3207, 1535, 3715, 3194, 5573, 6446, 4648, 946, 3698, 4457, 1088, 5232, 1090, 4126, 719, 3083, 4465, 4475, 2898, 5964, 2862, 3562, 1272, 1515, 875, 4655, 2791, 3853, 3749, 3140, 2656, 4512, 1719, 6295, 1273, 3714, 1263, 4432, 4925, 4984, 6476, 4115, 1416, 5463, 2899, 3175, 4581, 1141, 4559, 3301, 2897, 4342, 1916, 1944, 5114, 5849, 1861, 1476, 3416, 2740, 3188, 2743, 3952, 3190, 2897, 2897, 1008, 1870, 2705, 2706, 6170, 2710, 6493, 4154, 1472, 1241, 5323, 4145, 4146, 2897, 1932, 2898, 4165, 1878, 6318, 2893, 2897, 2897, 1416, 5499, 3339, 5898, 1416, 1416, 1280, 2898, 2898, 4560, 2989, 5965, 4656, 5044, 1986, 875, 875, 875, 2745, 2899, 1416, 2972, 2898, 6323, 5813, 4561, 812, 3229, 1536, 2898, 2898, 3235, 3236, 2899, 2899, 4196, 4197, 952, 952, 3302, 952, 1043, 3303, 1610, 830, 6143, 1051, 1142, 2899, 5814, 1052, 5151, 2863, 956, 5326, 2899, 2899, 1720, 6353, 5330, 2893, 4690, 5332, 3539, 1473, 1722, 1493, 1474, 3846, 947, 1945, 1723, 3750, 4479, 2893, 2893, 4027, 1917, 5152, 2834, 3751, 2802, 5477, 3752, 830, 3618, 3284, 963, 1646, 2893, 3286, 1662, 3288, 3992, 2780, 684, 2893, 2893, 3295, 1281, 875, 2867, 4383, 4384, 3309, 3310, 3934, 2806, 3993, 875, 5185, 833, 963, 1219, 3453, 3417, 3333, 3481, 2807, 5916, 3418, 653, 1043, 3138, -1803, 1219, 3353, 1987, 6207, 4562, 5105, 1647, 3368, 4385, 1663, 4433, 5151, 4303, 4774, 1010, 4775, 875, 4476, 1946, 830, 5566, 1044, 2935, 2935, 41, 3139, 2935, -1137, 3975, 1703, 3563, 3159, 2841, 3564, 2793, 1545, 830, 3304, 5152, 875, 1545, 1648, 875, 5567, 686, 6171, 3419, 1494, 1692, 2074, 5568, 4549, 3540, 4434, 3160, 1724, 4273, 4885, 1844, 3619, 1839, 5786, 1475, 45, 5569, 5946, 963, 5948, 1881, 4477, 3482, 5952, 5953, -3020, -3020, -3020, 4158, 4159, 4160, 4161, 4162, 4163, 1542, 875, -723, 1543, 5791, 1045, 4435, 41, 6197, 6276, 2841, 1143, 5792, 963, 963, 963, 963, 875, 3753, 5142, 1044, 1515, 1106, 1515, 1107, 49, 6387, 2841, 3618, 6354, 2714, 875, 1693, 1545, 41, 5777, 684, 1545, 4995, 50, 1947, 2760, 1416, 1416, 1416, 2760, 45, 2803, 1144, 1965, 3800, 5145, 3728, 4274, 5076, 3806, 3801, 6429, 3218, 5080, -1110, 6094, 5706, 51, 3322, 3322, -474, 3577, 5104, 2797, 1046, 6388, 3305, 45, 1694, 4546, 1282, 5153, 2715, 3349, 1610, 1695, 4028, 6167, 4413, 1696, 1045, 4275, 3370, 4776, 49, 3220, 1683, 2808, 5106, 3186, 4414, 1476, 3807, 3753, -1803, 3365, 4276, 5008, 50, 1499, 961, 1008, 1008, 4954, 686, 1475, 1145, 4304, 1146, 973, 5570, 49, 1147, 1283, 3420, 1284, 1477, 973, -1726, 4277, 973, 3619, 51, 3176, 6484, 50, 3729, 3808, 6356, 1684, 2809, -1726, 1086, 2714, 3161, 875, 3169, -1726, 4955, 2804, 697, 57, 698, 5492, 669, 1046, 875, 2644, 4278, 51, 5320, 4890, 4886, 1725, 963, 963, 6147, 3218, 3620, 3802, 3622, 4358, 688, 2785, 4996, 4274, 195, 3265, 57, 1896, 963, 3702, 797, 6198, 797, 2786, 797, 1573, 5327, 5703, 1027, 2715, 797, 1234, 1235, -474, -1726, 1501, 875, 2935, 2717, 5793, 6488, 2787, 3579, 6491, 1726, 3726, 5481, 4275, 1268, 3621, 3218, 5704, 963, 963, 963, 963, 2993, 991, 6407, 1028, 196, 875, 4868, 1461, 992, 993, 994, -1726, 875, 4883, 2645, 3149, 1210, 6042, 1998, 1224, 1226, 1228, 3538, 1727, 1230, 1231, 1232, 5982, 4956, 4277, 654, 1502, 4359, 654, 1237, 4470, 6243, 1685, 5996, 5482, 4279, 195, 2716, 974, 974, 3366, 1008, 2718, 3221, 3814, 3578, 1965, 1881, 1697, 1010, 1010, 5648, 4980, 974, 1304, 5571, 974, 4148, -1726, 3764, 2943, 4149, 4150, 4151, 6175, 2946, 665, 5572, -1726, 834, 3673, 963, 963, 3580, 4546, 697, 3222, 698, 963, 4814, 875, 6043, 196, 875, 3726, 4884, 2717, 1698, -1137, 6260, 3223, 1699, 1649, 1533, 192, 2962, 5623, 3622, 5679, 2025, 1297, 701, 1900, 5820, 1896, 2916, 963, 5097, 974, 4471, 6003, 3234, 974, 974, 3644, 875, 875, 850, 963, 942, 3510, 1110, 853, 1111, 5558, 875, 1700, 4708, 3224, 5328, 4008, 4981, 3803, 1701, 3270, 3210, 3674, 3211, 2885, 3212, 3021, 3213, 5711, 3214, 3027, 3315, 6367, 3215, 4721, 3737, 3891, 2718, 6261, 4279, 835, 875, 3745, 2788, 875, 3149, 2962, 807, 870, 3809, 807, 3275, 192, 797, 5355, 1416, 4689, 1416, 882, 4745, 2886, 3804, 1416, 1416, 4749, 3909, 1091, 1534, 5098, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 3847, 3848, 3849, 1416, 5479, 1416, 1010, 1416, 1416, 1416, 1416, 1416, 1416, 1154, 3805, 1416, 4357, 1416, 1416, 3763, 1089, 1416, -1726, 3934, 3765, 2885, 195, 6169, 2972, -173, 2760, 3738, 3768, 3739, 4192, 3771, 1416, 1416, 1416, 1535, 2760, 797, 6151, 5503, 4733, 3675, 4757, 5356, 3746, 3469, 5653, 1271, 5655, 3830, 1416, 2963, 1092, 3790, 3815, 1723, 2964, 2886, 940, -2465, 1133, 1900, 5490, -173, 2873, 3812, 2874, 3740, 196, 4153, 684, 5949, 6449, 4748, 3032, 5809, 5950, 4908, 4753, 4754, 3938, 3939, 3940, 3941, 4675, 3943, 6485, 4703, 3837, 3641, 963, 3274, 5974, 4002, -173, -1773, 5094, 1134, 4295, 3747, 3813, -1773, 5469, 4909, 5471, 6150, 4384, 3676, 1998, 4056, 3971, 2760, 968, 2904, 3853, 2933, 2963, 3033, 1713, 780, 4519, 2964, 4908, 5095, 3397, 1272, 3398, -1726, 1530, 6486, 1665, 3055, 2875, 5951, 4704, 4593, 4968, 1273, 3255, 6472, -1726, 6475, 3066, 4897, 686, 1689, -1726, 6008, 4909, 4037, 1536, 957, 1666, 3399, -636, 3910, 4154, 3781, 3084, 3782, 41, 1714, 3748, 3786, 3831, 1715, 4910, 4770, 4771, 4772, 4773, 1531, 6168, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, -1773, 1652, 1136, 6025, 5450, 1690, 5451, 5452, 5453, 5885, 4849, 5890, -1726, 1716, 4090, 1416, 45, 4474, 6279, 4091, 1538, 1667, 6516, 1532, 4898, 1653, 786, 4428, 4910, 3158, 961, 5752, 4851, 1537, 5886, 3400, 3, 4, 5891, 973, 1691, 3034, 1538, 1525, 3170, -1726, 973, 1166, 3174, 973, 787, 4182, -1773, 3035, 4825, 4826, 3964, 4189, 36, 5986, 49, 4911, 797, 3526, 4511, 4912, 797, 797, 2008, 1416, 4429, 2010, 1539, 2012, 4938, 2014, 1540, 2016, 3193, 1166, 36, 2020, 1526, 3036, 5547, 5753, 1527, 5954, 5754, 2942, 5459, 3401, 3402, 3403, 3404, 5755, 1652, -1726, 3405, 3406, 4623, 5703, 764, 3749, 3407, 4430, 4911, -1726, 6176, 4045, 4912, 1541, 3466, 5919, 1668, 941, 1652, 57, 5923, 5924, 1653, 1528, 15, 5756, 5460, 5704, 1416, 1261, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 6389, 3467, 2070, 1653, 1920, 6177, 6359, 6332, 697, 1542, 698, 1998, 1543, 2648, 3911, 234, 6490, 958, 3926, 764, 41, 670, -150, 20, 6369, 6390, 4319, 4899, 1921, 762, 2905, 1451, 6333, 2694, 4900, 1669, 780, 702, 6504, 15, 1670, 4901, 1051, 1992, 6241, 1671, 1052, 5757, 851, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 5062, 45, 5758, 2971, 1304, 2926, 1544, 4148, 3912, 1993, 5045, 4149, 4150, 4151, -1726, 5759, 966, 5703, 6513, 20, 4300, 4902, 2950, 5063, 4044, 4938, 780, -1726, 1655, 4815, 41, 4660, 4245, -1726, 5046, 6522, 4661, 1462, 1463, 1673, 3750, 5704, 1462, 1463, 4903, 49, 795, 1730, 3751, 3382, 1734, 3752, 795, 989, 4938, 2675, 1464, 990, 5908, 50, 5179, 1466, -1726, 1033, 2682, 4661, 2683, 3408, 2148, 45, 2686, -2438, 4174, -1725, 4176, 4177, 1051, 2692, 1241, 3409, 1052, 1042, -1726, 51, -2439, 1451, -1725, 1480, 1675, 1051, 4894, 1241, -1725, 1052, 1642, 1451, 1051, 2694, -2446, 1659, 1052, 1050, 57, 3401, 3402, 3403, 3404, 1845, 1154, 2094, 1846, 57, 1676, 49, 5320, -1726, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 6477, 1416, 50, 3164, 2004, 3165, 1051, 1846, 1678, 1485, 1052, 875, 1416, 1094, 1416, 2079, -1725, 3611, 1846, 1101, 2655, 875, 4480, 1846, 3374, 2668, 51, 3377, 2669, 875, 1008, 1416, 1115, 2702, 963, 1416, 1846, 1451, 1416, 2694, 1416, 3462, -1726, 1416, 797, 57, 1129, 1416, 33, -1725, 961, 4108, -1726, 4109, 797, 1096, 973, 4347, 5713, 1679, 973, 3608, 973, 3612, 3613, 1457, 1458, 6182, 5093, -635, 3509, 3204, 4253, 4254, 2669, 5223, 875, 875, 4314, 1138, 41, 4247, 3605, 3043, 3044, 6343, 3217, 1416, 1137, 3218, 6346, 6347, 5231, 4389, 4153, 1139, 1416, 1416, 1234, 1235, 1156, -1725, 33, 5760, 3219, 3640, 5761, 3218, 1160, 5254, 875, -1725, 3262, 3, 4, 3263, 5259, 5260, 3548, 45, 3465, 3470, 3549, 1998, 2669, 2669, 1934, 6259, 1936, 1937, 3483, 3485, 3486, 3581, 41, 3584, 3535, 3536, 4290, 2695, 6009, 797, 4967, 4546, 3638, 797, 797, 3639, 3720, 830, 3887, 3721, 1844, 3888, 4036, 4273, 4236, 3218, 4237, 5904, 807, 4217, 807, 49, 4238, 4088, 4239, 765, 2669, 5147, 4620, 2153, 4621, 45, 2154, 4609, 1416, 50, -3020, -3020, -3020, 4154, 4097, 4350, 4692, 2669, 5087, 654, 5088, 1598, 974, 1010, 974, 974, 4103, 1599, 963, 2669, 3744, 875, 1167, 51, -1726, 4957, 1176, 4964, 2658, 3505, 4273, 4104, 1706, 4123, 2669, 2659, 3846, 1183, 4147, 49, 830, 4134, 766, 4941, 2669, 4167, 6291, 29, 2669, 1177, 4175, 4181, 2867, 50, 2669, 4186, 4274, 4251, 4187, 843, 2669, 2660, 1601, 1194, 1492, 4406, 3661, 875, 4407, 6443, -1797, -1797, 3082, 3672, 29, 4323, 1211, 51, 4411, 4924, 1201, 4412, 875, -1725, 4720, 4439, 4199, 5801, 4440, 4508, 4275, 4423, 4440, 1051, 1462, 1463, 57, 1052, 4205, 4596, 4206, 3834, 665, 6238, 875, 4276, 780, 4632, 2760, 4274, 4633, 1492, 1492, 2841, 5269, 4635, 5270, 1707, 4636, 1602, 4666, 4795, 1240, 4667, 4796, 875, 1603, 4207, 4277, 4231, 1604, 4806, 1241, 4568, 4807, 4320, 4321, 4817, 830, 4893, 2669, 5148, 3564, 4275, 3218, -1801, -1801, 1154, 4448, 41, 1252, 5205, 4983, 4454, 5206, -1800, -1800, 4278, 4276, 1605, 797, 963, 1245, 4538, 963, 4334, 5210, 1249, 6380, 5211, 944, 5225, 5266, 1261, 2048, 2669, 41, 5910, 5911, 5299, 2661, 4277, 2669, -1774, 6417, 2662, 6418, 4892, 45, -1774, 875, 875, 3400, 5304, 6157, 1606, 2669, 3349, 3349, 1267, 5349, 5884, 3349, 3564, 1268, 3817, 4938, 3820, 3822, 5375, 4278, 5505, 5376, 1269, 5506, 45, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 3780, 6057, 6058, 5542, 6097, 6098, 4667, 49, 1275, 3626, 5839, 2664, 5840, 945, 1416, 1416, 1416, 1277, 3349, 3349, 1416, 50, 1288, 3401, 3402, 3403, 3404, 1485, 963, -1714, 4208, 4846, 4279, 4848, 49, 5588, 4209, 5165, 5589, 5590, 5610, 963, 2669, 5611, 1278, 51, -1774, 1416, 50, 963, 1708, 6450, 5620, 5626, 1608, 1998, 4606, 1289, 5628, 5158, 4444, 4606, 2867, 5747, 6292, 1609, 5748, 875, 5767, 1290, 2665, 3218, 51, 3924, 5802, 1610, 807, 5803, 5867, 1291, 5873, 5868, 4460, 1998, 5313, 4279, 5315, 1611, 963, 3935, 5876, 57, -1450, 4606, -1450, 6203, 6204, 5938, -1774, 3817, 5939, 5978, 6005, 3975, 2647, 6006, 4586, 6028, 946, 963, 6006, 3957, 6048, 3735, 6049, 4187, 6069, 2669, 4867, 6070, 4870, 4081, 6073, 4083, 4084, 1998, 1273, 5503, 6074, 6506, 1709, 2669, 6082, 1613, 1614, 6083, 1292, 6103, 6106, 4938, 3263, 3263, 4078, 6107, 4801, 6110, 3263, 5605, 2669, 5606, 963, 1298, 963, 6111, 963, 6112, 2669, 6139, 6113, 6209, 6140, 6224, 4606, 6226, 2669, 1710, 2669, 2667, 6240, 6255, 6281, 3218, 6256, 6282, 3297, 3298, 6331, 1300, 6366, 5881, 4035, 6006, 3607, 6413, 6433, 1427, 6414, 6434, 3615, 2025, 4940, 3334, 3335, 4943, 4210, 6441, 4946, 6444, 5206, 1429, 2669, 2700, 2760, 1430, 4600, 6081, 4211, 3953, 6471, 6473, 1431, 6070, 2669, 1154, 1435, 1154, 5578, 5579, 935, 936, 1439, 1304, 3380, 1008, 4148, 1445, 3505, 1444, 4149, 4150, 4151, 4569, 6481, 4571, 3658, 6482, 4713, 4727, 1616, 1447, 4579, 6519, 4582, 1451, 6434, 1454, 5296, 654, 963, 1745, 974, 6521, 974, 974, 6482, 963, 6523, 6157, 947, 6434, 1455, 1468, 1416, 4938, 1470, 1497, 1485, 1416, 1486, 1512, 1513, 1514, 1517, 1523, 2616, 1565, 1480, 938, 4030, 1591, -2483, 1594, 1596, -3020, -3020, -3020, 2620, 2621, 2622, 2623, 2624, 2625, 1597, 1637, 1632, 1638, 1649, 1154, 1636, 1844, 1651, 1661, 1665, 1664, 1688, 1704, 1705, 2153, 1721, 1731, 2154, 4698, 1732, 1735, 1740, 4641, 1416, 1416, 1416, 1741, 1854, 1416, 4967, 1856, 1666, 938, 1858, 1863, 4296, 1416, 1416, 1416, 1416, 1869, 1874, 1877, 1884, 1879, 1887, 1889, 1881, 1898, 2658, 1903, 1904, 1416, 1906, 6289, 1416, -3020, 1416, -137, 1907, 1909, 1912, 1923, 2153, 1911, 1930, 2154, 1932, 1935, 1416, 1416, 1939, 214, 1416, 1948, 5717, 1954, 1953, 3702, 1955, 4978, 1957, 2660, 1667, 1960, 1961, 1964, 5582, 1965, 1988, 5373, 1010, 1972, 1416, 1976, 1416, 4938, 1416, 2658, 1978, 1979, 1981, 1983, 1989, 1991, -3020, 3726, 4958, 1994, 1997, 2000, 2003, 2001, 2006, 2053, 4722, 1416, 2022, 2065, 4235, 2076, 2083, 5718, 875, 2091, 2084, 2087, 2092, -1973, -1980, 2099, 2660, 2100, 938, 2101, 2102, 2103, 5207, 57, 2105, 2106, 875, 2107, 4153, -1970, -1971, -1974, 5719, 2109, 2110, 2111, 3885, 2112, 4961, 2113, 4198, -1972, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 5720, 4920, 2124, 1665, 2125, 654, 5721, 2126, 3509, 4271, 1668, 2127, 2128, 4271, 4285, 4271, 4271, 4241, 4242, 4243, 2129, 2132, 1416, 5192, 2130, 1666, 2695, 1416, 5722, 2131, 2134, 2135, 5723, 2136, 2137, -3020, 2631, 2138, 4216, 2139, -3020, 2140, 1416, 2141, 2633, 2635, 1304, 5724, 2637, 4148, 2649, 2638, 2647, 4149, 4150, 4151, 3509, 2672, 4311, 3509, 2650, 2678, 2673, 2680, 4154, 2681, 5831, 2690, 1669, 2684, 2685, 2153, 961, 1670, 2154, 961, 2687, 1667, 1671, 5068, 2688, 2696, 2689, 2691, -3020, 973, 973, 2703, 5081, -3020, 1500, -3020, 2734, 2747, 2971, 1502, 2736, 1416, 2748, 2749, 973, 2750, 2766, 973, 2767, 1088, 2658, 1090, 2768, 2769, 2694, 5073, 2770, -3020, 2771, 2773, 2772, 2774, 2775, 2776, 2777, 963, 963, 2783, 2805, 2811, 2799, 2825, 2829, 2832, 1673, 2831, 2833, 2835, 6448, 2847, 2853, 5007, 2836, 2660, -3020, 2871, 3505, 2851, 2872, 3505, 2852, 2887, 2889, 2883, 2665, 4767, 2893, 5725, 2890, 973, 2891, 1416, 2892, 973, 973, 188, 2901, 2902, 2907, 4369, 2903, 2906, 2908, 2913, 1668, 4070, 2914, 2927, 2941, 2917, 2923, 2924, 2937, 1675, 2938, 2944, 188, 2951, 2958, 4794, 4080, 2965, 1492, 2947, 2948, 4085, 2953, 3505, 2968, 2954, 3505, 2966, 2973, 2665, 1610, 2983, 2985, 1676, 2987, 2974, 2994, 4056, 2979, 2980, 5726, 2992, 4824, 2986, 2995, 4417, 2988, 3011, 937, 3042, 3000, 4111, 3001, 3014, 1678, 3054, 3020, 3056, 1669, 4828, 3025, 3057, 3049, 1670, 3058, 3070, 5845, 4834, 1671, 875, 4296, 3059, 2700, 3063, 3071, 3064, 3065, -3020, 3067, 2935, 3075, 3068, 3069, 3076, 2971, 3077, 3078, 3085, -3020, 3086, 3089, 4153, 679, -3020, 3094, 3102, 3113, 5866, 1685, 3117, 3118, 3121, 3130, 3133, 3136, 1679, 3137, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 3146, 3157, 3163, 3167, 1673, 5525, 3179, 3181, 3182, 3322, -3020, 3477, 3479, 3183, 3184, 3197, 3209, 3487, 3272, 3231, 3150, 3242, 3369, 3291, 3256, 3375, 2154, 3415, -3020, 3441, 3435, 3349, 3349, 3349, 3349, 3456, 3458, 3349, 3349, 3349, 3349, 3349, 3349, 3349, 3349, 3349, 3349, 3459, 3154, 3533, 3533, 3172, 3296, 1675, 3261, 3336, 3473, 3379, 3457, 3474, 3395, 1475, 4154, 3413, 3440, 4798, 3488, 950, -3020, 3471, 3472, 3510, 1416, 3528, 3475, 945, 3476, 1676, 1416, 3480, 2620, 2621, 2622, 2623, 2624, 2625, 3546, 2665, 3489, 963, 3515, 3527, 3529, 3544, 3547, 3553, 3554, 3530, 1678, 3573, 3582, 3349, 3349, 3556, 3585, 3587, 3590, 722, 3595, 5220, 3606, 797, 3600, 3601, 3603, 3614, 811, -3020, 3630, 3635, 3645, 3637, 3651, 3652, 3653, 3664, 875, 875, 875, 2620, 2621, 2622, 2623, 2624, 2625, 3654, 3703, 3677, 3682, 3683, 3710, 3709, 3711, 875, 3716, 3719, 4858, 3727, 3734, 1679, 3736, 3758, 3737, 3774, 3757, 3818, 1900, 1416, 3833, 3841, 3842, 3845, 946, 3854, 3861, 3867, 5120, 5121, 3873, 3878, 3868, 3869, 3889, 3900, 3901, 2025, 875, 875, 3915, 3919, 3921, 875, 3929, 3936, -3020, 3917, 3942, 3947, 3948, 3949, 3950, 3951, 3955, 875, 3958, 3960, 3962, 3660, 3963, 3966, 3967, 5486, 3972, 3987, 3988, 5158, 5291, 3997, 3989, 4001, 3998, 3999, 4017, 938, 4003, 4019, 5215, 5216, 5217, 5218, 5219, 4020, 4023, 4025, 4038, 4039, 4040, 4041, 4335, 5338, 2153, 4042, 4053, 2154, 4043, 4059, 4338, 4057, 4066, 4074, 4082, 1998, 4102, 1995, 4058, 1962, 4047, 1247, 4118, 963, 4072, 4048, 4122, 4099, 4684, 3313, 4100, 4035, -2266, 4105, 4101, 4200, 4180, 4214, 4249, 2658, 4113, 4183, 4225, 4124, 4120, 4263, -3020, 3234, 4701, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 875, 4135, 797, 4232, 4626, 4292, 4307, -3020, 4130, 4317, 797, 4305, 4133, 797, 2660, 4136, 875, 4140, 4142, 2620, 2621, 2622, 2623, 2624, 2625, 797, 4143, 3846, 2669, 4195, 4144, 4309, 4166, 4171, 4172, 1416, 4322, 4179, 4288, 4194, 4663, 4257, 4222, 4226, 1416, 4228, 4230, 4250, 4832, 4255, 4256, 4298, 4272, 2108, 4258, 4264, 5907, 4436, 1416, 4438, 4324, 4325, 1416, 1416, 1416, 4329, 4331, 4343, 4354, 1416, 5457, 4356, 1416, 4344, 4355, 1416, 4360, 4362, 4368, 4372, 4366, 1416, 4375, 1416, 5395, 4380, 1416, 4827, 4367, 4373, 4378, 1416, 1416, 1416, 1416, 4391, 4392, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 4394, 4400, 4410, 1416, 1416, 1416, 4401, 4402, 4418, 4443, 4427, 4445, 4441, 1416, 4447, 4630, 938, 4451, 1416, 4449, 938, 4455, 1416, 4456, 4459, 4461, -3020, 4462, 4463, 4466, 1416, -3020, 4464, 1416, 4481, 1416, 4482, 4483, 4486, 4484, 4485, 4497, 4487, 4488, 3349, 4489, 4490, 4491, 4499, 4492, 4493, 1416, 4494, 4495, 1416, 1416, 4496, 1416, 4502, 4500, 1416, 1416, 4504, 4506, 3009, 1416, 3012, 1416, 4838, 4507, 4513, 4523, 4516, 4517, 4518, 4528, 875, 875, 875, 4520, 2700, 4534, -3020, 4578, 4536, 4572, 4577, 4296, 4584, 4587, 5342, 4588, 4521, 1416, 4271, 4285, 4271, 4271, 192, 1416, 4271, -2782, 4550, 4860, 4591, 4595, 1250, 3509, 4551, 4605, 4608, 3509, 1091, 4615, 4624, 4296, 4606, 4875, 4625, 4618, 4628, 4629, 4552, 4645, 5370, 4631, 5277, 4659, 4665, 4662, 4839, 4840, 4841, 4842, 4669, 4671, 4677, 4685, 4691, 4693, 4694, 2665, 4695, 653, 1416, 4678, 4714, 4696, 1089, 4697, 4553, 4715, 4554, 4699, 4716, 5470, 188, 4723, 4724, 4725, 4726, 4728, 4729, 1304, 4741, 4717, 4148, 797, 4730, 4731, 4149, 4150, 4151, 4732, 5435, 5436, 4736, 5438, 4555, 4740, 2094, 4742, 4746, 4747, 1092, 4743, 4750, 4755, 3658, 6324, 6325, 5869, 4756, 6327, 4148, 4067, 4768, 797, -2265, 4819, -2782, 4939, 2025, 2867, 4808, 2025, 4761, 4820, 2025, 4856, 4948, 4835, 4556, 3507, 4791, 4863, 4792, 4793, 4800, 4823, 4847, 4850, 4859, 5604, 4861, 4864, 4872, 1304, 5428, 4972, 4148, 4871, 4664, 5525, 4149, 4150, 4151, 4877, -3020, 4878, 4876, 4557, 4879, 4881, 3505, 4887, 4890, 4905, 3505, 188, 937, 4896, 5297, 4916, -2782, 4917, 5643, 4918, 4919, 4926, 961, 4927, 4929, 973, 4930, 973, 973, -2782, 4933, 4949, 3649, 4953, 4952, -2782, 4970, 4973, 4986, 5716, 4989, -2782, 5001, 4985, 4987, 4988, 5021, -2782, 4999, 5000, -2782, 5015, 5282, 5002, -2782, 5013, 5033, 5003, 5016, 5004, 5022, 5034, 5039, 5042, 5059, 5058, 5061, 4296, 4959, 5064, 5074, 5075, 5077, 5102, 5078, 5079, 5090, 5112, 5117, 5131, 5138, 5137, 5144, 5150, -2782, 4558, 5123, 5160, 5488, 4737, 4559, 5143, 5166, 5177, 5167, 5186, 5183, 5184, 5188, 5024, 3505, 5065, 5204, 5190, 5187, 5191, 5208, -3020, 5196, 2972, 3780, 5221, 5202, 3243, 5228, 5229, 3508, -2782, 5238, 2620, 2621, 2622, 2623, 2624, 2625, 5246, 5245, 5247, 5248, 5250, 1085, 5251, 5257, 5258, 963, 5249, 5252, 5268, 5280, 4560, 4153, 4769, 5283, 5289, 5263, 5274, 5647, 5284, 963, 5285, 1416, -2267, 5303, 5307, 5316, 4561, 5321, 5324, 875, 5317, 5331, 5335, 5340, 5343, 5110, 5344, 4790, 5345, 5348, -2782, 4252, 5353, 5350, -2782, 5377, 2867, 5932, 5351, 5934, -2782, 1153, 722, 5357, 5378, 5382, 950, 5392, 188, 5393, 5396, 875, 5403, 5394, 5398, 5404, 3509, 3935, 5405, 5417, 5420, 5424, 5426, 5430, 3817, 4153, 5439, 5448, 5440, 5431, 5449, 5447, 5454, 5159, 5458, 5461, 5465, 5466, 5475, 5619, 5467, 4301, 4301, 875, 5478, 5483, 5484, 5485, 4154, 5487, 5619, 5493, 5491, 5507, 5502, 1416, 1416, 5509, 5497, 5513, 5514, -2782, 5516, 5518, 5520, 5521, 1416, 5531, 5537, 3218, 5539, 5553, 5522, 5556, 5557, 5562, 5583, 2025, 875, 5576, 4562, 5594, 5593, 5577, 5587, 5603, 5595, 5612, 5607, 5618, 5622, 5625, 5654, 5644, 5646, 875, 5656, 5657, 1254, 1257, 5661, 1153, 1260, 5670, 5672, 5764, 5671, 4035, 5675, 1416, 5676, 5677, 4154, 1274, 5683, 5709, 5731, 5101, 5737, 5740, 812, 5943, 5673, 5738, 5678, 5689, 5690, 5694, 5751, 6062, 5700, 5701, 1295, 5702, 5770, 5743, 5746, 5771, 1008, 5750, 5775, 5169, 5782, 5799, 5804, 5780, 5810, 5811, 653, 5812, -2782, 5818, 1416, 3505, 3505, 5826, 5828, 5832, 5833, 5837, 5838, 5850, 5851, 5859, 5865, 5877, 5881, 5879, 1416, 5665, 5883, 5894, 5882, 6091, 5901, -2782, 5912, -2782, -2782, 5903, 5909, 5905, 5681, 5914, 5920, 5926, 1416, 5962, 5959, 5966, 5972, 5998, 5980, 5985, 6000, 5999, 6001, 6002, 5970, -2782, 6013, 5994, 6012, 6020, 6024, 6014, 6035, 5686, 6022, 6045, 6060, 6015, 6026, 6046, 1416, 6059, 6050, 1416, 3507, -2782, 6124, 6126, -2782, -2782, -2782, 1416, 1416, 6061, 5255, 6066, 6084, 6089, 1416, 1416, 6076, 6085, 4233, 1416, 6087, 6034, 6088, 6102, 1416, 6122, 6134, 1416, 6136, 1416, 6131, 6142, 6138, 6145, 6146, 1416, 6162, 6163, 6164, 875, 875, 875, 875, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 6165, 6173, 6174, 6180, 654, 6068, 6179, 4271, 6183, 6184, 6190, 3509, 6201, 6189, 188, 6191, 3509, 6196, 6205, 3509, 654, 6206, 3817, 6208, 5337, 6212, 5352, 1416, 6220, 1010, 6222, 2153, 6229, 6242, 2154, 6244, 961, 6250, 6252, 973, 1416, 973, 973, 6132, 6133, 6270, 6271, 6290, 5945, 6272, 6288, 6308, 6309, 807, 6310, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 6312, 6314, 2658, 5874, 6311, 6334, 6322, 1153, 3349, -3020, 6326, 5716, 1304, 6117, 6335, 4148, 6352, 2867, 1416, 4149, 4150, 4151, 6370, 6330, 6350, 3508, 6336, 6381, 6383, 6382, 1598, 6386, 6376, 5388, 6377, 2660, 1599, 6385, 6398, 2095, 6395, 6400, 6419, 6420, 6421, 6451, 6424, 6422, 6439, 6442, 6423, 4689, -2027, 6462, 6466, 6468, 6453, 1568, 6258, 2104, 6339, 3349, 6479, 6495, 5122, 6454, 6480, 6487, 6499, 6496, 6129, 6512, 6501, 6507, 797, 6510, 6505, 3505, 5806, 6518, 1487, 1601, 4069, 3780, 3505, 1595, 2072, 3026, 3791, 3505, 5936, 3708, 3505, 1569, 3780, 4386, 4976, 4583, 4969, 1416, 6253, 3832, 3880, 5728, 4533, 6116, 1416, 6351, 4829, 5119, 5781, 4965, 4966, 5464, 5763, 4364, 4327, 5958, 2145, 5386, 6402, 6345, 5663, 6403, 6137, 6135, 6269, 6362, 963, 4371, 5495, 5141, 5170, 5149, 5931, 6099, 5111, 3898, 1602, 4974, 4404, 6319, 6320, 963, 3899, 1603, 4594, 1687, 1154, 1604, 5489, 5136, 5769, 4634, -3020, 5194, 6016, 1570, 6416, -3020, 6517, 5744, 6497, 4539, 6274, 5688, 5178, 5922, 5847, 5691, 760, 3093, 814, 1084, 1416, 4700, 5897, 5222, 1605, 981, 6344, 5224, 5852, 6412, 2045, 5180, 3927, 4318, 1017, 653, 3559, 654, 653, 4651, 1571, 6010, 5807, 3156, 2867, 3152, 2050, 3185, 1039, 4503, 5875, 3829, 1195, 2025, 5005, 1153, -3020, 2147, 1155, 6294, 1606, 2060, 2061, 4450, 6452, 1153, 1153, 3168, 3935, 1432, 5197, 3857, 3514, -3020, 950, 950, 5198, 950, 3208, 3051, 6401, 963, 5549, 3957, 5893, 2782, 653, 6227, 5212, 653, 1572, 5896, 1153, 856, 2670, 857, 2643, 4294, 5253, 4306, 2731, 3524, 6225, 2730, 6078, 3507, 4267, 2735, 3507, 875, 4853, 4869, 5624, 797, 4260, 2665, 5864, 5863, 5213, 6437, 875, 4261, 6211, 6328, 6465, 5927, 5928, 6067, 4262, 5846, 1573, 4802, 3436, 6079, 1574, 4229, 4684, 6080, 2679, 3439, 1708, 4035, 3355, 4094, 1608, 3856, 1008, 6033, 6470, 4220, 4213, 4129, 3451, 3512, 4751, 1609, 3507, 0, 0, 3507, 4154, 1483, 0, 0, 0, 1610, 0, 1575, 1576, 3349, 0, 5687, 4296, 6117, 0, 0, 1538, 1611, 0, 5500, 0, 2149, 0, 0, 1008, 1416, 0, 0, 0, 0, 2151, 0, 0, 0, 0, 1416, 0, 0, 1416, 0, 3349, 1416, 1416, 1416, 0, 3505, 2641, 0, 0, 6093, 1577, 0, -3020, 0, 36, 5685, 0, 0, 0, 1578, 1154, 0, 0, 1613, 1614, 0, 1416, 1416, 1579, 0, 0, 1416, 0, 5546, 5548, 0, 0, 1580, 0, 0, 0, 0, 5362, 0, 0, 1581, 3508, 1416, 0, 3508, 0, 1416, 0, 0, 0, 1615, 0, 1416, 1582, 0, 5730, 3509, 0, 0, 0, 5337, 0, 1583, 1416, 0, 5642, 0, 1584, 0, 0, 0, 1416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5400, 3508, 0, 0, 3508, 0, 6075, 0, 6077, 0, 4939, 1010, 963, 0, 963, 0, 2025, 0, 0, 0, 0, 0, 5416, -3020, 0, 0, 0, 0, 5645, 0, 656, 0, 1616, 0, 1585, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 6460, 0, 0, 0, 0, 974, 1010, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 926, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 0, 0, 0, 0, 0, 0, 0, 974, 5444, 5931, 0, 0, 0, 0, 0, 0, 3505, 0, 6460, 0, 0, 5110, 0, 0, 0, 0, 875, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 2867, 0, 2153, 6460, 0, 2154, 0, 0, 0, 0, 875, 0, 0, 0, 5159, 0, 0, 5783, 0, 0, 0, 3505, 797, 6296, 0, 6298, 0, 0, 963, 875, 4939, 0, 3349, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 0, -3020, 0, 0, 72, 193, 81, 797, 176, 84, 192, 0, 0, 0, 2976, 0, 4939, 0, 1416, 85, 0, 797, 2984, 86, 185, 87, 0, 2660, 6498, 0, 107, 1416, 797, 0, 0, 6405, 6406, 1109, 125, 0, 0, 130, 0, 1109, 0, 160, 0, 5530, 1416, 179, 186, 5768, 1416, 656, 1416, 1109, 938, 0, 0, 0, 182, -3019, 656, 983, 0, 0, 0, 1568, 1416, 1154, 656, 0, 983, 656, 0, 0, 654, 0, 0, 1416, 0, 0, 5794, 5872, 0, 0, 983, 0, 0, 0, 1416, 0, 0, 0, 0, 0, 187, 1416, 0, 0, 6296, 0, 6298, 1569, 3390, 0, 0, 0, 1234, 1235, 0, 0, 2153, 0, 0, 2154, 0, 0, 188, 0, 0, 1568, 0, 0, 3505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2025, 0, 0, 0, 0, 0, 0, 0, 0, 1416, 0, 0, -3020, 2658, 0, 0, 0, -3020, 0, 3505, -3020, 0, 0, 1569, 0, 1416, -3019, 0, 0, 0, 0, 1416, 1416, 1570, 0, 0, 963, 963, 963, 963, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 6210, 0, 0, 188, 0, 0, 0, 0, 0, 0, 797, 4499, 5796, 0, 1416, -3020, 0, 1571, 0, 0, 0, 0, 1008, 654, 0, 0, 3505, -3019, 0, 0, 0, 0, 0, 0, 1570, 0, 3314, 0, 0, 6296, -3019, 6298, 0, 0, 0, 0, -3019, 0, 875, 3114, 0, 3509, -3019, 3119, 0, 0, 0, 0, -3019, 0, 3367, -3019, 0, 0, 0, -3019, 5301, 1572, 0, 0, 0, 1571, 0, 0, 2665, 0, 0, 875, 797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3019, 0, -3019, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1416, 1574, -3020, 0, 0, 0, 0, -3020, 0, 0, 0, 1572, 1416, 6404, 0, 0, 0, 0, -3019, 0, 0, 1416, 1416, 1416, 0, 0, 0, 2025, 0, 0, 0, 0, 0, 3817, 0, 1576, 1416, 3349, 3349, 0, 0, 3349, 5988, 1538, 0, 1416, 0, 1416, 0, 1416, 5642, 1573, 653, 0, 0, 1574, 653, 0, -3020, 0, 0, -3020, 1416, 6440, 0, 0, 0, 0, 0, 0, -3019, 2025, 0, 1010, -3019, 0, 0, 875, 3505, 0, -3019, 36, 1416, 2843, 0, 3258, 1578, 0, 1639, 1576, 0, 3260, 0, 0, 0, 1579, 0, 1538, 0, 0, 0, 0, 0, 0, 1580, 0, 0, 0, 0, 0, 0, 0, 2844, 0, 0, 0, 0, 2665, 2025, 2025, 0, 0, 3507, 0, 0, 1582, 3507, 0, 0, 0, 0, 1640, 0, 0, 1583, 36, 0, 3308, 0, 1584, 1578, -3019, 6249, 3396, 0, 0, 653, 0, 963, 1579, 0, 0, 0, 0, 0, 0, 0, 0, 1580, 0, 0, 0, 6158, 0, 0, 0, 1641, 0, -3020, 0, 0, 0, 0, 0, 4939, 0, 0, 0, 0, 1582, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 1583, 0, 0, 0, 0, 1584, 0, 0, 3391, 1585, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6301, 6302, -3020, 0, 3507, 0, 0, 1416, 0, 797, 0, 0, 983, 0, 0, 797, 0, 0, -3019, 0, 797, 0, 1416, 0, 0, 0, 5872, 0, 0, 0, 0, 983, 1416, 0, 0, 0, 2074, 983, 0, 1585, 6228, 2074, 2074, -3019, 0, -3019, -3019, 5414, 5415, 983, 0, 3508, 5418, 5419, 0, 3508, 0, 0, 0, 974, 0, 0, 0, 0, 0, 983, 0, -3019, 0, 0, 656, 963, 0, 0, 0, 926, 0, 0, 2025, 656, 983, 6181, 0, 0, 0, 0, 656, 3505, 983, 656, -3019, 0, -3019, -3019, 0, 0, 0, 0, 0, 3505, 0, 926, 983, 2867, 0, 0, 0, 0, 0, -3020, 1416, 0, 983, 0, 0, 0, 0, 0, 0, 0, 4939, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 974, 974, 6304, 0, 0, 0, 1416, 6300, 0, 0, 4035, 0, 192, 0, 0, 0, 3508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6011, 0, 0, 0, 0, 2025, 2025, 6321, 0, 983, 653, 653, 0, 1416, 1416, 0, 0, 1416, 0, 0, 6329, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6297, 0, 0, 0, 0, 0, 0, 0, 0, 2025, 6275, 656, 656, 0, 0, 963, 6375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6072, 0, 983, 6299, 656, 0, 0, 0, 0, 0, 0, 0, 3507, 3507, 6158, 963, 963, 0, 0, 0, 4939, 0, 0, 0, 0, 0, 0, 0, 926, 0, 0, 0, 6300, 3505, 0, 0, 0, 192, 654, 0, 0, 0, 0, 3396, 0, 0, 1416, 0, 0, 0, 0, 656, 0, 0, 6394, 0, 0, 0, 0, 0, 0, 0, 1416, 0, 983, 0, 0, 4035, 0, 0, 0, 0, 4684, 0, 0, 0, 0, 3497, 0, 0, 0, 0, 1416, 0, 0, 0, 0, 6297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6508, 6509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6425, 6426, 654, 6430, 6299, 0, 0, 0, 5872, 0, 0, 0, 0, 1416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 963, 0, 0, 4939, 0, 0, 0, 0, 3505, 0, 3508, 3508, 0, 0, 3505, 6300, 0, 0, 0, 2153, 192, 0, 2154, 6394, 0, 0, 2155, 2156, 2157, 656, 656, 1840, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 656, 2657, 0, 0, 0, 926, 656, 1416, 654, 0, 656, 2658, 656, 0, 653, 0, 926, 0, 2659, 0, 0, 653, 0, 0, 654, 0, 653, 6297, 0, 653, 5333, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 974, 974, 0, 2660, 6511, 0, 6394, 0, 0, 797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6299, 6394, 0, 0, 0, 0, 0, -2784, 0, 0, 0, 0, 0, 656, 0, 656, 656, 0, 0, 0, 0, 3507, 0, 0, 0, 0, 0, 0, 3507, 0, 0, 0, 0, 3507, 3505, 0, 3507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 983, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 656, 0, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 2661, 3024, 0, 0, 0, 2662, -2784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 2660, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 1153, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 983, 0, 0, 926, 0, 983, 0, 0, 0, 0, 0, 2664, 0, 0, 0, -2784, 0, 3508, 0, 0, 0, 983, 0, 0, 3508, 0, 983, 0, -2784, 3508, 0, 0, 3508, 0, -2784, 0, 0, 0, 656, 0, -2784, 0, 1260, 0, 0, 0, -2784, 0, 0, -2784, 0, 0, 0, -2784, 2415, 0, 0, 5472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 656, 0, 0, -2784, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 656, 656, 0, 656, 0, 0, -2784, 0, 0, 0, 0, 0, 2663, 2348, 188, 0, 0, 1260, 6436, 3103, 0, 0, 0, 0, 656, 0, 0, 3120, 0, 0, 0, 0, 0, 0, 0, 3024, 0, 0, 0, 0, 2664, 1260, 0, 0, 0, 797, 0, 0, 3507, 0, 1959, 0, 0, -2801, 0, 0, 1963, 2667, -2784, 0, 0, 0, -2784, 0, 0, 0, 1974, 0, -2784, 656, 1977, 0, 0, 0, 1980, 0, 1982, 0, 0, 0, 3178, 0, 1990, 2415, 0, 188, 0, 0, 1996, 0, 0, 1999, 0, 0, 0, 0, 0, 0, 1840, 2665, 0, 0, 2666, 0, 0, 3823, 0, 3024, 0, 3827, 0, 0, 0, 0, 0, 656, 0, 0, 0, 656, 656, 0, 0, 0, 0, 0, 0, 0, 0, -2784, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 926, 0, 0, 0, 0, 3860, 0, 3860, 0, 3860, 3860, -2801, 0, 0, 3860, 3860, 3860, 0, 3860, 3860, 3860, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 653, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 0, 0, 812, 3508, 4121, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2801, 0, 0, 926, 0, 0, 0, 3937, 0, 0, 653, 0, -2784, -2801, 0, 0, 0, 0, 2145, -2801, 0, 0, 0, 0, 0, -2801, 0, 0, 0, 0, 0, -2801, 3965, 0, -2801, 3507, 0, -2784, -2801, -2784, -2784, 0, 0, 0, 926, 0, 0, 0, 973, 0, 0, 0, 0, 0, 6114, 0, 0, 0, 0, 0, 0, -2784, 0, 0, 0, 0, 2145, 0, -2801, 0, 0, 0, 0, 0, 0, 0, 0, 926, 0, 0, 3507, -2784, 0, 0, -2784, -2784, -2784, 0, 0, 4223, 0, 0, 0, 973, 0, 0, 0, 2616, 0, 0, 0, -2801, 0, 0, 0, 4227, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 4137, 0, 0, 4138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1598, 0, 0, 0, 0, 983, 1599, 0, 0, 1153, 0, 0, 0, 0, 0, -2801, 0, 0, 653, -2801, 656, 656, 656, 0, 0, -2801, 4259, 0, 0, 4265, 0, 0, 0, 0, 0, 0, 0, 0, 3508, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 1601, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 3497, 0, 0, 3497, 0, 0, 3508, 2657, 0, -2801, 0, 3507, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 653, 1602, 0, 0, 0, 0, 0, 0, 1603, 0, 3507, 0, 1604, 983, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 926, 0, 812, 0, 0, 1605, 0, 0, 0, 0, 0, 0, 1840, 0, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2801, 0, 3507, 983, 0, 0, 0, 0, 0, 1606, 0, 983, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, -2801, 0, -2801, -2801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, -2801, 656, 0, 0, 926, 3508, 0, 926, 926, 0, 0, 656, 656, 0, 983, 983, 0, 5971, 0, 0, -2801, 0, 2661, -2801, -2801, -2801, 656, 2662, 983, 656, 0, 0, 0, 0, 3508, 0, 0, 0, 926, 926, 1708, 983, 983, 0, 1608, 653, 0, 0, 0, 0, 2663, 2348, 0, 0, 0, 1609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1610, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1611, 2664, 0, 0, 656, 0, 0, 2153, 656, 656, 2154, 0, 0, 0, 2155, 2156, 2157, 3508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 3507, 0, 0, 0, 2658, 1736, 2415, 0, 1613, 1614, 0, 2659, 1153, 0, 0, 0, 0, 1598, 0, 0, 0, 0, 2665, 1599, 0, 2666, 0, 656, 0, 656, 0, 0, 0, 0, 656, 656, 0, 2660, 1706, 0, 1737, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 0, 0, 0, 656, 0, 656, 0, 656, 656, 656, 656, 656, 656, 6458, 1601, 656, 0, 656, 656, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 926, 656, 656, 656, 0, 0, 0, 0, 0, 0, 0, 4409, 0, 0, 0, 0, 0, 0, 0, 656, 0, 1840, 0, 0, 1616, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 1707, 0, 1602, 0, 0, 6458, 0, 0, 0, 1603, 0, 0, 0, 1604, 0, 0, 0, 0, 3508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 6458, 0, 0, 2661, 188, 4458, 0, 0, 2662, 0, 653, 0, 1605, 0, 0, 0, 3180, 0, 0, 0, 0, 0, 0, 0, 3187, 0, 0, 3550, 0, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 188, 0, 0, 0, 0, 3566, 0, 0, 1606, 3569, 0, 0, 0, 3572, 0, 0, 0, 2153, 0, 2664, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 3507, 937, 0, 0, 0, 2616, 0, 4501, 0, 0, 3591, 0, 3507, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 2658, 0, 0, 0, 0, 0, 4139, 2659, 0, 0, 2415, 656, 0, 0, 0, 973, 0, 0, 0, 0, 3633, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 3860, 0, 2660, 0, 0, 1708, 0, 1109, 0, 1608, 0, 0, 4532, 4532, 0, 0, 0, 0, 0, 0, 1609, 0, 4548, 0, 0, 0, 0, 1153, 0, 1153, 1610, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 1611, 0, 0, 653, 3693, 0, 0, 0, 0, 0, 0, 0, 973, 973, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3722, 0, 4604, 0, 0, 0, 3731, 0, 0, 0, 0, 0, 3788, 3508, 0, 1613, 1614, 0, 656, 2667, 3741, 0, 0, 0, 0, 3508, 0, 1109, 0, 0, 3754, 0, 0, 0, 0, 0, 3759, 4640, 1153, 0, 0, 0, 3507, 0, 0, 0, 0, 3789, 2661, 0, 0, 0, 0, 2662, 0, 0, 3772, 0, 0, 0, 0, 0, 3775, 0, 0, 0, 0, 2145, 0, 3783, 0, 2145, 0, 0, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 3798, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 188, 653, 3824, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 1109, 0, 0, 0, 0, 0, 6379, 0, 0, 3497, 0, 0, 1616, 3497, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 2415, 0, 0, 0, 4190, 0, 0, 0, 0, 0, 0, 0, 0, 3507, 0, 0, 2665, 0, 0, 3507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1598, 0, 3508, 0, 0, 0, 1599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6428, 0, 0, 0, 0, 1600, 656, 656, 656, 656, 656, 656, 656, 656, 656, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 656, 0, 656, 0, 0, 0, 0, 0, 1601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 656, 0, 0, 656, 0, 656, 0, 4812, 656, 0, 0, 0, 656, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6428, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1840, 0, 656, 0, 0, 0, 6494, 0, 0, 1602, 0, 0, 3507, 0, 0, 0, 1603, 0, 0, 656, 1604, 3508, 0, 973, 973, 0, 3977, 3508, 656, 656, 0, 1568, 0, 1598, 0, 0, 0, 0, 0, 1599, 0, 0, 0, 0, 0, 4052, 0, 0, 0, 1605, 1568, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 926, 0, 0, 0, 926, 926, 1569, 4071, 0, 0, 0, 983, 0, 0, 4052, 983, 0, 0, 0, 983, 0, 0, 0, 1601, 1606, 1569, 2616, 0, 0, 983, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 983, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 926, 656, 0, 656, 656, 0, 926, 0, 0, 0, 1570, 0, 0, 0, 0, 0, 0, 0, 983, 0, 1602, 0, 0, 0, 0, 0, 0, 1603, 0, 1570, 0, 1604, 3508, 0, 0, 0, 983, 983, 0, 0, 0, 0, 3497, 0, 1607, 0, 0, 1571, 1608, 0, 0, 0, 926, 0, 0, 0, 0, 0, 0, 1609, 1605, 0, 0, 0, 0, 0, 1571, 0, 188, 1610, 0, 0, 4548, 0, 1840, 983, 0, 0, 1840, 0, 0, 1611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1606, 1572, 0, 0, 5011, 0, 983, 0, 1840, 0, 3460, 0, 983, 0, 0, 3978, 0, 0, 0, 5025, 1572, 0, 5026, 0, 5027, 0, 983, 0, 1612, 0, 0, 1613, 1614, 983, 0, 0, 983, 0, 0, 0, 0, 1573, 983, 0, 0, 1574, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 983, 1615, 1574, 2155, 2156, 2157, 983, 0, 5067, 0, 0, 0, 0, 983, 0, 0, 1656, 1576, 1708, 0, 0, 2657, 1608, 0, 3860, 1538, 0, 983, 0, 3860, 0, 2658, 0, 1609, 0, 0, 1576, 0, 2659, 0, 1665, 983, 0, 1610, 1538, 0, 1840, 0, 0, 0, 0, 0, 983, 0, 0, 1611, 0, 0, 0, 1657, 0, 0, 1666, 36, 2660, 0, 0, 0, 1578, 0, 656, 656, 656, 0, 1616, 0, 656, 1579, 0, 0, 0, 0, 36, 0, 0, 0, 1580, 3979, 4949, 0, 0, 0, 0, 0, 1658, 0, 1579, 0, 2826, 0, 0, 1613, 1614, 656, 926, 1580, 0, 1582, 0, 0, 0, 0, 1840, 2844, 1667, 4959, 1583, 0, 0, 0, 0, 1584, 2802, 0, 4332, 0, 1582, 0, 0, 5173, 0, 0, 4548, 2827, 0, 1583, 0, 0, 0, 0, 1584, 0, 0, 0, 0, 656, 0, 0, 0, 3497, 0, 0, 0, 0, 3497, 0, 0, 3497, 0, 0, 0, 3980, 4960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 926, 0, 1585, 0, 926, 0, 2661, 4961, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1585, 0, 0, 0, 3981, 0, 0, 0, 1616, 1668, 0, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 5227, 0, 0, 0, 0, 0, 5234, 5234, 5234, 5234, 0, 5234, 5234, 5234, 5234, 5234, 4419, 0, 0, 0, 0, 2664, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1669, 0, 0, 2657, 983, 1670, 1840, 0, 0, 0, 1671, 0, 0, 2658, 0, 0, 0, 2415, 0, 0, 2659, 0, 0, 983, 0, 926, 2971, 983, 0, 0, 4962, 0, 0, 2665, 983, 0, 2666, 0, 656, 0, 926, 656, 0, 656, 656, 926, 2660, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 656, 0, 0, 0, 1673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 5314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4514, 0, 0, 0, 0, 0, 0, 656, 656, 656, 0, 1675, 656, 0, 0, 0, 0, 0, 0, 0, 656, 656, 656, 656, 0, 0, 0, 0, 0, 0, 2667, 1840, 0, 0, 0, 1676, 656, 1840, 0, 656, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 656, 0, 1678, 656, 4963, 0, 0, 4375, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 188, 0, 0, 0, 0, 0, 656, 0, 656, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 4000, 0, 0, 656, 0, 4006, 0, 4007, 0, 0, 1679, 0, 0, 0, 0, 0, 0, 4013, 0, 0, 4014, 0, 4015, 4016, 2664, 0, 4018, 0, 188, 188, 4021, 0, 4022, 0, 0, 4024, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 656, 0, 0, 656, 3378, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 656, 0, 2893, 0, 0, 656, 0, 3024, 2665, 0, 0, 2666, 0, 0, 0, 1598, 0, 0, 0, 0, 656, 1599, 0, 0, 0, 0, 5442, 5443, 1665, 0, 4076, 0, 0, 0, 656, 0, 4702, 656, 0, 3860, 4706, 3860, 3860, 3860, 926, 0, 0, 926, 0, 926, 1666, 0, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1601, 0, 0, 983, 983, 0, 0, 0, 0, 656, 0, 0, 0, 0, 3497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 983, 0, 0, 926, 0, 0, 0, 0, 0, 1667, 0, 926, 2667, 0, 0, 5496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1602, 0, 0, 0, 0, 0, 926, 1603, 0, 0, 0, 1604, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1840, 1840, 1840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 0, 0, 1606, 983, 0, 5234, 0, 0, 0, 0, 0, 0, 926, 0, 926, 2616, 0, 0, 0, 0, 0, 0, 983, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 4131, 0, 188, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1669, 0, 0, 0, 0, 1670, 0, 0, 0, 0, 1671, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 662, 1672, 0, 188, 0, 1608, 711, 662, 0, 0, 0, 0, 763, 0, 662, 0, 1609, 0, 0, 0, 662, 0, 0, 832, 0, 0, 1610, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 1673, 1611, 0, 0, 2153, 886, 886, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 4921, 983, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 656, 0, 2657, 0, 4330, 0, 0, 0, 0, 926, 0, 0, 2658, 0, 0, 0, 0, 1674, 0, 2659, 1613, 1614, 1675, 0, 0, 4548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1840, 926, 0, 2145, 0, 0, 983, 0, 983, 2660, 1676, 0, 0, 0, 0, 0, 1677, 0, 0, 1598, 0, 983, 0, 983, 0, 1599, 0, 0, 0, 0, 0, 1678, 0, 0, 0, 3860, 0, 0, 0, 0, 0, 0, 0, 656, 5729, 0, 0, 0, 0, 4393, 0, 4395, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 926, 1601, 1598, 0, 0, 0, 0, 0, 1599, 0, 0, 0, 0, 1679, 0, 0, 0, 0, 0, 0, 1616, 983, 926, 0, 965, 0, 5047, 0, 969, 5050, 0, 0, 0, 0, 0, 0, 1012, 0, 0, 1014, 0, 0, 1019, 1020, 926, 1023, 0, 1026, 0, 0, 1032, 0, 1034, 1601, 0, 0, 0, 0, 1602, 2661, 0, 0, 0, 983, 2662, 1603, 0, 0, 0, 1604, 0, 0, 0, 0, 0, 3497, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 0, 983, 0, 0, 0, 983, 0, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1602, 0, 0, 0, 0, 2664, 0, 1603, 0, 0, 983, 1604, 0, 0, 0, 0, 4498, 0, 0, 0, 0, 5133, 4505, 0, 1606, 0, 656, 0, 0, 926, 0, 0, 0, 0, 0, 656, 0, 0, 3024, 0, 1605, 0, 0, 0, 0, 0, 0, 0, 2415, 656, 0, 0, 0, 656, 656, 656, 0, 0, 0, 0, 656, 0, 0, 656, 2665, 0, 656, 2666, 0, 0, 0, 0, 656, 0, 656, 0, 1606, 656, 0, 0, 0, 926, 656, 656, 656, 656, 0, 0, 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, 0, 0, 0, 656, 656, 656, 1607, 0, 926, 0, 1608, 0, 0, 656, 0, 0, 0, 0, 656, 0, 1840, 1609, 656, 0, 0, 1153, 0, 0, 0, 5947, 656, 1610, 0, 656, 0, 656, 4052, 0, 0, 0, 923, 0, 0, 1611, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 656, 656, 0, 656, 1708, 0, 656, 656, 1608, 2667, 0, 656, 0, 656, 0, 0, 0, 0, -136, 1609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1610, 0, 0, 2909, 0, 0, 1613, 1614, 0, 1, 656, 0, 1611, 0, 0, 0, 656, 0, 0, 0, 2, 0, 3, 4, 656, 0, 0, 4668, 656, 4670, 0, 4672, 0, 0, 0, 0, 0, 188, 2910, 0, 5, 0, 0, 925, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 3643, 0, 0, 1613, 1614, 0, 656, 7, 0, 8, 9, 0, 0, 0, 926, 0, 10, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 2616, 13, 0, 1615, 0, 0, 0, 0, 983, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 14, 0, 0, 15, 4535, 0, 1616, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 16, 0, 17, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 21, 0, 0, 0, 0, 0, 0, 22, 0, 188, 0, 1840, 0, 0, 0, 1616, 1840, 926, 1840, 0, 1153, 0, 0, 0, 6120, 23, 6121, 0, 0, 0, 6127, 6128, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 24, 0, 1840, 926, 0, 0, 0, 0, 1598, 1062, 0, 0, 0, 0, 1599, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 1103, 0, 0, 0, 0, 0, 0, 1116, 1117, 0, 0, 1123, 0, 1127, 1128, 0, 0, 0, 0, 0, 0, 0, 5411, 0, 983, 0, 0, 983, 1150, 0, 25, 26, 0, 0, 5421, 1601, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1163, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1191, 0, 1193, 29, 0, 0, 0, 0, 0, 0, 0, 0, 1209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6374, 0, 656, 1602, 0, 0, 0, 0, 0, 0, 1603, 0, 0, 0, 1604, 0, 0, 0, 0, 0, 0, 30, 0, 0, 662, 0, 0, 0, 0, 983, 983, 31, 0, 926, 0, 0, 0, 0, 0, 0, 983, 0, 0, 1605, 0, 0, 32, 656, 656, 0, 0, 33, 34, 0, 35, 0, 0, 983, 0, 36, 0, 0, 0, 0, 0, 37, 0, 0, 38, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 1606, 926, 0, 40, 41, 0, 926, 656, 656, 0, 0, 42, 0, 0, 0, 43, 0, 0, 656, 0, 2153, 0, 0, 2154, 0, 0, 44, 2155, 2156, 2157, 0, 0, 0, 886, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 2657, 0, 188, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 656, 2659, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 47, 1840, 0, 0, 1708, 0, 48, 0, 1608, 0, 0, 49, 2660, 0, 0, 0, 0, 0, 0, 1609, 4052, 0, 0, 0, 1153, 50, 0, 0, 656, 1610, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1611, 1559, 0, 656, 0, 0, 0, 0, 51, 0, 52, 53, 54, 55, 56, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 57, 0, 0, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3835, 0, 0, 1613, 1614, 0, 656, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 656, 656, 0, 926, 0, 0, 0, 656, 656, 0, 0, 0, 656, 0, 0, 1739, 0, 656, 3836, 0, 656, 0, 656, 0, 0, 0, 0, 0, 656, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 1860, 4052, 0, 4052, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 1872, 656, 1873, 2663, 2348, 0, 656, 0, 0, 656, 656, 0, 1876, 0, 0, 0, 0, 656, 0, 1886, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 2664, 0, 6459, 0, 0, 1616, 0, 0, 0, 2641, 0, 0, 0, 6463, 0, 923, 0, 0, 0, 0, 0, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 1938, 0, 1940, 0, 0, 983, 0, 1598, 0, 0, 656, 0, 2415, 1599, 0, 0, 5201, 0, 6489, 5203, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 6459, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 925, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6459, 1601, 0, 5314, 0, 0, 983, 5230, 0, 0, 0, 926, 0, 925, 0, 0, 0, 0, 983, 0, 0, 662, 0, 662, 0, 662, 0, 662, 0, 662, 662, 662, 0, 0, 656, 0, 662, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 983, 0, 0, 0, 0, 0, 1602, 0, 0, 0, 0, 0, 0, 1603, 0, 0, 2667, 1604, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 1605, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 656, 0, 3977, 0, 0, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 656, 0, 0, 2658, 0, 1840, 0, 0, 1606, 1568, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 0, 0, 0, 0, 656, 914, 0, 0, 0, 2660, 0, 925, 0, 0, 0, 0, 0, 0, 1569, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 4738, 0, 0, 5361, 0, 0, 926, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 1708, 0, 0, 0, 1608, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 1609, 0, 0, 2155, 2156, 2157, 1570, 0, 0, 0, 1610, 0, 923, 0, 886, 0, 0, 0, 0, 983, 0, 2657, 1611, 923, 0, 0, 0, 0, 5401, 5402, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 923, 0, 0, 0, 1571, 0, 656, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 656, 0, 2662, 656, 0, 0, 656, 656, 656, 2660, 4348, 0, 0, 1613, 1614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1755, 2663, 2348, 0, 0, 0, 0, 656, 656, 3978, 0, 0, 656, 0, 1572, 0, 0, 0, 0, 925, 0, 4349, 0, 0, 0, 0, 0, 0, 656, 2664, 925, 0, 656, 0, 0, 0, 0, 0, 656, 0, 0, 0, 656, 5445, 5446, 0, 925, 0, 926, 656, 0, 0, 0, 0, 0, 0, 2824, 656, 1574, 0, 0, 0, 983, 0, 983, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 2665, 0, 0, 2666, 1576, 0, 1616, 0, 0, 0, 0, 0, 1538, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 926, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 2921, 0, 0, 2059, 2663, 2348, 0, 0, 0, 0, 36, 923, 0, 0, 0, 1578, 0, 0, 0, 0, 0, 0, 0, 0, 1579, 0, 0, 2153, 0, 0, 2154, 0, 2664, 1580, 2155, 2156, 2157, 1840, 0, 0, 0, 2844, 656, 0, 0, 0, 5541, 0, 0, 5543, 5544, 0, 2657, 0, 1582, 0, 0, 2667, 0, 0, 0, 0, 2658, 1583, 0, 0, 0, 0, 1584, 2659, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 5559, 0, 0, 0, 0, 0, 0, 0, 3980, 0, 2665, 0, 0, 2666, 2660, 0, 925, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1585, 0, 0, 0, 3981, 0, 0, 0, 656, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2616, 0, 656, 0, 0, 4052, 656, 0, 656, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 3048, 0, 656, 0, 2667, 0, 0, 0, 0, 0, 656, 0, 916, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 2153, 2661, 656, 2154, 3052, 0, 2662, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2657, 0, 1598, 0, 2663, 2348, 0, 0, 1599, 0, 2658, 0, 0, 0, 3088, 0, 0, 2659, 0, 0, 0, 923, 0, 656, 0, 0, 0, 0, 0, 926, 0, 0, 2664, 0, 926, 926, 0, 0, 0, 656, 0, 0, 0, 2660, 0, 656, 656, 983, 0, 0, 0, 0, 0, 1601, 0, 0, 0, 2616, 0, 0, 3153, 983, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2415, 0, 0, 0, 4811, 3171, 656, 0, 0, 0, 0, 0, 0, 0, 923, 656, 2665, 0, 1840, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3191, 2765, 3192, 0, 1602, 0, 0, 0, 0, 0, 0, 1603, 656, 0, 0, 1604, 0, 3201, 0, 3202, 0, 0, 0, 0, 923, 0, 0, 662, 0, 662, 0, 662, 0, 662, 0, 662, 0, 0, 0, 662, 0, 0, 926, 926, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 2661, 923, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 2765, 0, 656, 1840, 0, 0, 0, 0, 0, 0, 0, 1606, 914, 2667, 656, 2663, 2348, 0, 0, 0, 0, 0, 0, 656, 656, 656, 0, 0, 2153, 0, 3267, 2154, 0, 0, 0, 2155, 2156, 2157, 656, 1840, 0, 925, 926, 2664, 0, 0, 0, 656, 0, 656, 0, 656, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 656, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 2415, 0, 0, 0, 0, 1708, 5899, 0, 0, 1608, 2660, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 1609, 0, 0, 1840, 0, 0, 983, 0, 0, 0, 1610, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 1611, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 4907, 0, 0, 0, 0, 0, 5937, 0, 0, 0, 0, 0, 0, 1755, 1755, 1755, 0, 0, 0, 0, 0, 914, 656, 0, 0, 0, 0, 0, 2153, 4421, 0, 2154, 1613, 1614, 656, 2155, 2156, 2157, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 2657, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 2658, 4422, 0, 923, 0, 0, 0, 2659, 0, 0, 2661, 0, 0, 0, 0, 2662, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 2660, 0, 0, 0, 0, 2663, 2348, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 0, 0, 923, 0, 0, 0, 0, 925, 6032, 0, 0, 2664, 0, 656, 0, 0, 0, 923, 925, 1616, 923, 923, 0, 983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 923, 923, 0, 2415, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 656, 0, 914, 0, 4932, 0, 2665, 0, 0, 2666, 656, 0, 0, 914, 2153, 0, 0, 2154, 0, 656, 656, 2155, 2156, 2157, 925, 656, 0, 0, 0, 914, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 925, 0, 0, 925, 925, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 656, 656, 2663, 2348, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 925, 925, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 656, 0, 0, 0, 2415, 0, 656, 0, 916, 0, 0, 2657, 0, 0, 0, 3516, 0, 0, 0, 0, 2665, 2658, 0, 2666, 656, 923, 0, 0, 2659, 0, 0, 0, 656, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 1755, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 914, 0, 2616, 1755, 0, 0, 1755, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, -3020, -3020, 0, 5139, 0, 3517, 656, 0, 0, 0, 925, 926, 0, 0, 0, 0, 2667, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 656, 0, 0, 0, 0, 0, 0, 1840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3020, 2661, 0, 0, 0, 0, 2662, 656, 656, 0, 0, 0, 0, 916, 0, 0, 2665, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 1840, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 656, 0, 0, 0, 0, 0, 0, 0, 0, 6342, 2616, 1840, 0, 0, 0, 2664, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 5264, 3551, 3552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3567, 3568, 0, 3570, 3571, 0, 2415, 0, 0, 3574, 3575, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 2665, 0, 3586, 2666, 0, 0, 3589, 0, 0, 0, 3592, 3593, 0, 0, 3596, 3597, 0, 0, 0, 0, 0, 3602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3617, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 3634, 0, 0, 0, 0, 3636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 3642, 0, 0, 0, 3648, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 3659, 0, 0, 3663, 0, 3665, 3668, 3670, 916, 0, 0, 0, 3678, 3681, 0, 0, 0, 0, 2667, 0, 0, 0, 3694, 0, 0, 2616, 0, 0, 3704, 914, 0, 0, 3707, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 3717, 3718, 0, 0, 0, 3723, 0, 0, 0, 0, 0, 3732, 3733, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3742, 914, 0, 3743, 0, 0, 0, 0, 0, 0, 3755, 3756, 0, 0, 3518, 0, 3760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3767, 0, 0, 3770, 0, 0, 914, 0, 3773, 0, 0, 0, 0, 0, 3776, 3777, 0, 0, 0, 0, 0, 0, 3785, 0, 0, 0, 3787, 0, 2616, 0, 3794, 3795, 3796, 3797, 0, 3799, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 3825, 3826, 0, 3828, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 3838, 3839, 3840, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 1, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 2, 0, 3, 4, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 3892, 0, 0, 0, 0, 0, 0, 6, 3916, 0, 0, 0, 0, 1755, 0, 0, 0, 0, 0, 7, 0, 8, 9, 0, 0, 0, 0, 3928, 10, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 12, 0, 13, 923, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3996, 0, 914, 16, 0, 17, 0, 0, 0, 18, 0, 0, 0, 914, 0, 0, 19, 0, 0, 4010, 0, 4012, 0, 0, 0, 923, 20, 0, 21, 914, 0, 923, 0, 0, 917, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3555, 0, 23, 0, 2765, 3561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 914, 914, 0, 0, 0, 0, 0, 0, 0, 0, 925, 0, 0, 0, 0, 0, 925, 0, 0, 0, 0, 4087, 0, 25, 26, 0, 0, 0, 0, 27, 0, 914, 914, 0, 0, 0, 0, 0, 0, 0, 916, 0, 2153, 0, 28, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 925, 29, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 917, 916, 0, 2660, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 32, 0, 0, 0, 0, 33, 34, 2153, 35, 0, 2154, 0, 0, 36, 2155, 2156, 2157, 0, 0, 37, 0, 916, 38, 0, 0, 0, 0, 0, 0, 39, 0, 0, 2657, 0, 0, 0, 40, 41, 0, 0, 0, 0, 2658, 0, 42, 0, 0, 0, 43, 2659, 0, 0, 0, 2153, 916, 0, 2154, 0, 923, 44, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 2660, 45, 0, 2657, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 2658, 0, 2155, 2156, 2157, 0, 0, 2659, 0, 46, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 2657, 47, 0, 0, 1755, 0, 0, 48, 0, 0, 2658, 0, 49, 2660, 0, 0, 0, 2659, 0, 0, 0, 2663, 2348, 923, 0, 0, 50, 923, 0, 0, 0, 0, 0, 0, 0, 0, 925, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 2664, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4168, 0, 0, 0, 0, 917, 4169, 0, 57, 0, 0, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 4333, 0, 0, 0, 0, 0, 0, 2665, 2765, 0, 2666, 0, 2765, 2663, 2348, 0, 0, 4340, 0, 0, 0, 4340, 0, 0, 0, 0, 4351, 4352, 4353, 0, 0, 2661, 0, 0, 0, 923, 2662, 0, 916, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 4365, 916, 923, 0, 0, 0, 0, 923, 0, 0, 0, 2663, 2348, 2661, 0, 0, 0, 916, 2662, 0, 0, 0, 0, 0, 4396, 4397, 4398, 4399, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 923, 0, 2664, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 2667, 0, 0, 0, 0, 0, 4420, 0, 4424, 4425, 4426, 0, 0, 2664, 0, 916, 0, 925, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 916, 0, 925, 916, 916, 0, 0, 925, 0, 0, 0, 0, 2665, 919, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 916, 916, 0, 925, 0, 919, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4170, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2616, 0, 917, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 4509, 5302, 0, 0, 0, 0, 0, 0, 0, 4515, 0, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4525, 4526, 0, 0, 0, 4527, 2667, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 723, 0, 0, 0, 0, 724, 0, 0, 0, 4570, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 917, 0, 919, 0, 923, 0, 725, 923, 0, 923, 0, 0, 916, 0, 923, 0, 0, 0, 0, 726, 0, 0, 0, 0, 4607, 0, 0, 0, 2616, 4613, 0, 0, 0, 917, 0, 4619, 727, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 5306, 0, 0, 0, 728, 0, 923, 0, 2616, 0, 0, 0, 0, 0, 923, 4658, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 729, 0, 5581, 0, 0, 0, 0, 0, 0, 0, 0, 923, 2765, 0, 730, 3561, 4673, 3561, 4674, 0, 0, 0, 2765, 731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 732, 0, 0, 0, 0, 0, 733, 0, 0, 0, 0, 0, 0, 734, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 925, 914, 914, 0, 0, 735, 0, 0, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 923, 0, 923, 0, 0, 0, 2765, 919, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 914, 0, 736, 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, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 737, 917, 0, 925, 0, 925, 0, 0, 0, 0, 0, 0, 0, 738, 0, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 740, 2153, 0, 741, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 917, 0, 0, 0, 923, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 742, 917, 0, 743, 917, 917, 2658, 744, 0, 0, 745, 0, 0, 2659, 0, 0, 723, 746, 923, 0, 747, 2813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 925, 0, 0, 917, 917, 0, 0, 2660, 748, 0, 0, 0, 0, 0, 0, 0, 749, 0, 919, 0, 0, 0, 0, 750, 0, 0, 751, 2814, 0, 1755, 0, 752, 0, 0, 0, 1755, 0, 0, 0, 753, 726, 754, 0, 0, 925, 0, 755, 0, 0, 0, 0, 0, 0, 4914, 923, 4915, 0, 727, 0, 0, 756, 0, 0, 0, 0, 0, 0, 0, 4922, 0, 0, 0, 3561, 757, 0, 1068, 923, 0, 0, 0, 4928, 0, 0, 0, 4931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4945, 0, 923, 2815, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 730, 0, 0, 4971, 0, 0, 0, 0, 0, 731, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 4975, 732, 0, 0, 0, 0, 925, 2816, 4979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 3561, 0, 0, 0, 0, 5014, 1071, 917, 0, 5018, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 2664, 0, 925, 914, 5028, 5029, 5030, 5031, 0, 0, 0, 923, 0, 0, 5035, 5036, 5037, 5038, 0, 920, 0, 0, 0, 5040, 5041, 0, 0, 0, 0, 5048, 5049, 0, 5051, 5052, 5053, 5054, 5055, 5056, 5057, 0, 0, 0, 0, 2415, 0, 920, 736, 0, 5066, 0, 0, 0, 5069, 5070, 5071, 5072, 0, 0, 0, 2665, 0, 0, 2666, 923, 0, 0, 0, 0, 1598, 0, 0, 0, 0, 0, 1599, 0, 4340, 0, 916, 0, 0, 1665, 916, 916, 919, 0, 0, 0, 923, 0, 0, 2817, 924, 0, 5092, 0, 0, 925, 0, 2153, 0, 0, 2154, 1666, 0, 0, 2155, 2156, 2157, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 1601, 0, 0, 0, 0, 2657, 0, 0, 914, 0, 214, 2818, 0, 914, 741, 2658, 0, 0, 0, 916, 0, 0, 2659, 0, 0, 916, 0, 0, 0, 0, 925, 0, 0, 919, 0, 0, 1667, 2667, 0, 0, 0, 1075, 0, 914, 2819, 0, 0, 0, 2660, 0, 0, 745, 5174, 0, 0, 925, 0, 1602, 746, 0, 0, 747, 0, 0, 1603, 0, 0, 0, 1604, 0, 0, 916, 0, 0, 919, 0, 0, 920, 0, 0, 0, 748, 0, 0, 0, 4340, 0, 0, 0, 1077, 0, 0, 5199, 0, 5200, 0, 750, 1605, 0, 1078, 0, 0, 0, 0, 752, 0, 0, 919, 0, 0, 0, 0, 2820, 923, 0, 0, 0, 0, 0, 2821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 0, 0, 1606, 0, 0, 0, 5226, 0, 0, 0, 0, 0, 0, 2616, 0, 757, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 5592, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1669, 0, 0, 0, 0, 1670, 0, 0, 2663, 2348, 1671, 0, 2765, 922, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 1672, 0, 0, 0, 1608, 0, 0, 0, 0, 0, 2664, 0, 0, 922, 0, 1609, 0, 0, 0, 0, 0, 0, 0, 0, 923, 1610, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 1673, 1611, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 2665, 0, 914, 2666, 0, 914, 0, 914, 0, 0, 0, 3761, 914, 3561, 1613, 1614, 1675, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1676, 3561, 0, 0, 0, 919, 3762, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 5363, 5364, 5365, 1678, 914, 0, 5366, 5367, 5368, 5369, 0, 0, 0, 5371, 916, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 0, 922, 0, 2667, 923, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1679, 0, 919, 0, 0, 919, 919, 1616, 0, 0, 0, 5406, 5407, 5408, 5409, 5410, 0, 5412, 5413, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 5422, 5423, 0, 0, 923, 0, 0, 919, 919, 923, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 920, 0, 2658, 914, 0, 914, 0, 0, 0, 2659, 0, 5429, 0, 0, 0, 0, 0, 0, 0, 0, 925, 916, 0, 917, 0, 0, 0, 917, 917, 0, 0, 0, 0, 0, 0, 2660, 916, 0, 0, 0, 2616, 916, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 5602, 0, 0, 0, 0, 3561, 0, 0, 0, 916, 2765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 5494, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 919, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 5545, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5561, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 925, 0, 920, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 923, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 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, 916, 0, 0, 916, 920, 916, 0, 0, 923, 662, 916, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 917, 0, 0, 0, 0, 2657, 0, 925, 0, 0, 0, 0, 920, 0, 0, 2658, 0, 0, 0, 916, 0, 2667, 2659, 0, 0, 2153, 0, 916, 2154, 0, 0, 0, 2155, 2156, 2157, 914, 924, 5682, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 2660, 0, 2657, 0, 916, 0, 0, 0, 5692, 0, 0, 0, 2658, 925, 5698, 5699, 0, 0, 0, 2659, 0, 923, 0, 0, 5710, 917, 0, 0, 0, 917, 0, 5712, 0, 0, 0, 925, 0, 0, 0, 914, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 5765, 5766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2616, 5774, 0, 5776, 916, 0, 916, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 5790, 0, 0, 0, 5660, 0, 0, 0, 0, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 4340, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 5830, 0, 923, 0, 0, 0, 2663, 2348, 0, 0, 924, 0, 917, 0, 922, 0, 0, 917, 0, 0, 0, 924, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 2664, 0, 0, 924, 0, 0, 0, 916, 0, 0, 0, 0, 0, 917, 0, 920, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 0, 0, 920, 2415, 0, 2664, 0, 0, 922, 0, 0, 916, 5528, 0, 925, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 5900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 922, 0, 0, 5918, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 920, 0, 0, 920, 920, 0, 0, 0, 923, 0, 0, 922, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 920, 916, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 914, 0, 0, 5977, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 919, 0, 923, 0, 919, 919, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 4340, 0, 0, 0, 6027, 0, 0, 0, 0, 0, 2657, 0, 919, 0, 0, 0, 0, 0, 919, 0, 2658, 0, 0, 917, 0, 0, 917, 2659, 917, 0, 0, 0, 2616, 917, 0, 0, 0, 0, 0, 6063, 3561, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 2660, 5693, 916, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 917, 923, 2616, 0, 6090, 920, 0, 0, 917, 922, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 922, 0, 0, 0, 5695, 0, 0, 0, 0, 6109, 0, 0, 916, 917, 0, 0, 922, 0, 0, 0, 0, 914, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3561, 6148, 0, 922, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 922, 0, 0, 922, 922, 0, 0, 0, 917, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 924, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 923, 923, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 2415, 0, 0, 919, 0, 916, 0, 0, 0, 6248, 0, 0, 0, 0, 0, 917, 2665, 0, 0, 2666, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 6263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6273, 925, 0, 0, 0, 0, 925, 925, 0, 0, 917, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 924, 2155, 2156, 2157, 0, 0, 919, 0, 0, 0, 919, 0, 0, 0, 923, 0, 0, 917, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 916, 0, 0, 0, 0, 2659, 0, 0, 922, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 914, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 988, 923, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 1022, 0, 0, 0, 0, 0, 5528, 925, 0, 0, 2153, 1041, 0, 2154, 917, 0, 6355, 2155, 2156, 2157, 0, 914, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 2657, 917, 0, 0, 0, 0, 919, 0, 914, 0, 2658, 919, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 925, 919, 0, 2660, 5734, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 924, 0, 0, 0, 914, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 917, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 924, 2661, 0, 924, 924, 0, 2662, 2665, 0, 0, 2666, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 6500, 924, 924, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 920, 920, 2664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 2667, 2657, 0, 0, 0, 0, 0, 920, 0, 0, 0, 2658, 2665, 920, 0, 2666, 0, 919, 2659, 0, 919, 0, 919, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 2153, 920, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 919, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 914, 0, 0, 0, 0, 2658, 0, 0, 924, 0, 0, 0, 2659, 0, 919, 0, 0, 0, 0, 2616, 0, 2667, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 2660, 0, 0, 6100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 1061, 0, 917, 0, 0, 0, 1093, 0, 914, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 919, 0, 919, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 2616, 916, 0, 2664, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 6108, 0, 0, 0, 0, 0, 0, 2661, 0, 922, 0, 0, 2662, 922, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 2663, 2348, 0, 914, 0, 2665, 0, 919, 2666, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 925, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 922, 0, 0, 723, 0, 0, 917, 0, 3276, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 920, 0, 2415, 0, 920, 0, 0, 0, 1434, 0, 919, 0, 0, 0, 0, 0, 0, 922, 2665, 0, 0, 2666, 1755, 0, 917, 0, 0, 0, 0, 917, 726, 3277, 0, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 727, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1068, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 975, 985, 0, 0, 0, 0, 0, 0, 975, 3278, 985, 975, 0, 914, 0, 0, 0, 0, 914, 914, 919, 0, 0, 730, 985, 0, 0, 0, 0, 0, 0, 0, 731, 920, 0, 2667, 0, 0, 0, 0, 0, 0, 919, 0, 0, 732, 0, 1629, 920, 0, 0, 3279, 0, 920, 0, 0, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 1071, 0, 0, 0, 6130, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3280, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 919, 736, 0, 916, 0, 2616, 0, 0, 0, 0, 922, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 1891, 0, 6361, 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, 1925, 1928, 1929, 0, 0, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 922, 214, 3281, 2153, 922, 741, 2154, 0, 0, 917, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 1075, 0, 0, 3282, 0, 0, 2658, 0, 0, 0, 745, 0, 0, 2659, 0, 0, 0, 746, 0, 0, 747, 0, 0, 924, 0, 0, 0, 924, 924, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 2660, 748, 0, 0, 0, 0, 0, 0, 0, 1077, 0, 1422, 0, 0, 917, 0, 750, 0, 0, 1078, 0, 0, 0, 0, 752, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 920, 916, 920, 3283, 0, 0, 922, 920, 924, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 922, 1422, 0, 0, 0, 922, 0, 0, 2153, 757, 919, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 917, 0, 0, 0, 2657, 0, 922, 920, 0, 0, 924, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 962, 964, 0, 0, 967, 920, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 1025, 0, 0, 0, 0, 0, 0, 1035, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 919, 0, 985, 0, 0, 916, 0, 920, 2651, 920, 916, 916, 0, 0, 985, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 975, 985, 2666, 0, 0, 0, 0, 975, 0, 985, 975, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2742, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 2664, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 0, 922, 919, 0, 922, 985, 922, 0, 920, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 2854, 0, 0, 0, 2665, 920, 0, 2666, 0, 2884, 0, 0, 0, 0, 0, 0, 924, 0, 919, 985, 924, 916, 922, 919, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2922, 0, 0, 0, 0, 0, 2934, 2934, 0, 0, 2934, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 917, 0, 2952, 0, 0, 2955, 0, 914, 0, 0, 0, 920, 0, 2616, 0, 0, 0, 0, 0, 985, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 920, 0, 6378, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 3008, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 922, 0, 922, 3028, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 924, 0, 0, 0, 0, 917, 0, 0, 0, 984, 0, 0, 1842, 0, 0, 0, 0, 0, 919, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2616, 975, 0, 0, 920, 975, 0, 975, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 1095, 0, 1098, 0, 6438, 1100, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1126, 0, 0, 3050, 0, 0, 1130, 0, 0, 0, 0, 0, 0, 0, 3053, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3097, 2934, 919, 2657, 922, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 985, 0, 0, 0, 3132, 0, 0, 0, 0, 0, 0, 3145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 2660, 917, 917, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 922, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 985, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 922, 0, 0, 2658, 0, 985, 0, 0, 0, 0, 2659, 3206, 0, 0, 2742, 985, 985, 0, 0, 0, 0, 985, 922, 0, 0, 924, 0, 0, 924, 0, 924, 0, 0, 0, 0, 924, 2660, 985, 920, 0, 0, 0, 985, 0, 0, 0, 1422, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 2661, 0, 0, 0, 0, 2662, 924, 0, 0, 0, 0, 0, 0, 0, 924, 3266, 0, 0, 3268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2664, 0, 6199, 0, 0, 0, 0, 920, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 1630, 1631, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 920, 0, 0, 0, 0, 0, 0, 922, 2415, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 2663, 2348, 0, 2665, 0, 0, 2666, 924, 0, 924, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 4803, 0, 0, 0, 1859, 0, 1842, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 1871, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 984, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 1893, 1894, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 984, 0, 2667, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 1931, 0, 984, 0, 0, 0, 6200, 0, 4804, 0, 984, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 919, 0, 0, 924, 0, 1969, 1971, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 920, 0, 0, 924, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 919, 0, 984, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 2616, 985, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 919, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 2657, 0, 0, 4096, 0, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 924, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 985, 0, 0, 0, 0, 0, 2658, 0, 0, 2153, 0, 0, 2154, 2659, 0, 922, 2155, 2156, 2157, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 0, 924, 0, 984, 0, 0, 2657, 1842, 0, 0, 0, 2660, 0, 0, 0, 0, 2658, 0, 0, 920, 0, 0, 0, 2659, 0, 0, 924, 3450, 0, 0, 985, 0, 0, 0, 922, 0, 0, 3455, 985, 922, 917, 0, 0, 0, 2153, 0, 985, 2154, 0, 2660, 0, 2155, 2156, 2157, 0, 0, 0, 0, 919, 0, 0, 0, 0, 919, 919, 0, 0, 0, 0, 2657, 0, 0, 4173, 920, 0, 0, 0, 0, 0, 2658, 2661, 0, 0, 0, 0, 2662, 2659, 975, 975, 0, 985, 985, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 975, 0, 985, 975, 0, 0, 2663, 2348, 0, 0, 2660, 0, 0, 0, 0, 985, 985, 0, 0, 0, 2842, 0, 0, 0, 1422, 984, 0, 0, 2661, 0, 0, 0, 0, 2662, 2664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 975, 2663, 2348, 0, 975, 975, 0, 0, 0, 0, 920, 2661, 0, 924, 0, 0, 2662, 0, 0, 0, 0, 919, 2415, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 984, 0, 0, 0, 0, 2665, 2663, 2348, 2666, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 922, 0, 984, 984, 0, 0, 0, 0, 984, 0, 0, 2664, 0, 2978, 0, 0, 2415, 0, 2661, 0, 0, 0, 0, 2662, 984, 0, 0, 0, 0, 984, 0, 0, 2665, 919, 0, 2666, 0, 0, 0, 0, 0, 0, 3004, 3005, 3006, 3007, 2663, 2348, 3662, 0, 0, 0, 0, 924, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 3684, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 2664, 0, 920, 0, 0, 2667, 0, 924, 0, 0, 0, 3712, 0, 0, 1842, 0, 0, 0, 0, 0, 0, 4141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 922, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 3792, 3793, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 922, 0, 2658, 0, 2616, 0, 0, 3061, 3062, 2659, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 3079, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 924, 0, 0, 920, 0, 0, 2667, 0, 0, 0, 0, 4105, 2616, 0, 0, 3122, 3123, 3124, 3125, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 3918, 2616, 0, 924, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4178, 0, 0, 3199, 0, 0, 0, 0, 0, 3203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 2616, 0, 0, 0, 2662, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 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, 2664, 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, 0, 0, 2415, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 924, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 984, 2657, 0, 0, 4185, 0, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 922, 0, 0, 0, 0, 2659, 0, 0, 0, 0, 0, 3393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 0, 919, 924, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 984, 0, 920, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2153, 922, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 1842, 0, 0, 924, 0, 1841, 0, 0, 0, 0, 2657, 0, 0, 4810, 0, 4240, 0, 0, 2661, 0, 2658, 0, 0, 2662, 0, 924, 0, 2659, 984, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 984, 0, 2663, 2348, 2616, 0, 0, 0, 0, 2660, 985, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 2661, 0, 985, 0, 2664, 2662, 985, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 920, 984, 984, 985, 0, 0, 0, 0, 0, 0, 924, 2663, 2348, 0, 0, 984, 0, 0, 985, 0, 0, 922, 0, 0, 0, 0, 0, 0, 984, 984, 2415, 0, 0, 0, 0, 975, 0, 975, 975, 2664, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 985, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 920, 0, 985, 985, 0, 0, 0, 0, 0, 0, 2657, 0, 0, 0, 2415, 0, 0, 2661, 0, 0, 2658, 0, 2662, 0, 0, 0, 0, 2659, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 1842, 985, 0, 0, 1842, 2663, 2348, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 985, 0, 1842, 0, 0, 2664, 985, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 985, 0, 0, 985, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 2415, 922, 922, 0, 0, 0, 0, 0, 985, 0, 0, 2667, 0, 0, 985, 0, 2665, 0, 0, 2666, 0, 985, 0, 0, 0, 0, 4442, 0, 1841, 0, 0, 0, 0, 0, 0, 985, 2934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4734, 0, 985, 0, 0, 0, 0, 1842, 0, 2661, 0, 0, 0, 985, 2662, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1398, 1398, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 3393, 0, 0, 0, 0, 2664, 2667, 0, 0, 922, 0, 2616, 0, 1842, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 2657, 0, 924, 0, 0, 1398, 0, 0, 2665, 0, 2658, 2666, 0, 0, 0, 0, 2153, 2659, 0, 2154, 0, 922, 0, 2155, 2156, 2157, 0, 0, 5255, 0, 0, 0, 0, 0, 0, 0, 4574, 4575, 4576, 0, 0, 2657, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 4585, 0, 0, 0, 2616, 2659, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2660, 0, 4610, 4612, 0, 0, 0, 4617, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 3616, 0, 0, 0, 0, 0, 0, 0, 985, 0, 1842, 0, 0, 0, 0, 0, 0, 0, 924, 0, 1752, 1756, 0, 0, 0, 0, 0, 985, 0, 0, 0, 985, 0, 0, 0, 0, 0, 5265, 985, 0, 0, 0, 0, 0, 0, 975, 0, 975, 975, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5271, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 1422, 0, 2616, 0, 0, 0, 0, 0, 2664, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 1842, 0, 920, 0, 0, 0, 1842, 0, 3766, 0, 0, 3769, 0, 0, 0, 0, 0, 0, 2664, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 924, 0, 0, 0, 0, 924, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3877, 0, 0, 0, 0, 0, 0, 0, 3886, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 4843, 4844, 4845, 0, 0, 0, 0, 1841, 0, 2097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3930, 0, 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 0, 3954, 0, 0, 0, 0, 0, 2123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 985, 0, 0, 0, 984, 2142, 2143, 2144, 984, 2146, 0, 0, 984, 4009, 0, 4011, 0, 0, 0, 924, 985, 0, 984, 985, 0, 0, 0, 0, 0, 2616, 2634, 0, 0, 0, 0, 0, 0, 984, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2616, 984, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 984, 984, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1842, 1842, 1842, 0, 4079, 2153, 0, 0, 2154, 0, 0, 4086, 2155, 2156, 2157, 0, 2709, 0, 0, 0, 2721, 2726, 1841, 984, 0, 985, 1841, 0, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 985, 0, 2153, 2659, 0, 2154, 984, 0, 1841, 2155, 2156, 2157, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 984, 2657, 0, 2660, 0, 0, 0, 984, 0, 0, 984, 2658, 0, 0, 0, 0, 984, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 984, 0, 2660, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 5103, 0, 0, 0, 0, 0, 2153, 984, 0, 2154, 0, 0, 1841, 2155, 2156, 2157, 985, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 5272, 0, 0, 0, 2657, 5135, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 5273, 2659, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 1842, 3145, 0, 0, 0, 0, 985, 0, 985, 0, 0, 2660, 0, 0, 0, 1841, 0, 2663, 2348, 0, 0, 985, 0, 985, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 5193, 0, 0, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 0, 3206, 0, 0, 0, 0, 2663, 2348, 0, 0, 1752, 1752, 1752, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 2664, 0, 2415, 0, 985, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 2665, 0, 0, 2666, 0, 0, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 2661, 0, 985, 4336, 4337, 2662, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 985, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 984, 0, 1841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2664, 0, 0, 985, 0, 984, 0, 0, 0, 984, 2153, 0, 0, 2154, 0, 2667, 984, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5309, 5310, 5311, 5312, 0, 0, 2657, 0, 0, 5861, 0, 0, 0, 0, 2415, 5844, 2658, 0, 924, 0, 0, 0, 0, 2659, 0, 0, 0, 2667, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 2660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1842, 0, 1841, 0, 0, 0, 0, 0, 1841, 0, 0, 2616, 0, 0, 2664, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 2415, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 4522, 2662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2663, 2348, 0, 0, 3294, 0, 0, 0, 0, 0, 0, 0, 5648, 3311, 3311, 3311, 3311, 3321, 3327, 3311, 3330, 3311, 3311, 0, 0, 0, 0, 3337, 2664, 3338, 0, 3340, 0, 0, 3354, 3357, 3362, 0, 2616, 0, 0, 0, 3371, 0, 985, 3376, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2667, 0, 0, 0, 3383, 3384, 3385, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 2153, 0, 0, 2154, 0, 0, 3386, 2155, 2156, 2157, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 2657, 984, 984, 0, 0, 0, 0, 0, 0, 0, 2658, 1842, 0, 0, 0, 0, 1842, 2659, 1842, 0, 0, 0, 984, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4676, 0, 0, 0, 2660, 1842, 0, 0, 5523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5533, 0, 0, 0, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 2667, 0, 0, 985, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1841, 1841, 1841, 2153, 0, 0, 2154, 0, 0, 0, 2155, 2156, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3394, 0, 0, 984, 0, 0, 2657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2658, 0, 0, 0, 0, 0, 984, 2659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 2660, 0, 0, 0, 0, 3412, 985, 985, 0, 0, 0, 0, 2663, 2348, 0, 2627, 2616, 985, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 985, 0, 0, 0, 0, 0, 2664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 3414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 2666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 2662, 0, 0, 0, 0, 0, 985, 0, 1841, 1842, 0, 0, 0, 0, 984, 0, 984, 0, 0, 0, 0, 0, 1, 2663, 2348, 0, 0, 0, 0, 984, 0, 984, 0, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 5749, 0, 0, 0, 0, 1422, 0, 2664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 5779, 0, 0, 0, 2667, 0, 0, 7, 0, 8, 9, 0, 0, 0, 0, 0, 10, 0, 11, 0, 0, 0, 0, 0, 0, 0, 2415, 0, 0, 0, 984, 12, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 2665, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 15, 0, 3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 0, 3430, 0, 0, 16, 0, 17, 0, 984, 0, 18, 0, 1398, 0, 1752, 0, 0, 5805, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 21, 0, 3386, 0, 0, 0, 3394, 22, 984, 3412, 0, 3414, 984, 0, 3464, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 23, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 984, 0, 0, 0, 0, 0, 24, 0, 0, 0, 2667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2143, 2144, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 2627, 0, 5089, 0, 0, 0, 0, 0, 25, 26, 0, 0, 0, 0, 27, 0, 5091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 985, 0, 0, 0, 1841, 0, 0, 3594, 0, 0, 0, 0, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 0, 0, 0, 985, 5984, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 6007, 0, 33, 34, 675, 35, 0, 0, 0, 0, 36, 0, 0, 4648, 0, 0, 37, 0, 0, 38, 0, 0, 0, 0, 0, 0, 39, 0, 0, 676, 0, 0, 0, 40, 41, 0, 0, 0, 0, 0, 0, 42, 677, 0, 0, 43, 0, 0, 0, 1842, 0, 0, 0, 0, 0, 0, 44, 0, 0, -905, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 45, 0, 0, 0, 678, 0, 0, 0, 0, 0, 679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 984, 0, 0, 680, 0, 0, 0, 0, 47, 0, 0, 0, 6096, 0, 48, 0, 0, 681, 0, 49, 0, 0, 0, 0, 0, 0, 682, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 683, 0, 0, 0, 0, 0, 0, 0, 0, 684, 0, 0, 0, 685, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 985, 1841, 0, 1841, -1110, 0, 0, 0, 57, 0, 0, -136, 0, 0, 0, 0, 0, 0, 3850, 3851, 1752, 0, 0, 0, 3855, 0, 0, 0, 0, 1841, 723, 0, 0, 0, 0, 1064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3884, 0, 0, 686, 0, 0, 0, 0, 2627, 0, 0, 0, 0, -636, 0, 0, 0, 0, 0, 0, 0, 0, 1065, 0, 984, 0, 0, 984, 0, 0, 0, 0, 0, 0, 2627, 726, 1066, 0, 3350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1067, 0, 0, 0, 727, 2627, 2627, 2627, 0, 2627, 687, 0, 0, 688, 0, 0, 0, 0, 0, 0, 0, 0, 1068, 985, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 689, 0, 0, 0, 0, 0, 0, 0, 1069, 0, 0, 0, 0, 0, 690, 0, 0, 0, 0, 0, 0, -474, 730, 0, 0, 0, 0, 0, 0, 0, 0, 731, 984, 984, 0, 0, 0, 0, 985, 0, 0, 691, 0, 984, 732, 0, 0, 0, 975, 0, 1070, 692, 0, 0, 0, 0, 0, 0, -474, 0, 984, 693, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1071, 0, 0, 198, 694, 0, 0, 0, 0, 0, 0, 1842, 695, 5437, 0, 0, 975, 0, 0, -474, 0, 0, 696, 0, 697, 0, 698, 699, 5441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1072, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 701, 0, 4092, 702, 199, 0, 703, 4098, 0, 0, 736, 0, 0, 0, 0, 0, 0, 0, 0, -474, 0, 200, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 1841, 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 2146, 0, 0, 0, 0, 203, 0, 0, 0, 0, 0, 3362, 5501, 3362, 3362, 0, 0, 0, 0, 204, 0, 0, 0, 0, 0, 739, 0, 4188, 205, 0, 4191, 0, 4193, 0, 0, 214, 1074, 0, 0, 741, 0, 206, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1075, 0, 4218, 1076, 4221, 0, 4224, 744, 209, 0, 745, 0, 0, 0, 0, 0, 0, 746, 0, 0, 747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 748, 0, 0, 0, 0, 0, 210, 0, 1077, 0, 0, 0, 0, 0, 0, 750, 0, 0, 1078, 0, 0, 0, 0, 752, 0, 0, 0, 0, 211, 0, 0, 1079, 0, 754, 0, 0, 0, 0, 1080, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4291, 0, 985, 0, 0, 2709, 0, 0, 757, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 2726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 1842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 215, 0, 0, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4326, 5666, 0, 5668, 0, 0, 0, 0, 0, 0, 217, 0, 0, 218, 0, 0, 984, 219, 0, 0, 220, 0, 0, 0, 0, 0, 0, 221, 984, 0, 222, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 1842, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 0, 224, 0, 4361, 0, 984, 225, 0, 226, 0, 0, 227, 0, 0, 0, 0, 228, 0, 0, 0, 0, 0, 0, 1842, 0, 0, 229, 0, 0, 0, 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 232, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1841, 0, 5795, 0, 0, 0, 0, 0, 0, 1842, 0, 0, 985, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 1752, 0, 0, 0, 0, 0, 1752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 975, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 5933, 0, 5935, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 984, 0, 975, 975, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4735, 0, 0, 0, 0, 0, 0, 0, 0, 4739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3311, 0, 0, 0, 4752, 3311, 3311, 0, 0, 0, 0, 3327, 0, 0, 4760, 0, 0, 4762, 0, 0, 0, 0, 0, 4764, 0, 4765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4787, 4788, 4789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3371, 6144, 0, 0, 0, 0, 0, 0, 4813, 0, 0, 4816, 0, 4818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4822, 1842, 0, 0, 0, 0, 0, 0, 0, 4830, 4831, 0, 0, 0, 0, 0, 4836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1842, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 975, 975, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 1842, 0, 0, 0, 0, 2627, 4889, 0, 0, 0, 0, 2627, 0, 984, 2627, 0, 0, 0, 0, 0, 6254, 2627, 2627, 0, 2627, 0, 0, 984, 0, 3350, 3350, 0, 4164, 0, 3350, 0, 0, 0, 2627, 0, 0, 2627, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 1841, 2627, 0, 0, 0, 0, 0, 0, 2627, 2627, 2627, 2627, 0, 0, 0, 0, 3350, 3350, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 2627, 0, 0, 0, 0, 0, 0, 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 6349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 0, 0, 0, 0, 1126, 1126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1841, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5181, 5182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 5244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2709, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5286, 5288, 0, 0, 0, 0, 0, 5292, 5293, 0, 0, 0, 5294, 0, 0, 0, 0, 5295, 0, 0, 5298, 0, 5300, 0, 0, 0, 0, 0, 5305, 0, 2627, 2627, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 2627, 0, 0, 0, 0, 0, 0, 0, 5339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5374, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5425, 0, 0, 0, 0, 0, 0, 5427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 5462, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4164, 4164, 0, 0, 3350, 3350, 3350, 3350, 0, 0, 3350, 3350, 3350, 3350, 3350, 3350, 3350, 3350, 3350, 3350, 4164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 2627, 0, 2627, 0, 0, 4164, 4164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 3350, 3350, 2627, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5580, 0, 0, 0, 0, 0, 5584, 5585, 5586, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5599, 5600, 0, 0, 0, 5601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 5609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5639, 0, 0, 0, 0, 0, 0, 0, 1398, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5829, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 3371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5913, 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, 0, 0, 0, 0, 2627, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5961, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 2627, 0, 2627, 2627, 0, 0, 0, 0, 4164, 4164, 4164, 4164, 0, 0, 0, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 2627, 2627, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 2627, 0, 2627, 0, 0, 0, 2627, 0, 0, 4164, 4164, 0, 0, 0, 2627, 2627, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 3311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6047, 0, 0, 0, 0, 0, 0, 0, 0, 6054, 6054, 6054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 5639, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6086, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5639, 0, 0, 0, 4164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 2627, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 6305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 3350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 2627, 0, 0, 0, 2627, 2627, 2627, 2627, 0, 0, 2627, 0, 2627, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3350, 0, 0, 0, 0, 0, 6054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 6396, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 4164, 3350, 2627, 2627, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 2627, 2627, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 3350, 0, 0, 4164, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4164, 0, 3350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3350, 3350, 0, 0, 3350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4164, 4164, 0, 4164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 0, 1301, 718, 0, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1746, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 2627, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 1747, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 1748, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 1749, 0, 0, 0, 0, 0, 0, 1385, 1750, 235, 0, 1301, 718, 0, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 1215, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 0, 0, 0, 0, 1385, 5880, 235, 0, 1301, 718, 0, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 0, 0, 0, 0, 1385, 3352, 235, 0, 1301, 718, 0, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 0, 0, 0, 0, 1385, 4766, 235, 0, 1301, 718, 0, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 0, 0, 0, 0, 1385, 4833, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 4268, 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, -1863, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, -1863, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, -1863, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, -1863, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, -1863, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, -1863, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, -1863, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1485, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2751, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2752, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 2754, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 2756, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 2848, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2751, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2752, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 2754, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 2756, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 235, 0, 1301, 718, 0, 1302, 1303, 1304, 780, 1305, 649, 650, 651, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 3973, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 3313, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 1215, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 1215, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 3358, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 3359, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 3360, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 3361, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, -2296, 245, 246, 247, 0, 0, 0, -2296, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, -2296, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, -2294, 245, 246, 247, 0, 0, 0, -2294, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, -2294, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 0, 0, 2094, 3287, 1385, 235, 0, 1301, 718, 0, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 1384, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2719, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 3313, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 3852, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 3359, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 3415, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2722, 2723, 0, 0, 0, 235, 0, 3531, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 4888, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 5275, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 5287, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 5629, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 5630, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 5631, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 5632, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 6051, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6052, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 6053, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6052, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 6053, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 5614, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3344, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3345, 3346, 0, 0, 0, 235, 0, 1301, 718, 3347, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, -3020, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6052, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 1325, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, -3020, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 0, 0, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, -3020, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 1352, 461, 462, 0, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 1360, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, -3020, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 6053, 609, 610, 611, 0, 1370, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, -3020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 1383, 0, 0, 0, 235, 0, 1301, 718, 1385, 1302, 1303, 1304, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 1356, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3344, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3345, 3346, 235, 0, 1301, 718, 0, 1302, 1303, 3347, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3520, 3521, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3522, 3523, 235, 0, 1301, 718, 0, 1302, 1303, 3347, 780, 1305, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3344, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 1301, 718, 0, 1302, 1303, 0, 780, 1305, 0, 0, 0, 0, 0, 0, 3347, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 4797, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3344, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 1301, 718, 0, 1302, 1303, 0, 780, 1305, 0, 0, 0, 0, 0, 0, 3347, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1306, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 1310, 1311, 271, 272, 1312, 1313, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 304, 305, 306, 307, 308, 309, 1323, 1324, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 1326, 344, 345, 346, 347, 1327, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 1331, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 1353, 1354, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 3344, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 1367, 601, 1368, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 4857, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3347, 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, 1311, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1327, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3491, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 3492, 1344, 413, 414, 415, 416, 417, 418, 419, 3493, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 0, 1354, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 871, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 3494, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1367, 601, 1368, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 1215, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 3495, 649, 650, 651, 0, 0, 0, 51, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3496, 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, 1311, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1327, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3491, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 3492, 1344, 413, 414, 415, 416, 417, 418, 419, 3493, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 0, 1354, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 871, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 3494, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1367, 601, 1368, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 3495, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3496, 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, 1311, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1327, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3491, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 0, 1354, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1367, 601, 1368, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3931, 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, 1311, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1327, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3491, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 3492, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 0, 1354, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 3494, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1367, 601, 1368, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 3495, 649, 650, 651, 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, 1311, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1327, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3491, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 0, 1354, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1367, 601, 1368, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4934, 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, 1311, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1327, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3491, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 0, 1354, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1367, 601, 1368, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 976, 0, 1622, 718, 0, 0, 0, 0, 780, 0, 0, 0, 0, 0, 0, 0, 6154, 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, 5940, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1847, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1848, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1849, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 976, 0, 0, 0, 0, 0, 0, 1623, 1624, 5941, 0, 0, 0, 0, 0, 0, 5942, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 45, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 1215, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 1055, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5684, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 41, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 45, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 1215, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 50, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 51, 0, 0, 659, 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, 2928, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 871, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 2929, 2930, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1881, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1433, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4031, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4233, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2152, 0, 0, 0, 0, 0, 0, 2153, 0, 0, 2154, 0, 0, 4874, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 0, 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, 2201, 2202, 2203, 2204, 2205, 0, 0, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 0, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 0, 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, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 0, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 0, 0, 2298, 2299, 2300, 2301, 0, 2302, 2303, 2304, 2305, 2306, 0, 2307, 2308, 2309, 2310, 2311, 0, 2312, 2313, 0, 2314, 2315, 2316, 0, 2317, 2318, 0, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 0, 2345, 0, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 0, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 0, 2393, 2394, 0, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 0, 2425, 2426, 2427, 0, 2428, 2429, 2430, 2431, 2432, 0, 2433, 2434, 2435, 2436, 0, 0, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 0, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 0, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 0, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 0, 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, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 0, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 0, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 0, 2591, 2592, 2593, 2594, 2595, 2596, 2597, 0, 2598, 0, 0, 0, 0, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 0, 2614, 2615, 0, 2616, 0, 0, 0, 0, 0, 0, 0, 0, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 888, 0, 1622, 718, 0, 0, 0, 991, 780, 0, 0, 0, 0, 0, 992, 993, 994, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1759, 245, 246, 247, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 248, 249, 250, 1767, 251, 252, 253, 254, 255, 256, 257, 258, 0, 889, 261, 890, 891, 1768, 264, 265, 266, 267, 268, 269, 270, 1769, 1770, 271, 272, 892, 893, 275, 1771, 276, 277, 278, 279, 0, 1772, 281, 1773, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1774, 293, 294, 295, 296, 297, 298, 1775, 299, 300, 301, 302, 1776, 1777, 1778, 303, 1779, 1780, 1781, 304, 305, 306, 307, 308, 309, 894, 895, 312, 1782, 313, 1783, 314, 315, 316, 317, 318, 319, 320, 1784, 321, 322, 323, 324, 1785, 1786, 325, 326, 896, 328, 329, 1787, 330, 331, 332, 333, 1788, 334, 335, 336, 337, 338, 1789, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 1790, 349, 1791, 350, 351, 352, 897, 354, 1792, 355, 1793, 356, 357, 358, 1794, 359, 360, 361, 362, 363, 1795, 364, 0, 1796, 0, 367, 368, 1797, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1798, 379, 380, 381, 382, 383, 384, 385, 386, 1799, 387, 388, 0, 390, 391, 392, 393, 898, 899, 1800, 900, 1801, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 1802, 1803, 420, 0, 422, 423, 424, 1804, 425, 426, 427, 1805, 1806, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 4540, 0, 460, 1807, 461, 462, 463, 464, 1808, 0, 466, 904, 468, 469, 470, 471, 1809, 472, 473, 474, 1810, 1811, 4541, 476, 477, 1812, 1813, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1814, 497, 498, 499, 0, 501, 0, 503, 504, 505, 1815, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 1816, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1817, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1818, 553, 554, 555, 556, 557, 1819, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 1820, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 1821, 585, 586, 1822, 1823, 587, 588, 589, 590, 591, 592, 593, 594, 1824, 595, 908, 909, 1825, 1826, 598, 599, 0, 601, 0, 1827, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1828, 1829, 612, 613, 614, 615, 616, 1830, 1831, 617, 618, 619, 620, 621, 0, 910, 1832, 624, 625, 626, 627, 628, 629, 630, 1833, 1834, 631, 1835, 1836, 632, 633, 634, 635, 636, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 4542, 4543, 1002, 1003, 1004, 1005, 888, 0, 1622, 718, 0, 0, 0, 991, 780, 0, 0, 0, 0, 0, 992, 993, 994, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1759, 245, 246, 247, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 248, 249, 250, 1767, 251, 252, 253, 254, 255, 256, 257, 258, 0, 889, 261, 890, 891, 1768, 264, 265, 266, 267, 268, 269, 270, 1769, 1770, 271, 272, 892, 893, 275, 1771, 276, 277, 278, 279, 0, 1772, 281, 1773, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1774, 293, 294, 295, 296, 297, 298, 1775, 299, 300, 301, 302, 1776, 1777, 1778, 303, 1779, 1780, 1781, 304, 305, 306, 307, 308, 309, 894, 895, 312, 1782, 313, 1783, 314, 315, 316, 317, 318, 319, 320, 1784, 321, 322, 323, 324, 1785, 1786, 325, 326, 896, 328, 329, 1787, 330, 331, 332, 333, 1788, 334, 335, 336, 337, 338, 1789, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 1790, 349, 1791, 350, 351, 352, 897, 354, 1792, 355, 1793, 356, 357, 358, 1794, 359, 360, 361, 362, 363, 1795, 364, 0, 1796, 0, 367, 368, 1797, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1798, 379, 380, 381, 382, 383, 384, 385, 386, 1799, 387, 388, 0, 390, 391, 392, 393, 898, 899, 1800, 900, 1801, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 1802, 1803, 420, 0, 422, 423, 424, 1804, 425, 426, 427, 1805, 1806, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 5006, 0, 460, 1807, 461, 462, 463, 464, 1808, 0, 466, 904, 468, 469, 470, 471, 1809, 472, 473, 474, 1810, 1811, 4541, 476, 477, 1812, 1813, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1814, 497, 498, 499, 0, 501, 0, 503, 504, 505, 1815, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 1816, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1817, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1818, 553, 554, 555, 556, 557, 1819, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 1820, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 1821, 585, 586, 1822, 1823, 587, 588, 589, 590, 591, 592, 593, 594, 1824, 595, 908, 909, 1825, 1826, 598, 599, 0, 601, 0, 1827, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1828, 1829, 612, 613, 614, 615, 616, 1830, 1831, 617, 618, 619, 620, 621, 0, 910, 1832, 624, 625, 626, 627, 628, 629, 630, 1833, 1834, 631, 1835, 1836, 632, 633, 634, 635, 636, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 4542, 4543, 1002, 1003, 1004, 1005, 659, 0, 0, 0, 0, 0, 0, 991, 0, 0, 0, 0, 0, 0, 992, 993, 994, 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, 995, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 996, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 659, 0, 0, 0, 0, 0, 0, 991, 0, 0, 0, 0, 0, 0, 992, 993, 994, 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, 1112, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 1113, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 659, 0, 0, 0, 0, 0, 0, 991, 0, 0, 0, 0, 0, 0, 992, 993, 994, 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, 1178, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 1179, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1180, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 659, 0, 0, 0, 0, 0, 0, 991, 0, 0, 0, 0, 0, 0, 992, 993, 994, 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, 1864, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 1865, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 659, 0, 0, 0, 0, 0, 0, 991, 0, 0, 0, 0, 0, 0, 992, 993, 994, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 659, 0, 0, 0, 0, 0, 0, 991, 0, 0, 0, 0, 0, 0, 992, 993, 994, 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, 3609, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 3610, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 659, 0, 0, 0, 0, 0, 0, 991, 0, 0, 0, 0, 0, 0, 992, 993, 994, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 5664, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 0, 0, 1758, 0, 0, 0, 0, 0, 0, 0, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1759, 245, 246, 247, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 248, 249, 250, 1767, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1768, 264, 265, 266, 267, 268, 269, 270, 1769, 1770, 271, 272, 273, 274, 275, 1771, 276, 277, 278, 279, 280, 1772, 281, 1773, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1774, 293, 294, 295, 296, 297, 298, 1775, 299, 300, 301, 302, 1776, 1777, 1778, 303, 1779, 1780, 1781, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1782, 313, 1783, 314, 315, 316, 317, 318, 319, 320, 1784, 321, 322, 323, 324, 1785, 1786, 325, 326, 327, 328, 329, 1787, 330, 331, 332, 333, 1788, 334, 335, 336, 337, 338, 1789, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1790, 349, 1791, 350, 351, 352, 353, 354, 1792, 355, 1793, 356, 357, 358, 1794, 359, 360, 361, 362, 363, 1795, 364, 365, 1796, 366, 367, 368, 1797, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1798, 379, 380, 381, 382, 383, 384, 385, 386, 1799, 387, 388, 389, 390, 391, 392, 393, 394, 395, 1800, 396, 1801, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 1802, 1803, 420, 421, 422, 423, 424, 1804, 425, 426, 427, 1805, 1806, 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, 1807, 461, 462, 463, 464, 1808, 465, 466, 467, 468, 469, 470, 471, 1809, 472, 473, 474, 1810, 1811, 475, 476, 477, 1812, 1813, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1814, 497, 498, 499, 500, 501, 502, 503, 504, 505, 1815, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1816, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1817, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1818, 553, 554, 555, 556, 557, 1819, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 1820, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 1821, 585, 586, 1822, 1823, 587, 588, 589, 590, 591, 592, 593, 594, 1824, 595, 596, 597, 1825, 1826, 598, 599, 600, 601, 602, 1827, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1828, 1829, 612, 613, 614, 615, 616, 1830, 1831, 617, 618, 619, 620, 621, 622, 623, 1832, 624, 625, 626, 627, 628, 629, 630, 1833, 1834, 631, 1835, 1836, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1837, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 877, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6123, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6125, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6257, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2751, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2752, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 2753, 478, 479, 2754, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 2756, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 0, 0, 3968, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2757, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2751, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2752, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 2753, 478, 479, 2754, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 2756, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 976, 0, 1622, 718, 0, 0, 0, 0, 780, 0, 0, 0, 0, 0, 0, 2757, 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, 2066, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1847, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1848, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1849, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 0, 1622, 718, 0, 0, 0, 0, 780, 0, 0, 0, 0, 1623, 1624, 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, 2071, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1847, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1848, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1849, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 0, 1622, 718, 0, 0, 0, 0, 780, 0, 0, 0, 0, 1623, 1624, 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, 3576, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1847, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1848, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1849, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 0, 1622, 718, 0, 0, 0, 0, 780, 0, 0, 0, 0, 1623, 1624, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1847, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1848, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1849, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 780, 0, 0, 0, 0, 1623, 1624, 0, 0, 236, 237, 781, 239, 240, 241, 242, 243, 244, 782, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 783, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 784, 353, 354, 0, 355, 0, 356, 785, 0, 786, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 787, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 788, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 789, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 790, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 791, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 792, 793, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 1055, 1758, 0, 6455, 718, 0, 0, 0, 0, 780, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1759, 245, 246, 247, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 248, 249, 250, 1767, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1768, 264, 265, 266, 267, 268, 269, 270, 1769, 1770, 271, 272, 273, 274, 275, 1771, 276, 277, 278, 279, 280, 1772, 281, 1773, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1774, 293, 294, 295, 296, 297, 298, 1775, 299, 300, 301, 302, 1776, 1777, 1778, 303, 1779, 1780, 1781, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1782, 313, 1783, 314, 315, 316, 317, 318, 319, 320, 1784, 321, 322, 323, 324, 1785, 1786, 325, 326, 327, 328, 329, 1787, 330, 331, 332, 333, 1788, 334, 335, 336, 337, 338, 1789, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1790, 349, 1791, 350, 351, 352, 353, 354, 1792, 355, 1793, 356, 357, 358, 1794, 359, 360, 361, 362, 363, 1795, 364, 365, 1796, 366, 367, 368, 1797, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1798, 379, 380, 381, 382, 383, 384, 385, 386, 1799, 387, 388, 389, 390, 391, 392, 393, 394, 395, 1800, 396, 1801, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 1802, 1803, 420, 421, 422, 423, 424, 1804, 425, 426, 427, 1805, 1806, 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, 1807, 461, 462, 463, 464, 1808, 465, 466, 467, 468, 469, 470, 471, 1809, 472, 473, 474, 1810, 1811, 475, 476, 477, 1812, 1813, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1814, 497, 498, 499, 500, 501, 502, 503, 504, 505, 1815, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1816, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1817, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1818, 553, 554, 555, 556, 557, 1819, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 1820, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 1821, 585, 586, 1822, 1823, 587, 588, 589, 590, 591, 592, 593, 594, 1824, 595, 596, 597, 1825, 1826, 598, 599, 600, 601, 602, 1827, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1828, 1829, 612, 613, 614, 615, 616, 1830, 1831, 617, 618, 619, 620, 621, 622, 623, 1832, 624, 625, 626, 627, 628, 629, 630, 1833, 1834, 631, 1835, 1836, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 1758, 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, 1759, 245, 246, 247, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 248, 249, 250, 1767, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1768, 264, 265, 266, 267, 268, 269, 270, 1769, 1770, 271, 272, 273, 274, 275, 1771, 276, 277, 278, 279, 280, 1772, 281, 1773, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1774, 293, 294, 295, 296, 297, 298, 1775, 299, 300, 301, 302, 1776, 1777, 1778, 303, 1779, 1780, 1781, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1782, 313, 1783, 314, 315, 316, 317, 318, 319, 320, 1784, 321, 322, 323, 324, 1785, 1786, 325, 326, 327, 328, 329, 1787, 330, 331, 332, 333, 1788, 334, 335, 336, 337, 338, 1789, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1790, 349, 1791, 350, 351, 352, 353, 354, 1792, 355, 1793, 356, 357, 358, 1794, 359, 360, 361, 362, 363, 1795, 364, 365, 1796, 366, 367, 368, 1797, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1798, 379, 380, 381, 382, 383, 384, 385, 386, 1799, 387, 388, 389, 390, 391, 392, 393, 394, 395, 1800, 396, 1801, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 1802, 1803, 420, 421, 422, 423, 424, 1804, 425, 426, 427, 1805, 1806, 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, 1807, 461, 462, 463, 464, 1808, 465, 466, 467, 468, 469, 470, 471, 1809, 472, 473, 474, 1810, 1811, 475, 476, 477, 1812, 1813, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1814, 497, 498, 499, 500, 501, 502, 503, 504, 505, 1815, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1816, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1817, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1818, 553, 554, 555, 556, 557, 1819, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 1820, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 1821, 585, 586, 1822, 1823, 587, 588, 589, 590, 591, 592, 593, 594, 1824, 595, 596, 597, 1825, 1826, 598, 599, 600, 601, 602, 1827, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1828, 1829, 612, 613, 614, 615, 616, 1830, 1831, 617, 618, 619, 620, 621, 622, 623, 1832, 624, 625, 626, 627, 628, 629, 630, 1833, 1834, 631, 1835, 1836, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 1758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 3685, 242, 243, 244, 1759, 245, 246, 247, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 248, 249, 250, 1767, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1768, 264, 265, 266, 267, 268, 269, 270, 1769, 1770, 271, 272, 273, 274, 275, 1771, 276, 277, 278, 279, 280, 1772, 281, 1773, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1774, 293, 294, 295, 296, 297, 298, 1775, 299, 300, 301, 302, 1776, 1777, 1778, 303, 1779, 1780, 1781, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1782, 313, 1783, 314, 315, 316, 317, 318, 319, 320, 1784, 321, 322, 323, 324, 1785, 1786, 325, 326, 327, 3686, 329, 1787, 330, 331, 332, 333, 1788, 334, 335, 336, 337, 338, 1789, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1790, 349, 1791, 350, 351, 352, 353, 354, 1792, 355, 1793, 356, 357, 358, 1794, 359, 360, 361, 362, 363, 1795, 364, 365, 1796, 366, 367, 368, 1797, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 1798, 379, 380, 381, 382, 383, 384, 385, 386, 1799, 387, 388, 389, 390, 391, 392, 393, 394, 395, 1800, 396, 1801, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 1802, 1803, 420, 421, 422, 423, 424, 1804, 425, 426, 427, 1805, 1806, 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, 1807, 461, 462, 463, 464, 1808, 465, 466, 467, 468, 469, 470, 471, 1809, 472, 473, 474, 1810, 1811, 475, 476, 477, 1812, 1813, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 1814, 497, 498, 499, 500, 501, 502, 503, 504, 505, 1815, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1816, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1817, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 1818, 553, 554, 555, 556, 557, 1819, 3687, 559, 560, 561, 562, 563, 564, 565, 566, 567, 1820, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 1821, 585, 586, 1822, 1823, 587, 588, 589, 590, 591, 592, 593, 594, 1824, 595, 596, 597, 1825, 1826, 598, 599, 600, 601, 602, 1827, 603, 604, 605, 606, 607, 608, 609, 610, 611, 1828, 1829, 612, 613, 614, 615, 616, 1830, 1831, 617, 618, 619, 620, 621, 622, 623, 1832, 624, 625, 626, 627, 628, 629, 630, 1833, 1834, 631, 1835, 1836, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 1311, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1314, 0, 1315, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1327, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 1330, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 3491, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 411, 1344, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 1345, 422, 423, 424, 0, 425, 426, 427, 1346, 1347, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1348, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 1351, 460, 0, 461, 462, 463, 464, 0, 1354, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 1357, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 1358, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 1361, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1363, 584, 0, 585, 586, 1364, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 1367, 601, 1368, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 1371, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 1373, 1374, 1375, 1376, 643, 1377, 1378, 1379, 1380, 648, 649, 650, 651, 235, 0, 1301, 718, 0, 1302, 1303, 0, 780, 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, 1307, 261, 1308, 1309, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 1312, 1313, 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, 1323, 1324, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1328, 349, 0, 350, 351, 352, 1329, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 1332, 1333, 0, 1334, 0, 397, 398, 399, 400, 401, 6427, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 1349, 448, 1350, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 463, 464, 1353, 465, 466, 1355, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 1359, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 1362, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 1365, 1366, 0, 0, 598, 599, 600, 601, 602, 1369, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 1372, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 1015, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 1036, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 1037, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 3022, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 4049, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 0, 0, 718, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 1847, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 1848, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 1849, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 1131, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1173, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1186, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 977, 303, 0, 0, 978, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1198, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 1199, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 979, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 0, 0, 718, 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, 2051, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 0, 0, 718, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1157, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1170, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1184, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1188, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 976, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 422, 423, 424, 0, 425, 426, 427, 0, 0, 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, 0, 461, 462, 463, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2855, 276, 277, 278, 279, 280, 0, 0, 2856, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2857, 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, 338, 0, 2858, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 2859, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 2860, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 2861, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 2862, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 2863, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2855, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2857, 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, 338, 0, 2858, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 2859, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 3902, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 2861, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 2862, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 2863, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2855, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2857, 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, 338, 0, 2858, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 2859, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 2861, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 2862, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 2863, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 799, 245, 800, 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, 801, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 846, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 802, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 803, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 799, 245, 800, 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, 801, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 3583, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 802, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 803, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 799, 245, 800, 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, 801, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 802, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 803, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 3098, 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, 2928, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 871, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 2929, 2930, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2027, 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, 2028, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 2029, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 2030, 356, 357, 0, 0, 0, 2031, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 2032, 2033, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 2034, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 2035, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 2036, 541, 542, 543, 544, 545, 546, 2037, 548, 549, 550, 551, 552, 0, 2038, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 2039, 587, 0, 2040, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 2041, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 800, 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, 801, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 802, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 803, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2928, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 871, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 2929, 2930, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1030, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 871, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 3666, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 3667, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 3679, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 3680, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 660, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 709, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 710, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 839, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 840, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 841, 597, 0, 0, 842, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 865, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 866, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 867, 597, 0, 0, 868, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 871, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 0, 931, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 986, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 987, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1149, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 839, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1265, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1419, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1261, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 816, 272, 273, 274, 1425, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 820, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 1423, 0, 861, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 862, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1566, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 871, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1627, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1628, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 3443, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 3444, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 3445, 587, 0, 589, 590, 3446, 592, 3447, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 3448, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 718, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 0, 0, 0, 0, 0, 0, 0, 780, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 4268, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 4282, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 4415, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 4947, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 5020, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 5387, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 816, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 818, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 820, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 821, 0, 822, 559, 560, 561, 823, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 825, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 831, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 837, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 816, 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, 858, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 859, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 820, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 860, 0, 861, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 862, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 883, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1011, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1021, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1024, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1040, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1097, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1102, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1119, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1122, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1124, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1162, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1190, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1192, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1202, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1205, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1208, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 1262, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 816, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 820, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 1423, 0, 861, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 862, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1890, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1924, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1926, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1966, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1968, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 1970, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 2088, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 2744, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 0, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 816, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 820, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 1423, 0, 861, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 2778, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 862, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 816, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 2840, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 821, 0, 861, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 825, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 816, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 2925, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 821, 0, 861, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 825, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 816, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 2949, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 821, 0, 861, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 825, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3143, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3147, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3205, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3588, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 816, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 817, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 819, 538, 539, 540, 541, 542, 543, 544, 545, 546, 820, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 821, 0, 861, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 824, 597, 0, 0, 825, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 826, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3646, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3669, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3671, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 3821, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 3863, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 5134, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 5669, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 367, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 6391, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 659, 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, 338, 0, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 0, 349, 0, 350, 351, 352, 353, 354, 0, 355, 0, 356, 357, 0, 0, 0, 360, 361, 362, 363, 0, 364, 365, 0, 366, 0, 368, 0, 369, 370, 371, 372, 373, 0, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 0, 389, 390, 391, 392, 393, 394, 395, 0, 396, 0, 397, 0, 0, 400, 0, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 421, 0, 423, 0, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 464, 0, 465, 466, 467, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 480, 0, 482, 0, 484, 485, 486, 487, 488, 489, 490, 491, 0, 493, 494, 495, 0, 496, 0, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 516, 517, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 0, 537, 538, 539, 540, 541, 542, 0, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 560, 561, 562, 0, 564, 565, 566, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 0, 585, 586, 0, 0, 587, 0, 589, 590, 591, 592, 593, 594, 0, 595, 596, 597, 0, 0, 598, 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 622, 623, 0, 624, 0, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 888, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 2751, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 2752, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 2754, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 2756, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 2836, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 4642, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 2915, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 906, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 4437, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 906, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 6071, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 906, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 6435, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 906, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 906, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 1164, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 906, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 1196, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 906, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 2755, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 889, 261, 890, 891, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 892, 893, 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, 894, 895, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 896, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 897, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 898, 899, 0, 900, 0, 397, 398, 399, 400, 401, 901, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 902, 448, 903, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 904, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 905, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 0, 561, 562, 563, 564, 565, 907, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 908, 909, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 910, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651, 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, 338, 0, 339, 340, 341, 342, 0, 344, 345, 346, 347, 0, 0, 349, 0, 350, 351, 352, 0, 354, 0, 355, 0, 356, 357, 358, 0, 359, 360, 361, 362, 363, 0, 364, 0, 0, 0, 367, 368, 0, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 0, 379, 380, 381, 382, 383, 384, 385, 386, 0, 387, 388, 0, 390, 391, 392, 393, 0, 0, 0, 0, 0, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 414, 415, 416, 417, 418, 419, 0, 0, 420, 0, 422, 423, 424, 0, 425, 426, 427, 0, 0, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 0, 450, 451, 452, 453, 454, 455, 456, 457, 0, 0, 460, 0, 461, 462, 463, 464, 0, 0, 466, 0, 468, 469, 470, 471, 0, 472, 473, 474, 0, 0, 475, 476, 477, 0, 0, 478, 479, 0, 481, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 0, 496, 0, 497, 498, 499, 0, 501, 0, 503, 504, 505, 0, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 0, 518, 519, 520, 0, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 0, 534, 535, 536, 537, 538, 539, 540, 541, 0, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 0, 553, 554, 555, 556, 557, 0, 558, 559, 0, 561, 562, 563, 564, 565, 0, 567, 0, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 584, 0, 585, 586, 0, 0, 587, 588, 589, 590, 591, 592, 593, 594, 0, 595, 0, 0, 0, 0, 598, 599, 0, 601, 0, 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, 0, 0, 612, 613, 614, 615, 616, 0, 0, 617, 618, 619, 620, 621, 0, 0, 0, 624, 625, 626, 627, 628, 629, 630, 0, 0, 631, 0, 0, 632, 633, 634, 635, 636, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 650, 651 }; static const yytype_int16 yycheck[] = { 6, 0, 0, 0, 37, 0, 0, 0, 666, 672, 57, 672, 801, 802, 803, 1050, 0, 23, 807, 25, 0, 0, 0, 29, 30, 951, 21, 0, 21, 35, 36, 37, 212, 39, 1052, 0, 42, 43, 0, 45, 1059, 47, 0, 1022, 1176, 212, 0, 0, 54, 55, 56, 760, 8, 856, 1614, 687, 858, 0, 1681, 15, 849, 719, 190, 22, 945, 1598, 947, 2863, 925, 28, 906, 1598, 207, 1048, 1305, 1023, 2086, 876, 1039, 719, 215, 1591, 2738, 218, 3272, 1239, 1054, 198, 894, 895, 2112, 217, 1125, 0, 3091, 2739, 742, 30, 904, 46, 1292, 1920, 3218, 3622, 2987, 231, 963, 862, 766, 3937, 756, 3452, 1523, 3454, 3156, 764, 3118, 3986, 36, 2759, 2760, 3657, 3502, 3659, 875, 43, 909, 1278, 3739, 3964, 3544, 1282, 1603, 1748, 1285, 1286, 2076, 6, 1099, 1644, 1645, 4366, 1103, 1648, 23, 2113, 3685, 1108, 3687, 3103, 4297, 988, 3009, 3889, 668, 1715, 1716, 1118, 37, 2639, 2094, 819, 4858, 2643, 765, 4325, 4607, 989, 192, 176, 5172, 1132, 755, 1992, 1480, 5256, 1013, 835, 3496, 819, 1591, 1018, 2108, 2109, 2110, 2111, 3953, 4630, 2114, 1114, 2116, 2117, 198, 199, 200, 4613, 1933, 203, 4575, 1022, 4031, 207, 1163, 209, 4618, 1130, 212, 36, 1031, 215, 4413, 2, 218, 2151, 5164, 221, 3099, 223, 1041, 4760, 226, 4762, 880, 974, 230, 192, 232, 740, 4686, 3547, 743, 4874, 5474, 4876, 5547, 3518, 5510, 1059, 1709, 51, 4617, 2725, 5115, 3315, 42, 3554, 2723, 3951, 2655, 948, 3406, 5380, 45, 3501, 5551, 3503, 3504, 4939, 5371, 5159, 6, 0, 2127, 3411, 972, 1736, 5784, 1564, 948, 6, 0, 11, 6, 0, 0, 5471, 5768, 21, 38, 54, 0, 15, 16, 4798, 942, 3056, 63, 3058, 3059, 37, 5163, 11, 3063, 3064, 3065, 2702, 3067, 3068, 3069, 13, 29, 43, 6044, 6, 1093, 1013, 63, 6, 25, 29, 1018, 63, 1063, 37, 29, 43, 5429, 0, 4466, 25, 892, 893, 47, 11, 6, 6, 122, 6, 11, 37, 37, 903, 149, 15, 16, 6, 15, 16, 6, 5436, 5437, 179, 6, 178, 6, 2082, 29, 6, 6, 127, 172, 92, 6, 6, 185, 195, 6, 37, 23, 6, 185, 120, 178, 47, 3, 164, 63, 178, 157, 21, 178, 882, 85, 47, 120, 178, 13, 63, 113, 185, 80, 88, 3, 156, 5, 6, 5461, 5, 6051, 5667, 11, 37, 92, 11, 1899, 1645, 125, 311, 1648, 202, 15, 1059, 178, 5, 11, 310, 3624, 35, 45, 11, 172, 331, 13, 156, 4724, 4725, 4726, 72, 4728, 4729, 4730, 4731, 4732, 140, 68, 316, 178, 349, 4631, 92, 257, 227, 178, 226, 140, 122, 63, 92, 289, 178, 63, 78, 52, 113, 45, 1267, 766, 42, 178, 1271, 1272, 178, 178, 1428, 324, 405, 80, 120, 178, 1492, 6183, 148, 1480, 202, 166, 404, 1115, 272, 1436, 35, 172, 361, 202, 25, 361, 202, 202, 78, 63, 5997, 362, 120, 202, 13, 153, 136, 124, 29, 217, 5389, 39, 156, 449, 169, 166, 178, 5988, 293, 78, 120, 326, 316, 58, 386, 474, 496, 95, 13, 398, 13, 4951, 13, 5786, 120, 313, 835, 1484, 1323, 1324, 202, 687, 94, 369, 391, 434, 80, 80, 1902, 29, 178, 6490, 536, 174, 80, 4953, 36, 541, 1183, 92, 45, 357, 310, 4961, 45, 6504, 92, 436, 1922, 29, 1355, 541, 29, 254, 421, 298, 36, 80, 404, 36, 685, 880, 5511, 358, 473, 137, 691, 217, 537, 92, 5682, 737, 13, 78, 129, 78, 6, 78, 703, 404, 394, 494, 130, 254, 1366, 541, 254, 224, 537, 140, 472, 395, 157, 289, 135, 302, 80, 486, 479, 375, 486, 1246, 222, 541, 1261, 306, 200, 178, 23, 284, 326, 480, 298, 6335, 1271, 1272, 537, 1217, 537, 375, 289, 447, 1261, 942, 537, 339, 1593, 80, 478, 80, 5907, 293, 1277, 537, 63, 407, 1386, 257, 63, 293, 391, 1298, 449, 6160, 80, 178, 289, 298, 1293, 63, 1899, 541, 6314, 369, 178, 293, 5730, 302, 456, 1298, 298, 92, 667, 185, 494, 407, 1416, 401, 673, 397, 675, 202, 677, 125, 449, 680, 1481, 142, 4413, 375, 672, 3898, 687, 390, 136, 399, 125, 692, 404, 694, 375, 432, 494, 5335, 672, 700, 334, 474, 537, 404, 537, 1211, 490, 537, 449, 432, 4441, 37, 404, 5904, 32, 541, 1746, 1747, 454, 1675, 537, 541, 1678, 724, 766, 537, 386, 5996, 1648, 449, 541, 441, 733, 443, 672, 541, 737, 494, 485, 740, 541, 1445, 743, 32, 1687, 1312, 1313, 407, 472, 1567, 541, 23, 1569, 375, 449, 498, 464, 375, 759, 479, 5213, 463, 1579, 4586, 6277, 477, 6503, 537, 770, 541, 672, 472, 5282, 527, 1744, 23, 479, 765, 6515, 498, 1700, 1701, 537, 1350, 10, 483, 527, 13, 6275, 541, 374, 17, 18, 19, 120, 375, 498, 1629, 539, 2091, 479, 536, 541, 535, 4627, 537, 540, 539, 537, 4952, 479, 1629, 813, 528, 529, 540, 1510, 818, 540, 540, 4963, 822, 823, 498, 533, 540, 449, 781, 951, 783, 449, 785, 1753, 5778, 1665, 1510, 837, 791, 4369, 537, 4371, 5933, 4448, 537, 795, 528, 529, 6360, 4454, 1666, 528, 529, 263, 1670, 1671, 856, 857, 858, 859, 860, 537, 537, 540, 537, 4626, 518, 519, 1994, 1881, 23, 871, 537, 6164, 2022, 537, 876, 518, 519, 537, 1385, 537, 882, 6151, 537, 537, 4260, 1589, 5782, 537, 537, 1457, 1458, 537, 537, 541, 537, 6409, 494, 1073, 449, 4631, 533, 2029, 3781, 3782, 818, 6097, 6098, 3786, 822, 823, 1073, 528, 529, 2041, 528, 529, 527, 414, 541, 939, 518, 3557, 541, 3559, 535, 528, 529, 929, 539, 449, 528, 529, 5238, 530, 531, 532, 533, 414, 1642, 1070, 414, 943, 6180, 1074, 1451, 1076, 941, 941, 941, 375, 941, 941, 941, 375, 956, 1659, 541, 1064, 4272, 535, 541, 941, 4276, 539, 375, 941, 941, 941, 449, 971, 965, 120, 941, 541, 3924, 202, 939, 4677, 23, 1900, 941, 6090, 5660, 941, 4128, 4129, 4138, 941, 990, 316, 263, 941, 941, 995, 996, 422, 423, 5995, 225, 449, 6109, 449, 941, 4535, 530, 531, 532, 533, 1636, 6279, 1517, 541, 4317, 541, 263, 4259, 449, 4261, 4262, 4534, 541, 449, 541, 472, 813, 1027, 1028, 439, 490, 6338, 528, 529, 530, 531, 532, 533, 472, 223, 941, 158, 113, 23, 3921, 4111, 3524, 1863, 5992, 122, 1050, 1051, 3523, 113, 6, 372, 1564, 23, 23, 5494, 470, 6, 3463, 120, 1064, 113, 1066, 859, 860, 115, 1070, 4213, 23, 1073, 1074, 148, 1076, 883, 76, 23, 23, 1081, 178, 2112, 372, 1544, 496, 312, 300, 876, 51, 6359, 528, 529, 530, 531, 532, 533, 386, 190, 388, 189, 3867, 311, 125, 1105, 391, 3, 5975, 6, 263, 404, 1112, 1113, 386, 1027, 1028, 541, 6193, 140, 391, 541, 179, 22, 5991, 729, 6, 537, 6, 28, 5501, 2093, 541, 124, 1134, 1135, 1136, 99, 1138, 207, 1140, 6248, 1142, 1143, 391, 21, 1929, 391, 194, 4662, 103, 755, 206, 180, 72, 474, 943, 5376, 1502, 386, 6283, 6284, 125, 2175, 4441, 6161, 454, 6474, 439, 956, 6157, 6158, 190, 21, 484, 1219, 1176, 324, 1178, 1179, 10, 326, 294, 13, 971, 6, 2148, 17, 18, 19, 4598, 6433, 439, 143, 1846, 91, 6172, 5649, 289, 470, 150, 89, 527, 125, 1027, 304, 5403, 6, 6152, 436, 535, 1211, 537, 538, 539, 6451, 541, 334, 537, 1219, 263, 89, 184, 470, 369, 496, 272, 537, 5865, 275, 1217, 72, 331, 224, 187, 289, 154, 294, 391, 1239, 289, 1241, 2038, 2039, 132, 1245, 6488, 1247, 541, 496, 146, 25, 537, 153, 217, 3889, 174, 331, 125, 404, 313, 187, 474, 125, 132, 537, 537, 3, 3, 357, 6, 89, 1222, 1273, 1224, 125, 1226, 179, 1228, 120, 1230, 1231, 1232, 263, 25, 312, 439, 1237, 6411, 6285, 537, 499, 1292, 537, 1997, 217, 1296, 263, 263, 387, 525, 526, 527, 528, 529, 530, 531, 532, 533, 307, 1310, 172, 263, 209, 132, 3331, 6292, 470, 310, 263, 263, 221, 5185, 344, 1964, 2028, 5148, 5862, 3260, 2032, 5765, 25, 5161, 480, 2037, 2856, 289, 2040, 1978, 5774, 316, 182, 5750, 496, 1385, 3979, 298, 269, 391, 395, 217, 1991, 1352, 449, 2759, 217, 91, 541, 6433, 5796, 472, 2826, 6358, 1148, 5776, 436, 140, 217, 436, 120, 4366, 3102, 5780, 6369, 6361, 293, 436, 4907, 5749, 115, 1957, 1381, 1382, 1383, 537, 1385, 5211, 478, 436, 334, 537, 40, 28, 5154, 2694, 5830, 439, 424, 515, 140, 2145, 298, 4932, 476, 115, 54, 1406, 269, 5779, 2004, 145, 391, 1989, 6488, 6410, 376, 316, 474, 298, 2076, 298, 2076, 298, 244, 1883, 391, 391, 470, 330, 347, 316, 527, 1219, 1433, 397, 72, 3045, 333, 537, 1440, 391, 329, 6418, 539, 2909, 822, 140, 391, 391, 6445, 298, 1451, 293, 496, 1961, 381, 92, 298, 194, 439, 478, 329, 111, 537, 513, 1069, 512, 52, 1512, 1976, 1514, 157, 1979, 439, 439, 1636, 1080, 1495, 1496, 30, 1498, 6477, 312, 194, 537, 4859, 3345, 3346, 439, 87, 470, 3350, 1096, 446, 537, 439, 439, 1497, 157, 2125, 5654, 1501, 1502, 114, 470, 470, 347, 354, 410, 472, 371, 329, 1512, 1513, 1514, 1515, 496, 1517, 3135, 470, 6210, 283, 363, 436, 2031, 260, 470, 470, 2035, 2036, 496, 496, 3391, 3392, 1495, 1496, 272, 1498, 122, 275, 314, 1541, 5977, 535, 180, 496, 308, 539, 304, 467, 472, 4863, 496, 496, 442, 120, 4868, 537, 4032, 4871, 297, 272, 25, 29, 275, 541, 466, 216, 31, 465, 168, 537, 537, 324, 442, 331, 1576, 473, 120, 5112, 476, 1581, 190, 2091, 1584, 326, 537, 2092, 326, 2094, 457, 326, 183, 537, 537, 2100, 207, 1597, 1598, 373, 374, 2106, 2107, 4599, 133, 472, 1606, 4643, 325, 1609, 472, 2640, 197, 2118, 194, 144, 404, 202, 6, 122, 304, 311, 472, 2128, 442, 404, 467, 180, 369, 2134, 404, 369, 326, 304, 311, 135, 1636, 137, 1638, 120, 289, 1641, 120, 227, 1644, 1645, 397, 331, 1648, 92, 3154, 1028, 538, 27, 1581, 541, 293, 1650, 1658, 395, 331, 1661, 1655, 404, 1664, 143, 257, 218, 253, 135, 25, 1275, 150, 5403, 411, 369, 50, 140, 100, 311, 2642, 289, 2694, 5512, 395, 436, 164, 5719, 1688, 5721, 537, 172, 272, 5725, 5726, 525, 526, 527, 528, 529, 530, 531, 532, 533, 439, 1705, 314, 442, 64, 293, 404, 397, 171, 6148, 1641, 351, 72, 1717, 1718, 1719, 1720, 1721, 2945, 4600, 227, 1512, 441, 1514, 443, 480, 404, 1658, 190, 298, 241, 1735, 91, 1730, 397, 5500, 183, 1734, 180, 494, 393, 3150, 1746, 1747, 1748, 3154, 436, 293, 388, 541, 25, 4606, 369, 179, 4523, 326, 31, 6389, 541, 4528, 207, 5906, 371, 518, 2112, 2113, 361, 2784, 4562, 120, 358, 404, 512, 436, 133, 4413, 391, 537, 289, 2127, 314, 140, 537, 6006, 527, 144, 293, 213, 2136, 293, 480, 181, 326, 326, 351, 1973, 539, 512, 369, 3026, 494, 135, 228, 4441, 494, 166, 198, 1972, 1973, 160, 257, 395, 452, 494, 454, 207, 298, 480, 458, 434, 409, 436, 537, 215, 153, 251, 218, 289, 518, 1962, 6462, 494, 449, 404, 6273, 369, 369, 166, 670, 241, 218, 1845, 1951, 172, 195, 391, 441, 537, 443, 537, 346, 358, 1856, 123, 280, 518, 4856, 377, 494, 326, 1864, 1865, 537, 541, 326, 140, 478, 325, 315, 172, 312, 179, 451, 449, 537, 470, 1880, 2893, 781, 342, 783, 184, 785, 289, 310, 494, 373, 289, 791, 792, 793, 486, 221, 254, 1898, 1899, 407, 257, 6467, 202, 381, 6470, 369, 2919, 155, 213, 413, 369, 541, 518, 1914, 1915, 1916, 1917, 1705, 10, 6355, 404, 497, 1923, 228, 2755, 17, 18, 19, 254, 1930, 169, 198, 1933, 762, 240, 541, 783, 784, 785, 2736, 404, 788, 789, 790, 5767, 293, 251, 1948, 306, 404, 1951, 798, 325, 6095, 485, 5785, 204, 380, 451, 358, 1961, 1962, 293, 2125, 472, 352, 369, 2784, 541, 537, 326, 1972, 1973, 490, 325, 1976, 10, 456, 1979, 13, 306, 2955, 1650, 17, 18, 19, 6019, 1655, 484, 468, 316, 267, 388, 1994, 1995, 473, 4631, 441, 385, 443, 2001, 35, 2003, 309, 497, 2006, 3019, 246, 407, 365, 454, 425, 399, 369, 202, 3, 2004, 112, 5331, 478, 5400, 2022, 851, 467, 494, 5539, 470, 1632, 2029, 123, 2031, 404, 5794, 2034, 2035, 2036, 2854, 2038, 2039, 346, 2041, 537, 491, 441, 243, 443, 5229, 2048, 404, 4054, 437, 474, 3179, 404, 326, 411, 2084, 2008, 454, 2010, 173, 2012, 1730, 2014, 5444, 2016, 1734, 2109, 6288, 2020, 4075, 541, 3085, 472, 488, 380, 537, 2078, 3, 379, 2081, 2082, 112, 2084, 451, 3005, 2087, 2088, 2076, 989, 123, 2092, 541, 2094, 537, 4112, 209, 369, 2099, 2100, 4117, 26, 2076, 91, 198, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 3039, 3040, 3041, 2122, 5114, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2784, 404, 2134, 3639, 2136, 2137, 2955, 2076, 2140, 466, 5138, 2959, 173, 451, 6009, 3764, 335, 3554, 2933, 2967, 2935, 3378, 2970, 2155, 2156, 2157, 145, 3564, 1059, 5990, 5153, 4091, 388, 4127, 198, 91, 2673, 5351, 449, 5353, 25, 2173, 268, 2076, 2993, 3008, 31, 273, 209, 0, 369, 361, 494, 5133, 373, 386, 369, 388, 2935, 497, 225, 183, 293, 6414, 4116, 326, 5533, 298, 122, 4121, 4122, 3122, 3123, 3124, 3125, 4020, 3127, 38, 494, 3028, 2852, 2213, 2087, 5748, 3171, 404, 166, 32, 398, 312, 146, 404, 172, 5102, 148, 5104, 5989, 374, 454, 541, 3244, 3152, 3639, 454, 5, 3846, 3737, 268, 369, 326, 11, 3852, 273, 122, 59, 135, 527, 137, 153, 326, 81, 38, 1858, 454, 355, 541, 436, 404, 539, 2048, 6439, 166, 6441, 1869, 181, 257, 326, 172, 5800, 148, 5382, 260, 541, 60, 164, 267, 202, 312, 2983, 1885, 2985, 397, 369, 209, 2989, 140, 373, 211, 4149, 4150, 4151, 4152, 369, 172, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 254, 494, 486, 5822, 5075, 369, 5077, 5078, 5079, 283, 4250, 266, 221, 404, 536, 2321, 436, 3788, 6153, 541, 335, 112, 6505, 404, 245, 518, 178, 326, 211, 1939, 724, 29, 4258, 326, 308, 229, 33, 34, 293, 733, 404, 358, 335, 326, 1954, 254, 740, 1957, 1958, 743, 202, 3369, 306, 370, 4219, 4220, 3145, 3375, 373, 5773, 480, 289, 1267, 2713, 3835, 293, 1271, 1272, 1220, 2375, 369, 1223, 365, 1225, 5376, 1227, 369, 1229, 1988, 1989, 373, 1233, 365, 400, 324, 83, 369, 5728, 86, 404, 180, 285, 286, 287, 288, 93, 494, 306, 292, 293, 3960, 494, 99, 333, 298, 404, 289, 316, 386, 3231, 293, 404, 267, 5684, 205, 540, 494, 537, 5689, 5690, 518, 404, 119, 121, 214, 518, 2432, 48, 525, 526, 527, 528, 529, 530, 531, 532, 533, 449, 293, 3261, 518, 172, 420, 6278, 415, 441, 439, 443, 541, 442, 71, 381, 5, 6469, 35, 3104, 99, 397, 11, 537, 157, 6289, 474, 532, 385, 196, 19, 5, 537, 440, 539, 392, 263, 11, 470, 6491, 119, 268, 399, 535, 172, 6092, 273, 539, 182, 38, 525, 526, 527, 528, 529, 530, 531, 532, 533, 27, 436, 195, 289, 10, 1642, 494, 13, 433, 196, 172, 17, 18, 19, 153, 208, 349, 494, 6501, 157, 5, 437, 1659, 50, 3228, 5522, 11, 166, 1017, 35, 397, 310, 3453, 172, 196, 6518, 315, 518, 519, 325, 465, 518, 518, 519, 460, 480, 22, 1036, 473, 2154, 1039, 476, 28, 302, 5551, 1455, 537, 486, 5669, 494, 310, 537, 466, 394, 1464, 315, 1466, 456, 3314, 436, 1470, 530, 3358, 153, 3360, 3361, 535, 1477, 537, 468, 539, 244, 221, 518, 530, 537, 166, 539, 374, 535, 532, 537, 172, 539, 1013, 537, 535, 539, 537, 1018, 539, 537, 537, 285, 286, 287, 288, 538, 3261, 535, 541, 537, 398, 480, 5611, 254, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 6448, 2627, 494, 494, 538, 496, 535, 541, 419, 538, 539, 2637, 2638, 271, 2640, 538, 221, 2817, 541, 454, 538, 2647, 3793, 541, 2138, 538, 518, 2141, 541, 2655, 2817, 2657, 371, 538, 2660, 2661, 541, 537, 2664, 539, 2666, 2656, 306, 2669, 1569, 537, 394, 2673, 365, 254, 1064, 494, 316, 496, 1579, 537, 1070, 3625, 5449, 470, 1074, 2816, 1076, 2818, 2819, 69, 70, 6028, 4553, 267, 2696, 538, 3475, 3476, 541, 4705, 2702, 2703, 3555, 96, 397, 3456, 2813, 15, 16, 6241, 538, 2713, 267, 541, 6246, 6247, 4722, 3661, 225, 207, 2722, 2723, 1623, 1624, 271, 306, 365, 421, 538, 2851, 424, 541, 196, 4751, 2736, 316, 538, 33, 34, 541, 4758, 4759, 2744, 436, 538, 538, 538, 541, 541, 541, 1140, 538, 1142, 1143, 2687, 2688, 2689, 2786, 397, 2788, 386, 387, 3509, 3565, 5802, 1666, 4385, 5403, 538, 1670, 1671, 541, 538, 2775, 538, 541, 3740, 541, 538, 100, 441, 541, 443, 5662, 2786, 3413, 2788, 480, 441, 538, 443, 484, 541, 4608, 494, 10, 496, 436, 13, 3949, 2802, 494, 17, 18, 19, 312, 538, 3626, 4035, 541, 494, 2813, 496, 25, 2816, 2817, 2818, 2819, 538, 31, 2822, 541, 2944, 2825, 454, 518, 466, 4383, 87, 4385, 45, 2696, 100, 538, 46, 538, 541, 52, 541, 59, 3347, 480, 2844, 538, 537, 4368, 541, 538, 294, 295, 541, 486, 3359, 538, 2856, 494, 541, 538, 179, 538, 541, 2775, 541, 78, 76, 394, 2655, 538, 2870, 2871, 541, 6403, 386, 387, 3888, 2877, 295, 3582, 537, 518, 538, 4348, 244, 541, 2886, 466, 4074, 538, 3395, 5525, 541, 538, 213, 3712, 541, 535, 518, 519, 537, 539, 135, 3930, 137, 3025, 484, 6089, 2908, 228, 11, 538, 4317, 179, 541, 2702, 2703, 2844, 135, 538, 137, 131, 541, 133, 538, 538, 434, 541, 541, 2929, 140, 164, 251, 3438, 144, 538, 537, 3892, 541, 3579, 3580, 538, 2942, 538, 541, 538, 541, 213, 541, 386, 387, 3603, 3735, 397, 541, 538, 4421, 3740, 541, 386, 387, 280, 228, 173, 1863, 2965, 310, 3886, 2968, 3603, 538, 391, 6307, 541, 153, 538, 538, 48, 541, 541, 397, 5672, 5673, 538, 197, 251, 541, 166, 538, 202, 540, 310, 436, 172, 2994, 2995, 229, 538, 5994, 209, 541, 3345, 3346, 514, 538, 5643, 3350, 541, 413, 3009, 6006, 3011, 3012, 538, 280, 538, 541, 313, 541, 436, 525, 526, 527, 528, 529, 530, 531, 532, 533, 2982, 5854, 5855, 538, 5910, 5911, 541, 480, 537, 2825, 494, 253, 496, 221, 3043, 3044, 3045, 59, 3391, 3392, 3049, 494, 48, 285, 286, 287, 288, 538, 3057, 540, 292, 4244, 380, 4246, 480, 538, 298, 4620, 541, 538, 538, 3070, 541, 541, 486, 518, 254, 3076, 494, 3078, 289, 6415, 538, 538, 293, 541, 541, 514, 538, 4615, 3729, 541, 3091, 538, 537, 304, 541, 3096, 538, 227, 312, 541, 518, 3102, 538, 314, 3105, 541, 538, 313, 538, 541, 3751, 541, 4846, 380, 4848, 326, 3117, 3118, 538, 537, 538, 541, 540, 6057, 6058, 538, 306, 3128, 541, 538, 538, 4636, 541, 541, 3918, 538, 316, 3138, 541, 3140, 538, 2929, 538, 541, 538, 541, 4277, 541, 4279, 3279, 538, 3281, 3282, 541, 539, 6147, 538, 6493, 369, 541, 538, 372, 373, 541, 310, 538, 538, 6164, 541, 541, 3276, 538, 4185, 538, 541, 5313, 541, 5315, 3179, 172, 3181, 538, 3183, 538, 541, 538, 541, 538, 541, 538, 541, 538, 541, 404, 541, 409, 538, 538, 538, 541, 541, 541, 2102, 2103, 538, 310, 538, 541, 3209, 541, 2815, 538, 538, 60, 541, 541, 2821, 3218, 4367, 2119, 2120, 4370, 456, 538, 4373, 538, 541, 48, 541, 4192, 4636, 514, 3936, 5884, 468, 3137, 538, 538, 227, 541, 541, 3894, 530, 3896, 5261, 5262, 55, 56, 177, 10, 2150, 3413, 13, 537, 3118, 541, 17, 18, 19, 3894, 538, 3896, 2867, 541, 4058, 4082, 477, 483, 3909, 538, 3911, 537, 541, 343, 35, 3276, 3277, 4247, 3279, 538, 3281, 3282, 541, 3284, 538, 6282, 466, 541, 537, 37, 3291, 6288, 537, 59, 538, 3296, 538, 178, 223, 223, 537, 537, 516, 498, 539, 3347, 3208, 537, 537, 369, 202, 525, 526, 527, 528, 529, 530, 531, 532, 533, 158, 158, 537, 310, 202, 3978, 539, 4290, 369, 310, 38, 158, 158, 202, 158, 10, 310, 172, 13, 4043, 369, 158, 252, 3978, 3345, 3346, 3347, 122, 474, 3350, 4968, 310, 60, 3395, 537, 302, 3518, 3358, 3359, 3360, 3361, 172, 538, 72, 38, 293, 293, 498, 537, 310, 45, 293, 48, 3374, 293, 6166, 3377, 52, 3379, 48, 459, 293, 326, 486, 10, 91, 486, 13, 87, 454, 3391, 3392, 172, 350, 3395, 158, 54, 537, 158, 4412, 158, 4414, 158, 78, 112, 498, 158, 158, 5268, 541, 172, 4933, 3413, 158, 3415, 158, 3417, 6414, 3419, 45, 158, 158, 158, 158, 158, 158, 52, 4440, 4384, 158, 158, 158, 436, 310, 223, 125, 4077, 3438, 537, 103, 3441, 38, 252, 101, 3445, 310, 172, 172, 537, 6, 6, 537, 78, 537, 3496, 172, 537, 537, 4684, 537, 537, 537, 3463, 537, 225, 6, 6, 6, 126, 537, 537, 537, 3077, 537, 182, 537, 151, 6, 537, 537, 537, 537, 537, 537, 537, 537, 537, 145, 4340, 537, 38, 537, 3493, 151, 537, 3496, 3497, 205, 537, 537, 3501, 3502, 3503, 3504, 3446, 3447, 3448, 537, 300, 3510, 4659, 537, 60, 4314, 3515, 173, 537, 537, 537, 177, 537, 537, 197, 495, 537, 151, 537, 202, 537, 3530, 537, 322, 167, 10, 192, 223, 13, 38, 541, 541, 17, 18, 19, 3544, 38, 3546, 3547, 252, 37, 537, 447, 312, 447, 5558, 537, 263, 535, 535, 10, 1948, 268, 13, 1951, 449, 112, 273, 4509, 449, 178, 449, 449, 197, 1961, 1962, 541, 4531, 202, 172, 253, 172, 68, 289, 306, 304, 3585, 449, 449, 1976, 391, 449, 1979, 485, 4250, 45, 4250, 449, 391, 539, 4519, 449, 52, 449, 254, 391, 449, 373, 79, 449, 3609, 3610, 527, 92, 391, 449, 158, 310, 249, 325, 396, 449, 449, 6412, 128, 439, 4441, 298, 78, 253, 331, 3493, 449, 310, 3496, 473, 304, 537, 386, 312, 4144, 537, 298, 449, 2031, 449, 3645, 195, 2035, 2036, 0, 92, 541, 202, 3653, 128, 326, 158, 474, 205, 3263, 474, 128, 114, 449, 449, 449, 449, 374, 449, 449, 21, 128, 59, 4178, 3278, 59, 3463, 449, 449, 3283, 449, 3544, 277, 449, 3547, 449, 449, 312, 314, 354, 354, 398, 354, 449, 331, 4707, 449, 449, 355, 439, 151, 449, 331, 3703, 449, 47, 57, 538, 449, 3313, 449, 449, 419, 225, 541, 225, 263, 4222, 449, 310, 542, 268, 225, 310, 5583, 4230, 273, 3727, 3889, 225, 4692, 225, 449, 225, 225, 409, 225, 3737, 459, 225, 225, 537, 289, 38, 158, 310, 197, 158, 293, 225, 120, 202, 474, 158, 158, 5614, 485, 158, 310, 260, 293, 293, 293, 470, 38, 525, 526, 527, 528, 529, 530, 531, 532, 533, 172, 38, 244, 393, 325, 5184, 158, 158, 474, 4127, 409, 2684, 2685, 158, 474, 158, 404, 2690, 178, 302, 537, 449, 277, 490, 297, 277, 13, 449, 253, 321, 187, 4149, 4150, 4151, 4152, 451, 195, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 195, 537, 2722, 2723, 537, 537, 374, 541, 538, 514, 541, 538, 514, 537, 395, 312, 537, 537, 4183, 275, 192, 516, 538, 535, 491, 3846, 241, 538, 221, 538, 398, 3852, 538, 528, 529, 530, 531, 532, 533, 38, 312, 538, 3863, 541, 407, 311, 474, 474, 319, 59, 541, 419, 485, 391, 4219, 4220, 538, 537, 298, 298, 17, 298, 4699, 537, 2784, 449, 449, 449, 172, 26, 516, 298, 310, 537, 310, 241, 293, 298, 252, 3900, 3901, 3902, 528, 529, 530, 531, 532, 533, 241, 271, 252, 252, 386, 449, 310, 439, 3917, 128, 541, 4264, 310, 310, 470, 202, 369, 541, 404, 310, 196, 494, 3931, 401, 449, 449, 358, 316, 538, 38, 225, 4580, 4581, 244, 353, 474, 474, 527, 158, 304, 3949, 3950, 3951, 172, 38, 437, 3955, 174, 354, 409, 486, 537, 401, 158, 537, 158, 158, 304, 3967, 474, 494, 293, 2870, 38, 293, 310, 5123, 27, 310, 244, 5506, 4810, 193, 304, 38, 193, 172, 244, 4028, 173, 401, 4693, 4694, 4695, 4696, 4697, 172, 310, 293, 202, 202, 202, 202, 3606, 4878, 10, 202, 59, 13, 498, 178, 3614, 449, 274, 310, 302, 541, 178, 541, 537, 541, 541, 541, 316, 4023, 494, 539, 479, 538, 4028, 377, 538, 4031, 322, 515, 538, 178, 135, 292, 267, 45, 538, 332, 449, 538, 541, 178, 52, 4047, 4048, 525, 526, 527, 528, 529, 530, 531, 532, 533, 4058, 538, 2959, 491, 3963, 187, 262, 516, 541, 59, 2967, 472, 541, 2970, 78, 538, 4074, 538, 538, 528, 529, 530, 531, 532, 533, 2982, 538, 541, 541, 514, 537, 491, 538, 538, 538, 4093, 310, 538, 518, 538, 3999, 538, 537, 537, 4102, 537, 537, 537, 4228, 536, 536, 517, 541, 537, 537, 537, 5668, 3719, 4116, 3721, 313, 310, 4120, 4121, 4122, 158, 449, 449, 215, 4127, 5083, 161, 4130, 449, 298, 4133, 449, 293, 158, 207, 537, 4139, 424, 4141, 4958, 404, 4144, 151, 537, 537, 209, 4149, 4150, 4151, 4152, 396, 158, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 158, 396, 207, 4168, 4169, 4170, 396, 252, 161, 449, 310, 474, 527, 4178, 161, 3967, 4222, 491, 4183, 391, 4226, 254, 4187, 333, 333, 471, 197, 161, 449, 421, 4195, 202, 449, 4198, 449, 4200, 449, 264, 449, 264, 264, 128, 449, 391, 4553, 449, 449, 391, 3817, 449, 391, 4216, 449, 391, 4219, 4220, 449, 4222, 404, 293, 4225, 4226, 158, 449, 47, 4230, 47, 4232, 4233, 449, 449, 225, 538, 538, 538, 225, 4241, 4242, 4243, 536, 5207, 190, 253, 541, 538, 314, 538, 4413, 459, 3, 4881, 172, 3861, 4258, 4259, 4260, 4261, 4262, 4250, 4264, 4265, 0, 72, 4268, 48, 113, 4058, 4272, 78, 538, 172, 4276, 4250, 537, 38, 4441, 541, 4282, 158, 538, 449, 158, 92, 172, 4929, 527, 4796, 304, 537, 190, 4236, 4237, 4238, 4239, 474, 474, 158, 310, 527, 391, 391, 312, 391, 2696, 4309, 480, 401, 391, 4250, 391, 120, 156, 122, 541, 156, 5103, 672, 225, 225, 225, 225, 225, 225, 10, 467, 538, 13, 3231, 225, 225, 17, 18, 19, 225, 5042, 5043, 147, 5045, 148, 229, 535, 467, 310, 310, 4250, 538, 59, 310, 3957, 6213, 6214, 38, 310, 6217, 13, 3259, 541, 3261, 322, 178, 99, 4366, 4367, 4368, 485, 4370, 538, 292, 4373, 537, 4375, 541, 182, 2696, 538, 228, 538, 538, 538, 538, 538, 536, 538, 5308, 537, 320, 438, 10, 5033, 4394, 13, 228, 4001, 5803, 17, 18, 19, 317, 409, 59, 537, 211, 191, 537, 4272, 446, 377, 172, 4276, 765, 766, 459, 35, 38, 153, 474, 5341, 474, 244, 449, 2813, 215, 59, 2816, 439, 2818, 2819, 166, 158, 86, 474, 182, 421, 172, 459, 396, 161, 5454, 391, 178, 391, 449, 449, 449, 4449, 184, 449, 449, 187, 537, 4799, 538, 191, 369, 59, 538, 494, 538, 537, 439, 480, 172, 78, 310, 158, 4631, 113, 459, 538, 225, 225, 241, 225, 225, 537, 537, 210, 449, 310, 498, 541, 38, 221, 293, 537, 331, 5131, 4096, 298, 538, 307, 3, 310, 459, 541, 537, 44, 4455, 4366, 4504, 479, 449, 541, 537, 90, 516, 538, 6129, 4466, 184, 401, 185, 113, 178, 2696, 254, 225, 528, 529, 530, 531, 532, 533, 145, 538, 242, 242, 298, 669, 298, 298, 298, 4537, 538, 538, 178, 59, 347, 225, 4148, 492, 541, 538, 538, 5346, 492, 4551, 538, 4553, 322, 538, 331, 538, 363, 537, 537, 4561, 541, 228, 537, 493, 446, 4567, 304, 4173, 494, 459, 306, 3472, 178, 303, 310, 494, 4578, 5705, 449, 5707, 316, 719, 720, 209, 78, 541, 939, 196, 941, 196, 38, 4593, 527, 298, 298, 59, 4598, 4599, 439, 541, 541, 449, 72, 449, 4606, 225, 158, 538, 161, 449, 225, 449, 537, 4615, 127, 180, 120, 38, 202, 5324, 289, 3522, 3523, 4625, 304, 537, 401, 474, 312, 38, 5335, 174, 293, 494, 304, 4637, 4638, 59, 401, 84, 439, 377, 494, 38, 178, 310, 4648, 172, 364, 541, 212, 527, 537, 313, 223, 538, 178, 4659, 4660, 538, 467, 418, 479, 538, 537, 59, 538, 38, 394, 81, 537, 537, 310, 538, 537, 4677, 538, 449, 816, 817, 203, 819, 820, 538, 538, 5483, 322, 4689, 38, 4691, 158, 158, 312, 831, 449, 172, 38, 298, 209, 265, 436, 5716, 538, 474, 537, 537, 537, 537, 401, 5859, 537, 537, 850, 537, 158, 537, 537, 113, 4881, 538, 38, 4624, 314, 178, 459, 538, 416, 416, 3118, 538, 466, 172, 4734, 4598, 4599, 92, 136, 541, 38, 310, 538, 206, 538, 112, 537, 537, 541, 537, 4750, 5377, 38, 35, 541, 5903, 439, 491, 195, 493, 494, 537, 363, 537, 5404, 474, 172, 439, 4768, 207, 537, 310, 6, 387, 165, 498, 72, 387, 313, 72, 538, 515, 136, 537, 540, 141, 478, 494, 150, 5415, 490, 310, 169, 494, 479, 538, 4796, 538, 479, 4799, 3118, 535, 5950, 5951, 538, 539, 540, 4807, 4808, 169, 332, 541, 38, 178, 4814, 4815, 537, 266, 537, 4819, 445, 5833, 445, 439, 4824, 298, 310, 4827, 310, 4829, 439, 401, 537, 38, 38, 4835, 313, 313, 537, 4839, 4840, 4841, 4842, 525, 526, 527, 528, 529, 530, 531, 532, 533, 203, 180, 180, 157, 4856, 5869, 537, 4859, 404, 498, 356, 4863, 154, 498, 1217, 356, 4868, 386, 59, 4871, 4872, 59, 4874, 81, 4876, 317, 4905, 4879, 38, 4881, 370, 10, 59, 538, 13, 537, 3276, 59, 449, 3279, 4892, 3281, 3282, 125, 472, 538, 6, 141, 5716, 401, 537, 498, 498, 4905, 310, 525, 526, 527, 528, 529, 530, 531, 532, 533, 538, 35, 45, 5622, 310, 294, 537, 1059, 5268, 52, 298, 5939, 10, 5942, 404, 13, 24, 4933, 4934, 17, 18, 19, 386, 537, 537, 3118, 294, 390, 310, 390, 25, 318, 541, 4949, 541, 78, 31, 386, 480, 1306, 81, 537, 449, 178, 537, 157, 150, 427, 479, 538, 427, 541, 6, 120, 317, 334, 416, 62, 6122, 1326, 480, 5321, 494, 180, 4584, 416, 494, 538, 474, 180, 5959, 81, 537, 537, 3889, 538, 479, 4856, 5532, 537, 941, 76, 3261, 4952, 4863, 981, 1272, 1733, 2993, 4868, 5709, 2902, 4871, 98, 4963, 3661, 4412, 3912, 4387, 5015, 6113, 3020, 3074, 5457, 3880, 5939, 5022, 6256, 151, 4578, 5506, 4385, 4385, 5092, 5482, 3648, 3586, 5734, 1385, 4946, 6344, 6245, 5376, 6345, 5969, 5968, 6133, 6282, 5044, 3654, 5138, 4599, 4625, 4610, 5702, 5912, 4568, 3088, 133, 4407, 3686, 6205, 6206, 5059, 3088, 140, 3928, 1023, 5716, 144, 5132, 4594, 5489, 3972, 197, 4661, 5815, 162, 6370, 202, 6507, 5473, 6482, 3888, 6145, 5417, 4633, 5687, 5589, 5420, 18, 1893, 28, 668, 5090, 4047, 5653, 4704, 173, 208, 6244, 4707, 5603, 6366, 1247, 4636, 3104, 3564, 217, 3493, 2760, 5107, 3496, 3983, 199, 5803, 5532, 1937, 5114, 1934, 1252, 1972, 231, 3820, 5625, 3019, 753, 5123, 4440, 1261, 253, 5632, 720, 6172, 209, 1267, 1268, 3737, 6418, 1271, 1272, 1948, 5138, 870, 4665, 3050, 2703, 225, 1495, 1496, 4667, 1498, 2006, 1846, 6340, 5151, 5206, 5153, 5649, 1548, 3544, 6083, 4689, 3547, 249, 5652, 1298, 41, 1444, 41, 1417, 3515, 4750, 3530, 1505, 2713, 6076, 1504, 5881, 3493, 3496, 1507, 3496, 5179, 4260, 4278, 5332, 4082, 3493, 312, 5611, 5610, 4690, 6395, 5190, 3493, 6070, 6218, 6434, 5700, 5701, 5868, 3493, 5587, 289, 4187, 2632, 5882, 293, 3436, 5206, 5883, 1461, 2633, 289, 5211, 2129, 3292, 293, 3049, 5377, 5832, 6436, 3416, 3406, 3328, 2638, 2701, 4119, 304, 3544, -1, -1, 3547, 312, 929, -1, -1, -1, 314, -1, 326, 327, 5583, -1, 5415, 5403, 6256, -1, -1, 335, 326, -1, 5150, -1, 1387, -1, -1, 5415, 5255, -1, -1, -1, -1, 1396, -1, -1, -1, -1, 5265, -1, -1, 5268, -1, 5614, 5271, 5272, 5273, -1, 5138, 1412, -1, -1, 5905, 369, -1, 409, -1, 373, 5414, -1, -1, -1, 378, 5942, -1, -1, 372, 373, -1, 5296, 5297, 387, -1, -1, 5301, -1, 5204, 5205, -1, -1, 396, -1, -1, -1, -1, 4916, -1, -1, 404, 3493, 5317, -1, 3496, -1, 5321, -1, -1, -1, 404, -1, 5327, 417, -1, 5459, 5331, -1, -1, -1, 5335, -1, 426, 5338, -1, 5340, -1, 431, -1, -1, -1, 5346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4970, 3544, -1, -1, 3547, -1, 5877, -1, 5879, -1, 5376, 5377, 5378, -1, 5380, -1, 5382, -1, -1, -1, -1, -1, 4992, 516, -1, -1, -1, -1, 5344, -1, 6, -1, 477, -1, 489, 528, 529, 530, 531, 532, 533, -1, -1, 6421, -1, -1, -1, -1, 5414, 5415, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6461, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, 5459, 5064, 6113, -1, -1, -1, -1, -1, -1, 5331, -1, 6482, -1, -1, 5473, -1, -1, -1, -1, 5478, -1, -1, -1, -1, 5483, -1, -1, -1, -1, -1, -1, -1, -1, 5492, -1, 10, 6507, -1, 13, -1, -1, -1, -1, 5502, -1, -1, -1, 5506, -1, -1, 5509, -1, -1, -1, 5376, 4413, 6172, -1, 6172, -1, -1, 5520, 5521, 5522, -1, 5868, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, 5532, 5532, 5532, 4441, 5532, 5532, 5532, -1, -1, -1, 1685, -1, 5551, -1, 5553, 5532, -1, 4455, 1693, 5532, 5532, 5532, -1, 78, 6483, -1, 5532, 5566, 4466, -1, -1, 6353, 6354, 685, 5532, -1, -1, 5532, -1, 691, -1, 5532, -1, 5186, 5583, 5532, 5532, 5487, 5587, 198, 5589, 703, 5632, -1, -1, -1, 5532, 0, 207, 208, -1, -1, -1, 62, 5603, 6256, 215, -1, 217, 218, -1, -1, 5611, -1, -1, 5614, -1, -1, 5518, 5618, -1, -1, 231, -1, -1, -1, 5625, -1, -1, -1, -1, -1, 5532, 5632, -1, -1, 6292, -1, 6292, 98, 43, -1, -1, -1, 4542, 4543, -1, -1, 10, -1, -1, 13, -1, -1, 2004, -1, -1, 62, -1, -1, 5522, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5669, -1, -1, -1, -1, -1, -1, -1, -1, 5678, -1, -1, 197, 45, -1, -1, -1, 202, -1, 5551, 52, -1, -1, 98, -1, 5694, 99, -1, -1, -1, -1, 5700, 5701, 162, -1, -1, 5705, 5706, 5707, 5708, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 6066, -1, -1, 2076, -1, -1, -1, -1, -1, -1, 4631, 5337, 5521, -1, 5736, 253, -1, 199, -1, -1, -1, -1, 5905, 5745, -1, -1, 5611, 153, -1, -1, -1, -1, -1, -1, 162, -1, 2109, -1, -1, 6418, 166, 6418, -1, -1, -1, -1, 172, -1, 5770, 1907, -1, 5773, 178, 1911, -1, -1, -1, -1, 184, -1, 2133, 187, -1, -1, -1, 191, 151, 249, -1, -1, -1, 199, -1, -1, 312, -1, -1, 5799, 4699, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 221, -1, 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5832, 293, 197, -1, -1, -1, -1, 202, -1, -1, -1, 249, 5844, 6350, -1, -1, -1, -1, 254, -1, -1, 5853, 5854, 5855, -1, -1, -1, 5859, -1, -1, -1, -1, -1, 5865, -1, 327, 5868, 6213, 6214, -1, -1, 6217, 5775, 335, -1, 5877, -1, 5879, -1, 5881, 5882, 289, 4272, -1, -1, 293, 4276, -1, 253, -1, -1, 409, 5894, 6400, -1, -1, -1, -1, -1, -1, 306, 5903, -1, 5905, 310, -1, -1, 5909, 5773, -1, 316, 373, 5914, 375, -1, 2053, 378, -1, 326, 327, -1, 2059, -1, -1, -1, 387, -1, 335, -1, -1, -1, -1, -1, -1, 396, -1, -1, -1, -1, -1, -1, -1, 404, -1, -1, -1, -1, 312, 5950, 5951, -1, -1, 4272, -1, -1, 417, 4276, -1, -1, -1, -1, 369, -1, -1, 426, 373, -1, 2105, -1, 431, 378, 377, 6103, 2326, -1, -1, 4366, -1, 5980, 387, -1, -1, -1, -1, -1, -1, -1, -1, 396, -1, -1, -1, 5994, -1, -1, -1, 404, -1, 516, -1, -1, -1, -1, -1, 6006, -1, -1, -1, -1, 417, 528, 529, 530, 531, 532, 533, -1, -1, 426, -1, -1, -1, -1, 431, -1, -1, 432, 489, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6173, 6174, 409, -1, 4366, -1, -1, 6051, -1, 4952, -1, -1, 666, -1, -1, 4958, -1, -1, 466, -1, 4963, -1, 6066, -1, -1, -1, 6070, -1, -1, -1, -1, 685, 6076, -1, -1, -1, 5684, 691, -1, 489, 6084, 5689, 5690, 491, -1, 493, 494, 4990, 4991, 703, -1, 4272, 4995, 4996, -1, 4276, -1, -1, -1, 6103, -1, -1, -1, -1, -1, 719, -1, 515, -1, -1, 724, 6115, -1, -1, -1, 729, -1, -1, 6122, 733, 734, 6026, -1, -1, -1, -1, 740, 5994, 742, 743, 538, -1, 540, 541, -1, -1, -1, -1, -1, 6006, -1, 755, 756, 6147, -1, -1, -1, -1, -1, 516, 6154, -1, 766, -1, -1, -1, -1, -1, -1, -1, 6164, 528, 529, 530, 531, 532, 533, -1, -1, 6173, 6174, 6175, -1, -1, -1, 6179, 6172, -1, -1, 6183, -1, 6172, -1, -1, -1, 4366, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5804, -1, -1, -1, -1, 6205, 6206, 6207, -1, 819, 4598, 4599, -1, 6213, 6214, -1, -1, 6217, -1, -1, 6220, -1, -1, -1, -1, 835, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6172, -1, -1, -1, -1, -1, -1, -1, -1, 6244, 6146, 856, 857, -1, -1, 6250, 6292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5872, -1, 880, 6172, 882, -1, -1, -1, -1, -1, -1, -1, 4598, 4599, 6282, 6283, 6284, -1, -1, -1, 6288, -1, -1, -1, -1, -1, -1, -1, 906, -1, -1, -1, 6292, 6164, -1, -1, -1, 6292, 6306, -1, -1, -1, -1, 2662, -1, -1, 6314, -1, -1, -1, -1, 929, -1, -1, 6322, -1, -1, -1, -1, -1, -1, -1, 6330, -1, 942, -1, -1, 6335, -1, -1, -1, -1, 6340, -1, -1, -1, -1, 2696, -1, -1, -1, -1, 6350, -1, -1, -1, -1, 6292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6495, 6496, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6387, 6388, 6389, 6390, 6292, -1, -1, -1, 6395, -1, -1, -1, -1, 6400, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6411, -1, -1, 6414, -1, -1, -1, -1, 6282, -1, 4598, 4599, -1, -1, 6288, 6418, -1, -1, -1, 10, 6418, -1, 13, 6434, -1, -1, 17, 18, 19, 1050, 1051, 1052, -1, -1, -1, -1, -1, -1, 1059, -1, -1, -1, -1, 1064, 35, -1, -1, -1, 1069, 1070, 6461, 6462, -1, 1074, 45, 1076, -1, 4856, -1, 1080, -1, 52, -1, -1, 4863, -1, -1, 6478, -1, 4868, 6418, -1, 4871, 4872, -1, 1096, -1, -1, -1, -1, -1, -1, -1, -1, 6495, 6496, -1, 78, 6499, -1, 6501, -1, -1, 5403, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6418, 6518, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, 1140, -1, 1142, 1143, -1, -1, -1, -1, 4856, -1, -1, -1, -1, -1, -1, 4863, -1, -1, -1, -1, 4868, 6414, -1, 4871, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 1183, -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, -1, 1211, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, 197, 1731, -1, -1, -1, 202, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1246, 78, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, 2784, -1, -1, 1261, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1271, 1272, -1, -1, 1275, -1, 1277, -1, -1, -1, -1, -1, 253, -1, -1, -1, 153, -1, 4856, -1, -1, -1, 1293, -1, -1, 4863, -1, 1298, -1, 166, 4868, -1, -1, 4871, -1, 172, -1, -1, -1, 1310, -1, 178, -1, 2840, -1, -1, -1, 184, -1, -1, 187, -1, -1, -1, 191, 296, -1, -1, 5107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, 1352, -1, -1, 221, -1, -1, -1, -1, 5138, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1381, 1382, 1383, -1, 1385, -1, -1, 254, -1, -1, -1, -1, -1, 225, 226, 3137, -1, -1, 2925, 6394, 1904, -1, -1, -1, -1, 1406, -1, -1, 1912, -1, -1, -1, -1, -1, -1, -1, 1920, -1, -1, -1, -1, 253, 2949, -1, -1, -1, 5716, -1, -1, 5138, -1, 1165, -1, -1, 0, -1, -1, 1171, 409, 306, -1, -1, -1, 310, -1, -1, -1, 1181, -1, 316, 1451, 1185, -1, -1, -1, 1189, -1, 1191, -1, -1, -1, 1965, -1, 1197, 296, -1, 3208, -1, -1, 1203, -1, -1, 1206, -1, -1, -1, -1, -1, -1, 1480, 312, -1, -1, 315, -1, -1, 3013, -1, 1992, -1, 3017, -1, -1, -1, -1, -1, 1497, -1, -1, -1, 1501, 1502, -1, -1, -1, -1, -1, -1, -1, -1, 377, -1, -1, -1, -1, -1, 1517, -1, -1, -1, -1, -1, 1523, -1, -1, -1, -1, 3054, -1, 3056, -1, 3058, 3059, 99, -1, -1, 3063, 3064, 3065, -1, 3067, 3068, 3069, -1, -1, 516, -1, -1, -1, -1, -1, -1, 5331, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, 436, 5138, 542, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, 153, -1, -1, 1591, -1, -1, -1, 3121, -1, -1, 5376, -1, 466, 166, -1, -1, -1, -1, 3347, 172, -1, -1, -1, -1, -1, 178, -1, -1, -1, -1, -1, 184, 3146, -1, 187, 5331, -1, 491, 191, 493, 494, -1, -1, -1, 1632, -1, -1, -1, 5414, -1, -1, -1, -1, -1, 5931, -1, -1, -1, -1, -1, -1, 515, -1, -1, -1, -1, 3395, -1, 221, -1, -1, -1, -1, -1, -1, -1, -1, 1665, -1, -1, 5376, 535, -1, -1, 538, 539, 540, -1, -1, 3418, -1, -1, -1, 5459, -1, -1, -1, 516, -1, -1, -1, 254, -1, -1, -1, 3434, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, 541, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 25, -1, -1, -1, -1, 1731, 31, -1, -1, 3261, -1, -1, -1, -1, -1, 306, -1, -1, 5522, 310, 1746, 1747, 1748, -1, -1, 316, 3493, -1, -1, 3496, -1, -1, -1, -1, -1, -1, -1, -1, 5331, -1, -1, -1, -1, -1, -1, -1, -1, 5551, -1, -1, -1, 76, -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, 3544, -1, -1, 3547, -1, -1, 5376, 35, -1, 377, -1, 5522, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, 5611, 133, -1, -1, -1, -1, -1, -1, 140, -1, 5551, -1, 144, 1846, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 1858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1869, -1, 436, -1, -1, 173, -1, -1, -1, -1, -1, -1, 1881, -1, -1, -1, 1885, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 466, -1, 5611, 1904, -1, -1, -1, -1, -1, 209, -1, 1912, -1, -1, -1, -1, -1, -1, -1, 1920, -1, -1, -1, -1, -1, 491, -1, 493, 494, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1939, -1, -1, -1, -1, -1, -1, -1, -1, 1948, -1, 515, 1951, -1, -1, 1954, 5522, -1, 1957, 1958, -1, -1, 1961, 1962, -1, 1964, 1965, -1, 5745, -1, -1, 535, -1, 197, 538, 539, 540, 1976, 202, 1978, 1979, -1, -1, -1, -1, 5551, -1, -1, -1, 1988, 1989, 289, 1991, 1992, -1, 293, 5773, -1, -1, -1, -1, 225, 226, -1, -1, -1, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, 253, -1, -1, 2031, -1, -1, 10, 2035, 2036, 13, -1, -1, -1, 17, 18, 19, 5611, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, 5773, -1, -1, -1, 45, 369, 296, -1, 372, 373, -1, 52, 3603, -1, -1, -1, -1, 25, -1, -1, -1, -1, 312, 31, -1, 315, -1, 2092, -1, 2094, -1, -1, -1, -1, 2099, 2100, -1, 78, 46, -1, 404, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, -1, -1, -1, 2122, -1, 2124, -1, 2126, 2127, 2128, 2129, 2130, 2131, 6421, 76, 2134, -1, 2136, 2137, -1, -1, 2140, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2154, 2155, 2156, 2157, -1, -1, -1, -1, -1, -1, -1, 3691, -1, -1, -1, -1, -1, -1, -1, 2173, -1, 2175, -1, -1, 477, -1, -1, -1, -1, -1, 409, -1, -1, -1, 131, -1, 133, -1, -1, 6482, -1, -1, -1, 140, -1, -1, -1, 144, -1, -1, -1, -1, 5773, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5994, -1, 6507, -1, -1, 197, 3963, 3749, -1, -1, 202, -1, 6006, -1, 173, -1, -1, -1, 1967, -1, -1, -1, -1, -1, -1, -1, 1975, -1, -1, 2748, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, 3999, -1, -1, -1, -1, 2766, -1, -1, 209, 2770, -1, -1, -1, 2774, -1, -1, -1, 10, -1, 253, 13, -1, -1, -1, 17, 18, 19, -1, 5994, 4028, -1, -1, -1, 516, -1, 3819, -1, -1, 2799, -1, 6006, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 45, -1, -1, -1, -1, -1, 541, 52, -1, -1, 296, 2321, -1, -1, -1, 6103, -1, -1, -1, -1, 2833, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, 3867, -1, 78, -1, -1, 289, -1, 2851, -1, 293, -1, -1, 3879, 3880, -1, -1, -1, -1, -1, -1, 304, -1, 3889, -1, -1, -1, -1, 3894, -1, 3896, 314, -1, -1, -1, 2375, -1, -1, -1, -1, -1, -1, -1, 326, -1, -1, 6164, 2890, -1, -1, -1, -1, -1, -1, -1, 6173, 6174, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2917, -1, 3942, -1, -1, -1, 2923, -1, -1, -1, -1, -1, 369, 5994, -1, 372, 373, -1, 2432, 409, 2937, -1, -1, -1, -1, 6006, -1, 2944, -1, -1, 2947, -1, -1, -1, -1, -1, 2953, 3977, 3978, -1, -1, -1, 6164, -1, -1, -1, -1, 404, 197, -1, -1, -1, -1, 202, -1, -1, 2973, -1, -1, -1, -1, -1, 2979, -1, -1, -1, -1, 4222, -1, 2986, -1, 4226, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, 3000, -1, -1, -1, -1, -1, -1, 6282, -1, -1, -1, -1, 4250, 6288, 3014, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, 3025, -1, -1, -1, -1, -1, 6306, -1, -1, 4272, -1, -1, 477, 4276, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 296, -1, -1, -1, 541, -1, -1, -1, -1, -1, -1, -1, -1, 6282, -1, -1, 312, -1, -1, 6288, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 25, -1, 6164, -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6389, -1, -1, -1, -1, 46, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, -1, 2627, -1, -1, -1, -1, -1, -1, -1, -1, 6414, -1, 2638, -1, 2640, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2657, -1, -1, -1, 2661, -1, -1, 2664, -1, 2666, -1, 4194, 2669, -1, -1, -1, 2673, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6462, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2694, -1, 2696, -1, -1, -1, 6478, -1, -1, 133, -1, -1, 6414, -1, -1, -1, 140, -1, -1, 2713, 144, 6282, -1, 6495, 6496, -1, 38, 6288, 2722, 2723, -1, 62, -1, 25, -1, -1, -1, -1, -1, 31, -1, -1, -1, -1, -1, 3242, -1, -1, -1, 173, 62, -1, -1, -1, 2748, -1, -1, -1, -1, -1, -1, 2755, -1, -1, -1, 2759, 2760, 98, 3265, -1, -1, -1, 2766, -1, -1, 3272, 2770, -1, -1, -1, 2774, -1, -1, -1, 76, 209, 98, 516, -1, -1, 2784, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 2799, -1, -1, 2802, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2813, -1, 2815, 2816, -1, 2818, 2819, -1, 2821, -1, -1, -1, 162, -1, -1, -1, -1, -1, -1, -1, 2833, -1, 133, -1, -1, -1, -1, -1, -1, 140, -1, 162, -1, 144, 6414, -1, -1, -1, 2851, 2852, -1, -1, -1, -1, 4598, -1, 289, -1, -1, 199, 293, -1, -1, -1, 2867, -1, -1, -1, -1, -1, -1, 304, 173, -1, -1, -1, -1, -1, 199, -1, 4624, 314, -1, -1, 4413, -1, 2889, 2890, -1, -1, 2893, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 249, -1, -1, 4441, -1, 2917, -1, 2919, -1, 2654, -1, 2923, -1, -1, 244, -1, -1, -1, 4456, 249, -1, 4459, -1, 4461, -1, 2937, -1, 369, -1, -1, 372, 373, 2944, -1, -1, 2947, -1, -1, -1, -1, 289, 2953, -1, -1, 293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 2973, 404, 293, 17, 18, 19, 2979, -1, 4507, -1, -1, -1, -1, 2986, -1, -1, 326, 327, 289, -1, -1, 35, 293, -1, 4523, 335, -1, 3000, -1, 4528, -1, 45, -1, 304, -1, -1, 327, -1, 52, -1, 38, 3014, -1, 314, 335, -1, 3019, -1, -1, -1, -1, -1, 3025, -1, -1, 326, -1, -1, -1, 369, -1, -1, 60, 373, 78, -1, -1, -1, 378, -1, 3043, 3044, 3045, -1, 477, -1, 3049, 387, -1, -1, -1, -1, 373, -1, -1, -1, 396, 378, 86, -1, -1, -1, -1, -1, 404, -1, 387, -1, 369, -1, -1, 372, 373, 3076, 3077, 396, -1, 417, -1, -1, -1, -1, 3085, 404, 112, 113, 426, -1, -1, -1, -1, 431, 120, -1, 3600, -1, 417, -1, -1, 4628, -1, -1, 4631, 404, -1, 426, -1, -1, -1, -1, 431, -1, -1, -1, -1, 3118, -1, -1, -1, 4863, -1, -1, -1, -1, 4868, -1, -1, 4871, -1, -1, -1, 452, 160, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3150, -1, 489, -1, 3154, -1, 197, 182, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, 489, -1, -1, -1, 493, -1, -1, -1, 477, 205, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, 4717, -1, -1, -1, -1, -1, 4723, 4724, 4725, 4726, -1, 4728, 4729, 4730, 4731, 4732, 3710, -1, -1, -1, -1, 253, -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, 263, -1, -1, 35, 3242, 268, 3244, -1, -1, -1, 273, -1, -1, 45, -1, -1, -1, 296, -1, -1, 52, -1, -1, 3261, -1, 3263, 289, 3265, -1, -1, 293, -1, -1, 312, 3272, -1, 315, -1, 3276, -1, 3278, 3279, -1, 3281, 3282, 3283, 78, -1, -1, -1, -1, -1, -1, 3291, -1, -1, -1, -1, 3296, -1, -1, -1, 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3313, -1, -1, -1, -1, -1, -1, -1, 4847, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3841, -1, -1, -1, -1, -1, -1, 3345, 3346, 3347, -1, 374, 3350, -1, -1, -1, -1, -1, -1, -1, 3358, 3359, 3360, 3361, -1, -1, -1, -1, -1, -1, 409, 3369, -1, -1, -1, 398, 3374, 3375, -1, 3377, -1, 3379, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3391, 3392, -1, 419, 3395, 421, -1, -1, 424, -1, -1, -1, 197, -1, -1, -1, -1, 202, 5150, -1, -1, -1, -1, -1, 3415, -1, 3417, -1, 3419, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, 3168, -1, -1, 3438, -1, 3173, -1, 3175, -1, -1, 470, -1, -1, -1, -1, -1, -1, 3185, -1, -1, 3188, -1, 3190, 3191, 253, -1, 3194, -1, 5204, 5205, 3198, -1, 3200, -1, -1, 3203, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 3493, -1, -1, 3496, 538, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, 3510, -1, 537, -1, -1, 3515, -1, 4020, 312, -1, -1, 315, -1, -1, -1, 25, -1, -1, -1, -1, 3530, 31, -1, -1, -1, -1, 5062, 5063, 38, -1, 3273, -1, -1, -1, 3544, -1, 4049, 3547, -1, 5075, 4053, 5077, 5078, 5079, 3554, -1, -1, 3557, -1, 3559, 60, -1, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, 3579, 3580, -1, -1, -1, -1, 3585, -1, -1, -1, -1, 5331, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3600, -1, -1, 3603, -1, -1, 3606, -1, -1, -1, -1, -1, 112, -1, 3614, 409, -1, -1, 5144, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 133, -1, -1, -1, -1, -1, 3639, 140, -1, -1, -1, 144, 3645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3685, 3686, 3687, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 205, -1, -1, -1, 209, 3710, -1, 5238, -1, -1, -1, -1, -1, -1, 3719, -1, 3721, 516, -1, -1, -1, -1, -1, -1, 3729, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, 5487, -1, -1, -1, -1, 3751, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 263, -1, -1, -1, -1, 268, -1, -1, -1, -1, 273, -1, -1, -1, 5518, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, 289, -1, 5532, -1, 293, 14, 15, -1, -1, -1, -1, 20, -1, 22, -1, 304, -1, -1, -1, 28, -1, -1, 31, -1, -1, 314, -1, -1, 3817, -1, -1, -1, -1, -1, -1, -1, 325, 326, -1, -1, 10, 50, 51, 13, -1, -1, -1, 17, 18, 19, -1, 4343, 3841, -1, -1, -1, -1, 3846, -1, -1, -1, -1, -1, 3852, -1, 35, -1, 3589, -1, -1, -1, -1, 3861, -1, -1, 45, -1, -1, -1, -1, 369, -1, 52, 372, 373, 374, -1, -1, 5403, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3888, 3889, -1, 5632, -1, -1, 3894, -1, 3896, 78, 398, -1, -1, -1, -1, -1, 404, -1, -1, 25, -1, 3909, -1, 3911, -1, 31, -1, -1, -1, -1, -1, 419, -1, -1, -1, 5449, -1, -1, -1, -1, -1, -1, -1, 3931, 5458, -1, -1, -1, -1, 3670, -1, 3672, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3957, 76, 25, -1, -1, -1, -1, -1, 31, -1, -1, -1, -1, 470, -1, -1, -1, -1, -1, -1, 477, 3978, 3979, -1, 201, -1, 4486, -1, 205, 4489, -1, -1, -1, -1, -1, -1, 213, -1, -1, 216, -1, -1, 219, 220, 4001, 222, -1, 224, -1, -1, 227, -1, 229, 76, -1, -1, -1, -1, 133, 197, -1, -1, -1, 4020, 202, 140, -1, -1, -1, 144, -1, -1, -1, -1, -1, 5773, -1, 5775, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, 4049, -1, -1, -1, 4053, -1, 173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 133, -1, -1, -1, -1, 253, -1, 140, -1, -1, 4077, 144, -1, -1, -1, -1, 3816, -1, -1, -1, -1, 4591, 3822, -1, 209, -1, 4093, -1, -1, 4096, -1, -1, -1, -1, -1, 4102, -1, -1, 4608, -1, 173, -1, -1, -1, -1, -1, -1, -1, 296, 4116, -1, -1, -1, 4120, 4121, 4122, -1, -1, -1, -1, 4127, -1, -1, 4130, 312, -1, 4133, 315, -1, -1, -1, -1, 4139, -1, 4141, -1, 209, 4144, -1, -1, -1, 4148, 4149, 4150, 4151, 4152, -1, -1, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, -1, -1, -1, 4168, 4169, 4170, 289, -1, 4173, -1, 293, -1, -1, 4178, -1, -1, -1, -1, 4183, -1, 4185, 304, 4187, -1, -1, 5716, -1, -1, -1, 5720, 4195, 314, -1, 4198, -1, 4200, 4704, -1, -1, -1, 52, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, 4216, -1, -1, 4219, 4220, -1, 4222, 289, -1, 4225, 4226, 293, 409, -1, 4230, -1, 4232, -1, -1, -1, -1, 0, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, 314, -1, -1, 369, -1, -1, 372, 373, -1, 20, 4258, -1, 326, -1, -1, -1, 4264, -1, -1, -1, 31, -1, 33, 34, 4272, -1, -1, 4008, 4276, 4010, -1, 4012, -1, -1, -1, -1, -1, 6026, 404, -1, 51, -1, -1, 52, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, 369, -1, -1, 372, 373, -1, 4309, 73, -1, 75, 76, -1, -1, -1, 4317, -1, 82, -1, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, 516, 99, -1, 404, -1, -1, -1, -1, 4343, 525, 526, 527, 528, 529, 530, 531, 532, 533, 116, -1, -1, 119, 538, -1, 477, -1, -1, -1, -1, -1, -1, 4366, -1, -1, -1, -1, 134, -1, 136, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, 147, -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, -1, 159, -1, -1, -1, -1, -1, -1, 166, -1, 6146, -1, 4407, -1, -1, -1, 477, 4412, 4413, 4414, -1, 5942, -1, -1, -1, 5946, 184, 5948, -1, -1, -1, 5952, 5953, -1, -1, -1, 6172, -1, -1, -1, -1, -1, -1, 201, -1, 4440, 4441, -1, -1, -1, -1, 25, 667, -1, -1, -1, -1, 31, -1, -1, -1, -1, -1, 678, -1, -1, -1, 682, -1, -1, -1, -1, -1, -1, 689, 690, -1, -1, 693, -1, 695, 696, -1, -1, -1, -1, -1, -1, -1, 4987, -1, 4486, -1, -1, 4489, 710, -1, 255, 256, -1, -1, 4999, 76, 261, -1, -1, -1, -1, -1, -1, -1, -1, -1, 728, -1, -1, -1, -1, 276, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 749, -1, 751, 295, -1, -1, -1, -1, -1, -1, -1, -1, 761, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6292, -1, 4553, 133, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, 144, -1, -1, -1, -1, -1, -1, 335, -1, -1, 795, -1, -1, -1, -1, 4580, 4581, 345, -1, 4584, -1, -1, -1, -1, -1, -1, 4591, -1, -1, 173, -1, -1, 360, 4598, 4599, -1, -1, 365, 366, -1, 368, -1, -1, 4608, -1, 373, -1, -1, -1, -1, -1, 379, -1, -1, 382, -1, -1, -1, -1, -1, -1, 389, -1, -1, -1, 209, 4631, -1, 396, 397, -1, 4636, 4637, 4638, -1, -1, 404, -1, -1, -1, 408, -1, -1, 4648, -1, 10, -1, -1, 13, -1, -1, 419, 17, 18, 19, -1, -1, -1, 883, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, -1, 35, -1, 6418, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, 4691, 52, -1, 457, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4704, -1, 469, 4707, -1, -1, 289, -1, 475, -1, 293, -1, -1, 480, 78, -1, -1, -1, -1, -1, -1, 304, 5229, -1, -1, -1, 6256, 494, -1, -1, 4734, 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, 968, -1, 4750, -1, -1, -1, -1, 518, -1, 520, 521, 522, 523, 524, -1, -1, -1, -1, -1, -1, 4768, -1, -1, -1, -1, -1, 537, -1, -1, 540, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 369, -1, -1, 372, 373, -1, 4796, -1, -1, 4799, -1, -1, -1, -1, -1, -1, -1, 4807, 4808, -1, 4810, -1, -1, -1, 4814, 4815, -1, -1, -1, 4819, -1, -1, 1042, -1, 4824, 404, -1, 4827, -1, 4829, -1, -1, -1, -1, -1, 4835, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, 1067, 5351, -1, 5353, -1, -1, -1, -1, -1, 4856, -1, -1, -1, -1, -1, 1082, 4863, 1084, 225, 226, -1, 4868, -1, -1, 4871, 4872, -1, 1094, -1, -1, -1, -1, 4879, -1, 1101, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4892, 253, -1, 6421, -1, -1, 477, -1, -1, -1, 6428, -1, -1, -1, 6432, -1, 755, -1, -1, -1, -1, -1, -1, -1, 4916, -1, -1, -1, -1, -1, -1, -1, 1144, -1, 1146, -1, -1, 4929, -1, 25, -1, -1, 4934, -1, 296, 31, -1, -1, 4673, -1, 6468, 4676, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, 6482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, 4970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6507, 76, -1, 6510, -1, -1, 4987, 4721, -1, -1, -1, 4992, -1, 755, -1, -1, -1, -1, 4999, -1, -1, 1222, -1, 1224, -1, 1226, -1, 1228, -1, 1230, 1231, 1232, -1, -1, 5015, -1, 1237, -1, -1, -1, -1, 5022, -1, -1, -1, -1, -1, -1, 1249, -1, -1, -1, 5033, -1, -1, -1, -1, -1, 133, -1, -1, -1, -1, -1, -1, 140, -1, -1, 409, 144, -1, -1, -1, -1, -1, -1, -1, -1, 906, -1, -1, -1, -1, 5064, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 173, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 5090, -1, 38, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, 5107, -1, -1, 45, -1, 5112, -1, -1, 209, 62, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5131, -1, -1, -1, -1, -1, -1, 5138, 52, -1, -1, -1, 78, -1, 906, -1, -1, -1, -1, -1, -1, 98, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, 4914, -1, -1, 5184, -1, 5186, -1, -1, -1, -1, -1, -1, -1, -1, 289, -1, -1, -1, 293, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 304, -1, -1, 17, 18, 19, 162, -1, -1, -1, 314, -1, 1069, -1, 1444, -1, -1, -1, -1, 5229, -1, 35, 326, 1080, -1, -1, -1, -1, 4971, 4972, -1, 45, -1, -1, -1, -1, -1, -1, 52, 1096, -1, -1, -1, 199, -1, 5255, -1, -1, -1, -1, -1, -1, 197, -1, -1, 5265, -1, 202, 5268, -1, -1, 5271, 5272, 5273, 78, 369, -1, -1, 372, 373, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1050, 225, 226, -1, -1, -1, -1, 5296, 5297, 244, -1, -1, 5301, -1, 249, -1, -1, -1, -1, 1069, -1, 404, -1, -1, -1, -1, -1, -1, 5317, 253, 1080, -1, 5321, -1, -1, -1, -1, -1, 5327, -1, -1, -1, 5331, 5065, 5066, -1, 1096, -1, 5337, 5338, -1, -1, -1, -1, -1, -1, 1565, 5346, 293, -1, -1, -1, 5351, -1, 5353, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5376, 312, -1, -1, 315, 327, -1, 477, -1, -1, -1, -1, -1, 335, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, 5403, 5404, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5414, -1, -1, 1637, -1, -1, 1267, 225, 226, -1, -1, -1, -1, 373, 1275, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, 387, -1, -1, 10, -1, -1, 13, -1, 253, 396, 17, 18, 19, 5454, -1, -1, -1, 404, 5459, -1, -1, -1, 5196, -1, -1, 5199, 5200, -1, 35, -1, 417, -1, -1, 409, -1, -1, -1, -1, 45, 426, -1, -1, -1, -1, 431, 52, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, 5231, -1, -1, -1, -1, -1, -1, -1, 452, -1, 312, -1, -1, 315, 78, -1, 1275, -1, -1, -1, -1, -1, -1, -1, 5522, -1, -1, 5525, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 489, -1, -1, -1, 493, -1, -1, -1, 5551, -1, 5553, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, 5583, -1, -1, 6089, 5587, -1, 5589, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 536, -1, 5603, -1, 409, -1, -1, -1, -1, -1, 5611, -1, 52, 5614, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5625, -1, -1, -1, -1, 10, 197, 5632, 13, 1854, -1, 202, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, 25, -1, 225, 226, -1, -1, 31, -1, 45, -1, -1, -1, 1889, -1, -1, 52, -1, -1, -1, 1523, -1, 5678, -1, -1, -1, -1, -1, 5684, -1, -1, 253, -1, 5689, 5690, -1, -1, -1, 5694, -1, -1, -1, 78, -1, 5700, 5701, 5702, -1, -1, -1, -1, -1, 76, -1, -1, -1, 516, -1, -1, 1935, 5716, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 296, -1, -1, -1, 538, 1955, 5736, -1, -1, -1, -1, -1, -1, -1, 1591, 5745, 312, -1, 5748, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1981, 1523, 1983, -1, 133, -1, -1, -1, -1, -1, -1, 140, 5773, -1, -1, 144, -1, 1998, -1, 2000, -1, -1, -1, -1, 1632, -1, -1, 2008, -1, 2010, -1, 2012, -1, 2014, -1, 2016, -1, -1, -1, 2020, -1, -1, 5803, 5804, 173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, 197, 1665, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, 1591, -1, 5832, 5833, -1, -1, -1, -1, -1, -1, -1, 209, 755, 409, 5844, 225, 226, -1, -1, -1, -1, -1, -1, 5853, 5854, 5855, -1, -1, 10, -1, 2080, 13, -1, -1, -1, 17, 18, 19, 5868, 5869, -1, 1632, 5872, 253, -1, -1, -1, 5877, -1, 5879, -1, 5881, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, 5894, -1, -1, -1, -1, -1, 52, -1, -1, -1, 1665, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5914, -1, 296, -1, -1, -1, -1, 289, 5655, -1, -1, 293, 78, -1, -1, -1, -1, -1, 312, -1, -1, 315, 304, -1, -1, 5939, -1, -1, 5942, -1, -1, -1, 314, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, 326, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, 5711, -1, -1, -1, -1, -1, -1, 1746, 1747, 1748, -1, -1, -1, -1, -1, 906, 5994, -1, -1, -1, -1, -1, 10, 369, -1, 13, 372, 373, 6006, 17, 18, 19, -1, 1858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1869, -1, -1, 35, -1, -1, -1, 409, -1, -1, -1, -1, -1, 45, 404, -1, 1885, -1, -1, -1, 52, -1, -1, 197, -1, -1, -1, -1, 202, 6051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6066, -1, 78, -1, -1, -1, -1, 225, 226, -1, 6076, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6089, -1, -1, 1939, -1, -1, -1, -1, 1858, 5831, -1, -1, 253, -1, 6103, -1, -1, -1, 1954, 1869, 477, 1957, 1958, -1, 6113, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 1885, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, 1988, 1989, -1, 296, 525, 526, 527, 528, 529, 530, 531, 532, 533, 6154, -1, 1069, -1, 538, -1, 312, -1, -1, 315, 6164, -1, -1, 1080, 10, -1, -1, 13, -1, 6173, 6174, 17, 18, 19, 1939, 6179, -1, -1, -1, 1096, -1, -1, -1, 197, -1, -1, -1, -1, 202, 1954, -1, -1, 1957, 1958, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, 6213, 6214, 225, 226, 6217, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1988, 1989, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6256, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 6282, -1, -1, -1, 296, -1, 6288, -1, 729, -1, -1, 35, -1, -1, -1, 39, -1, -1, -1, -1, 312, 45, -1, 315, 6306, 2154, -1, -1, 52, -1, -1, -1, 6314, -1, 755, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6330, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6350, 2112, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, 1275, -1, 516, 2126, -1, -1, 2129, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 225, 226, -1, 538, -1, 130, 6389, -1, -1, -1, 2154, 6394, -1, -1, -1, -1, 409, 6400, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, 6414, -1, -1, -1, -1, -1, -1, 6421, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, 197, -1, -1, -1, -1, 202, 6461, 6462, -1, -1, -1, -1, 906, -1, -1, 312, -1, -1, -1, -1, -1, -1, -1, 6478, -1, -1, -1, 6482, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6495, 6496, -1, -1, -1, -1, -1, -1, -1, -1, 6238, 516, 6507, -1, -1, -1, 253, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, 2749, 2750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2768, 2769, -1, 2771, 2772, -1, 296, -1, -1, 2777, 2778, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, 312, -1, 2792, 315, -1, -1, 2796, -1, -1, -1, 2800, 2801, -1, -1, 2804, 2805, -1, -1, -1, -1, -1, 2811, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2823, -1, -1, -1, -1, -1, -1, 1523, -1, -1, -1, -1, 2835, -1, -1, -1, -1, 2840, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1069, -1, -1, 2853, -1, -1, -1, 2857, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, 2869, -1, -1, 2872, -1, 2874, 2875, 2876, 1096, -1, -1, -1, 2881, 2882, -1, -1, -1, -1, 409, -1, -1, -1, 2891, -1, -1, 516, -1, -1, 2897, 1591, -1, -1, 2901, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 2913, 2914, -1, -1, -1, 2918, -1, -1, -1, -1, -1, 2924, 2925, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2938, 1632, -1, 2941, -1, -1, -1, -1, -1, -1, 2948, 2949, -1, -1, 474, -1, 2954, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2966, -1, -1, 2969, -1, -1, 1665, -1, 2974, -1, -1, -1, -1, -1, 2980, 2981, -1, -1, -1, -1, -1, -1, 2988, -1, -1, -1, 2992, -1, 516, -1, 2996, 2997, 2998, 2999, -1, 3001, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 3015, 3016, -1, 3018, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, 3029, 3030, 3031, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 755, -1, -1, -1, -1, -1, 20, -1, -1, -1, 1275, -1, -1, -1, -1, -1, -1, 31, -1, 33, 34, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, -1, 3086, -1, -1, -1, -1, -1, -1, 61, 3094, -1, -1, -1, -1, 2640, -1, -1, -1, -1, -1, 73, -1, 75, 76, -1, -1, -1, -1, 3113, 82, -1, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2755, 97, -1, 99, 2759, 2760, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, 119, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3163, -1, 1858, 134, -1, 136, -1, -1, -1, 140, -1, -1, -1, 1869, -1, -1, 147, -1, -1, 3182, -1, 3184, -1, -1, -1, 2815, 157, -1, 159, 1885, -1, 2821, -1, -1, 906, 166, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2755, -1, 184, -1, 2759, 2760, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, 2867, -1, -1, -1, -1, -1, 1939, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1954, -1, -1, 1957, 1958, -1, -1, -1, -1, -1, -1, -1, -1, 2815, -1, -1, -1, -1, -1, 2821, -1, -1, -1, -1, 3285, -1, 255, 256, -1, -1, -1, -1, 261, -1, 1988, 1989, -1, -1, -1, -1, -1, -1, -1, 1523, -1, 10, -1, 276, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2867, 295, -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, -1, -1, -1, -1, -1, 1069, -1, -1, -1, -1, -1, -1, 335, -1, -1, -1, 1080, 1591, -1, 78, -1, -1, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1096, -1, -1, -1, -1, 360, -1, -1, -1, -1, 365, 366, 10, 368, -1, 13, -1, -1, 373, 17, 18, 19, -1, -1, 379, -1, 1632, 382, -1, -1, -1, -1, -1, -1, 389, -1, -1, 35, -1, -1, -1, 396, 397, -1, -1, -1, -1, 45, -1, 404, -1, -1, -1, 408, 52, -1, -1, -1, 10, 1665, -1, 13, -1, 3077, 419, 17, 18, 19, -1, -1, -1, -1, -1, -1, 2154, -1, -1, -1, -1, -1, 78, 436, -1, 35, -1, -1, -1, -1, 10, -1, -1, 13, -1, 45, -1, 17, 18, 19, -1, -1, 52, -1, 457, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, 35, 469, -1, -1, 3045, -1, -1, 475, -1, -1, 45, -1, 480, 78, -1, -1, -1, 52, -1, -1, -1, 225, 226, 3150, -1, -1, 494, 3154, -1, -1, -1, -1, -1, -1, -1, -1, 3077, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, 253, 518, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 172, -1, -1, -1, -1, 1275, 178, -1, 537, -1, -1, 540, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, 296, -1, -1, -1, -1, -1, -1, -1, -1, 3601, -1, -1, -1, -1, -1, -1, 312, 3150, -1, 315, -1, 3154, 225, 226, -1, -1, 3618, -1, -1, -1, 3622, -1, -1, -1, -1, 3627, 3628, 3629, -1, -1, 197, -1, -1, -1, 3263, 202, -1, 1858, -1, -1, 253, -1, -1, -1, -1, -1, -1, 3649, 1869, 3278, -1, -1, -1, -1, 3283, -1, -1, -1, 225, 226, 197, -1, -1, -1, 1885, 202, -1, -1, -1, -1, -1, 3673, 3674, 3675, 3676, -1, -1, -1, -1, -1, -1, -1, -1, 296, 3313, -1, 253, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, 409, -1, -1, -1, -1, -1, 3711, -1, 3713, 3714, 3715, -1, -1, 253, -1, 1939, -1, 3263, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, 1954, -1, 3278, 1957, 1958, -1, -1, 3283, -1, -1, -1, -1, 312, 729, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, 1988, 1989, -1, 3313, -1, 755, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, 1523, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 3833, 538, -1, -1, -1, -1, -1, -1, -1, 3842, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3868, 3869, -1, -1, -1, 3873, 409, -1, -1, -1, -1, -1, -1, -1, 1591, -1, -1, -1, 23, -1, -1, -1, -1, 28, -1, -1, -1, 3895, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1632, -1, 906, -1, 3554, -1, 66, 3557, -1, 3559, -1, -1, 2154, -1, 3564, -1, -1, -1, -1, 79, -1, -1, -1, -1, 3947, -1, -1, -1, 516, 3952, -1, -1, -1, 1665, -1, 3958, 96, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, 114, -1, 3606, -1, 516, -1, -1, -1, -1, -1, 3614, 3988, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 138, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, 3639, 3554, -1, 152, 3557, 4017, 3559, 4019, -1, -1, -1, 3564, 161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 174, -1, -1, -1, -1, -1, 180, -1, -1, -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2755, -1, -1, 3606, 2759, 2760, -1, -1, 207, -1, -1, 3614, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1069, -1, -1, -1, 3719, -1, 3721, -1, -1, -1, 3639, 1080, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1096, -1, -1, -1, -1, -1, -1, 2815, -1, -1, -1, -1, -1, 2821, -1, 267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1869, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2867, 312, 1885, -1, 3719, -1, 3721, -1, -1, -1, -1, -1, -1, -1, 325, -1, 3817, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, 10, -1, 354, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 1939, -1, -1, -1, 3861, -1, -1, -1, -1, -1, 35, -1, -1, -1, 381, 1954, -1, 384, 1957, 1958, 45, 388, -1, -1, 391, -1, -1, 52, -1, -1, 23, 398, 3889, -1, 401, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3817, -1, -1, 1988, 1989, -1, -1, 78, 421, -1, -1, -1, -1, -1, -1, -1, 429, -1, 1275, -1, -1, -1, -1, 436, -1, -1, 439, 66, -1, 3846, -1, 444, -1, -1, -1, 3852, -1, -1, -1, 452, 79, 454, -1, -1, 3861, -1, 459, -1, -1, -1, -1, -1, -1, 4329, 3957, 4331, -1, 96, -1, -1, 473, -1, -1, -1, -1, -1, -1, -1, 4344, -1, -1, -1, 3889, 486, -1, 114, 3979, -1, -1, -1, 4356, -1, -1, -1, 4360, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4372, -1, 4001, 138, -1, -1, -1, -1, -1, -1, -1, -1, 3077, -1, -1, -1, -1, 152, -1, -1, 4392, -1, -1, -1, -1, -1, 161, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, 4410, 174, -1, -1, -1, -1, 3957, 180, 4418, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, 3979, -1, -1, -1, -1, 4443, 207, 2154, -1, 4447, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3150, 253, -1, 4001, 3154, 4462, 4463, 4464, 4465, -1, -1, -1, 4096, -1, -1, 4472, 4473, 4474, 4475, -1, 729, -1, -1, -1, 4481, 4482, -1, -1, -1, -1, 4487, 4488, -1, 4490, 4491, 4492, 4493, 4494, 4495, 4496, -1, -1, -1, -1, 296, -1, 755, 267, -1, 4506, -1, -1, -1, 4510, 4511, 4512, 4513, -1, -1, -1, 312, -1, -1, 315, 4148, -1, -1, -1, -1, 25, -1, -1, -1, -1, -1, 31, -1, 4534, -1, 2755, -1, -1, 38, 2759, 2760, 1523, -1, -1, -1, 4173, -1, -1, 312, 52, -1, 4552, -1, -1, 4096, -1, 10, -1, -1, 13, 60, -1, -1, 17, 18, 19, -1, -1, -1, 3263, -1, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, 35, -1, -1, 3278, -1, 350, 351, -1, 3283, 354, 45, -1, -1, -1, 2815, -1, -1, 52, -1, -1, 2821, -1, -1, -1, -1, 4148, -1, -1, 1591, -1, -1, 112, 409, -1, -1, -1, 381, -1, 3313, 384, -1, -1, -1, 78, -1, -1, 391, 4629, -1, -1, 4173, -1, 133, 398, -1, -1, 401, -1, -1, 140, -1, -1, -1, 144, -1, -1, 2867, -1, -1, 1632, -1, -1, 906, -1, -1, -1, 421, -1, -1, -1, 4662, -1, -1, -1, 429, -1, -1, 4669, -1, 4671, -1, 436, 173, -1, 439, -1, -1, -1, -1, 444, -1, -1, 1665, -1, -1, -1, -1, 452, 4317, -1, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, -1, -1, -1, -1, 205, -1, -1, -1, 209, -1, -1, -1, 4714, -1, -1, -1, -1, -1, -1, 516, -1, 486, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 263, -1, -1, -1, -1, 268, -1, -1, 225, 226, 273, -1, 4317, 729, -1, -1, -1, -1, -1, -1, -1, -1, 4413, -1, -1, -1, 289, -1, -1, -1, 293, -1, -1, -1, -1, -1, 253, -1, -1, 755, -1, 304, -1, -1, -1, -1, -1, -1, -1, -1, 4441, 314, -1, 1069, -1, -1, -1, -1, -1, -1, -1, -1, 325, 326, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, 1096, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3077, 312, -1, 3554, 315, -1, 3557, -1, 3559, -1, -1, -1, 369, 3564, 4413, 372, 373, 374, -1, 1858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1869, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 398, 4441, -1, -1, -1, 1885, 404, -1, -1, -1, -1, -1, -1, -1, 3606, -1, -1, -1, 4917, 4918, 4919, 419, 3614, -1, 4923, 4924, 4925, 4926, -1, -1, -1, 4930, 3150, -1, -1, -1, 3154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3639, -1, -1, -1, -1, -1, -1, -1, 906, -1, 409, 4584, 1939, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 470, -1, 1954, -1, -1, 1957, 1958, 477, -1, -1, -1, 4982, 4983, 4984, 4985, 4986, -1, 4988, 4989, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 5000, 5001, -1, -1, 4631, -1, -1, 1988, 1989, 4636, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, 1275, -1, 45, 3719, -1, 3721, -1, -1, -1, 52, -1, 5034, -1, -1, -1, -1, -1, -1, -1, -1, 4584, 3263, -1, 2755, -1, -1, -1, 2759, 2760, -1, -1, -1, -1, -1, -1, 78, 3278, -1, -1, -1, 516, 3283, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, 4631, -1, -1, -1, 3313, 4636, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2815, -1, -1, -1, -1, -1, 2821, -1, -1, -1, -1, 1069, -1, -1, -1, -1, -1, -1, 3817, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, 5137, -1, -1, -1, -1, -1, -1, 1096, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2867, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3861, -1, -1, -1, -1, 2154, -1, -1, -1, 197, -1, -1, -1, -1, 202, 4810, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3889, -1, -1, -1, -1, -1, 5202, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5246, -1, -1, -1, -1, -1, -1, 755, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3957, -1, -1, -1, -1, 4810, -1, 1523, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3979, -1, -1, 4916, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4001, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1275, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3554, -1, -1, 3557, 1591, 3559, -1, -1, 4970, 5344, 3564, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, 4992, -1, -1, 3077, -1, -1, -1, -1, 35, -1, 4916, -1, -1, -1, -1, 1632, -1, -1, 45, -1, -1, -1, 3606, -1, 409, 52, -1, -1, 10, -1, 3614, 13, -1, -1, -1, 17, 18, 19, 4096, 906, 5405, -1, -1, -1, -1, -1, -1, -1, 1665, -1, -1, 78, -1, 35, -1, 3639, -1, -1, -1, 5424, -1, -1, -1, 45, 4970, 5430, 5431, -1, -1, -1, 52, -1, 5064, -1, -1, 5440, 3150, -1, -1, -1, 3154, -1, 5447, -1, -1, -1, 4992, -1, -1, -1, 4148, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4173, -1, -1, -1, 5484, 5485, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, 5497, -1, 5499, 3719, -1, 3721, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 5514, -1, -1, -1, 538, -1, -1, -1, -1, 5064, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, 5539, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3263, -1, -1, 5557, -1, 5186, -1, -1, -1, 225, 226, -1, -1, 1069, -1, 3278, -1, 1523, -1, -1, 3283, -1, -1, -1, 1080, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, 253, -1, -1, 1096, -1, -1, -1, 3817, -1, -1, -1, -1, -1, 3313, -1, 1858, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, 1869, -1, -1, -1, -1, -1, -1, 4317, -1, -1, -1, -1, -1, -1, -1, -1, 1885, 296, -1, 253, -1, -1, 1591, -1, -1, 3861, 5184, -1, 5186, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, 5657, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3889, -1, -1, -1, -1, -1, -1, -1, -1, 296, 1632, -1, -1, 5683, -1, -1, -1, 1939, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, 1954, -1, -1, 1957, 1958, -1, -1, -1, 5337, -1, -1, 1665, -1, -1, -1, -1, -1, -1, 4413, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1988, 1989, 3957, -1, -1, -1, -1, -1, -1, -1, -1, 409, 4441, -1, -1, 5751, -1, -1, -1, -1, -1, -1, -1, -1, 3979, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1275, 2755, -1, 5403, -1, 2759, 2760, -1, -1, 4001, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, 5337, -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, 5822, -1, -1, -1, 5826, -1, -1, -1, -1, -1, 35, -1, 2815, -1, -1, -1, -1, -1, 2821, -1, 45, -1, -1, 3554, -1, -1, 3557, 52, 3559, -1, -1, -1, 516, 3564, -1, -1, -1, -1, -1, 5861, 5403, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 78, 538, 4096, -1, -1, -1, -1, -1, -1, -1, -1, 2867, -1, -1, -1, -1, 4584, -1, -1, -1, -1, -1, 3606, 5525, 516, -1, 5901, 2154, -1, -1, 3614, 1858, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1869, -1, -1, -1, 538, -1, -1, -1, -1, 5926, -1, -1, 4148, 3639, -1, -1, 1885, -1, -1, -1, -1, 4631, -1, -1, -1, -1, 4636, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5525, 5985, -1, 1939, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, 1954, -1, -1, 1957, 1958, -1, -1, -1, 3719, -1, 3721, -1, -1, -1, -1, -1, -1, -1, -1, 1523, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1988, 1989, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1591, -1, -1, -1, 296, -1, -1, 3077, -1, 4317, -1, -1, -1, 6102, -1, -1, -1, -1, -1, 3817, 312, -1, -1, 315, -1, -1, -1, -1, 4810, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1632, 6131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6142, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, 3861, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 1665, 17, 18, 19, -1, -1, 3150, -1, -1, -1, 3154, -1, -1, -1, 5804, -1, -1, 3889, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 4413, -1, -1, -1, -1, 52, -1, -1, 2154, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4441, 4916, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 5872, -1, -1, 3957, -1, -1, -1, -1, -1, -1, -1, 221, -1, -1, -1, -1, -1, 5803, 5804, -1, -1, 10, 232, -1, 13, 3979, -1, 6272, 17, 18, 19, -1, 4970, -1, -1, -1, -1, 3263, -1, -1, -1, -1, -1, -1, -1, -1, 35, 4001, -1, -1, -1, -1, 3278, -1, 4992, -1, 45, 3283, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 5872, 3313, -1, 78, 538, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, 1858, -1, -1, -1, -1, -1, -1, -1, -1, 4584, -1, 1869, -1, -1, -1, 5064, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1885, -1, -1, -1, 4096, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4631, -1, -1, -1, -1, 4636, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1939, -1, 4148, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, 1954, 197, -1, 1957, 1958, -1, 202, 312, -1, -1, 315, -1, 4173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, 6485, 1988, 1989, -1, -1, -1, -1, -1, 5186, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2755, -1, -1, -1, 2759, 2760, 253, -1, -1, -1, -1, -1, -1, -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, -1, -1, 296, -1, -1, -1, 409, 35, -1, -1, -1, -1, -1, 2815, -1, -1, -1, 45, 312, 2821, -1, 315, -1, 3554, 52, -1, 3557, -1, 3559, -1, -1, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, 4810, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, 4317, -1, -1, -1, -1, -1, 10, 2867, -1, 13, -1, -1, -1, 17, 18, 19, -1, 3606, -1, -1, -1, -1, -1, -1, -1, 3614, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, 5337, -1, -1, -1, -1, 45, -1, -1, 2154, -1, -1, -1, 52, -1, 3639, -1, -1, -1, -1, 516, -1, 409, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 78, -1, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4916, -1, -1, -1, -1, 667, -1, 4413, -1, -1, -1, 673, -1, 5403, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, 4441, -1, -1, -1, -1, -1, 3719, -1, 3721, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, 4970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6394, -1, -1, -1, -1, 516, 4992, -1, 253, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 538, -1, -1, -1, -1, -1, -1, 197, -1, 2755, -1, -1, 202, 2759, 2760, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, 3077, -1, -1, -1, 225, 226, -1, 5525, -1, 312, -1, 3817, 315, -1, -1, -1, -1, -1, -1, -1, 5064, -1, -1, -1, -1, -1, -1, -1, 6394, -1, -1, -1, 253, -1, -1, -1, -1, -1, 2815, -1, -1, -1, -1, -1, 2821, -1, -1, 23, -1, -1, 4584, -1, 28, -1, -1, 3861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 858, -1, -1, -1, -1, 3150, -1, 296, -1, 3154, -1, -1, -1, 871, -1, 3889, -1, -1, -1, -1, -1, -1, 2867, 312, -1, -1, 315, 6461, -1, 4631, -1, -1, -1, -1, 4636, 79, 80, -1, 409, -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, -1, -1, -1, -1, -1, -1, 114, -1, -1, -1, 5186, -1, -1, -1, -1, -1, -1, -1, -1, 3957, -1, 207, 208, -1, -1, -1, -1, -1, -1, 215, 138, 217, 218, -1, 5684, -1, -1, -1, -1, 5689, 5690, 3979, -1, -1, 152, 231, -1, -1, -1, -1, -1, -1, -1, 161, 3263, -1, 409, -1, -1, -1, -1, -1, -1, 4001, -1, -1, 174, -1, 990, 3278, -1, -1, 180, -1, 3283, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 207, -1, -1, -1, 538, 3313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 245, -1, -1, -1, -1, -1, -1, 4810, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5804, -1, -1, -1, 4096, 267, -1, 5337, -1, 516, -1, -1, -1, -1, 3077, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 1105, -1, 538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4148, -1, 1134, 1135, 1136, -1, -1, -1, -1, -1, -1, -1, 5872, -1, -1, -1, -1, 5403, -1, -1, -1, -1, -1, -1, -1, 4173, -1, -1, -1, -1, -1, 3150, 350, 351, 10, 3154, 354, 13, -1, -1, 4916, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 381, -1, -1, 384, -1, -1, 45, -1, -1, -1, 391, -1, -1, 52, -1, -1, -1, 398, -1, -1, 401, -1, -1, 2755, -1, -1, -1, 2759, 2760, -1, -1, 4970, -1, -1, -1, -1, -1, -1, -1, 78, 421, -1, -1, -1, -1, -1, -1, -1, 429, -1, 1245, -1, -1, 4992, -1, 436, -1, -1, 439, -1, -1, -1, -1, 444, -1, -1, -1, -1, -1, -1, -1, -1, 3554, -1, -1, 3557, 5525, 3559, 459, -1, -1, 3263, 3564, 2815, -1, -1, -1, -1, -1, 2821, -1, -1, -1, -1, -1, -1, 3278, 1292, -1, -1, -1, 3283, -1, -1, 10, 486, 4317, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3606, 5064, -1, -1, -1, 35, -1, 3313, 3614, -1, -1, 2867, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, 199, 200, -1, -1, 203, 3639, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, 223, -1, -1, -1, -1, -1, -1, 230, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4413, -1, -1, -1, -1, 666, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 685, -1, -1, -1, 4441, -1, 691, -1, -1, 5684, -1, 3719, 1433, 3721, 5689, 5690, -1, -1, 703, -1, -1, 5186, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, 719, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, 733, 734, 315, -1, -1, -1, -1, 740, -1, 742, 743, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, 756, -1, -1, -1, -1, -1, -1, -1, -1, -1, 766, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1513, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3817, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3077, -1, 253, -1, -1, -1, -1, -1, -1, -1, 5804, -1, -1, -1, -1, 819, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, 3554, 4584, -1, 3557, 835, 3559, -1, 3861, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, 5337, -1, -1, -1, 1597, -1, -1, -1, 312, 3889, -1, 315, -1, 1606, -1, -1, -1, -1, -1, -1, 3150, -1, 4631, 880, 3154, 5872, 3606, 4636, -1, -1, -1, -1, -1, -1, 3614, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1638, -1, -1, -1, -1, -1, 1644, 1645, -1, -1, 1648, -1, -1, -1, 3639, -1, -1, -1, -1, -1, -1, 5403, -1, 1661, -1, -1, 1664, -1, 6394, -1, -1, -1, 3957, -1, 516, -1, -1, -1, -1, -1, 942, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 3979, -1, 538, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4001, -1, -1, -1, -1, -1, -1, 1721, -1, -1, -1, -1, 3263, -1, -1, -1, -1, -1, 3719, -1, 3721, 1735, -1, -1, -1, -1, -1, 3278, -1, -1, -1, -1, 3283, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 208, -1, -1, -1, -1, -1, -1, -1, -1, 217, -1, -1, -1, -1, 3313, -1, -1, -1, -1, 5525, -1, -1, -1, 231, -1, -1, 1052, -1, -1, -1, -1, -1, 4810, 1059, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, 1070, -1, -1, 4096, 1074, -1, 1076, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 675, -1, 677, -1, 538, 680, -1, 3817, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 694, -1, -1, 1845, -1, -1, 700, -1, -1, -1, -1, -1, -1, -1, 1856, -1, -1, -1, -1, 4148, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3861, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 4173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1898, 1899, 4916, 35, 3889, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, 1183, -1, -1, -1, 1923, -1, -1, -1, -1, -1, -1, 1930, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5684, -1, -1, -1, 78, 5689, 5690, -1, -1, -1, -1, -1, -1, -1, 4970, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 3957, -1, -1, -1, -1, -1, 4992, -1, -1, -1, -1, -1, 1246, -1, -1, 35, -1, -1, -1, -1, -1, -1, 3979, -1, -1, 45, -1, 1261, -1, -1, -1, -1, 52, 2003, -1, -1, 2006, 1271, 1272, -1, -1, -1, -1, 1277, 4001, -1, -1, 3554, -1, -1, 3557, -1, 3559, -1, -1, -1, -1, 3564, 78, 1293, 4317, -1, -1, -1, 1298, -1, -1, -1, 2038, 2039, -1, -1, -1, -1, -1, -1, -1, -1, 5064, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5804, -1, -1, 197, -1, -1, -1, -1, 202, 3606, -1, -1, -1, -1, -1, -1, -1, 3614, 2078, -1, -1, 2081, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3639, -1, -1, -1, -1, -1, -1, 4096, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, 171, -1, -1, -1, -1, 4413, -1, 5872, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6394, -1, -1, 995, 996, -1, -1, 197, -1, -1, -1, -1, 202, -1, 4441, -1, -1, -1, -1, -1, -1, 4148, 296, -1, -1, -1, -1, -1, -1, -1, 5186, -1, -1, -1, -1, 225, 226, -1, 312, -1, -1, 315, 3719, -1, 3721, -1, 4173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, 344, -1, -1, -1, 1066, -1, 1480, -1, -1, -1, 666, -1, -1, -1, -1, -1, -1, -1, -1, 1081, -1, -1, -1, -1, -1, -1, -1, -1, -1, 685, -1, -1, -1, -1, -1, 691, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 703, -1, -1, 1112, 1113, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, 719, -1, 409, -1, -1, -1, -1, 3817, -1, -1, -1, -1, -1, 1138, -1, 734, -1, -1, -1, 342, -1, 428, -1, 742, 4584, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 756, -1, -1, -1, -1, -1, -1, -1, -1, -1, 766, 5337, -1, -1, 3861, -1, 1178, 1179, -1, -1, 4317, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4631, -1, -1, -1, -1, 4636, -1, -1, 3889, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 819, -1, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, 5403, -1, 835, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3957, -1, -1, -1, -1, -1, 4413, -1, -1, -1, -1, -1, -1, -1, 880, -1, -1, -1, -1, -1, -1, -1, 3979, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4441, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4001, -1, 516, 1731, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 942, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 5525, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4810, -1, -1, -1, -1, 35, -1, -1, 38, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 4096, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 1846, -1, -1, -1, -1, -1, 45, -1, -1, 10, -1, -1, 13, 52, -1, 4584, 17, 18, 19, -1, -1, -1, -1, -1, 1052, -1, -1, -1, -1, 4148, -1, 1059, -1, -1, 35, 1881, -1, -1, -1, 78, -1, -1, -1, -1, 45, -1, -1, 4916, -1, -1, -1, 52, -1, -1, 4173, 2637, -1, -1, 1904, -1, -1, -1, 4631, -1, -1, 2647, 1912, 4636, 6394, -1, -1, -1, 10, -1, 1920, 13, -1, 78, -1, 17, 18, 19, -1, -1, -1, -1, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, -1, -1, 35, -1, -1, 38, 4970, -1, -1, -1, -1, -1, 45, 197, -1, -1, -1, -1, 202, 52, 1961, 1962, -1, 1964, 1965, -1, -1, -1, 4992, -1, -1, -1, -1, -1, -1, 1976, -1, 1978, 1979, -1, -1, 225, 226, -1, -1, 78, -1, -1, -1, -1, 1991, 1992, -1, -1, -1, 1584, -1, -1, -1, 2736, 1183, -1, -1, 197, -1, -1, -1, -1, 202, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1609, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2031, 225, 226, -1, 2035, 2036, -1, -1, -1, -1, 5064, 197, -1, 4317, -1, -1, 202, -1, -1, -1, -1, 5804, 296, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, 1246, -1, -1, -1, -1, 312, 225, 226, 315, -1, -1, -1, -1, -1, -1, 1261, -1, -1, -1, -1, -1, -1, -1, 4810, -1, 1271, 1272, -1, -1, -1, -1, 1277, -1, -1, 253, -1, 1688, -1, -1, 296, -1, 197, -1, -1, -1, -1, 202, 1293, -1, -1, -1, -1, 1298, -1, -1, 312, 5872, -1, 315, -1, -1, -1, -1, -1, -1, 1717, 1718, 1719, 1720, 225, 226, 2871, -1, -1, -1, -1, 4413, 296, -1, -1, -1, -1, -1, -1, -1, -1, 2886, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, 253, -1, 5186, -1, -1, 409, -1, 4441, -1, -1, -1, 2908, -1, -1, 2175, -1, -1, -1, -1, -1, -1, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4916, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, 4970, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, 2994, 2995, -1, 35, -1, -1, -1, -1, -1, -1, -1, 4992, -1, 45, -1, 516, -1, -1, 1864, 1865, 52, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 1880, -1, -1, -1, -1, -1, 1480, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 4584, -1, -1, 5337, -1, -1, 409, -1, -1, -1, -1, 515, 516, -1, -1, 1914, 1915, 1916, 1917, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 5064, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4631, -1, 3096, 516, -1, 4636, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 5403, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 178, -1, -1, 1995, -1, -1, -1, -1, -1, 2001, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, 516, -1, -1, -1, 202, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5186, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5525, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, 4810, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, 1731, 35, -1, -1, 38, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -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, 78, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 5337, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, 2213, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, 6394, 4916, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5684, -1, -1, 1846, -1, 5689, 5690, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 5403, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 2694, -1, -1, 4970, -1, 1881, -1, -1, -1, -1, 35, -1, -1, 38, -1, 3445, -1, -1, 197, -1, 45, -1, -1, 202, -1, 4992, -1, 52, 1904, -1, -1, -1, -1, -1, -1, -1, 1912, -1, -1, -1, -1, -1, -1, -1, 1920, -1, 225, 226, 516, -1, -1, -1, -1, 78, 2748, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, 197, -1, 2766, -1, 253, 202, 2770, -1, -1, -1, 2774, -1, -1, -1, -1, -1, -1, 5804, 1964, 1965, 2784, -1, -1, -1, -1, -1, -1, 5064, 225, 226, -1, -1, 1978, -1, -1, 2799, -1, -1, 5525, -1, -1, -1, -1, -1, -1, 1991, 1992, 296, -1, -1, -1, -1, 2816, -1, 2818, 2819, 253, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, 2833, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 5872, -1, 2851, 2852, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 296, -1, -1, 197, -1, -1, 45, -1, 202, -1, -1, -1, -1, 52, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, 2889, 2890, -1, -1, 2893, 225, 226, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5186, -1, -1, -1, 2917, -1, 2919, -1, -1, 253, 2923, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2937, -1, -1, -1, -1, -1, -1, 2944, -1, -1, 2947, -1, -1, -1, -1, -1, 2953, -1, -1, -1, -1, -1, -1, -1, 5684, -1, -1, -1, 296, 5689, 5690, -1, -1, -1, -1, -1, 2973, -1, -1, 409, -1, -1, 2979, -1, 312, -1, -1, 315, -1, 2986, -1, -1, -1, -1, 3727, -1, 2175, -1, -1, -1, -1, -1, -1, 3000, 3737, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 445, -1, 3014, -1, -1, -1, -1, 3019, -1, 197, -1, -1, -1, 3025, 202, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, 856, 857, -1, -1, 5337, -1, -1, -1, -1, -1, -1, -1, 2660, -1, -1, -1, -1, 253, 409, -1, -1, 5804, -1, 516, -1, 3085, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, 35, -1, 5403, -1, -1, 929, -1, -1, 312, -1, 45, 315, -1, -1, -1, -1, 10, 52, -1, 13, -1, 5872, -1, 17, 18, 19, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, 3900, 3901, 3902, -1, -1, 35, -1, 78, -1, -1, -1, -1, -1, -1, -1, 45, -1, 3917, -1, -1, -1, 516, 52, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, 3950, 3951, -1, -1, -1, 3955, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, 2822, -1, -1, -1, -1, -1, -1, -1, 3242, -1, 3244, -1, -1, -1, -1, -1, -1, -1, 5525, -1, 1050, 1051, -1, -1, -1, -1, -1, 3261, -1, -1, -1, 3265, -1, -1, -1, -1, -1, 178, 3272, -1, -1, -1, -1, -1, -1, 3279, -1, 3281, 3282, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 178, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, 4074, -1, 516, -1, -1, -1, -1, -1, 253, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, 3369, -1, 6394, -1, -1, -1, 3375, -1, 2965, -1, -1, 2968, -1, -1, -1, -1, -1, -1, 253, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, 5684, -1, -1, -1, -1, 5689, 5690, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3057, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3070, -1, -1, -1, -1, -1, -1, -1, 3078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, 4241, 4242, 4243, -1, -1, -1, -1, 2694, -1, 1310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3117, -1, 5804, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, 3138, -1, -1, -1, -1, -1, 1352, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3579, 3580, -1, -1, -1, 2766, 1381, 1382, 1383, 2770, 1385, -1, -1, 2774, 3181, -1, 3183, -1, -1, -1, 5872, 3600, -1, 2784, 3603, -1, -1, -1, -1, -1, 516, 1406, -1, -1, -1, -1, -1, -1, 2799, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 516, 2833, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, 2851, 2852, 6394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3685, 3686, 3687, -1, 3277, 10, -1, -1, 13, -1, -1, 3284, 17, 18, 19, -1, 1497, -1, -1, -1, 1501, 1502, 2889, 2890, -1, 3710, 2893, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, 3729, -1, 10, 52, -1, 13, 2917, -1, 2919, 17, 18, 19, 2923, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3751, -1, -1, -1, 2937, 35, -1, 78, -1, -1, -1, 2944, -1, -1, 2947, 45, -1, -1, -1, -1, 2953, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2973, -1, -1, -1, -1, -1, 2979, -1, 78, -1, -1, -1, -1, 2986, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3000, -1, -1, -1, -1, -1, -1, 4561, -1, -1, -1, -1, -1, 10, 3014, -1, 13, -1, -1, 3019, 17, 18, 19, 3841, -1, 3025, -1, -1, -1, -1, -1, -1, -1, -1, 172, -1, -1, -1, 35, 4593, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, 151, 52, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, 3888, 4625, -1, -1, -1, -1, 3894, -1, 3896, -1, -1, 78, -1, -1, -1, 3085, -1, 225, 226, -1, -1, 3909, -1, 3911, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, 4660, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, 4677, -1, -1, -1, -1, 225, 226, -1, -1, 1746, 1747, 1748, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, 296, -1, 3978, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, 312, -1, -1, 315, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, 197, -1, 4020, 3609, 3610, 202, 78, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, 4049, -1, -1, -1, 4053, -1, -1, -1, -1, -1, -1, 3242, -1, 3244, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, 4077, -1, 3261, -1, -1, -1, 3265, 10, -1, -1, 13, -1, 409, 3272, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4839, 4840, 4841, 4842, -1, -1, 35, -1, -1, 38, -1, -1, -1, -1, 296, 172, 45, -1, 6394, -1, -1, -1, -1, 52, -1, -1, -1, 409, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4185, -1, 3369, -1, -1, -1, -1, -1, 3375, -1, -1, 516, -1, -1, 253, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, 296, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, 3863, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, 226, -1, -1, 2099, -1, -1, -1, -1, -1, -1, -1, 490, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, -1, -1, -1, -1, 2122, 253, 2124, -1, 2126, -1, -1, 2129, 2130, 2131, -1, 516, -1, -1, -1, 2137, -1, 4343, 2140, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 409, -1, -1, -1, 2155, 2156, 2157, -1, -1, -1, -1, -1, -1, -1, -1, 296, 10, -1, -1, 13, -1, -1, 2173, 17, 18, 19, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, 35, 3579, 3580, -1, -1, -1, -1, -1, -1, -1, 45, 4407, -1, -1, -1, -1, 4412, 52, 4414, -1, -1, -1, 3600, -1, -1, 3603, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4023, -1, -1, -1, 78, 4440, -1, -1, 5179, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5190, -1, -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 409, -1, -1, 4486, -1, -1, 4489, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3685, 3686, 3687, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2321, -1, -1, 3710, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, 3729, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, 3751, -1, -1, -1, -1, 78, -1, -1, -1, -1, 2375, 4580, 4581, -1, -1, -1, -1, 225, 226, -1, 1398, 516, 4591, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 4608, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1441, -1, -1, -1, 2432, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, 3841, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, 4704, -1, 3888, 4707, -1, -1, -1, -1, 3894, -1, 3896, -1, -1, -1, -1, -1, 20, 225, 226, -1, -1, -1, -1, 3909, -1, 3911, -1, 31, -1, 33, 34, -1, -1, -1, -1, -1, -1, -1, 5478, -1, -1, -1, -1, 5483, -1, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, 5502, -1, -1, -1, 409, -1, -1, 73, -1, 75, 76, -1, -1, -1, -1, -1, 82, -1, 84, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, 3978, 97, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, 119, -1, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, -1, 2627, -1, -1, 134, -1, 136, -1, 4020, -1, 140, -1, 2638, -1, 2640, -1, -1, 147, -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, -1, 159, -1, 2657, -1, -1, -1, 2661, 166, 4049, 2664, -1, 2666, 4053, -1, 2669, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, 184, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 4077, -1, -1, -1, -1, -1, 201, -1, -1, -1, 409, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2722, 2723, -1, 4929, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1752, -1, -1, -1, 1756, -1, 4537, -1, -1, -1, -1, -1, 255, 256, -1, -1, -1, -1, 261, -1, 4551, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 276, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4987, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, 4999, -1, -1, -1, 4185, -1, -1, 2802, -1, -1, -1, -1, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, -1, -1, -1, 5033, 5770, 335, -1, -1, -1, -1, -1, -1, -1, -1, -1, 345, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 360, -1, -1, 5799, -1, 365, 366, 41, 368, -1, -1, -1, -1, 373, -1, -1, 376, -1, -1, 379, -1, -1, 382, -1, -1, -1, -1, -1, -1, 389, -1, -1, 66, -1, -1, -1, 396, 397, -1, -1, -1, -1, -1, -1, 404, 79, -1, -1, 408, -1, -1, -1, 5112, -1, -1, -1, -1, -1, -1, 419, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, 5131, -1, -1, -1, -1, 436, -1, -1, -1, 114, -1, -1, -1, -1, -1, 120, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 457, -1, -1, -1, 4343, -1, -1, 138, -1, -1, -1, -1, 469, -1, -1, -1, 5909, -1, 475, -1, -1, 152, -1, 480, -1, -1, -1, -1, -1, -1, 161, -1, -1, -1, -1, -1, -1, 494, -1, -1, -1, -1, -1, 174, -1, -1, -1, -1, -1, -1, -1, -1, 183, -1, -1, -1, 187, -1, -1, -1, -1, 518, -1, -1, -1, -1, -1, -1, 4407, -1, -1, -1, 5229, 4412, -1, 4414, 207, -1, -1, -1, 537, -1, -1, 540, -1, -1, -1, -1, -1, -1, 3043, 3044, 3045, -1, -1, -1, 3049, -1, -1, -1, -1, 4440, 23, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3076, -1, -1, 257, -1, -1, -1, -1, 2097, -1, -1, -1, -1, 267, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, 4486, -1, -1, 4489, -1, -1, -1, -1, -1, -1, 2123, 79, 80, -1, 2127, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, -1, -1, -1, 96, 2142, 2143, 2144, -1, 2146, 312, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, 114, 5351, -1, 5353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 340, -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, -1, 354, -1, -1, -1, -1, -1, -1, 361, 152, -1, -1, -1, -1, -1, -1, -1, -1, 161, 4580, 4581, -1, -1, -1, -1, 5404, -1, -1, 381, -1, 4591, 174, -1, -1, -1, 5414, -1, 180, 391, -1, -1, -1, -1, -1, -1, 398, -1, 4608, 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 207, -1, -1, 28, 421, -1, -1, -1, -1, -1, -1, 5454, 429, 5044, -1, -1, 5459, -1, -1, 436, -1, -1, 439, -1, 441, -1, 443, 444, 5059, -1, -1, -1, -1, -1, -1, -1, -1, -1, 245, -1, -1, -1, 459, -1, -1, -1, -1, -1, -1, -1, 467, -1, 3291, 470, 79, -1, 473, 3296, -1, -1, 267, -1, -1, -1, -1, -1, -1, -1, -1, 486, -1, 96, -1, -1, -1, -1, -1, -1, -1, 4704, -1, -1, 4707, -1, -1, -1, -1, -1, -1, 114, -1, -1, -1, -1, -1, 120, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 3347, -1, -1, -1, -1, 138, -1, -1, -1, -1, -1, 3358, 5151, 3360, 3361, -1, -1, -1, -1, 152, -1, -1, -1, -1, -1, 340, -1, 3374, 161, -1, 3377, -1, 3379, -1, -1, 350, 351, -1, -1, 354, -1, 174, -1, -1, -1, -1, -1, 180, -1, -1, -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, -1, 3415, 384, 3417, -1, 3419, 388, 207, -1, 391, -1, -1, -1, -1, -1, -1, 398, -1, -1, 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 421, -1, -1, -1, -1, -1, 245, -1, 429, -1, -1, -1, -1, -1, -1, 436, -1, -1, 439, -1, -1, -1, -1, 444, -1, -1, -1, -1, 267, -1, -1, 452, -1, 454, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, -1, 5702, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3510, -1, 5716, -1, -1, 3515, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, -1, 3530, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4929, 5748, -1, -1, -1, -1, -1, -1, -1, -1, -1, 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3585, 5378, -1, 5380, -1, -1, -1, -1, -1, -1, 381, -1, -1, 384, -1, -1, 4987, 388, -1, -1, 391, -1, -1, -1, -1, -1, -1, 398, 4999, -1, 401, -1, -1, -1, -1, -1, 2634, -1, -1, -1, -1, -1, -1, -1, 5833, -1, -1, -1, -1, -1, 421, -1, -1, -1, -1, -1, -1, -1, 429, -1, 3645, -1, 5033, 434, -1, 436, -1, -1, 439, -1, -1, -1, -1, 444, -1, -1, -1, -1, -1, -1, 5869, -1, -1, 454, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 473, -1, -1, -1, -1, -1, -1, -1, -1, 2709, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, 2721, -1, -1, -1, -1, 2726, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5112, -1, 5520, -1, -1, -1, -1, -1, -1, 5939, -1, -1, 5942, -1, -1, -1, -1, -1, -1, 5131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5229, -1, -1, 3846, -1, -1, -1, -1, -1, 3852, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6089, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6103, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6113, -1, -1, -1, -1, 5706, -1, 5708, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3931, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5351, -1, 5353, -1, 6173, 6174, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5454, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4093, -1, -1, -1, -1, -1, -1, -1, -1, 4102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4116, -1, -1, -1, 4120, 4121, 4122, -1, -1, -1, -1, 4127, -1, -1, 4130, -1, -1, 4133, -1, -1, -1, -1, -1, 4139, -1, 4141, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4168, 4169, 4170, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4187, 5980, -1, -1, -1, -1, -1, -1, 4195, -1, -1, 4198, -1, 4200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4216, 6421, -1, -1, -1, -1, -1, -1, -1, 4225, 4226, -1, -1, -1, -1, -1, 4232, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4258, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6482, -1, -1, 3294, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6495, 6496, -1, -1, -1, -1, -1, 3311, -1, -1, -1, -1, 6507, -1, -1, -1, -1, 3321, 4309, -1, -1, -1, -1, 3327, -1, 5702, 3330, -1, -1, -1, -1, -1, 6115, 3337, 3338, -1, 3340, -1, -1, 5716, -1, 3345, 3346, -1, 3348, -1, 3350, -1, -1, -1, 3354, -1, -1, 3357, -1, -1, -1, -1, 3362, -1, -1, -1, -1, -1, -1, -1, -1, 3371, -1, -1, -1, 5748, 3376, -1, -1, -1, -1, -1, -1, 3383, 3384, 3385, 3386, -1, -1, -1, -1, 3391, 3392, -1, 3394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3412, -1, 3414, -1, -1, -1, -1, -1, -1, 3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5833, -1, -1, -1, 3464, -1, -1, -1, -1, -1, -1, 6250, -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, 6283, 6284, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5939, -1, -1, 5942, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3594, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6411, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4637, 4638, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4648, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4691, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6089, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6113, -1, -1, -1, -1, -1, -1, 4734, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4768, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4807, 4808, -1, -1, -1, -1, -1, 4814, 4815, -1, -1, -1, 4819, -1, -1, -1, -1, 4824, -1, -1, 4827, -1, 4829, -1, -1, -1, -1, -1, 4835, -1, 3850, 3851, -1, -1, -1, 3855, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6256, 3884, -1, -1, -1, -1, -1, -1, -1, 4879, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4892, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4934, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5015, -1, -1, -1, -1, -1, -1, 5022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6421, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4092, -1, -1, -1, -1, -1, 4098, -1, -1, -1, -1, 5090, -1, -1, -1, -1, -1, 6482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4145, 4146, -1, -1, 4149, 4150, 4151, 4152, -1, -1, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4188, -1, -1, 4191, -1, 4193, -1, -1, 4196, 4197, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4218, 4219, 4220, 4221, -1, -1, 4224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5255, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, 5271, 5272, 5273, -1, -1, -1, -1, 4291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5296, 5297, -1, -1, -1, 5301, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4326, -1, -1, -1, 5317, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5338, -1, -1, -1, -1, -1, -1, -1, 5346, -1, 4361, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4553, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5553, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4597, -1, -1, 5587, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5632, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5678, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4735, -1, -1, -1, 4739, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5736, -1, -1, 4752, -1, -1, -1, -1, -1, -1, -1, 4760, -1, 4762, -1, 4764, 4765, -1, -1, -1, -1, 4770, 4771, 4772, 4773, -1, -1, -1, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4813, -1, -1, 4816, -1, 4818, -1, -1, -1, 4822, -1, -1, 4825, 4826, -1, -1, -1, 4830, 4831, -1, -1, -1, -1, 4836, -1, -1, -1, -1, -1, -1, -1, -1, 5832, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5844, -1, -1, -1, -1, -1, -1, -1, -1, 5853, 5854, 5855, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4889, -1, -1, -1, -1, 5881, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5894, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6076, -1, -1, -1, 5093, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5181, 5182, -1, -1, -1, -1, -1, -1, 5189, -1, -1, 6179, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5214, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5244, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5267, 5268, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5286, -1, 5288, -1, -1, -1, 5292, 5293, 5294, 5295, -1, -1, 5298, -1, 5300, -1, -1, -1, -1, 5305, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5321, -1, -1, -1, -1, -1, 6314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5339, -1, -1, -1, 6330, -1, -1, -1, 5347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5425, -1, 5427, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5462, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6461, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5580, -1, 5582, 5583, 5584, 5585, 5586, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5599, 5600, 5601, -1, -1, -1, -1, -1, -1, -1, 5609, -1, -1, -1, -1, 5614, -1, -1, 5617, -1, -1, -1, 5621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5639, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5829, -1, -1, -1, -1, 5834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5845, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5866, -1, 5868, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5913, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5961, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6047, -1, -1, -1, -1, -1, -1, 6054, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6086, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6213, 6214, -1, -1, 6217, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6305, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6324, 6325, -1, 6327, -1, -1, -1, -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, 6396, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, 530, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 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, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, 518, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, -1, -1, 537, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, -1, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 538, 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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, 538, 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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, 512, 513, 514, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, 538, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 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, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, 518, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 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, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, 518, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, 178, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 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, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 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, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 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, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, -1, -1, 535, 536, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, 530, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 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, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, 178, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, 449, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -1, -1, -1, 3, -1, 5, 6, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, 3, -1, 5, 6, -1, 8, 9, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, 3, -1, 5, 6, -1, 8, 9, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, -1, 11, 12, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, -1, 11, 12, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 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, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, 518, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 528, 529, 530, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 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, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, -1, -1, 518, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, 518, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 537, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, -1, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, -1, 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, -1, 222, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, -1, 273, 274, -1, 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, -1, 307, 308, 309, -1, 311, 312, 313, 314, 315, -1, 317, 318, 319, 320, -1, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, -1, 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, -1, 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, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, -1, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, -1, 484, 485, 486, 487, 488, 489, 490, -1, 492, -1, -1, -1, -1, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, 514, -1, 516, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 157, -1, 159, 160, 161, 162, -1, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, -1, 187, -1, 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, -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, -1, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, -1, 292, 293, 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, -1, 342, -1, 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, -1, 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, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, -1, 454, -1, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 157, -1, 159, 160, 161, 162, -1, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, -1, 187, -1, 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, -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, -1, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, -1, 292, 293, 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, -1, 342, -1, 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, -1, 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, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, -1, 454, -1, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, 528, 529, 530, 531, 532, 533, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, 316, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 530, 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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, 316, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, 530, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, 178, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 528, 529, -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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 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, 333, 334, -1, 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, 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, 333, 334, -1, 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, 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, 333, 334, -1, 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, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, 435, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, 187, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, 310, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, 251, 252, 253, -1, 255, 256, 257, -1, -1, 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, -1, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 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, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 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, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 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, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, 467, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 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, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 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, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 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, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 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, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, 473, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, 436, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, -1, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, 189, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, -1, -1, -1, 180, 181, 182, 183, -1, 185, 186, -1, 188, -1, 190, -1, 192, 193, 194, 195, 196, -1, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, -1, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, 250, -1, 252, -1, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, 294, 295, -1, 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, -1, 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, -1, 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, -1, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, -1, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, -1, 433, 434, -1, -1, 437, -1, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, 453, 454, 455, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, 480, 481, -1, 483, -1, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, 172, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, 172, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, 170, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, 219, 220, -1, 222, -1, 224, 225, 226, 227, 228, 229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, 301, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, -1, 407, 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514, -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, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, 162, -1, -1, 165, -1, 167, 168, 169, -1, 171, -1, 173, -1, 175, 176, 177, -1, 179, 180, 181, 182, 183, -1, 185, -1, -1, -1, 189, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, -1, 215, 216, 217, 218, -1, -1, -1, -1, -1, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, 241, 242, 243, 244, 245, 246, -1, -1, 249, -1, 251, 252, 253, -1, 255, 256, 257, -1, -1, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, -1, -1, 292, -1, 294, 295, 296, 297, -1, -1, 300, -1, 302, 303, 304, 305, -1, 307, 308, 309, -1, -1, 312, 313, 314, -1, -1, 317, 318, -1, 320, 321, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, 339, 340, -1, 342, -1, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, -1, 360, 361, 362, -1, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, 380, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, -1, 404, 405, -1, 407, 408, 409, 410, 411, -1, 413, -1, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, -1, 433, 434, -1, -1, 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, -1, -1, -1, -1, 451, 452, -1, 454, -1, -1, 457, 458, 459, 460, 461, 462, 463, 464, 465, -1, -1, 468, 469, 470, 471, 472, -1, -1, 475, 476, 477, 478, 479, -1, -1, -1, 483, 484, 485, 486, 487, 488, 489, -1, -1, 492, -1, -1, 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 512, 513, 514 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_int16 yystos[] = { 0, 20, 31, 33, 34, 51, 61, 73, 75, 76, 82, 84, 97, 99, 116, 119, 134, 136, 140, 147, 157, 159, 166, 184, 201, 255, 256, 261, 276, 295, 335, 345, 360, 365, 366, 368, 373, 379, 382, 389, 396, 397, 404, 408, 419, 436, 457, 469, 475, 480, 494, 518, 520, 521, 522, 523, 524, 537, 544, 545, 546, 547, 552, 553, 559, 560, 562, 563, 564, 565, 567, 570, 582, 587, 588, 591, 592, 593, 613, 616, 617, 632, 687, 690, 691, 694, 697, 698, 699, 707, 714, 716, 717, 720, 723, 724, 728, 737, 741, 742, 743, 746, 748, 749, 750, 751, 759, 761, 781, 785, 787, 788, 798, 800, 806, 807, 810, 811, 812, 813, 814, 823, 825, 827, 830, 834, 835, 845, 846, 851, 856, 867, 899, 902, 903, 904, 909, 912, 914, 916, 918, 919, 923, 924, 927, 929, 930, 934, 935, 936, 939, 940, 941, 942, 943, 950, 952, 953, 954, 955, 961, 963, 964, 970, 971, 972, 975, 976, 977, 978, 980, 981, 983, 984, 986, 987, 989, 1001, 1003, 1006, 1008, 1010, 1023, 1025, 1031, 1036, 1046, 1050, 1051, 1052, 1053, 1054, 1055, 1061, 1097, 451, 497, 956, 28, 79, 96, 114, 120, 138, 152, 161, 174, 180, 187, 207, 245, 267, 312, 340, 350, 351, 354, 381, 384, 388, 391, 398, 401, 421, 429, 434, 436, 439, 444, 454, 459, 473, 486, 713, 956, 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, 152, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 165, 167, 168, 169, 170, 171, 173, 175, 176, 177, 179, 180, 181, 182, 183, 185, 186, 188, 189, 190, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 209, 210, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 249, 250, 251, 252, 253, 255, 256, 257, 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, 294, 295, 296, 297, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 312, 313, 314, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 398, 399, 400, 401, 402, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 433, 434, 437, 438, 439, 440, 441, 442, 443, 444, 446, 447, 448, 451, 452, 453, 454, 455, 457, 458, 459, 460, 461, 462, 463, 464, 465, 468, 469, 470, 471, 472, 475, 476, 477, 478, 479, 480, 481, 483, 484, 485, 486, 487, 488, 489, 492, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1165, 1257, 1269, 1270, 1274, 1275, 1276, 3, 29, 1047, 1254, 1269, 1274, 484, 537, 994, 310, 346, 956, 54, 537, 624, 23, 41, 66, 79, 114, 120, 138, 152, 161, 174, 183, 187, 257, 312, 315, 340, 354, 381, 391, 401, 421, 429, 439, 441, 443, 444, 459, 467, 470, 473, 633, 696, 803, 857, 868, 29, 345, 1254, 1047, 29, 339, 399, 441, 443, 6, 244, 910, 911, 1260, 23, 28, 66, 79, 96, 114, 138, 152, 161, 174, 180, 187, 207, 267, 312, 325, 340, 351, 354, 381, 384, 388, 391, 398, 401, 421, 429, 436, 439, 444, 452, 454, 459, 473, 486, 713, 815, 817, 818, 956, 1254, 99, 484, 537, 691, 694, 697, 989, 1002, 1006, 1009, 1023, 1030, 1036, 1046, 1050, 1061, 11, 22, 29, 49, 169, 176, 178, 202, 246, 284, 348, 367, 528, 529, 831, 832, 1047, 1259, 1261, 29, 31, 99, 363, 397, 836, 837, 838, 1269, 174, 1269, 1256, 1260, 436, 1064, 831, 1269, 67, 278, 373, 381, 391, 402, 404, 408, 447, 451, 500, 572, 573, 574, 1269, 451, 1254, 325, 267, 537, 922, 389, 1269, 29, 402, 447, 451, 574, 583, 584, 184, 836, 837, 1269, 346, 956, 1269, 243, 29, 135, 1066, 1067, 93, 257, 402, 404, 451, 571, 573, 29, 402, 447, 451, 574, 451, 311, 1109, 1110, 1252, 1269, 1064, 530, 1269, 179, 537, 995, 537, 361, 1056, 1057, 1254, 1056, 3, 53, 55, 56, 69, 70, 117, 118, 139, 170, 219, 220, 222, 229, 279, 281, 301, 359, 406, 412, 447, 448, 481, 1138, 1140, 1142, 1144, 1146, 1148, 1149, 1150, 1152, 1153, 1154, 1156, 1157, 1161, 1270, 1274, 1066, 1067, 1068, 1265, 12, 1266, 1267, 1269, 1266, 1266, 1051, 1052, 1055, 0, 540, 537, 994, 153, 221, 316, 466, 1069, 1070, 1051, 1053, 1054, 125, 217, 269, 472, 541, 35, 960, 884, 1257, 820, 1269, 820, 1254, 349, 820, 454, 1254, 113, 436, 872, 1257, 1269, 1276, 3, 106, 110, 403, 1262, 1263, 1271, 1274, 1275, 1276, 29, 196, 1252, 302, 486, 10, 17, 18, 19, 74, 165, 525, 526, 527, 528, 529, 530, 531, 532, 533, 906, 908, 1196, 1197, 1269, 196, 1254, 872, 1254, 29, 1262, 1263, 872, 1254, 1254, 196, 1252, 1254, 196, 820, 1254, 373, 404, 29, 196, 1109, 1254, 394, 1254, 820, 29, 264, 1262, 1263, 196, 1252, 244, 122, 227, 293, 358, 957, 958, 959, 537, 535, 539, 1221, 1223, 515, 988, 989, 990, 991, 1271, 1252, 1254, 1269, 28, 66, 80, 92, 114, 138, 180, 207, 245, 312, 351, 381, 384, 429, 439, 452, 459, 815, 816, 817, 818, 1260, 960, 1005, 1009, 1023, 1030, 1036, 1050, 1252, 271, 820, 537, 196, 820, 1254, 820, 454, 196, 1254, 113, 436, 441, 443, 1262, 1263, 441, 443, 74, 165, 906, 371, 1254, 1254, 1262, 196, 548, 1269, 196, 1254, 196, 549, 820, 1254, 1254, 394, 820, 264, 1262, 361, 398, 436, 486, 267, 96, 207, 28, 92, 180, 351, 388, 452, 454, 458, 708, 29, 1254, 1048, 581, 1260, 1271, 911, 271, 196, 884, 885, 196, 915, 196, 1254, 196, 822, 1138, 454, 113, 436, 196, 871, 872, 196, 1263, 1264, 87, 486, 74, 165, 196, 907, 908, 59, 196, 871, 196, 1264, 196, 871, 196, 1254, 196, 1254, 394, 915, 196, 822, 196, 264, 1264, 244, 196, 819, 820, 196, 1253, 1254, 196, 1254, 960, 537, 1007, 633, 1002, 480, 988, 994, 217, 472, 1261, 832, 833, 29, 833, 1261, 833, 29, 833, 1261, 833, 833, 833, 1261, 1259, 1259, 1047, 833, 349, 537, 434, 537, 662, 662, 662, 310, 449, 541, 662, 391, 1109, 1111, 541, 951, 1260, 120, 580, 1260, 584, 581, 1260, 48, 60, 572, 574, 29, 574, 514, 413, 313, 178, 449, 527, 539, 1260, 537, 1004, 59, 486, 988, 114, 207, 391, 434, 436, 920, 921, 1269, 48, 514, 227, 313, 310, 178, 313, 1260, 449, 960, 172, 828, 310, 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, 158, 163, 164, 170, 186, 188, 219, 220, 222, 229, 230, 231, 232, 233, 234, 235, 236, 237, 239, 250, 258, 259, 270, 279, 281, 291, 293, 298, 299, 301, 312, 323, 341, 359, 386, 403, 412, 430, 435, 447, 448, 453, 455, 456, 467, 473, 481, 502, 503, 504, 505, 507, 508, 509, 510, 516, 528, 529, 530, 537, 1051, 1141, 1144, 1147, 1148, 1149, 1151, 1152, 1153, 1156, 1157, 1161, 1162, 1164, 1165, 1166, 1168, 1192, 1193, 1194, 1198, 1215, 1220, 1246, 1249, 1250, 1257, 1258, 1259, 1260, 1269, 1248, 1249, 29, 589, 1251, 1252, 402, 571, 71, 571, 60, 958, 48, 514, 227, 959, 537, 1252, 530, 1223, 1111, 988, 177, 996, 1162, 1201, 1056, 541, 537, 997, 483, 1155, 1155, 1155, 537, 1143, 1143, 343, 537, 1145, 69, 70, 1155, 1143, 1140, 518, 519, 537, 1158, 537, 1158, 37, 1139, 537, 115, 194, 272, 275, 395, 512, 537, 1159, 1160, 539, 821, 1143, 1248, 1224, 538, 538, 546, 988, 998, 999, 1000, 1109, 29, 135, 1065, 1065, 59, 1065, 166, 172, 254, 306, 1073, 1075, 1076, 1091, 1093, 1094, 1095, 1069, 1070, 178, 223, 223, 1109, 1112, 537, 68, 289, 326, 369, 404, 537, 882, 326, 365, 369, 404, 821, 326, 369, 404, 3, 91, 145, 260, 326, 335, 365, 369, 404, 439, 442, 494, 582, 585, 965, 966, 967, 968, 852, 25, 140, 326, 369, 404, 477, 598, 1254, 25, 140, 404, 472, 566, 498, 196, 1109, 62, 98, 162, 199, 249, 289, 293, 326, 327, 369, 378, 387, 396, 404, 417, 426, 431, 489, 582, 586, 888, 900, 928, 537, 869, 1223, 369, 566, 202, 158, 25, 31, 46, 76, 133, 140, 144, 173, 209, 289, 293, 304, 314, 326, 369, 372, 373, 404, 477, 594, 596, 597, 731, 928, 5, 528, 529, 705, 1261, 29, 196, 1252, 820, 820, 537, 905, 326, 404, 539, 158, 310, 326, 369, 404, 900, 928, 25, 140, 326, 369, 404, 202, 561, 369, 494, 518, 554, 561, 326, 369, 404, 900, 928, 310, 326, 369, 158, 38, 60, 112, 205, 263, 268, 273, 289, 325, 369, 374, 398, 404, 419, 470, 594, 702, 703, 326, 369, 485, 731, 739, 158, 326, 369, 404, 25, 91, 133, 140, 144, 326, 365, 369, 404, 411, 584, 572, 202, 158, 46, 131, 289, 369, 404, 594, 595, 326, 369, 373, 404, 89, 132, 329, 442, 310, 25, 31, 140, 326, 369, 404, 614, 615, 561, 172, 369, 554, 561, 158, 369, 404, 594, 1254, 252, 122, 311, 499, 541, 957, 29, 135, 482, 530, 538, 877, 1162, 1202, 1203, 1270, 1162, 1222, 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, 153, 164, 166, 172, 174, 178, 184, 187, 191, 202, 211, 221, 223, 247, 248, 254, 258, 259, 293, 298, 306, 310, 311, 315, 316, 337, 347, 363, 377, 397, 403, 414, 432, 435, 436, 445, 449, 450, 456, 466, 467, 473, 474, 482, 490, 491, 493, 494, 530, 1255, 1272, 1274, 1275, 1276, 1277, 1221, 538, 541, 164, 310, 456, 578, 581, 705, 992, 474, 985, 310, 884, 537, 820, 1254, 1138, 872, 302, 74, 165, 908, 872, 872, 172, 1138, 820, 1254, 1254, 538, 662, 1254, 72, 1138, 293, 178, 537, 789, 554, 38, 979, 1254, 293, 554, 498, 196, 1252, 554, 820, 820, 789, 470, 633, 310, 172, 494, 896, 554, 293, 48, 568, 293, 459, 738, 293, 997, 91, 326, 715, 89, 132, 329, 442, 38, 789, 172, 196, 554, 486, 196, 1252, 196, 692, 1252, 1252, 486, 820, 87, 550, 1257, 454, 1257, 1257, 1254, 172, 1254, 713, 40, 54, 111, 216, 289, 393, 158, 63, 375, 541, 551, 158, 537, 158, 554, 158, 541, 551, 498, 158, 541, 551, 158, 541, 196, 819, 196, 820, 196, 820, 158, 541, 551, 1264, 158, 551, 158, 158, 551, 158, 551, 158, 89, 132, 329, 442, 172, 158, 551, 158, 172, 196, 158, 541, 551, 158, 541, 551, 158, 310, 1201, 436, 538, 1002, 223, 1112, 833, 1047, 833, 1047, 833, 1047, 833, 1047, 833, 1047, 1047, 1047, 833, 1047, 537, 663, 666, 1269, 663, 29, 114, 138, 174, 180, 244, 245, 328, 351, 384, 391, 398, 436, 439, 459, 841, 1251, 1264, 838, 1254, 202, 541, 1026, 1260, 120, 581, 125, 3, 120, 257, 579, 705, 1157, 1260, 1260, 94, 137, 1174, 103, 120, 575, 576, 578, 705, 120, 575, 1269, 1138, 1205, 38, 1264, 550, 538, 550, 550, 550, 252, 172, 841, 1264, 172, 389, 1269, 581, 310, 537, 1224, 535, 1051, 1206, 1162, 1219, 537, 537, 172, 537, 537, 1051, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 1162, 537, 537, 537, 537, 537, 537, 537, 537, 300, 649, 537, 537, 537, 537, 537, 537, 537, 537, 1162, 1162, 1162, 1051, 1162, 1201, 1223, 1260, 537, 1260, 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, 152, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 168, 169, 170, 171, 173, 174, 175, 176, 177, 179, 180, 181, 182, 183, 185, 186, 188, 189, 190, 192, 193, 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, 222, 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, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 273, 274, 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, 307, 308, 309, 311, 312, 313, 314, 315, 317, 318, 319, 320, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 336, 337, 338, 339, 340, 341, 342, 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, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 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, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 484, 485, 486, 487, 488, 489, 490, 492, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 513, 514, 516, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1196, 1198, 1200, 1273, 1278, 495, 1179, 322, 1162, 167, 1180, 223, 541, 1062, 537, 1260, 1223, 1062, 123, 198, 590, 541, 71, 38, 252, 1252, 95, 374, 824, 538, 994, 35, 45, 52, 78, 197, 202, 225, 253, 312, 315, 409, 538, 541, 1057, 1253, 38, 537, 1201, 1259, 1155, 1155, 37, 1139, 447, 447, 1259, 1259, 535, 535, 1259, 449, 449, 449, 537, 449, 1259, 1255, 539, 1143, 178, 1098, 15, 527, 1221, 1268, 538, 541, 997, 1053, 1053, 1071, 1072, 1162, 1053, 169, 284, 1082, 241, 289, 358, 407, 472, 29, 1077, 1162, 528, 529, 1078, 1079, 1162, 1164, 1091, 1092, 1076, 1075, 1073, 1074, 172, 1094, 304, 1096, 1073, 1091, 1112, 1011, 1252, 1112, 38, 1269, 1201, 68, 449, 449, 391, 202, 214, 316, 319, 406, 482, 530, 875, 876, 877, 879, 881, 883, 1138, 1270, 449, 485, 449, 391, 449, 449, 391, 254, 449, 373, 79, 449, 439, 571, 326, 965, 967, 527, 969, 172, 184, 202, 379, 853, 854, 72, 92, 293, 658, 659, 92, 120, 293, 449, 92, 449, 120, 293, 391, 92, 133, 144, 326, 369, 786, 391, 721, 28, 66, 138, 180, 312, 351, 384, 452, 459, 815, 816, 1254, 158, 369, 404, 594, 310, 705, 396, 249, 449, 1269, 449, 298, 705, 124, 224, 391, 573, 820, 375, 404, 888, 901, 128, 538, 870, 875, 449, 473, 439, 1252, 72, 80, 92, 154, 174, 196, 293, 347, 467, 640, 656, 657, 1269, 80, 92, 925, 331, 310, 386, 388, 454, 92, 925, 32, 372, 386, 388, 454, 386, 1252, 173, 209, 304, 820, 537, 449, 449, 195, 537, 602, 23, 263, 439, 470, 496, 602, 92, 541, 128, 5, 5, 326, 202, 158, 369, 404, 594, 928, 474, 474, 290, 1138, 449, 391, 537, 906, 1254, 1252, 449, 449, 391, 901, 128, 107, 436, 437, 937, 938, 1110, 1252, 1269, 938, 449, 449, 789, 938, 114, 404, 585, 449, 556, 585, 449, 449, 391, 901, 128, 1252, 449, 449, 1252, 1140, 705, 59, 704, 705, 705, 112, 268, 273, 59, 449, 554, 277, 391, 554, 289, 703, 449, 449, 298, 1260, 731, 820, 449, 449, 391, 421, 354, 1260, 354, 449, 354, 449, 354, 789, 789, 439, 1109, 331, 331, 92, 449, 925, 391, 449, 449, 602, 602, 820, 820, 820, 820, 1252, 47, 479, 47, 47, 479, 449, 47, 449, 479, 391, 537, 541, 585, 473, 747, 1263, 449, 556, 585, 1252, 449, 925, 391, 326, 369, 358, 370, 400, 577, 957, 1202, 1202, 1203, 538, 15, 16, 541, 1069, 1070, 536, 542, 1252, 990, 1254, 1252, 225, 1138, 225, 310, 225, 225, 705, 820, 820, 225, 225, 225, 1138, 225, 225, 225, 310, 449, 178, 449, 618, 459, 537, 38, 158, 820, 790, 791, 1272, 965, 1138, 310, 158, 718, 1254, 293, 331, 537, 555, 803, 474, 361, 486, 1252, 29, 938, 789, 555, 158, 1263, 99, 184, 569, 632, 698, 761, 834, 856, 961, 158, 1260, 739, 740, 158, 310, 1260, 1263, 260, 820, 820, 820, 820, 149, 357, 537, 747, 293, 555, 1252, 293, 700, 702, 293, 38, 304, 331, 537, 662, 662, 196, 695, 1252, 172, 196, 548, 1269, 537, 793, 882, 1254, 537, 873, 873, 38, 1138, 27, 50, 218, 762, 244, 494, 496, 1049, 393, 885, 884, 1138, 1254, 537, 822, 1138, 871, 872, 1264, 1263, 158, 551, 158, 474, 158, 474, 907, 908, 551, 871, 1264, 871, 1254, 1254, 1138, 822, 1264, 747, 158, 819, 820, 1253, 1254, 1254, 820, 538, 196, 1252, 1002, 1011, 404, 1047, 1047, 1047, 1047, 1047, 1047, 663, 538, 541, 538, 181, 352, 385, 399, 437, 1253, 819, 113, 401, 871, 1253, 302, 839, 840, 1269, 871, 871, 1253, 1251, 1251, 1253, 819, 449, 185, 494, 850, 153, 254, 744, 745, 23, 156, 386, 407, 1027, 1109, 297, 1028, 1260, 537, 1260, 541, 538, 541, 1005, 449, 1252, 1254, 1252, 548, 836, 837, 178, 850, 837, 1269, 28, 80, 138, 180, 245, 351, 384, 459, 815, 816, 1201, 536, 1201, 1206, 1207, 490, 1216, 1217, 1162, 1201, 537, 1259, 1259, 3, 115, 194, 272, 275, 395, 512, 1208, 1209, 1260, 1201, 1201, 1162, 1234, 377, 1051, 1052, 1234, 1238, 1245, 1234, 1234, 1162, 1164, 1202, 1238, 1241, 1242, 1162, 1242, 1234, 1162, 1234, 1234, 1201, 1259, 1259, 538, 1162, 1162, 906, 1162, 1202, 1204, 1211, 386, 528, 529, 537, 1163, 1164, 1198, 1212, 538, 1201, 1162, 1204, 1213, 1162, 57, 178, 248, 450, 1162, 1201, 1214, 135, 293, 1051, 1201, 277, 1164, 1162, 1172, 1173, 1174, 277, 1162, 1174, 538, 541, 1259, 1159, 1138, 1162, 1162, 1162, 1162, 1272, 257, 447, 43, 432, 1225, 820, 1162, 537, 1051, 135, 137, 164, 229, 285, 286, 287, 288, 292, 293, 298, 456, 468, 1210, 1239, 1162, 537, 1162, 449, 52, 197, 202, 253, 409, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 29, 36, 414, 1195, 187, 1180, 386, 537, 1192, 537, 321, 1184, 183, 257, 436, 441, 443, 470, 1063, 1252, 1250, 1098, 1202, 1098, 1252, 451, 538, 195, 195, 551, 1000, 989, 993, 1162, 538, 267, 293, 1058, 1201, 538, 538, 535, 514, 514, 538, 538, 1259, 536, 1259, 538, 194, 272, 1160, 272, 1160, 1160, 1259, 275, 538, 1255, 229, 238, 247, 387, 511, 537, 1051, 1099, 1100, 1101, 1109, 1115, 1125, 1132, 1165, 1167, 1168, 1246, 1269, 491, 1120, 1265, 1000, 998, 541, 39, 130, 474, 865, 386, 387, 528, 529, 1079, 1081, 1164, 407, 241, 311, 541, 5, 1080, 1259, 1080, 386, 387, 1081, 1251, 297, 411, 1029, 1092, 1074, 474, 1024, 38, 474, 1269, 538, 1263, 1254, 1254, 319, 59, 1270, 538, 877, 879, 876, 879, 1270, 316, 538, 541, 821, 1263, 1254, 1254, 1263, 1254, 1254, 1263, 485, 1254, 1254, 120, 578, 705, 381, 473, 836, 391, 184, 836, 537, 1254, 298, 196, 1254, 298, 1263, 1254, 1254, 1162, 298, 1254, 1254, 32, 372, 449, 449, 1254, 449, 722, 884, 537, 1138, 872, 74, 165, 908, 872, 872, 172, 1138, 820, 1254, 190, 289, 326, 369, 478, 725, 726, 727, 1109, 449, 925, 391, 298, 124, 224, 1263, 1254, 310, 1254, 310, 538, 541, 1262, 1264, 1254, 369, 594, 537, 196, 640, 1254, 474, 858, 241, 293, 298, 241, 474, 649, 686, 1138, 1254, 1259, 1269, 1252, 1254, 252, 1254, 29, 473, 1254, 196, 1254, 196, 1269, 388, 454, 388, 454, 252, 1254, 29, 473, 1254, 252, 386, 1252, 25, 140, 404, 732, 733, 734, 735, 1272, 1263, 1254, 120, 179, 294, 474, 601, 604, 605, 1272, 271, 1254, 76, 307, 1254, 597, 310, 449, 439, 1252, 449, 925, 391, 128, 1254, 1254, 541, 538, 541, 1263, 1254, 931, 932, 1272, 310, 369, 449, 755, 1263, 1254, 1254, 310, 1109, 202, 541, 662, 662, 1223, 1263, 1254, 1254, 1262, 3, 91, 146, 209, 333, 465, 473, 476, 557, 1263, 1254, 1254, 310, 369, 1263, 1254, 369, 404, 594, 702, 705, 820, 1254, 705, 820, 1254, 705, 1263, 1254, 404, 1263, 1254, 1254, 120, 608, 1261, 1253, 1253, 1263, 896, 1254, 1253, 1254, 369, 404, 594, 595, 1252, 1252, 1254, 1254, 1254, 1254, 1263, 1254, 25, 31, 140, 326, 369, 404, 326, 369, 404, 789, 369, 404, 369, 404, 369, 928, 1124, 1269, 196, 799, 1269, 196, 1269, 1260, 1263, 1254, 1254, 1260, 1254, 931, 25, 140, 615, 401, 1262, 369, 404, 594, 1254, 1254, 1254, 449, 449, 85, 464, 358, 541, 1069, 1069, 1069, 1162, 1162, 482, 1203, 538, 1162, 1222, 985, 298, 826, 1260, 38, 826, 138, 820, 826, 826, 225, 474, 474, 826, 826, 826, 244, 826, 826, 826, 820, 353, 619, 619, 207, 436, 760, 1162, 1138, 820, 538, 541, 527, 646, 1272, 1254, 63, 178, 391, 485, 719, 726, 727, 158, 304, 253, 634, 636, 638, 640, 653, 656, 26, 202, 381, 433, 557, 558, 172, 1254, 486, 1252, 38, 756, 437, 896, 548, 1269, 568, 633, 868, 1254, 174, 820, 537, 688, 689, 1167, 1269, 354, 1260, 789, 789, 789, 789, 537, 789, 1122, 1123, 1124, 401, 158, 537, 158, 158, 157, 1050, 820, 304, 634, 1269, 474, 681, 494, 603, 293, 38, 662, 1260, 293, 310, 3, 794, 795, 789, 27, 538, 874, 875, 880, 38, 244, 378, 452, 493, 886, 887, 888, 889, 886, 310, 244, 304, 125, 217, 457, 472, 763, 764, 1254, 193, 193, 172, 551, 38, 554, 173, 973, 974, 551, 551, 819, 820, 1254, 820, 1254, 551, 551, 551, 551, 244, 551, 401, 172, 551, 551, 310, 551, 293, 120, 324, 537, 1012, 1050, 537, 1032, 1033, 1034, 1269, 538, 666, 202, 202, 202, 202, 202, 498, 1253, 705, 706, 541, 539, 187, 842, 843, 1263, 59, 847, 848, 1272, 449, 537, 178, 156, 407, 156, 407, 386, 472, 274, 1259, 1159, 576, 1138, 1263, 494, 693, 310, 842, 551, 178, 884, 820, 1138, 872, 302, 872, 872, 1138, 820, 1254, 538, 536, 536, 541, 1162, 142, 1217, 1218, 38, 538, 1162, 538, 538, 538, 178, 538, 538, 515, 1235, 1236, 494, 496, 1240, 1138, 1236, 538, 21, 298, 541, 1244, 316, 1247, 541, 542, 479, 538, 538, 21, 298, 541, 1243, 1243, 541, 538, 1238, 541, 538, 538, 538, 538, 541, 541, 538, 337, 538, 538, 537, 1163, 1163, 1201, 13, 17, 18, 19, 202, 225, 312, 525, 526, 527, 528, 529, 530, 531, 532, 533, 1198, 1163, 538, 538, 172, 178, 409, 538, 538, 38, 1214, 1201, 1214, 1214, 178, 538, 135, 538, 1272, 332, 1177, 38, 538, 541, 1162, 1272, 541, 1162, 1224, 1162, 538, 514, 1163, 1163, 151, 1201, 178, 37, 302, 390, 479, 135, 137, 164, 292, 298, 456, 468, 1210, 1239, 292, 1240, 151, 906, 1162, 432, 1225, 1162, 537, 1051, 1162, 449, 537, 1051, 537, 1184, 537, 1201, 491, 537, 1185, 1269, 441, 443, 441, 443, 1252, 1064, 1064, 1064, 1120, 1069, 1120, 958, 1000, 267, 537, 538, 1259, 1158, 1158, 536, 536, 538, 537, 1051, 1115, 1125, 1132, 178, 537, 1051, 1100, 1101, 38, 1102, 1103, 1269, 541, 100, 179, 213, 228, 251, 280, 380, 1106, 1103, 38, 1102, 1105, 1269, 1103, 1103, 518, 1119, 1223, 1162, 187, 1083, 1072, 312, 1196, 1199, 517, 866, 5, 1259, 1081, 311, 494, 472, 1078, 262, 1099, 491, 1121, 1269, 1100, 883, 821, 879, 879, 59, 881, 532, 1264, 1264, 310, 1253, 313, 310, 1162, 659, 779, 158, 551, 449, 1263, 1254, 581, 1138, 820, 820, 1138, 709, 1254, 190, 478, 449, 449, 709, 725, 731, 369, 404, 594, 1254, 1254, 1254, 215, 298, 161, 875, 325, 404, 449, 1162, 293, 154, 657, 1254, 537, 537, 158, 1269, 537, 686, 207, 537, 779, 424, 644, 645, 209, 779, 404, 25, 140, 373, 374, 404, 598, 606, 607, 731, 926, 396, 158, 551, 158, 551, 1254, 1254, 1254, 1254, 396, 396, 252, 734, 735, 734, 538, 541, 736, 1260, 207, 538, 541, 527, 539, 120, 609, 1269, 161, 1263, 1254, 369, 404, 594, 1254, 1254, 1254, 310, 326, 369, 404, 25, 140, 326, 369, 404, 1138, 290, 1138, 538, 541, 527, 1252, 449, 1264, 474, 752, 161, 662, 391, 937, 491, 671, 671, 662, 254, 333, 298, 1260, 333, 1264, 471, 161, 449, 449, 391, 421, 896, 896, 896, 325, 404, 92, 449, 925, 391, 120, 172, 610, 168, 550, 449, 449, 264, 264, 264, 449, 449, 391, 449, 449, 391, 449, 391, 449, 391, 449, 128, 551, 1138, 293, 1260, 404, 926, 158, 551, 449, 449, 538, 1254, 449, 925, 391, 449, 1263, 1254, 538, 538, 538, 1203, 536, 1138, 820, 225, 826, 1254, 1254, 1254, 225, 422, 423, 620, 1260, 620, 190, 538, 538, 178, 789, 791, 290, 312, 528, 529, 705, 792, 879, 1199, 1260, 1277, 72, 78, 92, 120, 122, 148, 182, 211, 293, 298, 347, 363, 467, 647, 648, 652, 157, 490, 554, 581, 1254, 581, 314, 729, 1252, 1252, 1252, 538, 541, 1264, 187, 381, 1264, 1259, 459, 1252, 662, 3, 172, 757, 896, 48, 568, 436, 738, 113, 997, 1162, 178, 541, 1253, 603, 796, 797, 1260, 538, 541, 1254, 172, 663, 1252, 692, 1252, 1254, 693, 537, 635, 1252, 538, 1254, 494, 496, 682, 602, 38, 158, 1050, 681, 449, 158, 1109, 527, 538, 541, 763, 538, 541, 120, 527, 890, 1260, 581, 436, 878, 879, 172, 895, 51, 376, 891, 892, 889, 892, 125, 217, 397, 472, 948, 1254, 304, 310, 315, 190, 1050, 1138, 537, 538, 541, 551, 474, 551, 474, 551, 1254, 1254, 747, 820, 158, 480, 434, 473, 1013, 1014, 1015, 1269, 310, 1016, 1034, 1035, 541, 1098, 527, 1224, 391, 391, 391, 391, 391, 1253, 541, 840, 1269, 1263, 494, 541, 844, 1263, 541, 850, 164, 313, 456, 849, 1111, 401, 156, 156, 538, 113, 289, 841, 850, 1264, 225, 225, 225, 225, 705, 225, 225, 225, 225, 225, 1206, 445, 1162, 147, 1138, 538, 1162, 229, 467, 467, 538, 1236, 1238, 310, 310, 1234, 1238, 59, 1244, 1162, 1234, 1234, 310, 310, 1242, 1240, 1240, 1162, 538, 1162, 1210, 1162, 1162, 538, 1201, 541, 1138, 1163, 1163, 1163, 1163, 135, 137, 293, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1162, 1162, 1162, 1138, 538, 538, 538, 1201, 538, 541, 59, 1164, 1178, 538, 1272, 1173, 344, 428, 1176, 538, 541, 485, 1169, 38, 538, 1260, 1162, 35, 35, 1162, 538, 1162, 178, 292, 1240, 1162, 538, 151, 1163, 1163, 151, 1201, 151, 1162, 1162, 1070, 538, 1201, 541, 1162, 1186, 1269, 1064, 1064, 1064, 1064, 1252, 1252, 1252, 1083, 538, 1083, 1005, 536, 1234, 1103, 1105, 1103, 1103, 537, 506, 1164, 538, 1269, 537, 1100, 228, 320, 1107, 1100, 1107, 228, 1106, 1107, 228, 438, 1113, 537, 1269, 537, 317, 59, 191, 1090, 537, 866, 169, 246, 311, 494, 446, 103, 1162, 377, 1018, 310, 538, 532, 883, 459, 181, 245, 385, 392, 399, 437, 460, 855, 172, 855, 538, 122, 148, 211, 289, 293, 780, 1254, 1254, 38, 474, 474, 244, 821, 1263, 1254, 449, 925, 391, 449, 215, 1254, 59, 439, 1254, 538, 158, 537, 669, 670, 861, 1167, 1269, 663, 640, 779, 663, 779, 1254, 663, 120, 1269, 86, 642, 643, 421, 182, 160, 195, 293, 602, 554, 113, 160, 182, 293, 421, 602, 642, 644, 703, 404, 607, 459, 1254, 1269, 396, 733, 1254, 605, 792, 1272, 1254, 325, 404, 449, 925, 391, 449, 161, 449, 449, 391, 180, 312, 424, 801, 802, 180, 312, 808, 809, 449, 449, 391, 538, 538, 538, 932, 290, 705, 879, 933, 1199, 1260, 1277, 369, 1254, 537, 494, 753, 1254, 671, 107, 1269, 537, 671, 1261, 1260, 1260, 1260, 1254, 1254, 1254, 1254, 608, 59, 439, 1254, 1254, 1254, 1254, 480, 1254, 1254, 172, 172, 371, 172, 196, 1263, 1254, 1254, 1263, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 310, 78, 599, 158, 27, 50, 459, 1269, 1254, 1260, 731, 1254, 1254, 1254, 1254, 1069, 538, 225, 826, 225, 225, 225, 826, 554, 474, 625, 626, 709, 779, 494, 496, 820, 537, 820, 1254, 1163, 32, 59, 650, 123, 198, 122, 148, 298, 241, 1252, 649, 180, 351, 775, 782, 783, 1269, 718, 537, 331, 537, 635, 654, 210, 676, 638, 1264, 1264, 1138, 537, 603, 29, 125, 217, 397, 472, 758, 449, 754, 1263, 196, 1252, 740, 498, 310, 538, 1099, 689, 896, 538, 541, 1124, 729, 747, 538, 700, 38, 304, 331, 537, 1007, 637, 639, 641, 656, 1269, 331, 677, 678, 635, 676, 602, 307, 310, 683, 1050, 695, 693, 603, 1260, 1254, 858, 792, 3, 795, 310, 880, 1162, 1162, 541, 537, 886, 459, 541, 44, 1162, 449, 537, 663, 1252, 764, 709, 538, 973, 974, 1254, 1254, 551, 401, 551, 479, 538, 541, 1224, 90, 1018, 538, 541, 1033, 1121, 1162, 1253, 1253, 1253, 1253, 1253, 705, 184, 843, 850, 848, 538, 1254, 1260, 113, 178, 551, 850, 298, 829, 1260, 829, 829, 829, 225, 829, 829, 829, 829, 829, 1162, 538, 145, 242, 242, 538, 298, 298, 538, 1071, 1238, 332, 1226, 298, 298, 1238, 1238, 1226, 1226, 538, 538, 178, 538, 1162, 178, 135, 137, 178, 172, 151, 538, 501, 1171, 1201, 362, 479, 59, 1178, 1164, 492, 492, 538, 1162, 289, 1162, 541, 1170, 1140, 1162, 1162, 1162, 1162, 35, 35, 1162, 538, 1162, 151, 538, 538, 538, 1162, 538, 331, 1187, 1252, 1252, 1252, 1252, 1090, 1260, 1090, 538, 541, 1116, 1117, 1167, 537, 1177, 1102, 537, 1253, 1100, 310, 474, 1108, 1100, 228, 1100, 1257, 1123, 537, 1123, 1269, 1065, 1162, 493, 1181, 906, 446, 304, 494, 1019, 1162, 459, 538, 303, 449, 836, 178, 779, 123, 198, 209, 122, 148, 476, 551, 1138, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1264, 1254, 779, 640, 1162, 538, 541, 494, 78, 860, 864, 860, 541, 664, 496, 661, 661, 120, 1269, 729, 608, 650, 196, 196, 298, 705, 38, 650, 298, 608, 1138, 551, 551, 527, 59, 439, 1254, 1254, 1254, 1254, 1254, 1263, 1254, 1254, 1259, 1259, 1138, 541, 1259, 1259, 541, 1263, 1254, 1254, 449, 1162, 72, 1162, 1264, 1254, 449, 449, 178, 202, 494, 1253, 1253, 820, 1253, 158, 161, 820, 1260, 1260, 1138, 551, 551, 449, 538, 225, 826, 826, 826, 826, 537, 621, 622, 554, 127, 180, 214, 180, 1162, 293, 648, 120, 38, 289, 660, 896, 662, 896, 1257, 35, 157, 202, 730, 734, 304, 634, 610, 155, 204, 537, 401, 474, 663, 38, 1264, 752, 568, 293, 537, 174, 1254, 688, 1260, 401, 603, 157, 1050, 820, 304, 634, 693, 538, 541, 494, 646, 59, 681, 610, 677, 84, 439, 684, 494, 962, 38, 684, 178, 310, 537, 1252, 1260, 877, 897, 898, 1270, 892, 1138, 172, 893, 1252, 178, 449, 917, 364, 765, 212, 710, 551, 538, 551, 551, 1254, 1050, 324, 1050, 1015, 310, 537, 1017, 527, 1034, 1018, 313, 223, 842, 551, 829, 1254, 538, 1227, 1228, 1234, 120, 143, 150, 164, 298, 456, 468, 1230, 1231, 1233, 538, 538, 1238, 1238, 1162, 538, 1163, 178, 1162, 1162, 1162, 537, 538, 541, 538, 1178, 538, 479, 418, 538, 206, 289, 1175, 1162, 1162, 1162, 538, 59, 1069, 1181, 1181, 394, 1059, 1162, 538, 541, 38, 1118, 120, 1130, 1131, 1163, 81, 1253, 538, 1162, 537, 1100, 1108, 537, 538, 1123, 538, 102, 188, 383, 537, 1084, 1085, 1086, 1087, 1088, 1089, 1162, 1182, 1183, 1269, 1069, 538, 1047, 537, 1249, 490, 1037, 1038, 1039, 1040, 842, 310, 842, 538, 449, 404, 1028, 538, 203, 667, 670, 312, 906, 820, 549, 820, 336, 538, 322, 538, 538, 646, 38, 158, 158, 537, 599, 792, 1264, 1254, 449, 537, 872, 906, 908, 802, 537, 537, 809, 1254, 538, 537, 538, 404, 1028, 1254, 1254, 537, 537, 537, 494, 518, 982, 371, 982, 982, 172, 1254, 599, 1254, 826, 627, 628, 1272, 54, 101, 126, 145, 151, 173, 177, 192, 298, 355, 623, 621, 1260, 872, 38, 913, 913, 538, 195, 537, 209, 474, 685, 265, 668, 685, 537, 783, 775, 537, 538, 541, 1252, 538, 401, 29, 83, 86, 93, 121, 182, 195, 208, 421, 424, 655, 655, 1251, 1254, 1254, 538, 1050, 753, 158, 113, 729, 178, 1254, 38, 1254, 693, 635, 1252, 538, 639, 314, 1269, 682, 677, 681, 125, 140, 344, 1254, 64, 72, 257, 1050, 820, 1109, 859, 861, 178, 778, 879, 538, 541, 459, 147, 547, 891, 894, 1120, 416, 416, 538, 283, 308, 766, 767, 768, 172, 771, 709, 289, 478, 711, 712, 1013, 92, 859, 136, 1162, 1254, 850, 541, 38, 1162, 37, 302, 310, 538, 494, 496, 1229, 1230, 1232, 172, 1163, 1172, 1201, 289, 513, 206, 538, 1201, 189, 357, 387, 1188, 58, 129, 112, 1060, 38, 1133, 1119, 1116, 537, 1163, 538, 541, 38, 1126, 1127, 1269, 538, 1253, 1201, 538, 537, 405, 537, 538, 541, 541, 38, 1074, 283, 308, 1020, 1021, 1022, 266, 293, 1018, 1038, 35, 1041, 1041, 844, 855, 551, 1254, 439, 860, 537, 896, 537, 865, 602, 666, 363, 667, 667, 195, 1162, 474, 600, 404, 1028, 1254, 1205, 172, 805, 805, 1205, 1205, 1162, 439, 1201, 1201, 611, 612, 1271, 819, 820, 819, 820, 1253, 551, 538, 541, 120, 530, 537, 578, 629, 705, 979, 1260, 979, 293, 298, 355, 979, 979, 1120, 913, 42, 200, 660, 537, 701, 1162, 207, 179, 330, 410, 310, 672, 673, 674, 538, 1257, 6, 784, 734, 635, 676, 1254, 538, 729, 165, 804, 603, 962, 1252, 498, 1099, 729, 1050, 1007, 677, 635, 676, 646, 537, 683, 681, 682, 387, 387, 72, 313, 72, 693, 858, 538, 541, 1252, 779, 886, 897, 1138, 540, 136, 494, 494, 767, 386, 436, 769, 141, 772, 490, 774, 478, 709, 479, 1254, 538, 294, 472, 729, 551, 1228, 1272, 150, 37, 88, 463, 498, 37, 498, 240, 309, 1237, 310, 538, 1162, 538, 538, 479, 52, 103, 462, 1162, 1189, 1190, 1189, 1189, 538, 169, 169, 663, 1254, 1226, 1123, 541, 1131, 1272, 538, 541, 172, 1138, 538, 538, 1201, 537, 1201, 1085, 1183, 1185, 1092, 538, 541, 38, 266, 1162, 445, 445, 178, 1254, 663, 685, 906, 866, 865, 1252, 896, 896, 701, 538, 1162, 439, 538, 316, 394, 538, 538, 538, 1254, 538, 538, 538, 541, 1259, 982, 628, 578, 630, 631, 1260, 1260, 298, 530, 663, 530, 663, 1260, 1260, 702, 538, 439, 125, 472, 310, 674, 310, 673, 537, 538, 541, 610, 401, 729, 820, 38, 38, 537, 1254, 962, 693, 681, 610, 677, 537, 679, 680, 1167, 1269, 684, 682, 683, 313, 313, 537, 203, 862, 861, 172, 892, 30, 218, 949, 180, 180, 979, 386, 420, 773, 537, 157, 1050, 1120, 404, 498, 37, 498, 37, 498, 498, 356, 356, 1232, 143, 150, 1190, 386, 171, 342, 171, 342, 154, 1191, 1191, 1191, 59, 59, 404, 81, 538, 1164, 1127, 317, 3, 120, 293, 298, 334, 1128, 1129, 38, 1104, 370, 1114, 538, 1084, 538, 1021, 1269, 59, 125, 136, 472, 1042, 1043, 136, 217, 1044, 842, 1028, 538, 671, 538, 866, 537, 665, 685, 685, 1254, 872, 59, 1028, 449, 611, 820, 538, 541, 530, 663, 538, 425, 488, 651, 1254, 63, 289, 375, 404, 675, 675, 538, 6, 401, 1254, 801, 1050, 729, 682, 677, 681, 1162, 538, 541, 864, 864, 683, 684, 859, 537, 649, 141, 294, 537, 944, 946, 950, 1009, 1023, 1030, 1050, 1061, 872, 872, 770, 1269, 1162, 775, 1032, 498, 498, 310, 310, 538, 1230, 35, 103, 187, 289, 446, 663, 663, 1269, 537, 1177, 1163, 1163, 298, 1163, 1129, 1269, 537, 538, 415, 440, 294, 404, 294, 120, 324, 480, 537, 1045, 551, 779, 663, 668, 779, 779, 1028, 820, 537, 631, 24, 120, 298, 1254, 729, 962, 683, 681, 682, 538, 680, 549, 549, 684, 538, 861, 863, 603, 386, 945, 946, 947, 1051, 1052, 541, 541, 538, 1257, 1120, 390, 390, 310, 1190, 386, 318, 404, 404, 449, 474, 282, 1134, 1135, 1269, 81, 1162, 1032, 480, 1013, 537, 1014, 664, 672, 1201, 662, 662, 729, 684, 682, 683, 864, 862, 538, 541, 684, 774, 538, 540, 449, 178, 537, 427, 427, 150, 1269, 1269, 229, 1257, 1258, 1269, 334, 1136, 538, 541, 172, 1138, 1126, 538, 479, 1201, 538, 538, 779, 538, 683, 684, 549, 649, 861, 1120, 157, 947, 416, 416, 5, 776, 777, 1259, 1260, 1272, 537, 120, 1260, 1233, 1135, 317, 158, 334, 1137, 1235, 538, 1045, 538, 324, 1045, 684, 603, 775, 494, 494, 538, 541, 1202, 1258, 38, 81, 538, 1137, 1260, 1229, 1137, 1013, 684, 1257, 180, 180, 777, 1069, 474, 1254, 537, 1233, 1237, 1229, 479, 1120, 537, 872, 872, 538, 1269, 81, 1134, 1232, 1237, 1045, 776, 537, 538, 1232, 538, 1134, 538 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_int16 yyr1[] = { 0, 543, 544, 544, 544, 544, 544, 544, 545, 545, 546, 546, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 547, 548, 548, 549, 549, 550, 550, 551, 551, 551, 552, 553, 554, 554, 554, 555, 555, 556, 556, 557, 557, 557, 557, 557, 557, 557, 557, 557, 558, 558, 558, 558, 558, 558, 559, 560, 560, 561, 561, 562, 562, 562, 562, 563, 563, 563, 563, 563, 563, 564, 565, 566, 566, 567, 567, 567, 567, 568, 568, 569, 569, 569, 569, 569, 569, 570, 570, 570, 570, 570, 571, 571, 571, 572, 572, 572, 572, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 574, 574, 575, 575, 576, 576, 577, 577, 577, 577, 578, 578, 578, 578, 579, 579, 579, 579, 579, 579, 579, 580, 580, 580, 581, 581, 582, 582, 583, 583, 583, 583, 584, 584, 585, 585, 586, 586, 587, 587, 587, 587, 587, 587, 587, 588, 589, 589, 590, 590, 591, 592, 592, 592, 592, 592, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 594, 594, 595, 595, 595, 596, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 598, 598, 599, 599, 600, 600, 601, 601, 601, 601, 602, 603, 603, 604, 604, 605, 605, 605, 605, 606, 606, 607, 607, 607, 607, 608, 608, 609, 609, 610, 610, 610, 610, 611, 612, 612, 613, 614, 614, 615, 615, 615, 615, 616, 616, 617, 617, 618, 618, 619, 619, 620, 620, 620, 621, 621, 622, 622, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, 624, 624, 625, 625, 626, 626, 627, 627, 628, 629, 629, 629, 629, 629, 629, 630, 630, 631, 632, 632, 632, 632, 632, 632, 633, 633, 633, 633, 633, 633, 633, 633, 634, 634, 635, 635, 636, 636, 637, 637, 638, 638, 638, 639, 639, 640, 641, 641, 642, 642, 643, 643, 644, 644, 645, 645, 646, 646, 647, 647, 647, 647, 648, 648, 648, 648, 648, 648, 648, 648, 648, 649, 649, 649, 650, 650, 651, 651, 651, 652, 652, 652, 652, 652, 652, 653, 654, 654, 654, 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, 656, 656, 657, 657, 657, 657, 657, 657, 657, 657, 658, 658, 659, 659, 660, 660, 661, 661, 662, 662, 663, 663, 664, 664, 665, 665, 666, 667, 667, 668, 668, 668, 668, 669, 669, 670, 670, 671, 671, 672, 672, 672, 672, 672, 673, 674, 675, 675, 675, 675, 675, 676, 676, 677, 677, 678, 679, 679, 680, 680, 680, 681, 681, 682, 682, 682, 683, 683, 683, 683, 684, 684, 685, 685, 686, 687, 687, 688, 688, 689, 689, 689, 690, 690, 691, 691, 692, 693, 693, 693, 694, 694, 695, 696, 696, 697, 698, 698, 699, 699, 700, 700, 701, 701, 702, 702, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, 704, 704, 705, 705, 705, 705, 706, 706, 707, 707, 708, 708, 709, 709, 710, 710, 711, 711, 712, 712, 713, 713, 714, 715, 715, 716, 716, 717, 717, 718, 718, 719, 719, 719, 719, 720, 721, 721, 722, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 724, 725, 725, 725, 725, 726, 726, 727, 727, 728, 728, 729, 729, 730, 730, 731, 732, 732, 733, 733, 733, 733, 734, 735, 736, 737, 737, 738, 738, 739, 739, 740, 740, 741, 741, 741, 742, 742, 742, 742, 743, 744, 744, 745, 745, 746, 746, 747, 747, 748, 748, 749, 750, 751, 752, 752, 753, 753, 754, 754, 755, 755, 756, 756, 757, 757, 758, 758, 758, 758, 758, 759, 760, 760, 761, 761, 762, 762, 762, 763, 763, 764, 764, 764, 764, 764, 765, 765, 766, 766, 767, 768, 768, 769, 769, 770, 771, 771, 772, 772, 773, 773, 774, 774, 775, 775, 776, 776, 776, 777, 777, 777, 777, 778, 778, 779, 779, 780, 780, 780, 780, 780, 780, 780, 780, 781, 781, 782, 782, 783, 784, 784, 785, 786, 786, 786, 786, 787, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 789, 790, 790, 791, 791, 792, 792, 792, 792, 792, 792, 793, 794, 794, 795, 796, 796, 797, 797, 798, 798, 798, 798, 798, 799, 799, 800, 801, 801, 802, 802, 802, 802, 802, 803, 803, 804, 804, 805, 805, 805, 806, 807, 807, 808, 808, 809, 809, 810, 810, 811, 811, 812, 813, 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 816, 816, 816, 816, 816, 817, 817, 817, 817, 817, 817, 817, 817, 818, 818, 818, 819, 819, 820, 820, 821, 821, 822, 822, 823, 824, 824, 824, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 826, 826, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 828, 828, 829, 829, 830, 830, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 832, 832, 833, 833, 834, 835, 835, 836, 836, 836, 836, 836, 837, 837, 838, 838, 838, 838, 838, 839, 839, 840, 840, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 842, 842, 843, 843, 844, 844, 845, 845, 846, 846, 847, 847, 848, 849, 849, 849, 850, 850, 851, 852, 852, 853, 853, 853, 854, 854, 854, 855, 855, 855, 855, 855, 855, 855, 856, 856, 857, 857, 858, 858, 859, 859, 860, 860, 861, 861, 861, 862, 862, 863, 863, 864, 864, 865, 865, 865, 866, 866, 866, 867, 867, 867, 867, 868, 868, 869, 869, 870, 870, 871, 871, 872, 872, 872, 872, 873, 873, 874, 874, 875, 875, 875, 875, 875, 876, 876, 876, 876, 876, 877, 878, 879, 879, 879, 880, 880, 880, 881, 882, 882, 882, 882, 883, 883, 884, 885, 885, 886, 886, 887, 887, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 889, 889, 889, 889, 889, 890, 890, 891, 892, 892, 892, 893, 893, 894, 894, 895, 895, 896, 896, 897, 898, 898, 899, 899, 899, 900, 900, 901, 901, 902, 902, 902, 902, 902, 902, 903, 903, 904, 904, 905, 905, 905, 905, 906, 906, 907, 907, 908, 909, 910, 910, 911, 911, 912, 912, 912, 913, 913, 913, 914, 915, 915, 916, 917, 917, 917, 917, 918, 919, 919, 919, 920, 920, 921, 921, 922, 922, 923, 923, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 925, 925, 926, 926, 927, 927, 927, 927, 927, 927, 928, 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, 929, 929, 929, 930, 931, 931, 932, 932, 932, 933, 933, 933, 933, 933, 934, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 935, 936, 936, 936, 937, 937, 937, 937, 937, 937, 937, 938, 938, 939, 939, 939, 939, 940, 941, 941, 941, 941, 941, 941, 941, 941, 941, 942, 942, 943, 944, 944, 944, 945, 945, 946, 946, 946, 946, 946, 947, 947, 948, 948, 948, 948, 949, 949, 949, 950, 951, 951, 952, 953, 953, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 955, 955, 956, 956, 956, 957, 957, 957, 957, 957, 958, 958, 958, 959, 959, 960, 960, 960, 961, 961, 961, 961, 962, 962, 962, 962, 963, 964, 965, 965, 966, 966, 967, 967, 967, 968, 968, 968, 968, 968, 968, 968, 969, 969, 970, 970, 970, 970, 971, 972, 972, 972, 972, 973, 973, 974, 975, 976, 976, 977, 978, 978, 978, 978, 978, 978, 978, 979, 979, 980, 981, 981, 981, 981, 981, 981, 982, 982, 983, 984, 984, 984, 984, 984, 985, 985, 986, 986, 987, 987, 988, 988, 989, 989, 990, 991, 991, 991, 992, 992, 992, 993, 993, 994, 994, 995, 995, 996, 996, 997, 997, 998, 999, 999, 1000, 1000, 1001, 1001, 1001, 1001, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1003, 1004, 1004, 1005, 1005, 1005, 1005, 1005, 1006, 1006, 1006, 1007, 1007, 1008, 1008, 1008, 1008, 1009, 1010, 1011, 1011, 1012, 1012, 1012, 1012, 1012, 1013, 1013, 1014, 1014, 1015, 1016, 1016, 1016, 1017, 1017, 1017, 1018, 1018, 1019, 1019, 1020, 1020, 1021, 1022, 1022, 1023, 1024, 1024, 1025, 1026, 1026, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1028, 1028, 1029, 1029, 1029, 1030, 1031, 1032, 1032, 1033, 1033, 1034, 1035, 1035, 1036, 1037, 1037, 1038, 1038, 1038, 1038, 1038, 1039, 1039, 1040, 1040, 1041, 1041, 1042, 1043, 1044, 1044, 1044, 1044, 1044, 1045, 1046, 1047, 1048, 1048, 1048, 1048, 1048, 1048, 1049, 1049, 1049, 1050, 1050, 1051, 1051, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1053, 1053, 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1055, 1055, 1055, 1056, 1056, 1057, 1058, 1058, 1058, 1059, 1059, 1059, 1060, 1060, 1060, 1061, 1061, 1062, 1062, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1064, 1064, 1065, 1065, 1065, 1066, 1066, 1067, 1067, 1068, 1068, 1069, 1069, 1070, 1071, 1071, 1072, 1072, 1073, 1073, 1073, 1073, 1074, 1074, 1075, 1075, 1075, 1075, 1075, 1075, 1076, 1076, 1077, 1077, 1078, 1079, 1079, 1079, 1080, 1080, 1081, 1081, 1082, 1082, 1083, 1083, 1084, 1084, 1085, 1085, 1085, 1085, 1085, 1086, 1087, 1088, 1089, 1090, 1090, 1091, 1091, 1092, 1092, 1093, 1093, 1094, 1095, 1095, 1095, 1095, 1096, 1096, 1097, 1097, 1098, 1098, 1099, 1099, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1101, 1101, 1101, 1101, 1101, 1101, 1102, 1102, 1102, 1102, 1103, 1103, 1104, 1104, 1105, 1105, 1105, 1105, 1105, 1106, 1106, 1106, 1106, 1107, 1107, 1108, 1108, 1109, 1109, 1110, 1110, 1110, 1111, 1111, 1112, 1112, 1112, 1113, 1114, 1114, 1115, 1115, 1116, 1117, 1117, 1118, 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1121, 1122, 1122, 1123, 1123, 1124, 1125, 1125, 1126, 1126, 1127, 1127, 1127, 1128, 1128, 1129, 1129, 1129, 1129, 1129, 1130, 1130, 1131, 1131, 1132, 1133, 1133, 1134, 1134, 1135, 1135, 1135, 1135, 1135, 1135, 1136, 1136, 1137, 1137, 1138, 1138, 1138, 1138, 1138, 1138, 1139, 1139, 1139, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1141, 1141, 1141, 1141, 1141, 1142, 1142, 1143, 1143, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1145, 1145, 1146, 1146, 1147, 1147, 1148, 1149, 1150, 1150, 1151, 1151, 1152, 1153, 1154, 1154, 1154, 1154, 1154, 1154, 1155, 1155, 1156, 1156, 1156, 1156, 1157, 1158, 1158, 1158, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1160, 1160, 1161, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1166, 1166, 1166, 1167, 1167, 1167, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1169, 1169, 1170, 1170, 1170, 1170, 1171, 1172, 1172, 1173, 1173, 1174, 1174, 1175, 1175, 1175, 1176, 1176, 1176, 1177, 1177, 1177, 1177, 1178, 1178, 1179, 1179, 1180, 1180, 1181, 1181, 1182, 1182, 1183, 1184, 1184, 1184, 1185, 1186, 1186, 1187, 1187, 1188, 1188, 1188, 1188, 1189, 1189, 1190, 1190, 1190, 1190, 1190, 1191, 1191, 1191, 1191, 1191, 1192, 1192, 1192, 1193, 1193, 1194, 1195, 1195, 1195, 1196, 1196, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1198, 1198, 1199, 1199, 1200, 1200, 1200, 1200, 1200, 1200, 1201, 1201, 1202, 1202, 1203, 1203, 1203, 1204, 1204, 1205, 1205, 1206, 1206, 1206, 1207, 1207, 1208, 1209, 1209, 1209, 1209, 1209, 1209, 1209, 1209, 1210, 1210, 1210, 1210, 1211, 1211, 1212, 1213, 1213, 1213, 1213, 1213, 1214, 1214, 1214, 1215, 1216, 1216, 1217, 1218, 1218, 1219, 1219, 1220, 1220, 1221, 1221, 1221, 1221, 1222, 1222, 1223, 1223, 1224, 1224, 1225, 1225, 1226, 1226, 1227, 1227, 1228, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1230, 1230, 1231, 1231, 1231, 1231, 1231, 1231, 1231, 1231, 1232, 1232, 1232, 1232, 1233, 1233, 1234, 1235, 1235, 1236, 1236, 1237, 1237, 1237, 1237, 1237, 1238, 1238, 1239, 1239, 1239, 1239, 1239, 1240, 1240, 1240, 1240, 1240, 1241, 1241, 1242, 1242, 1243, 1243, 1243, 1244, 1244, 1244, 1245, 1245, 1246, 1246, 1247, 1247, 1248, 1248, 1249, 1249, 1250, 1250, 1250, 1250, 1251, 1251, 1252, 1252, 1253, 1253, 1254, 1255, 1256, 1257, 1257, 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1259, 1260, 1261, 1261, 1261, 1262, 1263, 1263, 1263, 1263, 1264, 1264, 1265, 1266, 1267, 1267, 1268, 1268, 1269, 1269, 1269, 1270, 1270, 1270, 1271, 1271, 1271, 1271, 1272, 1272, 1272, 1272, 1272, 1273, 1273, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_int8 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, 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, 3, 1, 4, 4, 5, 2, 5, 7, 5, 2, 3, 0, 1, 2, 1, 1, 0, 1, 2, 2, 2, 1, 2, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 4, 10, 3, 10, 4, 10, 12, 3, 1, 5, 3, 2, 0, 2, 0, 3, 0, 1, 3, 3, 0, 4, 0, 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, 1, 2, 2, 2, 2, 3, 3, 3, 1, 3, 1, 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, 2, 1, 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, 4, 4, 3, 6, 2, 1, 0, 2, 0, 2, 4, 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, 2, 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, 3, 0, 4, 0, 1, 3, 3, 1, 1, 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, 5, 4, 6, 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, 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, 1, 1, 1, 1, 1, 1 }; enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #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) /* Backward compatibility with an undocumented macro. Use YYerror or YYUNDEF. */ #define YYERRCODE YYUNDEF /* 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 int yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) { int 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 /* !defined YY_LOCATION_PRINT */ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Kind, Value, Location, yyscanner); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) { FILE *yyoutput = yyo; YYUSE (yyoutput); YYUSE (yylocationp); YYUSE (yyscanner); if (!yyvaluep) return; # ifdef YYPRINT if (yykind < YYNTOKENS) YYPRINT (yyo, yytoknum[yykind], *yyvaluep); # endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) { YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); YY_LOCATION_PRINT (yyo, *yylocationp); YYFPRINTF (yyo, ": "); yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, yyscanner); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yy_state_t *yybottom, yy_state_t *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 (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, core_yyscan_t yyscanner) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, YY_ACCESSING_SYMBOL (+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) ((void) 0) # define YY_SYMBOL_PRINT(Title, Kind, 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 /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, core_yyscan_t yyscanner) { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (yyscanner); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*----------. | yyparse. | `----------*/ int yyparse (core_yyscan_t yyscanner) { /* Lookahead token kind. */ 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 = 0; yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus = 0; /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ YYPTRDIFF_T yystacksize = YYINITDEPTH; /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; yy_state_t *yyss = yyssa; yy_state_t *yyssp = yyss; /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp = yyvs; /* The location stack: array, bottom, top. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp = yyls; int yyn; /* The return value of yyparse. */ int yyresult; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[3]; #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; YYDPRINTF ((stderr, "Starting parse\n")); 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 -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined 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. */ yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; 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 * YYSIZEOF (*yyssp), &yyvs1, yysize * YYSIZEOF (*yyvsp), &yyls1, yysize * YYSIZEOF (*yylsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; yyls = yyls1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, 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 yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN YYDPRINTF ((stderr, "Stack size increased to %ld\n", YY_CAST (long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ 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 empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (&yylval, &yylloc, yyscanner); } if (yychar <= YYEOF) { yychar = YYEOF; yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else if (yychar == YYerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = YYUNDEF; yytoken = YYSYMBOL_YYerror; yyerror_range[1] = yylloc; goto yyerrlab1; } 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); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END *++yylsp = yylloc; /* Discard the shifted token. */ yychar = YYEMPTY; 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); yyerror_range[1] = yyloc; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* parse_toplevel: stmtmulti */ #line 957 "gram_minimal.y" { pg_yyget_extra(yyscanner)->parsetree = (yyvsp[0].list); (void) yynerrs; /* suppress compiler warning */ } #line 32478 "gram_minimal.c" break; case 3: /* parse_toplevel: MODE_TYPE_NAME Typename */ #line 962 "gram_minimal.y" { pg_yyget_extra(yyscanner)->parsetree = list_make1((yyvsp[0].typnam)); } #line 32486 "gram_minimal.c" break; case 4: /* parse_toplevel: MODE_PLPGSQL_EXPR PLpgSQL_Expr */ #line 966 "gram_minimal.y" { pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((yyvsp[0].node), (yylsp[0]))); } #line 32495 "gram_minimal.c" break; case 5: /* parse_toplevel: MODE_PLPGSQL_ASSIGN1 PLAssignStmt */ #line 971 "gram_minimal.y" { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 1; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, (yylsp[0]))); } #line 32507 "gram_minimal.c" break; case 6: /* parse_toplevel: MODE_PLPGSQL_ASSIGN2 PLAssignStmt */ #line 979 "gram_minimal.y" { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 2; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, (yylsp[0]))); } #line 32519 "gram_minimal.c" break; case 7: /* parse_toplevel: MODE_PLPGSQL_ASSIGN3 PLAssignStmt */ #line 987 "gram_minimal.y" { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 3; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, (yylsp[0]))); } #line 32531 "gram_minimal.c" break; case 8: /* stmtmulti: stmtmulti ';' toplevel_stmt */ #line 1003 "gram_minimal.y" { 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[0]))); else (yyval.list) = (yyvsp[-2].list); } #line 32547 "gram_minimal.c" break; case 9: /* stmtmulti: toplevel_stmt */ #line 1015 "gram_minimal.y" { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1(makeRawStmt((yyvsp[0].node), (yylsp[0]))); else (yyval.list) = NIL; } #line 32558 "gram_minimal.c" break; case 136: /* stmt: %empty */ #line 1158 "gram_minimal.y" { (yyval.node) = NULL; } #line 32564 "gram_minimal.c" break; case 137: /* opt_single_name: ColId */ #line 1165 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 32570 "gram_minimal.c" break; case 138: /* opt_single_name: %empty */ #line 1166 "gram_minimal.y" { (yyval.str) = NULL; } #line 32576 "gram_minimal.c" break; case 139: /* opt_qualified_name: any_name */ #line 1170 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 32582 "gram_minimal.c" break; case 140: /* opt_qualified_name: %empty */ #line 1171 "gram_minimal.y" { (yyval.list) = NIL; } #line 32588 "gram_minimal.c" break; case 141: /* opt_concurrently: CONCURRENTLY */ #line 1175 "gram_minimal.y" { (yyval.boolean) = true; } #line 32594 "gram_minimal.c" break; case 142: /* opt_concurrently: %empty */ #line 1176 "gram_minimal.y" { (yyval.boolean) = false; } #line 32600 "gram_minimal.c" break; case 143: /* opt_drop_behavior: CASCADE */ #line 1180 "gram_minimal.y" { (yyval.dbehavior) = DROP_CASCADE; } #line 32606 "gram_minimal.c" break; case 144: /* opt_drop_behavior: RESTRICT */ #line 1181 "gram_minimal.y" { (yyval.dbehavior) = DROP_RESTRICT; } #line 32612 "gram_minimal.c" break; case 145: /* opt_drop_behavior: %empty */ #line 1182 "gram_minimal.y" { (yyval.dbehavior) = DROP_RESTRICT; /* default */ } #line 32618 "gram_minimal.c" break; case 146: /* CallStmt: CALL func_application */ #line 1192 "gram_minimal.y" { CallStmt *n = makeNode(CallStmt); n->funccall = castNode(FuncCall, (yyvsp[0].node)); (yyval.node) = (Node *) n; } #line 32629 "gram_minimal.c" break; case 147: /* CreateRoleStmt: CREATE ROLE RoleId opt_with OptRoleList */ #line 1208 "gram_minimal.y" { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_ROLE; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32642 "gram_minimal.c" break; case 151: /* OptRoleList: OptRoleList CreateOptRoleElem */ #line 1230 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 32648 "gram_minimal.c" break; case 152: /* OptRoleList: %empty */ #line 1231 "gram_minimal.y" { (yyval.list) = NIL; } #line 32654 "gram_minimal.c" break; case 153: /* AlterOptRoleList: AlterOptRoleList AlterOptRoleElem */ #line 1235 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 32660 "gram_minimal.c" break; case 154: /* AlterOptRoleList: %empty */ #line 1236 "gram_minimal.y" { (yyval.list) = NIL; } #line 32666 "gram_minimal.c" break; case 155: /* AlterOptRoleElem: PASSWORD Sconst */ #line 1241 "gram_minimal.y" { (yyval.defelt) = makeDefElem("password", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 32675 "gram_minimal.c" break; case 156: /* AlterOptRoleElem: PASSWORD NULL_P */ #line 1246 "gram_minimal.y" { (yyval.defelt) = makeDefElem("password", NULL, (yylsp[-1])); } #line 32683 "gram_minimal.c" break; case 157: /* AlterOptRoleElem: ENCRYPTED PASSWORD Sconst */ #line 1250 "gram_minimal.y" { /* * 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 32697 "gram_minimal.c" break; case 158: /* AlterOptRoleElem: UNENCRYPTED PASSWORD Sconst */ #line 1260 "gram_minimal.y" { 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 32709 "gram_minimal.c" break; case 159: /* AlterOptRoleElem: INHERIT */ #line 1268 "gram_minimal.y" { (yyval.defelt) = makeDefElem("inherit", (Node *) makeBoolean(true), (yylsp[0])); } #line 32717 "gram_minimal.c" break; case 160: /* AlterOptRoleElem: CONNECTION LIMIT SignedIconst */ #line 1272 "gram_minimal.y" { (yyval.defelt) = makeDefElem("connectionlimit", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 32725 "gram_minimal.c" break; case 161: /* AlterOptRoleElem: VALID UNTIL Sconst */ #line 1276 "gram_minimal.y" { (yyval.defelt) = makeDefElem("validUntil", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 32733 "gram_minimal.c" break; case 162: /* AlterOptRoleElem: USER role_list */ #line 1281 "gram_minimal.y" { (yyval.defelt) = makeDefElem("rolemembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 32741 "gram_minimal.c" break; case 163: /* AlterOptRoleElem: IDENT */ #line 1285 "gram_minimal.y" { /* * 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 32790 "gram_minimal.c" break; case 164: /* CreateOptRoleElem: AlterOptRoleElem */ #line 1332 "gram_minimal.y" { (yyval.defelt) = (yyvsp[0].defelt); } #line 32796 "gram_minimal.c" break; case 165: /* CreateOptRoleElem: SYSID Iconst */ #line 1335 "gram_minimal.y" { (yyval.defelt) = makeDefElem("sysid", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 32804 "gram_minimal.c" break; case 166: /* CreateOptRoleElem: ADMIN role_list */ #line 1339 "gram_minimal.y" { (yyval.defelt) = makeDefElem("adminmembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 32812 "gram_minimal.c" break; case 167: /* CreateOptRoleElem: ROLE role_list */ #line 1343 "gram_minimal.y" { (yyval.defelt) = makeDefElem("rolemembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 32820 "gram_minimal.c" break; case 168: /* CreateOptRoleElem: IN_P ROLE role_list */ #line 1347 "gram_minimal.y" { (yyval.defelt) = makeDefElem("addroleto", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 32828 "gram_minimal.c" break; case 169: /* CreateOptRoleElem: IN_P GROUP_P role_list */ #line 1351 "gram_minimal.y" { (yyval.defelt) = makeDefElem("addroleto", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 32836 "gram_minimal.c" break; case 170: /* CreateUserStmt: CREATE USER RoleId opt_with OptRoleList */ #line 1365 "gram_minimal.y" { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_USER; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32849 "gram_minimal.c" break; case 171: /* AlterRoleStmt: ALTER ROLE RoleSpec opt_with AlterOptRoleList */ #line 1384 "gram_minimal.y" { 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 32862 "gram_minimal.c" break; case 172: /* AlterRoleStmt: ALTER USER RoleSpec opt_with AlterOptRoleList */ #line 1393 "gram_minimal.y" { 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 32875 "gram_minimal.c" break; case 173: /* opt_in_database: %empty */ #line 1404 "gram_minimal.y" { (yyval.str) = NULL; } #line 32881 "gram_minimal.c" break; case 174: /* opt_in_database: IN_P DATABASE name */ #line 1405 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 32887 "gram_minimal.c" break; case 175: /* AlterRoleSetStmt: ALTER ROLE RoleSpec opt_in_database SetResetClause */ #line 1410 "gram_minimal.y" { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].rolespec); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 32900 "gram_minimal.c" break; case 176: /* AlterRoleSetStmt: ALTER ROLE ALL opt_in_database SetResetClause */ #line 1419 "gram_minimal.y" { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = NULL; n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 32913 "gram_minimal.c" break; case 177: /* AlterRoleSetStmt: ALTER USER RoleSpec opt_in_database SetResetClause */ #line 1428 "gram_minimal.y" { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].rolespec); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 32926 "gram_minimal.c" break; case 178: /* AlterRoleSetStmt: ALTER USER ALL opt_in_database SetResetClause */ #line 1437 "gram_minimal.y" { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = NULL; n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 32939 "gram_minimal.c" break; case 179: /* DropRoleStmt: DROP ROLE role_list */ #line 1459 "gram_minimal.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32951 "gram_minimal.c" break; case 180: /* DropRoleStmt: DROP ROLE IF_P EXISTS role_list */ #line 1467 "gram_minimal.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32963 "gram_minimal.c" break; case 181: /* DropRoleStmt: DROP USER role_list */ #line 1475 "gram_minimal.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32975 "gram_minimal.c" break; case 182: /* DropRoleStmt: DROP USER IF_P EXISTS role_list */ #line 1483 "gram_minimal.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32987 "gram_minimal.c" break; case 183: /* DropRoleStmt: DROP GROUP_P role_list */ #line 1491 "gram_minimal.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32999 "gram_minimal.c" break; case 184: /* DropRoleStmt: DROP GROUP_P IF_P EXISTS role_list */ #line 1499 "gram_minimal.y" { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 33011 "gram_minimal.c" break; case 185: /* CreateGroupStmt: CREATE GROUP_P RoleId opt_with OptRoleList */ #line 1517 "gram_minimal.y" { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_GROUP; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 33024 "gram_minimal.c" break; case 186: /* AlterGroupStmt: ALTER GROUP_P RoleSpec add_drop USER role_list */ #line 1536 "gram_minimal.y" { 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 33038 "gram_minimal.c" break; case 187: /* add_drop: ADD_P */ #line 1547 "gram_minimal.y" { (yyval.ival) = +1; } #line 33044 "gram_minimal.c" break; case 188: /* add_drop: DROP */ #line 1548 "gram_minimal.y" { (yyval.ival) = -1; } #line 33050 "gram_minimal.c" break; case 189: /* CreateSchemaStmt: CREATE SCHEMA opt_single_name AUTHORIZATION RoleSpec OptSchemaEltList */ #line 1560 "gram_minimal.y" { 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 33065 "gram_minimal.c" break; case 190: /* CreateSchemaStmt: CREATE SCHEMA ColId OptSchemaEltList */ #line 1571 "gram_minimal.y" { 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 33080 "gram_minimal.c" break; case 191: /* CreateSchemaStmt: CREATE SCHEMA IF_P NOT EXISTS opt_single_name AUTHORIZATION RoleSpec OptSchemaEltList */ #line 1582 "gram_minimal.y" { 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 33100 "gram_minimal.c" break; case 192: /* CreateSchemaStmt: CREATE SCHEMA IF_P NOT EXISTS ColId OptSchemaEltList */ #line 1598 "gram_minimal.y" { 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 33120 "gram_minimal.c" break; case 193: /* OptSchemaEltList: OptSchemaEltList schema_stmt */ #line 1617 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 33128 "gram_minimal.c" break; case 194: /* OptSchemaEltList: %empty */ #line 1621 "gram_minimal.y" { (yyval.list) = NIL; } #line 33134 "gram_minimal.c" break; case 201: /* VariableSetStmt: PGPOOL SET generic_set */ #line 1649 "gram_minimal.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep changes minimum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 33145 "gram_minimal.c" break; case 202: /* VariableSetStmt: PGPOOL set_rest_more */ #line 1656 "gram_minimal.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolQueryCacheStmt; /* Hack to keep changes minimum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 33156 "gram_minimal.c" break; case 203: /* VariableSetStmt: SET set_rest */ #line 1663 "gram_minimal.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 33167 "gram_minimal.c" break; case 204: /* VariableSetStmt: SET LOCAL set_rest */ #line 1670 "gram_minimal.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = true; (yyval.node) = (Node *) n; } #line 33178 "gram_minimal.c" break; case 205: /* VariableSetStmt: SET SESSION set_rest */ #line 1677 "gram_minimal.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 33189 "gram_minimal.c" break; case 206: /* set_rest: TRANSACTION transaction_mode_list */ #line 1687 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "TRANSACTION"; n->args = (yyvsp[0].list); n->jumble_args = true; n->location = -1; (yyval.vsetstmt) = n; } #line 33204 "gram_minimal.c" break; case 207: /* set_rest: SESSION CHARACTERISTICS AS TRANSACTION transaction_mode_list */ #line 1698 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "SESSION CHARACTERISTICS"; n->args = (yyvsp[0].list); n->jumble_args = true; n->location = -1; (yyval.vsetstmt) = n; } #line 33219 "gram_minimal.c" break; case 209: /* generic_set: var_name TO var_list */ #line 1713 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = (yyvsp[-2].str); n->args = (yyvsp[0].list); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33233 "gram_minimal.c" break; case 210: /* generic_set: var_name '=' var_list */ #line 1723 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = (yyvsp[-2].str); n->args = (yyvsp[0].list); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33247 "gram_minimal.c" break; case 211: /* generic_set: var_name TO DEFAULT */ #line 1733 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); n->location = -1; (yyval.vsetstmt) = n; } #line 33260 "gram_minimal.c" break; case 212: /* generic_set: var_name '=' DEFAULT */ #line 1742 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); n->location = -1; (yyval.vsetstmt) = n; } #line 33273 "gram_minimal.c" break; case 213: /* set_rest_more: generic_set */ #line 1753 "gram_minimal.y" {(yyval.vsetstmt) = (yyvsp[0].vsetstmt);} #line 33279 "gram_minimal.c" break; case 214: /* set_rest_more: var_name FROM CURRENT_P */ #line 1755 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_CURRENT; n->name = (yyvsp[-2].str); n->location = -1; (yyval.vsetstmt) = n; } #line 33292 "gram_minimal.c" break; case 215: /* set_rest_more: TIME ZONE zone_value */ #line 1765 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "timezone"; n->location = -1; n->jumble_args = true; if ((yyvsp[0].node) != NULL) n->args = list_make1((yyvsp[0].node)); else n->kind = VAR_SET_DEFAULT; (yyval.vsetstmt) = n; } #line 33310 "gram_minimal.c" break; case 216: /* set_rest_more: CATALOG_P Sconst */ #line 1779 "gram_minimal.y" { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("current database cannot be changed"), parser_errposition((yylsp[0])))); (yyval.vsetstmt) = NULL; /*not reached*/ } #line 33322 "gram_minimal.c" break; case 217: /* set_rest_more: SCHEMA Sconst */ #line 1787 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "search_path"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33336 "gram_minimal.c" break; case 218: /* set_rest_more: NAMES opt_encoding */ #line 1797 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "client_encoding"; n->location = (yylsp[0]); 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 33353 "gram_minimal.c" break; case 219: /* set_rest_more: ROLE NonReservedWord_or_Sconst */ #line 1810 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "role"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33367 "gram_minimal.c" break; case 220: /* set_rest_more: SESSION AUTHORIZATION NonReservedWord_or_Sconst */ #line 1820 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "session_authorization"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33381 "gram_minimal.c" break; case 221: /* set_rest_more: SESSION AUTHORIZATION DEFAULT */ #line 1830 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; n->location = -1; (yyval.vsetstmt) = n; } #line 33394 "gram_minimal.c" break; case 222: /* set_rest_more: XML_P OPTION document_or_content */ #line 1839 "gram_minimal.y" { 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]))); n->jumble_args = true; n->location = -1; (yyval.vsetstmt) = n; } #line 33409 "gram_minimal.c" break; case 223: /* set_rest_more: TRANSACTION SNAPSHOT Sconst */ #line 1851 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "TRANSACTION SNAPSHOT"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); n->location = (yylsp[0]); (yyval.vsetstmt) = n; } #line 33423 "gram_minimal.c" break; case 224: /* set_rest_more: SET CACHE DELETE_P Sconst */ #line 1862 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->name = (yyvsp[0].str); /* query to delete query cache */ (yyval.vsetstmt) = n; } #line 33433 "gram_minimal.c" break; case 225: /* var_name: ColId */ #line 1869 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 33439 "gram_minimal.c" break; case 226: /* var_name: var_name '.' ColId */ #line 1871 "gram_minimal.y" { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 33445 "gram_minimal.c" break; case 227: /* var_list: var_value */ #line 1874 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33451 "gram_minimal.c" break; case 228: /* var_list: var_list ',' var_value */ #line 1875 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33457 "gram_minimal.c" break; case 229: /* var_value: opt_boolean_or_string */ #line 1879 "gram_minimal.y" { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 33463 "gram_minimal.c" break; case 230: /* var_value: NumericOnly */ #line 1881 "gram_minimal.y" { (yyval.node) = makeAConst((yyvsp[0].node), (yylsp[0])); } #line 33469 "gram_minimal.c" break; case 231: /* iso_level: READ UNCOMMITTED */ #line 1884 "gram_minimal.y" { (yyval.str) = "read uncommitted"; } #line 33475 "gram_minimal.c" break; case 232: /* iso_level: READ COMMITTED */ #line 1885 "gram_minimal.y" { (yyval.str) = "read committed"; } #line 33481 "gram_minimal.c" break; case 233: /* iso_level: REPEATABLE READ */ #line 1886 "gram_minimal.y" { (yyval.str) = "repeatable read"; } #line 33487 "gram_minimal.c" break; case 234: /* iso_level: SERIALIZABLE */ #line 1887 "gram_minimal.y" { (yyval.str) = "serializable"; } #line 33493 "gram_minimal.c" break; case 235: /* opt_boolean_or_string: TRUE_P */ #line 1891 "gram_minimal.y" { (yyval.str) = "true"; } #line 33499 "gram_minimal.c" break; case 236: /* opt_boolean_or_string: FALSE_P */ #line 1892 "gram_minimal.y" { (yyval.str) = "false"; } #line 33505 "gram_minimal.c" break; case 237: /* opt_boolean_or_string: ON */ #line 1893 "gram_minimal.y" { (yyval.str) = "on"; } #line 33511 "gram_minimal.c" break; case 238: /* opt_boolean_or_string: NonReservedWord_or_Sconst */ #line 1899 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 33517 "gram_minimal.c" break; case 239: /* zone_value: Sconst */ #line 1912 "gram_minimal.y" { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 33525 "gram_minimal.c" break; case 240: /* zone_value: IDENT */ #line 1916 "gram_minimal.y" { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 33533 "gram_minimal.c" break; case 241: /* zone_value: ConstInterval Sconst opt_interval */ #line 1920 "gram_minimal.y" { 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 33554 "gram_minimal.c" break; case 242: /* zone_value: ConstInterval '(' Iconst ')' Sconst */ #line 1937 "gram_minimal.y" { 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 33566 "gram_minimal.c" break; case 243: /* zone_value: NumericOnly */ #line 1944 "gram_minimal.y" { (yyval.node) = makeAConst((yyvsp[0].node), (yylsp[0])); } #line 33572 "gram_minimal.c" break; case 244: /* zone_value: DEFAULT */ #line 1945 "gram_minimal.y" { (yyval.node) = NULL; } #line 33578 "gram_minimal.c" break; case 245: /* zone_value: LOCAL */ #line 1946 "gram_minimal.y" { (yyval.node) = NULL; } #line 33584 "gram_minimal.c" break; case 246: /* opt_encoding: Sconst */ #line 1950 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 33590 "gram_minimal.c" break; case 247: /* opt_encoding: DEFAULT */ #line 1951 "gram_minimal.y" { (yyval.str) = NULL; } #line 33596 "gram_minimal.c" break; case 248: /* opt_encoding: %empty */ #line 1952 "gram_minimal.y" { (yyval.str) = NULL; } #line 33602 "gram_minimal.c" break; case 249: /* NonReservedWord_or_Sconst: NonReservedWord */ #line 1956 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 33608 "gram_minimal.c" break; case 250: /* NonReservedWord_or_Sconst: Sconst */ #line 1957 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 33614 "gram_minimal.c" break; case 251: /* VariableResetStmt: RESET reset_rest */ #line 1961 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].vsetstmt); } #line 33620 "gram_minimal.c" break; case 252: /* VariableResetStmt: PGPOOL RESET generic_reset */ #line 1963 "gram_minimal.y" { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep the changes minimum */ (yyval.node) = (Node *) n; } #line 33630 "gram_minimal.c" break; case 253: /* reset_rest: generic_reset */ #line 1971 "gram_minimal.y" { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 33636 "gram_minimal.c" break; case 254: /* reset_rest: TIME ZONE */ #line 1973 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; n->location = -1; (yyval.vsetstmt) = n; } #line 33649 "gram_minimal.c" break; case 255: /* reset_rest: TRANSACTION ISOLATION LEVEL */ #line 1982 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; n->location = -1; (yyval.vsetstmt) = n; } #line 33662 "gram_minimal.c" break; case 256: /* reset_rest: SESSION AUTHORIZATION */ #line 1991 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; n->location = -1; (yyval.vsetstmt) = n; } #line 33675 "gram_minimal.c" break; case 257: /* generic_reset: var_name */ #line 2003 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = (yyvsp[0].str); n->location = -1; (yyval.vsetstmt) = n; } #line 33688 "gram_minimal.c" break; case 258: /* generic_reset: ALL */ #line 2012 "gram_minimal.y" { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; n->location = -1; (yyval.vsetstmt) = n; } #line 33700 "gram_minimal.c" break; case 259: /* SetResetClause: SET set_rest */ #line 2023 "gram_minimal.y" { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 33706 "gram_minimal.c" break; case 260: /* SetResetClause: VariableResetStmt */ #line 2024 "gram_minimal.y" { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 33712 "gram_minimal.c" break; case 261: /* FunctionSetResetClause: SET set_rest_more */ #line 2029 "gram_minimal.y" { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 33718 "gram_minimal.c" break; case 262: /* FunctionSetResetClause: VariableResetStmt */ #line 2030 "gram_minimal.y" { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 33724 "gram_minimal.c" break; case 263: /* VariableShowStmt: PGPOOL SHOW var_name */ #line 2037 "gram_minimal.y" { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33734 "gram_minimal.c" break; case 264: /* VariableShowStmt: PGPOOL SHOW ALL */ #line 2043 "gram_minimal.y" { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 33744 "gram_minimal.c" break; case 265: /* VariableShowStmt: SHOW var_name */ #line 2049 "gram_minimal.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33755 "gram_minimal.c" break; case 266: /* VariableShowStmt: SHOW TIME ZONE */ #line 2056 "gram_minimal.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "timezone"; (yyval.node) = (Node *) n; } #line 33766 "gram_minimal.c" break; case 267: /* VariableShowStmt: SHOW TRANSACTION ISOLATION LEVEL */ #line 2063 "gram_minimal.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "transaction_isolation"; (yyval.node) = (Node *) n; } #line 33777 "gram_minimal.c" break; case 268: /* VariableShowStmt: SHOW SESSION AUTHORIZATION */ #line 2070 "gram_minimal.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "session_authorization"; (yyval.node) = (Node *) n; } #line 33788 "gram_minimal.c" break; case 269: /* VariableShowStmt: SHOW ALL */ #line 2077 "gram_minimal.y" { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 33799 "gram_minimal.c" break; case 270: /* ConstraintsSetStmt: SET CONSTRAINTS constraints_set_list constraints_set_mode */ #line 2088 "gram_minimal.y" { ConstraintsSetStmt *n = makeNode(ConstraintsSetStmt); n->constraints = (yyvsp[-1].list); n->deferred = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 33811 "gram_minimal.c" break; case 271: /* constraints_set_list: ALL */ #line 2098 "gram_minimal.y" { (yyval.list) = NIL; } #line 33817 "gram_minimal.c" break; case 272: /* constraints_set_list: qualified_name_list */ #line 2099 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 33823 "gram_minimal.c" break; case 273: /* constraints_set_mode: DEFERRED */ #line 2103 "gram_minimal.y" { (yyval.boolean) = true; } #line 33829 "gram_minimal.c" break; case 274: /* constraints_set_mode: IMMEDIATE */ #line 2104 "gram_minimal.y" { (yyval.boolean) = false; } #line 33835 "gram_minimal.c" break; case 275: /* CheckPointStmt: CHECKPOINT */ #line 2113 "gram_minimal.y" { CheckPointStmt *n = makeNode(CheckPointStmt); (yyval.node) = (Node *) n; } #line 33845 "gram_minimal.c" break; case 276: /* DiscardStmt: DISCARD ALL */ #line 2129 "gram_minimal.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_ALL; (yyval.node) = (Node *) n; } #line 33856 "gram_minimal.c" break; case 277: /* DiscardStmt: DISCARD TEMP */ #line 2136 "gram_minimal.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 33867 "gram_minimal.c" break; case 278: /* DiscardStmt: DISCARD TEMPORARY */ #line 2143 "gram_minimal.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 33878 "gram_minimal.c" break; case 279: /* DiscardStmt: DISCARD PLANS */ #line 2150 "gram_minimal.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_PLANS; (yyval.node) = (Node *) n; } #line 33889 "gram_minimal.c" break; case 280: /* DiscardStmt: DISCARD SEQUENCES */ #line 2157 "gram_minimal.y" { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_SEQUENCES; (yyval.node) = (Node *) n; } #line 33900 "gram_minimal.c" break; case 281: /* AlterTableStmt: ALTER TABLE relation_expr alter_table_cmds */ #line 2177 "gram_minimal.y" { 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 33914 "gram_minimal.c" break; case 282: /* AlterTableStmt: ALTER TABLE IF_P EXISTS relation_expr alter_table_cmds */ #line 2187 "gram_minimal.y" { 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 33928 "gram_minimal.c" break; case 283: /* AlterTableStmt: ALTER TABLE relation_expr partition_cmd */ #line 2197 "gram_minimal.y" { 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 33942 "gram_minimal.c" break; case 284: /* AlterTableStmt: ALTER TABLE IF_P EXISTS relation_expr partition_cmd */ #line 2207 "gram_minimal.y" { 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 33956 "gram_minimal.c" break; case 285: /* AlterTableStmt: ALTER TABLE ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait */ #line 2217 "gram_minimal.y" { 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 33972 "gram_minimal.c" break; case 286: /* AlterTableStmt: ALTER TABLE ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait */ #line 2229 "gram_minimal.y" { 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 33988 "gram_minimal.c" break; case 287: /* AlterTableStmt: ALTER INDEX qualified_name alter_table_cmds */ #line 2241 "gram_minimal.y" { 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 34002 "gram_minimal.c" break; case 288: /* AlterTableStmt: ALTER INDEX IF_P EXISTS qualified_name alter_table_cmds */ #line 2251 "gram_minimal.y" { 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 34016 "gram_minimal.c" break; case 289: /* AlterTableStmt: ALTER INDEX qualified_name index_partition_cmd */ #line 2261 "gram_minimal.y" { 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 34030 "gram_minimal.c" break; case 290: /* AlterTableStmt: ALTER INDEX ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait */ #line 2271 "gram_minimal.y" { 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 34046 "gram_minimal.c" break; case 291: /* AlterTableStmt: ALTER INDEX ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait */ #line 2283 "gram_minimal.y" { 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 34062 "gram_minimal.c" break; case 292: /* AlterTableStmt: ALTER SEQUENCE qualified_name alter_table_cmds */ #line 2295 "gram_minimal.y" { 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 34076 "gram_minimal.c" break; case 293: /* AlterTableStmt: ALTER SEQUENCE IF_P EXISTS qualified_name alter_table_cmds */ #line 2305 "gram_minimal.y" { 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 34090 "gram_minimal.c" break; case 294: /* AlterTableStmt: ALTER VIEW qualified_name alter_table_cmds */ #line 2315 "gram_minimal.y" { 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 34104 "gram_minimal.c" break; case 295: /* AlterTableStmt: ALTER VIEW IF_P EXISTS qualified_name alter_table_cmds */ #line 2325 "gram_minimal.y" { 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 34118 "gram_minimal.c" break; case 296: /* AlterTableStmt: ALTER MATERIALIZED VIEW qualified_name alter_table_cmds */ #line 2335 "gram_minimal.y" { 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 34132 "gram_minimal.c" break; case 297: /* AlterTableStmt: ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name alter_table_cmds */ #line 2345 "gram_minimal.y" { 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 34146 "gram_minimal.c" break; case 298: /* AlterTableStmt: ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait */ #line 2355 "gram_minimal.y" { 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 34162 "gram_minimal.c" break; case 299: /* AlterTableStmt: ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait */ #line 2367 "gram_minimal.y" { 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 34178 "gram_minimal.c" break; case 300: /* AlterTableStmt: ALTER FOREIGN TABLE relation_expr alter_table_cmds */ #line 2379 "gram_minimal.y" { 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 34192 "gram_minimal.c" break; case 301: /* AlterTableStmt: ALTER FOREIGN TABLE IF_P EXISTS relation_expr alter_table_cmds */ #line 2389 "gram_minimal.y" { 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 34206 "gram_minimal.c" break; case 302: /* alter_table_cmds: alter_table_cmd */ #line 2401 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 34212 "gram_minimal.c" break; case 303: /* alter_table_cmds: alter_table_cmds ',' alter_table_cmd */ #line 2402 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 34218 "gram_minimal.c" break; case 304: /* partition_cmd: ATTACH PARTITION qualified_name PartitionBoundSpec */ #line 2408 "gram_minimal.y" { 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 34235 "gram_minimal.c" break; case 305: /* partition_cmd: DETACH PARTITION qualified_name opt_concurrently */ #line 2422 "gram_minimal.y" { 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 34252 "gram_minimal.c" break; case 306: /* partition_cmd: DETACH PARTITION qualified_name FINALIZE */ #line 2435 "gram_minimal.y" { 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 34268 "gram_minimal.c" break; case 307: /* index_partition_cmd: ATTACH PARTITION qualified_name */ #line 2451 "gram_minimal.y" { 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 34285 "gram_minimal.c" break; case 308: /* alter_table_cmd: ADD_P columnDef */ #line 2468 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 34298 "gram_minimal.c" break; case 309: /* alter_table_cmd: ADD_P IF_P NOT EXISTS columnDef */ #line 2478 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 34311 "gram_minimal.c" break; case 310: /* alter_table_cmd: ADD_P COLUMN columnDef */ #line 2488 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 34324 "gram_minimal.c" break; case 311: /* alter_table_cmd: ADD_P COLUMN IF_P NOT EXISTS columnDef */ #line 2498 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 34337 "gram_minimal.c" break; case 312: /* alter_table_cmd: ALTER opt_column ColId alter_column_default */ #line 2508 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ColumnDefault; n->name = (yyvsp[-1].str); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 34350 "gram_minimal.c" break; case 313: /* alter_table_cmd: ALTER opt_column ColId DROP NOT NULL_P */ #line 2518 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 34362 "gram_minimal.c" break; case 314: /* alter_table_cmd: ALTER opt_column ColId SET NOT NULL_P */ #line 2527 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 34374 "gram_minimal.c" break; case 315: /* alter_table_cmd: ALTER opt_column ColId SET EXPRESSION AS '(' a_expr ')' */ #line 2536 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetExpression; n->name = (yyvsp[-6].str); n->def = (yyvsp[-1].node); (yyval.node) = (Node *) n; } #line 34387 "gram_minimal.c" break; case 316: /* alter_table_cmd: ALTER opt_column ColId DROP EXPRESSION */ #line 2546 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = (yyvsp[-2].str); (yyval.node) = (Node *) n; } #line 34399 "gram_minimal.c" break; case 317: /* alter_table_cmd: ALTER opt_column ColId DROP EXPRESSION IF_P EXISTS */ #line 2555 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 34412 "gram_minimal.c" break; case 318: /* alter_table_cmd: ALTER opt_column ColId SET STATISTICS set_statistics_value */ #line 2565 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStatistics; n->name = (yyvsp[-3].str); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 34425 "gram_minimal.c" break; case 319: /* alter_table_cmd: ALTER opt_column Iconst SET STATISTICS set_statistics_value */ #line 2575 "gram_minimal.y" { 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 34444 "gram_minimal.c" break; case 320: /* alter_table_cmd: ALTER opt_column ColId SET reloptions */ #line 2591 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetOptions; n->name = (yyvsp[-2].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34457 "gram_minimal.c" break; case 321: /* alter_table_cmd: ALTER opt_column ColId RESET reloptions */ #line 2601 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetOptions; n->name = (yyvsp[-2].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34470 "gram_minimal.c" break; case 322: /* alter_table_cmd: ALTER opt_column ColId SET column_storage */ #line 2611 "gram_minimal.y" { 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 34483 "gram_minimal.c" break; case 323: /* alter_table_cmd: ALTER opt_column ColId SET column_compression */ #line 2621 "gram_minimal.y" { 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 34496 "gram_minimal.c" break; case 324: /* alter_table_cmd: ALTER opt_column ColId ADD_P GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList */ #line 2631 "gram_minimal.y" { 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 34516 "gram_minimal.c" break; case 325: /* alter_table_cmd: ALTER opt_column ColId alter_identity_column_option_list */ #line 2648 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetIdentity; n->name = (yyvsp[-1].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34529 "gram_minimal.c" break; case 326: /* alter_table_cmd: ALTER opt_column ColId DROP IDENTITY_P */ #line 2658 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = (yyvsp[-2].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 34542 "gram_minimal.c" break; case 327: /* alter_table_cmd: ALTER opt_column ColId DROP IDENTITY_P IF_P EXISTS */ #line 2668 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 34555 "gram_minimal.c" break; case 328: /* alter_table_cmd: DROP opt_column IF_P EXISTS ColId opt_drop_behavior */ #line 2678 "gram_minimal.y" { 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 34569 "gram_minimal.c" break; case 329: /* alter_table_cmd: DROP opt_column ColId opt_drop_behavior */ #line 2689 "gram_minimal.y" { 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 34583 "gram_minimal.c" break; case 330: /* alter_table_cmd: ALTER opt_column ColId opt_set_data TYPE_P Typename opt_collate_clause alter_using */ #line 2703 "gram_minimal.y" { 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 34602 "gram_minimal.c" break; case 331: /* alter_table_cmd: ALTER opt_column ColId alter_generic_options */ #line 2719 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AlterColumnGenericOptions; n->name = (yyvsp[-1].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 34614 "gram_minimal.c" break; case 332: /* alter_table_cmd: ADD_P TableConstraint */ #line 2728 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddConstraint; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 34626 "gram_minimal.c" break; case 333: /* alter_table_cmd: ALTER CONSTRAINT name ConstraintAttributeSpec */ #line 2737 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); ATAlterConstraint *c = makeNode(ATAlterConstraint); n->subtype = AT_AlterConstraint; n->def = (Node *) c; c->conname = (yyvsp[-1].str); if ((yyvsp[0].ival) & (CAS_NOT_ENFORCED | CAS_ENFORCED)) c->alterEnforceability = true; if ((yyvsp[0].ival) & (CAS_DEFERRABLE | CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED | CAS_INITIALLY_IMMEDIATE)) c->alterDeferrability = true; if ((yyvsp[0].ival) & CAS_NO_INHERIT) c->alterInheritability = true; /* handle unsupported case with specific error message */ if ((yyvsp[0].ival) & CAS_NOT_VALID) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("constraints cannot be altered to be NOT VALID"), parser_errposition((yylsp[0])))); processCASbits((yyvsp[0].ival), (yylsp[0]), "FOREIGN KEY", &c->deferrable, &c->initdeferred, &c->is_enforced, NULL, &c->noinherit, yyscanner); (yyval.node) = (Node *) n; } #line 34660 "gram_minimal.c" break; case 334: /* alter_table_cmd: ALTER CONSTRAINT name INHERIT */ #line 2768 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); ATAlterConstraint *c = makeNode(ATAlterConstraint); n->subtype = AT_AlterConstraint; n->def = (Node *) c; c->conname = (yyvsp[-1].str); c->alterInheritability = true; c->noinherit = false; (yyval.node) = (Node *) n; } #line 34677 "gram_minimal.c" break; case 335: /* alter_table_cmd: VALIDATE CONSTRAINT name */ #line 2782 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ValidateConstraint; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34689 "gram_minimal.c" break; case 336: /* alter_table_cmd: DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior */ #line 2791 "gram_minimal.y" { 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 34703 "gram_minimal.c" break; case 337: /* alter_table_cmd: DROP CONSTRAINT name opt_drop_behavior */ #line 2802 "gram_minimal.y" { 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 34717 "gram_minimal.c" break; case 338: /* alter_table_cmd: SET WITHOUT OIDS */ #line 2813 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOids; (yyval.node) = (Node *) n; } #line 34728 "gram_minimal.c" break; case 339: /* alter_table_cmd: CLUSTER ON name */ #line 2821 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ClusterOn; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34740 "gram_minimal.c" break; case 340: /* alter_table_cmd: SET WITHOUT CLUSTER */ #line 2830 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropCluster; n->name = NULL; (yyval.node) = (Node *) n; } #line 34752 "gram_minimal.c" break; case 341: /* alter_table_cmd: SET LOGGED */ #line 2839 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetLogged; (yyval.node) = (Node *) n; } #line 34763 "gram_minimal.c" break; case 342: /* alter_table_cmd: SET UNLOGGED */ #line 2847 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetUnLogged; (yyval.node) = (Node *) n; } #line 34774 "gram_minimal.c" break; case 343: /* alter_table_cmd: ENABLE_P TRIGGER name */ #line 2855 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34786 "gram_minimal.c" break; case 344: /* alter_table_cmd: ENABLE_P ALWAYS TRIGGER name */ #line 2864 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34798 "gram_minimal.c" break; case 345: /* alter_table_cmd: ENABLE_P REPLICA TRIGGER name */ #line 2873 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34810 "gram_minimal.c" break; case 346: /* alter_table_cmd: ENABLE_P TRIGGER ALL */ #line 2882 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigAll; (yyval.node) = (Node *) n; } #line 34821 "gram_minimal.c" break; case 347: /* alter_table_cmd: ENABLE_P TRIGGER USER */ #line 2890 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigUser; (yyval.node) = (Node *) n; } #line 34832 "gram_minimal.c" break; case 348: /* alter_table_cmd: DISABLE_P TRIGGER name */ #line 2898 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34844 "gram_minimal.c" break; case 349: /* alter_table_cmd: DISABLE_P TRIGGER ALL */ #line 2907 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigAll; (yyval.node) = (Node *) n; } #line 34855 "gram_minimal.c" break; case 350: /* alter_table_cmd: DISABLE_P TRIGGER USER */ #line 2915 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigUser; (yyval.node) = (Node *) n; } #line 34866 "gram_minimal.c" break; case 351: /* alter_table_cmd: ENABLE_P RULE name */ #line 2923 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34878 "gram_minimal.c" break; case 352: /* alter_table_cmd: ENABLE_P ALWAYS RULE name */ #line 2932 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34890 "gram_minimal.c" break; case 353: /* alter_table_cmd: ENABLE_P REPLICA RULE name */ #line 2941 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34902 "gram_minimal.c" break; case 354: /* alter_table_cmd: DISABLE_P RULE name */ #line 2950 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34914 "gram_minimal.c" break; case 355: /* alter_table_cmd: INHERIT qualified_name */ #line 2959 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *) n; } #line 34926 "gram_minimal.c" break; case 356: /* alter_table_cmd: NO INHERIT qualified_name */ #line 2968 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *) n; } #line 34938 "gram_minimal.c" break; case 357: /* alter_table_cmd: OF any_name */ #line 2977 "gram_minimal.y" { 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 34952 "gram_minimal.c" break; case 358: /* alter_table_cmd: NOT OF */ #line 2988 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOf; (yyval.node) = (Node *) n; } #line 34963 "gram_minimal.c" break; case 359: /* alter_table_cmd: OWNER TO RoleSpec */ #line 2996 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 34975 "gram_minimal.c" break; case 360: /* alter_table_cmd: SET ACCESS METHOD set_access_method_name */ #line 3005 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetAccessMethod; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34987 "gram_minimal.c" break; case 361: /* alter_table_cmd: SET TABLESPACE name */ #line 3014 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetTableSpace; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34999 "gram_minimal.c" break; case 362: /* alter_table_cmd: SET reloptions */ #line 3023 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetRelOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 35011 "gram_minimal.c" break; case 363: /* alter_table_cmd: RESET reloptions */ #line 3032 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetRelOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 35023 "gram_minimal.c" break; case 364: /* alter_table_cmd: REPLICA IDENTITY_P replica_identity */ #line 3041 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ReplicaIdentity; n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 35035 "gram_minimal.c" break; case 365: /* alter_table_cmd: ENABLE_P ROW LEVEL SECURITY */ #line 3050 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRowSecurity; (yyval.node) = (Node *) n; } #line 35046 "gram_minimal.c" break; case 366: /* alter_table_cmd: DISABLE_P ROW LEVEL SECURITY */ #line 3058 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRowSecurity; (yyval.node) = (Node *) n; } #line 35057 "gram_minimal.c" break; case 367: /* alter_table_cmd: FORCE ROW LEVEL SECURITY */ #line 3066 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ForceRowSecurity; (yyval.node) = (Node *) n; } #line 35068 "gram_minimal.c" break; case 368: /* alter_table_cmd: NO FORCE ROW LEVEL SECURITY */ #line 3074 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_NoForceRowSecurity; (yyval.node) = (Node *) n; } #line 35079 "gram_minimal.c" break; case 369: /* alter_table_cmd: alter_generic_options */ #line 3081 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_GenericOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 35091 "gram_minimal.c" break; case 370: /* alter_column_default: SET DEFAULT a_expr */ #line 3091 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 35097 "gram_minimal.c" break; case 371: /* alter_column_default: DROP DEFAULT */ #line 3092 "gram_minimal.y" { (yyval.node) = NULL; } #line 35103 "gram_minimal.c" break; case 372: /* opt_collate_clause: COLLATE any_name */ #line 3097 "gram_minimal.y" { CollateClause *n = makeNode(CollateClause); n->arg = NULL; n->collname = (yyvsp[0].list); n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 35116 "gram_minimal.c" break; case 373: /* opt_collate_clause: %empty */ #line 3105 "gram_minimal.y" { (yyval.node) = NULL; } #line 35122 "gram_minimal.c" break; case 374: /* alter_using: USING a_expr */ #line 3109 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 35128 "gram_minimal.c" break; case 375: /* alter_using: %empty */ #line 3110 "gram_minimal.y" { (yyval.node) = NULL; } #line 35134 "gram_minimal.c" break; case 376: /* replica_identity: NOTHING */ #line 3115 "gram_minimal.y" { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_NOTHING; n->name = NULL; (yyval.node) = (Node *) n; } #line 35146 "gram_minimal.c" break; case 377: /* replica_identity: FULL */ #line 3123 "gram_minimal.y" { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_FULL; n->name = NULL; (yyval.node) = (Node *) n; } #line 35158 "gram_minimal.c" break; case 378: /* replica_identity: DEFAULT */ #line 3131 "gram_minimal.y" { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_DEFAULT; n->name = NULL; (yyval.node) = (Node *) n; } #line 35170 "gram_minimal.c" break; case 379: /* replica_identity: USING INDEX name */ #line 3139 "gram_minimal.y" { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_INDEX; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 35182 "gram_minimal.c" break; case 380: /* reloptions: '(' reloption_list ')' */ #line 3149 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 35188 "gram_minimal.c" break; case 381: /* opt_reloptions: WITH reloptions */ #line 3152 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 35194 "gram_minimal.c" break; case 382: /* opt_reloptions: %empty */ #line 3153 "gram_minimal.y" { (yyval.list) = NIL; } #line 35200 "gram_minimal.c" break; case 383: /* reloption_list: reloption_elem */ #line 3157 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35206 "gram_minimal.c" break; case 384: /* reloption_list: reloption_list ',' reloption_elem */ #line 3158 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 35212 "gram_minimal.c" break; case 385: /* reloption_elem: ColLabel '=' def_arg */ #line 3164 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 35220 "gram_minimal.c" break; case 386: /* reloption_elem: ColLabel */ #line 3168 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 35228 "gram_minimal.c" break; case 387: /* reloption_elem: ColLabel '.' ColLabel '=' def_arg */ #line 3172 "gram_minimal.y" { (yyval.defelt) = makeDefElemExtended((yyvsp[-4].str), (yyvsp[-2].str), (Node *) (yyvsp[0].node), DEFELEM_UNSPEC, (yylsp[-4])); } #line 35237 "gram_minimal.c" break; case 388: /* reloption_elem: ColLabel '.' ColLabel */ #line 3177 "gram_minimal.y" { (yyval.defelt) = makeDefElemExtended((yyvsp[-2].str), (yyvsp[0].str), NULL, DEFELEM_UNSPEC, (yylsp[-2])); } #line 35245 "gram_minimal.c" break; case 389: /* alter_identity_column_option_list: alter_identity_column_option */ #line 3184 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35251 "gram_minimal.c" break; case 390: /* alter_identity_column_option_list: alter_identity_column_option_list alter_identity_column_option */ #line 3186 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 35257 "gram_minimal.c" break; case 391: /* alter_identity_column_option: RESTART */ #line 3191 "gram_minimal.y" { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 35265 "gram_minimal.c" break; case 392: /* alter_identity_column_option: RESTART opt_with NumericOnly */ #line 3195 "gram_minimal.y" { (yyval.defelt) = makeDefElem("restart", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 35273 "gram_minimal.c" break; case 393: /* alter_identity_column_option: SET SeqOptElem */ #line 3199 "gram_minimal.y" { 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 35288 "gram_minimal.c" break; case 394: /* alter_identity_column_option: SET GENERATED generated_when */ #line 3210 "gram_minimal.y" { (yyval.defelt) = makeDefElem("generated", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 35296 "gram_minimal.c" break; case 395: /* set_statistics_value: SignedIconst */ #line 3216 "gram_minimal.y" { (yyval.node) = (Node *) makeInteger((yyvsp[0].ival)); } #line 35302 "gram_minimal.c" break; case 396: /* set_statistics_value: DEFAULT */ #line 3217 "gram_minimal.y" { (yyval.node) = NULL; } #line 35308 "gram_minimal.c" break; case 397: /* set_access_method_name: ColId */ #line 3221 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 35314 "gram_minimal.c" break; case 398: /* set_access_method_name: DEFAULT */ #line 3222 "gram_minimal.y" { (yyval.str) = NULL; } #line 35320 "gram_minimal.c" break; case 399: /* PartitionBoundSpec: FOR VALUES WITH '(' hash_partbound ')' */ #line 3228 "gram_minimal.y" { 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"), parser_errposition((yylsp[-3])))); if (n->remainder == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("remainder for hash partition must be specified"), parser_errposition((yylsp[-3])))); n->location = (yylsp[-3]); (yyval.partboundspec) = n; } #line 35377 "gram_minimal.c" break; case 400: /* PartitionBoundSpec: FOR VALUES IN_P '(' expr_list ')' */ #line 3283 "gram_minimal.y" { 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 35392 "gram_minimal.c" break; case 401: /* PartitionBoundSpec: FOR VALUES FROM '(' expr_list ')' TO '(' expr_list ')' */ #line 3296 "gram_minimal.y" { 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 35408 "gram_minimal.c" break; case 402: /* PartitionBoundSpec: DEFAULT */ #line 3310 "gram_minimal.y" { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->is_default = true; n->location = (yylsp[0]); (yyval.partboundspec) = n; } #line 35421 "gram_minimal.c" break; case 403: /* hash_partbound_elem: NonReservedWord Iconst */ #line 3322 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 35429 "gram_minimal.c" break; case 404: /* hash_partbound: hash_partbound_elem */ #line 3329 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35437 "gram_minimal.c" break; case 405: /* hash_partbound: hash_partbound ',' hash_partbound_elem */ #line 3333 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 35445 "gram_minimal.c" break; case 406: /* AlterCompositeTypeStmt: ALTER TYPE_P any_name alter_type_cmds */ #line 3347 "gram_minimal.y" { 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 35459 "gram_minimal.c" break; case 407: /* alter_type_cmds: alter_type_cmd */ #line 3359 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 35465 "gram_minimal.c" break; case 408: /* alter_type_cmds: alter_type_cmds ',' alter_type_cmd */ #line 3360 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 35471 "gram_minimal.c" break; case 409: /* alter_type_cmd: ADD_P ATTRIBUTE TableFuncElement opt_drop_behavior */ #line 3366 "gram_minimal.y" { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[-1].node); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 35484 "gram_minimal.c" break; case 410: /* alter_type_cmd: DROP ATTRIBUTE IF_P EXISTS ColId opt_drop_behavior */ #line 3376 "gram_minimal.y" { 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 35498 "gram_minimal.c" break; case 411: /* alter_type_cmd: DROP ATTRIBUTE ColId opt_drop_behavior */ #line 3387 "gram_minimal.y" { 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 35512 "gram_minimal.c" break; case 412: /* alter_type_cmd: ALTER ATTRIBUTE ColId opt_set_data TYPE_P Typename opt_collate_clause opt_drop_behavior */ #line 3398 "gram_minimal.y" { 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 35532 "gram_minimal.c" break; case 413: /* ClosePortalStmt: CLOSE cursor_name */ #line 3425 "gram_minimal.y" { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 35543 "gram_minimal.c" break; case 414: /* ClosePortalStmt: CLOSE ALL */ #line 3432 "gram_minimal.y" { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = NULL; (yyval.node) = (Node *) n; } #line 35554 "gram_minimal.c" break; case 415: /* CopyStmt: COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause */ #line 3468 "gram_minimal.y" { 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 35592 "gram_minimal.c" break; case 416: /* CopyStmt: COPY '(' PreparableStmt ')' TO opt_program copy_file_name opt_with copy_options */ #line 3502 "gram_minimal.y" { 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 35616 "gram_minimal.c" break; case 417: /* copy_from: FROM */ #line 3524 "gram_minimal.y" { (yyval.boolean) = true; } #line 35622 "gram_minimal.c" break; case 418: /* copy_from: TO */ #line 3525 "gram_minimal.y" { (yyval.boolean) = false; } #line 35628 "gram_minimal.c" break; case 419: /* opt_program: PROGRAM */ #line 3529 "gram_minimal.y" { (yyval.boolean) = true; } #line 35634 "gram_minimal.c" break; case 420: /* opt_program: %empty */ #line 3530 "gram_minimal.y" { (yyval.boolean) = false; } #line 35640 "gram_minimal.c" break; case 421: /* copy_file_name: Sconst */ #line 3539 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 35646 "gram_minimal.c" break; case 422: /* copy_file_name: STDIN */ #line 3540 "gram_minimal.y" { (yyval.str) = NULL; } #line 35652 "gram_minimal.c" break; case 423: /* copy_file_name: STDOUT */ #line 3541 "gram_minimal.y" { (yyval.str) = NULL; } #line 35658 "gram_minimal.c" break; case 424: /* copy_options: copy_opt_list */ #line 3544 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 35664 "gram_minimal.c" break; case 425: /* copy_options: '(' copy_generic_opt_list ')' */ #line 3545 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 35670 "gram_minimal.c" break; case 426: /* copy_opt_list: copy_opt_list copy_opt_item */ #line 3550 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 35676 "gram_minimal.c" break; case 427: /* copy_opt_list: %empty */ #line 3551 "gram_minimal.y" { (yyval.list) = NIL; } #line 35682 "gram_minimal.c" break; case 428: /* copy_opt_item: BINARY */ #line 3556 "gram_minimal.y" { (yyval.defelt) = makeDefElem("format", (Node *) makeString("binary"), (yylsp[0])); } #line 35690 "gram_minimal.c" break; case 429: /* copy_opt_item: FREEZE */ #line 3560 "gram_minimal.y" { (yyval.defelt) = makeDefElem("freeze", (Node *) makeBoolean(true), (yylsp[0])); } #line 35698 "gram_minimal.c" break; case 430: /* copy_opt_item: DELIMITER opt_as Sconst */ #line 3564 "gram_minimal.y" { (yyval.defelt) = makeDefElem("delimiter", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 35706 "gram_minimal.c" break; case 431: /* copy_opt_item: NULL_P opt_as Sconst */ #line 3568 "gram_minimal.y" { (yyval.defelt) = makeDefElem("null", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 35714 "gram_minimal.c" break; case 432: /* copy_opt_item: CSV */ #line 3572 "gram_minimal.y" { (yyval.defelt) = makeDefElem("format", (Node *) makeString("csv"), (yylsp[0])); } #line 35722 "gram_minimal.c" break; case 433: /* copy_opt_item: HEADER_P */ #line 3576 "gram_minimal.y" { (yyval.defelt) = makeDefElem("header", (Node *) makeBoolean(true), (yylsp[0])); } #line 35730 "gram_minimal.c" break; case 434: /* copy_opt_item: QUOTE opt_as Sconst */ #line 3580 "gram_minimal.y" { (yyval.defelt) = makeDefElem("quote", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 35738 "gram_minimal.c" break; case 435: /* copy_opt_item: ESCAPE opt_as Sconst */ #line 3584 "gram_minimal.y" { (yyval.defelt) = makeDefElem("escape", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 35746 "gram_minimal.c" break; case 436: /* copy_opt_item: FORCE QUOTE columnList */ #line 3588 "gram_minimal.y" { (yyval.defelt) = makeDefElem("force_quote", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 35754 "gram_minimal.c" break; case 437: /* copy_opt_item: FORCE QUOTE '*' */ #line 3592 "gram_minimal.y" { (yyval.defelt) = makeDefElem("force_quote", (Node *) makeNode(A_Star), (yylsp[-2])); } #line 35762 "gram_minimal.c" break; case 438: /* copy_opt_item: FORCE NOT NULL_P columnList */ #line 3596 "gram_minimal.y" { (yyval.defelt) = makeDefElem("force_not_null", (Node *) (yyvsp[0].list), (yylsp[-3])); } #line 35770 "gram_minimal.c" break; case 439: /* copy_opt_item: FORCE NOT NULL_P '*' */ #line 3600 "gram_minimal.y" { (yyval.defelt) = makeDefElem("force_not_null", (Node *) makeNode(A_Star), (yylsp[-3])); } #line 35778 "gram_minimal.c" break; case 440: /* copy_opt_item: FORCE NULL_P columnList */ #line 3604 "gram_minimal.y" { (yyval.defelt) = makeDefElem("force_null", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 35786 "gram_minimal.c" break; case 441: /* copy_opt_item: FORCE NULL_P '*' */ #line 3608 "gram_minimal.y" { (yyval.defelt) = makeDefElem("force_null", (Node *) makeNode(A_Star), (yylsp[-2])); } #line 35794 "gram_minimal.c" break; case 442: /* copy_opt_item: ENCODING Sconst */ #line 3612 "gram_minimal.y" { (yyval.defelt) = makeDefElem("encoding", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 35802 "gram_minimal.c" break; case 443: /* opt_binary: BINARY */ #line 3621 "gram_minimal.y" { (yyval.defelt) = makeDefElem("format", (Node *) makeString("binary"), (yylsp[0])); } #line 35810 "gram_minimal.c" break; case 444: /* opt_binary: %empty */ #line 3624 "gram_minimal.y" { (yyval.defelt) = NULL; } #line 35816 "gram_minimal.c" break; case 445: /* copy_delimiter: opt_using DELIMITERS Sconst */ #line 3629 "gram_minimal.y" { (yyval.defelt) = makeDefElem("delimiter", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 35824 "gram_minimal.c" break; case 446: /* copy_delimiter: %empty */ #line 3632 "gram_minimal.y" { (yyval.defelt) = NULL; } #line 35830 "gram_minimal.c" break; case 449: /* copy_generic_opt_list: copy_generic_opt_elem */ #line 3643 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35838 "gram_minimal.c" break; case 450: /* copy_generic_opt_list: copy_generic_opt_list ',' copy_generic_opt_elem */ #line 3647 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 35846 "gram_minimal.c" break; case 451: /* copy_generic_opt_elem: ColLabel copy_generic_opt_arg */ #line 3654 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 35854 "gram_minimal.c" break; case 452: /* copy_generic_opt_arg: opt_boolean_or_string */ #line 3660 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 35860 "gram_minimal.c" break; case 453: /* copy_generic_opt_arg: NumericOnly */ #line 3661 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].node); } #line 35866 "gram_minimal.c" break; case 454: /* copy_generic_opt_arg: '*' */ #line 3662 "gram_minimal.y" { (yyval.node) = (Node *) makeNode(A_Star); } #line 35872 "gram_minimal.c" break; case 455: /* copy_generic_opt_arg: DEFAULT */ #line 3663 "gram_minimal.y" { (yyval.node) = (Node *) makeString("default"); } #line 35878 "gram_minimal.c" break; case 456: /* copy_generic_opt_arg: '(' copy_generic_opt_arg_list ')' */ #line 3664 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 35884 "gram_minimal.c" break; case 457: /* copy_generic_opt_arg: %empty */ #line 3665 "gram_minimal.y" { (yyval.node) = NULL; } #line 35890 "gram_minimal.c" break; case 458: /* copy_generic_opt_arg_list: copy_generic_opt_arg_list_item */ #line 3670 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 35898 "gram_minimal.c" break; case 459: /* copy_generic_opt_arg_list: copy_generic_opt_arg_list ',' copy_generic_opt_arg_list_item */ #line 3674 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 35906 "gram_minimal.c" break; case 460: /* copy_generic_opt_arg_list_item: opt_boolean_or_string */ #line 3681 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 35912 "gram_minimal.c" break; case 461: /* CreateStmt: CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3695 "gram_minimal.y" { 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 35934 "gram_minimal.c" break; case 462: /* CreateStmt: CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3715 "gram_minimal.y" { 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 35956 "gram_minimal.c" break; case 463: /* CreateStmt: CREATE OptTemp TABLE qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3735 "gram_minimal.y" { 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 35979 "gram_minimal.c" break; case 464: /* CreateStmt: CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3756 "gram_minimal.y" { 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 36002 "gram_minimal.c" break; case 465: /* CreateStmt: CREATE OptTemp TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3777 "gram_minimal.y" { 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 36025 "gram_minimal.c" break; case 466: /* CreateStmt: CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 3798 "gram_minimal.y" { 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 36048 "gram_minimal.c" break; case 467: /* OptTemp: TEMPORARY */ #line 3829 "gram_minimal.y" { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 36054 "gram_minimal.c" break; case 468: /* OptTemp: TEMP */ #line 3830 "gram_minimal.y" { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 36060 "gram_minimal.c" break; case 469: /* OptTemp: LOCAL TEMPORARY */ #line 3831 "gram_minimal.y" { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 36066 "gram_minimal.c" break; case 470: /* OptTemp: LOCAL TEMP */ #line 3832 "gram_minimal.y" { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 36072 "gram_minimal.c" break; case 471: /* OptTemp: GLOBAL TEMPORARY */ #line 3834 "gram_minimal.y" { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 36083 "gram_minimal.c" break; case 472: /* OptTemp: GLOBAL TEMP */ #line 3841 "gram_minimal.y" { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 36094 "gram_minimal.c" break; case 473: /* OptTemp: UNLOGGED */ #line 3847 "gram_minimal.y" { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 36100 "gram_minimal.c" break; case 474: /* OptTemp: %empty */ #line 3848 "gram_minimal.y" { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 36106 "gram_minimal.c" break; case 475: /* OptTableElementList: TableElementList */ #line 3852 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 36112 "gram_minimal.c" break; case 476: /* OptTableElementList: %empty */ #line 3853 "gram_minimal.y" { (yyval.list) = NIL; } #line 36118 "gram_minimal.c" break; case 477: /* OptTypedTableElementList: '(' TypedTableElementList ')' */ #line 3857 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 36124 "gram_minimal.c" break; case 478: /* OptTypedTableElementList: %empty */ #line 3858 "gram_minimal.y" { (yyval.list) = NIL; } #line 36130 "gram_minimal.c" break; case 479: /* TableElementList: TableElement */ #line 3863 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 36138 "gram_minimal.c" break; case 480: /* TableElementList: TableElementList ',' TableElement */ #line 3867 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36146 "gram_minimal.c" break; case 481: /* TypedTableElementList: TypedTableElement */ #line 3874 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 36154 "gram_minimal.c" break; case 482: /* TypedTableElementList: TypedTableElementList ',' TypedTableElement */ #line 3878 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36162 "gram_minimal.c" break; case 483: /* TableElement: columnDef */ #line 3884 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36168 "gram_minimal.c" break; case 484: /* TableElement: TableLikeClause */ #line 3885 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36174 "gram_minimal.c" break; case 485: /* TableElement: TableConstraint */ #line 3886 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36180 "gram_minimal.c" break; case 486: /* TypedTableElement: columnOptions */ #line 3890 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36186 "gram_minimal.c" break; case 487: /* TypedTableElement: TableConstraint */ #line 3891 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36192 "gram_minimal.c" break; case 488: /* columnDef: ColId Typename opt_column_storage opt_column_compression create_generic_options ColQualList */ #line 3895 "gram_minimal.y" { 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 36218 "gram_minimal.c" break; case 489: /* columnOptions: ColId ColQualList */ #line 3919 "gram_minimal.y" { 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 36241 "gram_minimal.c" break; case 490: /* columnOptions: ColId WITH OPTIONS ColQualList */ #line 3938 "gram_minimal.y" { 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 36264 "gram_minimal.c" break; case 491: /* column_compression: COMPRESSION ColId */ #line 3959 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 36270 "gram_minimal.c" break; case 492: /* column_compression: COMPRESSION DEFAULT */ #line 3960 "gram_minimal.y" { (yyval.str) = pstrdup("default"); } #line 36276 "gram_minimal.c" break; case 493: /* opt_column_compression: column_compression */ #line 3964 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 36282 "gram_minimal.c" break; case 494: /* opt_column_compression: %empty */ #line 3965 "gram_minimal.y" { (yyval.str) = NULL; } #line 36288 "gram_minimal.c" break; case 495: /* column_storage: STORAGE ColId */ #line 3969 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 36294 "gram_minimal.c" break; case 496: /* column_storage: STORAGE DEFAULT */ #line 3970 "gram_minimal.y" { (yyval.str) = pstrdup("default"); } #line 36300 "gram_minimal.c" break; case 497: /* opt_column_storage: column_storage */ #line 3974 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 36306 "gram_minimal.c" break; case 498: /* opt_column_storage: %empty */ #line 3975 "gram_minimal.y" { (yyval.str) = NULL; } #line 36312 "gram_minimal.c" break; case 499: /* ColQualList: ColQualList ColConstraint */ #line 3979 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 36318 "gram_minimal.c" break; case 500: /* ColQualList: %empty */ #line 3980 "gram_minimal.y" { (yyval.list) = NIL; } #line 36324 "gram_minimal.c" break; case 501: /* ColConstraint: CONSTRAINT name ColConstraintElem */ #line 3985 "gram_minimal.y" { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 36336 "gram_minimal.c" break; case 502: /* ColConstraint: ColConstraintElem */ #line 3992 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36342 "gram_minimal.c" break; case 503: /* ColConstraint: ConstraintAttr */ #line 3993 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36348 "gram_minimal.c" break; case 504: /* ColConstraint: COLLATE any_name */ #line 3995 "gram_minimal.y" { /* * 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 36366 "gram_minimal.c" break; case 505: /* ColConstraintElem: NOT NULL_P opt_no_inherit */ #line 4027 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-2]); n->is_no_inherit = (yyvsp[0].boolean); n->is_enforced = true; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *) n; } #line 36382 "gram_minimal.c" break; case 506: /* ColConstraintElem: NULL_P */ #line 4039 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 36394 "gram_minimal.c" break; case 507: /* ColConstraintElem: UNIQUE opt_unique_null_treatment opt_definition OptConsTableSpace */ #line 4047 "gram_minimal.y" { 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 36411 "gram_minimal.c" break; case 508: /* ColConstraintElem: PRIMARY KEY opt_definition OptConsTableSpace */ #line 4060 "gram_minimal.y" { 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 36427 "gram_minimal.c" break; case 509: /* ColConstraintElem: CHECK '(' a_expr ')' opt_no_inherit */ #line 4072 "gram_minimal.y" { 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->is_enforced = true; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *) n; } #line 36445 "gram_minimal.c" break; case 510: /* ColConstraintElem: DEFAULT b_expr */ #line 4086 "gram_minimal.y" { 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 36461 "gram_minimal.c" break; case 511: /* ColConstraintElem: GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList */ #line 4098 "gram_minimal.y" { 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 36475 "gram_minimal.c" break; case 512: /* ColConstraintElem: GENERATED generated_when AS '(' a_expr ')' opt_virtual_or_stored */ #line 4108 "gram_minimal.y" { 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->generated_kind = (yyvsp[0].ival); 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 36504 "gram_minimal.c" break; case 513: /* ColConstraintElem: REFERENCES qualified_name opt_column_list key_match key_actions */ #line 4133 "gram_minimal.y" { 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->is_enforced = true; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *) n; } #line 36526 "gram_minimal.c" break; case 514: /* opt_unique_null_treatment: NULLS_P DISTINCT */ #line 4153 "gram_minimal.y" { (yyval.boolean) = true; } #line 36532 "gram_minimal.c" break; case 515: /* opt_unique_null_treatment: NULLS_P NOT DISTINCT */ #line 4154 "gram_minimal.y" { (yyval.boolean) = false; } #line 36538 "gram_minimal.c" break; case 516: /* opt_unique_null_treatment: %empty */ #line 4155 "gram_minimal.y" { (yyval.boolean) = true; } #line 36544 "gram_minimal.c" break; case 517: /* generated_when: ALWAYS */ #line 4159 "gram_minimal.y" { (yyval.ival) = ATTRIBUTE_IDENTITY_ALWAYS; } #line 36550 "gram_minimal.c" break; case 518: /* generated_when: BY DEFAULT */ #line 4160 "gram_minimal.y" { (yyval.ival) = ATTRIBUTE_IDENTITY_BY_DEFAULT; } #line 36556 "gram_minimal.c" break; case 519: /* opt_virtual_or_stored: STORED */ #line 4164 "gram_minimal.y" { (yyval.ival) = ATTRIBUTE_GENERATED_STORED; } #line 36562 "gram_minimal.c" break; case 520: /* opt_virtual_or_stored: VIRTUAL */ #line 4165 "gram_minimal.y" { (yyval.ival) = ATTRIBUTE_GENERATED_VIRTUAL; } #line 36568 "gram_minimal.c" break; case 521: /* opt_virtual_or_stored: %empty */ #line 4166 "gram_minimal.y" { (yyval.ival) = ATTRIBUTE_GENERATED_VIRTUAL; } #line 36574 "gram_minimal.c" break; case 522: /* ConstraintAttr: DEFERRABLE */ #line 4186 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRABLE; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 36586 "gram_minimal.c" break; case 523: /* ConstraintAttr: NOT DEFERRABLE */ #line 4194 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_DEFERRABLE; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 36598 "gram_minimal.c" break; case 524: /* ConstraintAttr: INITIALLY DEFERRED */ #line 4202 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRED; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 36610 "gram_minimal.c" break; case 525: /* ConstraintAttr: INITIALLY IMMEDIATE */ #line 4210 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_IMMEDIATE; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 36622 "gram_minimal.c" break; case 526: /* ConstraintAttr: ENFORCED */ #line 4218 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_ENFORCED; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 36634 "gram_minimal.c" break; case 527: /* ConstraintAttr: NOT ENFORCED */ #line 4226 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_ENFORCED; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 36646 "gram_minimal.c" break; case 528: /* TableLikeClause: LIKE qualified_name TableLikeOptionList */ #line 4238 "gram_minimal.y" { TableLikeClause *n = makeNode(TableLikeClause); n->relation = (yyvsp[-1].range); n->options = (yyvsp[0].ival); n->relationOid = InvalidOid; (yyval.node) = (Node *) n; } #line 36659 "gram_minimal.c" break; case 529: /* TableLikeOptionList: TableLikeOptionList INCLUDING TableLikeOption */ #line 4249 "gram_minimal.y" { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 36665 "gram_minimal.c" break; case 530: /* TableLikeOptionList: TableLikeOptionList EXCLUDING TableLikeOption */ #line 4250 "gram_minimal.y" { (yyval.ival) = (yyvsp[-2].ival) & ~(yyvsp[0].ival); } #line 36671 "gram_minimal.c" break; case 531: /* TableLikeOptionList: %empty */ #line 4251 "gram_minimal.y" { (yyval.ival) = 0; } #line 36677 "gram_minimal.c" break; case 532: /* TableLikeOption: COMMENTS */ #line 4255 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_COMMENTS; } #line 36683 "gram_minimal.c" break; case 533: /* TableLikeOption: COMPRESSION */ #line 4256 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_COMPRESSION; } #line 36689 "gram_minimal.c" break; case 534: /* TableLikeOption: CONSTRAINTS */ #line 4257 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_CONSTRAINTS; } #line 36695 "gram_minimal.c" break; case 535: /* TableLikeOption: DEFAULTS */ #line 4258 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_DEFAULTS; } #line 36701 "gram_minimal.c" break; case 536: /* TableLikeOption: IDENTITY_P */ #line 4259 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_IDENTITY; } #line 36707 "gram_minimal.c" break; case 537: /* TableLikeOption: GENERATED */ #line 4260 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_GENERATED; } #line 36713 "gram_minimal.c" break; case 538: /* TableLikeOption: INDEXES */ #line 4261 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_INDEXES; } #line 36719 "gram_minimal.c" break; case 539: /* TableLikeOption: STATISTICS */ #line 4262 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_STATISTICS; } #line 36725 "gram_minimal.c" break; case 540: /* TableLikeOption: STORAGE */ #line 4263 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_STORAGE; } #line 36731 "gram_minimal.c" break; case 541: /* TableLikeOption: ALL */ #line 4264 "gram_minimal.y" { (yyval.ival) = CREATE_TABLE_LIKE_ALL; } #line 36737 "gram_minimal.c" break; case 542: /* TableConstraint: CONSTRAINT name ConstraintElem */ #line 4274 "gram_minimal.y" { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 36749 "gram_minimal.c" break; case 543: /* TableConstraint: ConstraintElem */ #line 4281 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36755 "gram_minimal.c" break; case 544: /* ConstraintElem: CHECK '(' a_expr ')' ConstraintAttributeSpec */ #line 4286 "gram_minimal.y" { 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->is_enforced, &n->skip_validation, &n->is_no_inherit, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (Node *) n; } #line 36773 "gram_minimal.c" break; case 545: /* ConstraintElem: NOT NULL_P ColId ConstraintAttributeSpec */ #line 4300 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-3]); n->keys = list_make1(makeString((yyvsp[-1].str))); processCASbits((yyvsp[0].ival), (yylsp[0]), "NOT NULL", NULL, NULL, NULL, &n->skip_validation, &n->is_no_inherit, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (Node *) n; } #line 36790 "gram_minimal.c" break; case 546: /* ConstraintElem: UNIQUE opt_unique_null_treatment '(' columnList opt_without_overlaps ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec */ #line 4314 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-9]); n->nulls_not_distinct = !(yyvsp[-8].boolean); n->keys = (yyvsp[-6].list); n->without_overlaps = (yyvsp[-5].boolean); 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36812 "gram_minimal.c" break; case 547: /* ConstraintElem: UNIQUE ExistingIndex ConstraintAttributeSpec */ #line 4332 "gram_minimal.y" { 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36832 "gram_minimal.c" break; case 548: /* ConstraintElem: PRIMARY KEY '(' columnList opt_without_overlaps ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec */ #line 4349 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-9]); n->keys = (yyvsp[-6].list); n->without_overlaps = (yyvsp[-5].boolean); 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36853 "gram_minimal.c" break; case 549: /* ConstraintElem: PRIMARY KEY ExistingIndex ConstraintAttributeSpec */ #line 4366 "gram_minimal.y" { 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36873 "gram_minimal.c" break; case 550: /* ConstraintElem: EXCLUDE access_method_clause '(' ExclusionConstraintList ')' opt_c_include opt_definition OptConsTableSpace OptWhereClause ConstraintAttributeSpec */ #line 4384 "gram_minimal.y" { 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, NULL, yyscanner); (yyval.node) = (Node *) n; } #line 36895 "gram_minimal.c" break; case 551: /* ConstraintElem: FOREIGN KEY '(' columnList optionalPeriodName ')' REFERENCES qualified_name opt_column_and_period_list key_match key_actions ConstraintAttributeSpec */ #line 4403 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_FOREIGN; n->location = (yylsp[-11]); n->pktable = (yyvsp[-4].range); n->fk_attrs = (yyvsp[-8].list); if ((yyvsp[-7].node)) { n->fk_attrs = lappend(n->fk_attrs, (yyvsp[-7].node)); n->fk_with_period = true; } n->pk_attrs = linitial((yyvsp[-3].list)); if (lsecond((yyvsp[-3].list))) { n->pk_attrs = lappend(n->pk_attrs, lsecond((yyvsp[-3].list))); n->pk_with_period = true; } 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->is_enforced, &n->skip_validation, NULL, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (Node *) n; } #line 36929 "gram_minimal.c" break; case 552: /* DomainConstraint: CONSTRAINT name DomainConstraintElem */ #line 4447 "gram_minimal.y" { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 36941 "gram_minimal.c" break; case 553: /* DomainConstraint: DomainConstraintElem */ #line 4454 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 36947 "gram_minimal.c" break; case 554: /* DomainConstraintElem: CHECK '(' a_expr ')' ConstraintAttributeSpec */ #line 4459 "gram_minimal.y" { 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, NULL, &n->skip_validation, &n->is_no_inherit, yyscanner); n->is_enforced = true; n->initially_valid = !n->skip_validation; (yyval.node) = (Node *) n; } #line 36966 "gram_minimal.c" break; case 555: /* DomainConstraintElem: NOT NULL_P ConstraintAttributeSpec */ #line 4474 "gram_minimal.y" { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-2]); n->keys = list_make1(makeString("value")); /* no NOT VALID, NO INHERIT support */ processCASbits((yyvsp[0].ival), (yylsp[0]), "NOT NULL", NULL, NULL, NULL, NULL, NULL, yyscanner); n->initially_valid = true; (yyval.node) = (Node *) n; } #line 36984 "gram_minimal.c" break; case 556: /* opt_no_inherit: NO INHERIT */ #line 4489 "gram_minimal.y" { (yyval.boolean) = true; } #line 36990 "gram_minimal.c" break; case 557: /* opt_no_inherit: %empty */ #line 4490 "gram_minimal.y" { (yyval.boolean) = false; } #line 36996 "gram_minimal.c" break; case 558: /* opt_without_overlaps: WITHOUT OVERLAPS */ #line 4494 "gram_minimal.y" { (yyval.boolean) = true; } #line 37002 "gram_minimal.c" break; case 559: /* opt_without_overlaps: %empty */ #line 4495 "gram_minimal.y" { (yyval.boolean) = false; } #line 37008 "gram_minimal.c" break; case 560: /* opt_column_list: '(' columnList ')' */ #line 4499 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 37014 "gram_minimal.c" break; case 561: /* opt_column_list: %empty */ #line 4500 "gram_minimal.y" { (yyval.list) = NIL; } #line 37020 "gram_minimal.c" break; case 562: /* columnList: columnElem */ #line 4504 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37026 "gram_minimal.c" break; case 563: /* columnList: columnList ',' columnElem */ #line 4505 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 37032 "gram_minimal.c" break; case 564: /* optionalPeriodName: ',' PERIOD columnElem */ #line 4509 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 37038 "gram_minimal.c" break; case 565: /* optionalPeriodName: %empty */ #line 4510 "gram_minimal.y" { (yyval.node) = NULL; } #line 37044 "gram_minimal.c" break; case 566: /* opt_column_and_period_list: '(' columnList optionalPeriodName ')' */ #line 4514 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-2].list), (yyvsp[-1].node)); } #line 37050 "gram_minimal.c" break; case 567: /* opt_column_and_period_list: %empty */ #line 4515 "gram_minimal.y" { (yyval.list) = list_make2(NIL, NULL); } #line 37056 "gram_minimal.c" break; case 568: /* columnElem: ColId */ #line 4519 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37064 "gram_minimal.c" break; case 569: /* opt_c_include: INCLUDE '(' columnList ')' */ #line 4524 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 37070 "gram_minimal.c" break; case 570: /* opt_c_include: %empty */ #line 4525 "gram_minimal.y" { (yyval.list) = NIL; } #line 37076 "gram_minimal.c" break; case 571: /* key_match: MATCH FULL */ #line 4529 "gram_minimal.y" { (yyval.ival) = FKCONSTR_MATCH_FULL; } #line 37084 "gram_minimal.c" break; case 572: /* key_match: MATCH PARTIAL */ #line 4533 "gram_minimal.y" { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("MATCH PARTIAL not yet implemented"), parser_errposition((yylsp[-1])))); (yyval.ival) = FKCONSTR_MATCH_PARTIAL; } #line 37096 "gram_minimal.c" break; case 573: /* key_match: MATCH SIMPLE */ #line 4541 "gram_minimal.y" { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 37104 "gram_minimal.c" break; case 574: /* key_match: %empty */ #line 4545 "gram_minimal.y" { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 37112 "gram_minimal.c" break; case 575: /* ExclusionConstraintList: ExclusionConstraintElem */ #line 4551 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].list)); } #line 37118 "gram_minimal.c" break; case 576: /* ExclusionConstraintList: ExclusionConstraintList ',' ExclusionConstraintElem */ #line 4553 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 37124 "gram_minimal.c" break; case 577: /* ExclusionConstraintElem: index_elem WITH any_operator */ #line 4557 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-2].ielem), (yyvsp[0].list)); } #line 37132 "gram_minimal.c" break; case 578: /* ExclusionConstraintElem: index_elem WITH OPERATOR '(' any_operator ')' */ #line 4562 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-5].ielem), (yyvsp[-1].list)); } #line 37140 "gram_minimal.c" break; case 579: /* OptWhereClause: WHERE '(' a_expr ')' */ #line 4568 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 37146 "gram_minimal.c" break; case 580: /* OptWhereClause: %empty */ #line 4569 "gram_minimal.y" { (yyval.node) = NULL; } #line 37152 "gram_minimal.c" break; case 581: /* key_actions: key_update */ #line 4574 "gram_minimal.y" { 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 37166 "gram_minimal.c" break; case 582: /* key_actions: key_delete */ #line 4584 "gram_minimal.y" { 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 37180 "gram_minimal.c" break; case 583: /* key_actions: key_update key_delete */ #line 4594 "gram_minimal.y" { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[-1].keyaction); n->deleteAction = (yyvsp[0].keyaction); (yyval.keyactions) = n; } #line 37192 "gram_minimal.c" break; case 584: /* key_actions: key_delete key_update */ #line 4602 "gram_minimal.y" { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[0].keyaction); n->deleteAction = (yyvsp[-1].keyaction); (yyval.keyactions) = n; } #line 37204 "gram_minimal.c" break; case 585: /* key_actions: %empty */ #line 4610 "gram_minimal.y" { 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 37220 "gram_minimal.c" break; case 586: /* key_update: ON UPDATE key_action */ #line 4624 "gram_minimal.y" { 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 37234 "gram_minimal.c" break; case 587: /* key_delete: ON DELETE_P key_action */ #line 4636 "gram_minimal.y" { (yyval.keyaction) = (yyvsp[0].keyaction); } #line 37242 "gram_minimal.c" break; case 588: /* key_action: NO ACTION */ #line 4643 "gram_minimal.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_NOACTION; n->cols = NIL; (yyval.keyaction) = n; } #line 37254 "gram_minimal.c" break; case 589: /* key_action: RESTRICT */ #line 4651 "gram_minimal.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_RESTRICT; n->cols = NIL; (yyval.keyaction) = n; } #line 37266 "gram_minimal.c" break; case 590: /* key_action: CASCADE */ #line 4659 "gram_minimal.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_CASCADE; n->cols = NIL; (yyval.keyaction) = n; } #line 37278 "gram_minimal.c" break; case 591: /* key_action: SET NULL_P opt_column_list */ #line 4667 "gram_minimal.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETNULL; n->cols = (yyvsp[0].list); (yyval.keyaction) = n; } #line 37290 "gram_minimal.c" break; case 592: /* key_action: SET DEFAULT opt_column_list */ #line 4675 "gram_minimal.y" { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETDEFAULT; n->cols = (yyvsp[0].list); (yyval.keyaction) = n; } #line 37302 "gram_minimal.c" break; case 593: /* OptInherit: INHERITS '(' qualified_name_list ')' */ #line 4684 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 37308 "gram_minimal.c" break; case 594: /* OptInherit: %empty */ #line 4685 "gram_minimal.y" { (yyval.list) = NIL; } #line 37314 "gram_minimal.c" break; case 595: /* OptPartitionSpec: PartitionSpec */ #line 4689 "gram_minimal.y" { (yyval.partspec) = (yyvsp[0].partspec); } #line 37320 "gram_minimal.c" break; case 596: /* OptPartitionSpec: %empty */ #line 4690 "gram_minimal.y" { (yyval.partspec) = NULL; } #line 37326 "gram_minimal.c" break; case 597: /* PartitionSpec: PARTITION BY ColId '(' part_params ')' */ #line 4694 "gram_minimal.y" { PartitionSpec *n = makeNode(PartitionSpec); n->strategy = parsePartitionStrategy((yyvsp[-3].str), (yylsp[-3]), yyscanner); n->partParams = (yyvsp[-1].list); n->location = (yylsp[-5]); (yyval.partspec) = n; } #line 37340 "gram_minimal.c" break; case 598: /* part_params: part_elem */ #line 4705 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].partelem)); } #line 37346 "gram_minimal.c" break; case 599: /* part_params: part_params ',' part_elem */ #line 4706 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].partelem)); } #line 37352 "gram_minimal.c" break; case 600: /* part_elem: ColId opt_collate opt_qualified_name */ #line 4710 "gram_minimal.y" { 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 37367 "gram_minimal.c" break; case 601: /* part_elem: func_expr_windowless opt_collate opt_qualified_name */ #line 4721 "gram_minimal.y" { 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 37382 "gram_minimal.c" break; case 602: /* part_elem: '(' a_expr ')' opt_collate opt_qualified_name */ #line 4732 "gram_minimal.y" { 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 37397 "gram_minimal.c" break; case 603: /* table_access_method_clause: USING name */ #line 4745 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 37403 "gram_minimal.c" break; case 604: /* table_access_method_clause: %empty */ #line 4746 "gram_minimal.y" { (yyval.str) = NULL; } #line 37409 "gram_minimal.c" break; case 605: /* OptWith: WITH reloptions */ #line 4751 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 37415 "gram_minimal.c" break; case 606: /* OptWith: WITHOUT OIDS */ #line 4752 "gram_minimal.y" { (yyval.list) = NIL; } #line 37421 "gram_minimal.c" break; case 607: /* OptWith: %empty */ #line 4753 "gram_minimal.y" { (yyval.list) = NIL; } #line 37427 "gram_minimal.c" break; case 608: /* OnCommitOption: ON COMMIT DROP */ #line 4756 "gram_minimal.y" { (yyval.oncommit) = ONCOMMIT_DROP; } #line 37433 "gram_minimal.c" break; case 609: /* OnCommitOption: ON COMMIT DELETE_P ROWS */ #line 4757 "gram_minimal.y" { (yyval.oncommit) = ONCOMMIT_DELETE_ROWS; } #line 37439 "gram_minimal.c" break; case 610: /* OnCommitOption: ON COMMIT PRESERVE ROWS */ #line 4758 "gram_minimal.y" { (yyval.oncommit) = ONCOMMIT_PRESERVE_ROWS; } #line 37445 "gram_minimal.c" break; case 611: /* OnCommitOption: %empty */ #line 4759 "gram_minimal.y" { (yyval.oncommit) = ONCOMMIT_NOOP; } #line 37451 "gram_minimal.c" break; case 612: /* OptTableSpace: TABLESPACE name */ #line 4762 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 37457 "gram_minimal.c" break; case 613: /* OptTableSpace: %empty */ #line 4763 "gram_minimal.y" { (yyval.str) = NULL; } #line 37463 "gram_minimal.c" break; case 614: /* OptConsTableSpace: USING INDEX TABLESPACE name */ #line 4766 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 37469 "gram_minimal.c" break; case 615: /* OptConsTableSpace: %empty */ #line 4767 "gram_minimal.y" { (yyval.str) = NULL; } #line 37475 "gram_minimal.c" break; case 616: /* ExistingIndex: USING INDEX name */ #line 4770 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 37481 "gram_minimal.c" break; case 617: /* CreateStatsStmt: CREATE STATISTICS opt_qualified_name opt_name_list ON stats_params FROM from_list */ #line 4792 "gram_minimal.y" { 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 37497 "gram_minimal.c" break; case 618: /* CreateStatsStmt: CREATE STATISTICS IF_P NOT EXISTS any_name opt_name_list ON stats_params FROM from_list */ #line 4805 "gram_minimal.y" { 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 37513 "gram_minimal.c" break; case 619: /* stats_params: stats_param */ #line 4825 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].selem)); } #line 37519 "gram_minimal.c" break; case 620: /* stats_params: stats_params ',' stats_param */ #line 4826 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].selem)); } #line 37525 "gram_minimal.c" break; case 621: /* stats_param: ColId */ #line 4830 "gram_minimal.y" { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = (yyvsp[0].str); (yyval.selem)->expr = NULL; } #line 37535 "gram_minimal.c" break; case 622: /* stats_param: func_expr_windowless */ #line 4836 "gram_minimal.y" { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = NULL; (yyval.selem)->expr = (yyvsp[0].node); } #line 37545 "gram_minimal.c" break; case 623: /* stats_param: '(' a_expr ')' */ #line 4842 "gram_minimal.y" { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = NULL; (yyval.selem)->expr = (yyvsp[-1].node); } #line 37555 "gram_minimal.c" break; case 624: /* AlterStatsStmt: ALTER STATISTICS any_name SET STATISTICS set_statistics_value */ #line 4859 "gram_minimal.y" { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = (yyvsp[-3].list); n->missing_ok = false; n->stxstattarget = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 37568 "gram_minimal.c" break; case 625: /* AlterStatsStmt: ALTER STATISTICS IF_P EXISTS any_name SET STATISTICS set_statistics_value */ #line 4868 "gram_minimal.y" { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = (yyvsp[-3].list); n->missing_ok = true; n->stxstattarget = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 37581 "gram_minimal.c" break; case 626: /* CreateAsStmt: CREATE OptTemp TABLE create_as_target AS SelectStmt opt_with_data */ #line 4890 "gram_minimal.y" { 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 37599 "gram_minimal.c" break; case 627: /* CreateAsStmt: CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS SelectStmt opt_with_data */ #line 4904 "gram_minimal.y" { 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 37617 "gram_minimal.c" break; case 628: /* create_as_target: qualified_name opt_column_list table_access_method_clause OptWith OnCommitOption OptTableSpace */ #line 4922 "gram_minimal.y" { (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 37633 "gram_minimal.c" break; case 629: /* opt_with_data: WITH DATA_P */ #line 4936 "gram_minimal.y" { (yyval.boolean) = true; } #line 37639 "gram_minimal.c" break; case 630: /* opt_with_data: WITH NO DATA_P */ #line 4937 "gram_minimal.y" { (yyval.boolean) = false; } #line 37645 "gram_minimal.c" break; case 631: /* opt_with_data: %empty */ #line 4938 "gram_minimal.y" { (yyval.boolean) = true; } #line 37651 "gram_minimal.c" break; case 632: /* CreateMatViewStmt: CREATE OptNoLog MATERIALIZED VIEW create_mv_target AS SelectStmt opt_with_data */ #line 4951 "gram_minimal.y" { 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 37669 "gram_minimal.c" break; case 633: /* CreateMatViewStmt: CREATE OptNoLog MATERIALIZED VIEW IF_P NOT EXISTS create_mv_target AS SelectStmt opt_with_data */ #line 4965 "gram_minimal.y" { 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 37687 "gram_minimal.c" break; case 634: /* create_mv_target: qualified_name opt_column_list table_access_method_clause opt_reloptions OptTableSpace */ #line 4982 "gram_minimal.y" { (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 37703 "gram_minimal.c" break; case 635: /* OptNoLog: UNLOGGED */ #line 4995 "gram_minimal.y" { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 37709 "gram_minimal.c" break; case 636: /* OptNoLog: %empty */ #line 4996 "gram_minimal.y" { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 37715 "gram_minimal.c" break; case 637: /* RefreshMatViewStmt: REFRESH MATERIALIZED VIEW opt_concurrently qualified_name opt_with_data */ #line 5009 "gram_minimal.y" { RefreshMatViewStmt *n = makeNode(RefreshMatViewStmt); n->concurrent = (yyvsp[-2].boolean); n->relation = (yyvsp[-1].range); n->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) n; } #line 37728 "gram_minimal.c" break; case 638: /* CreateSeqStmt: CREATE OptTemp SEQUENCE qualified_name OptSeqOptList */ #line 5030 "gram_minimal.y" { 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 37743 "gram_minimal.c" break; case 639: /* CreateSeqStmt: CREATE OptTemp SEQUENCE IF_P NOT EXISTS qualified_name OptSeqOptList */ #line 5041 "gram_minimal.y" { 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 37758 "gram_minimal.c" break; case 640: /* AlterSeqStmt: ALTER SEQUENCE qualified_name SeqOptList */ #line 5055 "gram_minimal.y" { AlterSeqStmt *n = makeNode(AlterSeqStmt); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 37771 "gram_minimal.c" break; case 641: /* AlterSeqStmt: ALTER SEQUENCE IF_P EXISTS qualified_name SeqOptList */ #line 5064 "gram_minimal.y" { AlterSeqStmt *n = makeNode(AlterSeqStmt); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 37784 "gram_minimal.c" break; case 642: /* OptSeqOptList: SeqOptList */ #line 5075 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 37790 "gram_minimal.c" break; case 643: /* OptSeqOptList: %empty */ #line 5076 "gram_minimal.y" { (yyval.list) = NIL; } #line 37796 "gram_minimal.c" break; case 644: /* OptParenthesizedSeqOptList: '(' SeqOptList ')' */ #line 5079 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 37802 "gram_minimal.c" break; case 645: /* OptParenthesizedSeqOptList: %empty */ #line 5080 "gram_minimal.y" { (yyval.list) = NIL; } #line 37808 "gram_minimal.c" break; case 646: /* SeqOptList: SeqOptElem */ #line 5083 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 37814 "gram_minimal.c" break; case 647: /* SeqOptList: SeqOptList SeqOptElem */ #line 5084 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 37820 "gram_minimal.c" break; case 648: /* SeqOptElem: AS SimpleTypename */ #line 5088 "gram_minimal.y" { (yyval.defelt) = makeDefElem("as", (Node *) (yyvsp[0].typnam), (yylsp[-1])); } #line 37828 "gram_minimal.c" break; case 649: /* SeqOptElem: CACHE NumericOnly */ #line 5092 "gram_minimal.y" { (yyval.defelt) = makeDefElem("cache", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 37836 "gram_minimal.c" break; case 650: /* SeqOptElem: CYCLE */ #line 5096 "gram_minimal.y" { (yyval.defelt) = makeDefElem("cycle", (Node *) makeBoolean(true), (yylsp[0])); } #line 37844 "gram_minimal.c" break; case 651: /* SeqOptElem: NO CYCLE */ #line 5100 "gram_minimal.y" { (yyval.defelt) = makeDefElem("cycle", (Node *) makeBoolean(false), (yylsp[-1])); } #line 37852 "gram_minimal.c" break; case 652: /* SeqOptElem: INCREMENT opt_by NumericOnly */ #line 5104 "gram_minimal.y" { (yyval.defelt) = makeDefElem("increment", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37860 "gram_minimal.c" break; case 653: /* SeqOptElem: LOGGED */ #line 5108 "gram_minimal.y" { (yyval.defelt) = makeDefElem("logged", NULL, (yylsp[0])); } #line 37868 "gram_minimal.c" break; case 654: /* SeqOptElem: MAXVALUE NumericOnly */ #line 5112 "gram_minimal.y" { (yyval.defelt) = makeDefElem("maxvalue", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 37876 "gram_minimal.c" break; case 655: /* SeqOptElem: MINVALUE NumericOnly */ #line 5116 "gram_minimal.y" { (yyval.defelt) = makeDefElem("minvalue", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 37884 "gram_minimal.c" break; case 656: /* SeqOptElem: NO MAXVALUE */ #line 5120 "gram_minimal.y" { (yyval.defelt) = makeDefElem("maxvalue", NULL, (yylsp[-1])); } #line 37892 "gram_minimal.c" break; case 657: /* SeqOptElem: NO MINVALUE */ #line 5124 "gram_minimal.y" { (yyval.defelt) = makeDefElem("minvalue", NULL, (yylsp[-1])); } #line 37900 "gram_minimal.c" break; case 658: /* SeqOptElem: OWNED BY any_name */ #line 5128 "gram_minimal.y" { (yyval.defelt) = makeDefElem("owned_by", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 37908 "gram_minimal.c" break; case 659: /* SeqOptElem: SEQUENCE NAME_P any_name */ #line 5132 "gram_minimal.y" { (yyval.defelt) = makeDefElem("sequence_name", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 37916 "gram_minimal.c" break; case 660: /* SeqOptElem: START opt_with NumericOnly */ #line 5136 "gram_minimal.y" { (yyval.defelt) = makeDefElem("start", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37924 "gram_minimal.c" break; case 661: /* SeqOptElem: RESTART */ #line 5140 "gram_minimal.y" { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 37932 "gram_minimal.c" break; case 662: /* SeqOptElem: RESTART opt_with NumericOnly */ #line 5144 "gram_minimal.y" { (yyval.defelt) = makeDefElem("restart", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37940 "gram_minimal.c" break; case 663: /* SeqOptElem: UNLOGGED */ #line 5148 "gram_minimal.y" { (yyval.defelt) = makeDefElem("unlogged", NULL, (yylsp[0])); } #line 37948 "gram_minimal.c" break; case 666: /* NumericOnly: FCONST */ #line 5158 "gram_minimal.y" { (yyval.node) = (Node *) makeFloat((yyvsp[0].str)); } #line 37954 "gram_minimal.c" break; case 667: /* NumericOnly: '+' FCONST */ #line 5159 "gram_minimal.y" { (yyval.node) = (Node *) makeFloat((yyvsp[0].str)); } #line 37960 "gram_minimal.c" break; case 668: /* NumericOnly: '-' FCONST */ #line 5161 "gram_minimal.y" { Float *f = makeFloat((yyvsp[0].str)); doNegateFloat(f); (yyval.node) = (Node *) f; } #line 37971 "gram_minimal.c" break; case 669: /* NumericOnly: SignedIconst */ #line 5167 "gram_minimal.y" { (yyval.node) = (Node *) makeInteger((yyvsp[0].ival)); } #line 37977 "gram_minimal.c" break; case 670: /* NumericOnly_list: NumericOnly */ #line 5170 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37983 "gram_minimal.c" break; case 671: /* NumericOnly_list: NumericOnly_list ',' NumericOnly */ #line 5171 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 37989 "gram_minimal.c" break; case 672: /* CreatePLangStmt: CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name */ #line 5184 "gram_minimal.y" { /* * 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 38009 "gram_minimal.c" break; case 673: /* CreatePLangStmt: CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name HANDLER handler_name opt_inline_handler opt_validator */ #line 5201 "gram_minimal.y" { 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 38025 "gram_minimal.c" break; case 674: /* opt_trusted: TRUSTED */ #line 5215 "gram_minimal.y" { (yyval.boolean) = true; } #line 38031 "gram_minimal.c" break; case 675: /* opt_trusted: %empty */ #line 5216 "gram_minimal.y" { (yyval.boolean) = false; } #line 38037 "gram_minimal.c" break; case 676: /* handler_name: name */ #line 5224 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 38043 "gram_minimal.c" break; case 677: /* handler_name: name attrs */ #line 5225 "gram_minimal.y" { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 38049 "gram_minimal.c" break; case 678: /* opt_inline_handler: INLINE_P handler_name */ #line 5229 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 38055 "gram_minimal.c" break; case 679: /* opt_inline_handler: %empty */ #line 5230 "gram_minimal.y" { (yyval.list) = NIL; } #line 38061 "gram_minimal.c" break; case 680: /* validator_clause: VALIDATOR handler_name */ #line 5234 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 38067 "gram_minimal.c" break; case 681: /* validator_clause: NO VALIDATOR */ #line 5235 "gram_minimal.y" { (yyval.list) = NIL; } #line 38073 "gram_minimal.c" break; case 682: /* opt_validator: validator_clause */ #line 5239 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 38079 "gram_minimal.c" break; case 683: /* opt_validator: %empty */ #line 5240 "gram_minimal.y" { (yyval.list) = NIL; } #line 38085 "gram_minimal.c" break; case 686: /* CreateTableSpaceStmt: CREATE TABLESPACE name OptTableSpaceOwner LOCATION Sconst opt_reloptions */ #line 5256 "gram_minimal.y" { 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 38099 "gram_minimal.c" break; case 687: /* OptTableSpaceOwner: OWNER RoleSpec */ #line 5267 "gram_minimal.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 38105 "gram_minimal.c" break; case 688: /* OptTableSpaceOwner: %empty */ #line 5268 "gram_minimal.y" { (yyval.rolespec) = NULL; } #line 38111 "gram_minimal.c" break; case 689: /* DropTableSpaceStmt: DROP TABLESPACE name */ #line 5282 "gram_minimal.y" { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 38123 "gram_minimal.c" break; case 690: /* DropTableSpaceStmt: DROP TABLESPACE IF_P EXISTS name */ #line 5290 "gram_minimal.y" { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 38135 "gram_minimal.c" break; case 691: /* CreateExtensionStmt: CREATE EXTENSION name opt_with create_extension_opt_list */ #line 5308 "gram_minimal.y" { CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->extname = (yyvsp[-2].str); n->if_not_exists = false; n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38148 "gram_minimal.c" break; case 692: /* CreateExtensionStmt: CREATE EXTENSION IF_P NOT EXISTS name opt_with create_extension_opt_list */ #line 5317 "gram_minimal.y" { CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->extname = (yyvsp[-2].str); n->if_not_exists = true; n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38161 "gram_minimal.c" break; case 693: /* create_extension_opt_list: create_extension_opt_list create_extension_opt_item */ #line 5329 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 38167 "gram_minimal.c" break; case 694: /* create_extension_opt_list: %empty */ #line 5331 "gram_minimal.y" { (yyval.list) = NIL; } #line 38173 "gram_minimal.c" break; case 695: /* create_extension_opt_item: SCHEMA name */ #line 5336 "gram_minimal.y" { (yyval.defelt) = makeDefElem("schema", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 38181 "gram_minimal.c" break; case 696: /* create_extension_opt_item: VERSION_P NonReservedWord_or_Sconst */ #line 5340 "gram_minimal.y" { (yyval.defelt) = makeDefElem("new_version", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 38189 "gram_minimal.c" break; case 697: /* create_extension_opt_item: FROM NonReservedWord_or_Sconst */ #line 5344 "gram_minimal.y" { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE EXTENSION ... FROM is no longer supported"), parser_errposition((yylsp[-1])))); } #line 38200 "gram_minimal.c" break; case 698: /* create_extension_opt_item: CASCADE */ #line 5351 "gram_minimal.y" { (yyval.defelt) = makeDefElem("cascade", (Node *) makeBoolean(true), (yylsp[0])); } #line 38208 "gram_minimal.c" break; case 699: /* AlterExtensionStmt: ALTER EXTENSION name UPDATE alter_extension_opt_list */ #line 5363 "gram_minimal.y" { AlterExtensionStmt *n = makeNode(AlterExtensionStmt); n->extname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38220 "gram_minimal.c" break; case 700: /* alter_extension_opt_list: alter_extension_opt_list alter_extension_opt_item */ #line 5374 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 38226 "gram_minimal.c" break; case 701: /* alter_extension_opt_list: %empty */ #line 5376 "gram_minimal.y" { (yyval.list) = NIL; } #line 38232 "gram_minimal.c" break; case 702: /* alter_extension_opt_item: TO NonReservedWord_or_Sconst */ #line 5381 "gram_minimal.y" { (yyval.defelt) = makeDefElem("new_version", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 38240 "gram_minimal.c" break; case 703: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop object_type_name name */ #line 5394 "gram_minimal.y" { 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 38254 "gram_minimal.c" break; case 704: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop object_type_any_name any_name */ #line 5404 "gram_minimal.y" { 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 38268 "gram_minimal.c" break; case 705: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop AGGREGATE aggregate_with_argtypes */ #line 5414 "gram_minimal.y" { 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 38282 "gram_minimal.c" break; case 706: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')' */ #line 5424 "gram_minimal.y" { 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 38296 "gram_minimal.c" break; case 707: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop DOMAIN_P Typename */ #line 5434 "gram_minimal.y" { 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 38310 "gram_minimal.c" break; case 708: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop FUNCTION function_with_argtypes */ #line 5444 "gram_minimal.y" { 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 38324 "gram_minimal.c" break; case 709: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop OPERATOR operator_with_argtypes */ #line 5454 "gram_minimal.y" { 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 38338 "gram_minimal.c" break; case 710: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING name */ #line 5464 "gram_minimal.y" { 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 38352 "gram_minimal.c" break; case 711: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop OPERATOR FAMILY any_name USING name */ #line 5474 "gram_minimal.y" { 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 38366 "gram_minimal.c" break; case 712: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop PROCEDURE function_with_argtypes */ #line 5484 "gram_minimal.y" { 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 38380 "gram_minimal.c" break; case 713: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop ROUTINE function_with_argtypes */ #line 5494 "gram_minimal.y" { 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 38394 "gram_minimal.c" break; case 714: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop TRANSFORM FOR Typename LANGUAGE name */ #line 5504 "gram_minimal.y" { 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 38408 "gram_minimal.c" break; case 715: /* AlterExtensionContentsStmt: ALTER EXTENSION name add_drop TYPE_P Typename */ #line 5514 "gram_minimal.y" { 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 38422 "gram_minimal.c" break; case 716: /* CreateFdwStmt: CREATE FOREIGN DATA_P WRAPPER name opt_fdw_options create_generic_options */ #line 5533 "gram_minimal.y" { 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 38435 "gram_minimal.c" break; case 717: /* fdw_option: HANDLER handler_name */ #line 5544 "gram_minimal.y" { (yyval.defelt) = makeDefElem("handler", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 38441 "gram_minimal.c" break; case 718: /* fdw_option: NO HANDLER */ #line 5545 "gram_minimal.y" { (yyval.defelt) = makeDefElem("handler", NULL, (yylsp[-1])); } #line 38447 "gram_minimal.c" break; case 719: /* fdw_option: VALIDATOR handler_name */ #line 5546 "gram_minimal.y" { (yyval.defelt) = makeDefElem("validator", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 38453 "gram_minimal.c" break; case 720: /* fdw_option: NO VALIDATOR */ #line 5547 "gram_minimal.y" { (yyval.defelt) = makeDefElem("validator", NULL, (yylsp[-1])); } #line 38459 "gram_minimal.c" break; case 721: /* fdw_options: fdw_option */ #line 5551 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38465 "gram_minimal.c" break; case 722: /* fdw_options: fdw_options fdw_option */ #line 5552 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 38471 "gram_minimal.c" break; case 723: /* opt_fdw_options: fdw_options */ #line 5556 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 38477 "gram_minimal.c" break; case 724: /* opt_fdw_options: %empty */ #line 5557 "gram_minimal.y" { (yyval.list) = NIL; } #line 38483 "gram_minimal.c" break; case 725: /* AlterFdwStmt: ALTER FOREIGN DATA_P WRAPPER name opt_fdw_options alter_generic_options */ #line 5568 "gram_minimal.y" { 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 38496 "gram_minimal.c" break; case 726: /* AlterFdwStmt: ALTER FOREIGN DATA_P WRAPPER name fdw_options */ #line 5577 "gram_minimal.y" { AlterFdwStmt *n = makeNode(AlterFdwStmt); n->fdwname = (yyvsp[-1].str); n->func_options = (yyvsp[0].list); n->options = NIL; (yyval.node) = (Node *) n; } #line 38509 "gram_minimal.c" break; case 727: /* create_generic_options: OPTIONS '(' generic_option_list ')' */ #line 5589 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 38515 "gram_minimal.c" break; case 728: /* create_generic_options: %empty */ #line 5590 "gram_minimal.y" { (yyval.list) = NIL; } #line 38521 "gram_minimal.c" break; case 729: /* generic_option_list: generic_option_elem */ #line 5595 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38529 "gram_minimal.c" break; case 730: /* generic_option_list: generic_option_list ',' generic_option_elem */ #line 5599 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 38537 "gram_minimal.c" break; case 731: /* alter_generic_options: OPTIONS '(' alter_generic_option_list ')' */ #line 5606 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 38543 "gram_minimal.c" break; case 732: /* alter_generic_option_list: alter_generic_option_elem */ #line 5611 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38551 "gram_minimal.c" break; case 733: /* alter_generic_option_list: alter_generic_option_list ',' alter_generic_option_elem */ #line 5615 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 38559 "gram_minimal.c" break; case 734: /* alter_generic_option_elem: generic_option_elem */ #line 5622 "gram_minimal.y" { (yyval.defelt) = (yyvsp[0].defelt); } #line 38567 "gram_minimal.c" break; case 735: /* alter_generic_option_elem: SET generic_option_elem */ #line 5626 "gram_minimal.y" { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_SET; } #line 38576 "gram_minimal.c" break; case 736: /* alter_generic_option_elem: ADD_P generic_option_elem */ #line 5631 "gram_minimal.y" { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_ADD; } #line 38585 "gram_minimal.c" break; case 737: /* alter_generic_option_elem: DROP generic_option_name */ #line 5636 "gram_minimal.y" { (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[0].str), NULL, DEFELEM_DROP, (yylsp[0])); } #line 38593 "gram_minimal.c" break; case 738: /* generic_option_elem: generic_option_name generic_option_arg */ #line 5643 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 38601 "gram_minimal.c" break; case 739: /* generic_option_name: ColLabel */ #line 5649 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 38607 "gram_minimal.c" break; case 740: /* generic_option_arg: Sconst */ #line 5654 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 38613 "gram_minimal.c" break; case 741: /* CreateForeignServerStmt: CREATE SERVER name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options */ #line 5666 "gram_minimal.y" { 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 38629 "gram_minimal.c" break; case 742: /* CreateForeignServerStmt: CREATE SERVER IF_P NOT EXISTS name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options */ #line 5679 "gram_minimal.y" { 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 38645 "gram_minimal.c" break; case 743: /* opt_type: TYPE_P Sconst */ #line 5693 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 38651 "gram_minimal.c" break; case 744: /* opt_type: %empty */ #line 5694 "gram_minimal.y" { (yyval.str) = NULL; } #line 38657 "gram_minimal.c" break; case 745: /* foreign_server_version: VERSION_P Sconst */ #line 5699 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 38663 "gram_minimal.c" break; case 746: /* foreign_server_version: VERSION_P NULL_P */ #line 5700 "gram_minimal.y" { (yyval.str) = NULL; } #line 38669 "gram_minimal.c" break; case 747: /* opt_foreign_server_version: foreign_server_version */ #line 5704 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 38675 "gram_minimal.c" break; case 748: /* opt_foreign_server_version: %empty */ #line 5705 "gram_minimal.y" { (yyval.str) = NULL; } #line 38681 "gram_minimal.c" break; case 749: /* AlterForeignServerStmt: ALTER SERVER name foreign_server_version alter_generic_options */ #line 5716 "gram_minimal.y" { 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 38695 "gram_minimal.c" break; case 750: /* AlterForeignServerStmt: ALTER SERVER name foreign_server_version */ #line 5726 "gram_minimal.y" { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->version = (yyvsp[0].str); n->has_version = true; (yyval.node) = (Node *) n; } #line 38708 "gram_minimal.c" break; case 751: /* AlterForeignServerStmt: ALTER SERVER name alter_generic_options */ #line 5735 "gram_minimal.y" { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38720 "gram_minimal.c" break; case 752: /* CreateForeignTableStmt: CREATE FOREIGN TABLE qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options */ #line 5755 "gram_minimal.y" { 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 38743 "gram_minimal.c" break; case 753: /* CreateForeignTableStmt: CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options */ #line 5776 "gram_minimal.y" { 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 38766 "gram_minimal.c" break; case 754: /* CreateForeignTableStmt: CREATE FOREIGN TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options */ #line 5797 "gram_minimal.y" { 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 38790 "gram_minimal.c" break; case 755: /* CreateForeignTableStmt: CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options */ #line 5819 "gram_minimal.y" { 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 38814 "gram_minimal.c" break; case 756: /* ImportForeignSchemaStmt: IMPORT_P FOREIGN SCHEMA name import_qualification FROM SERVER name INTO name create_generic_options */ #line 5852 "gram_minimal.y" { 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 38830 "gram_minimal.c" break; case 757: /* import_qualification_type: LIMIT TO */ #line 5866 "gram_minimal.y" { (yyval.ival) = FDW_IMPORT_SCHEMA_LIMIT_TO; } #line 38836 "gram_minimal.c" break; case 758: /* import_qualification_type: EXCEPT */ #line 5867 "gram_minimal.y" { (yyval.ival) = FDW_IMPORT_SCHEMA_EXCEPT; } #line 38842 "gram_minimal.c" break; case 759: /* import_qualification: import_qualification_type '(' relation_expr_list ')' */ #line 5872 "gram_minimal.y" { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = (yyvsp[-3].ival); n->table_names = (yyvsp[-1].list); (yyval.importqual) = n; } #line 38854 "gram_minimal.c" break; case 760: /* import_qualification: %empty */ #line 5880 "gram_minimal.y" { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = FDW_IMPORT_SCHEMA_ALL; n->table_names = NIL; (yyval.importqual) = n; } #line 38865 "gram_minimal.c" break; case 761: /* CreateUserMappingStmt: CREATE USER MAPPING FOR auth_ident SERVER name create_generic_options */ #line 5896 "gram_minimal.y" { 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 38879 "gram_minimal.c" break; case 762: /* CreateUserMappingStmt: CREATE USER MAPPING IF_P NOT EXISTS FOR auth_ident SERVER name create_generic_options */ #line 5906 "gram_minimal.y" { 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 38893 "gram_minimal.c" break; case 763: /* auth_ident: RoleSpec */ #line 5918 "gram_minimal.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 38899 "gram_minimal.c" break; case 764: /* auth_ident: USER */ #line 5919 "gram_minimal.y" { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 38905 "gram_minimal.c" break; case 765: /* DropUserMappingStmt: DROP USER MAPPING FOR auth_ident SERVER name */ #line 5932 "gram_minimal.y" { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = (yyvsp[-2].rolespec); n->servername = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 38918 "gram_minimal.c" break; case 766: /* DropUserMappingStmt: DROP USER MAPPING IF_P EXISTS FOR auth_ident SERVER name */ #line 5941 "gram_minimal.y" { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = (yyvsp[-2].rolespec); n->servername = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 38931 "gram_minimal.c" break; case 767: /* AlterUserMappingStmt: ALTER USER MAPPING FOR auth_ident SERVER name alter_generic_options */ #line 5959 "gram_minimal.y" { AlterUserMappingStmt *n = makeNode(AlterUserMappingStmt); n->user = (yyvsp[-3].rolespec); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 38944 "gram_minimal.c" break; case 768: /* CreatePolicyStmt: CREATE POLICY name ON qualified_name RowSecurityDefaultPermissive RowSecurityDefaultForCmd RowSecurityDefaultToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck */ #line 5986 "gram_minimal.y" { 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 38961 "gram_minimal.c" break; case 769: /* AlterPolicyStmt: ALTER POLICY name ON qualified_name RowSecurityOptionalToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck */ #line 6003 "gram_minimal.y" { 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 38976 "gram_minimal.c" break; case 770: /* RowSecurityOptionalExpr: USING '(' a_expr ')' */ #line 6016 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 38982 "gram_minimal.c" break; case 771: /* RowSecurityOptionalExpr: %empty */ #line 6017 "gram_minimal.y" { (yyval.node) = NULL; } #line 38988 "gram_minimal.c" break; case 772: /* RowSecurityOptionalWithCheck: WITH CHECK '(' a_expr ')' */ #line 6021 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 38994 "gram_minimal.c" break; case 773: /* RowSecurityOptionalWithCheck: %empty */ #line 6022 "gram_minimal.y" { (yyval.node) = NULL; } #line 39000 "gram_minimal.c" break; case 774: /* RowSecurityDefaultToRole: TO role_list */ #line 6026 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 39006 "gram_minimal.c" break; case 775: /* RowSecurityDefaultToRole: %empty */ #line 6027 "gram_minimal.y" { (yyval.list) = list_make1(makeRoleSpec(ROLESPEC_PUBLIC, -1)); } #line 39012 "gram_minimal.c" break; case 776: /* RowSecurityOptionalToRole: TO role_list */ #line 6031 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 39018 "gram_minimal.c" break; case 777: /* RowSecurityOptionalToRole: %empty */ #line 6032 "gram_minimal.y" { (yyval.list) = NULL; } #line 39024 "gram_minimal.c" break; case 778: /* RowSecurityDefaultPermissive: AS IDENT */ #line 6037 "gram_minimal.y" { 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 39042 "gram_minimal.c" break; case 779: /* RowSecurityDefaultPermissive: %empty */ #line 6050 "gram_minimal.y" { (yyval.boolean) = true; } #line 39048 "gram_minimal.c" break; case 780: /* RowSecurityDefaultForCmd: FOR row_security_cmd */ #line 6054 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 39054 "gram_minimal.c" break; case 781: /* RowSecurityDefaultForCmd: %empty */ #line 6055 "gram_minimal.y" { (yyval.str) = "all"; } #line 39060 "gram_minimal.c" break; case 782: /* row_security_cmd: ALL */ #line 6059 "gram_minimal.y" { (yyval.str) = "all"; } #line 39066 "gram_minimal.c" break; case 783: /* row_security_cmd: SELECT */ #line 6060 "gram_minimal.y" { (yyval.str) = "select"; } #line 39072 "gram_minimal.c" break; case 784: /* row_security_cmd: INSERT */ #line 6061 "gram_minimal.y" { (yyval.str) = "insert"; } #line 39078 "gram_minimal.c" break; case 785: /* row_security_cmd: UPDATE */ #line 6062 "gram_minimal.y" { (yyval.str) = "update"; } #line 39084 "gram_minimal.c" break; case 786: /* row_security_cmd: DELETE_P */ #line 6063 "gram_minimal.y" { (yyval.str) = "delete"; } #line 39090 "gram_minimal.c" break; case 787: /* CreateAmStmt: CREATE ACCESS METHOD name TYPE_P am_type HANDLER handler_name */ #line 6074 "gram_minimal.y" { 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 39103 "gram_minimal.c" break; case 788: /* am_type: INDEX */ #line 6085 "gram_minimal.y" { (yyval.chr) = AMTYPE_INDEX; } #line 39109 "gram_minimal.c" break; case 789: /* am_type: TABLE */ #line 6086 "gram_minimal.y" { (yyval.chr) = AMTYPE_TABLE; } #line 39115 "gram_minimal.c" break; case 790: /* CreateTrigStmt: CREATE opt_or_replace TRIGGER name TriggerActionTime TriggerEvents ON qualified_name TriggerReferencing TriggerForSpec TriggerWhen EXECUTE FUNCTION_or_PROCEDURE func_name '(' TriggerFuncArgs ')' */ #line 6100 "gram_minimal.y" { 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 39140 "gram_minimal.c" break; case 791: /* CreateTrigStmt: 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 ')' */ #line 6124 "gram_minimal.y" { 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"), parser_errposition((yylsp[-20])))); 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, NULL, yyscanner); n->constrrel = (yyvsp[-11].range); (yyval.node) = (Node *) n; } #line 39171 "gram_minimal.c" break; case 792: /* TriggerActionTime: BEFORE */ #line 6153 "gram_minimal.y" { (yyval.ival) = TRIGGER_TYPE_BEFORE; } #line 39177 "gram_minimal.c" break; case 793: /* TriggerActionTime: AFTER */ #line 6154 "gram_minimal.y" { (yyval.ival) = TRIGGER_TYPE_AFTER; } #line 39183 "gram_minimal.c" break; case 794: /* TriggerActionTime: INSTEAD OF */ #line 6155 "gram_minimal.y" { (yyval.ival) = TRIGGER_TYPE_INSTEAD; } #line 39189 "gram_minimal.c" break; case 795: /* TriggerEvents: TriggerOneEvent */ #line 6160 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 39195 "gram_minimal.c" break; case 796: /* TriggerEvents: TriggerEvents OR TriggerOneEvent */ #line 6162 "gram_minimal.y" { 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 39218 "gram_minimal.c" break; case 797: /* TriggerOneEvent: INSERT */ #line 6184 "gram_minimal.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); } #line 39224 "gram_minimal.c" break; case 798: /* TriggerOneEvent: DELETE_P */ #line 6186 "gram_minimal.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); } #line 39230 "gram_minimal.c" break; case 799: /* TriggerOneEvent: UPDATE */ #line 6188 "gram_minimal.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); } #line 39236 "gram_minimal.c" break; case 800: /* TriggerOneEvent: UPDATE OF columnList */ #line 6190 "gram_minimal.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), (yyvsp[0].list)); } #line 39242 "gram_minimal.c" break; case 801: /* TriggerOneEvent: TRUNCATE */ #line 6192 "gram_minimal.y" { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); } #line 39248 "gram_minimal.c" break; case 802: /* TriggerReferencing: REFERENCING TriggerTransitions */ #line 6196 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 39254 "gram_minimal.c" break; case 803: /* TriggerReferencing: %empty */ #line 6197 "gram_minimal.y" { (yyval.list) = NIL; } #line 39260 "gram_minimal.c" break; case 804: /* TriggerTransitions: TriggerTransition */ #line 6201 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 39266 "gram_minimal.c" break; case 805: /* TriggerTransitions: TriggerTransitions TriggerTransition */ #line 6202 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 39272 "gram_minimal.c" break; case 806: /* TriggerTransition: TransitionOldOrNew TransitionRowOrTable opt_as TransitionRelName */ #line 6207 "gram_minimal.y" { TriggerTransition *n = makeNode(TriggerTransition); n->name = (yyvsp[0].str); n->isNew = (yyvsp[-3].boolean); n->isTable = (yyvsp[-2].boolean); (yyval.node) = (Node *) n; } #line 39285 "gram_minimal.c" break; case 807: /* TransitionOldOrNew: NEW */ #line 6218 "gram_minimal.y" { (yyval.boolean) = true; } #line 39291 "gram_minimal.c" break; case 808: /* TransitionOldOrNew: OLD */ #line 6219 "gram_minimal.y" { (yyval.boolean) = false; } #line 39297 "gram_minimal.c" break; case 809: /* TransitionRowOrTable: TABLE */ #line 6223 "gram_minimal.y" { (yyval.boolean) = true; } #line 39303 "gram_minimal.c" break; case 810: /* TransitionRowOrTable: ROW */ #line 6232 "gram_minimal.y" { (yyval.boolean) = false; } #line 39309 "gram_minimal.c" break; case 811: /* TransitionRelName: ColId */ #line 6236 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 39315 "gram_minimal.c" break; case 812: /* TriggerForSpec: FOR TriggerForOptEach TriggerForType */ #line 6241 "gram_minimal.y" { (yyval.boolean) = (yyvsp[0].boolean); } #line 39323 "gram_minimal.c" break; case 813: /* TriggerForSpec: %empty */ #line 6245 "gram_minimal.y" { /* * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ (yyval.boolean) = false; } #line 39335 "gram_minimal.c" break; case 816: /* TriggerForType: ROW */ #line 6260 "gram_minimal.y" { (yyval.boolean) = true; } #line 39341 "gram_minimal.c" break; case 817: /* TriggerForType: STATEMENT */ #line 6261 "gram_minimal.y" { (yyval.boolean) = false; } #line 39347 "gram_minimal.c" break; case 818: /* TriggerWhen: WHEN '(' a_expr ')' */ #line 6265 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 39353 "gram_minimal.c" break; case 819: /* TriggerWhen: %empty */ #line 6266 "gram_minimal.y" { (yyval.node) = NULL; } #line 39359 "gram_minimal.c" break; case 822: /* TriggerFuncArgs: TriggerFuncArg */ #line 6275 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 39365 "gram_minimal.c" break; case 823: /* TriggerFuncArgs: TriggerFuncArgs ',' TriggerFuncArg */ #line 6276 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 39371 "gram_minimal.c" break; case 824: /* TriggerFuncArgs: %empty */ #line 6277 "gram_minimal.y" { (yyval.list) = NIL; } #line 39377 "gram_minimal.c" break; case 825: /* TriggerFuncArg: Iconst */ #line 6282 "gram_minimal.y" { (yyval.node) = (Node *) makeString(psprintf("%d", (yyvsp[0].ival))); } #line 39385 "gram_minimal.c" break; case 826: /* TriggerFuncArg: FCONST */ #line 6285 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39391 "gram_minimal.c" break; case 827: /* TriggerFuncArg: Sconst */ #line 6286 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39397 "gram_minimal.c" break; case 828: /* TriggerFuncArg: ColLabel */ #line 6287 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39403 "gram_minimal.c" break; case 829: /* OptConstrFromTable: FROM qualified_name */ #line 6291 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); } #line 39409 "gram_minimal.c" break; case 830: /* OptConstrFromTable: %empty */ #line 6292 "gram_minimal.y" { (yyval.range) = NULL; } #line 39415 "gram_minimal.c" break; case 831: /* ConstraintAttributeSpec: %empty */ #line 6297 "gram_minimal.y" { (yyval.ival) = 0; } #line 39421 "gram_minimal.c" break; case 832: /* ConstraintAttributeSpec: ConstraintAttributeSpec ConstraintAttributeElem */ #line 6299 "gram_minimal.y" { /* * 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) || (newspec & (CAS_NOT_ENFORCED | CAS_ENFORCED)) == (CAS_NOT_ENFORCED | CAS_ENFORCED)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("conflicting constraint properties"), parser_errposition((yylsp[0])))); (yyval.ival) = newspec; } #line 39450 "gram_minimal.c" break; case 833: /* ConstraintAttributeElem: NOT DEFERRABLE */ #line 6326 "gram_minimal.y" { (yyval.ival) = CAS_NOT_DEFERRABLE; } #line 39456 "gram_minimal.c" break; case 834: /* ConstraintAttributeElem: DEFERRABLE */ #line 6327 "gram_minimal.y" { (yyval.ival) = CAS_DEFERRABLE; } #line 39462 "gram_minimal.c" break; case 835: /* ConstraintAttributeElem: INITIALLY IMMEDIATE */ #line 6328 "gram_minimal.y" { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; } #line 39468 "gram_minimal.c" break; case 836: /* ConstraintAttributeElem: INITIALLY DEFERRED */ #line 6329 "gram_minimal.y" { (yyval.ival) = CAS_INITIALLY_DEFERRED; } #line 39474 "gram_minimal.c" break; case 837: /* ConstraintAttributeElem: NOT VALID */ #line 6330 "gram_minimal.y" { (yyval.ival) = CAS_NOT_VALID; } #line 39480 "gram_minimal.c" break; case 838: /* ConstraintAttributeElem: NO INHERIT */ #line 6331 "gram_minimal.y" { (yyval.ival) = CAS_NO_INHERIT; } #line 39486 "gram_minimal.c" break; case 839: /* ConstraintAttributeElem: NOT ENFORCED */ #line 6332 "gram_minimal.y" { (yyval.ival) = CAS_NOT_ENFORCED; } #line 39492 "gram_minimal.c" break; case 840: /* ConstraintAttributeElem: ENFORCED */ #line 6333 "gram_minimal.y" { (yyval.ival) = CAS_ENFORCED; } #line 39498 "gram_minimal.c" break; case 841: /* CreateEventTrigStmt: CREATE EVENT TRIGGER name ON ColLabel EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')' */ #line 6348 "gram_minimal.y" { 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 39512 "gram_minimal.c" break; case 842: /* CreateEventTrigStmt: CREATE EVENT TRIGGER name ON ColLabel WHEN event_trigger_when_list EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')' */ #line 6360 "gram_minimal.y" { 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 39526 "gram_minimal.c" break; case 843: /* event_trigger_when_list: event_trigger_when_item */ #line 6373 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39532 "gram_minimal.c" break; case 844: /* event_trigger_when_list: event_trigger_when_list AND event_trigger_when_item */ #line 6375 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39538 "gram_minimal.c" break; case 845: /* event_trigger_when_item: ColId IN_P '(' event_trigger_value_list ')' */ #line 6380 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-4].str), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 39544 "gram_minimal.c" break; case 846: /* event_trigger_value_list: SCONST */ #line 6385 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 39550 "gram_minimal.c" break; case 847: /* event_trigger_value_list: event_trigger_value_list ',' SCONST */ #line 6387 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 39556 "gram_minimal.c" break; case 848: /* AlterEventTrigStmt: ALTER EVENT TRIGGER name enable_trigger */ #line 6392 "gram_minimal.y" { AlterEventTrigStmt *n = makeNode(AlterEventTrigStmt); n->trigname = (yyvsp[-1].str); n->tgenabled = (yyvsp[0].chr); (yyval.node) = (Node *) n; } #line 39568 "gram_minimal.c" break; case 849: /* enable_trigger: ENABLE_P */ #line 6402 "gram_minimal.y" { (yyval.chr) = TRIGGER_FIRES_ON_ORIGIN; } #line 39574 "gram_minimal.c" break; case 850: /* enable_trigger: ENABLE_P REPLICA */ #line 6403 "gram_minimal.y" { (yyval.chr) = TRIGGER_FIRES_ON_REPLICA; } #line 39580 "gram_minimal.c" break; case 851: /* enable_trigger: ENABLE_P ALWAYS */ #line 6404 "gram_minimal.y" { (yyval.chr) = TRIGGER_FIRES_ALWAYS; } #line 39586 "gram_minimal.c" break; case 852: /* enable_trigger: DISABLE_P */ #line 6405 "gram_minimal.y" { (yyval.chr) = TRIGGER_DISABLED; } #line 39592 "gram_minimal.c" break; case 853: /* CreateAssertionStmt: CREATE ASSERTION any_name CHECK '(' a_expr ')' ConstraintAttributeSpec */ #line 6417 "gram_minimal.y" { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"), parser_errposition((yylsp[-7])))); (yyval.node) = NULL; } #line 39605 "gram_minimal.c" break; case 854: /* DefineStmt: CREATE opt_or_replace AGGREGATE func_name aggr_args definition */ #line 6437 "gram_minimal.y" { 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 39621 "gram_minimal.c" break; case 855: /* DefineStmt: CREATE opt_or_replace AGGREGATE func_name old_aggr_definition */ #line 6449 "gram_minimal.y" { /* 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 39638 "gram_minimal.c" break; case 856: /* DefineStmt: CREATE OPERATOR any_operator definition */ #line 6462 "gram_minimal.y" { 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 39653 "gram_minimal.c" break; case 857: /* DefineStmt: CREATE TYPE_P any_name definition */ #line 6473 "gram_minimal.y" { 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 39668 "gram_minimal.c" break; case 858: /* DefineStmt: CREATE TYPE_P any_name */ #line 6484 "gram_minimal.y" { /* 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 39684 "gram_minimal.c" break; case 859: /* DefineStmt: CREATE TYPE_P any_name AS '(' OptTableFuncElementList ')' */ #line 6496 "gram_minimal.y" { 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 39697 "gram_minimal.c" break; case 860: /* DefineStmt: CREATE TYPE_P any_name AS ENUM_P '(' opt_enum_val_list ')' */ #line 6505 "gram_minimal.y" { CreateEnumStmt *n = makeNode(CreateEnumStmt); n->typeName = (yyvsp[-5].list); n->vals = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 39709 "gram_minimal.c" break; case 861: /* DefineStmt: CREATE TYPE_P any_name AS RANGE definition */ #line 6513 "gram_minimal.y" { CreateRangeStmt *n = makeNode(CreateRangeStmt); n->typeName = (yyvsp[-3].list); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 39721 "gram_minimal.c" break; case 862: /* DefineStmt: CREATE TEXT_P SEARCH PARSER any_name definition */ #line 6521 "gram_minimal.y" { 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 39735 "gram_minimal.c" break; case 863: /* DefineStmt: CREATE TEXT_P SEARCH DICTIONARY any_name definition */ #line 6531 "gram_minimal.y" { 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 39749 "gram_minimal.c" break; case 864: /* DefineStmt: CREATE TEXT_P SEARCH TEMPLATE any_name definition */ #line 6541 "gram_minimal.y" { 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 39763 "gram_minimal.c" break; case 865: /* DefineStmt: CREATE TEXT_P SEARCH CONFIGURATION any_name definition */ #line 6551 "gram_minimal.y" { 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 39777 "gram_minimal.c" break; case 866: /* DefineStmt: CREATE COLLATION any_name definition */ #line 6561 "gram_minimal.y" { 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 39791 "gram_minimal.c" break; case 867: /* DefineStmt: CREATE COLLATION IF_P NOT EXISTS any_name definition */ #line 6571 "gram_minimal.y" { 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 39806 "gram_minimal.c" break; case 868: /* DefineStmt: CREATE COLLATION any_name FROM any_name */ #line 6582 "gram_minimal.y" { 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 39820 "gram_minimal.c" break; case 869: /* DefineStmt: CREATE COLLATION IF_P NOT EXISTS any_name FROM any_name */ #line 6592 "gram_minimal.y" { 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 39835 "gram_minimal.c" break; case 870: /* definition: '(' def_list ')' */ #line 6604 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 39841 "gram_minimal.c" break; case 871: /* def_list: def_elem */ #line 6607 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39847 "gram_minimal.c" break; case 872: /* def_list: def_list ',' def_elem */ #line 6608 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39853 "gram_minimal.c" break; case 873: /* def_elem: ColLabel '=' def_arg */ #line 6612 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 39861 "gram_minimal.c" break; case 874: /* def_elem: ColLabel */ #line 6616 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 39869 "gram_minimal.c" break; case 875: /* def_arg: func_type */ #line 6622 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].typnam); } #line 39875 "gram_minimal.c" break; case 876: /* def_arg: reserved_keyword */ #line 6623 "gram_minimal.y" { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 39881 "gram_minimal.c" break; case 877: /* def_arg: qual_all_Op */ #line 6624 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].list); } #line 39887 "gram_minimal.c" break; case 878: /* def_arg: NumericOnly */ #line 6625 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].node); } #line 39893 "gram_minimal.c" break; case 879: /* def_arg: Sconst */ #line 6626 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39899 "gram_minimal.c" break; case 880: /* def_arg: NONE */ #line 6627 "gram_minimal.y" { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 39905 "gram_minimal.c" break; case 881: /* old_aggr_definition: '(' old_aggr_list ')' */ #line 6630 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 39911 "gram_minimal.c" break; case 882: /* old_aggr_list: old_aggr_elem */ #line 6633 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39917 "gram_minimal.c" break; case 883: /* old_aggr_list: old_aggr_list ',' old_aggr_elem */ #line 6634 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39923 "gram_minimal.c" break; case 884: /* old_aggr_elem: IDENT '=' def_arg */ #line 6643 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 39931 "gram_minimal.c" break; case 885: /* opt_enum_val_list: enum_val_list */ #line 6649 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 39937 "gram_minimal.c" break; case 886: /* opt_enum_val_list: %empty */ #line 6650 "gram_minimal.y" { (yyval.list) = NIL; } #line 39943 "gram_minimal.c" break; case 887: /* enum_val_list: Sconst */ #line 6654 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 39949 "gram_minimal.c" break; case 888: /* enum_val_list: enum_val_list ',' Sconst */ #line 6656 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 39955 "gram_minimal.c" break; case 889: /* AlterEnumStmt: ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst */ #line 6667 "gram_minimal.y" { 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 39971 "gram_minimal.c" break; case 890: /* AlterEnumStmt: ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst BEFORE Sconst */ #line 6679 "gram_minimal.y" { 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 39987 "gram_minimal.c" break; case 891: /* AlterEnumStmt: ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst AFTER Sconst */ #line 6691 "gram_minimal.y" { 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 40003 "gram_minimal.c" break; case 892: /* AlterEnumStmt: ALTER TYPE_P any_name RENAME VALUE_P Sconst TO Sconst */ #line 6703 "gram_minimal.y" { 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 40019 "gram_minimal.c" break; case 893: /* AlterEnumStmt: ALTER TYPE_P any_name DROP VALUE_P Sconst */ #line 6715 "gram_minimal.y" { /* * 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 40050 "gram_minimal.c" break; case 894: /* opt_if_not_exists: IF_P NOT EXISTS */ #line 6743 "gram_minimal.y" { (yyval.boolean) = true; } #line 40056 "gram_minimal.c" break; case 895: /* opt_if_not_exists: %empty */ #line 6744 "gram_minimal.y" { (yyval.boolean) = false; } #line 40062 "gram_minimal.c" break; case 896: /* CreateOpClassStmt: CREATE OPERATOR CLASS any_name opt_default FOR TYPE_P Typename USING name opt_opfamily AS opclass_item_list */ #line 6762 "gram_minimal.y" { 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 40078 "gram_minimal.c" break; case 897: /* opclass_item_list: opclass_item */ #line 6776 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 40084 "gram_minimal.c" break; case 898: /* opclass_item_list: opclass_item_list ',' opclass_item */ #line 6777 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 40090 "gram_minimal.c" break; case 899: /* opclass_item: OPERATOR Iconst any_operator opclass_purpose */ #line 6782 "gram_minimal.y" { CreateOpClassItem *n = makeNode(CreateOpClassItem); ObjectWithArgs *owa = makeNode(ObjectWithArgs); owa->objname = (yyvsp[-1].list); owa->objargs = NIL; n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = owa; n->number = (yyvsp[-2].ival); n->order_family = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 40107 "gram_minimal.c" break; case 900: /* opclass_item: OPERATOR Iconst operator_with_argtypes opclass_purpose */ #line 6795 "gram_minimal.y" { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = (yyvsp[-1].objwithargs); n->number = (yyvsp[-2].ival); n->order_family = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 40121 "gram_minimal.c" break; case 901: /* opclass_item: FUNCTION Iconst function_with_argtypes */ #line 6805 "gram_minimal.y" { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = (yyvsp[0].objwithargs); n->number = (yyvsp[-1].ival); (yyval.node) = (Node *) n; } #line 40134 "gram_minimal.c" break; case 902: /* opclass_item: FUNCTION Iconst '(' type_list ')' function_with_argtypes */ #line 6814 "gram_minimal.y" { 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 40148 "gram_minimal.c" break; case 903: /* opclass_item: STORAGE Typename */ #line 6824 "gram_minimal.y" { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_STORAGETYPE; n->storedtype = (yyvsp[0].typnam); (yyval.node) = (Node *) n; } #line 40160 "gram_minimal.c" break; case 904: /* opt_default: DEFAULT */ #line 6833 "gram_minimal.y" { (yyval.boolean) = true; } #line 40166 "gram_minimal.c" break; case 905: /* opt_default: %empty */ #line 6834 "gram_minimal.y" { (yyval.boolean) = false; } #line 40172 "gram_minimal.c" break; case 906: /* opt_opfamily: FAMILY any_name */ #line 6837 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 40178 "gram_minimal.c" break; case 907: /* opt_opfamily: %empty */ #line 6838 "gram_minimal.y" { (yyval.list) = NIL; } #line 40184 "gram_minimal.c" break; case 908: /* opclass_purpose: FOR SEARCH */ #line 6841 "gram_minimal.y" { (yyval.list) = NIL; } #line 40190 "gram_minimal.c" break; case 909: /* opclass_purpose: FOR ORDER BY any_name */ #line 6842 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 40196 "gram_minimal.c" break; case 910: /* opclass_purpose: %empty */ #line 6843 "gram_minimal.y" { (yyval.list) = NIL; } #line 40202 "gram_minimal.c" break; case 911: /* CreateOpFamilyStmt: CREATE OPERATOR FAMILY any_name USING name */ #line 6849 "gram_minimal.y" { CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt); n->opfamilyname = (yyvsp[-2].list); n->amname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40214 "gram_minimal.c" break; case 912: /* AlterOpFamilyStmt: ALTER OPERATOR FAMILY any_name USING name ADD_P opclass_item_list */ #line 6860 "gram_minimal.y" { 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 40228 "gram_minimal.c" break; case 913: /* AlterOpFamilyStmt: ALTER OPERATOR FAMILY any_name USING name DROP opclass_drop_list */ #line 6870 "gram_minimal.y" { 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 40242 "gram_minimal.c" break; case 914: /* opclass_drop_list: opclass_drop */ #line 6882 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 40248 "gram_minimal.c" break; case 915: /* opclass_drop_list: opclass_drop_list ',' opclass_drop */ #line 6883 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 40254 "gram_minimal.c" break; case 916: /* opclass_drop: OPERATOR Iconst '(' type_list ')' */ #line 6888 "gram_minimal.y" { 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 40267 "gram_minimal.c" break; case 917: /* opclass_drop: FUNCTION Iconst '(' type_list ')' */ #line 6897 "gram_minimal.y" { 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 40280 "gram_minimal.c" break; case 918: /* DropOpClassStmt: DROP OPERATOR CLASS any_name USING name opt_drop_behavior */ #line 6910 "gram_minimal.y" { 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 40295 "gram_minimal.c" break; case 919: /* DropOpClassStmt: DROP OPERATOR CLASS IF_P EXISTS any_name USING name opt_drop_behavior */ #line 6921 "gram_minimal.y" { 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 40310 "gram_minimal.c" break; case 920: /* DropOpFamilyStmt: DROP OPERATOR FAMILY any_name USING name opt_drop_behavior */ #line 6935 "gram_minimal.y" { 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 40325 "gram_minimal.c" break; case 921: /* DropOpFamilyStmt: DROP OPERATOR FAMILY IF_P EXISTS any_name USING name opt_drop_behavior */ #line 6946 "gram_minimal.y" { 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 40340 "gram_minimal.c" break; case 922: /* DropOwnedStmt: DROP OWNED BY role_list opt_drop_behavior */ #line 6969 "gram_minimal.y" { DropOwnedStmt *n = makeNode(DropOwnedStmt); n->roles = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 40352 "gram_minimal.c" break; case 923: /* ReassignOwnedStmt: REASSIGN OWNED BY role_list TO RoleSpec */ #line 6980 "gram_minimal.y" { ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt); n->roles = (yyvsp[-2].list); n->newrole = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 40364 "gram_minimal.c" break; case 924: /* DropStmt: DROP object_type_any_name IF_P EXISTS any_name_list opt_drop_behavior */ #line 6999 "gram_minimal.y" { 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 40379 "gram_minimal.c" break; case 925: /* DropStmt: DROP object_type_any_name any_name_list opt_drop_behavior */ #line 7010 "gram_minimal.y" { 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 40394 "gram_minimal.c" break; case 926: /* DropStmt: DROP drop_type_name IF_P EXISTS name_list opt_drop_behavior */ #line 7021 "gram_minimal.y" { 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 40409 "gram_minimal.c" break; case 927: /* DropStmt: DROP drop_type_name name_list opt_drop_behavior */ #line 7032 "gram_minimal.y" { 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 40424 "gram_minimal.c" break; case 928: /* DropStmt: DROP object_type_name_on_any_name name ON any_name opt_drop_behavior */ #line 7043 "gram_minimal.y" { 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 40439 "gram_minimal.c" break; case 929: /* DropStmt: DROP object_type_name_on_any_name IF_P EXISTS name ON any_name opt_drop_behavior */ #line 7054 "gram_minimal.y" { 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 40454 "gram_minimal.c" break; case 930: /* DropStmt: DROP TYPE_P type_name_list opt_drop_behavior */ #line 7065 "gram_minimal.y" { 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 40469 "gram_minimal.c" break; case 931: /* DropStmt: DROP TYPE_P IF_P EXISTS type_name_list opt_drop_behavior */ #line 7076 "gram_minimal.y" { 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 40484 "gram_minimal.c" break; case 932: /* DropStmt: DROP DOMAIN_P type_name_list opt_drop_behavior */ #line 7087 "gram_minimal.y" { 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 40499 "gram_minimal.c" break; case 933: /* DropStmt: DROP DOMAIN_P IF_P EXISTS type_name_list opt_drop_behavior */ #line 7098 "gram_minimal.y" { 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 40514 "gram_minimal.c" break; case 934: /* DropStmt: DROP INDEX CONCURRENTLY any_name_list opt_drop_behavior */ #line 7109 "gram_minimal.y" { 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 40529 "gram_minimal.c" break; case 935: /* DropStmt: DROP INDEX CONCURRENTLY IF_P EXISTS any_name_list opt_drop_behavior */ #line 7120 "gram_minimal.y" { 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 40544 "gram_minimal.c" break; case 936: /* object_type_any_name: TABLE */ #line 7134 "gram_minimal.y" { (yyval.objtype) = OBJECT_TABLE; } #line 40550 "gram_minimal.c" break; case 937: /* object_type_any_name: SEQUENCE */ #line 7135 "gram_minimal.y" { (yyval.objtype) = OBJECT_SEQUENCE; } #line 40556 "gram_minimal.c" break; case 938: /* object_type_any_name: VIEW */ #line 7136 "gram_minimal.y" { (yyval.objtype) = OBJECT_VIEW; } #line 40562 "gram_minimal.c" break; case 939: /* object_type_any_name: MATERIALIZED VIEW */ #line 7137 "gram_minimal.y" { (yyval.objtype) = OBJECT_MATVIEW; } #line 40568 "gram_minimal.c" break; case 940: /* object_type_any_name: INDEX */ #line 7138 "gram_minimal.y" { (yyval.objtype) = OBJECT_INDEX; } #line 40574 "gram_minimal.c" break; case 941: /* object_type_any_name: FOREIGN TABLE */ #line 7139 "gram_minimal.y" { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 40580 "gram_minimal.c" break; case 942: /* object_type_any_name: COLLATION */ #line 7140 "gram_minimal.y" { (yyval.objtype) = OBJECT_COLLATION; } #line 40586 "gram_minimal.c" break; case 943: /* object_type_any_name: CONVERSION_P */ #line 7141 "gram_minimal.y" { (yyval.objtype) = OBJECT_CONVERSION; } #line 40592 "gram_minimal.c" break; case 944: /* object_type_any_name: STATISTICS */ #line 7142 "gram_minimal.y" { (yyval.objtype) = OBJECT_STATISTIC_EXT; } #line 40598 "gram_minimal.c" break; case 945: /* object_type_any_name: TEXT_P SEARCH PARSER */ #line 7143 "gram_minimal.y" { (yyval.objtype) = OBJECT_TSPARSER; } #line 40604 "gram_minimal.c" break; case 946: /* object_type_any_name: TEXT_P SEARCH DICTIONARY */ #line 7144 "gram_minimal.y" { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 40610 "gram_minimal.c" break; case 947: /* object_type_any_name: TEXT_P SEARCH TEMPLATE */ #line 7145 "gram_minimal.y" { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 40616 "gram_minimal.c" break; case 948: /* object_type_any_name: TEXT_P SEARCH CONFIGURATION */ #line 7146 "gram_minimal.y" { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 40622 "gram_minimal.c" break; case 949: /* object_type_name: drop_type_name */ #line 7156 "gram_minimal.y" { (yyval.objtype) = (yyvsp[0].objtype); } #line 40628 "gram_minimal.c" break; case 950: /* object_type_name: DATABASE */ #line 7157 "gram_minimal.y" { (yyval.objtype) = OBJECT_DATABASE; } #line 40634 "gram_minimal.c" break; case 951: /* object_type_name: ROLE */ #line 7158 "gram_minimal.y" { (yyval.objtype) = OBJECT_ROLE; } #line 40640 "gram_minimal.c" break; case 952: /* object_type_name: SUBSCRIPTION */ #line 7159 "gram_minimal.y" { (yyval.objtype) = OBJECT_SUBSCRIPTION; } #line 40646 "gram_minimal.c" break; case 953: /* object_type_name: TABLESPACE */ #line 7160 "gram_minimal.y" { (yyval.objtype) = OBJECT_TABLESPACE; } #line 40652 "gram_minimal.c" break; case 954: /* drop_type_name: ACCESS METHOD */ #line 7164 "gram_minimal.y" { (yyval.objtype) = OBJECT_ACCESS_METHOD; } #line 40658 "gram_minimal.c" break; case 955: /* drop_type_name: EVENT TRIGGER */ #line 7165 "gram_minimal.y" { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 40664 "gram_minimal.c" break; case 956: /* drop_type_name: EXTENSION */ #line 7166 "gram_minimal.y" { (yyval.objtype) = OBJECT_EXTENSION; } #line 40670 "gram_minimal.c" break; case 957: /* drop_type_name: FOREIGN DATA_P WRAPPER */ #line 7167 "gram_minimal.y" { (yyval.objtype) = OBJECT_FDW; } #line 40676 "gram_minimal.c" break; case 958: /* drop_type_name: opt_procedural LANGUAGE */ #line 7168 "gram_minimal.y" { (yyval.objtype) = OBJECT_LANGUAGE; } #line 40682 "gram_minimal.c" break; case 959: /* drop_type_name: PUBLICATION */ #line 7169 "gram_minimal.y" { (yyval.objtype) = OBJECT_PUBLICATION; } #line 40688 "gram_minimal.c" break; case 960: /* drop_type_name: SCHEMA */ #line 7170 "gram_minimal.y" { (yyval.objtype) = OBJECT_SCHEMA; } #line 40694 "gram_minimal.c" break; case 961: /* drop_type_name: SERVER */ #line 7171 "gram_minimal.y" { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 40700 "gram_minimal.c" break; case 962: /* object_type_name_on_any_name: POLICY */ #line 7176 "gram_minimal.y" { (yyval.objtype) = OBJECT_POLICY; } #line 40706 "gram_minimal.c" break; case 963: /* object_type_name_on_any_name: RULE */ #line 7177 "gram_minimal.y" { (yyval.objtype) = OBJECT_RULE; } #line 40712 "gram_minimal.c" break; case 964: /* object_type_name_on_any_name: TRIGGER */ #line 7178 "gram_minimal.y" { (yyval.objtype) = OBJECT_TRIGGER; } #line 40718 "gram_minimal.c" break; case 965: /* any_name_list: any_name */ #line 7182 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].list)); } #line 40724 "gram_minimal.c" break; case 966: /* any_name_list: any_name_list ',' any_name */ #line 7183 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 40730 "gram_minimal.c" break; case 967: /* any_name: ColId */ #line 7186 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 40736 "gram_minimal.c" break; case 968: /* any_name: ColId attrs */ #line 7187 "gram_minimal.y" { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 40742 "gram_minimal.c" break; case 969: /* attrs: '.' attr_name */ #line 7191 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 40748 "gram_minimal.c" break; case 970: /* attrs: attrs '.' attr_name */ #line 7193 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 40754 "gram_minimal.c" break; case 971: /* type_name_list: Typename */ #line 7197 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 40760 "gram_minimal.c" break; case 972: /* type_name_list: type_name_list ',' Typename */ #line 7198 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 40766 "gram_minimal.c" break; case 973: /* TruncateStmt: TRUNCATE opt_table relation_expr_list opt_restart_seqs opt_drop_behavior */ #line 7210 "gram_minimal.y" { 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 40779 "gram_minimal.c" break; case 974: /* opt_restart_seqs: CONTINUE_P IDENTITY_P */ #line 7221 "gram_minimal.y" { (yyval.boolean) = false; } #line 40785 "gram_minimal.c" break; case 975: /* opt_restart_seqs: RESTART IDENTITY_P */ #line 7222 "gram_minimal.y" { (yyval.boolean) = true; } #line 40791 "gram_minimal.c" break; case 976: /* opt_restart_seqs: %empty */ #line 7223 "gram_minimal.y" { (yyval.boolean) = false; } #line 40797 "gram_minimal.c" break; case 977: /* CommentStmt: COMMENT ON object_type_any_name any_name IS comment_text */ #line 7234 "gram_minimal.y" { 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 40810 "gram_minimal.c" break; case 978: /* CommentStmt: COMMENT ON COLUMN any_name IS comment_text */ #line 7243 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_COLUMN; n->object = (Node *) (yyvsp[-2].list); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40823 "gram_minimal.c" break; case 979: /* CommentStmt: COMMENT ON object_type_name name IS comment_text */ #line 7252 "gram_minimal.y" { 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 40836 "gram_minimal.c" break; case 980: /* CommentStmt: COMMENT ON TYPE_P Typename IS comment_text */ #line 7261 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TYPE; n->object = (Node *) (yyvsp[-2].typnam); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40849 "gram_minimal.c" break; case 981: /* CommentStmt: COMMENT ON DOMAIN_P Typename IS comment_text */ #line 7270 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-2].typnam); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40862 "gram_minimal.c" break; case 982: /* CommentStmt: COMMENT ON AGGREGATE aggregate_with_argtypes IS comment_text */ #line 7279 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40875 "gram_minimal.c" break; case 983: /* CommentStmt: COMMENT ON FUNCTION function_with_argtypes IS comment_text */ #line 7288 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40888 "gram_minimal.c" break; case 984: /* CommentStmt: COMMENT ON OPERATOR operator_with_argtypes IS comment_text */ #line 7297 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40901 "gram_minimal.c" break; case 985: /* CommentStmt: COMMENT ON CONSTRAINT name ON any_name IS comment_text */ #line 7306 "gram_minimal.y" { 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 40914 "gram_minimal.c" break; case 986: /* CommentStmt: COMMENT ON CONSTRAINT name ON DOMAIN_P any_name IS comment_text */ #line 7315 "gram_minimal.y" { 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 40932 "gram_minimal.c" break; case 987: /* CommentStmt: COMMENT ON object_type_name_on_any_name name ON any_name IS comment_text */ #line 7329 "gram_minimal.y" { 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 40945 "gram_minimal.c" break; case 988: /* CommentStmt: COMMENT ON PROCEDURE function_with_argtypes IS comment_text */ #line 7338 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40958 "gram_minimal.c" break; case 989: /* CommentStmt: COMMENT ON ROUTINE function_with_argtypes IS comment_text */ #line 7347 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40971 "gram_minimal.c" break; case 990: /* CommentStmt: COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text */ #line 7356 "gram_minimal.y" { 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 40984 "gram_minimal.c" break; case 991: /* CommentStmt: COMMENT ON OPERATOR CLASS any_name USING name IS comment_text */ #line 7365 "gram_minimal.y" { 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 40997 "gram_minimal.c" break; case 992: /* CommentStmt: COMMENT ON OPERATOR FAMILY any_name USING name IS comment_text */ #line 7374 "gram_minimal.y" { 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 41010 "gram_minimal.c" break; case 993: /* CommentStmt: COMMENT ON LARGE_P OBJECT_P NumericOnly IS comment_text */ #line 7383 "gram_minimal.y" { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].node); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 41023 "gram_minimal.c" break; case 994: /* CommentStmt: COMMENT ON CAST '(' Typename AS Typename ')' IS comment_text */ #line 7392 "gram_minimal.y" { 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 41036 "gram_minimal.c" break; case 995: /* comment_text: Sconst */ #line 7403 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 41042 "gram_minimal.c" break; case 996: /* comment_text: NULL_P */ #line 7404 "gram_minimal.y" { (yyval.str) = NULL; } #line 41048 "gram_minimal.c" break; case 997: /* SecLabelStmt: SECURITY LABEL opt_provider ON object_type_any_name any_name IS security_label */ #line 7420 "gram_minimal.y" { 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 41062 "gram_minimal.c" break; case 998: /* SecLabelStmt: SECURITY LABEL opt_provider ON COLUMN any_name IS security_label */ #line 7431 "gram_minimal.y" { 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 41076 "gram_minimal.c" break; case 999: /* SecLabelStmt: SECURITY LABEL opt_provider ON object_type_name name IS security_label */ #line 7442 "gram_minimal.y" { 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 41090 "gram_minimal.c" break; case 1000: /* SecLabelStmt: SECURITY LABEL opt_provider ON TYPE_P Typename IS security_label */ #line 7453 "gram_minimal.y" { 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 41104 "gram_minimal.c" break; case 1001: /* SecLabelStmt: SECURITY LABEL opt_provider ON DOMAIN_P Typename IS security_label */ #line 7464 "gram_minimal.y" { 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 41118 "gram_minimal.c" break; case 1002: /* SecLabelStmt: SECURITY LABEL opt_provider ON AGGREGATE aggregate_with_argtypes IS security_label */ #line 7475 "gram_minimal.y" { 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 41132 "gram_minimal.c" break; case 1003: /* SecLabelStmt: SECURITY LABEL opt_provider ON FUNCTION function_with_argtypes IS security_label */ #line 7486 "gram_minimal.y" { 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 41146 "gram_minimal.c" break; case 1004: /* SecLabelStmt: SECURITY LABEL opt_provider ON LARGE_P OBJECT_P NumericOnly IS security_label */ #line 7497 "gram_minimal.y" { 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 41160 "gram_minimal.c" break; case 1005: /* SecLabelStmt: SECURITY LABEL opt_provider ON PROCEDURE function_with_argtypes IS security_label */ #line 7508 "gram_minimal.y" { 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 41174 "gram_minimal.c" break; case 1006: /* SecLabelStmt: SECURITY LABEL opt_provider ON ROUTINE function_with_argtypes IS security_label */ #line 7519 "gram_minimal.y" { 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 41188 "gram_minimal.c" break; case 1007: /* opt_provider: FOR NonReservedWord_or_Sconst */ #line 7530 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 41194 "gram_minimal.c" break; case 1008: /* opt_provider: %empty */ #line 7531 "gram_minimal.y" { (yyval.str) = NULL; } #line 41200 "gram_minimal.c" break; case 1009: /* security_label: Sconst */ #line 7534 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 41206 "gram_minimal.c" break; case 1010: /* security_label: NULL_P */ #line 7535 "gram_minimal.y" { (yyval.str) = NULL; } #line 41212 "gram_minimal.c" break; case 1011: /* FetchStmt: FETCH fetch_args */ #line 7546 "gram_minimal.y" { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = false; (yyval.node) = (Node *) n; } #line 41223 "gram_minimal.c" break; case 1012: /* FetchStmt: MOVE fetch_args */ #line 7553 "gram_minimal.y" { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = true; (yyval.node) = (Node *) n; } #line 41234 "gram_minimal.c" break; case 1013: /* fetch_args: cursor_name */ #line 7562 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41247 "gram_minimal.c" break; case 1014: /* fetch_args: from_in cursor_name */ #line 7571 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41260 "gram_minimal.c" break; case 1015: /* fetch_args: NEXT opt_from_in cursor_name */ #line 7580 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41273 "gram_minimal.c" break; case 1016: /* fetch_args: PRIOR opt_from_in cursor_name */ #line 7589 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41286 "gram_minimal.c" break; case 1017: /* fetch_args: FIRST_P opt_from_in cursor_name */ #line 7598 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41299 "gram_minimal.c" break; case 1018: /* fetch_args: LAST_P opt_from_in cursor_name */ #line 7607 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = -1; (yyval.node) = (Node *) n; } #line 41312 "gram_minimal.c" break; case 1019: /* fetch_args: ABSOLUTE_P SignedIconst opt_from_in cursor_name */ #line 7616 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41325 "gram_minimal.c" break; case 1020: /* fetch_args: RELATIVE_P SignedIconst opt_from_in cursor_name */ #line 7625 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_RELATIVE; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41338 "gram_minimal.c" break; case 1021: /* fetch_args: SignedIconst opt_from_in cursor_name */ #line 7634 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41351 "gram_minimal.c" break; case 1022: /* fetch_args: ALL opt_from_in cursor_name */ #line 7643 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *) n; } #line 41364 "gram_minimal.c" break; case 1023: /* fetch_args: FORWARD opt_from_in cursor_name */ #line 7652 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41377 "gram_minimal.c" break; case 1024: /* fetch_args: FORWARD SignedIconst opt_from_in cursor_name */ #line 7661 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41390 "gram_minimal.c" break; case 1025: /* fetch_args: FORWARD ALL opt_from_in cursor_name */ #line 7670 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *) n; } #line 41403 "gram_minimal.c" break; case 1026: /* fetch_args: BACKWARD opt_from_in cursor_name */ #line 7679 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = 1; (yyval.node) = (Node *) n; } #line 41416 "gram_minimal.c" break; case 1027: /* fetch_args: BACKWARD SignedIconst opt_from_in cursor_name */ #line 7688 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 41429 "gram_minimal.c" break; case 1028: /* fetch_args: BACKWARD ALL opt_from_in cursor_name */ #line 7697 "gram_minimal.y" { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *) n; } #line 41442 "gram_minimal.c" break; case 1033: /* GrantStmt: GRANT privileges ON privilege_target TO grantee_list opt_grant_grant_option opt_granted_by */ #line 7724 "gram_minimal.y" { 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 41460 "gram_minimal.c" break; case 1034: /* RevokeStmt: REVOKE privileges ON privilege_target FROM grantee_list opt_granted_by opt_drop_behavior */ #line 7742 "gram_minimal.y" { 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 41479 "gram_minimal.c" break; case 1035: /* RevokeStmt: REVOKE GRANT OPTION FOR privileges ON privilege_target FROM grantee_list opt_granted_by opt_drop_behavior */ #line 7758 "gram_minimal.y" { 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 41498 "gram_minimal.c" break; case 1036: /* privileges: privilege_list */ #line 7785 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 41504 "gram_minimal.c" break; case 1037: /* privileges: ALL */ #line 7787 "gram_minimal.y" { (yyval.list) = NIL; } #line 41510 "gram_minimal.c" break; case 1038: /* privileges: ALL PRIVILEGES */ #line 7789 "gram_minimal.y" { (yyval.list) = NIL; } #line 41516 "gram_minimal.c" break; case 1039: /* privileges: ALL '(' columnList ')' */ #line 7791 "gram_minimal.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 41528 "gram_minimal.c" break; case 1040: /* privileges: ALL PRIVILEGES '(' columnList ')' */ #line 7799 "gram_minimal.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 41540 "gram_minimal.c" break; case 1041: /* privilege_list: privilege */ #line 7808 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].accesspriv)); } #line 41546 "gram_minimal.c" break; case 1042: /* privilege_list: privilege_list ',' privilege */ #line 7809 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].accesspriv)); } #line 41552 "gram_minimal.c" break; case 1043: /* privilege: SELECT opt_column_list */ #line 7813 "gram_minimal.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 41564 "gram_minimal.c" break; case 1044: /* privilege: REFERENCES opt_column_list */ #line 7821 "gram_minimal.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 41576 "gram_minimal.c" break; case 1045: /* privilege: CREATE opt_column_list */ #line 7829 "gram_minimal.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 41588 "gram_minimal.c" break; case 1046: /* privilege: ALTER SYSTEM_P */ #line 7837 "gram_minimal.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup("alter system"); n->cols = NIL; (yyval.accesspriv) = n; } #line 41599 "gram_minimal.c" break; case 1047: /* privilege: ColId opt_column_list */ #line 7844 "gram_minimal.y" { AccessPriv *n = makeNode(AccessPriv); n->priv_name = (yyvsp[-1].str); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 41611 "gram_minimal.c" break; case 1048: /* parameter_name_list: parameter_name */ #line 7855 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 41619 "gram_minimal.c" break; case 1049: /* parameter_name_list: parameter_name_list ',' parameter_name */ #line 7859 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 41627 "gram_minimal.c" break; case 1050: /* parameter_name: ColId */ #line 7866 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 41635 "gram_minimal.c" break; case 1051: /* parameter_name: parameter_name '.' ColId */ #line 7870 "gram_minimal.y" { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 41643 "gram_minimal.c" break; case 1052: /* privilege_target: qualified_name_list */ #line 7881 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41656 "gram_minimal.c" break; case 1053: /* privilege_target: TABLE qualified_name_list */ #line 7890 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41669 "gram_minimal.c" break; case 1054: /* privilege_target: SEQUENCE qualified_name_list */ #line 7899 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_SEQUENCE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41682 "gram_minimal.c" break; case 1055: /* privilege_target: FOREIGN DATA_P WRAPPER name_list */ #line 7908 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FDW; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41695 "gram_minimal.c" break; case 1056: /* privilege_target: FOREIGN SERVER name_list */ #line 7917 "gram_minimal.y" { 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 41708 "gram_minimal.c" break; case 1057: /* privilege_target: FUNCTION function_with_argtypes_list */ #line 7926 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FUNCTION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41721 "gram_minimal.c" break; case 1058: /* privilege_target: PROCEDURE function_with_argtypes_list */ #line 7935 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_PROCEDURE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41734 "gram_minimal.c" break; case 1059: /* privilege_target: ROUTINE function_with_argtypes_list */ #line 7944 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_ROUTINE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41747 "gram_minimal.c" break; case 1060: /* privilege_target: DATABASE name_list */ #line 7953 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_DATABASE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41760 "gram_minimal.c" break; case 1061: /* privilege_target: DOMAIN_P any_name_list */ #line 7962 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_DOMAIN; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41773 "gram_minimal.c" break; case 1062: /* privilege_target: LANGUAGE name_list */ #line 7971 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_LANGUAGE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41786 "gram_minimal.c" break; case 1063: /* privilege_target: LARGE_P OBJECT_P NumericOnly_list */ #line 7980 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_LARGEOBJECT; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41799 "gram_minimal.c" break; case 1064: /* privilege_target: PARAMETER parameter_name_list */ #line 7989 "gram_minimal.y" { 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 41811 "gram_minimal.c" break; case 1065: /* privilege_target: SCHEMA name_list */ #line 7997 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_SCHEMA; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41824 "gram_minimal.c" break; case 1066: /* privilege_target: TABLESPACE name_list */ #line 8006 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLESPACE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41837 "gram_minimal.c" break; case 1067: /* privilege_target: TYPE_P any_name_list */ #line 8015 "gram_minimal.y" { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TYPE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 41850 "gram_minimal.c" break; case 1068: /* privilege_target: ALL TABLES IN_P SCHEMA name_list */ #line 8024 "gram_minimal.y" { 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 41863 "gram_minimal.c" break; case 1069: /* privilege_target: ALL SEQUENCES IN_P SCHEMA name_list */ #line 8033 "gram_minimal.y" { 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 41876 "gram_minimal.c" break; case 1070: /* privilege_target: ALL FUNCTIONS IN_P SCHEMA name_list */ #line 8042 "gram_minimal.y" { 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 41889 "gram_minimal.c" break; case 1071: /* privilege_target: ALL PROCEDURES IN_P SCHEMA name_list */ #line 8051 "gram_minimal.y" { 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 41902 "gram_minimal.c" break; case 1072: /* privilege_target: ALL ROUTINES IN_P SCHEMA name_list */ #line 8060 "gram_minimal.y" { 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 41915 "gram_minimal.c" break; case 1073: /* grantee_list: grantee */ #line 8072 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 41921 "gram_minimal.c" break; case 1074: /* grantee_list: grantee_list ',' grantee */ #line 8073 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 41927 "gram_minimal.c" break; case 1075: /* grantee: RoleSpec */ #line 8077 "gram_minimal.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 41933 "gram_minimal.c" break; case 1076: /* grantee: GROUP_P RoleSpec */ #line 8078 "gram_minimal.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 41939 "gram_minimal.c" break; case 1077: /* opt_grant_grant_option: WITH GRANT OPTION */ #line 8083 "gram_minimal.y" { (yyval.boolean) = true; } #line 41945 "gram_minimal.c" break; case 1078: /* opt_grant_grant_option: %empty */ #line 8084 "gram_minimal.y" { (yyval.boolean) = false; } #line 41951 "gram_minimal.c" break; case 1079: /* GrantRoleStmt: GRANT privilege_list TO role_list opt_granted_by */ #line 8095 "gram_minimal.y" { 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 41966 "gram_minimal.c" break; case 1080: /* GrantRoleStmt: GRANT privilege_list TO role_list WITH grant_role_opt_list opt_granted_by */ #line 8106 "gram_minimal.y" { 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 41981 "gram_minimal.c" break; case 1081: /* RevokeRoleStmt: REVOKE privilege_list FROM role_list opt_granted_by opt_drop_behavior */ #line 8120 "gram_minimal.y" { 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 41997 "gram_minimal.c" break; case 1082: /* RevokeRoleStmt: REVOKE ColId OPTION FOR privilege_list FROM role_list opt_granted_by opt_drop_behavior */ #line 8132 "gram_minimal.y" { 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 42016 "gram_minimal.c" break; case 1083: /* grant_role_opt_list: grant_role_opt_list ',' grant_role_opt */ #line 8149 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 42022 "gram_minimal.c" break; case 1084: /* grant_role_opt_list: grant_role_opt */ #line 8150 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 42028 "gram_minimal.c" break; case 1085: /* grant_role_opt: ColLabel grant_role_opt_value */ #line 8155 "gram_minimal.y" { (yyval.defelt) = makeDefElem(pstrdup((yyvsp[-1].str)), (yyvsp[0].node), (yylsp[-1])); } #line 42036 "gram_minimal.c" break; case 1086: /* grant_role_opt_value: OPTION */ #line 8161 "gram_minimal.y" { (yyval.node) = (Node *) makeBoolean(true); } #line 42042 "gram_minimal.c" break; case 1087: /* grant_role_opt_value: TRUE_P */ #line 8162 "gram_minimal.y" { (yyval.node) = (Node *) makeBoolean(true); } #line 42048 "gram_minimal.c" break; case 1088: /* grant_role_opt_value: FALSE_P */ #line 8163 "gram_minimal.y" { (yyval.node) = (Node *) makeBoolean(false); } #line 42054 "gram_minimal.c" break; case 1089: /* opt_granted_by: GRANTED BY RoleSpec */ #line 8166 "gram_minimal.y" { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 42060 "gram_minimal.c" break; case 1090: /* opt_granted_by: %empty */ #line 8167 "gram_minimal.y" { (yyval.rolespec) = NULL; } #line 42066 "gram_minimal.c" break; case 1091: /* AlterDefaultPrivilegesStmt: ALTER DEFAULT PRIVILEGES DefACLOptionList DefACLAction */ #line 8178 "gram_minimal.y" { AlterDefaultPrivilegesStmt *n = makeNode(AlterDefaultPrivilegesStmt); n->options = (yyvsp[-1].list); n->action = (GrantStmt *) (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 42078 "gram_minimal.c" break; case 1092: /* DefACLOptionList: DefACLOptionList DefACLOption */ #line 8188 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 42084 "gram_minimal.c" break; case 1093: /* DefACLOptionList: %empty */ #line 8189 "gram_minimal.y" { (yyval.list) = NIL; } #line 42090 "gram_minimal.c" break; case 1094: /* DefACLOption: IN_P SCHEMA name_list */ #line 8194 "gram_minimal.y" { (yyval.defelt) = makeDefElem("schemas", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 42098 "gram_minimal.c" break; case 1095: /* DefACLOption: FOR ROLE role_list */ #line 8198 "gram_minimal.y" { (yyval.defelt) = makeDefElem("roles", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 42106 "gram_minimal.c" break; case 1096: /* DefACLOption: FOR USER role_list */ #line 8202 "gram_minimal.y" { (yyval.defelt) = makeDefElem("roles", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 42114 "gram_minimal.c" break; case 1097: /* DefACLAction: GRANT privileges ON defacl_privilege_target TO grantee_list opt_grant_grant_option */ #line 8214 "gram_minimal.y" { 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 42131 "gram_minimal.c" break; case 1098: /* DefACLAction: REVOKE privileges ON defacl_privilege_target FROM grantee_list opt_drop_behavior */ #line 8228 "gram_minimal.y" { 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 42149 "gram_minimal.c" break; case 1099: /* DefACLAction: REVOKE GRANT OPTION FOR privileges ON defacl_privilege_target FROM grantee_list opt_drop_behavior */ #line 8243 "gram_minimal.y" { 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 42167 "gram_minimal.c" break; case 1100: /* defacl_privilege_target: TABLES */ #line 8259 "gram_minimal.y" { (yyval.ival) = OBJECT_TABLE; } #line 42173 "gram_minimal.c" break; case 1101: /* defacl_privilege_target: FUNCTIONS */ #line 8260 "gram_minimal.y" { (yyval.ival) = OBJECT_FUNCTION; } #line 42179 "gram_minimal.c" break; case 1102: /* defacl_privilege_target: ROUTINES */ #line 8261 "gram_minimal.y" { (yyval.ival) = OBJECT_FUNCTION; } #line 42185 "gram_minimal.c" break; case 1103: /* defacl_privilege_target: SEQUENCES */ #line 8262 "gram_minimal.y" { (yyval.ival) = OBJECT_SEQUENCE; } #line 42191 "gram_minimal.c" break; case 1104: /* defacl_privilege_target: TYPES_P */ #line 8263 "gram_minimal.y" { (yyval.ival) = OBJECT_TYPE; } #line 42197 "gram_minimal.c" break; case 1105: /* defacl_privilege_target: SCHEMAS */ #line 8264 "gram_minimal.y" { (yyval.ival) = OBJECT_SCHEMA; } #line 42203 "gram_minimal.c" break; case 1106: /* defacl_privilege_target: LARGE_P OBJECTS_P */ #line 8265 "gram_minimal.y" { (yyval.ival) = OBJECT_LARGEOBJECT; } #line 42209 "gram_minimal.c" break; case 1107: /* IndexStmt: CREATE opt_unique INDEX opt_concurrently opt_single_name ON relation_expr access_method_clause '(' index_params ')' opt_include opt_unique_null_treatment opt_reloptions OptTableSpace where_clause */ #line 8280 "gram_minimal.y" { 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 42243 "gram_minimal.c" break; case 1108: /* IndexStmt: CREATE opt_unique INDEX opt_concurrently IF_P NOT EXISTS name ON relation_expr access_method_clause '(' index_params ')' opt_include opt_unique_null_treatment opt_reloptions OptTableSpace where_clause */ #line 8312 "gram_minimal.y" { 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 42277 "gram_minimal.c" break; case 1109: /* opt_unique: UNIQUE */ #line 8344 "gram_minimal.y" { (yyval.boolean) = true; } #line 42283 "gram_minimal.c" break; case 1110: /* opt_unique: %empty */ #line 8345 "gram_minimal.y" { (yyval.boolean) = false; } #line 42289 "gram_minimal.c" break; case 1111: /* access_method_clause: USING name */ #line 8349 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 42295 "gram_minimal.c" break; case 1112: /* access_method_clause: %empty */ #line 8350 "gram_minimal.y" { (yyval.str) = DEFAULT_INDEX_TYPE; } #line 42301 "gram_minimal.c" break; case 1113: /* index_params: index_elem */ #line 8353 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 42307 "gram_minimal.c" break; case 1114: /* index_params: index_params ',' index_elem */ #line 8354 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 42313 "gram_minimal.c" break; case 1115: /* index_elem_options: opt_collate opt_qualified_name opt_asc_desc opt_nulls_order */ #line 8360 "gram_minimal.y" { (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 42329 "gram_minimal.c" break; case 1116: /* index_elem_options: opt_collate any_name reloptions opt_asc_desc opt_nulls_order */ #line 8372 "gram_minimal.y" { (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 42345 "gram_minimal.c" break; case 1117: /* index_elem: ColId index_elem_options */ #line 8391 "gram_minimal.y" { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->name = (yyvsp[-1].str); } #line 42354 "gram_minimal.c" break; case 1118: /* index_elem: func_expr_windowless index_elem_options */ #line 8396 "gram_minimal.y" { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->expr = (yyvsp[-1].node); } #line 42363 "gram_minimal.c" break; case 1119: /* index_elem: '(' a_expr ')' index_elem_options */ #line 8401 "gram_minimal.y" { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->expr = (yyvsp[-2].node); } #line 42372 "gram_minimal.c" break; case 1120: /* opt_include: INCLUDE '(' index_including_params ')' */ #line 8407 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 42378 "gram_minimal.c" break; case 1121: /* opt_include: %empty */ #line 8408 "gram_minimal.y" { (yyval.list) = NIL; } #line 42384 "gram_minimal.c" break; case 1122: /* index_including_params: index_elem */ #line 8411 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 42390 "gram_minimal.c" break; case 1123: /* index_including_params: index_including_params ',' index_elem */ #line 8412 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 42396 "gram_minimal.c" break; case 1124: /* opt_collate: COLLATE any_name */ #line 8415 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 42402 "gram_minimal.c" break; case 1125: /* opt_collate: %empty */ #line 8416 "gram_minimal.y" { (yyval.list) = NIL; } #line 42408 "gram_minimal.c" break; case 1126: /* opt_asc_desc: ASC */ #line 8420 "gram_minimal.y" { (yyval.ival) = SORTBY_ASC; } #line 42414 "gram_minimal.c" break; case 1127: /* opt_asc_desc: DESC */ #line 8421 "gram_minimal.y" { (yyval.ival) = SORTBY_DESC; } #line 42420 "gram_minimal.c" break; case 1128: /* opt_asc_desc: %empty */ #line 8422 "gram_minimal.y" { (yyval.ival) = SORTBY_DEFAULT; } #line 42426 "gram_minimal.c" break; case 1129: /* opt_nulls_order: NULLS_LA FIRST_P */ #line 8425 "gram_minimal.y" { (yyval.ival) = SORTBY_NULLS_FIRST; } #line 42432 "gram_minimal.c" break; case 1130: /* opt_nulls_order: NULLS_LA LAST_P */ #line 8426 "gram_minimal.y" { (yyval.ival) = SORTBY_NULLS_LAST; } #line 42438 "gram_minimal.c" break; case 1131: /* opt_nulls_order: %empty */ #line 8427 "gram_minimal.y" { (yyval.ival) = SORTBY_NULLS_DEFAULT; } #line 42444 "gram_minimal.c" break; case 1132: /* CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args_with_defaults RETURNS func_return opt_createfunc_opt_list opt_routine_body */ #line 8445 "gram_minimal.y" { 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 42461 "gram_minimal.c" break; case 1133: /* CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args_with_defaults RETURNS TABLE '(' table_func_column_list ')' opt_createfunc_opt_list opt_routine_body */ #line 8459 "gram_minimal.y" { 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), yyscanner); 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 42479 "gram_minimal.c" break; case 1134: /* CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args_with_defaults opt_createfunc_opt_list opt_routine_body */ #line 8474 "gram_minimal.y" { 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 42496 "gram_minimal.c" break; case 1135: /* CreateFunctionStmt: CREATE opt_or_replace PROCEDURE func_name func_args_with_defaults opt_createfunc_opt_list opt_routine_body */ #line 8488 "gram_minimal.y" { 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 42513 "gram_minimal.c" break; case 1136: /* opt_or_replace: OR REPLACE */ #line 8503 "gram_minimal.y" { (yyval.boolean) = true; } #line 42519 "gram_minimal.c" break; case 1137: /* opt_or_replace: %empty */ #line 8504 "gram_minimal.y" { (yyval.boolean) = false; } #line 42525 "gram_minimal.c" break; case 1138: /* func_args: '(' func_args_list ')' */ #line 8507 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 42531 "gram_minimal.c" break; case 1139: /* func_args: '(' ')' */ #line 8508 "gram_minimal.y" { (yyval.list) = NIL; } #line 42537 "gram_minimal.c" break; case 1140: /* func_args_list: func_arg */ #line 8512 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 42543 "gram_minimal.c" break; case 1141: /* func_args_list: func_args_list ',' func_arg */ #line 8513 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 42549 "gram_minimal.c" break; case 1142: /* function_with_argtypes_list: function_with_argtypes */ #line 8517 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 42555 "gram_minimal.c" break; case 1143: /* function_with_argtypes_list: function_with_argtypes_list ',' function_with_argtypes */ #line 8519 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 42561 "gram_minimal.c" break; case 1144: /* function_with_argtypes: func_name func_args */ #line 8524 "gram_minimal.y" { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractArgTypes((yyvsp[0].list)); n->objfuncargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 42574 "gram_minimal.c" break; case 1145: /* function_with_argtypes: type_func_name_keyword */ #line 8538 "gram_minimal.y" { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = list_make1(makeString(pstrdup((yyvsp[0].keyword)))); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 42586 "gram_minimal.c" break; case 1146: /* function_with_argtypes: ColId */ #line 8546 "gram_minimal.y" { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = list_make1(makeString((yyvsp[0].str))); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 42598 "gram_minimal.c" break; case 1147: /* function_with_argtypes: ColId indirection */ #line 8554 "gram_minimal.y" { 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 42611 "gram_minimal.c" break; case 1148: /* func_args_with_defaults: '(' func_args_with_defaults_list ')' */ #line 8569 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 42617 "gram_minimal.c" break; case 1149: /* func_args_with_defaults: '(' ')' */ #line 8570 "gram_minimal.y" { (yyval.list) = NIL; } #line 42623 "gram_minimal.c" break; case 1150: /* func_args_with_defaults_list: func_arg_with_default */ #line 8574 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 42629 "gram_minimal.c" break; case 1151: /* func_args_with_defaults_list: func_args_with_defaults_list ',' func_arg_with_default */ #line 8576 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 42635 "gram_minimal.c" break; case 1152: /* func_arg: arg_class param_name func_type */ #line 8591 "gram_minimal.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-2].fun_param_mode); n->defexpr = NULL; n->location = (yylsp[-2]); (yyval.fun_param) = n; } #line 42650 "gram_minimal.c" break; case 1153: /* func_arg: param_name arg_class func_type */ #line 8602 "gram_minimal.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-2].str); n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-1].fun_param_mode); n->defexpr = NULL; n->location = (yylsp[-2]); (yyval.fun_param) = n; } #line 42665 "gram_minimal.c" break; case 1154: /* func_arg: param_name func_type */ #line 8613 "gram_minimal.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_DEFAULT; n->defexpr = NULL; n->location = (yylsp[-1]); (yyval.fun_param) = n; } #line 42680 "gram_minimal.c" break; case 1155: /* func_arg: arg_class func_type */ #line 8624 "gram_minimal.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = NULL; n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-1].fun_param_mode); n->defexpr = NULL; n->location = (yylsp[-1]); (yyval.fun_param) = n; } #line 42695 "gram_minimal.c" break; case 1156: /* func_arg: func_type */ #line 8635 "gram_minimal.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = NULL; n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_DEFAULT; n->defexpr = NULL; n->location = (yylsp[0]); (yyval.fun_param) = n; } #line 42710 "gram_minimal.c" break; case 1157: /* arg_class: IN_P */ #line 8648 "gram_minimal.y" { (yyval.fun_param_mode) = FUNC_PARAM_IN; } #line 42716 "gram_minimal.c" break; case 1158: /* arg_class: OUT_P */ #line 8649 "gram_minimal.y" { (yyval.fun_param_mode) = FUNC_PARAM_OUT; } #line 42722 "gram_minimal.c" break; case 1159: /* arg_class: INOUT */ #line 8650 "gram_minimal.y" { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 42728 "gram_minimal.c" break; case 1160: /* arg_class: IN_P OUT_P */ #line 8651 "gram_minimal.y" { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 42734 "gram_minimal.c" break; case 1161: /* arg_class: VARIADIC */ #line 8652 "gram_minimal.y" { (yyval.fun_param_mode) = FUNC_PARAM_VARIADIC; } #line 42740 "gram_minimal.c" break; case 1163: /* func_return: func_type */ #line 8663 "gram_minimal.y" { /* 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 42752 "gram_minimal.c" break; case 1164: /* func_type: Typename */ #line 8677 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 42758 "gram_minimal.c" break; case 1165: /* func_type: type_function_name attrs '%' TYPE_P */ #line 8679 "gram_minimal.y" { (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-3].str)), (yyvsp[-2].list))); (yyval.typnam)->pct_type = true; (yyval.typnam)->location = (yylsp[-3]); } #line 42768 "gram_minimal.c" break; case 1166: /* func_type: SETOF type_function_name attrs '%' TYPE_P */ #line 8685 "gram_minimal.y" { (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 42779 "gram_minimal.c" break; case 1167: /* func_arg_with_default: func_arg */ #line 8695 "gram_minimal.y" { (yyval.fun_param) = (yyvsp[0].fun_param); } #line 42787 "gram_minimal.c" break; case 1168: /* func_arg_with_default: func_arg DEFAULT a_expr */ #line 8699 "gram_minimal.y" { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 42796 "gram_minimal.c" break; case 1169: /* func_arg_with_default: func_arg '=' a_expr */ #line 8704 "gram_minimal.y" { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 42805 "gram_minimal.c" break; case 1170: /* aggr_arg: func_arg */ #line 8712 "gram_minimal.y" { 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 42820 "gram_minimal.c" break; case 1171: /* aggr_args: '(' '*' ')' */ #line 8754 "gram_minimal.y" { (yyval.list) = list_make2(NIL, makeInteger(-1)); } #line 42828 "gram_minimal.c" break; case 1172: /* aggr_args: '(' aggr_args_list ')' */ #line 8758 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(-1)); } #line 42836 "gram_minimal.c" break; case 1173: /* aggr_args: '(' ORDER BY aggr_args_list ')' */ #line 8762 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(0)); } #line 42844 "gram_minimal.c" break; case 1174: /* aggr_args: '(' aggr_args_list ORDER BY aggr_args_list ')' */ #line 8766 "gram_minimal.y" { /* this is the only case requiring consistency checking */ (yyval.list) = makeOrderedSetArgs((yyvsp[-4].list), (yyvsp[-1].list), yyscanner); } #line 42853 "gram_minimal.c" break; case 1175: /* aggr_args_list: aggr_arg */ #line 8773 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 42859 "gram_minimal.c" break; case 1176: /* aggr_args_list: aggr_args_list ',' aggr_arg */ #line 8774 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 42865 "gram_minimal.c" break; case 1177: /* aggregate_with_argtypes: func_name aggr_args */ #line 8779 "gram_minimal.y" { 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 42878 "gram_minimal.c" break; case 1178: /* aggregate_with_argtypes_list: aggregate_with_argtypes */ #line 8790 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 42884 "gram_minimal.c" break; case 1179: /* aggregate_with_argtypes_list: aggregate_with_argtypes_list ',' aggregate_with_argtypes */ #line 8792 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 42890 "gram_minimal.c" break; case 1181: /* opt_createfunc_opt_list: %empty */ #line 8797 "gram_minimal.y" { (yyval.list) = NIL; } #line 42896 "gram_minimal.c" break; case 1182: /* createfunc_opt_list: createfunc_opt_item */ #line 8802 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 42902 "gram_minimal.c" break; case 1183: /* createfunc_opt_list: createfunc_opt_list createfunc_opt_item */ #line 8803 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 42908 "gram_minimal.c" break; case 1184: /* common_func_opt_item: CALLED ON NULL_P INPUT_P */ #line 8811 "gram_minimal.y" { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(false), (yylsp[-3])); } #line 42916 "gram_minimal.c" break; case 1185: /* common_func_opt_item: RETURNS NULL_P ON NULL_P INPUT_P */ #line 8815 "gram_minimal.y" { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(true), (yylsp[-4])); } #line 42924 "gram_minimal.c" break; case 1186: /* common_func_opt_item: STRICT_P */ #line 8819 "gram_minimal.y" { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(true), (yylsp[0])); } #line 42932 "gram_minimal.c" break; case 1187: /* common_func_opt_item: IMMUTABLE */ #line 8823 "gram_minimal.y" { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("immutable"), (yylsp[0])); } #line 42940 "gram_minimal.c" break; case 1188: /* common_func_opt_item: STABLE */ #line 8827 "gram_minimal.y" { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("stable"), (yylsp[0])); } #line 42948 "gram_minimal.c" break; case 1189: /* common_func_opt_item: VOLATILE */ #line 8831 "gram_minimal.y" { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("volatile"), (yylsp[0])); } #line 42956 "gram_minimal.c" break; case 1190: /* common_func_opt_item: EXTERNAL SECURITY DEFINER */ #line 8835 "gram_minimal.y" { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(true), (yylsp[-2])); } #line 42964 "gram_minimal.c" break; case 1191: /* common_func_opt_item: EXTERNAL SECURITY INVOKER */ #line 8839 "gram_minimal.y" { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(false), (yylsp[-2])); } #line 42972 "gram_minimal.c" break; case 1192: /* common_func_opt_item: SECURITY DEFINER */ #line 8843 "gram_minimal.y" { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(true), (yylsp[-1])); } #line 42980 "gram_minimal.c" break; case 1193: /* common_func_opt_item: SECURITY INVOKER */ #line 8847 "gram_minimal.y" { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(false), (yylsp[-1])); } #line 42988 "gram_minimal.c" break; case 1194: /* common_func_opt_item: LEAKPROOF */ #line 8851 "gram_minimal.y" { (yyval.defelt) = makeDefElem("leakproof", (Node *) makeBoolean(true), (yylsp[0])); } #line 42996 "gram_minimal.c" break; case 1195: /* common_func_opt_item: NOT LEAKPROOF */ #line 8855 "gram_minimal.y" { (yyval.defelt) = makeDefElem("leakproof", (Node *) makeBoolean(false), (yylsp[-1])); } #line 43004 "gram_minimal.c" break; case 1196: /* common_func_opt_item: COST NumericOnly */ #line 8859 "gram_minimal.y" { (yyval.defelt) = makeDefElem("cost", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 43012 "gram_minimal.c" break; case 1197: /* common_func_opt_item: ROWS NumericOnly */ #line 8863 "gram_minimal.y" { (yyval.defelt) = makeDefElem("rows", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 43020 "gram_minimal.c" break; case 1198: /* common_func_opt_item: SUPPORT any_name */ #line 8867 "gram_minimal.y" { (yyval.defelt) = makeDefElem("support", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 43028 "gram_minimal.c" break; case 1199: /* common_func_opt_item: FunctionSetResetClause */ #line 8871 "gram_minimal.y" { /* we abuse the normal content of a DefElem here */ (yyval.defelt) = makeDefElem("set", (Node *) (yyvsp[0].vsetstmt), (yylsp[0])); } #line 43037 "gram_minimal.c" break; case 1200: /* common_func_opt_item: PARALLEL ColId */ #line 8876 "gram_minimal.y" { (yyval.defelt) = makeDefElem("parallel", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 43045 "gram_minimal.c" break; case 1201: /* createfunc_opt_item: AS func_as */ #line 8883 "gram_minimal.y" { (yyval.defelt) = makeDefElem("as", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 43053 "gram_minimal.c" break; case 1202: /* createfunc_opt_item: LANGUAGE NonReservedWord_or_Sconst */ #line 8887 "gram_minimal.y" { (yyval.defelt) = makeDefElem("language", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 43061 "gram_minimal.c" break; case 1203: /* createfunc_opt_item: TRANSFORM transform_type_list */ #line 8891 "gram_minimal.y" { (yyval.defelt) = makeDefElem("transform", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 43069 "gram_minimal.c" break; case 1204: /* createfunc_opt_item: WINDOW */ #line 8895 "gram_minimal.y" { (yyval.defelt) = makeDefElem("window", (Node *) makeBoolean(true), (yylsp[0])); } #line 43077 "gram_minimal.c" break; case 1205: /* createfunc_opt_item: common_func_opt_item */ #line 8899 "gram_minimal.y" { (yyval.defelt) = (yyvsp[0].defelt); } #line 43085 "gram_minimal.c" break; case 1206: /* func_as: Sconst */ #line 8904 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 43091 "gram_minimal.c" break; case 1207: /* func_as: Sconst ',' Sconst */ #line 8906 "gram_minimal.y" { (yyval.list) = list_make2(makeString((yyvsp[-2].str)), makeString((yyvsp[0].str))); } #line 43099 "gram_minimal.c" break; case 1208: /* ReturnStmt: RETURN a_expr */ #line 8912 "gram_minimal.y" { ReturnStmt *r = makeNode(ReturnStmt); r->returnval = (Node *) (yyvsp[0].node); (yyval.node) = (Node *) r; } #line 43110 "gram_minimal.c" break; case 1209: /* opt_routine_body: ReturnStmt */ #line 8922 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 43118 "gram_minimal.c" break; case 1210: /* opt_routine_body: BEGIN_P ATOMIC routine_body_stmt_list END_P */ #line 8926 "gram_minimal.y" { /* * 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 43132 "gram_minimal.c" break; case 1211: /* opt_routine_body: %empty */ #line 8936 "gram_minimal.y" { (yyval.node) = NULL; } #line 43140 "gram_minimal.c" break; case 1212: /* routine_body_stmt_list: routine_body_stmt_list routine_body_stmt ';' */ #line 8943 "gram_minimal.y" { /* 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 43152 "gram_minimal.c" break; case 1213: /* routine_body_stmt_list: %empty */ #line 8951 "gram_minimal.y" { (yyval.list) = NIL; } #line 43160 "gram_minimal.c" break; case 1216: /* transform_type_list: FOR TYPE_P Typename */ #line 8962 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 43166 "gram_minimal.c" break; case 1217: /* transform_type_list: transform_type_list ',' FOR TYPE_P Typename */ #line 8963 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-4].list), (yyvsp[0].typnam)); } #line 43172 "gram_minimal.c" break; case 1218: /* opt_definition: WITH definition */ #line 8967 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 43178 "gram_minimal.c" break; case 1219: /* opt_definition: %empty */ #line 8968 "gram_minimal.y" { (yyval.list) = NIL; } #line 43184 "gram_minimal.c" break; case 1220: /* table_func_column: param_name func_type */ #line 8972 "gram_minimal.y" { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_TABLE; n->defexpr = NULL; n->location = (yylsp[-1]); (yyval.fun_param) = n; } #line 43199 "gram_minimal.c" break; case 1221: /* table_func_column_list: table_func_column */ #line 8986 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 43207 "gram_minimal.c" break; case 1222: /* table_func_column_list: table_func_column_list ',' table_func_column */ #line 8990 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 43215 "gram_minimal.c" break; case 1223: /* AlterFunctionStmt: ALTER FUNCTION function_with_argtypes alterfunc_opt_list opt_restrict */ #line 9005 "gram_minimal.y" { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_FUNCTION; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43228 "gram_minimal.c" break; case 1224: /* AlterFunctionStmt: ALTER PROCEDURE function_with_argtypes alterfunc_opt_list opt_restrict */ #line 9014 "gram_minimal.y" { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_PROCEDURE; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43241 "gram_minimal.c" break; case 1225: /* AlterFunctionStmt: ALTER ROUTINE function_with_argtypes alterfunc_opt_list opt_restrict */ #line 9023 "gram_minimal.y" { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_ROUTINE; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43254 "gram_minimal.c" break; case 1226: /* alterfunc_opt_list: common_func_opt_item */ #line 9035 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 43260 "gram_minimal.c" break; case 1227: /* alterfunc_opt_list: alterfunc_opt_list common_func_opt_item */ #line 9036 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 43266 "gram_minimal.c" break; case 1230: /* RemoveFuncStmt: DROP FUNCTION function_with_argtypes_list opt_drop_behavior */ #line 9060 "gram_minimal.y" { 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 43281 "gram_minimal.c" break; case 1231: /* RemoveFuncStmt: DROP FUNCTION IF_P EXISTS function_with_argtypes_list opt_drop_behavior */ #line 9071 "gram_minimal.y" { 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 43296 "gram_minimal.c" break; case 1232: /* RemoveFuncStmt: DROP PROCEDURE function_with_argtypes_list opt_drop_behavior */ #line 9082 "gram_minimal.y" { 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 43311 "gram_minimal.c" break; case 1233: /* RemoveFuncStmt: DROP PROCEDURE IF_P EXISTS function_with_argtypes_list opt_drop_behavior */ #line 9093 "gram_minimal.y" { 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 43326 "gram_minimal.c" break; case 1234: /* RemoveFuncStmt: DROP ROUTINE function_with_argtypes_list opt_drop_behavior */ #line 9104 "gram_minimal.y" { 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 43341 "gram_minimal.c" break; case 1235: /* RemoveFuncStmt: DROP ROUTINE IF_P EXISTS function_with_argtypes_list opt_drop_behavior */ #line 9115 "gram_minimal.y" { 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 43356 "gram_minimal.c" break; case 1236: /* RemoveAggrStmt: DROP AGGREGATE aggregate_with_argtypes_list opt_drop_behavior */ #line 9129 "gram_minimal.y" { 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 43371 "gram_minimal.c" break; case 1237: /* RemoveAggrStmt: DROP AGGREGATE IF_P EXISTS aggregate_with_argtypes_list opt_drop_behavior */ #line 9140 "gram_minimal.y" { 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 43386 "gram_minimal.c" break; case 1238: /* RemoveOperStmt: DROP OPERATOR operator_with_argtypes_list opt_drop_behavior */ #line 9154 "gram_minimal.y" { 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 43401 "gram_minimal.c" break; case 1239: /* RemoveOperStmt: DROP OPERATOR IF_P EXISTS operator_with_argtypes_list opt_drop_behavior */ #line 9165 "gram_minimal.y" { 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 43416 "gram_minimal.c" break; case 1240: /* oper_argtypes: '(' Typename ')' */ #line 9179 "gram_minimal.y" { 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 43428 "gram_minimal.c" break; case 1241: /* oper_argtypes: '(' Typename ',' Typename ')' */ #line 9187 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); } #line 43434 "gram_minimal.c" break; case 1242: /* oper_argtypes: '(' NONE ',' Typename ')' */ #line 9189 "gram_minimal.y" { (yyval.list) = list_make2(NULL, (yyvsp[-1].typnam)); } #line 43440 "gram_minimal.c" break; case 1243: /* oper_argtypes: '(' Typename ',' NONE ')' */ #line 9191 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-3].typnam), NULL); } #line 43446 "gram_minimal.c" break; case 1244: /* any_operator: all_Op */ #line 9196 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 43452 "gram_minimal.c" break; case 1245: /* any_operator: ColId '.' any_operator */ #line 9198 "gram_minimal.y" { (yyval.list) = lcons(makeString((yyvsp[-2].str)), (yyvsp[0].list)); } #line 43458 "gram_minimal.c" break; case 1246: /* operator_with_argtypes_list: operator_with_argtypes */ #line 9202 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 43464 "gram_minimal.c" break; case 1247: /* operator_with_argtypes_list: operator_with_argtypes_list ',' operator_with_argtypes */ #line 9204 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 43470 "gram_minimal.c" break; case 1248: /* operator_with_argtypes: any_operator oper_argtypes */ #line 9209 "gram_minimal.y" { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 43482 "gram_minimal.c" break; case 1249: /* DoStmt: DO dostmt_opt_list */ #line 9228 "gram_minimal.y" { DoStmt *n = makeNode(DoStmt); n->args = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43493 "gram_minimal.c" break; case 1250: /* dostmt_opt_list: dostmt_opt_item */ #line 9237 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 43499 "gram_minimal.c" break; case 1251: /* dostmt_opt_list: dostmt_opt_list dostmt_opt_item */ #line 9238 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 43505 "gram_minimal.c" break; case 1252: /* dostmt_opt_item: Sconst */ #line 9243 "gram_minimal.y" { (yyval.defelt) = makeDefElem("as", (Node *) makeString((yyvsp[0].str)), (yylsp[0])); } #line 43513 "gram_minimal.c" break; case 1253: /* dostmt_opt_item: LANGUAGE NonReservedWord_or_Sconst */ #line 9247 "gram_minimal.y" { (yyval.defelt) = makeDefElem("language", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 43521 "gram_minimal.c" break; case 1254: /* CreateCastStmt: CREATE CAST '(' Typename AS Typename ')' WITH FUNCTION function_with_argtypes cast_context */ #line 9260 "gram_minimal.y" { 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 43536 "gram_minimal.c" break; case 1255: /* CreateCastStmt: CREATE CAST '(' Typename AS Typename ')' WITHOUT FUNCTION cast_context */ #line 9272 "gram_minimal.y" { 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 43551 "gram_minimal.c" break; case 1256: /* CreateCastStmt: CREATE CAST '(' Typename AS Typename ')' WITH INOUT cast_context */ #line 9284 "gram_minimal.y" { 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 43566 "gram_minimal.c" break; case 1257: /* cast_context: AS IMPLICIT_P */ #line 9296 "gram_minimal.y" { (yyval.ival) = COERCION_IMPLICIT; } #line 43572 "gram_minimal.c" break; case 1258: /* cast_context: AS ASSIGNMENT */ #line 9297 "gram_minimal.y" { (yyval.ival) = COERCION_ASSIGNMENT; } #line 43578 "gram_minimal.c" break; case 1259: /* cast_context: %empty */ #line 9298 "gram_minimal.y" { (yyval.ival) = COERCION_EXPLICIT; } #line 43584 "gram_minimal.c" break; case 1260: /* DropCastStmt: DROP CAST opt_if_exists '(' Typename AS Typename ')' opt_drop_behavior */ #line 9303 "gram_minimal.y" { 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 43599 "gram_minimal.c" break; case 1261: /* opt_if_exists: IF_P EXISTS */ #line 9315 "gram_minimal.y" { (yyval.boolean) = true; } #line 43605 "gram_minimal.c" break; case 1262: /* opt_if_exists: %empty */ #line 9316 "gram_minimal.y" { (yyval.boolean) = false; } #line 43611 "gram_minimal.c" break; case 1263: /* CreateTransformStmt: CREATE opt_or_replace TRANSFORM FOR Typename LANGUAGE name '(' transform_element_list ')' */ #line 9327 "gram_minimal.y" { 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 43626 "gram_minimal.c" break; case 1264: /* transform_element_list: FROM SQL_P WITH FUNCTION function_with_argtypes ',' TO SQL_P WITH FUNCTION function_with_argtypes */ #line 9340 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-6].objwithargs), (yyvsp[0].objwithargs)); } #line 43634 "gram_minimal.c" break; case 1265: /* transform_element_list: TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes */ #line 9344 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[0].objwithargs), (yyvsp[-6].objwithargs)); } #line 43642 "gram_minimal.c" break; case 1266: /* transform_element_list: FROM SQL_P WITH FUNCTION function_with_argtypes */ #line 9348 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[0].objwithargs), NULL); } #line 43650 "gram_minimal.c" break; case 1267: /* transform_element_list: TO SQL_P WITH FUNCTION function_with_argtypes */ #line 9352 "gram_minimal.y" { (yyval.list) = list_make2(NULL, (yyvsp[0].objwithargs)); } #line 43658 "gram_minimal.c" break; case 1268: /* DropTransformStmt: DROP TRANSFORM opt_if_exists FOR Typename LANGUAGE name opt_drop_behavior */ #line 9359 "gram_minimal.y" { 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 43672 "gram_minimal.c" break; case 1269: /* ReindexStmt: REINDEX opt_reindex_option_list reindex_target_relation opt_concurrently qualified_name */ #line 9381 "gram_minimal.y" { 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 43689 "gram_minimal.c" break; case 1270: /* ReindexStmt: REINDEX opt_reindex_option_list SCHEMA opt_concurrently name */ #line 9394 "gram_minimal.y" { 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 43706 "gram_minimal.c" break; case 1271: /* ReindexStmt: REINDEX opt_reindex_option_list reindex_target_all opt_concurrently opt_single_name */ #line 9407 "gram_minimal.y" { 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 43723 "gram_minimal.c" break; case 1272: /* reindex_target_relation: INDEX */ #line 9421 "gram_minimal.y" { (yyval.ival) = REINDEX_OBJECT_INDEX; } #line 43729 "gram_minimal.c" break; case 1273: /* reindex_target_relation: TABLE */ #line 9422 "gram_minimal.y" { (yyval.ival) = REINDEX_OBJECT_TABLE; } #line 43735 "gram_minimal.c" break; case 1274: /* reindex_target_all: SYSTEM_P */ #line 9425 "gram_minimal.y" { (yyval.ival) = REINDEX_OBJECT_SYSTEM; } #line 43741 "gram_minimal.c" break; case 1275: /* reindex_target_all: DATABASE */ #line 9426 "gram_minimal.y" { (yyval.ival) = REINDEX_OBJECT_DATABASE; } #line 43747 "gram_minimal.c" break; case 1276: /* opt_reindex_option_list: '(' utility_option_list ')' */ #line 9429 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 43753 "gram_minimal.c" break; case 1277: /* opt_reindex_option_list: %empty */ #line 9430 "gram_minimal.y" { (yyval.list) = NULL; } #line 43759 "gram_minimal.c" break; case 1278: /* AlterTblSpcStmt: ALTER TABLESPACE name SET reloptions */ #line 9441 "gram_minimal.y" { AlterTableSpaceOptionsStmt *n = makeNode(AlterTableSpaceOptionsStmt); n->tablespacename = (yyvsp[-2].str); n->options = (yyvsp[0].list); n->isReset = false; (yyval.node) = (Node *) n; } #line 43773 "gram_minimal.c" break; case 1279: /* AlterTblSpcStmt: ALTER TABLESPACE name RESET reloptions */ #line 9451 "gram_minimal.y" { AlterTableSpaceOptionsStmt *n = makeNode(AlterTableSpaceOptionsStmt); n->tablespacename = (yyvsp[-2].str); n->options = (yyvsp[0].list); n->isReset = true; (yyval.node) = (Node *) n; } #line 43787 "gram_minimal.c" break; case 1280: /* RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name */ #line 9469 "gram_minimal.y" { 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 43801 "gram_minimal.c" break; case 1281: /* RenameStmt: ALTER COLLATION any_name RENAME TO name */ #line 9479 "gram_minimal.y" { 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 43815 "gram_minimal.c" break; case 1282: /* RenameStmt: ALTER CONVERSION_P any_name RENAME TO name */ #line 9489 "gram_minimal.y" { 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 43829 "gram_minimal.c" break; case 1283: /* RenameStmt: ALTER DATABASE name RENAME TO name */ #line 9499 "gram_minimal.y" { 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 43843 "gram_minimal.c" break; case 1284: /* RenameStmt: ALTER DOMAIN_P any_name RENAME TO name */ #line 9509 "gram_minimal.y" { 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 43857 "gram_minimal.c" break; case 1285: /* RenameStmt: ALTER DOMAIN_P any_name RENAME CONSTRAINT name TO name */ #line 9519 "gram_minimal.y" { 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 43871 "gram_minimal.c" break; case 1286: /* RenameStmt: ALTER FOREIGN DATA_P WRAPPER name RENAME TO name */ #line 9529 "gram_minimal.y" { 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 43885 "gram_minimal.c" break; case 1287: /* RenameStmt: ALTER FUNCTION function_with_argtypes RENAME TO name */ #line 9539 "gram_minimal.y" { 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 43899 "gram_minimal.c" break; case 1288: /* RenameStmt: ALTER GROUP_P RoleId RENAME TO RoleId */ #line 9549 "gram_minimal.y" { 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 43913 "gram_minimal.c" break; case 1289: /* RenameStmt: ALTER opt_procedural LANGUAGE name RENAME TO name */ #line 9559 "gram_minimal.y" { 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 43927 "gram_minimal.c" break; case 1290: /* RenameStmt: ALTER OPERATOR CLASS any_name USING name RENAME TO name */ #line 9569 "gram_minimal.y" { 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 43941 "gram_minimal.c" break; case 1291: /* RenameStmt: ALTER OPERATOR FAMILY any_name USING name RENAME TO name */ #line 9579 "gram_minimal.y" { 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 43955 "gram_minimal.c" break; case 1292: /* RenameStmt: ALTER POLICY name ON qualified_name RENAME TO name */ #line 9589 "gram_minimal.y" { 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 43970 "gram_minimal.c" break; case 1293: /* RenameStmt: ALTER POLICY IF_P EXISTS name ON qualified_name RENAME TO name */ #line 9600 "gram_minimal.y" { 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 43985 "gram_minimal.c" break; case 1294: /* RenameStmt: ALTER PROCEDURE function_with_argtypes RENAME TO name */ #line 9611 "gram_minimal.y" { 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 43999 "gram_minimal.c" break; case 1295: /* RenameStmt: ALTER PUBLICATION name RENAME TO name */ #line 9621 "gram_minimal.y" { 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 44013 "gram_minimal.c" break; case 1296: /* RenameStmt: ALTER ROUTINE function_with_argtypes RENAME TO name */ #line 9631 "gram_minimal.y" { 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 44027 "gram_minimal.c" break; case 1297: /* RenameStmt: ALTER SCHEMA name RENAME TO name */ #line 9641 "gram_minimal.y" { 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 44041 "gram_minimal.c" break; case 1298: /* RenameStmt: ALTER SERVER name RENAME TO name */ #line 9651 "gram_minimal.y" { 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 44055 "gram_minimal.c" break; case 1299: /* RenameStmt: ALTER SUBSCRIPTION name RENAME TO name */ #line 9661 "gram_minimal.y" { 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 44069 "gram_minimal.c" break; case 1300: /* RenameStmt: ALTER TABLE relation_expr RENAME TO name */ #line 9671 "gram_minimal.y" { 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 44084 "gram_minimal.c" break; case 1301: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME TO name */ #line 9682 "gram_minimal.y" { 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 44099 "gram_minimal.c" break; case 1302: /* RenameStmt: ALTER SEQUENCE qualified_name RENAME TO name */ #line 9693 "gram_minimal.y" { 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 44114 "gram_minimal.c" break; case 1303: /* RenameStmt: ALTER SEQUENCE IF_P EXISTS qualified_name RENAME TO name */ #line 9704 "gram_minimal.y" { 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 44129 "gram_minimal.c" break; case 1304: /* RenameStmt: ALTER VIEW qualified_name RENAME TO name */ #line 9715 "gram_minimal.y" { 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 44144 "gram_minimal.c" break; case 1305: /* RenameStmt: ALTER VIEW IF_P EXISTS qualified_name RENAME TO name */ #line 9726 "gram_minimal.y" { 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 44159 "gram_minimal.c" break; case 1306: /* RenameStmt: ALTER MATERIALIZED VIEW qualified_name RENAME TO name */ #line 9737 "gram_minimal.y" { 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 44174 "gram_minimal.c" break; case 1307: /* RenameStmt: ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name RENAME TO name */ #line 9748 "gram_minimal.y" { 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 44189 "gram_minimal.c" break; case 1308: /* RenameStmt: ALTER INDEX qualified_name RENAME TO name */ #line 9759 "gram_minimal.y" { 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 44204 "gram_minimal.c" break; case 1309: /* RenameStmt: ALTER INDEX IF_P EXISTS qualified_name RENAME TO name */ #line 9770 "gram_minimal.y" { 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 44219 "gram_minimal.c" break; case 1310: /* RenameStmt: ALTER FOREIGN TABLE relation_expr RENAME TO name */ #line 9781 "gram_minimal.y" { 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 44234 "gram_minimal.c" break; case 1311: /* RenameStmt: ALTER FOREIGN TABLE IF_P EXISTS relation_expr RENAME TO name */ #line 9792 "gram_minimal.y" { 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 44249 "gram_minimal.c" break; case 1312: /* RenameStmt: ALTER TABLE relation_expr RENAME opt_column name TO name */ #line 9803 "gram_minimal.y" { 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 44265 "gram_minimal.c" break; case 1313: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name */ #line 9815 "gram_minimal.y" { 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 44281 "gram_minimal.c" break; case 1314: /* RenameStmt: ALTER VIEW qualified_name RENAME opt_column name TO name */ #line 9827 "gram_minimal.y" { 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 44297 "gram_minimal.c" break; case 1315: /* RenameStmt: ALTER VIEW IF_P EXISTS qualified_name RENAME opt_column name TO name */ #line 9839 "gram_minimal.y" { 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 44313 "gram_minimal.c" break; case 1316: /* RenameStmt: ALTER MATERIALIZED VIEW qualified_name RENAME opt_column name TO name */ #line 9851 "gram_minimal.y" { 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 44329 "gram_minimal.c" break; case 1317: /* RenameStmt: ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name RENAME opt_column name TO name */ #line 9863 "gram_minimal.y" { 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 44345 "gram_minimal.c" break; case 1318: /* RenameStmt: ALTER TABLE relation_expr RENAME CONSTRAINT name TO name */ #line 9875 "gram_minimal.y" { 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 44360 "gram_minimal.c" break; case 1319: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME CONSTRAINT name TO name */ #line 9886 "gram_minimal.y" { 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 44375 "gram_minimal.c" break; case 1320: /* RenameStmt: ALTER FOREIGN TABLE relation_expr RENAME opt_column name TO name */ #line 9897 "gram_minimal.y" { 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 44391 "gram_minimal.c" break; case 1321: /* RenameStmt: ALTER FOREIGN TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name */ #line 9909 "gram_minimal.y" { 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 44407 "gram_minimal.c" break; case 1322: /* RenameStmt: ALTER RULE name ON qualified_name RENAME TO name */ #line 9921 "gram_minimal.y" { 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 44422 "gram_minimal.c" break; case 1323: /* RenameStmt: ALTER TRIGGER name ON qualified_name RENAME TO name */ #line 9932 "gram_minimal.y" { 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 44437 "gram_minimal.c" break; case 1324: /* RenameStmt: ALTER EVENT TRIGGER name RENAME TO name */ #line 9943 "gram_minimal.y" { 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 44450 "gram_minimal.c" break; case 1325: /* RenameStmt: ALTER ROLE RoleId RENAME TO RoleId */ #line 9952 "gram_minimal.y" { 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 44464 "gram_minimal.c" break; case 1326: /* RenameStmt: ALTER USER RoleId RENAME TO RoleId */ #line 9962 "gram_minimal.y" { 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 44478 "gram_minimal.c" break; case 1327: /* RenameStmt: ALTER TABLESPACE name RENAME TO name */ #line 9972 "gram_minimal.y" { 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 44492 "gram_minimal.c" break; case 1328: /* RenameStmt: ALTER STATISTICS any_name RENAME TO name */ #line 9982 "gram_minimal.y" { 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 44506 "gram_minimal.c" break; case 1329: /* RenameStmt: ALTER TEXT_P SEARCH PARSER any_name RENAME TO name */ #line 9992 "gram_minimal.y" { 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 44520 "gram_minimal.c" break; case 1330: /* RenameStmt: ALTER TEXT_P SEARCH DICTIONARY any_name RENAME TO name */ #line 10002 "gram_minimal.y" { 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 44534 "gram_minimal.c" break; case 1331: /* RenameStmt: ALTER TEXT_P SEARCH TEMPLATE any_name RENAME TO name */ #line 10012 "gram_minimal.y" { 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 44548 "gram_minimal.c" break; case 1332: /* RenameStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name RENAME TO name */ #line 10022 "gram_minimal.y" { 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 44562 "gram_minimal.c" break; case 1333: /* RenameStmt: ALTER TYPE_P any_name RENAME TO name */ #line 10032 "gram_minimal.y" { 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 44576 "gram_minimal.c" break; case 1334: /* RenameStmt: ALTER TYPE_P any_name RENAME ATTRIBUTE name TO name opt_drop_behavior */ #line 10042 "gram_minimal.y" { 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 44593 "gram_minimal.c" break; case 1337: /* opt_set_data: SET DATA_P */ #line 10060 "gram_minimal.y" { (yyval.ival) = 1; } #line 44599 "gram_minimal.c" break; case 1338: /* opt_set_data: %empty */ #line 10061 "gram_minimal.y" { (yyval.ival) = 0; } #line 44605 "gram_minimal.c" break; case 1339: /* AlterObjectDependsStmt: ALTER FUNCTION function_with_argtypes opt_no DEPENDS ON EXTENSION name */ #line 10072 "gram_minimal.y" { 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 44619 "gram_minimal.c" break; case 1340: /* AlterObjectDependsStmt: ALTER PROCEDURE function_with_argtypes opt_no DEPENDS ON EXTENSION name */ #line 10082 "gram_minimal.y" { 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 44633 "gram_minimal.c" break; case 1341: /* AlterObjectDependsStmt: ALTER ROUTINE function_with_argtypes opt_no DEPENDS ON EXTENSION name */ #line 10092 "gram_minimal.y" { 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 44647 "gram_minimal.c" break; case 1342: /* AlterObjectDependsStmt: ALTER TRIGGER name ON qualified_name opt_no DEPENDS ON EXTENSION name */ #line 10102 "gram_minimal.y" { 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 44662 "gram_minimal.c" break; case 1343: /* AlterObjectDependsStmt: ALTER MATERIALIZED VIEW qualified_name opt_no DEPENDS ON EXTENSION name */ #line 10113 "gram_minimal.y" { 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 44676 "gram_minimal.c" break; case 1344: /* AlterObjectDependsStmt: ALTER INDEX qualified_name opt_no DEPENDS ON EXTENSION name */ #line 10123 "gram_minimal.y" { 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 44690 "gram_minimal.c" break; case 1345: /* opt_no: NO */ #line 10134 "gram_minimal.y" { (yyval.boolean) = true; } #line 44696 "gram_minimal.c" break; case 1346: /* opt_no: %empty */ #line 10135 "gram_minimal.y" { (yyval.boolean) = false; } #line 44702 "gram_minimal.c" break; case 1347: /* AlterObjectSchemaStmt: ALTER AGGREGATE aggregate_with_argtypes SET SCHEMA name */ #line 10146 "gram_minimal.y" { 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 44716 "gram_minimal.c" break; case 1348: /* AlterObjectSchemaStmt: ALTER COLLATION any_name SET SCHEMA name */ #line 10156 "gram_minimal.y" { 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 44730 "gram_minimal.c" break; case 1349: /* AlterObjectSchemaStmt: ALTER CONVERSION_P any_name SET SCHEMA name */ #line 10166 "gram_minimal.y" { 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 44744 "gram_minimal.c" break; case 1350: /* AlterObjectSchemaStmt: ALTER DOMAIN_P any_name SET SCHEMA name */ #line 10176 "gram_minimal.y" { 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 44758 "gram_minimal.c" break; case 1351: /* AlterObjectSchemaStmt: ALTER EXTENSION name SET SCHEMA name */ #line 10186 "gram_minimal.y" { 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 44772 "gram_minimal.c" break; case 1352: /* AlterObjectSchemaStmt: ALTER FUNCTION function_with_argtypes SET SCHEMA name */ #line 10196 "gram_minimal.y" { 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 44786 "gram_minimal.c" break; case 1353: /* AlterObjectSchemaStmt: ALTER OPERATOR operator_with_argtypes SET SCHEMA name */ #line 10206 "gram_minimal.y" { 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 44800 "gram_minimal.c" break; case 1354: /* AlterObjectSchemaStmt: ALTER OPERATOR CLASS any_name USING name SET SCHEMA name */ #line 10216 "gram_minimal.y" { 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 44814 "gram_minimal.c" break; case 1355: /* AlterObjectSchemaStmt: ALTER OPERATOR FAMILY any_name USING name SET SCHEMA name */ #line 10226 "gram_minimal.y" { 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 44828 "gram_minimal.c" break; case 1356: /* AlterObjectSchemaStmt: ALTER PROCEDURE function_with_argtypes SET SCHEMA name */ #line 10236 "gram_minimal.y" { 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 44842 "gram_minimal.c" break; case 1357: /* AlterObjectSchemaStmt: ALTER ROUTINE function_with_argtypes SET SCHEMA name */ #line 10246 "gram_minimal.y" { 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 44856 "gram_minimal.c" break; case 1358: /* AlterObjectSchemaStmt: ALTER TABLE relation_expr SET SCHEMA name */ #line 10256 "gram_minimal.y" { 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 44870 "gram_minimal.c" break; case 1359: /* AlterObjectSchemaStmt: ALTER TABLE IF_P EXISTS relation_expr SET SCHEMA name */ #line 10266 "gram_minimal.y" { 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 44884 "gram_minimal.c" break; case 1360: /* AlterObjectSchemaStmt: ALTER STATISTICS any_name SET SCHEMA name */ #line 10276 "gram_minimal.y" { 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 44898 "gram_minimal.c" break; case 1361: /* AlterObjectSchemaStmt: ALTER TEXT_P SEARCH PARSER any_name SET SCHEMA name */ #line 10286 "gram_minimal.y" { 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 44912 "gram_minimal.c" break; case 1362: /* AlterObjectSchemaStmt: ALTER TEXT_P SEARCH DICTIONARY any_name SET SCHEMA name */ #line 10296 "gram_minimal.y" { 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 44926 "gram_minimal.c" break; case 1363: /* AlterObjectSchemaStmt: ALTER TEXT_P SEARCH TEMPLATE any_name SET SCHEMA name */ #line 10306 "gram_minimal.y" { 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 44940 "gram_minimal.c" break; case 1364: /* AlterObjectSchemaStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name SET SCHEMA name */ #line 10316 "gram_minimal.y" { 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 44954 "gram_minimal.c" break; case 1365: /* AlterObjectSchemaStmt: ALTER SEQUENCE qualified_name SET SCHEMA name */ #line 10326 "gram_minimal.y" { 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 44968 "gram_minimal.c" break; case 1366: /* AlterObjectSchemaStmt: ALTER SEQUENCE IF_P EXISTS qualified_name SET SCHEMA name */ #line 10336 "gram_minimal.y" { 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 44982 "gram_minimal.c" break; case 1367: /* AlterObjectSchemaStmt: ALTER VIEW qualified_name SET SCHEMA name */ #line 10346 "gram_minimal.y" { 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 44996 "gram_minimal.c" break; case 1368: /* AlterObjectSchemaStmt: ALTER VIEW IF_P EXISTS qualified_name SET SCHEMA name */ #line 10356 "gram_minimal.y" { 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 45010 "gram_minimal.c" break; case 1369: /* AlterObjectSchemaStmt: ALTER MATERIALIZED VIEW qualified_name SET SCHEMA name */ #line 10366 "gram_minimal.y" { 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 45024 "gram_minimal.c" break; case 1370: /* AlterObjectSchemaStmt: ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name SET SCHEMA name */ #line 10376 "gram_minimal.y" { 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 45038 "gram_minimal.c" break; case 1371: /* AlterObjectSchemaStmt: ALTER FOREIGN TABLE relation_expr SET SCHEMA name */ #line 10386 "gram_minimal.y" { 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 45052 "gram_minimal.c" break; case 1372: /* AlterObjectSchemaStmt: ALTER FOREIGN TABLE IF_P EXISTS relation_expr SET SCHEMA name */ #line 10396 "gram_minimal.y" { 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 45066 "gram_minimal.c" break; case 1373: /* AlterObjectSchemaStmt: ALTER TYPE_P any_name SET SCHEMA name */ #line 10406 "gram_minimal.y" { 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 45080 "gram_minimal.c" break; case 1374: /* AlterOperatorStmt: ALTER OPERATOR operator_with_argtypes SET '(' operator_def_list ')' */ #line 10425 "gram_minimal.y" { AlterOperatorStmt *n = makeNode(AlterOperatorStmt); n->opername = (yyvsp[-4].objwithargs); n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 45092 "gram_minimal.c" break; case 1375: /* operator_def_list: operator_def_elem */ #line 10434 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 45098 "gram_minimal.c" break; case 1376: /* operator_def_list: operator_def_list ',' operator_def_elem */ #line 10435 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 45104 "gram_minimal.c" break; case 1377: /* operator_def_elem: ColLabel '=' NONE */ #line 10439 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 45110 "gram_minimal.c" break; case 1378: /* operator_def_elem: ColLabel '=' operator_def_arg */ #line 10441 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 45116 "gram_minimal.c" break; case 1379: /* operator_def_elem: ColLabel */ #line 10443 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 45122 "gram_minimal.c" break; case 1380: /* operator_def_arg: func_type */ #line 10448 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].typnam); } #line 45128 "gram_minimal.c" break; case 1381: /* operator_def_arg: reserved_keyword */ #line 10449 "gram_minimal.y" { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 45134 "gram_minimal.c" break; case 1382: /* operator_def_arg: qual_all_Op */ #line 10450 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].list); } #line 45140 "gram_minimal.c" break; case 1383: /* operator_def_arg: NumericOnly */ #line 10451 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].node); } #line 45146 "gram_minimal.c" break; case 1384: /* operator_def_arg: Sconst */ #line 10452 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 45152 "gram_minimal.c" break; case 1385: /* AlterTypeStmt: ALTER TYPE_P any_name SET '(' operator_def_list ')' */ #line 10465 "gram_minimal.y" { AlterTypeStmt *n = makeNode(AlterTypeStmt); n->typeName = (yyvsp[-4].list); n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 45164 "gram_minimal.c" break; case 1386: /* AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec */ #line 10481 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45177 "gram_minimal.c" break; case 1387: /* AlterOwnerStmt: ALTER COLLATION any_name OWNER TO RoleSpec */ #line 10490 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_COLLATION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45190 "gram_minimal.c" break; case 1388: /* AlterOwnerStmt: ALTER CONVERSION_P any_name OWNER TO RoleSpec */ #line 10499 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45203 "gram_minimal.c" break; case 1389: /* AlterOwnerStmt: ALTER DATABASE name OWNER TO RoleSpec */ #line 10508 "gram_minimal.y" { 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 45216 "gram_minimal.c" break; case 1390: /* AlterOwnerStmt: ALTER DOMAIN_P any_name OWNER TO RoleSpec */ #line 10517 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45229 "gram_minimal.c" break; case 1391: /* AlterOwnerStmt: ALTER FUNCTION function_with_argtypes OWNER TO RoleSpec */ #line 10526 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45242 "gram_minimal.c" break; case 1392: /* AlterOwnerStmt: ALTER opt_procedural LANGUAGE name OWNER TO RoleSpec */ #line 10535 "gram_minimal.y" { 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 45255 "gram_minimal.c" break; case 1393: /* AlterOwnerStmt: ALTER LARGE_P OBJECT_P NumericOnly OWNER TO RoleSpec */ #line 10544 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-3].node); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45268 "gram_minimal.c" break; case 1394: /* AlterOwnerStmt: ALTER OPERATOR operator_with_argtypes OWNER TO RoleSpec */ #line 10553 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45281 "gram_minimal.c" break; case 1395: /* AlterOwnerStmt: ALTER OPERATOR CLASS any_name USING name OWNER TO RoleSpec */ #line 10562 "gram_minimal.y" { 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 45294 "gram_minimal.c" break; case 1396: /* AlterOwnerStmt: ALTER OPERATOR FAMILY any_name USING name OWNER TO RoleSpec */ #line 10571 "gram_minimal.y" { 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 45307 "gram_minimal.c" break; case 1397: /* AlterOwnerStmt: ALTER PROCEDURE function_with_argtypes OWNER TO RoleSpec */ #line 10580 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45320 "gram_minimal.c" break; case 1398: /* AlterOwnerStmt: ALTER ROUTINE function_with_argtypes OWNER TO RoleSpec */ #line 10589 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45333 "gram_minimal.c" break; case 1399: /* AlterOwnerStmt: ALTER SCHEMA name OWNER TO RoleSpec */ #line 10598 "gram_minimal.y" { 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 45346 "gram_minimal.c" break; case 1400: /* AlterOwnerStmt: ALTER TYPE_P any_name OWNER TO RoleSpec */ #line 10607 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TYPE; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45359 "gram_minimal.c" break; case 1401: /* AlterOwnerStmt: ALTER TABLESPACE name OWNER TO RoleSpec */ #line 10616 "gram_minimal.y" { 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 45372 "gram_minimal.c" break; case 1402: /* AlterOwnerStmt: ALTER STATISTICS any_name OWNER TO RoleSpec */ #line 10625 "gram_minimal.y" { 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 45385 "gram_minimal.c" break; case 1403: /* AlterOwnerStmt: ALTER TEXT_P SEARCH DICTIONARY any_name OWNER TO RoleSpec */ #line 10634 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45398 "gram_minimal.c" break; case 1404: /* AlterOwnerStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name OWNER TO RoleSpec */ #line 10643 "gram_minimal.y" { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 45411 "gram_minimal.c" break; case 1405: /* AlterOwnerStmt: ALTER FOREIGN DATA_P WRAPPER name OWNER TO RoleSpec */ #line 10652 "gram_minimal.y" { 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 45424 "gram_minimal.c" break; case 1406: /* AlterOwnerStmt: ALTER SERVER name OWNER TO RoleSpec */ #line 10661 "gram_minimal.y" { 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 45437 "gram_minimal.c" break; case 1407: /* AlterOwnerStmt: ALTER EVENT TRIGGER name OWNER TO RoleSpec */ #line 10670 "gram_minimal.y" { 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 45450 "gram_minimal.c" break; case 1408: /* AlterOwnerStmt: ALTER PUBLICATION name OWNER TO RoleSpec */ #line 10679 "gram_minimal.y" { 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 45463 "gram_minimal.c" break; case 1409: /* AlterOwnerStmt: ALTER SUBSCRIPTION name OWNER TO RoleSpec */ #line 10688 "gram_minimal.y" { 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 45476 "gram_minimal.c" break; case 1410: /* CreatePublicationStmt: CREATE PUBLICATION name opt_definition */ #line 10716 "gram_minimal.y" { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45488 "gram_minimal.c" break; case 1411: /* CreatePublicationStmt: CREATE PUBLICATION name FOR ALL TABLES opt_definition */ #line 10724 "gram_minimal.y" { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-4].str); n->options = (yyvsp[0].list); n->for_all_tables = true; (yyval.node) = (Node *) n; } #line 45501 "gram_minimal.c" break; case 1412: /* CreatePublicationStmt: CREATE PUBLICATION name FOR pub_obj_list opt_definition */ #line 10733 "gram_minimal.y" { 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 45515 "gram_minimal.c" break; case 1413: /* PublicationObjSpec: TABLE relation_expr opt_column_list OptWhereClause */ #line 10759 "gram_minimal.y" { (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 45528 "gram_minimal.c" break; case 1414: /* PublicationObjSpec: TABLES IN_P SCHEMA ColId */ #line 10768 "gram_minimal.y" { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA; (yyval.publicationobjectspec)->name = (yyvsp[0].str); (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 45539 "gram_minimal.c" break; case 1415: /* PublicationObjSpec: TABLES IN_P SCHEMA CURRENT_SCHEMA */ #line 10775 "gram_minimal.y" { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA; (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 45549 "gram_minimal.c" break; case 1416: /* PublicationObjSpec: ColId opt_column_list OptWhereClause */ #line 10781 "gram_minimal.y" { (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 45580 "gram_minimal.c" break; case 1417: /* PublicationObjSpec: ColId indirection opt_column_list OptWhereClause */ #line 10808 "gram_minimal.y" { (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 45594 "gram_minimal.c" break; case 1418: /* PublicationObjSpec: extended_relation_expr opt_column_list OptWhereClause */ #line 10819 "gram_minimal.y" { (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 45607 "gram_minimal.c" break; case 1419: /* PublicationObjSpec: CURRENT_SCHEMA */ #line 10828 "gram_minimal.y" { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 45617 "gram_minimal.c" break; case 1420: /* pub_obj_list: PublicationObjSpec */ #line 10836 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].publicationobjectspec)); } #line 45623 "gram_minimal.c" break; case 1421: /* pub_obj_list: pub_obj_list ',' PublicationObjSpec */ #line 10838 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].publicationobjectspec)); } #line 45629 "gram_minimal.c" break; case 1422: /* AlterPublicationStmt: ALTER PUBLICATION name SET definition */ #line 10860 "gram_minimal.y" { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45641 "gram_minimal.c" break; case 1423: /* AlterPublicationStmt: ALTER PUBLICATION name ADD_P pub_obj_list */ #line 10868 "gram_minimal.y" { 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 45655 "gram_minimal.c" break; case 1424: /* AlterPublicationStmt: ALTER PUBLICATION name SET pub_obj_list */ #line 10878 "gram_minimal.y" { 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 45669 "gram_minimal.c" break; case 1425: /* AlterPublicationStmt: ALTER PUBLICATION name DROP pub_obj_list */ #line 10888 "gram_minimal.y" { 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 45683 "gram_minimal.c" break; case 1426: /* CreateSubscriptionStmt: CREATE SUBSCRIPTION name CONNECTION Sconst PUBLICATION name_list opt_definition */ #line 10907 "gram_minimal.y" { 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 45697 "gram_minimal.c" break; case 1427: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name SET definition */ #line 10926 "gram_minimal.y" { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_OPTIONS; n->subname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45711 "gram_minimal.c" break; case 1428: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name CONNECTION Sconst */ #line 10936 "gram_minimal.y" { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_CONNECTION; n->subname = (yyvsp[-2].str); n->conninfo = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 45725 "gram_minimal.c" break; case 1429: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name REFRESH PUBLICATION opt_definition */ #line 10946 "gram_minimal.y" { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_REFRESH; n->subname = (yyvsp[-3].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45739 "gram_minimal.c" break; case 1430: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name ADD_P PUBLICATION name_list opt_definition */ #line 10956 "gram_minimal.y" { 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 45754 "gram_minimal.c" break; case 1431: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name DROP PUBLICATION name_list opt_definition */ #line 10967 "gram_minimal.y" { 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 45769 "gram_minimal.c" break; case 1432: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name SET PUBLICATION name_list opt_definition */ #line 10978 "gram_minimal.y" { 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 45784 "gram_minimal.c" break; case 1433: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name ENABLE_P */ #line 10989 "gram_minimal.y" { 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 45799 "gram_minimal.c" break; case 1434: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name DISABLE_P */ #line 11000 "gram_minimal.y" { 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 45814 "gram_minimal.c" break; case 1435: /* AlterSubscriptionStmt: ALTER SUBSCRIPTION name SKIP definition */ #line 11011 "gram_minimal.y" { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_SKIP; n->subname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45828 "gram_minimal.c" break; case 1436: /* DropSubscriptionStmt: DROP SUBSCRIPTION name opt_drop_behavior */ #line 11029 "gram_minimal.y" { DropSubscriptionStmt *n = makeNode(DropSubscriptionStmt); n->subname = (yyvsp[-1].str); n->missing_ok = false; n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 45841 "gram_minimal.c" break; case 1437: /* DropSubscriptionStmt: DROP SUBSCRIPTION IF_P EXISTS name opt_drop_behavior */ #line 11038 "gram_minimal.y" { DropSubscriptionStmt *n = makeNode(DropSubscriptionStmt); n->subname = (yyvsp[-1].str); n->missing_ok = true; n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 45854 "gram_minimal.c" break; case 1438: /* RuleStmt: CREATE opt_or_replace RULE name AS ON event TO qualified_name where_clause DO opt_instead RuleActionList */ #line 11057 "gram_minimal.y" { 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 45871 "gram_minimal.c" break; case 1439: /* RuleActionList: NOTHING */ #line 11072 "gram_minimal.y" { (yyval.list) = NIL; } #line 45877 "gram_minimal.c" break; case 1440: /* RuleActionList: RuleActionStmt */ #line 11073 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45883 "gram_minimal.c" break; case 1441: /* RuleActionList: '(' RuleActionMulti ')' */ #line 11074 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 45889 "gram_minimal.c" break; case 1442: /* RuleActionMulti: RuleActionMulti ';' RuleActionStmtOrEmpty */ #line 11080 "gram_minimal.y" { if ((yyvsp[0].node) != NULL) (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); else (yyval.list) = (yyvsp[-2].list); } #line 45899 "gram_minimal.c" break; case 1443: /* RuleActionMulti: RuleActionStmtOrEmpty */ #line 11086 "gram_minimal.y" { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1((yyvsp[0].node)); else (yyval.list) = NIL; } #line 45909 "gram_minimal.c" break; case 1449: /* RuleActionStmtOrEmpty: RuleActionStmt */ #line 11102 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 45915 "gram_minimal.c" break; case 1450: /* RuleActionStmtOrEmpty: %empty */ #line 11103 "gram_minimal.y" { (yyval.node) = NULL; } #line 45921 "gram_minimal.c" break; case 1451: /* event: SELECT */ #line 11106 "gram_minimal.y" { (yyval.ival) = CMD_SELECT; } #line 45927 "gram_minimal.c" break; case 1452: /* event: UPDATE */ #line 11107 "gram_minimal.y" { (yyval.ival) = CMD_UPDATE; } #line 45933 "gram_minimal.c" break; case 1453: /* event: DELETE_P */ #line 11108 "gram_minimal.y" { (yyval.ival) = CMD_DELETE; } #line 45939 "gram_minimal.c" break; case 1454: /* event: INSERT */ #line 11109 "gram_minimal.y" { (yyval.ival) = CMD_INSERT; } #line 45945 "gram_minimal.c" break; case 1455: /* opt_instead: INSTEAD */ #line 11113 "gram_minimal.y" { (yyval.boolean) = true; } #line 45951 "gram_minimal.c" break; case 1456: /* opt_instead: ALSO */ #line 11114 "gram_minimal.y" { (yyval.boolean) = false; } #line 45957 "gram_minimal.c" break; case 1457: /* opt_instead: %empty */ #line 11115 "gram_minimal.y" { (yyval.boolean) = false; } #line 45963 "gram_minimal.c" break; case 1458: /* NotifyStmt: NOTIFY ColId notify_payload */ #line 11128 "gram_minimal.y" { NotifyStmt *n = makeNode(NotifyStmt); n->conditionname = (yyvsp[-1].str); n->payload = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 45975 "gram_minimal.c" break; case 1459: /* notify_payload: ',' Sconst */ #line 11138 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 45981 "gram_minimal.c" break; case 1460: /* notify_payload: %empty */ #line 11139 "gram_minimal.y" { (yyval.str) = NULL; } #line 45987 "gram_minimal.c" break; case 1461: /* ListenStmt: LISTEN ColId */ #line 11143 "gram_minimal.y" { ListenStmt *n = makeNode(ListenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 45998 "gram_minimal.c" break; case 1462: /* UnlistenStmt: UNLISTEN ColId */ #line 11153 "gram_minimal.y" { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 46009 "gram_minimal.c" break; case 1463: /* UnlistenStmt: UNLISTEN '*' */ #line 11160 "gram_minimal.y" { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = NULL; (yyval.node) = (Node *) n; } #line 46020 "gram_minimal.c" break; case 1464: /* TransactionStmt: ABORT_P opt_transaction opt_transaction_chain */ #line 11180 "gram_minimal.y" { 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 46034 "gram_minimal.c" break; case 1465: /* TransactionStmt: START TRANSACTION transaction_mode_list_or_empty */ #line 11190 "gram_minimal.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_START; n->options = (yyvsp[0].list); n->location = -1; (yyval.node) = (Node *) n; } #line 46047 "gram_minimal.c" break; case 1466: /* TransactionStmt: COMMIT opt_transaction opt_transaction_chain */ #line 11199 "gram_minimal.y" { 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 46061 "gram_minimal.c" break; case 1467: /* TransactionStmt: ROLLBACK opt_transaction opt_transaction_chain */ #line 11209 "gram_minimal.y" { 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 46075 "gram_minimal.c" break; case 1468: /* TransactionStmt: SAVEPOINT ColId */ #line 11219 "gram_minimal.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_SAVEPOINT; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 46088 "gram_minimal.c" break; case 1469: /* TransactionStmt: RELEASE SAVEPOINT ColId */ #line 11228 "gram_minimal.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 46101 "gram_minimal.c" break; case 1470: /* TransactionStmt: RELEASE ColId */ #line 11237 "gram_minimal.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 46114 "gram_minimal.c" break; case 1471: /* TransactionStmt: ROLLBACK opt_transaction TO SAVEPOINT ColId */ #line 11246 "gram_minimal.y" { 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 46127 "gram_minimal.c" break; case 1472: /* TransactionStmt: ROLLBACK opt_transaction TO ColId */ #line 11255 "gram_minimal.y" { 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 46140 "gram_minimal.c" break; case 1473: /* TransactionStmt: PREPARE TRANSACTION Sconst */ #line 11264 "gram_minimal.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_PREPARE; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 46153 "gram_minimal.c" break; case 1474: /* TransactionStmt: COMMIT PREPARED Sconst */ #line 11273 "gram_minimal.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT_PREPARED; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 46166 "gram_minimal.c" break; case 1475: /* TransactionStmt: ROLLBACK PREPARED Sconst */ #line 11282 "gram_minimal.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_PREPARED; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 46179 "gram_minimal.c" break; case 1476: /* TransactionStmtLegacy: BEGIN_P opt_transaction transaction_mode_list_or_empty */ #line 11294 "gram_minimal.y" { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_BEGIN; n->options = (yyvsp[0].list); n->location = -1; (yyval.node) = (Node *) n; } #line 46192 "gram_minimal.c" break; case 1477: /* TransactionStmtLegacy: END_P opt_transaction opt_transaction_chain */ #line 11303 "gram_minimal.y" { 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 46206 "gram_minimal.c" break; case 1481: /* transaction_mode_item: ISOLATION LEVEL iso_level */ #line 11321 "gram_minimal.y" { (yyval.defelt) = makeDefElem("transaction_isolation", makeStringConst((yyvsp[0].str), (yylsp[0])), (yylsp[-2])); } #line 46213 "gram_minimal.c" break; case 1482: /* transaction_mode_item: READ ONLY */ #line 11324 "gram_minimal.y" { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(true, (yylsp[-1])), (yylsp[-1])); } #line 46220 "gram_minimal.c" break; case 1483: /* transaction_mode_item: READ WRITE */ #line 11327 "gram_minimal.y" { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 46227 "gram_minimal.c" break; case 1484: /* transaction_mode_item: DEFERRABLE */ #line 11330 "gram_minimal.y" { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(true, (yylsp[0])), (yylsp[0])); } #line 46234 "gram_minimal.c" break; case 1485: /* transaction_mode_item: NOT DEFERRABLE */ #line 11333 "gram_minimal.y" { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 46241 "gram_minimal.c" break; case 1486: /* transaction_mode_list: transaction_mode_item */ #line 11340 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 46247 "gram_minimal.c" break; case 1487: /* transaction_mode_list: transaction_mode_list ',' transaction_mode_item */ #line 11342 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 46253 "gram_minimal.c" break; case 1488: /* transaction_mode_list: transaction_mode_list transaction_mode_item */ #line 11344 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 46259 "gram_minimal.c" break; case 1490: /* transaction_mode_list_or_empty: %empty */ #line 11350 "gram_minimal.y" { (yyval.list) = NIL; } #line 46265 "gram_minimal.c" break; case 1491: /* opt_transaction_chain: AND CHAIN */ #line 11354 "gram_minimal.y" { (yyval.boolean) = true; } #line 46271 "gram_minimal.c" break; case 1492: /* opt_transaction_chain: AND NO CHAIN */ #line 11355 "gram_minimal.y" { (yyval.boolean) = false; } #line 46277 "gram_minimal.c" break; case 1493: /* opt_transaction_chain: %empty */ #line 11356 "gram_minimal.y" { (yyval.boolean) = false; } #line 46283 "gram_minimal.c" break; case 1494: /* ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option */ #line 11370 "gram_minimal.y" { 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 46300 "gram_minimal.c" break; case 1495: /* ViewStmt: CREATE OR REPLACE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option */ #line 11384 "gram_minimal.y" { 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 46317 "gram_minimal.c" break; case 1496: /* ViewStmt: CREATE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option */ #line 11398 "gram_minimal.y" { 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 46339 "gram_minimal.c" break; case 1497: /* ViewStmt: CREATE OR REPLACE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option */ #line 11417 "gram_minimal.y" { 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 46361 "gram_minimal.c" break; case 1498: /* opt_check_option: WITH CHECK OPTION */ #line 11437 "gram_minimal.y" { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 46367 "gram_minimal.c" break; case 1499: /* opt_check_option: WITH CASCADED CHECK OPTION */ #line 11438 "gram_minimal.y" { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 46373 "gram_minimal.c" break; case 1500: /* opt_check_option: WITH LOCAL CHECK OPTION */ #line 11439 "gram_minimal.y" { (yyval.ival) = LOCAL_CHECK_OPTION; } #line 46379 "gram_minimal.c" break; case 1501: /* opt_check_option: %empty */ #line 11440 "gram_minimal.y" { (yyval.ival) = NO_CHECK_OPTION; } #line 46385 "gram_minimal.c" break; case 1502: /* LoadStmt: LOAD file_name */ #line 11451 "gram_minimal.y" { LoadStmt *n = makeNode(LoadStmt); n->filename = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 46396 "gram_minimal.c" break; case 1503: /* CreatedbStmt: CREATE DATABASE name opt_with createdb_opt_list */ #line 11468 "gram_minimal.y" { CreatedbStmt *n = makeNode(CreatedbStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46408 "gram_minimal.c" break; case 1504: /* createdb_opt_list: createdb_opt_items */ #line 11478 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 46414 "gram_minimal.c" break; case 1505: /* createdb_opt_list: %empty */ #line 11479 "gram_minimal.y" { (yyval.list) = NIL; } #line 46420 "gram_minimal.c" break; case 1506: /* createdb_opt_items: createdb_opt_item */ #line 11483 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 46426 "gram_minimal.c" break; case 1507: /* createdb_opt_items: createdb_opt_items createdb_opt_item */ #line 11484 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 46432 "gram_minimal.c" break; case 1508: /* createdb_opt_item: createdb_opt_name opt_equal NumericOnly */ #line 11489 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (yyvsp[0].node), (yylsp[-2])); } #line 46440 "gram_minimal.c" break; case 1509: /* createdb_opt_item: createdb_opt_name opt_equal opt_boolean_or_string */ #line 11493 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 46448 "gram_minimal.c" break; case 1510: /* createdb_opt_item: createdb_opt_name opt_equal DEFAULT */ #line 11497 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 46456 "gram_minimal.c" break; case 1511: /* createdb_opt_name: IDENT */ #line 11514 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 46462 "gram_minimal.c" break; case 1512: /* createdb_opt_name: CONNECTION LIMIT */ #line 11515 "gram_minimal.y" { (yyval.str) = pstrdup("connection_limit"); } #line 46468 "gram_minimal.c" break; case 1513: /* createdb_opt_name: ENCODING */ #line 11516 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46474 "gram_minimal.c" break; case 1514: /* createdb_opt_name: LOCATION */ #line 11517 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46480 "gram_minimal.c" break; case 1515: /* createdb_opt_name: OWNER */ #line 11518 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46486 "gram_minimal.c" break; case 1516: /* createdb_opt_name: TABLESPACE */ #line 11519 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46492 "gram_minimal.c" break; case 1517: /* createdb_opt_name: TEMPLATE */ #line 11520 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46498 "gram_minimal.c" break; case 1520: /* AlterDatabaseStmt: ALTER DATABASE name WITH createdb_opt_list */ #line 11540 "gram_minimal.y" { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46510 "gram_minimal.c" break; case 1521: /* AlterDatabaseStmt: ALTER DATABASE name createdb_opt_list */ #line 11548 "gram_minimal.y" { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46522 "gram_minimal.c" break; case 1522: /* AlterDatabaseStmt: ALTER DATABASE name SET TABLESPACE name */ #line 11556 "gram_minimal.y" { 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 46535 "gram_minimal.c" break; case 1523: /* AlterDatabaseStmt: ALTER DATABASE name REFRESH COLLATION VERSION_P */ #line 11565 "gram_minimal.y" { AlterDatabaseRefreshCollStmt *n = makeNode(AlterDatabaseRefreshCollStmt); n->dbname = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 46546 "gram_minimal.c" break; case 1524: /* AlterDatabaseSetStmt: ALTER DATABASE name SetResetClause */ #line 11575 "gram_minimal.y" { AlterDatabaseSetStmt *n = makeNode(AlterDatabaseSetStmt); n->dbname = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 46558 "gram_minimal.c" break; case 1525: /* DropdbStmt: DROP DATABASE name */ #line 11593 "gram_minimal.y" { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = false; n->options = NULL; (yyval.node) = (Node *) n; } #line 46571 "gram_minimal.c" break; case 1526: /* DropdbStmt: DROP DATABASE IF_P EXISTS name */ #line 11602 "gram_minimal.y" { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = true; n->options = NULL; (yyval.node) = (Node *) n; } #line 46584 "gram_minimal.c" break; case 1527: /* DropdbStmt: DROP DATABASE name opt_with '(' drop_option_list ')' */ #line 11611 "gram_minimal.y" { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[-4].str); n->missing_ok = false; n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 46597 "gram_minimal.c" break; case 1528: /* DropdbStmt: DROP DATABASE IF_P EXISTS name opt_with '(' drop_option_list ')' */ #line 11620 "gram_minimal.y" { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[-4].str); n->missing_ok = true; n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 46610 "gram_minimal.c" break; case 1529: /* drop_option_list: drop_option */ #line 11632 "gram_minimal.y" { (yyval.list) = list_make1((Node *) (yyvsp[0].defelt)); } #line 46618 "gram_minimal.c" break; case 1530: /* drop_option_list: drop_option_list ',' drop_option */ #line 11636 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (Node *) (yyvsp[0].defelt)); } #line 46626 "gram_minimal.c" break; case 1531: /* drop_option: FORCE */ #line 11647 "gram_minimal.y" { (yyval.defelt) = makeDefElem("force", NULL, (yylsp[0])); } #line 46634 "gram_minimal.c" break; case 1532: /* AlterCollationStmt: ALTER COLLATION any_name REFRESH VERSION_P */ #line 11659 "gram_minimal.y" { AlterCollationStmt *n = makeNode(AlterCollationStmt); n->collname = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 46645 "gram_minimal.c" break; case 1533: /* AlterSystemStmt: ALTER SYSTEM_P SET generic_set */ #line 11677 "gram_minimal.y" { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 46656 "gram_minimal.c" break; case 1534: /* AlterSystemStmt: ALTER SYSTEM_P RESET generic_reset */ #line 11684 "gram_minimal.y" { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 46667 "gram_minimal.c" break; case 1535: /* CreateDomainStmt: CREATE DOMAIN_P any_name opt_as Typename ColQualList */ #line 11701 "gram_minimal.y" { 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 46681 "gram_minimal.c" break; case 1536: /* AlterDomainStmt: ALTER DOMAIN_P any_name alter_column_default */ #line 11715 "gram_minimal.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'T'; n->typeName = (yyvsp[-1].list); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 46694 "gram_minimal.c" break; case 1537: /* AlterDomainStmt: ALTER DOMAIN_P any_name DROP NOT NULL_P */ #line 11725 "gram_minimal.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'N'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 46706 "gram_minimal.c" break; case 1538: /* AlterDomainStmt: ALTER DOMAIN_P any_name SET NOT NULL_P */ #line 11734 "gram_minimal.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'O'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 46718 "gram_minimal.c" break; case 1539: /* AlterDomainStmt: ALTER DOMAIN_P any_name ADD_P DomainConstraint */ #line 11743 "gram_minimal.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'C'; n->typeName = (yyvsp[-2].list); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 46731 "gram_minimal.c" break; case 1540: /* AlterDomainStmt: ALTER DOMAIN_P any_name DROP CONSTRAINT name opt_drop_behavior */ #line 11753 "gram_minimal.y" { 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 46746 "gram_minimal.c" break; case 1541: /* AlterDomainStmt: ALTER DOMAIN_P any_name DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior */ #line 11765 "gram_minimal.y" { 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 46761 "gram_minimal.c" break; case 1542: /* AlterDomainStmt: ALTER DOMAIN_P any_name VALIDATE CONSTRAINT name */ #line 11777 "gram_minimal.y" { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'V'; n->typeName = (yyvsp[-3].list); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 46774 "gram_minimal.c" break; case 1545: /* AlterTSDictionaryStmt: ALTER TEXT_P SEARCH DICTIONARY any_name definition */ #line 11800 "gram_minimal.y" { AlterTSDictionaryStmt *n = makeNode(AlterTSDictionaryStmt); n->dictname = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46786 "gram_minimal.c" break; case 1546: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name ADD_P MAPPING FOR name_list any_with any_name_list */ #line 11811 "gram_minimal.y" { 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 46802 "gram_minimal.c" break; case 1547: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list any_with any_name_list */ #line 11823 "gram_minimal.y" { 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 46818 "gram_minimal.c" break; case 1548: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING REPLACE any_name any_with any_name */ #line 11835 "gram_minimal.y" { 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 46834 "gram_minimal.c" break; case 1549: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list REPLACE any_name any_with any_name */ #line 11847 "gram_minimal.y" { 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 46850 "gram_minimal.c" break; case 1550: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING FOR name_list */ #line 11859 "gram_minimal.y" { 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 46864 "gram_minimal.c" break; case 1551: /* AlterTSConfigurationStmt: ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING IF_P EXISTS FOR name_list */ #line 11869 "gram_minimal.y" { 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 46878 "gram_minimal.c" break; case 1554: /* CreateConversionStmt: CREATE opt_default CONVERSION_P any_name FOR Sconst TO Sconst FROM any_name */ #line 11898 "gram_minimal.y" { 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 46893 "gram_minimal.c" break; case 1555: /* ClusterStmt: CLUSTER '(' utility_option_list ')' qualified_name cluster_index_specification */ #line 11921 "gram_minimal.y" { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->params = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 46906 "gram_minimal.c" break; case 1556: /* ClusterStmt: CLUSTER '(' utility_option_list ')' */ #line 11930 "gram_minimal.y" { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->params = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 46919 "gram_minimal.c" break; case 1557: /* ClusterStmt: CLUSTER opt_verbose qualified_name cluster_index_specification */ #line 11940 "gram_minimal.y" { 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 46934 "gram_minimal.c" break; case 1558: /* ClusterStmt: CLUSTER opt_verbose */ #line 11952 "gram_minimal.y" { 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 46949 "gram_minimal.c" break; case 1559: /* ClusterStmt: CLUSTER opt_verbose name ON qualified_name */ #line 11964 "gram_minimal.y" { 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 46964 "gram_minimal.c" break; case 1560: /* cluster_index_specification: USING name */ #line 11977 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 46970 "gram_minimal.c" break; case 1561: /* cluster_index_specification: %empty */ #line 11978 "gram_minimal.y" { (yyval.str) = NULL; } #line 46976 "gram_minimal.c" break; case 1562: /* VacuumStmt: VACUUM opt_full opt_freeze opt_verbose opt_analyze opt_vacuum_relation_list */ #line 11991 "gram_minimal.y" { 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 47001 "gram_minimal.c" break; case 1563: /* VacuumStmt: VACUUM '(' utility_option_list ')' opt_vacuum_relation_list */ #line 12012 "gram_minimal.y" { VacuumStmt *n = makeNode(VacuumStmt); n->options = (yyvsp[-2].list); n->rels = (yyvsp[0].list); n->is_vacuumcmd = true; (yyval.node) = (Node *) n; } #line 47014 "gram_minimal.c" break; case 1564: /* AnalyzeStmt: analyze_keyword opt_verbose opt_vacuum_relation_list */ #line 12023 "gram_minimal.y" { 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 47030 "gram_minimal.c" break; case 1565: /* AnalyzeStmt: analyze_keyword '(' utility_option_list ')' opt_vacuum_relation_list */ #line 12035 "gram_minimal.y" { VacuumStmt *n = makeNode(VacuumStmt); n->options = (yyvsp[-2].list); n->rels = (yyvsp[0].list); n->is_vacuumcmd = false; (yyval.node) = (Node *) n; } #line 47043 "gram_minimal.c" break; case 1566: /* utility_option_list: utility_option_elem */ #line 12047 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 47051 "gram_minimal.c" break; case 1567: /* utility_option_list: utility_option_list ',' utility_option_elem */ #line 12051 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 47059 "gram_minimal.c" break; case 1570: /* utility_option_elem: utility_option_name utility_option_arg */ #line 12063 "gram_minimal.y" { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 47067 "gram_minimal.c" break; case 1571: /* utility_option_name: NonReservedWord */ #line 12069 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 47073 "gram_minimal.c" break; case 1572: /* utility_option_name: analyze_keyword */ #line 12070 "gram_minimal.y" { (yyval.str) = "analyze"; } #line 47079 "gram_minimal.c" break; case 1573: /* utility_option_name: FORMAT_LA */ #line 12071 "gram_minimal.y" { (yyval.str) = "format"; } #line 47085 "gram_minimal.c" break; case 1574: /* utility_option_arg: opt_boolean_or_string */ #line 12075 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 47091 "gram_minimal.c" break; case 1575: /* utility_option_arg: NumericOnly */ #line 12076 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].node); } #line 47097 "gram_minimal.c" break; case 1576: /* utility_option_arg: %empty */ #line 12077 "gram_minimal.y" { (yyval.node) = NULL; } #line 47103 "gram_minimal.c" break; case 1577: /* opt_analyze: analyze_keyword */ #line 12081 "gram_minimal.y" { (yyval.boolean) = true; } #line 47109 "gram_minimal.c" break; case 1578: /* opt_analyze: %empty */ #line 12082 "gram_minimal.y" { (yyval.boolean) = false; } #line 47115 "gram_minimal.c" break; case 1579: /* opt_verbose: VERBOSE */ #line 12086 "gram_minimal.y" { (yyval.boolean) = true; } #line 47121 "gram_minimal.c" break; case 1580: /* opt_verbose: %empty */ #line 12087 "gram_minimal.y" { (yyval.boolean) = false; } #line 47127 "gram_minimal.c" break; case 1581: /* opt_full: FULL */ #line 12090 "gram_minimal.y" { (yyval.boolean) = true; } #line 47133 "gram_minimal.c" break; case 1582: /* opt_full: %empty */ #line 12091 "gram_minimal.y" { (yyval.boolean) = false; } #line 47139 "gram_minimal.c" break; case 1583: /* opt_freeze: FREEZE */ #line 12094 "gram_minimal.y" { (yyval.boolean) = true; } #line 47145 "gram_minimal.c" break; case 1584: /* opt_freeze: %empty */ #line 12095 "gram_minimal.y" { (yyval.boolean) = false; } #line 47151 "gram_minimal.c" break; case 1585: /* opt_name_list: '(' name_list ')' */ #line 12099 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 47157 "gram_minimal.c" break; case 1586: /* opt_name_list: %empty */ #line 12100 "gram_minimal.y" { (yyval.list) = NIL; } #line 47163 "gram_minimal.c" break; case 1587: /* vacuum_relation: relation_expr opt_name_list */ #line 12105 "gram_minimal.y" { (yyval.node) = (Node *) makeVacuumRelation((yyvsp[-1].range), InvalidOid, (yyvsp[0].list)); } #line 47171 "gram_minimal.c" break; case 1588: /* vacuum_relation_list: vacuum_relation */ #line 12112 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47177 "gram_minimal.c" break; case 1589: /* vacuum_relation_list: vacuum_relation_list ',' vacuum_relation */ #line 12114 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 47183 "gram_minimal.c" break; case 1590: /* opt_vacuum_relation_list: vacuum_relation_list */ #line 12118 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 47189 "gram_minimal.c" break; case 1591: /* opt_vacuum_relation_list: %empty */ #line 12119 "gram_minimal.y" { (yyval.list) = NIL; } #line 47195 "gram_minimal.c" break; case 1592: /* ExplainStmt: EXPLAIN ExplainableStmt */ #line 12133 "gram_minimal.y" { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = NIL; (yyval.node) = (Node *) n; } #line 47207 "gram_minimal.c" break; case 1593: /* ExplainStmt: EXPLAIN analyze_keyword opt_verbose ExplainableStmt */ #line 12141 "gram_minimal.y" { 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 47222 "gram_minimal.c" break; case 1594: /* ExplainStmt: EXPLAIN VERBOSE ExplainableStmt */ #line 12152 "gram_minimal.y" { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = list_make1(makeDefElem("verbose", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 47234 "gram_minimal.c" break; case 1595: /* ExplainStmt: EXPLAIN '(' utility_option_list ')' ExplainableStmt */ #line 12160 "gram_minimal.y" { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 47246 "gram_minimal.c" break; case 1606: /* PrepareStmt: PREPARE name prep_type_clause AS PreparableStmt */ #line 12190 "gram_minimal.y" { PrepareStmt *n = makeNode(PrepareStmt); n->name = (yyvsp[-3].str); n->argtypes = (yyvsp[-2].list); n->query = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 47259 "gram_minimal.c" break; case 1607: /* prep_type_clause: '(' type_list ')' */ #line 12200 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 47265 "gram_minimal.c" break; case 1608: /* prep_type_clause: %empty */ #line 12201 "gram_minimal.y" { (yyval.list) = NIL; } #line 47271 "gram_minimal.c" break; case 1614: /* ExecuteStmt: EXECUTE name execute_param_clause */ #line 12220 "gram_minimal.y" { ExecuteStmt *n = makeNode(ExecuteStmt); n->name = (yyvsp[-1].str); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 47283 "gram_minimal.c" break; case 1615: /* ExecuteStmt: CREATE OptTemp TABLE create_as_target AS EXECUTE name execute_param_clause opt_with_data */ #line 12229 "gram_minimal.y" { 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 47304 "gram_minimal.c" break; case 1616: /* ExecuteStmt: CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS EXECUTE name execute_param_clause opt_with_data */ #line 12247 "gram_minimal.y" { 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 47325 "gram_minimal.c" break; case 1617: /* execute_param_clause: '(' expr_list ')' */ #line 12265 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 47331 "gram_minimal.c" break; case 1618: /* execute_param_clause: %empty */ #line 12266 "gram_minimal.y" { (yyval.list) = NIL; } #line 47337 "gram_minimal.c" break; case 1619: /* DeallocateStmt: DEALLOCATE name */ #line 12277 "gram_minimal.y" { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); n->isall = false; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 47350 "gram_minimal.c" break; case 1620: /* DeallocateStmt: DEALLOCATE PREPARE name */ #line 12286 "gram_minimal.y" { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); n->isall = false; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 47363 "gram_minimal.c" break; case 1621: /* DeallocateStmt: DEALLOCATE ALL */ #line 12295 "gram_minimal.y" { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; n->isall = true; n->location = -1; (yyval.node) = (Node *) n; } #line 47376 "gram_minimal.c" break; case 1622: /* DeallocateStmt: DEALLOCATE PREPARE ALL */ #line 12304 "gram_minimal.y" { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; n->isall = true; n->location = -1; (yyval.node) = (Node *) n; } #line 47389 "gram_minimal.c" break; case 1623: /* InsertStmt: opt_with_clause INSERT INTO insert_target insert_rest opt_on_conflict returning_clause */ #line 12324 "gram_minimal.y" { (yyvsp[-2].istmt)->relation = (yyvsp[-3].range); (yyvsp[-2].istmt)->onConflictClause = (yyvsp[-1].onconflict); (yyvsp[-2].istmt)->returningClause = (yyvsp[0].retclause); (yyvsp[-2].istmt)->withClause = (yyvsp[-6].with); (yyval.node) = (Node *) (yyvsp[-2].istmt); } #line 47401 "gram_minimal.c" break; case 1624: /* InsertStmtShort: opt_with_clause INSERT INTO insert_target */ #line 12334 "gram_minimal.y" { 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 47417 "gram_minimal.c" break; case 1625: /* insert_target: qualified_name */ #line 12355 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); } #line 47425 "gram_minimal.c" break; case 1626: /* insert_target: qualified_name AS ColId */ #line 12359 "gram_minimal.y" { (yyvsp[-2].range)->alias = makeAlias((yyvsp[0].str), NIL); (yyval.range) = (yyvsp[-2].range); } #line 47434 "gram_minimal.c" break; case 1627: /* insert_rest: SelectStmt */ #line 12367 "gram_minimal.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 47444 "gram_minimal.c" break; case 1628: /* insert_rest: OVERRIDING override_kind VALUE_P SelectStmt */ #line 12373 "gram_minimal.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->override = (yyvsp[-2].ival); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 47455 "gram_minimal.c" break; case 1629: /* insert_rest: '(' insert_column_list ')' SelectStmt */ #line 12380 "gram_minimal.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-2].list); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 47465 "gram_minimal.c" break; case 1630: /* insert_rest: '(' insert_column_list ')' OVERRIDING override_kind VALUE_P SelectStmt */ #line 12386 "gram_minimal.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-5].list); (yyval.istmt)->override = (yyvsp[-2].ival); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 47476 "gram_minimal.c" break; case 1631: /* insert_rest: DEFAULT VALUES */ #line 12393 "gram_minimal.y" { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = NULL; } #line 47486 "gram_minimal.c" break; case 1632: /* override_kind: USER */ #line 12401 "gram_minimal.y" { (yyval.ival) = OVERRIDING_USER_VALUE; } #line 47492 "gram_minimal.c" break; case 1633: /* override_kind: SYSTEM_P */ #line 12402 "gram_minimal.y" { (yyval.ival) = OVERRIDING_SYSTEM_VALUE; } #line 47498 "gram_minimal.c" break; case 1634: /* insert_column_list: insert_column_item */ #line 12407 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 47504 "gram_minimal.c" break; case 1635: /* insert_column_list: insert_column_list ',' insert_column_item */ #line 12409 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 47510 "gram_minimal.c" break; case 1636: /* insert_column_item: ColId opt_indirection */ #line 12414 "gram_minimal.y" { (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 47522 "gram_minimal.c" break; case 1637: /* opt_on_conflict: ON CONFLICT opt_conf_expr DO UPDATE SET set_clause_list where_clause */ #line 12425 "gram_minimal.y" { (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 47535 "gram_minimal.c" break; case 1638: /* opt_on_conflict: ON CONFLICT opt_conf_expr DO NOTHING */ #line 12435 "gram_minimal.y" { (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 47548 "gram_minimal.c" break; case 1639: /* opt_on_conflict: %empty */ #line 12444 "gram_minimal.y" { (yyval.onconflict) = NULL; } #line 47556 "gram_minimal.c" break; case 1640: /* opt_conf_expr: '(' index_params ')' where_clause */ #line 12451 "gram_minimal.y" { (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 47568 "gram_minimal.c" break; case 1641: /* opt_conf_expr: ON CONSTRAINT name */ #line 12460 "gram_minimal.y" { (yyval.infer) = makeNode(InferClause); (yyval.infer)->indexElems = NIL; (yyval.infer)->whereClause = NULL; (yyval.infer)->conname = (yyvsp[0].str); (yyval.infer)->location = (yylsp[-2]); } #line 47580 "gram_minimal.c" break; case 1642: /* opt_conf_expr: %empty */ #line 12468 "gram_minimal.y" { (yyval.infer) = NULL; } #line 47588 "gram_minimal.c" break; case 1643: /* returning_clause: RETURNING returning_with_clause target_list */ #line 12475 "gram_minimal.y" { ReturningClause *n = makeNode(ReturningClause); n->options = (yyvsp[-1].list); n->exprs = (yyvsp[0].list); (yyval.retclause) = n; } #line 47600 "gram_minimal.c" break; case 1644: /* returning_clause: %empty */ #line 12483 "gram_minimal.y" { (yyval.retclause) = NULL; } #line 47608 "gram_minimal.c" break; case 1645: /* returning_with_clause: WITH '(' returning_options ')' */ #line 12489 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 47614 "gram_minimal.c" break; case 1646: /* returning_with_clause: %empty */ #line 12490 "gram_minimal.y" { (yyval.list) = NIL; } #line 47620 "gram_minimal.c" break; case 1647: /* returning_options: returning_option */ #line 12494 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47626 "gram_minimal.c" break; case 1648: /* returning_options: returning_options ',' returning_option */ #line 12495 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 47632 "gram_minimal.c" break; case 1649: /* returning_option: returning_option_kind AS ColId */ #line 12500 "gram_minimal.y" { ReturningOption *n = makeNode(ReturningOption); n->option = (yyvsp[-2].retoptionkind); n->value = (yyvsp[0].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 47645 "gram_minimal.c" break; case 1650: /* returning_option_kind: OLD */ #line 12511 "gram_minimal.y" { (yyval.retoptionkind) = RETURNING_OPTION_OLD; } #line 47651 "gram_minimal.c" break; case 1651: /* returning_option_kind: NEW */ #line 12512 "gram_minimal.y" { (yyval.retoptionkind) = RETURNING_OPTION_NEW; } #line 47657 "gram_minimal.c" break; case 1652: /* DeleteStmt: opt_with_clause DELETE_P FROM relation_expr_opt_alias using_clause where_or_current_clause returning_clause */ #line 12525 "gram_minimal.y" { DeleteStmt *n = makeNode(DeleteStmt); n->relation = (yyvsp[-3].range); n->usingClause = (yyvsp[-2].list); n->whereClause = (yyvsp[-1].node); n->returningClause = (yyvsp[0].retclause); n->withClause = (yyvsp[-6].with); (yyval.node) = (Node *) n; } #line 47672 "gram_minimal.c" break; case 1653: /* using_clause: USING from_list */ #line 12538 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 47678 "gram_minimal.c" break; case 1654: /* using_clause: %empty */ #line 12539 "gram_minimal.y" { (yyval.list) = NIL; } #line 47684 "gram_minimal.c" break; case 1655: /* LockStmt: LOCK_P opt_table relation_expr_list opt_lock opt_nowait */ #line 12551 "gram_minimal.y" { LockStmt *n = makeNode(LockStmt); n->relations = (yyvsp[-2].list); n->mode = (yyvsp[-1].ival); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 47697 "gram_minimal.c" break; case 1656: /* opt_lock: IN_P lock_type MODE */ #line 12561 "gram_minimal.y" { (yyval.ival) = (yyvsp[-1].ival); } #line 47703 "gram_minimal.c" break; case 1657: /* opt_lock: %empty */ #line 12562 "gram_minimal.y" { (yyval.ival) = AccessExclusiveLock; } #line 47709 "gram_minimal.c" break; case 1658: /* lock_type: ACCESS SHARE */ #line 12565 "gram_minimal.y" { (yyval.ival) = AccessShareLock; } #line 47715 "gram_minimal.c" break; case 1659: /* lock_type: ROW SHARE */ #line 12566 "gram_minimal.y" { (yyval.ival) = RowShareLock; } #line 47721 "gram_minimal.c" break; case 1660: /* lock_type: ROW EXCLUSIVE */ #line 12567 "gram_minimal.y" { (yyval.ival) = RowExclusiveLock; } #line 47727 "gram_minimal.c" break; case 1661: /* lock_type: SHARE UPDATE EXCLUSIVE */ #line 12568 "gram_minimal.y" { (yyval.ival) = ShareUpdateExclusiveLock; } #line 47733 "gram_minimal.c" break; case 1662: /* lock_type: SHARE */ #line 12569 "gram_minimal.y" { (yyval.ival) = ShareLock; } #line 47739 "gram_minimal.c" break; case 1663: /* lock_type: SHARE ROW EXCLUSIVE */ #line 12570 "gram_minimal.y" { (yyval.ival) = ShareRowExclusiveLock; } #line 47745 "gram_minimal.c" break; case 1664: /* lock_type: EXCLUSIVE */ #line 12571 "gram_minimal.y" { (yyval.ival) = ExclusiveLock; } #line 47751 "gram_minimal.c" break; case 1665: /* lock_type: ACCESS EXCLUSIVE */ #line 12572 "gram_minimal.y" { (yyval.ival) = AccessExclusiveLock; } #line 47757 "gram_minimal.c" break; case 1666: /* opt_nowait: NOWAIT */ #line 12575 "gram_minimal.y" { (yyval.boolean) = true; } #line 47763 "gram_minimal.c" break; case 1667: /* opt_nowait: %empty */ #line 12576 "gram_minimal.y" { (yyval.boolean) = false; } #line 47769 "gram_minimal.c" break; case 1668: /* opt_nowait_or_skip: NOWAIT */ #line 12580 "gram_minimal.y" { (yyval.ival) = LockWaitError; } #line 47775 "gram_minimal.c" break; case 1669: /* opt_nowait_or_skip: SKIP LOCKED */ #line 12581 "gram_minimal.y" { (yyval.ival) = LockWaitSkip; } #line 47781 "gram_minimal.c" break; case 1670: /* opt_nowait_or_skip: %empty */ #line 12582 "gram_minimal.y" { (yyval.ival) = LockWaitBlock; } #line 47787 "gram_minimal.c" break; case 1671: /* UpdateStmt: opt_with_clause UPDATE relation_expr_opt_alias SET set_clause_list from_clause where_or_current_clause returning_clause */ #line 12598 "gram_minimal.y" { 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->returningClause = (yyvsp[0].retclause); n->withClause = (yyvsp[-7].with); (yyval.node) = (Node *) n; } #line 47803 "gram_minimal.c" break; case 1672: /* UpdateStmtShort: opt_with_clause UPDATE relation_expr_opt_alias */ #line 12611 "gram_minimal.y" { UpdateStmt *n = makeNode(UpdateStmt); n->relation = (yyvsp[0].range); n->targetList = NULL; n->fromClause = NULL; n->whereClause = NULL; n->returningClause = NULL; n->withClause = (yyvsp[-2].with); (yyval.node) = (Node *)n; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((yyval.node), 0)); YYACCEPT; } #line 47820 "gram_minimal.c" break; case 1673: /* set_clause_list: set_clause */ #line 12625 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 47826 "gram_minimal.c" break; case 1674: /* set_clause_list: set_clause_list ',' set_clause */ #line 12626 "gram_minimal.y" { (yyval.list) = list_concat((yyvsp[-2].list),(yyvsp[0].list)); } #line 47832 "gram_minimal.c" break; case 1675: /* set_clause: set_target '=' a_expr */ #line 12631 "gram_minimal.y" { (yyvsp[-2].target)->val = (Node *) (yyvsp[0].node); (yyval.list) = list_make1((yyvsp[-2].target)); } #line 47841 "gram_minimal.c" break; case 1676: /* set_clause: '(' set_target_list ')' '=' a_expr */ #line 12636 "gram_minimal.y" { 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 47866 "gram_minimal.c" break; case 1677: /* set_target: ColId opt_indirection */ #line 12660 "gram_minimal.y" { (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 47878 "gram_minimal.c" break; case 1678: /* set_target_list: set_target */ #line 12670 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 47884 "gram_minimal.c" break; case 1679: /* set_target_list: set_target_list ',' set_target */ #line 12671 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].target)); } #line 47890 "gram_minimal.c" break; case 1680: /* MergeStmt: opt_with_clause MERGE INTO relation_expr_opt_alias USING table_ref ON a_expr merge_when_list returning_clause */ #line 12688 "gram_minimal.y" { 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->returningClause = (yyvsp[0].retclause); (yyval.node) = (Node *) m; } #line 47907 "gram_minimal.c" break; case 1681: /* merge_when_list: merge_when_clause */ #line 12703 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47913 "gram_minimal.c" break; case 1682: /* merge_when_list: merge_when_list merge_when_clause */ #line 12704 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list),(yyvsp[0].node)); } #line 47919 "gram_minimal.c" break; case 1683: /* merge_when_clause: merge_when_tgt_matched opt_merge_when_condition THEN merge_update */ #line 12715 "gram_minimal.y" { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 47930 "gram_minimal.c" break; case 1684: /* merge_when_clause: merge_when_tgt_matched opt_merge_when_condition THEN merge_delete */ #line 12722 "gram_minimal.y" { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 47941 "gram_minimal.c" break; case 1685: /* merge_when_clause: merge_when_tgt_not_matched opt_merge_when_condition THEN merge_insert */ #line 12729 "gram_minimal.y" { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 47952 "gram_minimal.c" break; case 1686: /* merge_when_clause: merge_when_tgt_matched opt_merge_when_condition THEN DO NOTHING */ #line 12736 "gram_minimal.y" { MergeWhenClause *m = makeNode(MergeWhenClause); m->matchKind = (yyvsp[-4].mergematch); m->commandType = CMD_NOTHING; m->condition = (yyvsp[-3].node); (yyval.node) = (Node *) m; } #line 47966 "gram_minimal.c" break; case 1687: /* merge_when_clause: merge_when_tgt_not_matched opt_merge_when_condition THEN DO NOTHING */ #line 12746 "gram_minimal.y" { MergeWhenClause *m = makeNode(MergeWhenClause); m->matchKind = (yyvsp[-4].mergematch); m->commandType = CMD_NOTHING; m->condition = (yyvsp[-3].node); (yyval.node) = (Node *) m; } #line 47980 "gram_minimal.c" break; case 1688: /* merge_when_tgt_matched: WHEN MATCHED */ #line 12758 "gram_minimal.y" { (yyval.mergematch) = MERGE_WHEN_MATCHED; } #line 47986 "gram_minimal.c" break; case 1689: /* merge_when_tgt_matched: WHEN NOT MATCHED BY SOURCE */ #line 12759 "gram_minimal.y" { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_SOURCE; } #line 47992 "gram_minimal.c" break; case 1690: /* merge_when_tgt_not_matched: WHEN NOT MATCHED */ #line 12763 "gram_minimal.y" { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_TARGET; } #line 47998 "gram_minimal.c" break; case 1691: /* merge_when_tgt_not_matched: WHEN NOT MATCHED BY TARGET */ #line 12764 "gram_minimal.y" { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_TARGET; } #line 48004 "gram_minimal.c" break; case 1692: /* opt_merge_when_condition: AND a_expr */ #line 12768 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48010 "gram_minimal.c" break; case 1693: /* opt_merge_when_condition: %empty */ #line 12769 "gram_minimal.y" { (yyval.node) = NULL; } #line 48016 "gram_minimal.c" break; case 1694: /* merge_update: UPDATE SET set_clause_list */ #line 12774 "gram_minimal.y" { 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 48030 "gram_minimal.c" break; case 1695: /* merge_delete: DELETE_P */ #line 12787 "gram_minimal.y" { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_DELETE; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = NIL; (yyval.mergewhen) = n; } #line 48044 "gram_minimal.c" break; case 1696: /* merge_insert: INSERT merge_values_clause */ #line 12800 "gram_minimal.y" { 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 48057 "gram_minimal.c" break; case 1697: /* merge_insert: INSERT OVERRIDING override_kind VALUE_P merge_values_clause */ #line 12809 "gram_minimal.y" { 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 48070 "gram_minimal.c" break; case 1698: /* merge_insert: INSERT '(' insert_column_list ')' merge_values_clause */ #line 12818 "gram_minimal.y" { 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 48083 "gram_minimal.c" break; case 1699: /* merge_insert: INSERT '(' insert_column_list ')' OVERRIDING override_kind VALUE_P merge_values_clause */ #line 12827 "gram_minimal.y" { 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 48096 "gram_minimal.c" break; case 1700: /* merge_insert: INSERT DEFAULT VALUES */ #line 12836 "gram_minimal.y" { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = NIL; (yyval.mergewhen) = n; } #line 48109 "gram_minimal.c" break; case 1701: /* merge_values_clause: VALUES '(' expr_list ')' */ #line 12848 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 48117 "gram_minimal.c" break; case 1702: /* DeclareCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR SelectStmt */ #line 12860 "gram_minimal.y" { 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 48131 "gram_minimal.c" break; case 1703: /* cursor_name: name */ #line 12871 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 48137 "gram_minimal.c" break; case 1704: /* cursor_options: %empty */ #line 12874 "gram_minimal.y" { (yyval.ival) = 0; } #line 48143 "gram_minimal.c" break; case 1705: /* cursor_options: cursor_options NO SCROLL */ #line 12875 "gram_minimal.y" { (yyval.ival) = (yyvsp[-2].ival) | CURSOR_OPT_NO_SCROLL; } #line 48149 "gram_minimal.c" break; case 1706: /* cursor_options: cursor_options SCROLL */ #line 12876 "gram_minimal.y" { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_SCROLL; } #line 48155 "gram_minimal.c" break; case 1707: /* cursor_options: cursor_options BINARY */ #line 12877 "gram_minimal.y" { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_BINARY; } #line 48161 "gram_minimal.c" break; case 1708: /* cursor_options: cursor_options ASENSITIVE */ #line 12878 "gram_minimal.y" { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_ASENSITIVE; } #line 48167 "gram_minimal.c" break; case 1709: /* cursor_options: cursor_options INSENSITIVE */ #line 12879 "gram_minimal.y" { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_INSENSITIVE; } #line 48173 "gram_minimal.c" break; case 1710: /* opt_hold: %empty */ #line 12882 "gram_minimal.y" { (yyval.ival) = 0; } #line 48179 "gram_minimal.c" break; case 1711: /* opt_hold: WITH HOLD */ #line 12883 "gram_minimal.y" { (yyval.ival) = CURSOR_OPT_HOLD; } #line 48185 "gram_minimal.c" break; case 1712: /* opt_hold: WITHOUT HOLD */ #line 12884 "gram_minimal.y" { (yyval.ival) = 0; } #line 48191 "gram_minimal.c" break; case 1715: /* select_with_parens: '(' select_no_parens ')' */ #line 12937 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 48197 "gram_minimal.c" break; case 1716: /* select_with_parens: '(' select_with_parens ')' */ #line 12938 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 48203 "gram_minimal.c" break; case 1717: /* select_no_parens: simple_select */ #line 12953 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48209 "gram_minimal.c" break; case 1718: /* select_no_parens: select_clause sort_clause */ #line 12955 "gram_minimal.y" { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 48220 "gram_minimal.c" break; case 1719: /* select_no_parens: select_clause opt_sort_clause for_locking_clause opt_select_limit */ #line 12962 "gram_minimal.y" { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), (yyvsp[0].selectlimit), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 48232 "gram_minimal.c" break; case 1720: /* select_no_parens: select_clause opt_sort_clause select_limit opt_for_locking_clause */ #line 12970 "gram_minimal.y" { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), (yyvsp[-1].selectlimit), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 48244 "gram_minimal.c" break; case 1721: /* select_no_parens: with_clause select_clause */ #line 12978 "gram_minimal.y" { insertSelectOptions((SelectStmt *) (yyvsp[0].node), NULL, NIL, NULL, (yyvsp[-1].with), yyscanner); (yyval.node) = (yyvsp[0].node); } #line 48256 "gram_minimal.c" break; case 1722: /* select_no_parens: with_clause select_clause sort_clause */ #line 12986 "gram_minimal.y" { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, (yyvsp[-2].with), yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 48268 "gram_minimal.c" break; case 1723: /* select_no_parens: with_clause select_clause opt_sort_clause for_locking_clause opt_select_limit */ #line 12994 "gram_minimal.y" { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), (yyvsp[0].selectlimit), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 48280 "gram_minimal.c" break; case 1724: /* select_no_parens: with_clause select_clause opt_sort_clause select_limit opt_for_locking_clause */ #line 13002 "gram_minimal.y" { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), (yyvsp[-1].selectlimit), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 48292 "gram_minimal.c" break; case 1725: /* select_clause: simple_select */ #line 13012 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48298 "gram_minimal.c" break; case 1726: /* select_clause: select_with_parens */ #line 13013 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48304 "gram_minimal.c" break; case 1727: /* simple_select: SELECT opt_all_clause opt_target_list into_clause from_clause where_clause group_clause having_clause window_clause */ #line 13048 "gram_minimal.y" { 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 48322 "gram_minimal.c" break; case 1728: /* simple_select: SELECT distinct_clause target_list into_clause from_clause where_clause group_clause having_clause window_clause */ #line 13064 "gram_minimal.y" { 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 48341 "gram_minimal.c" break; case 1729: /* simple_select: values_clause */ #line 13078 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48347 "gram_minimal.c" break; case 1730: /* simple_select: TABLE relation_expr */ #line 13080 "gram_minimal.y" { /* 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 48370 "gram_minimal.c" break; case 1731: /* simple_select: select_clause UNION set_quantifier select_clause */ #line 13099 "gram_minimal.y" { (yyval.node) = makeSetOp(SETOP_UNION, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 48378 "gram_minimal.c" break; case 1732: /* simple_select: select_clause INTERSECT set_quantifier select_clause */ #line 13103 "gram_minimal.y" { (yyval.node) = makeSetOp(SETOP_INTERSECT, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 48386 "gram_minimal.c" break; case 1733: /* simple_select: select_clause EXCEPT set_quantifier select_clause */ #line 13107 "gram_minimal.y" { (yyval.node) = makeSetOp(SETOP_EXCEPT, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 48394 "gram_minimal.c" break; case 1734: /* with_clause: WITH cte_list */ #line 13122 "gram_minimal.y" { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; (yyval.with)->location = (yylsp[-1]); } #line 48405 "gram_minimal.c" break; case 1735: /* with_clause: WITH_LA cte_list */ #line 13129 "gram_minimal.y" { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; (yyval.with)->location = (yylsp[-1]); } #line 48416 "gram_minimal.c" break; case 1736: /* with_clause: WITH RECURSIVE cte_list */ #line 13136 "gram_minimal.y" { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = true; (yyval.with)->location = (yylsp[-2]); } #line 48427 "gram_minimal.c" break; case 1737: /* cte_list: common_table_expr */ #line 13145 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 48433 "gram_minimal.c" break; case 1738: /* cte_list: cte_list ',' common_table_expr */ #line 13146 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 48439 "gram_minimal.c" break; case 1739: /* common_table_expr: name opt_name_list AS opt_materialized '(' PreparableStmt ')' opt_search_clause opt_cycle_clause */ #line 13150 "gram_minimal.y" { 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 48456 "gram_minimal.c" break; case 1740: /* opt_materialized: MATERIALIZED */ #line 13165 "gram_minimal.y" { (yyval.ival) = CTEMaterializeAlways; } #line 48462 "gram_minimal.c" break; case 1741: /* opt_materialized: NOT MATERIALIZED */ #line 13166 "gram_minimal.y" { (yyval.ival) = CTEMaterializeNever; } #line 48468 "gram_minimal.c" break; case 1742: /* opt_materialized: %empty */ #line 13167 "gram_minimal.y" { (yyval.ival) = CTEMaterializeDefault; } #line 48474 "gram_minimal.c" break; case 1743: /* opt_search_clause: SEARCH DEPTH FIRST_P BY columnList SET ColId */ #line 13172 "gram_minimal.y" { 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 48488 "gram_minimal.c" break; case 1744: /* opt_search_clause: SEARCH BREADTH FIRST_P BY columnList SET ColId */ #line 13182 "gram_minimal.y" { 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 48502 "gram_minimal.c" break; case 1745: /* opt_search_clause: %empty */ #line 13192 "gram_minimal.y" { (yyval.node) = NULL; } #line 48510 "gram_minimal.c" break; case 1746: /* opt_cycle_clause: CYCLE columnList SET ColId TO AexprConst DEFAULT AexprConst USING ColId */ #line 13199 "gram_minimal.y" { 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 48526 "gram_minimal.c" break; case 1747: /* opt_cycle_clause: CYCLE columnList SET ColId USING ColId */ #line 13211 "gram_minimal.y" { 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 48542 "gram_minimal.c" break; case 1748: /* opt_cycle_clause: %empty */ #line 13223 "gram_minimal.y" { (yyval.node) = NULL; } #line 48550 "gram_minimal.c" break; case 1749: /* opt_with_clause: with_clause */ #line 13229 "gram_minimal.y" { (yyval.with) = (yyvsp[0].with); } #line 48556 "gram_minimal.c" break; case 1750: /* opt_with_clause: %empty */ #line 13230 "gram_minimal.y" { (yyval.with) = NULL; } #line 48562 "gram_minimal.c" break; case 1751: /* into_clause: INTO OptTempTableName */ #line 13235 "gram_minimal.y" { (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 48577 "gram_minimal.c" break; case 1752: /* into_clause: %empty */ #line 13246 "gram_minimal.y" { (yyval.into) = NULL; } #line 48583 "gram_minimal.c" break; case 1753: /* OptTempTableName: TEMPORARY opt_table qualified_name */ #line 13255 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 48592 "gram_minimal.c" break; case 1754: /* OptTempTableName: TEMP opt_table qualified_name */ #line 13260 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 48601 "gram_minimal.c" break; case 1755: /* OptTempTableName: LOCAL TEMPORARY opt_table qualified_name */ #line 13265 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 48610 "gram_minimal.c" break; case 1756: /* OptTempTableName: LOCAL TEMP opt_table qualified_name */ #line 13270 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 48619 "gram_minimal.c" break; case 1757: /* OptTempTableName: GLOBAL TEMPORARY opt_table qualified_name */ #line 13275 "gram_minimal.y" { 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 48631 "gram_minimal.c" break; case 1758: /* OptTempTableName: GLOBAL TEMP opt_table qualified_name */ #line 13283 "gram_minimal.y" { 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 48643 "gram_minimal.c" break; case 1759: /* OptTempTableName: UNLOGGED opt_table qualified_name */ #line 13291 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_UNLOGGED; } #line 48652 "gram_minimal.c" break; case 1760: /* OptTempTableName: TABLE qualified_name */ #line 13296 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 48661 "gram_minimal.c" break; case 1761: /* OptTempTableName: qualified_name */ #line 13301 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 48670 "gram_minimal.c" break; case 1764: /* set_quantifier: ALL */ #line 13312 "gram_minimal.y" { (yyval.setquantifier) = SET_QUANTIFIER_ALL; } #line 48676 "gram_minimal.c" break; case 1765: /* set_quantifier: DISTINCT */ #line 13313 "gram_minimal.y" { (yyval.setquantifier) = SET_QUANTIFIER_DISTINCT; } #line 48682 "gram_minimal.c" break; case 1766: /* set_quantifier: %empty */ #line 13314 "gram_minimal.y" { (yyval.setquantifier) = SET_QUANTIFIER_DEFAULT; } #line 48688 "gram_minimal.c" break; case 1767: /* distinct_clause: DISTINCT */ #line 13321 "gram_minimal.y" { (yyval.list) = list_make1(NIL); } #line 48694 "gram_minimal.c" break; case 1768: /* distinct_clause: DISTINCT ON '(' expr_list ')' */ #line 13322 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 48700 "gram_minimal.c" break; case 1771: /* opt_distinct_clause: distinct_clause */ #line 13331 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 48706 "gram_minimal.c" break; case 1772: /* opt_distinct_clause: opt_all_clause */ #line 13332 "gram_minimal.y" { (yyval.list) = NIL; } #line 48712 "gram_minimal.c" break; case 1773: /* opt_sort_clause: sort_clause */ #line 13336 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 48718 "gram_minimal.c" break; case 1774: /* opt_sort_clause: %empty */ #line 13337 "gram_minimal.y" { (yyval.list) = NIL; } #line 48724 "gram_minimal.c" break; case 1775: /* sort_clause: ORDER BY sortby_list */ #line 13341 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 48730 "gram_minimal.c" break; case 1776: /* sortby_list: sortby */ #line 13345 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].sortby)); } #line 48736 "gram_minimal.c" break; case 1777: /* sortby_list: sortby_list ',' sortby */ #line 13346 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].sortby)); } #line 48742 "gram_minimal.c" break; case 1778: /* sortby: a_expr USING qual_all_Op opt_nulls_order */ #line 13350 "gram_minimal.y" { (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 48755 "gram_minimal.c" break; case 1779: /* sortby: a_expr opt_asc_desc opt_nulls_order */ #line 13359 "gram_minimal.y" { (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 48768 "gram_minimal.c" break; case 1780: /* select_limit: limit_clause offset_clause */ #line 13372 "gram_minimal.y" { (yyval.selectlimit) = (yyvsp[-1].selectlimit); ((yyval.selectlimit))->limitOffset = (yyvsp[0].node); ((yyval.selectlimit))->offsetLoc = (yylsp[0]); } #line 48778 "gram_minimal.c" break; case 1781: /* select_limit: offset_clause limit_clause */ #line 13378 "gram_minimal.y" { (yyval.selectlimit) = (yyvsp[0].selectlimit); ((yyval.selectlimit))->limitOffset = (yyvsp[-1].node); ((yyval.selectlimit))->offsetLoc = (yylsp[-1]); } #line 48788 "gram_minimal.c" break; case 1782: /* select_limit: limit_clause */ #line 13384 "gram_minimal.y" { (yyval.selectlimit) = (yyvsp[0].selectlimit); } #line 48796 "gram_minimal.c" break; case 1783: /* select_limit: offset_clause */ #line 13388 "gram_minimal.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = (yyvsp[0].node); n->limitCount = NULL; n->limitOption = LIMIT_OPTION_COUNT; n->offsetLoc = (yylsp[0]); n->countLoc = -1; n->optionLoc = -1; (yyval.selectlimit) = n; } #line 48812 "gram_minimal.c" break; case 1784: /* opt_select_limit: select_limit */ #line 13402 "gram_minimal.y" { (yyval.selectlimit) = (yyvsp[0].selectlimit); } #line 48818 "gram_minimal.c" break; case 1785: /* opt_select_limit: %empty */ #line 13403 "gram_minimal.y" { (yyval.selectlimit) = NULL; } #line 48824 "gram_minimal.c" break; case 1786: /* limit_clause: LIMIT select_limit_value */ #line 13408 "gram_minimal.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[0].node); n->limitOption = LIMIT_OPTION_COUNT; n->offsetLoc = -1; n->countLoc = (yylsp[-1]); n->optionLoc = -1; (yyval.selectlimit) = n; } #line 48840 "gram_minimal.c" break; case 1787: /* limit_clause: LIMIT select_limit_value ',' select_offset_value */ #line 13420 "gram_minimal.y" { /* 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 48853 "gram_minimal.c" break; case 1788: /* limit_clause: FETCH first_or_next select_fetch_first_value row_or_rows ONLY */ #line 13436 "gram_minimal.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[-2].node); n->limitOption = LIMIT_OPTION_COUNT; n->offsetLoc = -1; n->countLoc = (yylsp[-4]); n->optionLoc = -1; (yyval.selectlimit) = n; } #line 48869 "gram_minimal.c" break; case 1789: /* limit_clause: FETCH first_or_next select_fetch_first_value row_or_rows WITH TIES */ #line 13448 "gram_minimal.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[-3].node); n->limitOption = LIMIT_OPTION_WITH_TIES; n->offsetLoc = -1; n->countLoc = (yylsp[-5]); n->optionLoc = (yylsp[-1]); (yyval.selectlimit) = n; } #line 48885 "gram_minimal.c" break; case 1790: /* limit_clause: FETCH first_or_next row_or_rows ONLY */ #line 13460 "gram_minimal.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = makeIntConst(1, -1); n->limitOption = LIMIT_OPTION_COUNT; n->offsetLoc = -1; n->countLoc = (yylsp[-3]); n->optionLoc = -1; (yyval.selectlimit) = n; } #line 48901 "gram_minimal.c" break; case 1791: /* limit_clause: FETCH first_or_next row_or_rows WITH TIES */ #line 13472 "gram_minimal.y" { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = makeIntConst(1, -1); n->limitOption = LIMIT_OPTION_WITH_TIES; n->offsetLoc = -1; n->countLoc = (yylsp[-4]); n->optionLoc = (yylsp[-1]); (yyval.selectlimit) = n; } #line 48917 "gram_minimal.c" break; case 1792: /* offset_clause: OFFSET select_offset_value */ #line 13487 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48923 "gram_minimal.c" break; case 1793: /* offset_clause: OFFSET select_fetch_first_value row_or_rows */ #line 13490 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 48929 "gram_minimal.c" break; case 1794: /* select_limit_value: a_expr */ #line 13494 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48935 "gram_minimal.c" break; case 1795: /* select_limit_value: ALL */ #line 13496 "gram_minimal.y" { /* LIMIT ALL is represented as a NULL constant */ (yyval.node) = makeNullAConst((yylsp[0])); } #line 48944 "gram_minimal.c" break; case 1796: /* select_offset_value: a_expr */ #line 13503 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48950 "gram_minimal.c" break; case 1797: /* select_fetch_first_value: c_expr */ #line 13523 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 48956 "gram_minimal.c" break; case 1798: /* select_fetch_first_value: '+' I_or_F_const */ #line 13525 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 48962 "gram_minimal.c" break; case 1799: /* select_fetch_first_value: '-' I_or_F_const */ #line 13527 "gram_minimal.y" { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 48968 "gram_minimal.c" break; case 1800: /* I_or_F_const: Iconst */ #line 13531 "gram_minimal.y" { (yyval.node) = makeIntConst((yyvsp[0].ival),(yylsp[0])); } #line 48974 "gram_minimal.c" break; case 1801: /* I_or_F_const: FCONST */ #line 13532 "gram_minimal.y" { (yyval.node) = makeFloatConst((yyvsp[0].str),(yylsp[0])); } #line 48980 "gram_minimal.c" break; case 1802: /* row_or_rows: ROW */ #line 13536 "gram_minimal.y" { (yyval.ival) = 0; } #line 48986 "gram_minimal.c" break; case 1803: /* row_or_rows: ROWS */ #line 13537 "gram_minimal.y" { (yyval.ival) = 0; } #line 48992 "gram_minimal.c" break; case 1804: /* first_or_next: FIRST_P */ #line 13540 "gram_minimal.y" { (yyval.ival) = 0; } #line 48998 "gram_minimal.c" break; case 1805: /* first_or_next: NEXT */ #line 13541 "gram_minimal.y" { (yyval.ival) = 0; } #line 49004 "gram_minimal.c" break; case 1806: /* group_clause: GROUP_P BY set_quantifier group_by_list */ #line 13567 "gram_minimal.y" { GroupClause *n = (GroupClause *) palloc(sizeof(GroupClause)); n->distinct = (yyvsp[-1].setquantifier) == SET_QUANTIFIER_DISTINCT; n->list = (yyvsp[0].list); (yyval.groupclause) = n; } #line 49016 "gram_minimal.c" break; case 1807: /* group_clause: %empty */ #line 13575 "gram_minimal.y" { GroupClause *n = (GroupClause *) palloc(sizeof(GroupClause)); n->distinct = false; n->list = NIL; (yyval.groupclause) = n; } #line 49028 "gram_minimal.c" break; case 1808: /* group_by_list: group_by_item */ #line 13585 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49034 "gram_minimal.c" break; case 1809: /* group_by_list: group_by_list ',' group_by_item */ #line 13586 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].node)); } #line 49040 "gram_minimal.c" break; case 1810: /* group_by_item: a_expr */ #line 13590 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49046 "gram_minimal.c" break; case 1811: /* group_by_item: empty_grouping_set */ #line 13591 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49052 "gram_minimal.c" break; case 1812: /* group_by_item: cube_clause */ #line 13592 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49058 "gram_minimal.c" break; case 1813: /* group_by_item: rollup_clause */ #line 13593 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49064 "gram_minimal.c" break; case 1814: /* group_by_item: grouping_sets_clause */ #line 13594 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49070 "gram_minimal.c" break; case 1815: /* empty_grouping_set: '(' ')' */ #line 13599 "gram_minimal.y" { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[-1])); } #line 49078 "gram_minimal.c" break; case 1816: /* rollup_clause: ROLLUP '(' expr_list ')' */ #line 13612 "gram_minimal.y" { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[-1].list), (yylsp[-3])); } #line 49086 "gram_minimal.c" break; case 1817: /* cube_clause: CUBE '(' expr_list ')' */ #line 13619 "gram_minimal.y" { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[-1].list), (yylsp[-3])); } #line 49094 "gram_minimal.c" break; case 1818: /* grouping_sets_clause: GROUPING SETS '(' group_by_list ')' */ #line 13626 "gram_minimal.y" { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[-1].list), (yylsp[-4])); } #line 49102 "gram_minimal.c" break; case 1819: /* having_clause: HAVING a_expr */ #line 13632 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49108 "gram_minimal.c" break; case 1820: /* having_clause: %empty */ #line 13633 "gram_minimal.y" { (yyval.node) = NULL; } #line 49114 "gram_minimal.c" break; case 1821: /* for_locking_clause: for_locking_items */ #line 13637 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 49120 "gram_minimal.c" break; case 1822: /* for_locking_clause: FOR READ ONLY */ #line 13638 "gram_minimal.y" { (yyval.list) = NIL; } #line 49126 "gram_minimal.c" break; case 1823: /* opt_for_locking_clause: for_locking_clause */ #line 13642 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 49132 "gram_minimal.c" break; case 1824: /* opt_for_locking_clause: %empty */ #line 13643 "gram_minimal.y" { (yyval.list) = NIL; } #line 49138 "gram_minimal.c" break; case 1825: /* for_locking_items: for_locking_item */ #line 13647 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49144 "gram_minimal.c" break; case 1826: /* for_locking_items: for_locking_items for_locking_item */ #line 13648 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 49150 "gram_minimal.c" break; case 1827: /* for_locking_item: for_locking_strength locked_rels_list opt_nowait_or_skip */ #line 13653 "gram_minimal.y" { LockingClause *n = makeNode(LockingClause); n->lockedRels = (yyvsp[-1].list); n->strength = (yyvsp[-2].ival); n->waitPolicy = (yyvsp[0].ival); (yyval.node) = (Node *) n; } #line 49163 "gram_minimal.c" break; case 1828: /* for_locking_strength: FOR UPDATE */ #line 13664 "gram_minimal.y" { (yyval.ival) = LCS_FORUPDATE; } #line 49169 "gram_minimal.c" break; case 1829: /* for_locking_strength: FOR NO KEY UPDATE */ #line 13665 "gram_minimal.y" { (yyval.ival) = LCS_FORNOKEYUPDATE; } #line 49175 "gram_minimal.c" break; case 1830: /* for_locking_strength: FOR SHARE */ #line 13666 "gram_minimal.y" { (yyval.ival) = LCS_FORSHARE; } #line 49181 "gram_minimal.c" break; case 1831: /* for_locking_strength: FOR KEY SHARE */ #line 13667 "gram_minimal.y" { (yyval.ival) = LCS_FORKEYSHARE; } #line 49187 "gram_minimal.c" break; case 1832: /* locked_rels_list: OF qualified_name_list */ #line 13671 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 49193 "gram_minimal.c" break; case 1833: /* locked_rels_list: %empty */ #line 13672 "gram_minimal.y" { (yyval.list) = NIL; } #line 49199 "gram_minimal.c" break; case 1834: /* values_clause: VALUES '(' expr_list ')' */ #line 13683 "gram_minimal.y" { SelectStmt *n = makeNode(SelectStmt); n->valuesLists = list_make1((yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 49210 "gram_minimal.c" break; case 1835: /* values_clause: values_clause ',' '(' expr_list ')' */ #line 13690 "gram_minimal.y" { SelectStmt *n = (SelectStmt *) (yyvsp[-4].node); n->valuesLists = lappend(n->valuesLists, (yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 49221 "gram_minimal.c" break; case 1836: /* from_clause: FROM from_list */ #line 13708 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 49227 "gram_minimal.c" break; case 1837: /* from_clause: %empty */ #line 13709 "gram_minimal.y" { (yyval.list) = NIL; } #line 49233 "gram_minimal.c" break; case 1838: /* from_list: table_ref */ #line 13713 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49239 "gram_minimal.c" break; case 1839: /* from_list: from_list ',' table_ref */ #line 13714 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 49245 "gram_minimal.c" break; case 1840: /* table_ref: relation_expr opt_alias_clause */ #line 13721 "gram_minimal.y" { (yyvsp[-1].range)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-1].range); } #line 49254 "gram_minimal.c" break; case 1841: /* table_ref: relation_expr opt_alias_clause tablesample_clause */ #line 13726 "gram_minimal.y" { 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 49267 "gram_minimal.c" break; case 1842: /* table_ref: func_table func_alias_clause */ #line 13735 "gram_minimal.y" { RangeFunction *n = (RangeFunction *) (yyvsp[-1].node); n->alias = linitial((yyvsp[0].list)); n->coldeflist = lsecond((yyvsp[0].list)); (yyval.node) = (Node *) n; } #line 49279 "gram_minimal.c" break; case 1843: /* table_ref: LATERAL_P func_table func_alias_clause */ #line 13743 "gram_minimal.y" { 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 49292 "gram_minimal.c" break; case 1844: /* table_ref: xmltable opt_alias_clause */ #line 13752 "gram_minimal.y" { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 49303 "gram_minimal.c" break; case 1845: /* table_ref: LATERAL_P xmltable opt_alias_clause */ #line 13759 "gram_minimal.y" { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->lateral = true; n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 49315 "gram_minimal.c" break; case 1846: /* table_ref: select_with_parens opt_alias_clause */ #line 13767 "gram_minimal.y" { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = false; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 49328 "gram_minimal.c" break; case 1847: /* table_ref: LATERAL_P select_with_parens opt_alias_clause */ #line 13776 "gram_minimal.y" { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = true; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 49341 "gram_minimal.c" break; case 1848: /* table_ref: joined_table */ #line 13785 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[0].jexpr); } #line 49349 "gram_minimal.c" break; case 1849: /* table_ref: '(' joined_table ')' alias_clause */ #line 13789 "gram_minimal.y" { (yyvsp[-2].jexpr)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-2].jexpr); } #line 49358 "gram_minimal.c" break; case 1850: /* table_ref: json_table opt_alias_clause */ #line 13794 "gram_minimal.y" { JsonTable *jt = castNode(JsonTable, (yyvsp[-1].node)); jt->alias = (yyvsp[0].alias); (yyval.node) = (Node *) jt; } #line 49369 "gram_minimal.c" break; case 1851: /* table_ref: LATERAL_P json_table opt_alias_clause */ #line 13801 "gram_minimal.y" { JsonTable *jt = castNode(JsonTable, (yyvsp[-1].node)); jt->alias = (yyvsp[0].alias); jt->lateral = true; (yyval.node) = (Node *) jt; } #line 49381 "gram_minimal.c" break; case 1852: /* joined_table: '(' joined_table ')' */ #line 13830 "gram_minimal.y" { (yyval.jexpr) = (yyvsp[-1].jexpr); } #line 49389 "gram_minimal.c" break; case 1853: /* joined_table: table_ref CROSS JOIN table_ref */ #line 13834 "gram_minimal.y" { /* 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 49407 "gram_minimal.c" break; case 1854: /* joined_table: table_ref join_type JOIN table_ref join_qual */ #line 13848 "gram_minimal.y" { 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 49432 "gram_minimal.c" break; case 1855: /* joined_table: table_ref JOIN table_ref join_qual */ #line 13869 "gram_minimal.y" { /* 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 49458 "gram_minimal.c" break; case 1856: /* joined_table: table_ref NATURAL join_type JOIN table_ref */ #line 13891 "gram_minimal.y" { 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 49475 "gram_minimal.c" break; case 1857: /* joined_table: table_ref NATURAL JOIN table_ref */ #line 13904 "gram_minimal.y" { /* 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 49493 "gram_minimal.c" break; case 1858: /* alias_clause: AS ColId '(' name_list ')' */ #line 13921 "gram_minimal.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 49503 "gram_minimal.c" break; case 1859: /* alias_clause: AS ColId */ #line 13927 "gram_minimal.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 49512 "gram_minimal.c" break; case 1860: /* alias_clause: ColId '(' name_list ')' */ #line 13932 "gram_minimal.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 49522 "gram_minimal.c" break; case 1861: /* alias_clause: ColId */ #line 13938 "gram_minimal.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 49531 "gram_minimal.c" break; case 1862: /* opt_alias_clause: alias_clause */ #line 13944 "gram_minimal.y" { (yyval.alias) = (yyvsp[0].alias); } #line 49537 "gram_minimal.c" break; case 1863: /* opt_alias_clause: %empty */ #line 13945 "gram_minimal.y" { (yyval.alias) = NULL; } #line 49543 "gram_minimal.c" break; case 1864: /* opt_alias_clause_for_join_using: AS ColId */ #line 13956 "gram_minimal.y" { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); /* the column name list will be inserted later */ } #line 49553 "gram_minimal.c" break; case 1865: /* opt_alias_clause_for_join_using: %empty */ #line 13961 "gram_minimal.y" { (yyval.alias) = NULL; } #line 49559 "gram_minimal.c" break; case 1866: /* func_alias_clause: alias_clause */ #line 13970 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[0].alias), NIL); } #line 49567 "gram_minimal.c" break; case 1867: /* func_alias_clause: AS '(' TableFuncElementList ')' */ #line 13974 "gram_minimal.y" { (yyval.list) = list_make2(NULL, (yyvsp[-1].list)); } #line 49575 "gram_minimal.c" break; case 1868: /* func_alias_clause: AS ColId '(' TableFuncElementList ')' */ #line 13978 "gram_minimal.y" { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 49586 "gram_minimal.c" break; case 1869: /* func_alias_clause: ColId '(' TableFuncElementList ')' */ #line 13985 "gram_minimal.y" { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 49597 "gram_minimal.c" break; case 1870: /* func_alias_clause: %empty */ #line 13992 "gram_minimal.y" { (yyval.list) = list_make2(NULL, NIL); } #line 49605 "gram_minimal.c" break; case 1871: /* join_type: FULL opt_outer */ #line 13997 "gram_minimal.y" { (yyval.jtype) = JOIN_FULL; } #line 49611 "gram_minimal.c" break; case 1872: /* join_type: LEFT opt_outer */ #line 13998 "gram_minimal.y" { (yyval.jtype) = JOIN_LEFT; } #line 49617 "gram_minimal.c" break; case 1873: /* join_type: RIGHT opt_outer */ #line 13999 "gram_minimal.y" { (yyval.jtype) = JOIN_RIGHT; } #line 49623 "gram_minimal.c" break; case 1874: /* join_type: INNER_P */ #line 14000 "gram_minimal.y" { (yyval.jtype) = JOIN_INNER; } #line 49629 "gram_minimal.c" break; case 1877: /* join_qual: USING '(' name_list ')' opt_alias_clause_for_join_using */ #line 14021 "gram_minimal.y" { (yyval.node) = (Node *) list_make2((yyvsp[-2].list), (yyvsp[0].alias)); } #line 49637 "gram_minimal.c" break; case 1878: /* join_qual: ON a_expr */ #line 14025 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49645 "gram_minimal.c" break; case 1879: /* relation_expr: qualified_name */ #line 14033 "gram_minimal.y" { /* inheritance query, implicitly */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 49656 "gram_minimal.c" break; case 1880: /* relation_expr: extended_relation_expr */ #line 14040 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); } #line 49664 "gram_minimal.c" break; case 1881: /* extended_relation_expr: qualified_name '*' */ #line 14047 "gram_minimal.y" { /* inheritance query, explicitly */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 49675 "gram_minimal.c" break; case 1882: /* extended_relation_expr: ONLY qualified_name */ #line 14054 "gram_minimal.y" { /* no inheritance */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 49686 "gram_minimal.c" break; case 1883: /* extended_relation_expr: ONLY '(' qualified_name ')' */ #line 14061 "gram_minimal.y" { /* no inheritance, SQL99-style syntax */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 49697 "gram_minimal.c" break; case 1884: /* relation_expr_list: relation_expr */ #line 14071 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].range)); } #line 49703 "gram_minimal.c" break; case 1885: /* relation_expr_list: relation_expr_list ',' relation_expr */ #line 14072 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 49709 "gram_minimal.c" break; case 1886: /* relation_expr_opt_alias: relation_expr */ #line 14086 "gram_minimal.y" { (yyval.range) = (yyvsp[0].range); } #line 49717 "gram_minimal.c" break; case 1887: /* relation_expr_opt_alias: relation_expr ColId */ #line 14090 "gram_minimal.y" { Alias *alias = makeNode(Alias); alias->aliasname = (yyvsp[0].str); (yyvsp[-1].range)->alias = alias; (yyval.range) = (yyvsp[-1].range); } #line 49729 "gram_minimal.c" break; case 1888: /* relation_expr_opt_alias: relation_expr AS ColId */ #line 14098 "gram_minimal.y" { Alias *alias = makeNode(Alias); alias->aliasname = (yyvsp[0].str); (yyvsp[-2].range)->alias = alias; (yyval.range) = (yyvsp[-2].range); } #line 49741 "gram_minimal.c" break; case 1889: /* tablesample_clause: TABLESAMPLE func_name '(' expr_list ')' opt_repeatable_clause */ #line 14112 "gram_minimal.y" { 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 49756 "gram_minimal.c" break; case 1890: /* opt_repeatable_clause: REPEATABLE '(' a_expr ')' */ #line 14125 "gram_minimal.y" { (yyval.node) = (Node *) (yyvsp[-1].node); } #line 49762 "gram_minimal.c" break; case 1891: /* opt_repeatable_clause: %empty */ #line 14126 "gram_minimal.y" { (yyval.node) = NULL; } #line 49768 "gram_minimal.c" break; case 1892: /* func_table: func_expr_windowless opt_ordinality */ #line 14142 "gram_minimal.y" { 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 49783 "gram_minimal.c" break; case 1893: /* func_table: ROWS FROM '(' rowsfrom_list ')' opt_ordinality */ #line 14153 "gram_minimal.y" { 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 49798 "gram_minimal.c" break; case 1894: /* rowsfrom_item: func_expr_windowless opt_col_def_list */ #line 14166 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].list)); } #line 49804 "gram_minimal.c" break; case 1895: /* rowsfrom_list: rowsfrom_item */ #line 14170 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].list)); } #line 49810 "gram_minimal.c" break; case 1896: /* rowsfrom_list: rowsfrom_list ',' rowsfrom_item */ #line 14171 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 49816 "gram_minimal.c" break; case 1897: /* opt_col_def_list: AS '(' TableFuncElementList ')' */ #line 14174 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 49822 "gram_minimal.c" break; case 1898: /* opt_col_def_list: %empty */ #line 14175 "gram_minimal.y" { (yyval.list) = NIL; } #line 49828 "gram_minimal.c" break; case 1899: /* opt_ordinality: WITH_LA ORDINALITY */ #line 14178 "gram_minimal.y" { (yyval.boolean) = true; } #line 49834 "gram_minimal.c" break; case 1900: /* opt_ordinality: %empty */ #line 14179 "gram_minimal.y" { (yyval.boolean) = false; } #line 49840 "gram_minimal.c" break; case 1901: /* where_clause: WHERE a_expr */ #line 14184 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49846 "gram_minimal.c" break; case 1902: /* where_clause: %empty */ #line 14185 "gram_minimal.y" { (yyval.node) = NULL; } #line 49852 "gram_minimal.c" break; case 1903: /* where_or_current_clause: WHERE a_expr */ #line 14190 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 49858 "gram_minimal.c" break; case 1904: /* where_or_current_clause: WHERE CURRENT_P OF cursor_name */ #line 14192 "gram_minimal.y" { 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 49871 "gram_minimal.c" break; case 1905: /* where_or_current_clause: %empty */ #line 14200 "gram_minimal.y" { (yyval.node) = NULL; } #line 49877 "gram_minimal.c" break; case 1906: /* OptTableFuncElementList: TableFuncElementList */ #line 14205 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 49883 "gram_minimal.c" break; case 1907: /* OptTableFuncElementList: %empty */ #line 14206 "gram_minimal.y" { (yyval.list) = NIL; } #line 49889 "gram_minimal.c" break; case 1908: /* TableFuncElementList: TableFuncElement */ #line 14211 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49897 "gram_minimal.c" break; case 1909: /* TableFuncElementList: TableFuncElementList ',' TableFuncElement */ #line 14215 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 49905 "gram_minimal.c" break; case 1910: /* TableFuncElement: ColId Typename opt_collate_clause */ #line 14221 "gram_minimal.y" { 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 49928 "gram_minimal.c" break; case 1911: /* xmltable: XMLTABLE '(' c_expr xmlexists_argument COLUMNS xmltable_column_list ')' */ #line 14246 "gram_minimal.y" { 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 49943 "gram_minimal.c" break; case 1912: /* xmltable: XMLTABLE '(' XMLNAMESPACES '(' xml_namespace_list ')' ',' c_expr xmlexists_argument COLUMNS xmltable_column_list ')' */ #line 14258 "gram_minimal.y" { 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 49958 "gram_minimal.c" break; case 1913: /* xmltable_column_list: xmltable_column_el */ #line 14270 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 49964 "gram_minimal.c" break; case 1914: /* xmltable_column_list: xmltable_column_list ',' xmltable_column_el */ #line 14271 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 49970 "gram_minimal.c" break; case 1915: /* xmltable_column_el: ColId Typename */ #line 14276 "gram_minimal.y" { 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 49988 "gram_minimal.c" break; case 1916: /* xmltable_column_el: ColId Typename xmltable_column_option_list */ #line 14290 "gram_minimal.y" { 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, "__pg__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 50049 "gram_minimal.c" break; case 1917: /* xmltable_column_el: ColId FOR ORDINALITY */ #line 14347 "gram_minimal.y" { 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 50064 "gram_minimal.c" break; case 1918: /* xmltable_column_option_list: xmltable_column_option_el */ #line 14361 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 50070 "gram_minimal.c" break; case 1919: /* xmltable_column_option_list: xmltable_column_option_list xmltable_column_option_el */ #line 14363 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 50076 "gram_minimal.c" break; case 1920: /* xmltable_column_option_el: IDENT b_expr */ #line 14368 "gram_minimal.y" { if (strcmp((yyvsp[-1].str), "__pg__is_not_null") == 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("option name \"%s\" cannot be used in XMLTABLE", (yyvsp[-1].str)), parser_errposition((yylsp[-1])))); (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 50089 "gram_minimal.c" break; case 1921: /* xmltable_column_option_el: DEFAULT b_expr */ #line 14377 "gram_minimal.y" { (yyval.defelt) = makeDefElem("default", (yyvsp[0].node), (yylsp[-1])); } #line 50095 "gram_minimal.c" break; case 1922: /* xmltable_column_option_el: NOT NULL_P */ #line 14379 "gram_minimal.y" { (yyval.defelt) = makeDefElem("__pg__is_not_null", (Node *) makeBoolean(true), (yylsp[-1])); } #line 50101 "gram_minimal.c" break; case 1923: /* xmltable_column_option_el: NULL_P */ #line 14381 "gram_minimal.y" { (yyval.defelt) = makeDefElem("__pg__is_not_null", (Node *) makeBoolean(false), (yylsp[0])); } #line 50107 "gram_minimal.c" break; case 1924: /* xmltable_column_option_el: PATH b_expr */ #line 14383 "gram_minimal.y" { (yyval.defelt) = makeDefElem("path", (yyvsp[0].node), (yylsp[-1])); } #line 50113 "gram_minimal.c" break; case 1925: /* xml_namespace_list: xml_namespace_el */ #line 14388 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 50119 "gram_minimal.c" break; case 1926: /* xml_namespace_list: xml_namespace_list ',' xml_namespace_el */ #line 14390 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 50125 "gram_minimal.c" break; case 1927: /* xml_namespace_el: b_expr AS ColLabel */ #line 14395 "gram_minimal.y" { (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 50137 "gram_minimal.c" break; case 1928: /* xml_namespace_el: DEFAULT b_expr */ #line 14403 "gram_minimal.y" { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = NULL; (yyval.target)->indirection = NIL; (yyval.target)->val = (yyvsp[0].node); (yyval.target)->location = (yylsp[-1]); } #line 50149 "gram_minimal.c" break; case 1929: /* json_table: JSON_TABLE '(' json_value_expr ',' a_expr json_table_path_name_opt json_passing_clause_opt COLUMNS '(' json_table_column_definition_list ')' json_on_error_clause_opt ')' */ #line 14419 "gram_minimal.y" { 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 50173 "gram_minimal.c" break; case 1930: /* json_table_path_name_opt: AS name */ #line 14441 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 50179 "gram_minimal.c" break; case 1931: /* json_table_path_name_opt: %empty */ #line 14442 "gram_minimal.y" { (yyval.str) = NULL; } #line 50185 "gram_minimal.c" break; case 1932: /* json_table_column_definition_list: json_table_column_definition */ #line 14447 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 50191 "gram_minimal.c" break; case 1933: /* json_table_column_definition_list: json_table_column_definition_list ',' json_table_column_definition */ #line 14449 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 50197 "gram_minimal.c" break; case 1934: /* json_table_column_definition: ColId FOR ORDINALITY */ #line 14454 "gram_minimal.y" { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_FOR_ORDINALITY; n->name = (yyvsp[-2].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 50210 "gram_minimal.c" break; case 1935: /* json_table_column_definition: ColId Typename json_table_column_path_clause_opt json_wrapper_behavior json_quotes_clause_opt json_behavior_clause_opt */ #line 14467 "gram_minimal.y" { 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 50230 "gram_minimal.c" break; case 1936: /* json_table_column_definition: ColId Typename json_format_clause json_table_column_path_clause_opt json_wrapper_behavior json_quotes_clause_opt json_behavior_clause_opt */ #line 14487 "gram_minimal.y" { 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 50250 "gram_minimal.c" break; case 1937: /* json_table_column_definition: ColId Typename EXISTS json_table_column_path_clause_opt json_on_error_clause_opt */ #line 14505 "gram_minimal.y" { 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 50270 "gram_minimal.c" break; case 1938: /* json_table_column_definition: NESTED path_opt Sconst COLUMNS '(' json_table_column_definition_list ')' */ #line 14522 "gram_minimal.y" { 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 50285 "gram_minimal.c" break; case 1939: /* json_table_column_definition: NESTED path_opt Sconst AS name COLUMNS '(' json_table_column_definition_list ')' */ #line 14534 "gram_minimal.y" { 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 50300 "gram_minimal.c" break; case 1942: /* json_table_column_path_clause_opt: PATH Sconst */ #line 14553 "gram_minimal.y" { (yyval.node) = (Node *) makeJsonTablePathSpec((yyvsp[0].str), NULL, (yylsp[0]), -1); } #line 50306 "gram_minimal.c" break; case 1943: /* json_table_column_path_clause_opt: %empty */ #line 14555 "gram_minimal.y" { (yyval.node) = NULL; } #line 50312 "gram_minimal.c" break; case 1944: /* Typename: SimpleTypename opt_array_bounds */ #line 14569 "gram_minimal.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); } #line 50321 "gram_minimal.c" break; case 1945: /* Typename: SETOF SimpleTypename opt_array_bounds */ #line 14574 "gram_minimal.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); (yyval.typnam)->setof = true; } #line 50331 "gram_minimal.c" break; case 1946: /* Typename: SimpleTypename ARRAY '[' Iconst ']' */ #line 14581 "gram_minimal.y" { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); } #line 50340 "gram_minimal.c" break; case 1947: /* Typename: SETOF SimpleTypename ARRAY '[' Iconst ']' */ #line 14586 "gram_minimal.y" { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); (yyval.typnam)->setof = true; } #line 50350 "gram_minimal.c" break; case 1948: /* Typename: SimpleTypename ARRAY */ #line 14592 "gram_minimal.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); } #line 50359 "gram_minimal.c" break; case 1949: /* Typename: SETOF SimpleTypename ARRAY */ #line 14597 "gram_minimal.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); (yyval.typnam)->setof = true; } #line 50369 "gram_minimal.c" break; case 1950: /* opt_array_bounds: opt_array_bounds '[' ']' */ #line 14606 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), makeInteger(-1)); } #line 50375 "gram_minimal.c" break; case 1951: /* opt_array_bounds: opt_array_bounds '[' Iconst ']' */ #line 14608 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-3].list), makeInteger((yyvsp[-1].ival))); } #line 50381 "gram_minimal.c" break; case 1952: /* opt_array_bounds: %empty */ #line 14610 "gram_minimal.y" { (yyval.list) = NIL; } #line 50387 "gram_minimal.c" break; case 1953: /* SimpleTypename: GenericType */ #line 14614 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50393 "gram_minimal.c" break; case 1954: /* SimpleTypename: Numeric */ #line 14615 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50399 "gram_minimal.c" break; case 1955: /* SimpleTypename: Bit */ #line 14616 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50405 "gram_minimal.c" break; case 1956: /* SimpleTypename: Character */ #line 14617 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50411 "gram_minimal.c" break; case 1957: /* SimpleTypename: ConstDatetime */ #line 14618 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50417 "gram_minimal.c" break; case 1958: /* SimpleTypename: ConstInterval opt_interval */ #line 14620 "gram_minimal.y" { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->typmods = (yyvsp[0].list); } #line 50426 "gram_minimal.c" break; case 1959: /* SimpleTypename: ConstInterval '(' Iconst ')' */ #line 14625 "gram_minimal.y" { (yyval.typnam) = (yyvsp[-3].typnam); (yyval.typnam)->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 50436 "gram_minimal.c" break; case 1960: /* SimpleTypename: JsonType */ #line 14630 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50442 "gram_minimal.c" break; case 1961: /* ConstTypename: Numeric */ #line 14645 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50448 "gram_minimal.c" break; case 1962: /* ConstTypename: ConstBit */ #line 14646 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50454 "gram_minimal.c" break; case 1963: /* ConstTypename: ConstCharacter */ #line 14647 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50460 "gram_minimal.c" break; case 1964: /* ConstTypename: ConstDatetime */ #line 14648 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50466 "gram_minimal.c" break; case 1965: /* ConstTypename: JsonType */ #line 14649 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50472 "gram_minimal.c" break; case 1966: /* GenericType: type_function_name opt_type_modifiers */ #line 14661 "gram_minimal.y" { (yyval.typnam) = makeTypeName((yyvsp[-1].str)); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 50482 "gram_minimal.c" break; case 1967: /* GenericType: type_function_name attrs opt_type_modifiers */ #line 14667 "gram_minimal.y" { (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-2].str)), (yyvsp[-1].list))); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-2]); } #line 50492 "gram_minimal.c" break; case 1968: /* opt_type_modifiers: '(' expr_list ')' */ #line 14674 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 50498 "gram_minimal.c" break; case 1969: /* opt_type_modifiers: %empty */ #line 14675 "gram_minimal.y" { (yyval.list) = NIL; } #line 50504 "gram_minimal.c" break; case 1970: /* Numeric: INT_P */ #line 14682 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 50513 "gram_minimal.c" break; case 1971: /* Numeric: INTEGER */ #line 14687 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 50522 "gram_minimal.c" break; case 1972: /* Numeric: SMALLINT */ #line 14692 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("int2"); (yyval.typnam)->location = (yylsp[0]); } #line 50531 "gram_minimal.c" break; case 1973: /* Numeric: BIGINT */ #line 14697 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("int8"); (yyval.typnam)->location = (yylsp[0]); } #line 50540 "gram_minimal.c" break; case 1974: /* Numeric: REAL */ #line 14702 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("float4"); (yyval.typnam)->location = (yylsp[0]); } #line 50549 "gram_minimal.c" break; case 1975: /* Numeric: FLOAT_P opt_float */ #line 14707 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->location = (yylsp[-1]); } #line 50558 "gram_minimal.c" break; case 1976: /* Numeric: DOUBLE_P PRECISION */ #line 14712 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("float8"); (yyval.typnam)->location = (yylsp[-1]); } #line 50567 "gram_minimal.c" break; case 1977: /* Numeric: DECIMAL_P opt_type_modifiers */ #line 14717 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 50577 "gram_minimal.c" break; case 1978: /* Numeric: DEC opt_type_modifiers */ #line 14723 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 50587 "gram_minimal.c" break; case 1979: /* Numeric: NUMERIC opt_type_modifiers */ #line 14729 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 50597 "gram_minimal.c" break; case 1980: /* Numeric: BOOLEAN_P */ #line 14735 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("bool"); (yyval.typnam)->location = (yylsp[0]); } #line 50606 "gram_minimal.c" break; case 1981: /* opt_float: '(' Iconst ')' */ #line 14742 "gram_minimal.y" { /* * 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 50631 "gram_minimal.c" break; case 1982: /* opt_float: %empty */ #line 14763 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("float8"); } #line 50639 "gram_minimal.c" break; case 1983: /* Bit: BitWithLength */ #line 14773 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50647 "gram_minimal.c" break; case 1984: /* Bit: BitWithoutLength */ #line 14777 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50655 "gram_minimal.c" break; case 1985: /* ConstBit: BitWithLength */ #line 14785 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50663 "gram_minimal.c" break; case 1986: /* ConstBit: BitWithoutLength */ #line 14789 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; } #line 50672 "gram_minimal.c" break; case 1987: /* BitWithLength: BIT opt_varying '(' expr_list ')' */ #line 14797 "gram_minimal.y" { char *typname; typname = (yyvsp[-3].boolean) ? "varbit" : "bit"; (yyval.typnam) = SystemTypeName(typname); (yyval.typnam)->typmods = (yyvsp[-1].list); (yyval.typnam)->location = (yylsp[-4]); } #line 50685 "gram_minimal.c" break; case 1988: /* BitWithoutLength: BIT opt_varying */ #line 14809 "gram_minimal.y" { /* 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 50703 "gram_minimal.c" break; case 1989: /* Character: CharacterWithLength */ #line 14830 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50711 "gram_minimal.c" break; case 1990: /* Character: CharacterWithoutLength */ #line 14834 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50719 "gram_minimal.c" break; case 1991: /* ConstCharacter: CharacterWithLength */ #line 14840 "gram_minimal.y" { (yyval.typnam) = (yyvsp[0].typnam); } #line 50727 "gram_minimal.c" break; case 1992: /* ConstCharacter: CharacterWithoutLength */ #line 14844 "gram_minimal.y" { /* 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 50742 "gram_minimal.c" break; case 1993: /* CharacterWithLength: character '(' Iconst ')' */ #line 14857 "gram_minimal.y" { (yyval.typnam) = SystemTypeName((yyvsp[-3].str)); (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); (yyval.typnam)->location = (yylsp[-3]); } #line 50752 "gram_minimal.c" break; case 1994: /* CharacterWithoutLength: character */ #line 14865 "gram_minimal.y" { (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 50764 "gram_minimal.c" break; case 1995: /* character: CHARACTER opt_varying */ #line 14875 "gram_minimal.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50770 "gram_minimal.c" break; case 1996: /* character: CHAR_P opt_varying */ #line 14877 "gram_minimal.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50776 "gram_minimal.c" break; case 1997: /* character: VARCHAR */ #line 14879 "gram_minimal.y" { (yyval.str) = "varchar"; } #line 50782 "gram_minimal.c" break; case 1998: /* character: NATIONAL CHARACTER opt_varying */ #line 14881 "gram_minimal.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50788 "gram_minimal.c" break; case 1999: /* character: NATIONAL CHAR_P opt_varying */ #line 14883 "gram_minimal.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50794 "gram_minimal.c" break; case 2000: /* character: NCHAR opt_varying */ #line 14885 "gram_minimal.y" { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 50800 "gram_minimal.c" break; case 2001: /* opt_varying: VARYING */ #line 14889 "gram_minimal.y" { (yyval.boolean) = true; } #line 50806 "gram_minimal.c" break; case 2002: /* opt_varying: %empty */ #line 14890 "gram_minimal.y" { (yyval.boolean) = false; } #line 50812 "gram_minimal.c" break; case 2003: /* ConstDatetime: TIMESTAMP '(' Iconst ')' opt_timezone */ #line 14898 "gram_minimal.y" { 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 50825 "gram_minimal.c" break; case 2004: /* ConstDatetime: TIMESTAMP opt_timezone */ #line 14907 "gram_minimal.y" { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); (yyval.typnam)->location = (yylsp[-1]); } #line 50837 "gram_minimal.c" break; case 2005: /* ConstDatetime: TIME '(' Iconst ')' opt_timezone */ #line 14915 "gram_minimal.y" { 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 50850 "gram_minimal.c" break; case 2006: /* ConstDatetime: TIME opt_timezone */ #line 14924 "gram_minimal.y" { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); (yyval.typnam)->location = (yylsp[-1]); } #line 50862 "gram_minimal.c" break; case 2007: /* ConstInterval: INTERVAL */ #line 14935 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("interval"); (yyval.typnam)->location = (yylsp[0]); } #line 50871 "gram_minimal.c" break; case 2008: /* opt_timezone: WITH_LA TIME ZONE */ #line 14942 "gram_minimal.y" { (yyval.boolean) = true; } #line 50877 "gram_minimal.c" break; case 2009: /* opt_timezone: WITHOUT_LA TIME ZONE */ #line 14943 "gram_minimal.y" { (yyval.boolean) = false; } #line 50883 "gram_minimal.c" break; case 2010: /* opt_timezone: %empty */ #line 14944 "gram_minimal.y" { (yyval.boolean) = false; } #line 50889 "gram_minimal.c" break; case 2011: /* opt_interval: YEAR_P */ #line 14949 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[0]))); } #line 50895 "gram_minimal.c" break; case 2012: /* opt_interval: MONTH_P */ #line 14951 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[0]))); } #line 50901 "gram_minimal.c" break; case 2013: /* opt_interval: DAY_P */ #line 14953 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[0]))); } #line 50907 "gram_minimal.c" break; case 2014: /* opt_interval: HOUR_P */ #line 14955 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[0]))); } #line 50913 "gram_minimal.c" break; case 2015: /* opt_interval: MINUTE_P */ #line 14957 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[0]))); } #line 50919 "gram_minimal.c" break; case 2016: /* opt_interval: interval_second */ #line 14959 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 50925 "gram_minimal.c" break; case 2017: /* opt_interval: YEAR_P TO MONTH_P */ #line 14961 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH), (yylsp[-2]))); } #line 50934 "gram_minimal.c" break; case 2018: /* opt_interval: DAY_P TO HOUR_P */ #line 14966 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR), (yylsp[-2]))); } #line 50943 "gram_minimal.c" break; case 2019: /* opt_interval: DAY_P TO MINUTE_P */ #line 14971 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 50953 "gram_minimal.c" break; case 2020: /* opt_interval: DAY_P TO interval_second */ #line 14977 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 50965 "gram_minimal.c" break; case 2021: /* opt_interval: HOUR_P TO MINUTE_P */ #line 14985 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 50974 "gram_minimal.c" break; case 2022: /* opt_interval: HOUR_P TO interval_second */ #line 14990 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 50985 "gram_minimal.c" break; case 2023: /* opt_interval: MINUTE_P TO interval_second */ #line 14997 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 50995 "gram_minimal.c" break; case 2024: /* opt_interval: %empty */ #line 15003 "gram_minimal.y" { (yyval.list) = NIL; } #line 51001 "gram_minimal.c" break; case 2025: /* interval_second: SECOND_P */ #line 15008 "gram_minimal.y" { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[0]))); } #line 51009 "gram_minimal.c" break; case 2026: /* interval_second: SECOND_P '(' Iconst ')' */ #line 15012 "gram_minimal.y" { (yyval.list) = list_make2(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[-3])), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 51018 "gram_minimal.c" break; case 2027: /* JsonType: JSON */ #line 15020 "gram_minimal.y" { (yyval.typnam) = SystemTypeName("json"); (yyval.typnam)->location = (yylsp[0]); } #line 51027 "gram_minimal.c" break; case 2028: /* a_expr: c_expr */ #line 15054 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 51033 "gram_minimal.c" break; case 2029: /* a_expr: a_expr TYPECAST Typename */ #line 15056 "gram_minimal.y" { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 51039 "gram_minimal.c" break; case 2030: /* a_expr: a_expr COLLATE any_name */ #line 15058 "gram_minimal.y" { CollateClause *n = makeNode(CollateClause); n->arg = (yyvsp[-2].node); n->collname = (yyvsp[0].list); n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 51052 "gram_minimal.c" break; case 2031: /* a_expr: a_expr AT TIME ZONE a_expr */ #line 15067 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make2((yyvsp[0].node), (yyvsp[-4].node)), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 51063 "gram_minimal.c" break; case 2032: /* a_expr: a_expr AT LOCAL */ #line 15074 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make1((yyvsp[-2].node)), COERCE_SQL_SYNTAX, -1); } #line 51074 "gram_minimal.c" break; case 2033: /* a_expr: '+' a_expr */ #line 15090 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 51080 "gram_minimal.c" break; case 2034: /* a_expr: '-' a_expr */ #line 15092 "gram_minimal.y" { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 51086 "gram_minimal.c" break; case 2035: /* a_expr: a_expr '+' a_expr */ #line 15094 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51092 "gram_minimal.c" break; case 2036: /* a_expr: a_expr '-' a_expr */ #line 15096 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51098 "gram_minimal.c" break; case 2037: /* a_expr: a_expr '*' a_expr */ #line 15098 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51104 "gram_minimal.c" break; case 2038: /* a_expr: a_expr '/' a_expr */ #line 15100 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51110 "gram_minimal.c" break; case 2039: /* a_expr: a_expr '%' a_expr */ #line 15102 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51116 "gram_minimal.c" break; case 2040: /* a_expr: a_expr '^' a_expr */ #line 15104 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51122 "gram_minimal.c" break; case 2041: /* a_expr: a_expr '<' a_expr */ #line 15106 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51128 "gram_minimal.c" break; case 2042: /* a_expr: a_expr '>' a_expr */ #line 15108 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51134 "gram_minimal.c" break; case 2043: /* a_expr: a_expr '=' a_expr */ #line 15110 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51140 "gram_minimal.c" break; case 2044: /* a_expr: a_expr LESS_EQUALS a_expr */ #line 15112 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51146 "gram_minimal.c" break; case 2045: /* a_expr: a_expr GREATER_EQUALS a_expr */ #line 15114 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51152 "gram_minimal.c" break; case 2046: /* a_expr: a_expr NOT_EQUALS a_expr */ #line 15116 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51158 "gram_minimal.c" break; case 2047: /* a_expr: a_expr qual_Op a_expr */ #line 15119 "gram_minimal.y" { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51164 "gram_minimal.c" break; case 2048: /* a_expr: qual_Op a_expr */ #line 15121 "gram_minimal.y" { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 51170 "gram_minimal.c" break; case 2049: /* a_expr: a_expr AND a_expr */ #line 15124 "gram_minimal.y" { (yyval.node) = makeAndExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51176 "gram_minimal.c" break; case 2050: /* a_expr: a_expr OR a_expr */ #line 15126 "gram_minimal.y" { (yyval.node) = makeOrExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51182 "gram_minimal.c" break; case 2051: /* a_expr: NOT a_expr */ #line 15128 "gram_minimal.y" { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 51188 "gram_minimal.c" break; case 2052: /* a_expr: NOT_LA a_expr */ #line 15130 "gram_minimal.y" { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 51194 "gram_minimal.c" break; case 2053: /* a_expr: a_expr LIKE a_expr */ #line 15133 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "~~", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51203 "gram_minimal.c" break; case 2054: /* a_expr: a_expr LIKE a_expr ESCAPE a_expr */ #line 15138 "gram_minimal.y" { 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 51216 "gram_minimal.c" break; case 2055: /* a_expr: a_expr NOT_LA LIKE a_expr */ #line 15147 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "!~~", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 51225 "gram_minimal.c" break; case 2056: /* a_expr: a_expr NOT_LA LIKE a_expr ESCAPE a_expr */ #line 15152 "gram_minimal.y" { 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 51238 "gram_minimal.c" break; case 2057: /* a_expr: a_expr ILIKE a_expr */ #line 15161 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "~~*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51247 "gram_minimal.c" break; case 2058: /* a_expr: a_expr ILIKE a_expr ESCAPE a_expr */ #line 15166 "gram_minimal.y" { 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 51260 "gram_minimal.c" break; case 2059: /* a_expr: a_expr NOT_LA ILIKE a_expr */ #line 15175 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "!~~*", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 51269 "gram_minimal.c" break; case 2060: /* a_expr: a_expr NOT_LA ILIKE a_expr ESCAPE a_expr */ #line 15180 "gram_minimal.y" { 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 51282 "gram_minimal.c" break; case 2061: /* a_expr: a_expr SIMILAR TO a_expr */ #line 15190 "gram_minimal.y" { 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 51295 "gram_minimal.c" break; case 2062: /* a_expr: a_expr SIMILAR TO a_expr ESCAPE a_expr */ #line 15199 "gram_minimal.y" { 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 51308 "gram_minimal.c" break; case 2063: /* a_expr: a_expr NOT_LA SIMILAR TO a_expr */ #line 15208 "gram_minimal.y" { 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 51321 "gram_minimal.c" break; case 2064: /* a_expr: a_expr NOT_LA SIMILAR TO a_expr ESCAPE a_expr */ #line 15217 "gram_minimal.y" { 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 51334 "gram_minimal.c" break; case 2065: /* a_expr: a_expr IS NULL_P */ #line 15236 "gram_minimal.y" { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-2].node); n->nulltesttype = IS_NULL; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 51347 "gram_minimal.c" break; case 2066: /* a_expr: a_expr ISNULL */ #line 15245 "gram_minimal.y" { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 51360 "gram_minimal.c" break; case 2067: /* a_expr: a_expr IS NOT NULL_P */ #line 15254 "gram_minimal.y" { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-3].node); n->nulltesttype = IS_NOT_NULL; n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 51373 "gram_minimal.c" break; case 2068: /* a_expr: a_expr NOTNULL */ #line 15263 "gram_minimal.y" { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NOT_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 51386 "gram_minimal.c" break; case 2069: /* a_expr: row OVERLAPS row */ #line 15272 "gram_minimal.y" { 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 51407 "gram_minimal.c" break; case 2070: /* a_expr: a_expr IS TRUE_P */ #line 15289 "gram_minimal.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_TRUE; b->location = (yylsp[-1]); (yyval.node) = (Node *) b; } #line 51420 "gram_minimal.c" break; case 2071: /* a_expr: a_expr IS NOT TRUE_P */ #line 15298 "gram_minimal.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_TRUE; b->location = (yylsp[-2]); (yyval.node) = (Node *) b; } #line 51433 "gram_minimal.c" break; case 2072: /* a_expr: a_expr IS FALSE_P */ #line 15307 "gram_minimal.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_FALSE; b->location = (yylsp[-1]); (yyval.node) = (Node *) b; } #line 51446 "gram_minimal.c" break; case 2073: /* a_expr: a_expr IS NOT FALSE_P */ #line 15316 "gram_minimal.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_FALSE; b->location = (yylsp[-2]); (yyval.node) = (Node *) b; } #line 51459 "gram_minimal.c" break; case 2074: /* a_expr: a_expr IS UNKNOWN */ #line 15325 "gram_minimal.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_UNKNOWN; b->location = (yylsp[-1]); (yyval.node) = (Node *) b; } #line 51472 "gram_minimal.c" break; case 2075: /* a_expr: a_expr IS NOT UNKNOWN */ #line 15334 "gram_minimal.y" { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_UNKNOWN; b->location = (yylsp[-2]); (yyval.node) = (Node *) b; } #line 51485 "gram_minimal.c" break; case 2076: /* a_expr: a_expr IS DISTINCT FROM a_expr */ #line 15343 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 51493 "gram_minimal.c" break; case 2077: /* a_expr: a_expr IS NOT DISTINCT FROM a_expr */ #line 15347 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 51501 "gram_minimal.c" break; case 2078: /* a_expr: a_expr BETWEEN opt_asymmetric b_expr AND a_expr */ #line 15351 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_BETWEEN, "BETWEEN", (yyvsp[-5].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); } #line 51513 "gram_minimal.c" break; case 2079: /* a_expr: a_expr NOT_LA BETWEEN opt_asymmetric b_expr AND a_expr */ #line 15359 "gram_minimal.y" { (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 51525 "gram_minimal.c" break; case 2080: /* a_expr: a_expr BETWEEN SYMMETRIC b_expr AND a_expr */ #line 15367 "gram_minimal.y" { (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 51537 "gram_minimal.c" break; case 2081: /* a_expr: a_expr NOT_LA BETWEEN SYMMETRIC b_expr AND a_expr */ #line 15375 "gram_minimal.y" { (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 51549 "gram_minimal.c" break; case 2082: /* a_expr: a_expr IN_P select_with_parens */ #line 15383 "gram_minimal.y" { /* generate foo = ANY (subquery) */ SubLink *n = makeNode(SubLink); n->subselect = (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; } #line 51566 "gram_minimal.c" break; case 2083: /* a_expr: a_expr IN_P '(' expr_list ')' */ #line 15396 "gram_minimal.y" { /* generate scalar IN expression */ A_Expr *n = makeSimpleA_Expr(AEXPR_IN, "=", (yyvsp[-4].node), (Node *) (yyvsp[-1].list), (yylsp[-3])); n->rexpr_list_start = (yylsp[-2]); n->rexpr_list_end = (yylsp[0]); (yyval.node) = (Node *) n; } #line 51579 "gram_minimal.c" break; case 2084: /* a_expr: a_expr NOT_LA IN_P select_with_parens */ #line 15405 "gram_minimal.y" { /* generate NOT (foo = ANY (subquery)) */ SubLink *n = makeNode(SubLink); n->subselect = (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])); } #line 51597 "gram_minimal.c" break; case 2085: /* a_expr: a_expr NOT_LA IN_P '(' expr_list ')' */ #line 15419 "gram_minimal.y" { /* generate scalar NOT IN expression */ A_Expr *n = makeSimpleA_Expr(AEXPR_IN, "<>", (yyvsp[-5].node), (Node *) (yyvsp[-1].list), (yylsp[-4])); n->rexpr_list_start = (yylsp[-2]); n->rexpr_list_end = (yylsp[0]); (yyval.node) = (Node *) n; } #line 51610 "gram_minimal.c" break; case 2086: /* a_expr: a_expr subquery_Op sub_type select_with_parens */ #line 15428 "gram_minimal.y" { 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 51626 "gram_minimal.c" break; case 2087: /* a_expr: a_expr subquery_Op sub_type '(' a_expr ')' */ #line 15440 "gram_minimal.y" { 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 51637 "gram_minimal.c" break; case 2088: /* a_expr: UNIQUE opt_unique_null_treatment select_with_parens */ #line 15447 "gram_minimal.y" { /* 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 51657 "gram_minimal.c" break; case 2089: /* a_expr: a_expr IS DOCUMENT_P */ #line 15463 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 51666 "gram_minimal.c" break; case 2090: /* a_expr: a_expr IS NOT DOCUMENT_P */ #line 15468 "gram_minimal.y" { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 51676 "gram_minimal.c" break; case 2091: /* a_expr: a_expr IS NORMALIZED */ #line 15474 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make1((yyvsp[-2].node)), COERCE_SQL_SYNTAX, (yylsp[-1])); } #line 51687 "gram_minimal.c" break; case 2092: /* a_expr: a_expr IS unicode_normal_form NORMALIZED */ #line 15481 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make2((yyvsp[-3].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-2])); } #line 51698 "gram_minimal.c" break; case 2093: /* a_expr: a_expr IS NOT NORMALIZED */ #line 15488 "gram_minimal.y" { (yyval.node) = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make1((yyvsp[-3].node)), COERCE_SQL_SYNTAX, (yylsp[-2])), (yylsp[-2])); } #line 51710 "gram_minimal.c" break; case 2094: /* a_expr: a_expr IS NOT unicode_normal_form NORMALIZED */ #line 15496 "gram_minimal.y" { (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 51722 "gram_minimal.c" break; case 2095: /* a_expr: a_expr IS json_predicate_type_constraint json_key_uniqueness_constraint_opt */ #line 15505 "gram_minimal.y" { 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 51732 "gram_minimal.c" break; case 2096: /* a_expr: a_expr IS NOT json_predicate_type_constraint json_key_uniqueness_constraint_opt */ #line 15523 "gram_minimal.y" { 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 51742 "gram_minimal.c" break; case 2097: /* a_expr: DEFAULT */ #line 15540 "gram_minimal.y" { /* * 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 51761 "gram_minimal.c" break; case 2098: /* b_expr: c_expr */ #line 15566 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 51767 "gram_minimal.c" break; case 2099: /* b_expr: b_expr TYPECAST Typename */ #line 15568 "gram_minimal.y" { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 51773 "gram_minimal.c" break; case 2100: /* b_expr: '+' b_expr */ #line 15570 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 51779 "gram_minimal.c" break; case 2101: /* b_expr: '-' b_expr */ #line 15572 "gram_minimal.y" { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 51785 "gram_minimal.c" break; case 2102: /* b_expr: b_expr '+' b_expr */ #line 15574 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51791 "gram_minimal.c" break; case 2103: /* b_expr: b_expr '-' b_expr */ #line 15576 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51797 "gram_minimal.c" break; case 2104: /* b_expr: b_expr '*' b_expr */ #line 15578 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51803 "gram_minimal.c" break; case 2105: /* b_expr: b_expr '/' b_expr */ #line 15580 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51809 "gram_minimal.c" break; case 2106: /* b_expr: b_expr '%' b_expr */ #line 15582 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51815 "gram_minimal.c" break; case 2107: /* b_expr: b_expr '^' b_expr */ #line 15584 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51821 "gram_minimal.c" break; case 2108: /* b_expr: b_expr '<' b_expr */ #line 15586 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51827 "gram_minimal.c" break; case 2109: /* b_expr: b_expr '>' b_expr */ #line 15588 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51833 "gram_minimal.c" break; case 2110: /* b_expr: b_expr '=' b_expr */ #line 15590 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51839 "gram_minimal.c" break; case 2111: /* b_expr: b_expr LESS_EQUALS b_expr */ #line 15592 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51845 "gram_minimal.c" break; case 2112: /* b_expr: b_expr GREATER_EQUALS b_expr */ #line 15594 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51851 "gram_minimal.c" break; case 2113: /* b_expr: b_expr NOT_EQUALS b_expr */ #line 15596 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51857 "gram_minimal.c" break; case 2114: /* b_expr: b_expr qual_Op b_expr */ #line 15598 "gram_minimal.y" { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 51863 "gram_minimal.c" break; case 2115: /* b_expr: qual_Op b_expr */ #line 15600 "gram_minimal.y" { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 51869 "gram_minimal.c" break; case 2116: /* b_expr: b_expr IS DISTINCT FROM b_expr */ #line 15602 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 51877 "gram_minimal.c" break; case 2117: /* b_expr: b_expr IS NOT DISTINCT FROM b_expr */ #line 15606 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 51885 "gram_minimal.c" break; case 2118: /* b_expr: b_expr IS DOCUMENT_P */ #line 15610 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 51894 "gram_minimal.c" break; case 2119: /* b_expr: b_expr IS NOT DOCUMENT_P */ #line 15615 "gram_minimal.y" { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 51904 "gram_minimal.c" break; case 2120: /* c_expr: columnref */ #line 15630 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 51910 "gram_minimal.c" break; case 2121: /* c_expr: AexprConst */ #line 15631 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 51916 "gram_minimal.c" break; case 2122: /* c_expr: PARAM opt_indirection */ #line 15633 "gram_minimal.y" { 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 51937 "gram_minimal.c" break; case 2123: /* c_expr: '(' a_expr ')' opt_indirection */ #line 15650 "gram_minimal.y" { 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 51954 "gram_minimal.c" break; case 2124: /* c_expr: case_expr */ #line 15663 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 51960 "gram_minimal.c" break; case 2125: /* c_expr: func_expr */ #line 15665 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 51966 "gram_minimal.c" break; case 2126: /* c_expr: select_with_parens */ #line 15667 "gram_minimal.y" { 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 51982 "gram_minimal.c" break; case 2127: /* c_expr: select_with_parens indirection */ #line 15679 "gram_minimal.y" { /* * 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 52011 "gram_minimal.c" break; case 2128: /* c_expr: EXISTS select_with_parens */ #line 15704 "gram_minimal.y" { 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 52027 "gram_minimal.c" break; case 2129: /* c_expr: ARRAY select_with_parens */ #line 15716 "gram_minimal.y" { 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 52043 "gram_minimal.c" break; case 2130: /* c_expr: ARRAY array_expr */ #line 15728 "gram_minimal.y" { 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 52055 "gram_minimal.c" break; case 2131: /* c_expr: explicit_row */ #line 15736 "gram_minimal.y" { 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 52070 "gram_minimal.c" break; case 2132: /* c_expr: implicit_row */ #line 15747 "gram_minimal.y" { 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 52085 "gram_minimal.c" break; case 2133: /* c_expr: GROUPING '(' expr_list ')' */ #line 15758 "gram_minimal.y" { GroupingFunc *g = makeNode(GroupingFunc); g->args = (yyvsp[-1].list); g->location = (yylsp[-3]); (yyval.node) = (Node *) g; } #line 52097 "gram_minimal.c" break; case 2134: /* func_application: func_name '(' ')' */ #line 15768 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall((yyvsp[-2].list), NIL, COERCE_EXPLICIT_CALL, (yylsp[-2])); } #line 52107 "gram_minimal.c" break; case 2135: /* func_application: func_name '(' func_arg_list opt_sort_clause ')' */ #line 15774 "gram_minimal.y" { 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 52120 "gram_minimal.c" break; case 2136: /* func_application: func_name '(' VARIADIC func_arg_expr opt_sort_clause ')' */ #line 15783 "gram_minimal.y" { 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 52134 "gram_minimal.c" break; case 2137: /* func_application: func_name '(' func_arg_list ',' VARIADIC func_arg_expr opt_sort_clause ')' */ #line 15793 "gram_minimal.y" { 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 52148 "gram_minimal.c" break; case 2138: /* func_application: func_name '(' ALL func_arg_list opt_sort_clause ')' */ #line 15803 "gram_minimal.y" { 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 52165 "gram_minimal.c" break; case 2139: /* func_application: func_name '(' DISTINCT func_arg_list opt_sort_clause ')' */ #line 15816 "gram_minimal.y" { 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 52179 "gram_minimal.c" break; case 2140: /* func_application: func_name '(' '*' ')' */ #line 15826 "gram_minimal.y" { /* * 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 52202 "gram_minimal.c" break; case 2141: /* func_expr: func_application within_group_clause filter_clause over_clause */ #line 15857 "gram_minimal.y" { 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 52242 "gram_minimal.c" break; case 2142: /* func_expr: json_aggregate_func filter_clause over_clause */ #line 15893 "gram_minimal.y" { 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 52256 "gram_minimal.c" break; case 2143: /* func_expr: func_expr_common_subexpr */ #line 15903 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 52262 "gram_minimal.c" break; case 2144: /* func_expr_windowless: func_application */ #line 15913 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 52268 "gram_minimal.c" break; case 2145: /* func_expr_windowless: func_expr_common_subexpr */ #line 15914 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 52274 "gram_minimal.c" break; case 2146: /* func_expr_windowless: json_aggregate_func */ #line 15915 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 52280 "gram_minimal.c" break; case 2147: /* func_expr_common_subexpr: COLLATION FOR '(' a_expr ')' */ #line 15923 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"), list_make1((yyvsp[-1].node)), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 52291 "gram_minimal.c" break; case 2148: /* func_expr_common_subexpr: CURRENT_DATE */ #line 15930 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_DATE, -1, (yylsp[0])); } #line 52299 "gram_minimal.c" break; case 2149: /* func_expr_common_subexpr: CURRENT_TIME */ #line 15934 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME, -1, (yylsp[0])); } #line 52307 "gram_minimal.c" break; case 2150: /* func_expr_common_subexpr: CURRENT_TIME '(' Iconst ')' */ #line 15938 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 52315 "gram_minimal.c" break; case 2151: /* func_expr_common_subexpr: CURRENT_TIMESTAMP */ #line 15942 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP, -1, (yylsp[0])); } #line 52323 "gram_minimal.c" break; case 2152: /* func_expr_common_subexpr: CURRENT_TIMESTAMP '(' Iconst ')' */ #line 15946 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 52331 "gram_minimal.c" break; case 2153: /* func_expr_common_subexpr: LOCALTIME */ #line 15950 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME, -1, (yylsp[0])); } #line 52339 "gram_minimal.c" break; case 2154: /* func_expr_common_subexpr: LOCALTIME '(' Iconst ')' */ #line 15954 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 52347 "gram_minimal.c" break; case 2155: /* func_expr_common_subexpr: LOCALTIMESTAMP */ #line 15958 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP, -1, (yylsp[0])); } #line 52355 "gram_minimal.c" break; case 2156: /* func_expr_common_subexpr: LOCALTIMESTAMP '(' Iconst ')' */ #line 15962 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 52363 "gram_minimal.c" break; case 2157: /* func_expr_common_subexpr: CURRENT_ROLE */ #line 15966 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_ROLE, -1, (yylsp[0])); } #line 52371 "gram_minimal.c" break; case 2158: /* func_expr_common_subexpr: CURRENT_USER */ #line 15970 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_USER, -1, (yylsp[0])); } #line 52379 "gram_minimal.c" break; case 2159: /* func_expr_common_subexpr: SESSION_USER */ #line 15974 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_SESSION_USER, -1, (yylsp[0])); } #line 52387 "gram_minimal.c" break; case 2160: /* func_expr_common_subexpr: SYSTEM_USER */ #line 15978 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("system_user"), NIL, COERCE_SQL_SYNTAX, (yylsp[0])); } #line 52398 "gram_minimal.c" break; case 2161: /* func_expr_common_subexpr: USER */ #line 15985 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_USER, -1, (yylsp[0])); } #line 52406 "gram_minimal.c" break; case 2162: /* func_expr_common_subexpr: CURRENT_CATALOG */ #line 15989 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_CATALOG, -1, (yylsp[0])); } #line 52414 "gram_minimal.c" break; case 2163: /* func_expr_common_subexpr: CURRENT_SCHEMA */ #line 15993 "gram_minimal.y" { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_SCHEMA, -1, (yylsp[0])); } #line 52422 "gram_minimal.c" break; case 2164: /* func_expr_common_subexpr: CAST '(' a_expr AS Typename ')' */ #line 15997 "gram_minimal.y" { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), (yylsp[-5])); } #line 52428 "gram_minimal.c" break; case 2165: /* func_expr_common_subexpr: EXTRACT '(' extract_list ')' */ #line 15999 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("extract"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 52439 "gram_minimal.c" break; case 2166: /* func_expr_common_subexpr: NORMALIZE '(' a_expr ')' */ #line 16006 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("normalize"), list_make1((yyvsp[-1].node)), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 52450 "gram_minimal.c" break; case 2167: /* func_expr_common_subexpr: NORMALIZE '(' a_expr ',' unicode_normal_form ')' */ #line 16013 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("normalize"), list_make2((yyvsp[-3].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-5])); } #line 52461 "gram_minimal.c" break; case 2168: /* func_expr_common_subexpr: OVERLAY '(' overlay_list ')' */ #line 16020 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("overlay"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 52472 "gram_minimal.c" break; case 2169: /* func_expr_common_subexpr: OVERLAY '(' func_arg_list_opt ')' */ #line 16027 "gram_minimal.y" { /* * 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 52487 "gram_minimal.c" break; case 2170: /* func_expr_common_subexpr: POSITION '(' position_list ')' */ #line 16038 "gram_minimal.y" { /* * 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 52505 "gram_minimal.c" break; case 2171: /* func_expr_common_subexpr: SUBSTRING '(' substr_list ')' */ #line 16052 "gram_minimal.y" { /* 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 52519 "gram_minimal.c" break; case 2172: /* func_expr_common_subexpr: SUBSTRING '(' func_arg_list_opt ')' */ #line 16062 "gram_minimal.y" { /* * 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 52534 "gram_minimal.c" break; case 2173: /* func_expr_common_subexpr: TREAT '(' a_expr AS Typename ')' */ #line 16073 "gram_minimal.y" { /* 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 52554 "gram_minimal.c" break; case 2174: /* func_expr_common_subexpr: TRIM '(' BOTH trim_list ')' */ #line 16089 "gram_minimal.y" { /* 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 52568 "gram_minimal.c" break; case 2175: /* func_expr_common_subexpr: TRIM '(' LEADING trim_list ')' */ #line 16099 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 52579 "gram_minimal.c" break; case 2176: /* func_expr_common_subexpr: TRIM '(' TRAILING trim_list ')' */ #line 16106 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 52590 "gram_minimal.c" break; case 2177: /* func_expr_common_subexpr: TRIM '(' trim_list ')' */ #line 16113 "gram_minimal.y" { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("btrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 52601 "gram_minimal.c" break; case 2178: /* func_expr_common_subexpr: NULLIF '(' a_expr ',' a_expr ')' */ #line 16120 "gram_minimal.y" { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NULLIF, "=", (yyvsp[-3].node), (yyvsp[-1].node), (yylsp[-5])); } #line 52609 "gram_minimal.c" break; case 2179: /* func_expr_common_subexpr: COALESCE '(' expr_list ')' */ #line 16124 "gram_minimal.y" { CoalesceExpr *c = makeNode(CoalesceExpr); c->args = (yyvsp[-1].list); c->location = (yylsp[-3]); (yyval.node) = (Node *) c; } #line 52621 "gram_minimal.c" break; case 2180: /* func_expr_common_subexpr: GREATEST '(' expr_list ')' */ #line 16132 "gram_minimal.y" { MinMaxExpr *v = makeNode(MinMaxExpr); v->args = (yyvsp[-1].list); v->op = IS_GREATEST; v->location = (yylsp[-3]); (yyval.node) = (Node *) v; } #line 52634 "gram_minimal.c" break; case 2181: /* func_expr_common_subexpr: LEAST '(' expr_list ')' */ #line 16141 "gram_minimal.y" { MinMaxExpr *v = makeNode(MinMaxExpr); v->args = (yyvsp[-1].list); v->op = IS_LEAST; v->location = (yylsp[-3]); (yyval.node) = (Node *) v; } #line 52647 "gram_minimal.c" break; case 2182: /* func_expr_common_subexpr: XMLCONCAT '(' expr_list ')' */ #line 16150 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLCONCAT, NULL, NIL, (yyvsp[-1].list), (yylsp[-3])); } #line 52655 "gram_minimal.c" break; case 2183: /* func_expr_common_subexpr: XMLELEMENT '(' NAME_P ColLabel ')' */ #line 16154 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-1].str), NIL, NIL, (yylsp[-4])); } #line 52663 "gram_minimal.c" break; case 2184: /* func_expr_common_subexpr: XMLELEMENT '(' NAME_P ColLabel ',' xml_attributes ')' */ #line 16158 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), (yyvsp[-1].list), NIL, (yylsp[-6])); } #line 52671 "gram_minimal.c" break; case 2185: /* func_expr_common_subexpr: XMLELEMENT '(' NAME_P ColLabel ',' expr_list ')' */ #line 16162 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), NIL, (yyvsp[-1].list), (yylsp[-6])); } #line 52679 "gram_minimal.c" break; case 2186: /* func_expr_common_subexpr: XMLELEMENT '(' NAME_P ColLabel ',' xml_attributes ',' expr_list ')' */ #line 16166 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-5].str), (yyvsp[-3].list), (yyvsp[-1].list), (yylsp[-8])); } #line 52687 "gram_minimal.c" break; case 2187: /* func_expr_common_subexpr: XMLEXISTS '(' c_expr xmlexists_argument ')' */ #line 16170 "gram_minimal.y" { /* 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 52700 "gram_minimal.c" break; case 2188: /* func_expr_common_subexpr: XMLFOREST '(' xml_attribute_list ')' */ #line 16179 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLFOREST, NULL, (yyvsp[-1].list), NIL, (yylsp[-3])); } #line 52708 "gram_minimal.c" break; case 2189: /* func_expr_common_subexpr: XMLPARSE '(' document_or_content a_expr xml_whitespace_option ')' */ #line 16183 "gram_minimal.y" { 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 52722 "gram_minimal.c" break; case 2190: /* func_expr_common_subexpr: XMLPI '(' NAME_P ColLabel ')' */ #line 16193 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-1].str), NULL, NIL, (yylsp[-4])); } #line 52730 "gram_minimal.c" break; case 2191: /* func_expr_common_subexpr: XMLPI '(' NAME_P ColLabel ',' a_expr ')' */ #line 16197 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-3].str), NULL, list_make1((yyvsp[-1].node)), (yylsp[-6])); } #line 52738 "gram_minimal.c" break; case 2192: /* func_expr_common_subexpr: XMLROOT '(' a_expr ',' xml_root_version opt_xml_root_standalone ')' */ #line 16201 "gram_minimal.y" { (yyval.node) = makeXmlExpr(IS_XMLROOT, NULL, NIL, list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node)), (yylsp[-6])); } #line 52747 "gram_minimal.c" break; case 2193: /* func_expr_common_subexpr: XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')' */ #line 16206 "gram_minimal.y" { 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 52762 "gram_minimal.c" break; case 2194: /* func_expr_common_subexpr: JSON_OBJECT '(' func_arg_list ')' */ #line 16217 "gram_minimal.y" { /* Support for legacy (non-standard) json_object() */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("json_object"), (yyvsp[-1].list), COERCE_EXPLICIT_CALL, (yylsp[-3])); } #line 52772 "gram_minimal.c" break; case 2195: /* func_expr_common_subexpr: JSON_OBJECT '(' json_name_and_value_list json_object_constructor_null_clause_opt json_key_uniqueness_constraint_opt json_returning_clause_opt ')' */ #line 16226 "gram_minimal.y" { 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 52787 "gram_minimal.c" break; case 2196: /* func_expr_common_subexpr: JSON_OBJECT '(' json_returning_clause_opt ')' */ #line 16237 "gram_minimal.y" { 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 52802 "gram_minimal.c" break; case 2197: /* func_expr_common_subexpr: JSON_ARRAY '(' json_value_expr_list json_array_constructor_null_clause_opt json_returning_clause_opt ')' */ #line 16252 "gram_minimal.y" { 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 52816 "gram_minimal.c" break; case 2198: /* func_expr_common_subexpr: JSON_ARRAY '(' select_no_parens json_format_clause_opt json_returning_clause_opt ')' */ #line 16267 "gram_minimal.y" { 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 52831 "gram_minimal.c" break; case 2199: /* func_expr_common_subexpr: JSON_ARRAY '(' json_returning_clause_opt ')' */ #line 16280 "gram_minimal.y" { 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 52845 "gram_minimal.c" break; case 2200: /* func_expr_common_subexpr: JSON '(' json_value_expr json_key_uniqueness_constraint_opt ')' */ #line 16290 "gram_minimal.y" { 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 52859 "gram_minimal.c" break; case 2201: /* func_expr_common_subexpr: JSON_SCALAR '(' a_expr ')' */ #line 16300 "gram_minimal.y" { JsonScalarExpr *n = makeNode(JsonScalarExpr); n->expr = (Expr *) (yyvsp[-1].node); n->output = NULL; n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 52872 "gram_minimal.c" break; case 2202: /* func_expr_common_subexpr: JSON_SERIALIZE '(' json_value_expr json_returning_clause_opt ')' */ #line 16309 "gram_minimal.y" { 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 52885 "gram_minimal.c" break; case 2203: /* func_expr_common_subexpr: MERGE_ACTION '(' ')' */ #line 16318 "gram_minimal.y" { MergeSupportFunc *m = makeNode(MergeSupportFunc); m->msftype = TEXTOID; m->location = (yylsp[-2]); (yyval.node) = (Node *) m; } #line 52897 "gram_minimal.c" break; case 2204: /* func_expr_common_subexpr: JSON_QUERY '(' json_value_expr ',' a_expr json_passing_clause_opt json_returning_clause_opt json_wrapper_behavior json_quotes_clause_opt json_behavior_clause_opt ')' */ #line 16332 "gram_minimal.y" { 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 52917 "gram_minimal.c" break; case 2205: /* func_expr_common_subexpr: JSON_EXISTS '(' json_value_expr ',' a_expr json_passing_clause_opt json_on_error_clause_opt ')' */ #line 16351 "gram_minimal.y" { 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 52934 "gram_minimal.c" break; case 2206: /* func_expr_common_subexpr: JSON_VALUE '(' json_value_expr ',' a_expr json_passing_clause_opt json_returning_clause_opt json_behavior_clause_opt ')' */ #line 16368 "gram_minimal.y" { 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 52952 "gram_minimal.c" break; case 2207: /* xml_root_version: VERSION_P a_expr */ #line 16388 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 52958 "gram_minimal.c" break; case 2208: /* xml_root_version: VERSION_P NO VALUE_P */ #line 16390 "gram_minimal.y" { (yyval.node) = makeNullAConst(-1); } #line 52964 "gram_minimal.c" break; case 2209: /* opt_xml_root_standalone: ',' STANDALONE_P YES_P */ #line 16394 "gram_minimal.y" { (yyval.node) = makeIntConst(XML_STANDALONE_YES, -1); } #line 52970 "gram_minimal.c" break; case 2210: /* opt_xml_root_standalone: ',' STANDALONE_P NO */ #line 16396 "gram_minimal.y" { (yyval.node) = makeIntConst(XML_STANDALONE_NO, -1); } #line 52976 "gram_minimal.c" break; case 2211: /* opt_xml_root_standalone: ',' STANDALONE_P NO VALUE_P */ #line 16398 "gram_minimal.y" { (yyval.node) = makeIntConst(XML_STANDALONE_NO_VALUE, -1); } #line 52982 "gram_minimal.c" break; case 2212: /* opt_xml_root_standalone: %empty */ #line 16400 "gram_minimal.y" { (yyval.node) = makeIntConst(XML_STANDALONE_OMITTED, -1); } #line 52988 "gram_minimal.c" break; case 2213: /* xml_attributes: XMLATTRIBUTES '(' xml_attribute_list ')' */ #line 16403 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 52994 "gram_minimal.c" break; case 2214: /* xml_attribute_list: xml_attribute_el */ #line 16406 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 53000 "gram_minimal.c" break; case 2215: /* xml_attribute_list: xml_attribute_list ',' xml_attribute_el */ #line 16407 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 53006 "gram_minimal.c" break; case 2216: /* xml_attribute_el: a_expr AS ColLabel */ #line 16411 "gram_minimal.y" { (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 53018 "gram_minimal.c" break; case 2217: /* xml_attribute_el: a_expr */ #line 16419 "gram_minimal.y" { (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 53030 "gram_minimal.c" break; case 2218: /* document_or_content: DOCUMENT_P */ #line 16428 "gram_minimal.y" { (yyval.ival) = XMLOPTION_DOCUMENT; } #line 53036 "gram_minimal.c" break; case 2219: /* document_or_content: CONTENT_P */ #line 16429 "gram_minimal.y" { (yyval.ival) = XMLOPTION_CONTENT; } #line 53042 "gram_minimal.c" break; case 2220: /* xml_indent_option: INDENT */ #line 16432 "gram_minimal.y" { (yyval.boolean) = true; } #line 53048 "gram_minimal.c" break; case 2221: /* xml_indent_option: NO INDENT */ #line 16433 "gram_minimal.y" { (yyval.boolean) = false; } #line 53054 "gram_minimal.c" break; case 2222: /* xml_indent_option: %empty */ #line 16434 "gram_minimal.y" { (yyval.boolean) = false; } #line 53060 "gram_minimal.c" break; case 2223: /* xml_whitespace_option: PRESERVE WHITESPACE_P */ #line 16437 "gram_minimal.y" { (yyval.boolean) = true; } #line 53066 "gram_minimal.c" break; case 2224: /* xml_whitespace_option: STRIP_P WHITESPACE_P */ #line 16438 "gram_minimal.y" { (yyval.boolean) = false; } #line 53072 "gram_minimal.c" break; case 2225: /* xml_whitespace_option: %empty */ #line 16439 "gram_minimal.y" { (yyval.boolean) = false; } #line 53078 "gram_minimal.c" break; case 2226: /* xmlexists_argument: PASSING c_expr */ #line 16445 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 53086 "gram_minimal.c" break; case 2227: /* xmlexists_argument: PASSING c_expr xml_passing_mech */ #line 16449 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 53094 "gram_minimal.c" break; case 2228: /* xmlexists_argument: PASSING xml_passing_mech c_expr */ #line 16453 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 53102 "gram_minimal.c" break; case 2229: /* xmlexists_argument: PASSING xml_passing_mech c_expr xml_passing_mech */ #line 16457 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 53110 "gram_minimal.c" break; case 2232: /* within_group_clause: WITHIN GROUP_P '(' sort_clause ')' */ #line 16472 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 53116 "gram_minimal.c" break; case 2233: /* within_group_clause: %empty */ #line 16473 "gram_minimal.y" { (yyval.list) = NIL; } #line 53122 "gram_minimal.c" break; case 2234: /* filter_clause: FILTER '(' WHERE a_expr ')' */ #line 16477 "gram_minimal.y" { (yyval.node) = (yyvsp[-1].node); } #line 53128 "gram_minimal.c" break; case 2235: /* filter_clause: %empty */ #line 16478 "gram_minimal.y" { (yyval.node) = NULL; } #line 53134 "gram_minimal.c" break; case 2236: /* window_clause: WINDOW window_definition_list */ #line 16486 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 53140 "gram_minimal.c" break; case 2237: /* window_clause: %empty */ #line 16487 "gram_minimal.y" { (yyval.list) = NIL; } #line 53146 "gram_minimal.c" break; case 2238: /* window_definition_list: window_definition */ #line 16491 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].windef)); } #line 53152 "gram_minimal.c" break; case 2239: /* window_definition_list: window_definition_list ',' window_definition */ #line 16493 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].windef)); } #line 53158 "gram_minimal.c" break; case 2240: /* window_definition: ColId AS window_specification */ #line 16498 "gram_minimal.y" { WindowDef *n = (yyvsp[0].windef); n->name = (yyvsp[-2].str); (yyval.windef) = n; } #line 53169 "gram_minimal.c" break; case 2241: /* over_clause: OVER window_specification */ #line 16507 "gram_minimal.y" { (yyval.windef) = (yyvsp[0].windef); } #line 53175 "gram_minimal.c" break; case 2242: /* over_clause: OVER ColId */ #line 16509 "gram_minimal.y" { 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 53193 "gram_minimal.c" break; case 2243: /* over_clause: %empty */ #line 16523 "gram_minimal.y" { (yyval.windef) = NULL; } #line 53199 "gram_minimal.c" break; case 2244: /* window_specification: '(' opt_existing_window_name opt_partition_clause opt_sort_clause opt_frame_clause ')' */ #line 16528 "gram_minimal.y" { 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 53218 "gram_minimal.c" break; case 2245: /* opt_existing_window_name: ColId */ #line 16554 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 53224 "gram_minimal.c" break; case 2246: /* opt_existing_window_name: %empty */ #line 16555 "gram_minimal.y" { (yyval.str) = NULL; } #line 53230 "gram_minimal.c" break; case 2247: /* opt_partition_clause: PARTITION BY expr_list */ #line 16558 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 53236 "gram_minimal.c" break; case 2248: /* opt_partition_clause: %empty */ #line 16559 "gram_minimal.y" { (yyval.list) = NIL; } #line 53242 "gram_minimal.c" break; case 2249: /* opt_frame_clause: RANGE frame_extent opt_window_exclusion_clause */ #line 16568 "gram_minimal.y" { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_RANGE; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 53254 "gram_minimal.c" break; case 2250: /* opt_frame_clause: ROWS frame_extent opt_window_exclusion_clause */ #line 16576 "gram_minimal.y" { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_ROWS; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 53266 "gram_minimal.c" break; case 2251: /* opt_frame_clause: GROUPS frame_extent opt_window_exclusion_clause */ #line 16584 "gram_minimal.y" { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_GROUPS; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 53278 "gram_minimal.c" break; case 2252: /* opt_frame_clause: %empty */ #line 16592 "gram_minimal.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 53291 "gram_minimal.c" break; case 2253: /* frame_extent: frame_bound */ #line 16603 "gram_minimal.y" { 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 53313 "gram_minimal.c" break; case 2254: /* frame_extent: BETWEEN frame_bound AND frame_bound */ #line 16621 "gram_minimal.y" { 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 53355 "gram_minimal.c" break; case 2255: /* frame_bound: UNBOUNDED PRECEDING */ #line 16667 "gram_minimal.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_PRECEDING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 53368 "gram_minimal.c" break; case 2256: /* frame_bound: UNBOUNDED FOLLOWING */ #line 16676 "gram_minimal.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_FOLLOWING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 53381 "gram_minimal.c" break; case 2257: /* frame_bound: CURRENT_P ROW */ #line 16685 "gram_minimal.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_CURRENT_ROW; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 53394 "gram_minimal.c" break; case 2258: /* frame_bound: a_expr PRECEDING */ #line 16694 "gram_minimal.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_PRECEDING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 53407 "gram_minimal.c" break; case 2259: /* frame_bound: a_expr FOLLOWING */ #line 16703 "gram_minimal.y" { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_FOLLOWING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 53420 "gram_minimal.c" break; case 2260: /* opt_window_exclusion_clause: EXCLUDE CURRENT_P ROW */ #line 16714 "gram_minimal.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; } #line 53426 "gram_minimal.c" break; case 2261: /* opt_window_exclusion_clause: EXCLUDE GROUP_P */ #line 16715 "gram_minimal.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; } #line 53432 "gram_minimal.c" break; case 2262: /* opt_window_exclusion_clause: EXCLUDE TIES */ #line 16716 "gram_minimal.y" { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; } #line 53438 "gram_minimal.c" break; case 2263: /* opt_window_exclusion_clause: EXCLUDE NO OTHERS */ #line 16717 "gram_minimal.y" { (yyval.ival) = 0; } #line 53444 "gram_minimal.c" break; case 2264: /* opt_window_exclusion_clause: %empty */ #line 16718 "gram_minimal.y" { (yyval.ival) = 0; } #line 53450 "gram_minimal.c" break; case 2265: /* row: ROW '(' expr_list ')' */ #line 16732 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 53456 "gram_minimal.c" break; case 2266: /* row: ROW '(' ')' */ #line 16733 "gram_minimal.y" { (yyval.list) = NIL; } #line 53462 "gram_minimal.c" break; case 2267: /* row: '(' expr_list ',' a_expr ')' */ #line 16734 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 53468 "gram_minimal.c" break; case 2268: /* explicit_row: ROW '(' expr_list ')' */ #line 16737 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 53474 "gram_minimal.c" break; case 2269: /* explicit_row: ROW '(' ')' */ #line 16738 "gram_minimal.y" { (yyval.list) = NIL; } #line 53480 "gram_minimal.c" break; case 2270: /* implicit_row: '(' expr_list ',' a_expr ')' */ #line 16741 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 53486 "gram_minimal.c" break; case 2271: /* sub_type: ANY */ #line 16744 "gram_minimal.y" { (yyval.ival) = ANY_SUBLINK; } #line 53492 "gram_minimal.c" break; case 2272: /* sub_type: SOME */ #line 16745 "gram_minimal.y" { (yyval.ival) = ANY_SUBLINK; } #line 53498 "gram_minimal.c" break; case 2273: /* sub_type: ALL */ #line 16746 "gram_minimal.y" { (yyval.ival) = ALL_SUBLINK; } #line 53504 "gram_minimal.c" break; case 2274: /* all_Op: Op */ #line 16749 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 53510 "gram_minimal.c" break; case 2275: /* all_Op: MathOp */ #line 16750 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 53516 "gram_minimal.c" break; case 2276: /* MathOp: '+' */ #line 16753 "gram_minimal.y" { (yyval.str) = "+"; } #line 53522 "gram_minimal.c" break; case 2277: /* MathOp: '-' */ #line 16754 "gram_minimal.y" { (yyval.str) = "-"; } #line 53528 "gram_minimal.c" break; case 2278: /* MathOp: '*' */ #line 16755 "gram_minimal.y" { (yyval.str) = "*"; } #line 53534 "gram_minimal.c" break; case 2279: /* MathOp: '/' */ #line 16756 "gram_minimal.y" { (yyval.str) = "/"; } #line 53540 "gram_minimal.c" break; case 2280: /* MathOp: '%' */ #line 16757 "gram_minimal.y" { (yyval.str) = "%"; } #line 53546 "gram_minimal.c" break; case 2281: /* MathOp: '^' */ #line 16758 "gram_minimal.y" { (yyval.str) = "^"; } #line 53552 "gram_minimal.c" break; case 2282: /* MathOp: '<' */ #line 16759 "gram_minimal.y" { (yyval.str) = "<"; } #line 53558 "gram_minimal.c" break; case 2283: /* MathOp: '>' */ #line 16760 "gram_minimal.y" { (yyval.str) = ">"; } #line 53564 "gram_minimal.c" break; case 2284: /* MathOp: '=' */ #line 16761 "gram_minimal.y" { (yyval.str) = "="; } #line 53570 "gram_minimal.c" break; case 2285: /* MathOp: LESS_EQUALS */ #line 16762 "gram_minimal.y" { (yyval.str) = "<="; } #line 53576 "gram_minimal.c" break; case 2286: /* MathOp: GREATER_EQUALS */ #line 16763 "gram_minimal.y" { (yyval.str) = ">="; } #line 53582 "gram_minimal.c" break; case 2287: /* MathOp: NOT_EQUALS */ #line 16764 "gram_minimal.y" { (yyval.str) = "<>"; } #line 53588 "gram_minimal.c" break; case 2288: /* qual_Op: Op */ #line 16768 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 53594 "gram_minimal.c" break; case 2289: /* qual_Op: OPERATOR '(' any_operator ')' */ #line 16770 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 53600 "gram_minimal.c" break; case 2290: /* qual_all_Op: all_Op */ #line 16775 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 53606 "gram_minimal.c" break; case 2291: /* qual_all_Op: OPERATOR '(' any_operator ')' */ #line 16777 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 53612 "gram_minimal.c" break; case 2292: /* subquery_Op: all_Op */ #line 16782 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 53618 "gram_minimal.c" break; case 2293: /* subquery_Op: OPERATOR '(' any_operator ')' */ #line 16784 "gram_minimal.y" { (yyval.list) = (yyvsp[-1].list); } #line 53624 "gram_minimal.c" break; case 2294: /* subquery_Op: LIKE */ #line 16786 "gram_minimal.y" { (yyval.list) = list_make1(makeString("~~")); } #line 53630 "gram_minimal.c" break; case 2295: /* subquery_Op: NOT_LA LIKE */ #line 16788 "gram_minimal.y" { (yyval.list) = list_make1(makeString("!~~")); } #line 53636 "gram_minimal.c" break; case 2296: /* subquery_Op: ILIKE */ #line 16790 "gram_minimal.y" { (yyval.list) = list_make1(makeString("~~*")); } #line 53642 "gram_minimal.c" break; case 2297: /* subquery_Op: NOT_LA ILIKE */ #line 16792 "gram_minimal.y" { (yyval.list) = list_make1(makeString("!~~*")); } #line 53648 "gram_minimal.c" break; case 2298: /* expr_list: a_expr */ #line 16804 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53656 "gram_minimal.c" break; case 2299: /* expr_list: expr_list ',' a_expr */ #line 16808 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 53664 "gram_minimal.c" break; case 2300: /* func_arg_list: func_arg_expr */ #line 16815 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53672 "gram_minimal.c" break; case 2301: /* func_arg_list: func_arg_list ',' func_arg_expr */ #line 16819 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 53680 "gram_minimal.c" break; case 2302: /* func_arg_expr: a_expr */ #line 16825 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 53688 "gram_minimal.c" break; case 2303: /* func_arg_expr: param_name COLON_EQUALS a_expr */ #line 16829 "gram_minimal.y" { 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 53702 "gram_minimal.c" break; case 2304: /* func_arg_expr: param_name EQUALS_GREATER a_expr */ #line 16839 "gram_minimal.y" { 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 53716 "gram_minimal.c" break; case 2305: /* func_arg_list_opt: func_arg_list */ #line 16850 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 53722 "gram_minimal.c" break; case 2306: /* func_arg_list_opt: %empty */ #line 16851 "gram_minimal.y" { (yyval.list) = NIL; } #line 53728 "gram_minimal.c" break; case 2307: /* type_list: Typename */ #line 16854 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 53734 "gram_minimal.c" break; case 2308: /* type_list: type_list ',' Typename */ #line 16855 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 53740 "gram_minimal.c" break; case 2309: /* array_expr: '[' expr_list ']' */ #line 16859 "gram_minimal.y" { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2]), (yylsp[0])); } #line 53748 "gram_minimal.c" break; case 2310: /* array_expr: '[' array_expr_list ']' */ #line 16863 "gram_minimal.y" { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2]), (yylsp[0])); } #line 53756 "gram_minimal.c" break; case 2311: /* array_expr: '[' ']' */ #line 16867 "gram_minimal.y" { (yyval.node) = makeAArrayExpr(NIL, (yylsp[-1]), (yylsp[0])); } #line 53764 "gram_minimal.c" break; case 2312: /* array_expr_list: array_expr */ #line 16872 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53770 "gram_minimal.c" break; case 2313: /* array_expr_list: array_expr_list ',' array_expr */ #line 16873 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 53776 "gram_minimal.c" break; case 2314: /* extract_list: extract_arg FROM a_expr */ #line 16879 "gram_minimal.y" { (yyval.list) = list_make2(makeStringConst((yyvsp[-2].str), (yylsp[-2])), (yyvsp[0].node)); } #line 53784 "gram_minimal.c" break; case 2315: /* extract_arg: IDENT */ #line 16888 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 53790 "gram_minimal.c" break; case 2316: /* extract_arg: YEAR_P */ #line 16889 "gram_minimal.y" { (yyval.str) = "year"; } #line 53796 "gram_minimal.c" break; case 2317: /* extract_arg: MONTH_P */ #line 16890 "gram_minimal.y" { (yyval.str) = "month"; } #line 53802 "gram_minimal.c" break; case 2318: /* extract_arg: DAY_P */ #line 16891 "gram_minimal.y" { (yyval.str) = "day"; } #line 53808 "gram_minimal.c" break; case 2319: /* extract_arg: HOUR_P */ #line 16892 "gram_minimal.y" { (yyval.str) = "hour"; } #line 53814 "gram_minimal.c" break; case 2320: /* extract_arg: MINUTE_P */ #line 16893 "gram_minimal.y" { (yyval.str) = "minute"; } #line 53820 "gram_minimal.c" break; case 2321: /* extract_arg: SECOND_P */ #line 16894 "gram_minimal.y" { (yyval.str) = "second"; } #line 53826 "gram_minimal.c" break; case 2322: /* extract_arg: Sconst */ #line 16895 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 53832 "gram_minimal.c" break; case 2323: /* unicode_normal_form: NFC */ #line 16899 "gram_minimal.y" { (yyval.str) = "NFC"; } #line 53838 "gram_minimal.c" break; case 2324: /* unicode_normal_form: NFD */ #line 16900 "gram_minimal.y" { (yyval.str) = "NFD"; } #line 53844 "gram_minimal.c" break; case 2325: /* unicode_normal_form: NFKC */ #line 16901 "gram_minimal.y" { (yyval.str) = "NFKC"; } #line 53850 "gram_minimal.c" break; case 2326: /* unicode_normal_form: NFKD */ #line 16902 "gram_minimal.y" { (yyval.str) = "NFKD"; } #line 53856 "gram_minimal.c" break; case 2327: /* overlay_list: a_expr PLACING a_expr FROM a_expr FOR a_expr */ #line 16908 "gram_minimal.y" { /* 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 53865 "gram_minimal.c" break; case 2328: /* overlay_list: a_expr PLACING a_expr FROM a_expr */ #line 16913 "gram_minimal.y" { /* 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 53874 "gram_minimal.c" break; case 2329: /* position_list: b_expr IN_P b_expr */ #line 16921 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-2].node)); } #line 53880 "gram_minimal.c" break; case 2330: /* substr_list: a_expr FROM a_expr FOR a_expr */ #line 16943 "gram_minimal.y" { (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 53888 "gram_minimal.c" break; case 2331: /* substr_list: a_expr FOR a_expr FROM a_expr */ #line 16947 "gram_minimal.y" { /* not legal per SQL, but might as well allow it */ (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[0].node), (yyvsp[-2].node)); } #line 53897 "gram_minimal.c" break; case 2332: /* substr_list: a_expr FROM a_expr */ #line 16952 "gram_minimal.y" { /* * 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 53912 "gram_minimal.c" break; case 2333: /* substr_list: a_expr FOR a_expr */ #line 16963 "gram_minimal.y" { /* 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 53933 "gram_minimal.c" break; case 2334: /* substr_list: a_expr SIMILAR a_expr ESCAPE a_expr */ #line 16980 "gram_minimal.y" { (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 53941 "gram_minimal.c" break; case 2335: /* trim_list: a_expr FROM expr_list */ #line 16985 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[0].list), (yyvsp[-2].node)); } #line 53947 "gram_minimal.c" break; case 2336: /* trim_list: FROM expr_list */ #line 16986 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 53953 "gram_minimal.c" break; case 2337: /* trim_list: expr_list */ #line 16987 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 53959 "gram_minimal.c" break; case 2338: /* case_expr: CASE case_arg when_clause_list case_default END_P */ #line 16998 "gram_minimal.y" { 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 53974 "gram_minimal.c" break; case 2339: /* when_clause_list: when_clause */ #line 17012 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 53980 "gram_minimal.c" break; case 2340: /* when_clause_list: when_clause_list when_clause */ #line 17013 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 53986 "gram_minimal.c" break; case 2341: /* when_clause: WHEN a_expr THEN a_expr */ #line 17018 "gram_minimal.y" { 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 53999 "gram_minimal.c" break; case 2342: /* case_default: ELSE a_expr */ #line 17029 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 54005 "gram_minimal.c" break; case 2343: /* case_default: %empty */ #line 17030 "gram_minimal.y" { (yyval.node) = NULL; } #line 54011 "gram_minimal.c" break; case 2344: /* case_arg: a_expr */ #line 17033 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 54017 "gram_minimal.c" break; case 2345: /* case_arg: %empty */ #line 17034 "gram_minimal.y" { (yyval.node) = NULL; } #line 54023 "gram_minimal.c" break; case 2346: /* columnref: ColId */ #line 17038 "gram_minimal.y" { (yyval.node) = makeColumnRef((yyvsp[0].str), NIL, (yylsp[0]), yyscanner); } #line 54031 "gram_minimal.c" break; case 2347: /* columnref: ColId indirection */ #line 17042 "gram_minimal.y" { (yyval.node) = makeColumnRef((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 54039 "gram_minimal.c" break; case 2348: /* indirection_el: '.' attr_name */ #line 17049 "gram_minimal.y" { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 54047 "gram_minimal.c" break; case 2349: /* indirection_el: '.' '*' */ #line 17053 "gram_minimal.y" { (yyval.node) = (Node *) makeNode(A_Star); } #line 54055 "gram_minimal.c" break; case 2350: /* indirection_el: '[' a_expr ']' */ #line 17057 "gram_minimal.y" { A_Indices *ai = makeNode(A_Indices); ai->is_slice = false; ai->lidx = NULL; ai->uidx = (yyvsp[-1].node); (yyval.node) = (Node *) ai; } #line 54068 "gram_minimal.c" break; case 2351: /* indirection_el: '[' opt_slice_bound ':' opt_slice_bound ']' */ #line 17066 "gram_minimal.y" { 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 54081 "gram_minimal.c" break; case 2352: /* opt_slice_bound: a_expr */ #line 17077 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 54087 "gram_minimal.c" break; case 2353: /* opt_slice_bound: %empty */ #line 17078 "gram_minimal.y" { (yyval.node) = NULL; } #line 54093 "gram_minimal.c" break; case 2354: /* indirection: indirection_el */ #line 17082 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 54099 "gram_minimal.c" break; case 2355: /* indirection: indirection indirection_el */ #line 17083 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 54105 "gram_minimal.c" break; case 2356: /* opt_indirection: %empty */ #line 17087 "gram_minimal.y" { (yyval.list) = NIL; } #line 54111 "gram_minimal.c" break; case 2357: /* opt_indirection: opt_indirection indirection_el */ #line 17088 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 54117 "gram_minimal.c" break; case 2360: /* json_passing_clause_opt: PASSING json_arguments */ #line 17097 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 54123 "gram_minimal.c" break; case 2361: /* json_passing_clause_opt: %empty */ #line 17098 "gram_minimal.y" { (yyval.list) = NIL; } #line 54129 "gram_minimal.c" break; case 2362: /* json_arguments: json_argument */ #line 17102 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 54135 "gram_minimal.c" break; case 2363: /* json_arguments: json_arguments ',' json_argument */ #line 17103 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 54141 "gram_minimal.c" break; case 2364: /* json_argument: json_value_expr AS ColLabel */ #line 17108 "gram_minimal.y" { JsonArgument *n = makeNode(JsonArgument); n->val = (JsonValueExpr *) (yyvsp[-2].node); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 54153 "gram_minimal.c" break; case 2365: /* json_wrapper_behavior: WITHOUT WRAPPER */ #line 17119 "gram_minimal.y" { (yyval.ival) = JSW_NONE; } #line 54159 "gram_minimal.c" break; case 2366: /* json_wrapper_behavior: WITHOUT ARRAY WRAPPER */ #line 17120 "gram_minimal.y" { (yyval.ival) = JSW_NONE; } #line 54165 "gram_minimal.c" break; case 2367: /* json_wrapper_behavior: WITH WRAPPER */ #line 17121 "gram_minimal.y" { (yyval.ival) = JSW_UNCONDITIONAL; } #line 54171 "gram_minimal.c" break; case 2368: /* json_wrapper_behavior: WITH ARRAY WRAPPER */ #line 17122 "gram_minimal.y" { (yyval.ival) = JSW_UNCONDITIONAL; } #line 54177 "gram_minimal.c" break; case 2369: /* json_wrapper_behavior: WITH CONDITIONAL ARRAY WRAPPER */ #line 17123 "gram_minimal.y" { (yyval.ival) = JSW_CONDITIONAL; } #line 54183 "gram_minimal.c" break; case 2370: /* json_wrapper_behavior: WITH UNCONDITIONAL ARRAY WRAPPER */ #line 17124 "gram_minimal.y" { (yyval.ival) = JSW_UNCONDITIONAL; } #line 54189 "gram_minimal.c" break; case 2371: /* json_wrapper_behavior: WITH CONDITIONAL WRAPPER */ #line 17125 "gram_minimal.y" { (yyval.ival) = JSW_CONDITIONAL; } #line 54195 "gram_minimal.c" break; case 2372: /* json_wrapper_behavior: WITH UNCONDITIONAL WRAPPER */ #line 17126 "gram_minimal.y" { (yyval.ival) = JSW_UNCONDITIONAL; } #line 54201 "gram_minimal.c" break; case 2373: /* json_wrapper_behavior: %empty */ #line 17127 "gram_minimal.y" { (yyval.ival) = JSW_UNSPEC; } #line 54207 "gram_minimal.c" break; case 2374: /* json_behavior: DEFAULT a_expr */ #line 17132 "gram_minimal.y" { (yyval.node) = (Node *) makeJsonBehavior(JSON_BEHAVIOR_DEFAULT, (yyvsp[0].node), (yylsp[-1])); } #line 54213 "gram_minimal.c" break; case 2375: /* json_behavior: json_behavior_type */ #line 17134 "gram_minimal.y" { (yyval.node) = (Node *) makeJsonBehavior((yyvsp[0].ival), NULL, (yylsp[0])); } #line 54219 "gram_minimal.c" break; case 2376: /* json_behavior_type: ERROR_P */ #line 17138 "gram_minimal.y" { (yyval.ival) = JSON_BEHAVIOR_ERROR; } #line 54225 "gram_minimal.c" break; case 2377: /* json_behavior_type: NULL_P */ #line 17139 "gram_minimal.y" { (yyval.ival) = JSON_BEHAVIOR_NULL; } #line 54231 "gram_minimal.c" break; case 2378: /* json_behavior_type: TRUE_P */ #line 17140 "gram_minimal.y" { (yyval.ival) = JSON_BEHAVIOR_TRUE; } #line 54237 "gram_minimal.c" break; case 2379: /* json_behavior_type: FALSE_P */ #line 17141 "gram_minimal.y" { (yyval.ival) = JSON_BEHAVIOR_FALSE; } #line 54243 "gram_minimal.c" break; case 2380: /* json_behavior_type: UNKNOWN */ #line 17142 "gram_minimal.y" { (yyval.ival) = JSON_BEHAVIOR_UNKNOWN; } #line 54249 "gram_minimal.c" break; case 2381: /* json_behavior_type: EMPTY_P ARRAY */ #line 17143 "gram_minimal.y" { (yyval.ival) = JSON_BEHAVIOR_EMPTY_ARRAY; } #line 54255 "gram_minimal.c" break; case 2382: /* json_behavior_type: EMPTY_P OBJECT_P */ #line 17144 "gram_minimal.y" { (yyval.ival) = JSON_BEHAVIOR_EMPTY_OBJECT; } #line 54261 "gram_minimal.c" break; case 2383: /* json_behavior_type: EMPTY_P */ #line 17146 "gram_minimal.y" { (yyval.ival) = JSON_BEHAVIOR_EMPTY_ARRAY; } #line 54267 "gram_minimal.c" break; case 2384: /* json_behavior_clause_opt: json_behavior ON EMPTY_P */ #line 17151 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-2].node), NULL); } #line 54273 "gram_minimal.c" break; case 2385: /* json_behavior_clause_opt: json_behavior ON ERROR_P */ #line 17153 "gram_minimal.y" { (yyval.list) = list_make2(NULL, (yyvsp[-2].node)); } #line 54279 "gram_minimal.c" break; case 2386: /* json_behavior_clause_opt: json_behavior ON EMPTY_P json_behavior ON ERROR_P */ #line 17155 "gram_minimal.y" { (yyval.list) = list_make2((yyvsp[-5].node), (yyvsp[-2].node)); } #line 54285 "gram_minimal.c" break; case 2387: /* json_behavior_clause_opt: %empty */ #line 17157 "gram_minimal.y" { (yyval.list) = list_make2(NULL, NULL); } #line 54291 "gram_minimal.c" break; case 2388: /* json_on_error_clause_opt: json_behavior ON ERROR_P */ #line 17162 "gram_minimal.y" { (yyval.node) = (yyvsp[-2].node); } #line 54297 "gram_minimal.c" break; case 2389: /* json_on_error_clause_opt: %empty */ #line 17164 "gram_minimal.y" { (yyval.node) = NULL; } #line 54303 "gram_minimal.c" break; case 2390: /* json_value_expr: a_expr json_format_clause_opt */ #line 17169 "gram_minimal.y" { /* formatted_expr will be set during parse-analysis. */ (yyval.node) = (Node *) makeJsonValueExpr((Expr *) (yyvsp[-1].node), NULL, castNode(JsonFormat, (yyvsp[0].node))); } #line 54313 "gram_minimal.c" break; case 2391: /* json_format_clause: FORMAT_LA JSON ENCODING name */ #line 17178 "gram_minimal.y" { 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)), parser_errposition((yylsp[0])))); (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_JSON, encoding, (yylsp[-3])); } #line 54335 "gram_minimal.c" break; case 2392: /* json_format_clause: FORMAT_LA JSON */ #line 17196 "gram_minimal.y" { (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_JSON, JS_ENC_DEFAULT, (yylsp[-1])); } #line 54343 "gram_minimal.c" break; case 2393: /* json_format_clause_opt: json_format_clause */ #line 17203 "gram_minimal.y" { (yyval.node) = (yyvsp[0].node); } #line 54351 "gram_minimal.c" break; case 2394: /* json_format_clause_opt: %empty */ #line 17207 "gram_minimal.y" { (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); } #line 54359 "gram_minimal.c" break; case 2395: /* json_quotes_clause_opt: KEEP QUOTES ON SCALAR STRING_P */ #line 17213 "gram_minimal.y" { (yyval.ival) = JS_QUOTES_KEEP; } #line 54365 "gram_minimal.c" break; case 2396: /* json_quotes_clause_opt: KEEP QUOTES */ #line 17214 "gram_minimal.y" { (yyval.ival) = JS_QUOTES_KEEP; } #line 54371 "gram_minimal.c" break; case 2397: /* json_quotes_clause_opt: OMIT QUOTES ON SCALAR STRING_P */ #line 17215 "gram_minimal.y" { (yyval.ival) = JS_QUOTES_OMIT; } #line 54377 "gram_minimal.c" break; case 2398: /* json_quotes_clause_opt: OMIT QUOTES */ #line 17216 "gram_minimal.y" { (yyval.ival) = JS_QUOTES_OMIT; } #line 54383 "gram_minimal.c" break; case 2399: /* json_quotes_clause_opt: %empty */ #line 17217 "gram_minimal.y" { (yyval.ival) = JS_QUOTES_UNSPEC; } #line 54389 "gram_minimal.c" break; case 2400: /* json_returning_clause_opt: RETURNING Typename json_format_clause_opt */ #line 17222 "gram_minimal.y" { 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 54402 "gram_minimal.c" break; case 2401: /* json_returning_clause_opt: %empty */ #line 17230 "gram_minimal.y" { (yyval.node) = NULL; } #line 54408 "gram_minimal.c" break; case 2402: /* json_predicate_type_constraint: JSON */ #line 17244 "gram_minimal.y" { (yyval.ival) = JS_TYPE_ANY; } #line 54414 "gram_minimal.c" break; case 2403: /* json_predicate_type_constraint: JSON VALUE_P */ #line 17245 "gram_minimal.y" { (yyval.ival) = JS_TYPE_ANY; } #line 54420 "gram_minimal.c" break; case 2404: /* json_predicate_type_constraint: JSON ARRAY */ #line 17246 "gram_minimal.y" { (yyval.ival) = JS_TYPE_ARRAY; } #line 54426 "gram_minimal.c" break; case 2405: /* json_predicate_type_constraint: JSON OBJECT_P */ #line 17247 "gram_minimal.y" { (yyval.ival) = JS_TYPE_OBJECT; } #line 54432 "gram_minimal.c" break; case 2406: /* json_predicate_type_constraint: JSON SCALAR */ #line 17248 "gram_minimal.y" { (yyval.ival) = JS_TYPE_SCALAR; } #line 54438 "gram_minimal.c" break; case 2407: /* json_key_uniqueness_constraint_opt: WITH UNIQUE KEYS */ #line 17257 "gram_minimal.y" { (yyval.boolean) = true; } #line 54444 "gram_minimal.c" break; case 2408: /* json_key_uniqueness_constraint_opt: WITH UNIQUE */ #line 17258 "gram_minimal.y" { (yyval.boolean) = true; } #line 54450 "gram_minimal.c" break; case 2409: /* json_key_uniqueness_constraint_opt: WITHOUT UNIQUE KEYS */ #line 17259 "gram_minimal.y" { (yyval.boolean) = false; } #line 54456 "gram_minimal.c" break; case 2410: /* json_key_uniqueness_constraint_opt: WITHOUT UNIQUE */ #line 17260 "gram_minimal.y" { (yyval.boolean) = false; } #line 54462 "gram_minimal.c" break; case 2411: /* json_key_uniqueness_constraint_opt: %empty */ #line 17261 "gram_minimal.y" { (yyval.boolean) = false; } #line 54468 "gram_minimal.c" break; case 2412: /* json_name_and_value_list: json_name_and_value */ #line 17266 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 54474 "gram_minimal.c" break; case 2413: /* json_name_and_value_list: json_name_and_value_list ',' json_name_and_value */ #line 17268 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 54480 "gram_minimal.c" break; case 2414: /* json_name_and_value: c_expr VALUE_P json_value_expr */ #line 17278 "gram_minimal.y" { (yyval.node) = makeJsonKeyValue((yyvsp[-2].node), (yyvsp[0].node)); } #line 54486 "gram_minimal.c" break; case 2415: /* json_name_and_value: a_expr ':' json_value_expr */ #line 17281 "gram_minimal.y" { (yyval.node) = makeJsonKeyValue((yyvsp[-2].node), (yyvsp[0].node)); } #line 54492 "gram_minimal.c" break; case 2416: /* json_object_constructor_null_clause_opt: NULL_P ON NULL_P */ #line 17286 "gram_minimal.y" { (yyval.boolean) = false; } #line 54498 "gram_minimal.c" break; case 2417: /* json_object_constructor_null_clause_opt: ABSENT ON NULL_P */ #line 17287 "gram_minimal.y" { (yyval.boolean) = true; } #line 54504 "gram_minimal.c" break; case 2418: /* json_object_constructor_null_clause_opt: %empty */ #line 17288 "gram_minimal.y" { (yyval.boolean) = false; } #line 54510 "gram_minimal.c" break; case 2419: /* json_array_constructor_null_clause_opt: NULL_P ON NULL_P */ #line 17292 "gram_minimal.y" { (yyval.boolean) = false; } #line 54516 "gram_minimal.c" break; case 2420: /* json_array_constructor_null_clause_opt: ABSENT ON NULL_P */ #line 17293 "gram_minimal.y" { (yyval.boolean) = true; } #line 54522 "gram_minimal.c" break; case 2421: /* json_array_constructor_null_clause_opt: %empty */ #line 17294 "gram_minimal.y" { (yyval.boolean) = true; } #line 54528 "gram_minimal.c" break; case 2422: /* json_value_expr_list: json_value_expr */ #line 17298 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].node)); } #line 54534 "gram_minimal.c" break; case 2423: /* json_value_expr_list: json_value_expr_list ',' json_value_expr */ #line 17299 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node));} #line 54540 "gram_minimal.c" break; case 2424: /* json_aggregate_func: JSON_OBJECTAGG '(' json_name_and_value json_object_constructor_null_clause_opt json_key_uniqueness_constraint_opt json_returning_clause_opt ')' */ #line 17309 "gram_minimal.y" { 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 54557 "gram_minimal.c" break; case 2425: /* json_aggregate_func: JSON_ARRAYAGG '(' json_value_expr json_array_aggregate_order_by_clause_opt json_array_constructor_null_clause_opt json_returning_clause_opt ')' */ #line 17327 "gram_minimal.y" { 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 54573 "gram_minimal.c" break; case 2426: /* json_array_aggregate_order_by_clause_opt: ORDER BY sortby_list */ #line 17341 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 54579 "gram_minimal.c" break; case 2427: /* json_array_aggregate_order_by_clause_opt: %empty */ #line 17342 "gram_minimal.y" { (yyval.list) = NIL; } #line 54585 "gram_minimal.c" break; case 2428: /* opt_target_list: target_list */ #line 17351 "gram_minimal.y" { (yyval.list) = (yyvsp[0].list); } #line 54591 "gram_minimal.c" break; case 2429: /* opt_target_list: %empty */ #line 17352 "gram_minimal.y" { (yyval.list) = NIL; } #line 54597 "gram_minimal.c" break; case 2430: /* target_list: target_el */ #line 17356 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].target)); } #line 54603 "gram_minimal.c" break; case 2431: /* target_list: target_list ',' target_el */ #line 17357 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 54609 "gram_minimal.c" break; case 2432: /* target_el: a_expr AS ColLabel */ #line 17361 "gram_minimal.y" { (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 54621 "gram_minimal.c" break; case 2433: /* target_el: a_expr BareColLabel */ #line 17369 "gram_minimal.y" { (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 54633 "gram_minimal.c" break; case 2434: /* target_el: a_expr */ #line 17377 "gram_minimal.y" { (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 54645 "gram_minimal.c" break; case 2435: /* target_el: '*' */ #line 17385 "gram_minimal.y" { 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 54662 "gram_minimal.c" break; case 2436: /* qualified_name_list: qualified_name */ #line 17407 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].range)); } #line 54668 "gram_minimal.c" break; case 2437: /* qualified_name_list: qualified_name_list ',' qualified_name */ #line 17408 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 54674 "gram_minimal.c" break; case 2438: /* qualified_name: ColId */ #line 17420 "gram_minimal.y" { (yyval.range) = makeRangeVar(NULL, (yyvsp[0].str), (yylsp[0])); } #line 54682 "gram_minimal.c" break; case 2439: /* qualified_name: ColId indirection */ #line 17424 "gram_minimal.y" { (yyval.range) = makeRangeVarFromQualifiedName((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 54690 "gram_minimal.c" break; case 2440: /* name_list: name */ #line 17430 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 54696 "gram_minimal.c" break; case 2441: /* name_list: name_list ',' name */ #line 17432 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 54702 "gram_minimal.c" break; case 2442: /* name: ColId */ #line 17436 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 54708 "gram_minimal.c" break; case 2443: /* attr_name: ColLabel */ #line 17438 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 54714 "gram_minimal.c" break; case 2444: /* file_name: Sconst */ #line 17440 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 54720 "gram_minimal.c" break; case 2445: /* func_name: type_function_name */ #line 17451 "gram_minimal.y" { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 54726 "gram_minimal.c" break; case 2446: /* func_name: ColId indirection */ #line 17453 "gram_minimal.y" { (yyval.list) = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); } #line 54735 "gram_minimal.c" break; case 2447: /* AexprConst: Iconst */ #line 17464 "gram_minimal.y" { (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); } #line 54743 "gram_minimal.c" break; case 2448: /* AexprConst: FCONST */ #line 17468 "gram_minimal.y" { (yyval.node) = makeFloatConst((yyvsp[0].str), (yylsp[0])); } #line 54751 "gram_minimal.c" break; case 2449: /* AexprConst: Sconst */ #line 17472 "gram_minimal.y" { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 54759 "gram_minimal.c" break; case 2450: /* AexprConst: BCONST */ #line 17476 "gram_minimal.y" { (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); } #line 54767 "gram_minimal.c" break; case 2451: /* AexprConst: XCONST */ #line 17480 "gram_minimal.y" { /* 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 54780 "gram_minimal.c" break; case 2452: /* AexprConst: func_name Sconst */ #line 17489 "gram_minimal.y" { /* generic type 'literal' syntax */ TypeName *t = makeTypeNameFromNameList((yyvsp[-1].list)); t->location = (yylsp[-1]); (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); } #line 54792 "gram_minimal.c" break; case 2453: /* AexprConst: func_name '(' func_arg_list opt_sort_clause ')' Sconst */ #line 17497 "gram_minimal.y" { /* 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 54828 "gram_minimal.c" break; case 2454: /* AexprConst: ConstTypename Sconst */ #line 17529 "gram_minimal.y" { (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), (yyvsp[-1].typnam)); } #line 54836 "gram_minimal.c" break; case 2455: /* AexprConst: ConstInterval Sconst opt_interval */ #line 17533 "gram_minimal.y" { TypeName *t = (yyvsp[-2].typnam); t->typmods = (yyvsp[0].list); (yyval.node) = makeStringConstCast((yyvsp[-1].str), (yylsp[-1]), t); } #line 54847 "gram_minimal.c" break; case 2456: /* AexprConst: ConstInterval '(' Iconst ')' Sconst */ #line 17540 "gram_minimal.y" { 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 54859 "gram_minimal.c" break; case 2457: /* AexprConst: TRUE_P */ #line 17548 "gram_minimal.y" { (yyval.node) = makeBoolAConst(true, (yylsp[0])); } #line 54867 "gram_minimal.c" break; case 2458: /* AexprConst: FALSE_P */ #line 17552 "gram_minimal.y" { (yyval.node) = makeBoolAConst(false, (yylsp[0])); } #line 54875 "gram_minimal.c" break; case 2459: /* AexprConst: NULL_P */ #line 17556 "gram_minimal.y" { (yyval.node) = makeNullAConst((yylsp[0])); } #line 54883 "gram_minimal.c" break; case 2460: /* Iconst: ICONST */ #line 17561 "gram_minimal.y" { (yyval.ival) = (yyvsp[0].ival); } #line 54889 "gram_minimal.c" break; case 2461: /* Sconst: SCONST */ #line 17562 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 54895 "gram_minimal.c" break; case 2462: /* SignedIconst: Iconst */ #line 17564 "gram_minimal.y" { (yyval.ival) = (yyvsp[0].ival); } #line 54901 "gram_minimal.c" break; case 2463: /* SignedIconst: '+' Iconst */ #line 17565 "gram_minimal.y" { (yyval.ival) = + (yyvsp[0].ival); } #line 54907 "gram_minimal.c" break; case 2464: /* SignedIconst: '-' Iconst */ #line 17566 "gram_minimal.y" { (yyval.ival) = - (yyvsp[0].ival); } #line 54913 "gram_minimal.c" break; case 2465: /* RoleId: RoleSpec */ #line 17571 "gram_minimal.y" { 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 54956 "gram_minimal.c" break; case 2466: /* RoleSpec: NonReservedWord */ #line 17612 "gram_minimal.y" { /* * "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 54988 "gram_minimal.c" break; case 2467: /* RoleSpec: CURRENT_ROLE */ #line 17640 "gram_minimal.y" { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_ROLE, (yylsp[0])); } #line 54996 "gram_minimal.c" break; case 2468: /* RoleSpec: CURRENT_USER */ #line 17644 "gram_minimal.y" { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 55004 "gram_minimal.c" break; case 2469: /* RoleSpec: SESSION_USER */ #line 17648 "gram_minimal.y" { (yyval.rolespec) = makeRoleSpec(ROLESPEC_SESSION_USER, (yylsp[0])); } #line 55012 "gram_minimal.c" break; case 2470: /* role_list: RoleSpec */ #line 17654 "gram_minimal.y" { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 55018 "gram_minimal.c" break; case 2471: /* role_list: role_list ',' RoleSpec */ #line 17656 "gram_minimal.y" { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 55024 "gram_minimal.c" break; case 2472: /* PLpgSQL_Expr: opt_distinct_clause opt_target_list from_clause where_clause group_clause having_clause window_clause opt_sort_clause opt_select_limit opt_for_locking_clause */ #line 17673 "gram_minimal.y" { 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"), parser_errposition((yyvsp[-1].selectlimit)->optionLoc))); n->limitOption = (yyvsp[-1].selectlimit)->limitOption; } n->lockingClause = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 55056 "gram_minimal.c" break; case 2473: /* PLAssignStmt: plassign_target opt_indirection plassign_equals PLpgSQL_Expr */ #line 17707 "gram_minimal.y" { 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 55071 "gram_minimal.c" break; case 2474: /* plassign_target: ColId */ #line 17719 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 55077 "gram_minimal.c" break; case 2475: /* plassign_target: PARAM */ #line 17720 "gram_minimal.y" { (yyval.str) = psprintf("$%d", (yyvsp[0].ival)); } #line 55083 "gram_minimal.c" break; case 2478: /* ColId: IDENT */ #line 17741 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 55089 "gram_minimal.c" break; case 2479: /* ColId: unreserved_keyword */ #line 17742 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55095 "gram_minimal.c" break; case 2480: /* ColId: col_name_keyword */ #line 17743 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55101 "gram_minimal.c" break; case 2481: /* type_function_name: IDENT */ #line 17748 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 55107 "gram_minimal.c" break; case 2482: /* type_function_name: unreserved_keyword */ #line 17749 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55113 "gram_minimal.c" break; case 2483: /* type_function_name: type_func_name_keyword */ #line 17750 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55119 "gram_minimal.c" break; case 2484: /* NonReservedWord: IDENT */ #line 17755 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 55125 "gram_minimal.c" break; case 2485: /* NonReservedWord: unreserved_keyword */ #line 17756 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55131 "gram_minimal.c" break; case 2486: /* NonReservedWord: col_name_keyword */ #line 17757 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55137 "gram_minimal.c" break; case 2487: /* NonReservedWord: type_func_name_keyword */ #line 17758 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55143 "gram_minimal.c" break; case 2488: /* ColLabel: IDENT */ #line 17764 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 55149 "gram_minimal.c" break; case 2489: /* ColLabel: unreserved_keyword */ #line 17765 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55155 "gram_minimal.c" break; case 2490: /* ColLabel: col_name_keyword */ #line 17766 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55161 "gram_minimal.c" break; case 2491: /* ColLabel: type_func_name_keyword */ #line 17767 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55167 "gram_minimal.c" break; case 2492: /* ColLabel: reserved_keyword */ #line 17768 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55173 "gram_minimal.c" break; case 2493: /* BareColLabel: IDENT */ #line 17774 "gram_minimal.y" { (yyval.str) = (yyvsp[0].str); } #line 55179 "gram_minimal.c" break; case 2494: /* BareColLabel: bare_label_keyword */ #line 17775 "gram_minimal.y" { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 55185 "gram_minimal.c" break; #line 55189 "gram_minimal.c" 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 ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; *++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. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } 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 ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; yyerror (&yylloc, yyscanner, YY_("syntax error")); } 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 when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; /* 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. */ /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYSYMBOL_YYerror; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { 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", YY_ACCESSING_SYMBOL (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; ++yylsp; YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (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 /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (&yylloc, yyscanner, YY_("memory exhausted")); yyresult = 2; goto yyreturn; #endif /*-------------------------------------------------------. | yyreturn -- parsing is finished, clean up and return. | `-------------------------------------------------------*/ 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", YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, yyscanner); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 18793 "gram_minimal.y" /* * 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(firsto->location))); /* 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(limitClause->offsetLoc))); 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(limitClause->countLoc))); stmt->limitCount = limitClause->limitCount; } if (limitClause) { /* If there was a conflict, we must have detected it above */ Assert(!stmt->limitOption); 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"), parser_errposition(limitClause->optionLoc))); 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"), parser_errposition(limitClause->optionLoc))); } } 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, int location_end) { A_ArrayExpr *n = makeNode(A_ArrayExpr); n->elements = elements; n->location = location; n->list_start = location; n->list_end = location_end; 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, core_yyscan_t yyscanner) { 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"), parser_errposition(p->location))); } 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 *is_enforced, 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 (is_enforced) *is_enforced = true; 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))); } if (cas_bits & CAS_NOT_ENFORCED) { if (is_enforced) *is_enforced = false; else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), /* translator: %s is CHECK, UNIQUE, or similar */ errmsg("%s constraints cannot be marked NOT ENFORCED", constrType), parser_errposition(location))); /* * NB: The validated status is irrelevant when the constraint is set to * NOT ENFORCED, but for consistency, it should be set accordingly. * This ensures that if the constraint is later changed to ENFORCED, it * will automatically be in the correct NOT VALIDATED state. */ if (not_valid) *not_valid = true; } if (cas_bits & CAS_ENFORCED) { if (is_enforced) *is_enforced = true; else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), /* translator: %s is CHECK, UNIQUE, or similar */ errmsg("%s constraints cannot be marked ENFORCED", constrType), parser_errposition(location))); } } /* * Parse a user-supplied partition strategy string into parse node * PartitionStrategy representation, or die trying. */ static PartitionStrategy parsePartitionStrategy(char *strategy, int location, core_yyscan_t yyscanner) { 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), parser_errposition(location))); 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.7.0/src/parser/gram_minimal.h0000644000175000017500000012003515120733657015144 00000000000000/* A Bison parser, made by GNU Bison 3.7.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 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. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ #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 kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ IDENT = 258, /* IDENT */ UIDENT = 259, /* UIDENT */ FCONST = 260, /* FCONST */ SCONST = 261, /* SCONST */ USCONST = 262, /* USCONST */ BCONST = 263, /* BCONST */ XCONST = 264, /* XCONST */ Op = 265, /* Op */ ICONST = 266, /* ICONST */ PARAM = 267, /* PARAM */ TYPECAST = 268, /* TYPECAST */ DOT_DOT = 269, /* DOT_DOT */ COLON_EQUALS = 270, /* COLON_EQUALS */ EQUALS_GREATER = 271, /* EQUALS_GREATER */ LESS_EQUALS = 272, /* LESS_EQUALS */ GREATER_EQUALS = 273, /* GREATER_EQUALS */ NOT_EQUALS = 274, /* NOT_EQUALS */ ABORT_P = 275, /* ABORT_P */ ABSENT = 276, /* ABSENT */ ABSOLUTE_P = 277, /* ABSOLUTE_P */ ACCESS = 278, /* ACCESS */ ACTION = 279, /* ACTION */ ADD_P = 280, /* ADD_P */ ADMIN = 281, /* ADMIN */ AFTER = 282, /* AFTER */ AGGREGATE = 283, /* AGGREGATE */ ALL = 284, /* ALL */ ALSO = 285, /* ALSO */ ALTER = 286, /* ALTER */ ALWAYS = 287, /* ALWAYS */ ANALYSE = 288, /* ANALYSE */ ANALYZE = 289, /* ANALYZE */ AND = 290, /* AND */ ANY = 291, /* ANY */ ARRAY = 292, /* ARRAY */ AS = 293, /* AS */ ASC = 294, /* ASC */ ASENSITIVE = 295, /* ASENSITIVE */ ASSERTION = 296, /* ASSERTION */ ASSIGNMENT = 297, /* ASSIGNMENT */ ASYMMETRIC = 298, /* ASYMMETRIC */ ATOMIC = 299, /* ATOMIC */ AT = 300, /* AT */ ATTACH = 301, /* ATTACH */ ATTRIBUTE = 302, /* ATTRIBUTE */ AUTHORIZATION = 303, /* AUTHORIZATION */ BACKWARD = 304, /* BACKWARD */ BEFORE = 305, /* BEFORE */ BEGIN_P = 306, /* BEGIN_P */ BETWEEN = 307, /* BETWEEN */ BIGINT = 308, /* BIGINT */ BINARY = 309, /* BINARY */ BIT = 310, /* BIT */ BOOLEAN_P = 311, /* BOOLEAN_P */ BOTH = 312, /* BOTH */ BREADTH = 313, /* BREADTH */ BY = 314, /* BY */ CACHE = 315, /* CACHE */ CALL = 316, /* CALL */ CALLED = 317, /* CALLED */ CASCADE = 318, /* CASCADE */ CASCADED = 319, /* CASCADED */ CASE = 320, /* CASE */ CAST = 321, /* CAST */ CATALOG_P = 322, /* CATALOG_P */ CHAIN = 323, /* CHAIN */ CHAR_P = 324, /* CHAR_P */ CHARACTER = 325, /* CHARACTER */ CHARACTERISTICS = 326, /* CHARACTERISTICS */ CHECK = 327, /* CHECK */ CHECKPOINT = 328, /* CHECKPOINT */ CLASS = 329, /* CLASS */ CLOSE = 330, /* CLOSE */ CLUSTER = 331, /* CLUSTER */ COALESCE = 332, /* COALESCE */ COLLATE = 333, /* COLLATE */ COLLATION = 334, /* COLLATION */ COLUMN = 335, /* COLUMN */ COLUMNS = 336, /* COLUMNS */ COMMENT = 337, /* COMMENT */ COMMENTS = 338, /* COMMENTS */ COMMIT = 339, /* COMMIT */ COMMITTED = 340, /* COMMITTED */ COMPRESSION = 341, /* COMPRESSION */ CONCURRENTLY = 342, /* CONCURRENTLY */ CONDITIONAL = 343, /* CONDITIONAL */ CONFIGURATION = 344, /* CONFIGURATION */ CONFLICT = 345, /* CONFLICT */ CONNECTION = 346, /* CONNECTION */ CONSTRAINT = 347, /* CONSTRAINT */ CONSTRAINTS = 348, /* CONSTRAINTS */ CONTENT_P = 349, /* CONTENT_P */ CONTINUE_P = 350, /* CONTINUE_P */ CONVERSION_P = 351, /* CONVERSION_P */ COPY = 352, /* COPY */ COST = 353, /* COST */ CREATE = 354, /* CREATE */ CROSS = 355, /* CROSS */ CSV = 356, /* CSV */ CUBE = 357, /* CUBE */ CURRENT_P = 358, /* CURRENT_P */ CURRENT_CATALOG = 359, /* CURRENT_CATALOG */ CURRENT_DATE = 360, /* CURRENT_DATE */ CURRENT_ROLE = 361, /* CURRENT_ROLE */ CURRENT_SCHEMA = 362, /* CURRENT_SCHEMA */ CURRENT_TIME = 363, /* CURRENT_TIME */ CURRENT_TIMESTAMP = 364, /* CURRENT_TIMESTAMP */ CURRENT_USER = 365, /* CURRENT_USER */ CURSOR = 366, /* CURSOR */ CYCLE = 367, /* CYCLE */ DATA_P = 368, /* DATA_P */ DATABASE = 369, /* DATABASE */ DAY_P = 370, /* DAY_P */ DEALLOCATE = 371, /* DEALLOCATE */ DEC = 372, /* DEC */ DECIMAL_P = 373, /* DECIMAL_P */ DECLARE = 374, /* DECLARE */ DEFAULT = 375, /* DEFAULT */ DEFAULTS = 376, /* DEFAULTS */ DEFERRABLE = 377, /* DEFERRABLE */ DEFERRED = 378, /* DEFERRED */ DEFINER = 379, /* DEFINER */ DELETE_P = 380, /* DELETE_P */ DELIMITER = 381, /* DELIMITER */ DELIMITERS = 382, /* DELIMITERS */ DEPENDS = 383, /* DEPENDS */ DEPTH = 384, /* DEPTH */ DESC = 385, /* DESC */ DETACH = 386, /* DETACH */ DICTIONARY = 387, /* DICTIONARY */ DISABLE_P = 388, /* DISABLE_P */ DISCARD = 389, /* DISCARD */ DISTINCT = 390, /* DISTINCT */ DO = 391, /* DO */ DOCUMENT_P = 392, /* DOCUMENT_P */ DOMAIN_P = 393, /* DOMAIN_P */ DOUBLE_P = 394, /* DOUBLE_P */ DROP = 395, /* DROP */ EACH = 396, /* EACH */ ELSE = 397, /* ELSE */ EMPTY_P = 398, /* EMPTY_P */ ENABLE_P = 399, /* ENABLE_P */ ENCODING = 400, /* ENCODING */ ENCRYPTED = 401, /* ENCRYPTED */ END_P = 402, /* END_P */ ENFORCED = 403, /* ENFORCED */ ENUM_P = 404, /* ENUM_P */ ERROR_P = 405, /* ERROR_P */ ESCAPE = 406, /* ESCAPE */ EVENT = 407, /* EVENT */ EXCEPT = 408, /* EXCEPT */ EXCLUDE = 409, /* EXCLUDE */ EXCLUDING = 410, /* EXCLUDING */ EXCLUSIVE = 411, /* EXCLUSIVE */ EXECUTE = 412, /* EXECUTE */ EXISTS = 413, /* EXISTS */ EXPLAIN = 414, /* EXPLAIN */ EXPRESSION = 415, /* EXPRESSION */ EXTENSION = 416, /* EXTENSION */ EXTERNAL = 417, /* EXTERNAL */ EXTRACT = 418, /* EXTRACT */ FALSE_P = 419, /* FALSE_P */ FAMILY = 420, /* FAMILY */ FETCH = 421, /* FETCH */ FILTER = 422, /* FILTER */ FINALIZE = 423, /* FINALIZE */ FIRST_P = 424, /* FIRST_P */ FLOAT_P = 425, /* FLOAT_P */ FOLLOWING = 426, /* FOLLOWING */ FOR = 427, /* FOR */ FORCE = 428, /* FORCE */ FOREIGN = 429, /* FOREIGN */ FORMAT = 430, /* FORMAT */ FORWARD = 431, /* FORWARD */ FREEZE = 432, /* FREEZE */ FROM = 433, /* FROM */ FULL = 434, /* FULL */ FUNCTION = 435, /* FUNCTION */ FUNCTIONS = 436, /* FUNCTIONS */ GENERATED = 437, /* GENERATED */ GLOBAL = 438, /* GLOBAL */ GRANT = 439, /* GRANT */ GRANTED = 440, /* GRANTED */ GREATEST = 441, /* GREATEST */ GROUP_P = 442, /* GROUP_P */ GROUPING = 443, /* GROUPING */ GROUPS = 444, /* GROUPS */ HANDLER = 445, /* HANDLER */ HAVING = 446, /* HAVING */ HEADER_P = 447, /* HEADER_P */ HOLD = 448, /* HOLD */ HOUR_P = 449, /* HOUR_P */ IDENTITY_P = 450, /* IDENTITY_P */ IF_P = 451, /* IF_P */ ILIKE = 452, /* ILIKE */ IMMEDIATE = 453, /* IMMEDIATE */ IMMUTABLE = 454, /* IMMUTABLE */ IMPLICIT_P = 455, /* IMPLICIT_P */ IMPORT_P = 456, /* IMPORT_P */ IN_P = 457, /* IN_P */ INCLUDE = 458, /* INCLUDE */ INCLUDING = 459, /* INCLUDING */ INCREMENT = 460, /* INCREMENT */ INDENT = 461, /* INDENT */ INDEX = 462, /* INDEX */ INDEXES = 463, /* INDEXES */ INHERIT = 464, /* INHERIT */ INHERITS = 465, /* INHERITS */ INITIALLY = 466, /* INITIALLY */ INLINE_P = 467, /* INLINE_P */ INNER_P = 468, /* INNER_P */ INOUT = 469, /* INOUT */ INPUT_P = 470, /* INPUT_P */ INSENSITIVE = 471, /* INSENSITIVE */ INSERT = 472, /* INSERT */ INSTEAD = 473, /* INSTEAD */ INT_P = 474, /* INT_P */ INTEGER = 475, /* INTEGER */ INTERSECT = 476, /* INTERSECT */ INTERVAL = 477, /* INTERVAL */ INTO = 478, /* INTO */ INVOKER = 479, /* INVOKER */ IS = 480, /* IS */ ISNULL = 481, /* ISNULL */ ISOLATION = 482, /* ISOLATION */ JOIN = 483, /* JOIN */ JSON = 484, /* JSON */ JSON_ARRAY = 485, /* JSON_ARRAY */ JSON_ARRAYAGG = 486, /* JSON_ARRAYAGG */ JSON_EXISTS = 487, /* JSON_EXISTS */ JSON_OBJECT = 488, /* JSON_OBJECT */ JSON_OBJECTAGG = 489, /* JSON_OBJECTAGG */ JSON_QUERY = 490, /* JSON_QUERY */ JSON_SCALAR = 491, /* JSON_SCALAR */ JSON_SERIALIZE = 492, /* JSON_SERIALIZE */ JSON_TABLE = 493, /* JSON_TABLE */ JSON_VALUE = 494, /* JSON_VALUE */ KEEP = 495, /* KEEP */ KEY = 496, /* KEY */ KEYS = 497, /* KEYS */ LABEL = 498, /* LABEL */ LANGUAGE = 499, /* LANGUAGE */ LARGE_P = 500, /* LARGE_P */ LAST_P = 501, /* LAST_P */ LATERAL_P = 502, /* LATERAL_P */ LEADING = 503, /* LEADING */ LEAKPROOF = 504, /* LEAKPROOF */ LEAST = 505, /* LEAST */ LEFT = 506, /* LEFT */ LEVEL = 507, /* LEVEL */ LIKE = 508, /* LIKE */ LIMIT = 509, /* LIMIT */ LISTEN = 510, /* LISTEN */ LOAD = 511, /* LOAD */ LOCAL = 512, /* LOCAL */ LOCALTIME = 513, /* LOCALTIME */ LOCALTIMESTAMP = 514, /* LOCALTIMESTAMP */ LOCATION = 515, /* LOCATION */ LOCK_P = 516, /* LOCK_P */ LOCKED = 517, /* LOCKED */ LOGGED = 518, /* LOGGED */ MAPPING = 519, /* MAPPING */ MATCH = 520, /* MATCH */ MATCHED = 521, /* MATCHED */ MATERIALIZED = 522, /* MATERIALIZED */ MAXVALUE = 523, /* MAXVALUE */ MERGE = 524, /* MERGE */ MERGE_ACTION = 525, /* MERGE_ACTION */ METHOD = 526, /* METHOD */ MINUTE_P = 527, /* MINUTE_P */ MINVALUE = 528, /* MINVALUE */ MODE = 529, /* MODE */ MONTH_P = 530, /* MONTH_P */ MOVE = 531, /* MOVE */ NAME_P = 532, /* NAME_P */ NAMES = 533, /* NAMES */ NATIONAL = 534, /* NATIONAL */ NATURAL = 535, /* NATURAL */ NCHAR = 536, /* NCHAR */ NESTED = 537, /* NESTED */ NEW = 538, /* NEW */ NEXT = 539, /* NEXT */ NFC = 540, /* NFC */ NFD = 541, /* NFD */ NFKC = 542, /* NFKC */ NFKD = 543, /* NFKD */ NO = 544, /* NO */ NONE = 545, /* NONE */ NORMALIZE = 546, /* NORMALIZE */ NORMALIZED = 547, /* NORMALIZED */ NOT = 548, /* NOT */ NOTHING = 549, /* NOTHING */ NOTIFY = 550, /* NOTIFY */ NOTNULL = 551, /* NOTNULL */ NOWAIT = 552, /* NOWAIT */ NULL_P = 553, /* NULL_P */ NULLIF = 554, /* NULLIF */ NULLS_P = 555, /* NULLS_P */ NUMERIC = 556, /* NUMERIC */ OBJECT_P = 557, /* OBJECT_P */ OBJECTS_P = 558, /* OBJECTS_P */ OF = 559, /* OF */ OFF = 560, /* OFF */ OFFSET = 561, /* OFFSET */ OIDS = 562, /* OIDS */ OLD = 563, /* OLD */ OMIT = 564, /* OMIT */ ON = 565, /* ON */ ONLY = 566, /* ONLY */ OPERATOR = 567, /* OPERATOR */ OPTION = 568, /* OPTION */ OPTIONS = 569, /* OPTIONS */ OR = 570, /* OR */ ORDER = 571, /* ORDER */ ORDINALITY = 572, /* ORDINALITY */ OTHERS = 573, /* OTHERS */ OUT_P = 574, /* OUT_P */ OUTER_P = 575, /* OUTER_P */ OVER = 576, /* OVER */ OVERLAPS = 577, /* OVERLAPS */ OVERLAY = 578, /* OVERLAY */ OVERRIDING = 579, /* OVERRIDING */ OWNED = 580, /* OWNED */ OWNER = 581, /* OWNER */ PARALLEL = 582, /* PARALLEL */ PARAMETER = 583, /* PARAMETER */ PARSER = 584, /* PARSER */ PARTIAL = 585, /* PARTIAL */ PARTITION = 586, /* PARTITION */ PASSING = 587, /* PASSING */ PASSWORD = 588, /* PASSWORD */ PATH = 589, /* PATH */ PGPOOL = 590, /* PGPOOL */ PERIOD = 591, /* PERIOD */ PLACING = 592, /* PLACING */ PLAN = 593, /* PLAN */ PLANS = 594, /* PLANS */ POLICY = 595, /* POLICY */ POSITION = 596, /* POSITION */ PRECEDING = 597, /* PRECEDING */ PRECISION = 598, /* PRECISION */ PRESERVE = 599, /* PRESERVE */ PREPARE = 600, /* PREPARE */ PREPARED = 601, /* PREPARED */ PRIMARY = 602, /* PRIMARY */ PRIOR = 603, /* PRIOR */ PRIVILEGES = 604, /* PRIVILEGES */ PROCEDURAL = 605, /* PROCEDURAL */ PROCEDURE = 606, /* PROCEDURE */ PROCEDURES = 607, /* PROCEDURES */ PROGRAM = 608, /* PROGRAM */ PUBLICATION = 609, /* PUBLICATION */ QUOTE = 610, /* QUOTE */ QUOTES = 611, /* QUOTES */ RANGE = 612, /* RANGE */ READ = 613, /* READ */ REAL = 614, /* REAL */ REASSIGN = 615, /* REASSIGN */ RECURSIVE = 616, /* RECURSIVE */ REF_P = 617, /* REF_P */ REFERENCES = 618, /* REFERENCES */ REFERENCING = 619, /* REFERENCING */ REFRESH = 620, /* REFRESH */ REINDEX = 621, /* REINDEX */ RELATIVE_P = 622, /* RELATIVE_P */ RELEASE = 623, /* RELEASE */ RENAME = 624, /* RENAME */ REPEATABLE = 625, /* REPEATABLE */ REPLACE = 626, /* REPLACE */ REPLICA = 627, /* REPLICA */ RESET = 628, /* RESET */ RESTART = 629, /* RESTART */ RESTRICT = 630, /* RESTRICT */ RETURN = 631, /* RETURN */ RETURNING = 632, /* RETURNING */ RETURNS = 633, /* RETURNS */ REVOKE = 634, /* REVOKE */ RIGHT = 635, /* RIGHT */ ROLE = 636, /* ROLE */ ROLLBACK = 637, /* ROLLBACK */ ROLLUP = 638, /* ROLLUP */ ROUTINE = 639, /* ROUTINE */ ROUTINES = 640, /* ROUTINES */ ROW = 641, /* ROW */ ROWS = 642, /* ROWS */ RULE = 643, /* RULE */ SAVEPOINT = 644, /* SAVEPOINT */ SCALAR = 645, /* SCALAR */ SCHEMA = 646, /* SCHEMA */ SCHEMAS = 647, /* SCHEMAS */ SCROLL = 648, /* SCROLL */ SEARCH = 649, /* SEARCH */ SECOND_P = 650, /* SECOND_P */ SECURITY = 651, /* SECURITY */ SELECT = 652, /* SELECT */ SEQUENCE = 653, /* SEQUENCE */ SEQUENCES = 654, /* SEQUENCES */ SERIALIZABLE = 655, /* SERIALIZABLE */ SERVER = 656, /* SERVER */ SESSION = 657, /* SESSION */ SESSION_USER = 658, /* SESSION_USER */ SET = 659, /* SET */ SETS = 660, /* SETS */ SETOF = 661, /* SETOF */ SHARE = 662, /* SHARE */ SHOW = 663, /* SHOW */ SIMILAR = 664, /* SIMILAR */ SIMPLE = 665, /* SIMPLE */ SKIP = 666, /* SKIP */ SMALLINT = 667, /* SMALLINT */ SNAPSHOT = 668, /* SNAPSHOT */ SOME = 669, /* SOME */ SOURCE = 670, /* SOURCE */ SQL_P = 671, /* SQL_P */ STABLE = 672, /* STABLE */ STANDALONE_P = 673, /* STANDALONE_P */ START = 674, /* START */ STATEMENT = 675, /* STATEMENT */ STATISTICS = 676, /* STATISTICS */ STDIN = 677, /* STDIN */ STDOUT = 678, /* STDOUT */ STORAGE = 679, /* STORAGE */ STORED = 680, /* STORED */ STRICT_P = 681, /* STRICT_P */ STRING_P = 682, /* STRING_P */ STRIP_P = 683, /* STRIP_P */ SUBSCRIPTION = 684, /* SUBSCRIPTION */ SUBSTRING = 685, /* SUBSTRING */ SUPPORT = 686, /* SUPPORT */ SYMMETRIC = 687, /* SYMMETRIC */ SYSID = 688, /* SYSID */ SYSTEM_P = 689, /* SYSTEM_P */ SYSTEM_USER = 690, /* SYSTEM_USER */ TABLE = 691, /* TABLE */ TABLES = 692, /* TABLES */ TABLESAMPLE = 693, /* TABLESAMPLE */ TABLESPACE = 694, /* TABLESPACE */ TARGET = 695, /* TARGET */ TEMP = 696, /* TEMP */ TEMPLATE = 697, /* TEMPLATE */ TEMPORARY = 698, /* TEMPORARY */ TEXT_P = 699, /* TEXT_P */ THEN = 700, /* THEN */ TIES = 701, /* TIES */ TIME = 702, /* TIME */ TIMESTAMP = 703, /* TIMESTAMP */ TO = 704, /* TO */ TRAILING = 705, /* TRAILING */ TRANSACTION = 706, /* TRANSACTION */ TRANSFORM = 707, /* TRANSFORM */ TREAT = 708, /* TREAT */ TRIGGER = 709, /* TRIGGER */ TRIM = 710, /* TRIM */ TRUE_P = 711, /* TRUE_P */ TRUNCATE = 712, /* TRUNCATE */ TRUSTED = 713, /* TRUSTED */ TYPE_P = 714, /* TYPE_P */ TYPES_P = 715, /* TYPES_P */ UESCAPE = 716, /* UESCAPE */ UNBOUNDED = 717, /* UNBOUNDED */ UNCONDITIONAL = 718, /* UNCONDITIONAL */ UNCOMMITTED = 719, /* UNCOMMITTED */ UNENCRYPTED = 720, /* UNENCRYPTED */ UNION = 721, /* UNION */ UNIQUE = 722, /* UNIQUE */ UNKNOWN = 723, /* UNKNOWN */ UNLISTEN = 724, /* UNLISTEN */ UNLOGGED = 725, /* UNLOGGED */ UNTIL = 726, /* UNTIL */ UPDATE = 727, /* UPDATE */ USER = 728, /* USER */ USING = 729, /* USING */ VACUUM = 730, /* VACUUM */ VALID = 731, /* VALID */ VALIDATE = 732, /* VALIDATE */ VALIDATOR = 733, /* VALIDATOR */ VALUE_P = 734, /* VALUE_P */ VALUES = 735, /* VALUES */ VARCHAR = 736, /* VARCHAR */ VARIADIC = 737, /* VARIADIC */ VARYING = 738, /* VARYING */ VERBOSE = 739, /* VERBOSE */ VERSION_P = 740, /* VERSION_P */ VIEW = 741, /* VIEW */ VIEWS = 742, /* VIEWS */ VIRTUAL = 743, /* VIRTUAL */ VOLATILE = 744, /* VOLATILE */ WHEN = 745, /* WHEN */ WHERE = 746, /* WHERE */ WHITESPACE_P = 747, /* WHITESPACE_P */ WINDOW = 748, /* WINDOW */ WITH = 749, /* WITH */ WITHIN = 750, /* WITHIN */ WITHOUT = 751, /* WITHOUT */ WORK = 752, /* WORK */ WRAPPER = 753, /* WRAPPER */ WRITE = 754, /* WRITE */ XML_P = 755, /* XML_P */ XMLATTRIBUTES = 756, /* XMLATTRIBUTES */ XMLCONCAT = 757, /* XMLCONCAT */ XMLELEMENT = 758, /* XMLELEMENT */ XMLEXISTS = 759, /* XMLEXISTS */ XMLFOREST = 760, /* XMLFOREST */ XMLNAMESPACES = 761, /* XMLNAMESPACES */ XMLPARSE = 762, /* XMLPARSE */ XMLPI = 763, /* XMLPI */ XMLROOT = 764, /* XMLROOT */ XMLSERIALIZE = 765, /* XMLSERIALIZE */ XMLTABLE = 766, /* XMLTABLE */ YEAR_P = 767, /* YEAR_P */ YES_P = 768, /* YES_P */ ZONE = 769, /* ZONE */ FORMAT_LA = 770, /* FORMAT_LA */ NOT_LA = 771, /* NOT_LA */ NULLS_LA = 772, /* NULLS_LA */ WITH_LA = 773, /* WITH_LA */ WITHOUT_LA = 774, /* WITHOUT_LA */ MODE_TYPE_NAME = 775, /* MODE_TYPE_NAME */ MODE_PLPGSQL_EXPR = 776, /* MODE_PLPGSQL_EXPR */ MODE_PLPGSQL_ASSIGN1 = 777, /* MODE_PLPGSQL_ASSIGN1 */ MODE_PLPGSQL_ASSIGN2 = 778, /* MODE_PLPGSQL_ASSIGN2 */ MODE_PLPGSQL_ASSIGN3 = 779, /* MODE_PLPGSQL_ASSIGN3 */ UMINUS = 780 /* UMINUS */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #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 ENFORCED 403 #define ENUM_P 404 #define ERROR_P 405 #define ESCAPE 406 #define EVENT 407 #define EXCEPT 408 #define EXCLUDE 409 #define EXCLUDING 410 #define EXCLUSIVE 411 #define EXECUTE 412 #define EXISTS 413 #define EXPLAIN 414 #define EXPRESSION 415 #define EXTENSION 416 #define EXTERNAL 417 #define EXTRACT 418 #define FALSE_P 419 #define FAMILY 420 #define FETCH 421 #define FILTER 422 #define FINALIZE 423 #define FIRST_P 424 #define FLOAT_P 425 #define FOLLOWING 426 #define FOR 427 #define FORCE 428 #define FOREIGN 429 #define FORMAT 430 #define FORWARD 431 #define FREEZE 432 #define FROM 433 #define FULL 434 #define FUNCTION 435 #define FUNCTIONS 436 #define GENERATED 437 #define GLOBAL 438 #define GRANT 439 #define GRANTED 440 #define GREATEST 441 #define GROUP_P 442 #define GROUPING 443 #define GROUPS 444 #define HANDLER 445 #define HAVING 446 #define HEADER_P 447 #define HOLD 448 #define HOUR_P 449 #define IDENTITY_P 450 #define IF_P 451 #define ILIKE 452 #define IMMEDIATE 453 #define IMMUTABLE 454 #define IMPLICIT_P 455 #define IMPORT_P 456 #define IN_P 457 #define INCLUDE 458 #define INCLUDING 459 #define INCREMENT 460 #define INDENT 461 #define INDEX 462 #define INDEXES 463 #define INHERIT 464 #define INHERITS 465 #define INITIALLY 466 #define INLINE_P 467 #define INNER_P 468 #define INOUT 469 #define INPUT_P 470 #define INSENSITIVE 471 #define INSERT 472 #define INSTEAD 473 #define INT_P 474 #define INTEGER 475 #define INTERSECT 476 #define INTERVAL 477 #define INTO 478 #define INVOKER 479 #define IS 480 #define ISNULL 481 #define ISOLATION 482 #define JOIN 483 #define JSON 484 #define JSON_ARRAY 485 #define JSON_ARRAYAGG 486 #define JSON_EXISTS 487 #define JSON_OBJECT 488 #define JSON_OBJECTAGG 489 #define JSON_QUERY 490 #define JSON_SCALAR 491 #define JSON_SERIALIZE 492 #define JSON_TABLE 493 #define JSON_VALUE 494 #define KEEP 495 #define KEY 496 #define KEYS 497 #define LABEL 498 #define LANGUAGE 499 #define LARGE_P 500 #define LAST_P 501 #define LATERAL_P 502 #define LEADING 503 #define LEAKPROOF 504 #define LEAST 505 #define LEFT 506 #define LEVEL 507 #define LIKE 508 #define LIMIT 509 #define LISTEN 510 #define LOAD 511 #define LOCAL 512 #define LOCALTIME 513 #define LOCALTIMESTAMP 514 #define LOCATION 515 #define LOCK_P 516 #define LOCKED 517 #define LOGGED 518 #define MAPPING 519 #define MATCH 520 #define MATCHED 521 #define MATERIALIZED 522 #define MAXVALUE 523 #define MERGE 524 #define MERGE_ACTION 525 #define METHOD 526 #define MINUTE_P 527 #define MINVALUE 528 #define MODE 529 #define MONTH_P 530 #define MOVE 531 #define NAME_P 532 #define NAMES 533 #define NATIONAL 534 #define NATURAL 535 #define NCHAR 536 #define NESTED 537 #define NEW 538 #define NEXT 539 #define NFC 540 #define NFD 541 #define NFKC 542 #define NFKD 543 #define NO 544 #define NONE 545 #define NORMALIZE 546 #define NORMALIZED 547 #define NOT 548 #define NOTHING 549 #define NOTIFY 550 #define NOTNULL 551 #define NOWAIT 552 #define NULL_P 553 #define NULLIF 554 #define NULLS_P 555 #define NUMERIC 556 #define OBJECT_P 557 #define OBJECTS_P 558 #define OF 559 #define OFF 560 #define OFFSET 561 #define OIDS 562 #define OLD 563 #define OMIT 564 #define ON 565 #define ONLY 566 #define OPERATOR 567 #define OPTION 568 #define OPTIONS 569 #define OR 570 #define ORDER 571 #define ORDINALITY 572 #define OTHERS 573 #define OUT_P 574 #define OUTER_P 575 #define OVER 576 #define OVERLAPS 577 #define OVERLAY 578 #define OVERRIDING 579 #define OWNED 580 #define OWNER 581 #define PARALLEL 582 #define PARAMETER 583 #define PARSER 584 #define PARTIAL 585 #define PARTITION 586 #define PASSING 587 #define PASSWORD 588 #define PATH 589 #define PGPOOL 590 #define PERIOD 591 #define PLACING 592 #define PLAN 593 #define PLANS 594 #define POLICY 595 #define POSITION 596 #define PRECEDING 597 #define PRECISION 598 #define PRESERVE 599 #define PREPARE 600 #define PREPARED 601 #define PRIMARY 602 #define PRIOR 603 #define PRIVILEGES 604 #define PROCEDURAL 605 #define PROCEDURE 606 #define PROCEDURES 607 #define PROGRAM 608 #define PUBLICATION 609 #define QUOTE 610 #define QUOTES 611 #define RANGE 612 #define READ 613 #define REAL 614 #define REASSIGN 615 #define RECURSIVE 616 #define REF_P 617 #define REFERENCES 618 #define REFERENCING 619 #define REFRESH 620 #define REINDEX 621 #define RELATIVE_P 622 #define RELEASE 623 #define RENAME 624 #define REPEATABLE 625 #define REPLACE 626 #define REPLICA 627 #define RESET 628 #define RESTART 629 #define RESTRICT 630 #define RETURN 631 #define RETURNING 632 #define RETURNS 633 #define REVOKE 634 #define RIGHT 635 #define ROLE 636 #define ROLLBACK 637 #define ROLLUP 638 #define ROUTINE 639 #define ROUTINES 640 #define ROW 641 #define ROWS 642 #define RULE 643 #define SAVEPOINT 644 #define SCALAR 645 #define SCHEMA 646 #define SCHEMAS 647 #define SCROLL 648 #define SEARCH 649 #define SECOND_P 650 #define SECURITY 651 #define SELECT 652 #define SEQUENCE 653 #define SEQUENCES 654 #define SERIALIZABLE 655 #define SERVER 656 #define SESSION 657 #define SESSION_USER 658 #define SET 659 #define SETS 660 #define SETOF 661 #define SHARE 662 #define SHOW 663 #define SIMILAR 664 #define SIMPLE 665 #define SKIP 666 #define SMALLINT 667 #define SNAPSHOT 668 #define SOME 669 #define SOURCE 670 #define SQL_P 671 #define STABLE 672 #define STANDALONE_P 673 #define START 674 #define STATEMENT 675 #define STATISTICS 676 #define STDIN 677 #define STDOUT 678 #define STORAGE 679 #define STORED 680 #define STRICT_P 681 #define STRING_P 682 #define STRIP_P 683 #define SUBSCRIPTION 684 #define SUBSTRING 685 #define SUPPORT 686 #define SYMMETRIC 687 #define SYSID 688 #define SYSTEM_P 689 #define SYSTEM_USER 690 #define TABLE 691 #define TABLES 692 #define TABLESAMPLE 693 #define TABLESPACE 694 #define TARGET 695 #define TEMP 696 #define TEMPLATE 697 #define TEMPORARY 698 #define TEXT_P 699 #define THEN 700 #define TIES 701 #define TIME 702 #define TIMESTAMP 703 #define TO 704 #define TRAILING 705 #define TRANSACTION 706 #define TRANSFORM 707 #define TREAT 708 #define TRIGGER 709 #define TRIM 710 #define TRUE_P 711 #define TRUNCATE 712 #define TRUSTED 713 #define TYPE_P 714 #define TYPES_P 715 #define UESCAPE 716 #define UNBOUNDED 717 #define UNCONDITIONAL 718 #define UNCOMMITTED 719 #define UNENCRYPTED 720 #define UNION 721 #define UNIQUE 722 #define UNKNOWN 723 #define UNLISTEN 724 #define UNLOGGED 725 #define UNTIL 726 #define UPDATE 727 #define USER 728 #define USING 729 #define VACUUM 730 #define VALID 731 #define VALIDATE 732 #define VALIDATOR 733 #define VALUE_P 734 #define VALUES 735 #define VARCHAR 736 #define VARIADIC 737 #define VARYING 738 #define VERBOSE 739 #define VERSION_P 740 #define VIEW 741 #define VIEWS 742 #define VIRTUAL 743 #define VOLATILE 744 #define WHEN 745 #define WHERE 746 #define WHITESPACE_P 747 #define WINDOW 748 #define WITH 749 #define WITHIN 750 #define WITHOUT 751 #define WORK 752 #define WRAPPER 753 #define WRITE 754 #define XML_P 755 #define XMLATTRIBUTES 756 #define XMLCONCAT 757 #define XMLELEMENT 758 #define XMLEXISTS 759 #define XMLFOREST 760 #define XMLNAMESPACES 761 #define XMLPARSE 762 #define XMLPI 763 #define XMLROOT 764 #define XMLSERIALIZE 765 #define XMLTABLE 766 #define YEAR_P 767 #define YES_P 768 #define ZONE 769 #define FORMAT_LA 770 #define NOT_LA 771 #define NULLS_LA 772 #define WITH_LA 773 #define WITHOUT_LA 774 #define MODE_TYPE_NAME 775 #define MODE_PLPGSQL_EXPR 776 #define MODE_PLPGSQL_ASSIGN1 777 #define MODE_PLPGSQL_ASSIGN2 778 #define MODE_PLPGSQL_ASSIGN3 779 #define UMINUS 780 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 257 "gram_minimal.y" 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; ReturningClause *retclause; ReturningOptionKind retoptionkind; #line 1171 "gram_minimal.h" }; 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.7.0/src/parser/copyfuncs.c0000644000175000017500000042577415116217422014526 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-2025, PgPool Global Development Group * Portions Copyright (c) 1996-2025, 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) : 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(planId); 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(partPruneInfos); COPY_NODE_FIELD(rtable); COPY_BITMAPSET_FIELD(unprunableRelids); COPY_NODE_FIELD(permInfos); 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(plan.disabled_nodes); 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_STRING_FIELD(returningOldAlias); COPY_STRING_FIELD(returningNewAlias); 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_SCALAR_FIELD(part_prune_index); 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_SCALAR_FIELD(part_prune_index); 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); COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid)); COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid)); COPY_POINTER_FIELD(mergeStrategies, list_length(from->mergeclauses) * sizeof(int)); COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool)); COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * 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_STRING_FIELD(winname); 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(cmpColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(cmpOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(cmpCollations, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(cmpNullsFirst, from->numCols * sizeof(bool)); 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_BITMAPSET_FIELD(relids); 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(leafpart_rti_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_BITMAPSET_FIELD(varnullingrels); COPY_SCALAR_FIELD(varlevelsup); COPY_SCALAR_FIELD(varreturningtype); 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(list_start); COPY_LOCATION_FIELD(list_end); 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(cmptype); 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; } static ReturningExpr * _copyReturningExpr(const ReturningExpr *from) { ReturningExpr *newnode = makeNode(ReturningExpr); COPY_SCALAR_FIELD(retlevelsup); COPY_SCALAR_FIELD(retold); COPY_NODE_FIELD(retexpr); 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_cmptype); 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_NODE_FIELD(groupexprs); 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(reverse_sort); 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(rexpr_list_start); COPY_LOCATION_FIELD(rexpr_list_end); 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(list_start); COPY_LOCATION_FIELD(list_end); 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(is_enforced); 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(generated_kind); COPY_SCALAR_FIELD(nulls_not_distinct); COPY_NODE_FIELD(keys); COPY_SCALAR_FIELD(without_overlaps); 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_with_period); COPY_SCALAR_FIELD(pk_with_period); 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 ReturningOption * _copyReturningOption(const ReturningOption *from) { ReturningOption *newnode = makeNode(ReturningOption); COPY_SCALAR_FIELD(option); COPY_STRING_FIELD(value); COPY_LOCATION_FIELD(location); return newnode; } static ReturningClause * _copyReturningClause(const ReturningClause *from) { ReturningClause *newnode = makeNode(ReturningClause); COPY_NODE_FIELD(options); COPY_NODE_FIELD(exprs); 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(hasGroupRTE); 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_STRING_FIELD(returningOldAlias); COPY_STRING_FIELD(returningNewAlias); 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(returningClause); 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(returningClause); 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(returningClause); 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(returningClause); 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 ATAlterConstraint * _copyATAlterConstraint(const ATAlterConstraint *from) { ATAlterConstraint *newnode = makeNode(ATAlterConstraint); COPY_STRING_FIELD(conname); COPY_SCALAR_FIELD(alterEnforceability); COPY_SCALAR_FIELD(is_enforced); COPY_SCALAR_FIELD(alterDeferrability); COPY_SCALAR_FIELD(deferrable); COPY_SCALAR_FIELD(initdeferred); COPY_SCALAR_FIELD(alterInheritability); COPY_SCALAR_FIELD(noinherit); return newnode; } static ReplicaIdentityStmt * _copyReplicaIdentityStmt(const ReplicaIdentityStmt *from) { ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt); COPY_SCALAR_FIELD(identity_type); COPY_STRING_FIELD(name); 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(nnconstraints); 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(iswithoutoverlaps); 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); COPY_LOCATION_FIELD(location); 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 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(jumble_args); COPY_SCALAR_FIELD(is_local); COPY_LOCATION_FIELD(location); 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 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_SCALAR_FIELD(conenforced); 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_ReturningExpr: retval = _copyReturningExpr(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_ATAlterConstraint: retval = _copyATAlterConstraint(from); break; case T_ReplicaIdentityStmt: retval = _copyReplicaIdentityStmt(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_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_ReturningOption: retval = _copyReturningOption(from); break; case T_ReturningClause: retval = _copyReturningClause(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_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.7.0/src/parser/gram.y0000644000175000017500000174315015116217422013461 00000000000000%{ /*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y * POSTGRESQL BISON rules/actions * * Portions Copyright (c) 2003-2025, PgPool Global Development Group * Portions Copyright (c) 1996-2025, 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' #define ATTRIBUTE_GENERATED_STORED 's' #define ATTRIBUTE_GENERATED_VIRTUAL 'v' /* * 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. Unlike bison's default, we only want * to track the start position not the end position of each nonterminal. * Nonterminals that reduce to empty receive position "-1". Since a * production's leading RHS nonterminal(s) may have reduced to empty, * we have to scan to find the first one that's not -1. */ #define YYLLOC_DEFAULT(Current, Rhs, N) \ do { \ (Current) = (-1); \ for (int _i = 1; _i <= (N); _i++) \ { \ if ((Rhs)[_i] >= 0) \ { \ (Current) = (Rhs)[_i]; \ break; \ } \ } \ } while (0) /* * 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 select_limit & limit_clause productions */ typedef struct SelectLimit { Node *limitOffset; Node *limitCount; LimitOption limitOption; /* indicates presence of WITH TIES */ ParseLoc offsetLoc; /* location of OFFSET token, if present */ ParseLoc countLoc; /* location of LIMIT/FETCH token, if present */ ParseLoc optionLoc; /* location of WITH TIES, if present */ } 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 CAS_NOT_ENFORCED 0x40 #define CAS_ENFORCED 0x80 #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, int end_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, core_yyscan_t yyscanner); 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 *is_enforced, bool *not_valid, bool *no_inherit, core_yyscan_t yyscanner); static PartitionStrategy parsePartitionStrategy(char *strategy, int location, core_yyscan_t yyscanner); 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; ReturningClause *retclause; ReturningOptionKind retoptionkind; } %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_with_clause returning_options 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 returning_clause %type returning_option %type returning_option_kind %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 %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 optionalPeriodName %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 having_clause func_table xmltable array_expr OptWhereClause operator_def_arg %type opt_column_and_period_list %type rowsfrom_item rowsfrom_list opt_col_def_list %type opt_ordinality opt_without_overlaps %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 opt_virtual_or_stored %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 ENFORCED 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 OBJECTS_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 PERIOD PLACING PLAN PLANS POLICY POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROCEDURES PROGRAM PUBLICATION QUOTE QUOTES RANGE READ REAL REASSIGN 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 VIRTUAL 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, @2)); } | MODE_PLPGSQL_ASSIGN1 PLAssignStmt { PLAssignStmt *n = (PLAssignStmt *) $2; n->nnames = 1; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, @2)); } | MODE_PLPGSQL_ASSIGN2 PLAssignStmt { PLAssignStmt *n = (PLAssignStmt *) $2; n->nnames = 2; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, @2)); } | MODE_PLPGSQL_ASSIGN3 PLAssignStmt { PLAssignStmt *n = (PLAssignStmt *) $2; n->nnames = 3; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, @2)); } ; /* * At top level, we wrap each stmt with a RawStmt node carrying start location * and length of the stmt's text. * We also take care to discard empty statements entirely (which among other * things dodges the problem of assigning them a location). */ 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, @3)); else $$ = $1; } | toplevel_stmt { if ($1 != NULL) $$ = list_make1(makeRawStmt($1, @1)); 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 { $$ = 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->jumble_args = true; n->location = -1; $$ = 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->jumble_args = true; n->location = -1; $$ = 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->location = @3; $$ = n; } | var_name '=' var_list { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = $1; n->args = $3; n->location = @3; $$ = n; } | var_name TO DEFAULT { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = $1; n->location = -1; $$ = n; } | var_name '=' DEFAULT { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = $1; n->location = -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->location = -1; $$ = n; } /* Special syntaxes mandated by SQL standard: */ | TIME ZONE zone_value { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "timezone"; n->location = -1; n->jumble_args = true; 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->location = @2; $$ = n; } | NAMES opt_encoding { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "client_encoding"; n->location = @2; 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->location = @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->location = @3; $$ = n; } | SESSION AUTHORIZATION DEFAULT { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; n->location = -1; $$ = 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->jumble_args = true; n->location = -1; $$ = 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->location = @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->location = -1; $$ = n; } | TRANSACTION ISOLATION LEVEL { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; n->location = -1; $$ = n; } | SESSION AUTHORIZATION { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; n->location = -1; $$ = n; } ; generic_reset: var_name { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = $1; n->location = -1; $$ = n; } | ALL { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; n->location = -1; $$ = 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); ATAlterConstraint *c = makeNode(ATAlterConstraint); n->subtype = AT_AlterConstraint; n->def = (Node *) c; c->conname = $3; if ($4 & (CAS_NOT_ENFORCED | CAS_ENFORCED)) c->alterEnforceability = true; if ($4 & (CAS_DEFERRABLE | CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED | CAS_INITIALLY_IMMEDIATE)) c->alterDeferrability = true; if ($4 & CAS_NO_INHERIT) c->alterInheritability = true; /* handle unsupported case with specific error message */ if ($4 & CAS_NOT_VALID) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("constraints cannot be altered to be NOT VALID"), parser_errposition(@4))); processCASbits($4, @4, "FOREIGN KEY", &c->deferrable, &c->initdeferred, &c->is_enforced, NULL, &c->noinherit, yyscanner); $$ = (Node *) n; } /* ALTER TABLE ALTER CONSTRAINT INHERIT */ | ALTER CONSTRAINT name INHERIT { AlterTableCmd *n = makeNode(AlterTableCmd); ATAlterConstraint *c = makeNode(ATAlterConstraint); n->subtype = AT_AlterConstraint; n->def = (Node *) c; c->conname = $3; c->alterInheritability = true; c->noinherit = false; $$ = (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"), parser_errposition(@3))); if (n->remainder == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("remainder for hash partition must be specified"), parser_errposition(@3))); 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 opt_no_inherit { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = @1; n->is_no_inherit = $3; n->is_enforced = true; n->skip_validation = false; n->initially_valid = true; $$ = (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->is_enforced = true; 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 ')' opt_virtual_or_stored { Constraint *n = makeNode(Constraint); n->contype = CONSTR_GENERATED; n->generated_when = $2; n->raw_expr = $5; n->cooked_expr = NULL; n->generated_kind = $7; 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->is_enforced = true; 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; } ; opt_virtual_or_stored: STORED { $$ = ATTRIBUTE_GENERATED_STORED; } | VIRTUAL { $$ = ATTRIBUTE_GENERATED_VIRTUAL; } | /*EMPTY*/ { $$ = ATTRIBUTE_GENERATED_VIRTUAL; } ; /* * 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; } | ENFORCED { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_ENFORCED; n->location = @1; $$ = (Node *) n; } | NOT ENFORCED { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_ENFORCED; 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->is_enforced, &n->skip_validation, &n->is_no_inherit, yyscanner); n->initially_valid = !n->skip_validation; $$ = (Node *) n; } | NOT NULL_P ColId ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = @1; n->keys = list_make1(makeString($3)); processCASbits($4, @4, "NOT NULL", NULL, 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_without_overlaps ')' 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->without_overlaps = $5; n->including = $7; n->options = $8; n->indexname = NULL; n->indexspace = $9; processCASbits($10, @10, "UNIQUE", &n->deferrable, &n->initdeferred, NULL, 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, NULL, yyscanner); $$ = (Node *) n; } | PRIMARY KEY '(' columnList opt_without_overlaps ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = @1; n->keys = $4; n->without_overlaps = $5; n->including = $7; n->options = $8; n->indexname = NULL; n->indexspace = $9; processCASbits($10, @10, "PRIMARY KEY", &n->deferrable, &n->initdeferred, NULL, 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, 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, NULL, yyscanner); $$ = (Node *) n; } | FOREIGN KEY '(' columnList optionalPeriodName ')' REFERENCES qualified_name opt_column_and_period_list key_match key_actions ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_FOREIGN; n->location = @1; n->pktable = $8; n->fk_attrs = $4; if ($5) { n->fk_attrs = lappend(n->fk_attrs, $5); n->fk_with_period = true; } n->pk_attrs = linitial($9); if (lsecond($9)) { n->pk_attrs = lappend(n->pk_attrs, lsecond($9)); n->pk_with_period = true; } n->fk_matchtype = $10; n->fk_upd_action = ($11)->updateAction->action; n->fk_del_action = ($11)->deleteAction->action; n->fk_del_set_cols = ($11)->deleteAction->cols; processCASbits($12, @12, "FOREIGN KEY", &n->deferrable, &n->initdeferred, &n->is_enforced, &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, NULL, &n->skip_validation, &n->is_no_inherit, yyscanner); n->is_enforced = true; 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, NO INHERIT support */ processCASbits($3, @3, "NOT NULL", NULL, NULL, NULL, NULL, NULL, yyscanner); n->initially_valid = true; $$ = (Node *) n; } ; opt_no_inherit: NO INHERIT { $$ = true; } | /* EMPTY */ { $$ = false; } ; opt_without_overlaps: WITHOUT OVERLAPS { $$ = true; } | /*EMPTY*/ { $$ = false; } ; opt_column_list: '(' columnList ')' { $$ = $2; } | /*EMPTY*/ { $$ = NIL; } ; columnList: columnElem { $$ = list_make1($1); } | columnList ',' columnElem { $$ = lappend($1, $3); } ; optionalPeriodName: ',' PERIOD columnElem { $$ = $3; } | /*EMPTY*/ { $$ = NULL; } ; opt_column_and_period_list: '(' columnList optionalPeriodName ')' { $$ = list_make2($2, $3); } | /*EMPTY*/ { $$ = list_make2(NIL, NULL); } ; 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, @3, yyscanner); 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); } | LOGGED { $$ = makeDefElem("logged", NULL, @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 { $$ = 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); } | UNLOGGED { $$ = makeDefElem("unlogged", NULL, @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"), parser_errposition(@1))); 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, 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) || (newspec & (CAS_NOT_ENFORCED | CAS_ENFORCED)) == (CAS_NOT_ENFORCED | CAS_ENFORCED)) 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; } | NOT ENFORCED { $$ = CAS_NOT_ENFORCED; } | ENFORCED { $$ = CAS_ENFORCED; } ; /***************************************************************************** * * 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"), parser_errposition(@1))); $$ = 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 { 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 { 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; } ; 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