From svnnotify ¡÷ sourceforge.jp Thu Dec 6 19:31:32 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 06 Dec 2007 19:31:32 +0900 Subject: [Tritonn-commit 41] [svn] [50] created. Message-ID: <1196937092.414887.23823.nullmailer@users.sourceforge.jp> Revision: 50 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=50 Author: mir Date: 2007-12-06 19:31:31 +0900 (Thu, 06 Dec 2007) Log Message: ----------- created. Added Paths: ----------- trunk/ trunk/AUTHORS trunk/COPYING trunk/ChangeLog trunk/INSTALL trunk/Makefile.am trunk/Makefile.in trunk/NEWS trunk/README trunk/README.windows trunk/TODO trunk/aclocal.m4 trunk/config/ trunk/config/ac_mysql.m4 trunk/config/config.guess trunk/config/config.sub trunk/config/depcomp trunk/config/dtrace.m4 trunk/config/install-sh trunk/config/ltmain.sh trunk/config/missing trunk/config/mkinstalldirs trunk/configure trunk/configure.in trunk/src/ trunk/src/CMakeFiles.txt trunk/src/CMakeLists.txt trunk/src/ChangeLog trunk/src/Makefile trunk/src/Makefile.am trunk/src/Makefile.in trunk/src/NEWS trunk/src/TODO trunk/src/ft_boolean_search.c trunk/src/ft_eval.h trunk/src/ft_nlq_search.c trunk/src/ft_parser.c trunk/src/ft_static.c trunk/src/ft_stem.c trunk/src/ft_stopwords.c trunk/src/ft_test1.h trunk/src/ft_update.c trunk/src/ftdefs.h trunk/src/fulltext.h trunk/src/ha_tritonn.cc trunk/src/ha_tritonn.h trunk/src/mi_cache.c trunk/src/mi_changed.c trunk/src/mi_check.c trunk/src/mi_checksum.c trunk/src/mi_close.c trunk/src/mi_create.c trunk/src/mi_dbug.c trunk/src/mi_delete.c trunk/src/mi_delete_all.c trunk/src/mi_delete_table.c trunk/src/mi_dynrec.c trunk/src/mi_extra.c trunk/src/mi_info.c trunk/src/mi_key.c trunk/src/mi_keycache.c trunk/src/mi_locking.c trunk/src/mi_log.c trunk/src/mi_open.c trunk/src/mi_packrec.c trunk/src/mi_page.c trunk/src/mi_panic.c trunk/src/mi_preload.c trunk/src/mi_range.c trunk/src/mi_rename.c trunk/src/mi_rfirst.c trunk/src/mi_rkey.c trunk/src/mi_rlast.c trunk/src/mi_rnext.c trunk/src/mi_rnext_same.c trunk/src/mi_rprev.c trunk/src/mi_rrnd.c trunk/src/mi_rsame.c trunk/src/mi_rsamepos.c trunk/src/mi_scan.c trunk/src/mi_search.c trunk/src/mi_static.c trunk/src/mi_statrec.c trunk/src/mi_test1.c trunk/src/mi_test2.c trunk/src/mi_test3.c trunk/src/mi_test_all.res trunk/src/mi_test_all.sh trunk/src/mi_unique.c trunk/src/mi_update.c trunk/src/mi_write.c trunk/src/myisam_ftdump.c trunk/src/myisamchk.c trunk/src/myisamdef.h trunk/src/myisamlog.c trunk/src/myisampack.c trunk/src/plug.in trunk/src/rt_index.c trunk/src/rt_index.h trunk/src/rt_key.c trunk/src/rt_key.h trunk/src/rt_mbr.c trunk/src/rt_mbr.h trunk/src/rt_split.c trunk/src/rt_test.c trunk/src/sort.c trunk/src/sp_defs.h trunk/src/sp_key.c trunk/src/sp_test.c Added: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/AUTHORS 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1 @@ +Tetsuro IKEDA | - Original Design Added: trunk/COPYING =================================================================== --- trunk/COPYING 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/COPYING 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,30 @@ +Copyright (c) 2007, Tritonn Project +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + + * 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. + + * Neither the name of TangentOrg or MySQL 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 COPYRIGHT HOLDERS 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 COPYRIGHT +OWNER 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. Added: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/ChangeLog 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,2 @@ +0.0.1 - 2007-12-06 19:09:34 JST + - created Added: trunk/INSTALL =================================================================== --- trunk/INSTALL 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/INSTALL 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,234 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006 Free Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +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. + + 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. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. 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. + +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 `..'. + + 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. + +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'. + + 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. + + 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'. + +Optional Features +================= + +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. + +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 the options to `configure', and exit. + +`--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. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + Added: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/Makefile.am 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,3 @@ +INCLUDES = +SUBDIRS = src +EXTRA_DIST = README.windows Added: trunk/Makefile.in =================================================================== --- trunk/Makefile.in 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/Makefile.in 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,600 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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@ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS TODO config/config.guess \ + config/config.sub config/depcomp config/install-sh \ + config/ltmain.sh config/missing config/mkinstalldirs +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/ac_mysql.m4 \ + $(top_srcdir)/config/dtrace.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DTRACE = @DTRACE@ +DTRACEFLAGS = @DTRACEFLAGS@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +HAVE_DTRACE = @HAVE_DTRACE@ +HAVE_DTRACE_FALSE = @HAVE_DTRACE_FALSE@ +HAVE_DTRACE_TRUE = @HAVE_DTRACE_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MYSQL_INC = @MYSQL_INC@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +INCLUDES = +SUBDIRS = src +EXTRA_DIST = README.windows +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; 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; \ + (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" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + 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 || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/config + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$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 \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { 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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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 + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +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: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-libtool clean-recursive \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-libtool distclean-recursive \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: trunk/NEWS =================================================================== --- trunk/NEWS 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/NEWS 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1 @@ +Please read the ChangeLog Added: trunk/README =================================================================== --- trunk/README 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/README 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,29 @@ +Hi! + +This is an skeleton engine, it does not do much. Its been put together for +documentation reasons and as a way to get someone started quickly. + +To install, grab a copy of the mysql source code and run this: +./configure --with-mysql=/home/brian/mysql-5.1/ --libdir=/usr/local/lib/mysql/ +make install + +And then inside of MySQL: + +mysql> INSTALL PLUGIN skeleton SONAME 'libskeleton_engine.so'; + +mysql> CREATE TABLE `d` (`a` varchar(125), b text, primary key(a)) ENGINE=skeleton DEFAULT +CHARSET=latin1; +Query OK, 0 rows affected (0.01 sec) + +You will probably need to edit the Makefile.am in the src/ tree if you want +to build on anything other then Linux (and the Makefile assumes that the +server was not compiled for debug). + +For Solaris you can enable DTrace probes by adding to configure +--enable-dtrace + +Have fun! + +Cheers, + -Brian + Added: trunk/README.windows =================================================================== --- trunk/README.windows 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/README.windows 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,23 @@ +The following files are changed in order to build a new engine on Windows: + +- Update win\configure.js with +case "WITH_SKELETON_STORAGE_ENGINE": +to make sure it will pass WITH_SKELETON_STORAGE_ENGINE in. + +- Update CMakeFiles.txt under mysql root: + IF(WITH_SKELETON_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_SKELETON_STORAGE_ENGINE) + SET (mysql_plugin_defs + "${mysql_plugin_defs},builtin_skeleton_plugin") + ENDIF(WITH_SKELETON_STORAGE_ENGINE) + + and, + + IF(WITH_SKELETON_STORAGE_ENGINE) + ADD_SUBDIRECTORY(storage/skeleton/src) + ENDIF(WITH_SKELETON_STORAGE_ENGINE) + + - Update CMakeFiles.txt under sql: + IF(WITH_SKELETON_STORAGE_ENGINE) + TARGET_LINK_LIBRARIES(mysqld skeleton) + ENDIF(WITH_SKELETON_STORAGE_ENGINE) Added: trunk/TODO =================================================================== --- trunk/TODO 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/TODO 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,3 @@ +* Porting testsuites +* Documenting + Added: trunk/aclocal.m4 =================================================================== --- trunk/aclocal.m4 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/aclocal.m4 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,7249 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 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. + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 48 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])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_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$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. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$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 conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# 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. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + 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_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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 conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# 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*) + # 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; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + *) + # 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. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + 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` + ;; + 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 +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# --------------------------------------------------------------------- +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#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 + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=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; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +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_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [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="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_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 +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$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:__oline__: $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:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_AC_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 .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_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 +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[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" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +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" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # 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. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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 + 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' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + 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*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + 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' + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + 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 + ;; + 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 + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # 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}${versuffix}$shared_ext ${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`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +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[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $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' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU 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 + 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=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + 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 + export_dynamic_flag_spec='${wl}-Blargedynsym' + 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 + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + 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' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_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="ifelse([$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 <&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 + +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 +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_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 + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +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]) 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 + ;; + +interix3*) + # 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 Linux ELF. +linux*) + 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=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +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 +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-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_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[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_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_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_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++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_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_AC_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 "\-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_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_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_AC_SYS_LIBPATH_AIX + _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_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' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_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; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_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_AC_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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + 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_AC_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_AC_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; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_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=`echo $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; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_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::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_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_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_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=`echo $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; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_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 "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_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=`echo $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; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_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 "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # 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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # 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. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +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 +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([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. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +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... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 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 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# 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. + +# 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//" + +# 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 + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# 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 + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# 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 + +# 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 + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# 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 + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# 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 + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # 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" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# 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]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + 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 + +# 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 + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, 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. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $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 < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_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_save_LIBS" + CFLAGS="$lt_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 -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix3*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # 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*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix3*) + # 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_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # 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. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[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 + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_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' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_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_AC_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_AC_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' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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_AC_TAGVAR(ld_shlibs, $1)=no + cat <&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. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_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_AC_SYS_LIBPATH_AIX + _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # 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. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $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_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_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~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_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' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_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_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +# 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. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +]) + +# Copyright (C) 2002, 2003, 2005 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. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# 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. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +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])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# 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. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# 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. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# 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. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])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 +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +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], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])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) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# 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_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 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 +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 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. + +# serial 2 + +# 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])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 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. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# 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. + +# serial 4 + +# 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 supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 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_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 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. + +# serial 3 + +# _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], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# 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. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# 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 ( + 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 + rm -f conftest.file + 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 + + 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)]) + +# Copyright (C) 2001, 2003, 2005 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="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 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. + +# serial 2 + +# _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. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +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 + Added: trunk/config/ac_mysql.m4 =================================================================== --- trunk/config/ac_mysql.m4 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/ac_mysql.m4 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,25 @@ +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_SRC +dnl --------------------------------------------------------------------------- +AC_DEFUN([MYSQL_SRC_TEST], [ + AC_MSG_CHECKING(for mysql source code) + AC_ARG_WITH(mysql, + [[ --with-mysql[=mysql src directory] + Source requir to build engine.]], + [ + if test -d "$withval/sql"; then + MYSQL_SRC="$i/mysql_config" + fi + + AC_DEFINE([MYSQL_SRC], [1], [Source directory for MySQL]) + MYSQL_INC="-I$withval/sql -I$withval/include -I$withval/regex -I$withval" + AC_MSG_RESULT(["$withval"]) + ], + [ + AC_MSG_ERROR(["no mysql source provided"]) + ]) +]) + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_SRC +dnl --------------------------------------------------------------------------- Added: trunk/config/config.guess =================================================================== --- trunk/config/config.guess 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/config.guess 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1500 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2006-07-02' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi ¡÷ noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee ¡÷ wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + 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:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[3456]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[3456]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-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; } ;; + 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.0*:*) + 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 ;; + 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 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: Property changes on: trunk/config/config.guess ___________________________________________________________________ Name: svn:executable + Added: trunk/config/config.sub =================================================================== --- trunk/config/config.sub 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/config.sub 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1616 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2006-09-20' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # 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 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: Property changes on: trunk/config/config.sub ___________________________________________________________________ Name: svn:executable + Added: trunk/config/depcomp =================================================================== --- trunk/config/depcomp 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/depcomp 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Property changes on: trunk/config/depcomp ___________________________________________________________________ Name: svn:executable + Added: trunk/config/dtrace.m4 =================================================================== --- trunk/config/dtrace.m4 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/dtrace.m4 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,20 @@ +dnl --------------------------------------------------------------------------- +dnl Macro: DTRACE_TEST +dnl --------------------------------------------------------------------------- +AC_ARG_ENABLE(dtrace, + [ --enable-dtrace Build with support for the DTRACE.], + [ + AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support]) + AC_CHECK_PROGS(DTRACE, dtrace) + ENABLE_DTRACE="yes" + AC_SUBST(DTRACEFLAGS) + AC_SUBST(HAVE_DTRACE) + ], + [ + ENABLE_DTRACE="no" + ] + ) +AM_CONDITIONAL([HAVE_DTRACE], [ test "$ENABLE_DTRACE" = "yes" ]) +dnl --------------------------------------------------------------------------- +dnl End Macro: DTRACE_TEST +dnl --------------------------------------------------------------------------- Added: trunk/config/install-sh =================================================================== --- trunk/config/install-sh 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/install-sh 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-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. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + 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 + trap '(exit $?); exit' 1 2 13 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 starting with `-'. + 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 "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now 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. + { + if test -f "$dst"; then + $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 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Property changes on: trunk/config/install-sh ___________________________________________________________________ Name: svn:executable + Added: trunk/config/ltmain.sh =================================================================== --- trunk/config/ltmain.sh 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/ltmain.sh 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,6909 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 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 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# 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. + +basename="s,^.*/,,g" + +# 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 $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# Be Bourne compatible (taken from Autoconf:_AS_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 + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# 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. +func_win32_libid () +{ + 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 + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_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 () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + 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 "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # 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. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # 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 + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + 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 + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + extracted_serial=`expr $extracted_serial + 1` + 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" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + 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 have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2005 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# 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= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # 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= + + 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) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$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,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$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. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + *.obj) xform=obj ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </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." + + $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 + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </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." + + $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 + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + 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 + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + 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 + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + 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 + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + 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*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + 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 + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + 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. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'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\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + 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 test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$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 + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # 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 + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$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 + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$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 "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; 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*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; 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 + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + 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 "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # 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="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + 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]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + 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]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + 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]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + 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 + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. +# for path in $notinst_path; do +# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` +# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` +# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "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 + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$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 "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$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. + $rm conftest.c + cat > conftest.c </dev/null` + 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 "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$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 + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$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 + newdeplibs="$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 + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + 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 is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # 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 "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + 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"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$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" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$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 "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; 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 + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "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"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # 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 + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + 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~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "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" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + 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\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(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 "$mode" = relink; then + $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 + $show "${rm}r $gentop" + $run ${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 + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${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" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + 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 "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$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 "*) ;; + *) finalize_rpath="$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"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$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"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # 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/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + 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*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + else + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + fi + ;; + * ) + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + 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 "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$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 + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "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}\" || 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 + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + 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 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#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 +# 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 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + 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 ("getcwd failed"); + 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 * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# 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. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible (taken from Autoconf:_AS_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 + +# 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 variable: + 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 + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + 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 >> $output "\ + + # 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 $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \$*\" + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # 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 + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_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 + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$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= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "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}\" || 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 + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; 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 "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# 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' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + 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. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$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 "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. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` + else + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run 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 + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$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 + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run 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 + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + 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 + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo 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. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo 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. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "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) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + 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 + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG 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 + fi" + done + + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +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. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [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: $modename [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 + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +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: $modename [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: $modename [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: $modename [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 rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [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 + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -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] + +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: $modename [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." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: Added: trunk/config/missing =================================================================== --- trunk/config/missing 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/missing 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +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 + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Property changes on: trunk/config/missing ___________________________________________________________________ Name: svn:executable + Added: trunk/config/mkinstalldirs =================================================================== --- trunk/config/mkinstalldirs 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/config/mkinstalldirs 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,161 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2006-05-11.19 + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Property changes on: trunk/config/mkinstalldirs ___________________________________________________________________ Name: svn:executable + Added: trunk/configure =================================================================== --- trunk/configure 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/configure 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,20314 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59. +# +# Copyright (C) 2003 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 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+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# 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'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="src/ha_tritonn.cc" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DTRACE DTRACEFLAGS HAVE_DTRACE HAVE_DTRACE_TRUE HAVE_DTRACE_FALSE MYSQL_INC LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# 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. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +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 + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -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 | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$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 ;; + + -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 ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + 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 ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=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 ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + 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'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +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 + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + 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 + + +# 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 its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + 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 + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS + +# +# 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 this package 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 \`..'] + +_ACEOF + + cat <<_ACEOF +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] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_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 + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --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) + --enable-dtrace Build with support for the DTRACE. + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] + include additional configurations [automatic] + --with-mysql[=mysql src directory] + Source requir to build engine. + +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 + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 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 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +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` +hostinfo = `(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=. + echo "PATH: $as_dir" +done + +} >&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_sep= +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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$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 + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >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 + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + 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. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +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 `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`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. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +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 config $srcdir/config; 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 + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +am__api_version="1.9" +# 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. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_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 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +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. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$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' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# 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 ( + 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 + rm -f conftest.file + 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". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +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 $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +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="tritonn_engine" + VERSION=0.0.1 + + +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"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out 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. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$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 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* 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 -std1 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 -std1. */ +int osf4_cc_array ['\x00' == 0 ? 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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext 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 +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +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 + +depcc="$CXX" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +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 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f 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 +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +if test $ac_cv_c_compiler_gnu = yes; then + echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +# Check whether --enable-shared or --disable-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 or --disable-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 --enable-fast-install or --disable-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; + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$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 + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + 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'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +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]) 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 + ;; + +interix3*) + # 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 Linux ELF. +linux*) + 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=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +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 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 whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 4413 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + 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" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f 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 +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + + +esac + +need_locks="$enable_libtool_lock" + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:5313:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +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 + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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*) + # 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; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + *) + # 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. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + 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` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + 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 + +# 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 + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, 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. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$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=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && 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 < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_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 -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 + +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 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 + +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 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +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;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# 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 warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$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 +printf "$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 conftest* + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6376: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6380: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # 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' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # 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' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + interix3*) + # 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 + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # 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='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # 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' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + 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 + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6644: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6648: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$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:6748: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:6752: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # 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_" + # 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. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [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 + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + 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 + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + 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*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + 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/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + 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' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + 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; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # 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; $echo \"$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' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + 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 $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' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&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. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + 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 + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$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 $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 + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + 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")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # 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. + 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 `echo "$deplibs" | $SED -e '\''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' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=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* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${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' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + 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' + 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 linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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 + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 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:$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=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +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" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # 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. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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 + 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' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + 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*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + 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' + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + 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 + ;; + 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 + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # 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}${versuffix}$shared_ext ${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`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +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[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 8217 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $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' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU 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 + 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=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + 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 + export_dynamic_flag_spec='${wl}-Blargedynsym' + 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 + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + 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' + ;; + +uts4*) + version_type=linux + 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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}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" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + 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 + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; 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 + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* 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_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* 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_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#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 + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=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; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && 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 +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#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 + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=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; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && 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 +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$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 + + +# Report which library types will actually be built +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 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 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# 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. + +# 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//" + +# 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 + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# 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 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# 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 + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# 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 + +# 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 + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# 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 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# 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 + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# 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 and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# 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 + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# 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 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 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# 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 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_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 + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # 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" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +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" + + +# Check whether --with-tags or --without-tags was given. +if test "${with_tags+set}" = set; then + withval="$with_tags" + tagnames="$withval" +fi; + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# 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 warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$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 +printf "$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 conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +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++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${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 + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + 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. + archive_cmds_CXX='$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 "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=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_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # 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_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$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. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$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' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=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 + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=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 + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$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; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${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 + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${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_CXX='$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_CXX='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++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + 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. + archive_cmds_CXX='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' + archive_expsym_cmds_CXX='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; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # 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."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$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 + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$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' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$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 + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # 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=`echo $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; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=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::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + 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. + archive_cmds_CXX='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' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # 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=`echo $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; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # 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 "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + 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. + archive_cmds_CXX='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' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='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' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # 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=`echo $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; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # 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 "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$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' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # 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. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$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. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # 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. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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 + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p 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 "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # 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_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # 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_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix3*) + # 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_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # 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*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+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_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11557: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:11561: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$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:11661: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:11665: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_CXX=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 .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +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" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # 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. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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 + 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' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + 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*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + 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' + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + 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 + ;; + 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 + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # 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}${versuffix}$shared_ext ${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`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +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[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 12197 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $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' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU 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 + 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=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + 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 + export_dynamic_flag_spec='${wl}-Blargedynsym' + 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 + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + 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' + ;; + +uts4*) + version_type=linux + 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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6 + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# 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 + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# 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 + +# 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 + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# 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 + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# 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 + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# 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_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +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 +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +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 + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# 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 warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$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 +printf "$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 conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # 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_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # 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_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + interix3*) + # 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_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # 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_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # 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_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-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_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # 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:13255: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:13259: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$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:13359: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:13363: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_F77=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 .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # 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_F77="_GLOBAL_OFFSET_TABLE_" + # 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. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [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 + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$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_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${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_F77='$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_F77='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' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $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_F77=no + cat <&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. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$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_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=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_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # 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_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$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. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$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_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # 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. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$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' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +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" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # 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. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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 + 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' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + 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*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + 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' + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + 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 + ;; + 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 + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # 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}${versuffix}$shared_ext ${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`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +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[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 14808 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $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' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU 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 + 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=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + 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 + export_dynamic_flag_spec='${wl}-Blargedynsym' + 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 + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + 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' + ;; + +uts4*) + version_type=linux + 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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6 + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# 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 + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# 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 + +# 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 + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# 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 + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# 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 + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# 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_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +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" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# 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 warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$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 +printf "$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 conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15586: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15590: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # 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_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # 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_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + interix3*) + # 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_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # 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_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # 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_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-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_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # 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:15854: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15858: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$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:15958: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:15962: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_GCJ=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 .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # 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_GCJ="_GLOBAL_OFFSET_TABLE_" + # 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. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [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 + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$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_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${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_GCJ='$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_GCJ='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' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $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_GCJ=no + cat <&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. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$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_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=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_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # 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_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$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. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$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_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # 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. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${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_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$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' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +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" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # 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. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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 + 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' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + 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*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + 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' + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + 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 + ;; + 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 + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # 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}${versuffix}$shared_ext ${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`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +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[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 17427 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $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' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU 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 + 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=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + 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 + export_dynamic_flag_spec='${wl}-Blargedynsym' + 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 + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + 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' + ;; + +uts4*) + version_type=linux + 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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6 + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# 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 + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# 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 + +# 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 + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# 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 + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# 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 + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# 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_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +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" + + else + tagname="" + fi + ;; + + RC) + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# 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. + +# 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 warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$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 +printf "$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 conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# 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 + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# 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 + +# 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 + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# 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 + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# 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 + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# 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_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +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" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + +LIBTOOL="$LIBTOOL --preserve-dup-deps" + + + + + +# Check whether --enable-dtrace or --disable-dtrace was given. +if test "${enable_dtrace+set}" = set; then + enableval="$enable_dtrace" + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DTRACE 1 +_ACEOF + + for ac_prog in dtrace +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DTRACE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DTRACE"; then + ac_cv_prog_DTRACE="$DTRACE" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DTRACE="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DTRACE=$ac_cv_prog_DTRACE +if test -n "$DTRACE"; then + echo "$as_me:$LINENO: result: $DTRACE" >&5 +echo "${ECHO_T}$DTRACE" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$DTRACE" && break +done + + ENABLE_DTRACE="yes" + + + +else + + ENABLE_DTRACE="no" + + +fi; + + +if test "$ENABLE_DTRACE" = "yes" ; then + HAVE_DTRACE_TRUE= + HAVE_DTRACE_FALSE='#' +else + HAVE_DTRACE_TRUE='#' + HAVE_DTRACE_FALSE= +fi + + + + + echo "$as_me:$LINENO: checking for mysql source code" >&5 +echo $ECHO_N "checking for mysql source code... $ECHO_C" >&6 + +# Check whether --with-mysql or --without-mysql was given. +if test "${with_mysql+set}" = set; then + withval="$with_mysql" + + if test -d "$withval/sql"; then + MYSQL_SRC="$i/mysql_config" + fi + + +cat >>confdefs.h <<\_ACEOF +#define MYSQL_SRC 1 +_ACEOF + + MYSQL_INC="-I$withval/sql -I$withval/include -I$withval/regex -I$withval" + echo "$as_me:$LINENO: result: \"$withval\"" >&5 +echo "${ECHO_T}\"$withval\"" >&6 + +else + + { { echo "$as_me:$LINENO: error: \"no mysql source provided\"" >&5 +echo "$as_me: error: \"no mysql source provided\"" >&2;} + { (exit 1); exit 1; }; } + +fi; + + + +# We only support GCC and Sun's forte at the moment +if test "$GCC" = "yes" +then + CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti" +else + CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -fast -m64" + CXXFLAGS="$CXXFLAGS -noex -mt -D_FORTEC_ -fast -m64" + DTRACEFLAGS="-64" +fi + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* 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"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 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 saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + + + +for ac_header in limits.h syslimits.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + ac_config_files="$ac_config_files Makefile src/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, don't put newlines in cache variables' values. +# 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. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *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 \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + 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}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ 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[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +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_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_DTRACE_TRUE}" && test -z "${HAVE_DTRACE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_DTRACE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_DTRACE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $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} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# 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+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# 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'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -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 + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +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=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + 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 +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + 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_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 to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s, ¡÷ SHELL@,$SHELL,;t t +s, ¡÷ PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s, ¡÷ PACKAGE_NAME@,$PACKAGE_NAME,;t t +s, ¡÷ PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s, ¡÷ PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s, ¡÷ PACKAGE_STRING@,$PACKAGE_STRING,;t t +s, ¡÷ PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s, ¡÷ exec_prefix@,$exec_prefix,;t t +s, ¡÷ prefix@,$prefix,;t t +s, ¡÷ program_transform_name@,$program_transform_name,;t t +s, ¡÷ bindir@,$bindir,;t t +s, ¡÷ sbindir@,$sbindir,;t t +s, ¡÷ libexecdir@,$libexecdir,;t t +s, ¡÷ datadir@,$datadir,;t t +s, ¡÷ sysconfdir@,$sysconfdir,;t t +s, ¡÷ sharedstatedir@,$sharedstatedir,;t t +s, ¡÷ localstatedir@,$localstatedir,;t t +s, ¡÷ libdir@,$libdir,;t t +s, ¡÷ includedir@,$includedir,;t t +s, ¡÷ oldincludedir@,$oldincludedir,;t t +s, ¡÷ infodir@,$infodir,;t t +s, ¡÷ mandir@,$mandir,;t t +s, ¡÷ build_alias@,$build_alias,;t t +s, ¡÷ host_alias@,$host_alias,;t t +s, ¡÷ target_alias@,$target_alias,;t t +s, ¡÷ DEFS@,$DEFS,;t t +s, ¡÷ ECHO_C@,$ECHO_C,;t t +s, ¡÷ ECHO_N@,$ECHO_N,;t t +s, ¡÷ ECHO_T@,$ECHO_T,;t t +s, ¡÷ LIBS@,$LIBS,;t t +s, ¡÷ INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s, ¡÷ INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s, ¡÷ INSTALL_DATA@,$INSTALL_DATA,;t t +s, ¡÷ CYGPATH_W@,$CYGPATH_W,;t t +s, ¡÷ PACKAGE@,$PACKAGE,;t t +s, ¡÷ VERSION@,$VERSION,;t t +s, ¡÷ ACLOCAL@,$ACLOCAL,;t t +s, ¡÷ AUTOCONF@,$AUTOCONF,;t t +s, ¡÷ AUTOMAKE@,$AUTOMAKE,;t t +s, ¡÷ AUTOHEADER@,$AUTOHEADER,;t t +s, ¡÷ MAKEINFO@,$MAKEINFO,;t t +s, ¡÷ install_sh@,$install_sh,;t t +s, ¡÷ STRIP@,$STRIP,;t t +s, ¡÷ ac_ct_STRIP@,$ac_ct_STRIP,;t t +s, ¡÷ INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s, ¡÷ mkdir_p@,$mkdir_p,;t t +s, ¡÷ AWK@,$AWK,;t t +s, ¡÷ SET_MAKE@,$SET_MAKE,;t t +s, ¡÷ am__leading_dot@,$am__leading_dot,;t t +s, ¡÷ AMTAR@,$AMTAR,;t t +s, ¡÷ am__tar@,$am__tar,;t t +s, ¡÷ am__untar@,$am__untar,;t t +s, ¡÷ CC@,$CC,;t t +s, ¡÷ CFLAGS@,$CFLAGS,;t t +s, ¡÷ LDFLAGS@,$LDFLAGS,;t t +s, ¡÷ CPPFLAGS@,$CPPFLAGS,;t t +s, ¡÷ ac_ct_CC@,$ac_ct_CC,;t t +s, ¡÷ EXEEXT@,$EXEEXT,;t t +s, ¡÷ OBJEXT@,$OBJEXT,;t t +s, ¡÷ DEPDIR@,$DEPDIR,;t t +s, ¡÷ am__include@,$am__include,;t t +s, ¡÷ am__quote@,$am__quote,;t t +s, ¡÷ AMDEP_TRUE@,$AMDEP_TRUE,;t t +s, ¡÷ AMDEP_FALSE@,$AMDEP_FALSE,;t t +s, ¡÷ AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s, ¡÷ CCDEPMODE@,$CCDEPMODE,;t t +s, ¡÷ am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s, ¡÷ am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s, ¡÷ CXX@,$CXX,;t t +s, ¡÷ CXXFLAGS@,$CXXFLAGS,;t t +s, ¡÷ ac_ct_CXX@,$ac_ct_CXX,;t t +s, ¡÷ CXXDEPMODE@,$CXXDEPMODE,;t t +s, ¡÷ am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t +s, ¡÷ am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t +s, ¡÷ CPP@,$CPP,;t t +s, ¡÷ EGREP@,$EGREP,;t t +s, ¡÷ build@,$build,;t t +s, ¡÷ build_cpu@,$build_cpu,;t t +s, ¡÷ build_vendor@,$build_vendor,;t t +s, ¡÷ build_os@,$build_os,;t t +s, ¡÷ host@,$host,;t t +s, ¡÷ host_cpu@,$host_cpu,;t t +s, ¡÷ host_vendor@,$host_vendor,;t t +s, ¡÷ host_os@,$host_os,;t t +s, ¡÷ SED@,$SED,;t t +s, ¡÷ LN_S@,$LN_S,;t t +s, ¡÷ ECHO@,$ECHO,;t t +s, ¡÷ AR@,$AR,;t t +s, ¡÷ ac_ct_AR@,$ac_ct_AR,;t t +s, ¡÷ RANLIB@,$RANLIB,;t t +s, ¡÷ ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s, ¡÷ CXXCPP@,$CXXCPP,;t t +s, ¡÷ F77@,$F77,;t t +s, ¡÷ FFLAGS@,$FFLAGS,;t t +s, ¡÷ ac_ct_F77@,$ac_ct_F77,;t t +s, ¡÷ LIBTOOL@,$LIBTOOL,;t t +s, ¡÷ DTRACE@,$DTRACE,;t t +s, ¡÷ DTRACEFLAGS@,$DTRACEFLAGS,;t t +s, ¡÷ HAVE_DTRACE@,$HAVE_DTRACE,;t t +s, ¡÷ HAVE_DTRACE_TRUE@,$HAVE_DTRACE_TRUE,;t t +s, ¡÷ HAVE_DTRACE_FALSE@,$HAVE_DTRACE_FALSE,;t t +s, ¡÷ MYSQL_INC@,$MYSQL_INC,;t t +s, ¡÷ LIBOBJS@,$LIBOBJS,;t t +s, ¡÷ LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # 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. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s, ¡÷ configure_input@,$configure_input,;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, ¡÷ top_builddir@,$ac_top_builddir,;t t +s, ¡÷ abs_top_builddir@,$ac_abs_top_builddir,;t t +s, ¡÷ INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# 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 || { (exit 1); exit 1; } +fi + Property changes on: trunk/configure ___________________________________________________________________ Name: svn:executable + Added: trunk/configure.in =================================================================== --- trunk/configure.in 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/configure.in 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,35 @@ +dnl For Tritonn MySQL Engine +AC_INIT(src/ha_tritonn.cc) +AC_CONFIG_AUX_DIR(config) +dnl AM_CONFIG_HEADER(src/skeleton_config.h) +AM_INIT_AUTOMAKE("tritonn_engine", 0.0.1) + +AC_PROG_CC +AC_PROG_CXX +AC_PROG_CPP +AC_PROG_GCC_TRADITIONAL +AC_PROG_LIBTOOL +LIBTOOL="$LIBTOOL --preserve-dup-deps" +AC_SUBST(LIBTOOL)dnl + +sinclude(config/ac_mysql.m4) +sinclude(config/ac_system.m4) +sinclude(config/dtrace.m4) + +MYSQL_SRC_TEST +AC_SUBST(MYSQL_INC) + +# We only support GCC and Sun's forte at the moment +if test "$GCC" = "yes" +then + CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti" +else + CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -fast -m64" + CXXFLAGS="$CXXFLAGS -noex -mt -D_FORTEC_ -fast -m64" + DTRACEFLAGS="-64" +fi + +AC_C_CONST +AC_TYPE_SIZE_T +AC_CHECK_HEADERS(limits.h syslimits.h) +AC_OUTPUT(Makefile src/Makefile) Added: trunk/src/CMakeFiles.txt =================================================================== --- trunk/src/CMakeFiles.txt 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/CMakeFiles.txt 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,22 @@ +# Copyright (C) 2006 MySQL AB +# +# 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; version 2 of the License. +# +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql + ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/extra/yassl/include) +ADD_LIBRARY(skeleton ha_example.cc) Added: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/CMakeLists.txt 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,60 @@ +# Copyright (C) 2006 MySQL AB +# +# 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; version 2 of the License. +# +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") + +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib + ${CMAKE_SOURCE_DIR}/sql + ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/extra/yassl/include) + +SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c + ha_myisam.cc + ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c + mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c + mi_delete_all.c mi_delete_table.c mi_dynrec.c mi_extra.c mi_info.c + mi_key.c mi_keycache.c mi_locking.c mi_log.c mi_open.c + mi_packrec.c mi_page.c mi_panic.c mi_preload.c mi_range.c mi_rename.c + mi_rfirst.c mi_rlast.c mi_rnext.c mi_rnext_same.c mi_rprev.c mi_rrnd.c + mi_rsame.c mi_rsamepos.c mi_scan.c mi_search.c mi_static.c mi_statrec.c + mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c + rt_split.c sort.c sp_key.c ft_eval.h myisamdef.h rt_index.h mi_rkey.c) + +IF(NOT SOURCE_SUBLIBS) + + ADD_LIBRARY(myisam ${MYISAM_SOURCES}) + + ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c) + TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys debug dbug strings zlib wsock32) + + ADD_EXECUTABLE(myisamchk myisamchk.c) + TARGET_LINK_LIBRARIES(myisamchk myisam mysys debug dbug strings zlib wsock32) + + ADD_EXECUTABLE(myisamlog myisamlog.c) + TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32) + + ADD_EXECUTABLE(myisampack myisampack.c) + TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32) + + IF(EMBED_MANIFESTS) + MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker") + MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker") + MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker") + MYSQL_EMBED_MANIFEST("myisampack" "asInvoker") + ENDIF(EMBED_MANIFESTS) + +ENDIF(NOT SOURCE_SUBLIBS) Property changes on: trunk/src/CMakeLists.txt ___________________________________________________________________ Name: svn:executable + Added: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ChangeLog 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1 @@ + Added: trunk/src/Makefile =================================================================== --- trunk/src/Makefile 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/Makefile 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,671 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# src/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + + + +# Copyright (C) 2000-2006 MySQL AB +# +# 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; version 2 of the License. +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + +srcdir = . +top_srcdir = .. + +pkgdatadir = $(datadir)/tritonn_engine +pkglibdir = $(libdir)/tritonn_engine +pkgincludedir = $(includedir)/tritonn_engine +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = /usr/bin/install -c +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 = i686-pc-linux-gnu +host_triplet = i686-pc-linux-gnu +subdir = src +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ChangeLog NEWS TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/ac_mysql.m4 \ + $(top_srcdir)/config/dtrace.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_CLEAN_FILES = +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 = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libdir)" +pkglibLIBRARIES_INSTALL = $(INSTALL_DATA) +LIBRARIES = $(pkglib_LIBRARIES) +ARFLAGS = cru +libtritonn_a_AR = $(AR) $(ARFLAGS) +libtritonn_a_LIBADD = +am_libtritonn_a_OBJECTS = mi_open.$(OBJEXT) mi_extra.$(OBJEXT) \ + mi_info.$(OBJEXT) mi_rkey.$(OBJEXT) mi_rnext.$(OBJEXT) \ + mi_rnext_same.$(OBJEXT) mi_search.$(OBJEXT) mi_page.$(OBJEXT) \ + mi_key.$(OBJEXT) mi_locking.$(OBJEXT) mi_rrnd.$(OBJEXT) \ + mi_scan.$(OBJEXT) mi_cache.$(OBJEXT) mi_statrec.$(OBJEXT) \ + mi_packrec.$(OBJEXT) mi_dynrec.$(OBJEXT) mi_update.$(OBJEXT) \ + mi_write.$(OBJEXT) mi_unique.$(OBJEXT) mi_delete.$(OBJEXT) \ + mi_rprev.$(OBJEXT) mi_rfirst.$(OBJEXT) mi_rlast.$(OBJEXT) \ + mi_rsame.$(OBJEXT) mi_rsamepos.$(OBJEXT) mi_panic.$(OBJEXT) \ + mi_close.$(OBJEXT) mi_create.$(OBJEXT) mi_range.$(OBJEXT) \ + mi_dbug.$(OBJEXT) mi_checksum.$(OBJEXT) mi_log.$(OBJEXT) \ + mi_changed.$(OBJEXT) mi_static.$(OBJEXT) \ + mi_delete_all.$(OBJEXT) mi_delete_table.$(OBJEXT) \ + mi_rename.$(OBJEXT) mi_check.$(OBJEXT) mi_keycache.$(OBJEXT) \ + mi_preload.$(OBJEXT) ft_parser.$(OBJEXT) \ + ft_stopwords.$(OBJEXT) ft_static.$(OBJEXT) ft_update.$(OBJEXT) \ + ft_boolean_search.$(OBJEXT) ft_nlq_search.$(OBJEXT) \ + sort.$(OBJEXT) ha_tritonn.$(OBJEXT) rt_index.$(OBJEXT) \ + rt_key.$(OBJEXT) rt_mbr.$(OBJEXT) rt_split.$(OBJEXT) \ + sp_key.$(OBJEXT) +libtritonn_a_OBJECTS = $(am_libtritonn_a_OBJECTS) +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libtritonn_engine_la_DEPENDENCIES = +am_libtritonn_engine_la_OBJECTS = libtritonn_engine_la-ha_tritonn.lo +libtritonn_engine_la_OBJECTS = $(am_libtritonn_engine_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libtritonn_a_SOURCES) $(libtritonn_engine_la_SOURCES) +DIST_SOURCES = $(libtritonn_a_SOURCES) $(libtritonn_engine_la_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/mir/dev/tritonn_engine/config/missing --run aclocal-1.9 +AMDEP_FALSE = # +AMDEP_TRUE = +AMTAR = ${SHELL} /home/mir/dev/tritonn_engine/config/missing --run tar +AR = ar +AUTOCONF = ${SHELL} /home/mir/dev/tritonn_engine/config/missing --run autoconf +AUTOHEADER = ${SHELL} /home/mir/dev/tritonn_engine/config/missing --run autoheader +AUTOMAKE = ${SHELL} /home/mir/dev/tritonn_engine/config/missing --run automake-1.9 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 -fno-implicit-templates -fno-exceptions -fno-rtti +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"tritonn_engine\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DMYSQL_SRC=1 -DHAVE_LIMITS_H=1 +DEPDIR = .deps +DTRACE = +DTRACEFLAGS = +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = grep -E +EXEEXT = +F77 = g77 +FFLAGS = -g -O2 +HAVE_DTRACE = +HAVE_DTRACE_FALSE = +HAVE_DTRACE_TRUE = # +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +LDFLAGS = +LIBOBJS = +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool --preserve-dup-deps +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /home/mir/dev/tritonn_engine/config/missing --run makeinfo +MYSQL_INC = -I/home/mir/dev/mysql-5.1.22-rc/sql -I/home/mir/dev/mysql-5.1.22-rc/include -I/home/mir/dev/mysql-5.1.22-rc/regex -I/home/mir/dev/mysql-5.1.22-rc +OBJEXT = o +PACKAGE = tritonn_engine +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.1 +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = g77 +ac_ct_RANLIB = ranlib +ac_ct_STRIP = strip +am__fastdepCC_FALSE = # +am__fastdepCC_TRUE = +am__fastdepCXX_FALSE = # +am__fastdepCXX_TRUE = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-linux-gnu +build_alias = +build_cpu = i686 +build_os = linux-gnu +build_vendor = pc +datadir = ${prefix}/share +exec_prefix = ${prefix} +host = i686-pc-linux-gnu +host_alias = +host_cpu = i686 +host_os = linux-gnu +host_vendor = pc +includedir = ${prefix}/include +infodir = ${prefix}/info +install_sh = /home/mir/dev/tritonn_engine/config/install-sh +libdir = /usr/local/mysql/lib/mysql +libexecdir = ${exec_prefix}/libexec +localstatedir = ${prefix}/var +mandir = ${prefix}/man +mkdir_p = mkdir -p -- +oldincludedir = /usr/include +prefix = /usr/local +program_transform_name = s,x,x, +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +sysconfdir = ${prefix}/etc +target_alias = +MYSQLDATAdir = $(localstatedir) +MYSQLSHAREdir = $(pkgdatadir) +MYSQLBASEdir = $(prefix) +MYSQLLIBdir = $(pkglibdir) +INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \ + -I$(top_srcdir)/regex \ + -I$(top_srcdir)/sql \ + -I$(srcdir) $(MYSQL_INC) + +lib_LTLIBRARIES = libtritonn_engine.la +libtritonn_engine_la_SOURCES = ha_tritonn.cc +libtritonn_engine_la_LIBADD = +libtritonn_engine_la_LDFLAGS = -module +libtritonn_engine_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +libtritonn_engine_la_CXXFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +WRAPLIBS = +LDADD = +EXTRA_DIST = ft_stem.c CMakeLists.txt plug.in +pkglib_LIBRARIES = libtritonn.a +noinst_HEADERS = myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h \ + fulltext.h ftdefs.h ft_test1.h ft_eval.h \ + ha_tritonn.h + +libtritonn_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \ + mi_rnext.c mi_rnext_same.c \ + mi_search.c mi_page.c mi_key.c mi_locking.c \ + mi_rrnd.c mi_scan.c mi_cache.c \ + mi_statrec.c mi_packrec.c mi_dynrec.c \ + mi_update.c mi_write.c mi_unique.c \ + mi_delete.c \ + mi_rprev.c mi_rfirst.c mi_rlast.c mi_rsame.c \ + mi_rsamepos.c mi_panic.c mi_close.c mi_create.c\ + mi_range.c mi_dbug.c mi_checksum.c mi_log.c \ + mi_changed.c mi_static.c mi_delete_all.c \ + mi_delete_table.c mi_rename.c mi_check.c \ + mi_keycache.c mi_preload.c \ + ft_parser.c ft_stopwords.c ft_static.c \ + ft_update.c ft_boolean_search.c ft_nlq_search.c sort.c \ + ha_tritonn.cc \ + rt_index.c rt_key.c rt_mbr.c rt_split.c sp_key.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLIBRARIES: $(pkglib_LIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(pkglibLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(pkglibLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(pkglib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + p=$(am__strip_dir) \ + echo " $(RANLIB) '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(RANLIB) "$(DESTDIR)$(pkglibdir)/$$p"; \ + else :; fi; \ + done + +uninstall-pkglibLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLIBRARIES: + -test -z "$(pkglib_LIBRARIES)" || rm -f $(pkglib_LIBRARIES) +libtritonn.a: $(libtritonn_a_OBJECTS) $(libtritonn_a_DEPENDENCIES) + -rm -f libtritonn.a + $(libtritonn_a_AR) libtritonn.a $(libtritonn_a_OBJECTS) $(libtritonn_a_LIBADD) + $(RANLIB) libtritonn.a +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libtritonn_engine.la: $(libtritonn_engine_la_OBJECTS) $(libtritonn_engine_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libtritonn_engine_la_LDFLAGS) $(libtritonn_engine_la_OBJECTS) $(libtritonn_engine_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/ft_boolean_search.Po +include ./$(DEPDIR)/ft_nlq_search.Po +include ./$(DEPDIR)/ft_parser.Po +include ./$(DEPDIR)/ft_static.Po +include ./$(DEPDIR)/ft_stopwords.Po +include ./$(DEPDIR)/ft_update.Po +include ./$(DEPDIR)/ha_tritonn.Po +include ./$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Plo +include ./$(DEPDIR)/mi_cache.Po +include ./$(DEPDIR)/mi_changed.Po +include ./$(DEPDIR)/mi_check.Po +include ./$(DEPDIR)/mi_checksum.Po +include ./$(DEPDIR)/mi_close.Po +include ./$(DEPDIR)/mi_create.Po +include ./$(DEPDIR)/mi_dbug.Po +include ./$(DEPDIR)/mi_delete.Po +include ./$(DEPDIR)/mi_delete_all.Po +include ./$(DEPDIR)/mi_delete_table.Po +include ./$(DEPDIR)/mi_dynrec.Po +include ./$(DEPDIR)/mi_extra.Po +include ./$(DEPDIR)/mi_info.Po +include ./$(DEPDIR)/mi_key.Po +include ./$(DEPDIR)/mi_keycache.Po +include ./$(DEPDIR)/mi_locking.Po +include ./$(DEPDIR)/mi_log.Po +include ./$(DEPDIR)/mi_open.Po +include ./$(DEPDIR)/mi_packrec.Po +include ./$(DEPDIR)/mi_page.Po +include ./$(DEPDIR)/mi_panic.Po +include ./$(DEPDIR)/mi_preload.Po +include ./$(DEPDIR)/mi_range.Po +include ./$(DEPDIR)/mi_rename.Po +include ./$(DEPDIR)/mi_rfirst.Po +include ./$(DEPDIR)/mi_rkey.Po +include ./$(DEPDIR)/mi_rlast.Po +include ./$(DEPDIR)/mi_rnext.Po +include ./$(DEPDIR)/mi_rnext_same.Po +include ./$(DEPDIR)/mi_rprev.Po +include ./$(DEPDIR)/mi_rrnd.Po +include ./$(DEPDIR)/mi_rsame.Po +include ./$(DEPDIR)/mi_rsamepos.Po +include ./$(DEPDIR)/mi_scan.Po +include ./$(DEPDIR)/mi_search.Po +include ./$(DEPDIR)/mi_static.Po +include ./$(DEPDIR)/mi_statrec.Po +include ./$(DEPDIR)/mi_unique.Po +include ./$(DEPDIR)/mi_update.Po +include ./$(DEPDIR)/mi_write.Po +include ./$(DEPDIR)/rt_index.Po +include ./$(DEPDIR)/rt_key.Po +include ./$(DEPDIR)/rt_mbr.Po +include ./$(DEPDIR)/rt_split.Po +include ./$(DEPDIR)/sort.Po +include ./$(DEPDIR)/sp_key.Po + +.c.o: + if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ + then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +.cc.o: + if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: + if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ + then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: + if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(LTCXXCOMPILE) -c -o $@ $< + +libtritonn_engine_la-ha_tritonn.lo: ha_tritonn.cc + if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtritonn_engine_la_CXXFLAGS) $(CXXFLAGS) -MT libtritonn_engine_la-ha_tritonn.lo -MD -MP -MF "$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Tpo" -c -o libtritonn_engine_la-ha_tritonn.lo `test -f 'ha_tritonn.cc' || echo '$(srcdir)/'`ha_tritonn.cc; \ + then mv -f "$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Tpo" "$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Plo"; else rm -f "$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Tpo"; exit 1; fi +# source='ha_tritonn.cc' object='libtritonn_engine_la-ha_tritonn.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtritonn_engine_la_CXXFLAGS) $(CXXFLAGS) -c -o libtritonn_engine_la-ha_tritonn.lo `test -f 'ha_tritonn.cc' || echo '$(srcdir)/'`ha_tritonn.cc + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$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) $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-pkglibLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES install-pkglibLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-pkglibLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-pkglibLIBRARIES ctags \ + 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-exec install-exec-am install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-pkglibLIBRARIES 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 uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES uninstall-pkglibLIBRARIES + +#CLEANFILES = test?.MY? FT?.MY? isam.log mi_test_all rt_test.MY? sp_test.MY? + +# Move to automake rules ? +prolint:; plparse -b -u -hF1 "-width(0,0)" "-format=%f:%l:\s%t:%n\s%m" \ + "-elib(????)" "+elib(?3??)" my.lnt $(nisam_SOURCES) + +# Don't update the files from bitkeeper +%::SCCS/s.% +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/Makefile.am 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,70 @@ +# Copyright (C) 2000-2006 MySQL AB +# +# 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; version 2 of the License. +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +MYSQLDATAdir = $(localstatedir) +MYSQLSHAREdir = $(pkgdatadir) +MYSQLBASEdir= $(prefix) +MYSQLLIBdir= $(pkglibdir) +INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \ + -I$(top_srcdir)/regex \ + -I$(top_srcdir)/sql \ + -I$(srcdir) $(MYSQL_INC) + +lib_LTLIBRARIES = libtritonn_engine.la +libtritonn_engine_la_SOURCES = ha_tritonn.cc +libtritonn_engine_la_LIBADD = +libtritonn_engine_la_LDFLAGS = -module +libtritonn_engine_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +libtritonn_engine_la_CXXFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN + + +WRAPLIBS= + +LDADD = + +DEFS = @DEFS@ + +EXTRA_DIST = ft_stem.c CMakeLists.txt plug.in + + +pkglib_LIBRARIES = libtritonn.a +noinst_HEADERS = myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h \ + fulltext.h ftdefs.h ft_test1.h ft_eval.h \ + ha_tritonn.h +libtritonn_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \ + mi_rnext.c mi_rnext_same.c \ + mi_search.c mi_page.c mi_key.c mi_locking.c \ + mi_rrnd.c mi_scan.c mi_cache.c \ + mi_statrec.c mi_packrec.c mi_dynrec.c \ + mi_update.c mi_write.c mi_unique.c \ + mi_delete.c \ + mi_rprev.c mi_rfirst.c mi_rlast.c mi_rsame.c \ + mi_rsamepos.c mi_panic.c mi_close.c mi_create.c\ + mi_range.c mi_dbug.c mi_checksum.c mi_log.c \ + mi_changed.c mi_static.c mi_delete_all.c \ + mi_delete_table.c mi_rename.c mi_check.c \ + mi_keycache.c mi_preload.c \ + ft_parser.c ft_stopwords.c ft_static.c \ + ft_update.c ft_boolean_search.c ft_nlq_search.c sort.c \ + ha_tritonn.cc \ + rt_index.c rt_key.c rt_mbr.c rt_split.c sp_key.c +#CLEANFILES = test?.MY? FT?.MY? isam.log mi_test_all rt_test.MY? sp_test.MY? + +# Move to automake rules ? +prolint:; plparse -b -u -hF1 "-width(0,0)" "-format=%f:%l:\s%t:%n\s%m" \ + "-elib(????)" "+elib(?3??)" my.lnt $(nisam_SOURCES) + +# Don't update the files from bitkeeper +%::SCCS/s.% Added: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/Makefile.in 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,671 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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@ + +# Copyright (C) 2000-2006 MySQL AB +# +# 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; version 2 of the License. +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ChangeLog NEWS TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/ac_mysql.m4 \ + $(top_srcdir)/config/dtrace.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_CLEAN_FILES = +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 = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libdir)" +pkglibLIBRARIES_INSTALL = $(INSTALL_DATA) +LIBRARIES = $(pkglib_LIBRARIES) +ARFLAGS = cru +libtritonn_a_AR = $(AR) $(ARFLAGS) +libtritonn_a_LIBADD = +am_libtritonn_a_OBJECTS = mi_open.$(OBJEXT) mi_extra.$(OBJEXT) \ + mi_info.$(OBJEXT) mi_rkey.$(OBJEXT) mi_rnext.$(OBJEXT) \ + mi_rnext_same.$(OBJEXT) mi_search.$(OBJEXT) mi_page.$(OBJEXT) \ + mi_key.$(OBJEXT) mi_locking.$(OBJEXT) mi_rrnd.$(OBJEXT) \ + mi_scan.$(OBJEXT) mi_cache.$(OBJEXT) mi_statrec.$(OBJEXT) \ + mi_packrec.$(OBJEXT) mi_dynrec.$(OBJEXT) mi_update.$(OBJEXT) \ + mi_write.$(OBJEXT) mi_unique.$(OBJEXT) mi_delete.$(OBJEXT) \ + mi_rprev.$(OBJEXT) mi_rfirst.$(OBJEXT) mi_rlast.$(OBJEXT) \ + mi_rsame.$(OBJEXT) mi_rsamepos.$(OBJEXT) mi_panic.$(OBJEXT) \ + mi_close.$(OBJEXT) mi_create.$(OBJEXT) mi_range.$(OBJEXT) \ + mi_dbug.$(OBJEXT) mi_checksum.$(OBJEXT) mi_log.$(OBJEXT) \ + mi_changed.$(OBJEXT) mi_static.$(OBJEXT) \ + mi_delete_all.$(OBJEXT) mi_delete_table.$(OBJEXT) \ + mi_rename.$(OBJEXT) mi_check.$(OBJEXT) mi_keycache.$(OBJEXT) \ + mi_preload.$(OBJEXT) ft_parser.$(OBJEXT) \ + ft_stopwords.$(OBJEXT) ft_static.$(OBJEXT) ft_update.$(OBJEXT) \ + ft_boolean_search.$(OBJEXT) ft_nlq_search.$(OBJEXT) \ + sort.$(OBJEXT) ha_tritonn.$(OBJEXT) rt_index.$(OBJEXT) \ + rt_key.$(OBJEXT) rt_mbr.$(OBJEXT) rt_split.$(OBJEXT) \ + sp_key.$(OBJEXT) +libtritonn_a_OBJECTS = $(am_libtritonn_a_OBJECTS) +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libtritonn_engine_la_DEPENDENCIES = +am_libtritonn_engine_la_OBJECTS = libtritonn_engine_la-ha_tritonn.lo +libtritonn_engine_la_OBJECTS = $(am_libtritonn_engine_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libtritonn_a_SOURCES) $(libtritonn_engine_la_SOURCES) +DIST_SOURCES = $(libtritonn_a_SOURCES) $(libtritonn_engine_la_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DTRACE = @DTRACE@ +DTRACEFLAGS = @DTRACEFLAGS@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +HAVE_DTRACE = @HAVE_DTRACE@ +HAVE_DTRACE_FALSE = @HAVE_DTRACE_FALSE@ +HAVE_DTRACE_TRUE = @HAVE_DTRACE_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MYSQL_INC = @MYSQL_INC@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +MYSQLDATAdir = $(localstatedir) +MYSQLSHAREdir = $(pkgdatadir) +MYSQLBASEdir = $(prefix) +MYSQLLIBdir = $(pkglibdir) +INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \ + -I$(top_srcdir)/regex \ + -I$(top_srcdir)/sql \ + -I$(srcdir) $(MYSQL_INC) + +lib_LTLIBRARIES = libtritonn_engine.la +libtritonn_engine_la_SOURCES = ha_tritonn.cc +libtritonn_engine_la_LIBADD = +libtritonn_engine_la_LDFLAGS = -module +libtritonn_engine_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +libtritonn_engine_la_CXXFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +WRAPLIBS = +LDADD = +EXTRA_DIST = ft_stem.c CMakeLists.txt plug.in +pkglib_LIBRARIES = libtritonn.a +noinst_HEADERS = myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h \ + fulltext.h ftdefs.h ft_test1.h ft_eval.h \ + ha_tritonn.h + +libtritonn_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \ + mi_rnext.c mi_rnext_same.c \ + mi_search.c mi_page.c mi_key.c mi_locking.c \ + mi_rrnd.c mi_scan.c mi_cache.c \ + mi_statrec.c mi_packrec.c mi_dynrec.c \ + mi_update.c mi_write.c mi_unique.c \ + mi_delete.c \ + mi_rprev.c mi_rfirst.c mi_rlast.c mi_rsame.c \ + mi_rsamepos.c mi_panic.c mi_close.c mi_create.c\ + mi_range.c mi_dbug.c mi_checksum.c mi_log.c \ + mi_changed.c mi_static.c mi_delete_all.c \ + mi_delete_table.c mi_rename.c mi_check.c \ + mi_keycache.c mi_preload.c \ + ft_parser.c ft_stopwords.c ft_static.c \ + ft_update.c ft_boolean_search.c ft_nlq_search.c sort.c \ + ha_tritonn.cc \ + rt_index.c rt_key.c rt_mbr.c rt_split.c sp_key.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLIBRARIES: $(pkglib_LIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(pkglibLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(pkglibLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(pkglib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + p=$(am__strip_dir) \ + echo " $(RANLIB) '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(RANLIB) "$(DESTDIR)$(pkglibdir)/$$p"; \ + else :; fi; \ + done + +uninstall-pkglibLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLIBRARIES: + -test -z "$(pkglib_LIBRARIES)" || rm -f $(pkglib_LIBRARIES) +libtritonn.a: $(libtritonn_a_OBJECTS) $(libtritonn_a_DEPENDENCIES) + -rm -f libtritonn.a + $(libtritonn_a_AR) libtritonn.a $(libtritonn_a_OBJECTS) $(libtritonn_a_LIBADD) + $(RANLIB) libtritonn.a +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libtritonn_engine.la: $(libtritonn_engine_la_OBJECTS) $(libtritonn_engine_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libtritonn_engine_la_LDFLAGS) $(libtritonn_engine_la_OBJECTS) $(libtritonn_engine_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/ft_boolean_search.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/ft_nlq_search.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/ft_parser.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/ft_static.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/ft_stopwords.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/ft_update.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/ha_tritonn.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Plo ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_cache.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_changed.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_check.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_checksum.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_close.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_create.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_dbug.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_delete.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_delete_all.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_delete_table.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_dynrec.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_extra.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_info.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_key.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_keycache.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_locking.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_log.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_open.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_packrec.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_page.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_panic.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_preload.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_range.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rename.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rfirst.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rkey.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rlast.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rnext.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rnext_same.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rprev.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rrnd.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rsame.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_rsamepos.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_scan.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_search.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_static.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_statrec.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_unique.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_update.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/mi_write.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/rt_index.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/rt_key.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/rt_mbr.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/rt_split.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/sort.Po ¡÷ am__quote@ + ¡÷ AMDEP_TRUE@@am__include@ @am__quote ¡÷ ./$(DEPDIR)/sp_key.Po ¡÷ am__quote@ + +.c.o: + ¡÷ am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + ¡÷ am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + ¡÷ AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + ¡÷ AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + ¡÷ am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: + ¡÷ am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ + ¡÷ am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + ¡÷ AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + ¡÷ AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + ¡÷ am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + ¡÷ am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + ¡÷ am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + ¡÷ AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ + ¡÷ AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + ¡÷ am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +.cc.o: + ¡÷ am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + ¡÷ am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + ¡÷ AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + ¡÷ AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + ¡÷ am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: + ¡÷ am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ + ¡÷ am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + ¡÷ AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + ¡÷ AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + ¡÷ am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: + ¡÷ am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + ¡÷ am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + ¡÷ AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ + ¡÷ AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + ¡÷ am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libtritonn_engine_la-ha_tritonn.lo: ha_tritonn.cc + ¡÷ am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtritonn_engine_la_CXXFLAGS) $(CXXFLAGS) -MT libtritonn_engine_la-ha_tritonn.lo -MD -MP -MF "$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Tpo" -c -o libtritonn_engine_la-ha_tritonn.lo `test -f 'ha_tritonn.cc' || echo '$(srcdir)/'`ha_tritonn.cc; \ + ¡÷ am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Tpo" "$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Plo"; else rm -f "$(DEPDIR)/libtritonn_engine_la-ha_tritonn.Tpo"; exit 1; fi + ¡÷ AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ha_tritonn.cc' object='libtritonn_engine_la-ha_tritonn.lo' libtool=yes @AMDEPBACKSLASH@ + ¡÷ AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + ¡÷ am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtritonn_engine_la_CXXFLAGS) $(CXXFLAGS) -c -o libtritonn_engine_la-ha_tritonn.lo `test -f 'ha_tritonn.cc' || echo '$(srcdir)/'`ha_tritonn.cc + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$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) $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-pkglibLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES install-pkglibLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-pkglibLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-pkglibLIBRARIES ctags \ + 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-exec install-exec-am install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-pkglibLIBRARIES 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 uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES uninstall-pkglibLIBRARIES + +#CLEANFILES = test?.MY? FT?.MY? isam.log mi_test_all rt_test.MY? sp_test.MY? + +# Move to automake rules ? +prolint:; plparse -b -u -hF1 "-width(0,0)" "-format=%f:%l:\s%t:%n\s%m" \ + "-elib(????)" "+elib(?3??)" my.lnt $(nisam_SOURCES) + +# Don't update the files from bitkeeper +%::SCCS/s.% +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: trunk/src/NEWS =================================================================== --- trunk/src/NEWS 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/NEWS 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1 @@ + Added: trunk/src/TODO =================================================================== --- trunk/src/TODO 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/TODO 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,2 @@ +TODO: +- Porting tritonn patches \ No newline at end of file Added: trunk/src/ft_boolean_search.c =================================================================== --- trunk/src/ft_boolean_search.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_boolean_search.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,998 @@ +/* Copyright (C) 2001-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +/* TODO: add caching - pre-read several index entries at once */ + +/* + Added optimization for full-text queries with plus-words. It was + implemented by sharing maximal document id (max_docid) variable + inside plus subtree. max_docid could be used by any word in plus + subtree, but it could be updated by plus-word only. + + Fulltext "smarter index merge" optimization assumes that rows + it gets are ordered by doc_id. That is not the case when we + search for a word with truncation operator. It may return + rows in random order. Thus we may not use "smarter index merge" + optimization with "trunc-words". + + The idea is: there is no need to search for docid smaller than + biggest docid inside current plus subtree or any upper plus subtree. + + Examples: + +word1 word2 + share same max_docid + max_docid updated by word1 + +word1 +(word2 word3) + share same max_docid + max_docid updated by word1 + +(word1 -word2) +(+word3 word4) + share same max_docid + max_docid updated by word3 + +word1 word2 (+word3 word4 (+word5 word6)) + three subexpressions (including the top-level one), + every one has its own max_docid, updated by its plus word. + but for the search word6 uses + max(word1.max_docid, word3.max_docid, word5.max_docid), + while word4 uses, accordingly, + max(word1.max_docid, word3.max_docid). +*/ + +#define FT_CORE +#include "ftdefs.h" + +/* search with boolean queries */ + +static double _wghts[11]= +{ + 0.131687242798354, + 0.197530864197531, + 0.296296296296296, + 0.444444444444444, + 0.666666666666667, + 1.000000000000000, + 1.500000000000000, + 2.250000000000000, + 3.375000000000000, + 5.062500000000000, + 7.593750000000000}; +static double *wghts=_wghts+5; /* wghts[i] = 1.5**i */ + +static double _nwghts[11]= +{ + -0.065843621399177, + -0.098765432098766, + -0.148148148148148, + -0.222222222222222, + -0.333333333333334, + -0.500000000000000, + -0.750000000000000, + -1.125000000000000, + -1.687500000000000, + -2.531250000000000, + -3.796875000000000}; +static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */ + +#define FTB_FLAG_TRUNC 1 +/* At most one of the following flags can be set */ +#define FTB_FLAG_YES 2 +#define FTB_FLAG_NO 4 +#define FTB_FLAG_WONLY 8 + +typedef struct st_ftb_expr FTB_EXPR; +struct st_ftb_expr +{ + FTB_EXPR *up; + uint flags; +/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */ + my_off_t docid[2]; + my_off_t max_docid; + float weight; + float cur_weight; + LIST *phrase; /* phrase words */ + LIST *document; /* for phrase search */ + uint yesses; /* number of "yes" words matched */ + uint nos; /* number of "no" words matched */ + uint ythresh; /* number of "yes" words in expr */ + uint yweaks; /* number of "yes" words for scan only */ +}; + +typedef struct st_ftb_word +{ + FTB_EXPR *up; + uint flags; +/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */ + my_off_t docid[2]; /* for index search and for scan */ + my_off_t key_root; + FTB_EXPR *max_docid_expr; + MI_KEYDEF *keyinfo; + struct st_ftb_word *prev; + float weight; + uint ndepth; + uint len; + uchar off; + uchar word[1]; +} FTB_WORD; + +typedef struct st_ft_info +{ + struct _ft_vft *please; + MI_INFO *info; + CHARSET_INFO *charset; + FTB_EXPR *root; + FTB_WORD **list; + FTB_WORD *last_word; + MEM_ROOT mem_root; + QUEUE queue; + TREE no_dupes; + my_off_t lastpos; + uint keynr; + uchar with_scan; + enum { UNINITIALIZED, READY, INDEX_SEARCH, INDEX_DONE } state; +} FTB; + +static int FTB_WORD_cmp(my_off_t *v, FTB_WORD *a, FTB_WORD *b) +{ + int i; + + /* if a==curdoc, take it as a < b */ + if (v && a->docid[0] == *v) + return -1; + + /* ORDER BY docid, ndepth DESC */ + i=CMP_NUM(a->docid[0], b->docid[0]); + if (!i) + i=CMP_NUM(b->ndepth,a->ndepth); + return i; +} + +static int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b) +{ + /* ORDER BY word DESC, ndepth DESC */ + int i= mi_compare_text(cs, (uchar*) (*b)->word+1,(*b)->len-1, + (uchar*) (*a)->word+1,(*a)->len-1,0,0); + if (!i) + i=CMP_NUM((*b)->ndepth,(*a)->ndepth); + return i; +} + + +typedef struct st_my_ftb_param +{ + FTB *ftb; + FTB_EXPR *ftbe; + uchar *up_quot; + uint depth; +} MY_FTB_PARAM; + + +static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param, + char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *info) +{ + MY_FTB_PARAM *ftb_param= param->mysql_ftparam; + FTB_WORD *ftbw; + FTB_EXPR *ftbe, *tmp_expr; + FT_WORD *phrase_word; + LIST *tmp_element; + int r= info->weight_adjust; + float weight= (float) + (info->wasign ? nwghts : wghts)[(r>5)?5:((r<-5)?-5:r)]; + + switch (info->type) { + case FT_TOKEN_WORD: + ftbw= (FTB_WORD *)alloc_root(&ftb_param->ftb->mem_root, + sizeof(FTB_WORD) + + (info->trunc ? MI_MAX_KEY_BUFF : + word_len * ftb_param->ftb->charset->mbmaxlen + + HA_FT_WLEN + + ftb_param->ftb->info->s->rec_reflength)); + ftbw->len= word_len + 1; + ftbw->flags= 0; + ftbw->off= 0; + if (info->yesno > 0) ftbw->flags|= FTB_FLAG_YES; + if (info->yesno < 0) ftbw->flags|= FTB_FLAG_NO; + if (info->trunc) ftbw->flags|= FTB_FLAG_TRUNC; + ftbw->weight= weight; + ftbw->up= ftb_param->ftbe; + ftbw->docid[0]= ftbw->docid[1]= HA_OFFSET_ERROR; + ftbw->ndepth= (info->yesno < 0) + ftb_param->depth; + ftbw->key_root= HA_OFFSET_ERROR; + memcpy(ftbw->word + 1, word, word_len); + ftbw->word[0]= word_len; + if (info->yesno > 0) ftbw->up->ythresh++; + ftb_param->ftb->queue.max_elements++; + ftbw->prev= ftb_param->ftb->last_word; + ftb_param->ftb->last_word= ftbw; + ftb_param->ftb->with_scan|= (info->trunc & FTB_FLAG_TRUNC); + for (tmp_expr= ftb_param->ftbe; tmp_expr->up; tmp_expr= tmp_expr->up) + if (! (tmp_expr->flags & FTB_FLAG_YES)) + break; + ftbw->max_docid_expr= tmp_expr; + /* fall through */ + case FT_TOKEN_STOPWORD: + if (! ftb_param->up_quot) break; + phrase_word= (FT_WORD *)alloc_root(&ftb_param->ftb->mem_root, sizeof(FT_WORD)); + tmp_element= (LIST *)alloc_root(&ftb_param->ftb->mem_root, sizeof(LIST)); + phrase_word->pos= (uchar*) word; + phrase_word->len= word_len; + tmp_element->data= (void *)phrase_word; + ftb_param->ftbe->phrase= list_add(ftb_param->ftbe->phrase, tmp_element); + /* Allocate document list at this point. + It allows to avoid huge amount of allocs/frees for each row.*/ + tmp_element= (LIST *)alloc_root(&ftb_param->ftb->mem_root, sizeof(LIST)); + tmp_element->data= alloc_root(&ftb_param->ftb->mem_root, sizeof(FT_WORD)); + ftb_param->ftbe->document= + list_add(ftb_param->ftbe->document, tmp_element); + break; + case FT_TOKEN_LEFT_PAREN: + ftbe=(FTB_EXPR *)alloc_root(&ftb_param->ftb->mem_root, sizeof(FTB_EXPR)); + ftbe->flags= 0; + if (info->yesno > 0) ftbe->flags|= FTB_FLAG_YES; + if (info->yesno < 0) ftbe->flags|= FTB_FLAG_NO; + ftbe->weight= weight; + ftbe->up= ftb_param->ftbe; + ftbe->max_docid= ftbe->ythresh= ftbe->yweaks= 0; + ftbe->docid[0]= ftbe->docid[1]= HA_OFFSET_ERROR; + ftbe->phrase= NULL; + ftbe->document= 0; + if (info->quot) ftb_param->ftb->with_scan|= 2; + if (info->yesno > 0) ftbe->up->ythresh++; + ftb_param->ftbe= ftbe; + ftb_param->depth++; + ftb_param->up_quot= (uchar*) info->quot; + break; + case FT_TOKEN_RIGHT_PAREN: + if (ftb_param->ftbe->document) + { + /* Circuit document list */ + for (tmp_element= ftb_param->ftbe->document; + tmp_element->next; tmp_element= tmp_element->next) /* no-op */; + tmp_element->next= ftb_param->ftbe->document; + ftb_param->ftbe->document->prev= tmp_element; + } + info->quot= 0; + if (ftb_param->ftbe->up) + { + DBUG_ASSERT(ftb_param->depth); + ftb_param->ftbe= ftb_param->ftbe->up; + ftb_param->depth--; + ftb_param->up_quot= 0; + } + break; + case FT_TOKEN_EOF: + default: + break; + } + return(0); +} + + +static int ftb_parse_query_internal(MYSQL_FTPARSER_PARAM *param, + char *query, int len) +{ + MY_FTB_PARAM *ftb_param= param->mysql_ftparam; + MYSQL_FTPARSER_BOOLEAN_INFO info; + CHARSET_INFO *cs= ftb_param->ftb->charset; + uchar **start= (uchar**) &query; + uchar *end= (uchar*) query + len; + FT_WORD w; + + info.prev= ' '; + info.quot= 0; + while (ft_get_word(cs, start, end, &w, &info)) + param->mysql_add_word(param, (char*) w.pos, w.len, &info); + return(0); +} + + +static int _ftb_parse_query(FTB *ftb, uchar *query, uint len, + struct st_mysql_ftparser *parser) +{ + MYSQL_FTPARSER_PARAM *param; + MY_FTB_PARAM ftb_param; + DBUG_ENTER("_ftb_parse_query"); + DBUG_ASSERT(parser); + + if (ftb->state != UNINITIALIZED) + DBUG_RETURN(0); + if (! (param= ftparser_call_initializer(ftb->info, ftb->keynr, 0))) + DBUG_RETURN(1); + + ftb_param.ftb= ftb; + ftb_param.depth= 0; + ftb_param.ftbe= ftb->root; + ftb_param.up_quot= 0; + + param->mysql_parse= ftb_parse_query_internal; + param->mysql_add_word= ftb_query_add_word; + param->mysql_ftparam= (void *)&ftb_param; + param->cs= ftb->charset; + param->doc= (char*) query; + param->length= len; + param->flags= 0; + param->mode= MYSQL_FTPARSER_FULL_BOOLEAN_INFO; + DBUG_RETURN(parser->parse(param)); +} + + +static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)), + const void *a,const void *b) +{ + return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b))); +} + +/* returns 1 if the search was finished (must-word wasn't found) */ +static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) +{ + int r; + int subkeys=1; + my_bool can_go_down; + MI_INFO *info=ftb->info; + uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength; + uchar *lastkey_buf=ftbw->word+ftbw->off; + + LINT_INIT(off); + if (ftbw->flags & FTB_FLAG_TRUNC) + lastkey_buf+=ftbw->len; + + if (init_search) + { + ftbw->key_root=info->s->state.key_root[ftb->keynr]; + ftbw->keyinfo=info->s->keyinfo+ftb->keynr; + + r=_mi_search(info, ftbw->keyinfo, (uchar*) ftbw->word, ftbw->len, + SEARCH_FIND | SEARCH_BIGGER, ftbw->key_root); + } + else + { + uint sflag= SEARCH_BIGGER; + my_off_t max_docid=0; + FTB_EXPR *tmp; + + for (tmp= ftbw->max_docid_expr; tmp; tmp= tmp->up) + set_if_bigger(max_docid, tmp->max_docid); + + if (ftbw->docid[0] < max_docid) + { + sflag|= SEARCH_SAME; + _mi_dpointer(info, (uchar *)(ftbw->word + ftbw->len + HA_FT_WLEN), + max_docid); + } + r=_mi_search(info, ftbw->keyinfo, (uchar*) lastkey_buf, + USE_WHOLE_KEY, sflag, ftbw->key_root); + } + + can_go_down=(!ftbw->off && (init_search || (ftbw->flags & FTB_FLAG_TRUNC))); + /* Skip rows inserted by concurrent insert */ + while (!r) + { + if (can_go_down) + { + /* going down ? */ + off=info->lastkey_length-extra; + subkeys=ft_sintXkorr(info->lastkey+off); + } + if (subkeys<0 || info->lastpos < info->state->data_file_length) + break; + r= _mi_search_next(info, ftbw->keyinfo, info->lastkey, + info->lastkey_length, + SEARCH_BIGGER, ftbw->key_root); + } + + if (!r && !ftbw->off) + { + r= mi_compare_text(ftb->charset, + info->lastkey+1, + info->lastkey_length-extra-1, + (uchar*) ftbw->word+1, + ftbw->len-1, + (my_bool) (ftbw->flags & FTB_FLAG_TRUNC),0); + } + + if (r) /* not found */ + { + if (!ftbw->off || !(ftbw->flags & FTB_FLAG_TRUNC)) + { + ftbw->docid[0]=HA_OFFSET_ERROR; + if ((ftbw->flags & FTB_FLAG_YES) && ftbw->up->up==0) + { + /* + This word MUST BE present in every document returned, + so we can stop the search right now + */ + ftb->state=INDEX_DONE; + return 1; /* search is done */ + } + else + return 0; + } + + /* going up to the first-level tree to continue search there */ + _mi_dpointer(info, (uchar*) (lastkey_buf+HA_FT_WLEN), ftbw->key_root); + ftbw->key_root=info->s->state.key_root[ftb->keynr]; + ftbw->keyinfo=info->s->keyinfo+ftb->keynr; + ftbw->off=0; + return _ft2_search(ftb, ftbw, 0); + } + + /* matching key found */ + memcpy(lastkey_buf, info->lastkey, info->lastkey_length); + if (lastkey_buf == ftbw->word) + ftbw->len=info->lastkey_length-extra; + + /* going down ? */ + if (subkeys<0) + { + /* + yep, going down, to the second-level tree + TODO here: subkey-based optimization + */ + ftbw->off=off; + ftbw->key_root=info->lastpos; + ftbw->keyinfo=& info->s->ft2_keyinfo; + r=_mi_search_first(info, ftbw->keyinfo, ftbw->key_root); + DBUG_ASSERT(r==0); /* found something */ + memcpy(lastkey_buf+off, info->lastkey, info->lastkey_length); + } + ftbw->docid[0]=info->lastpos; + if (ftbw->flags & FTB_FLAG_YES && !(ftbw->flags & FTB_FLAG_TRUNC)) + ftbw->max_docid_expr->max_docid= info->lastpos; + return 0; +} + +static void _ftb_init_index_search(FT_INFO *ftb) +{ + int i; + FTB_WORD *ftbw; + + if ((ftb->state != READY && ftb->state !=INDEX_DONE) || + ftb->keynr == NO_SUCH_KEY) + return; + ftb->state=INDEX_SEARCH; + + for (i=ftb->queue.elements; i; i--) + { + ftbw=(FTB_WORD *)(ftb->queue.root[i]); + + if (ftbw->flags & FTB_FLAG_TRUNC) + { + /* + special treatment for truncation operator + 1. there are some (besides this) +words + | no need to search in the index, it can never ADD new rows + | to the result, and to remove half-matched rows we do scan anyway + 2. -trunc* + | same as 1. + 3. in 1 and 2, +/- need not be on the same expr. level, + but can be on any upper level, as in +word +(trunc1* trunc2*) + 4. otherwise + | We have to index-search for this prefix. + | It may cause duplicates, as in the index (sorted by ) + | + | + | + | Searching for "aa*" will find row1 twice... + */ + FTB_EXPR *ftbe; + for (ftbe=(FTB_EXPR*)ftbw; + ftbe->up && !(ftbe->up->flags & FTB_FLAG_TRUNC); + ftbe->up->flags|= FTB_FLAG_TRUNC, ftbe=ftbe->up) + { + if (ftbe->flags & FTB_FLAG_NO || /* 2 */ + ftbe->up->ythresh - ftbe->up->yweaks > + (uint) test(ftbe->flags & FTB_FLAG_YES)) /* 1 */ + { + FTB_EXPR *top_ftbe=ftbe->up; + ftbw->docid[0]=HA_OFFSET_ERROR; + for (ftbe=(FTB_EXPR *)ftbw; + ftbe != top_ftbe && !(ftbe->flags & FTB_FLAG_NO); + ftbe=ftbe->up) + ftbe->up->yweaks++; + ftbe=0; + break; + } + } + if (!ftbe) + continue; + /* 4 */ + if (!is_tree_inited(& ftb->no_dupes)) + init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), + _ftb_no_dupes_cmp,0,0,0); + else + reset_tree(& ftb->no_dupes); + } + + ftbw->off=0; /* in case of reinit */ + if (_ft2_search(ftb, ftbw, 1)) + return; + } + queue_fix(& ftb->queue); +} + + +FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query, + uint query_len, CHARSET_INFO *cs) +{ + FTB *ftb; + FTB_EXPR *ftbe; + FTB_WORD *ftbw; + + if (!(ftb=(FTB *)my_malloc(sizeof(FTB), MYF(MY_WME)))) + return 0; + ftb->please= (struct _ft_vft *) & _ft_vft_boolean; + ftb->state=UNINITIALIZED; + ftb->info=info; + ftb->keynr=keynr; + ftb->charset=cs; + DBUG_ASSERT(keynr==NO_SUCH_KEY || cs == info->s->keyinfo[keynr].seg->charset); + ftb->with_scan=0; + ftb->lastpos=HA_OFFSET_ERROR; + bzero(& ftb->no_dupes, sizeof(TREE)); + ftb->last_word= 0; + + init_alloc_root(&ftb->mem_root, 1024, 1024); + ftb->queue.max_elements= 0; + if (!(ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR)))) + goto err; + ftbe->weight=1; + ftbe->flags=FTB_FLAG_YES; + ftbe->nos=1; + ftbe->up=0; + ftbe->max_docid= ftbe->ythresh= ftbe->yweaks= 0; + ftbe->docid[0]=ftbe->docid[1]=HA_OFFSET_ERROR; + ftbe->phrase= NULL; + ftbe->document= 0; + ftb->root=ftbe; + if (unlikely(_ftb_parse_query(ftb, query, query_len, + keynr == NO_SUCH_KEY ? &ft_default_parser : + info->s->keyinfo[keynr].parser))) + goto err; + /* + Hack: instead of init_queue, we'll use reinit queue to be able + to alloc queue with alloc_root() + */ + if (! (ftb->queue.root= (uchar **)alloc_root(&ftb->mem_root, + (ftb->queue.max_elements + 1) * + sizeof(void *)))) + goto err; + reinit_queue(&ftb->queue, ftb->queue.max_elements, 0, 0, + (int (*)(void*, uchar*, uchar*))FTB_WORD_cmp, 0); + for (ftbw= ftb->last_word; ftbw; ftbw= ftbw->prev) + queue_insert(&ftb->queue, (uchar *)ftbw); + ftb->list=(FTB_WORD **)alloc_root(&ftb->mem_root, + sizeof(FTB_WORD *)*ftb->queue.elements); + memcpy(ftb->list, ftb->queue.root+1, sizeof(FTB_WORD *)*ftb->queue.elements); + qsort2(ftb->list, ftb->queue.elements, sizeof(FTB_WORD *), + (qsort2_cmp)FTB_WORD_cmp_list, ftb->charset); + if (ftb->queue.elements<2) ftb->with_scan &= ~FTB_FLAG_TRUNC; + ftb->state=READY; + return ftb; +err: + free_root(& ftb->mem_root, MYF(0)); + my_free((uchar*)ftb,MYF(0)); + return 0; +} + + +typedef struct st_my_ftb_phrase_param +{ + LIST *phrase; + LIST *document; + CHARSET_INFO *cs; + uint phrase_length; + uint document_length; + uint match; +} MY_FTB_PHRASE_PARAM; + + +static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param, + char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused))) +{ + MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam; + FT_WORD *w= (FT_WORD *)phrase_param->document->data; + LIST *phrase, *document; + w->pos= (uchar*) word; + w->len= word_len; + phrase_param->document= phrase_param->document->prev; + if (phrase_param->phrase_length > phrase_param->document_length) + { + phrase_param->document_length++; + return 0; + } + /* TODO: rewrite phrase search to avoid + comparing the same word twice. */ + for (phrase= phrase_param->phrase, document= phrase_param->document->next; + phrase; phrase= phrase->next, document= document->next) + { + FT_WORD *phrase_word= (FT_WORD *)phrase->data; + FT_WORD *document_word= (FT_WORD *)document->data; + if (my_strnncoll(phrase_param->cs, (uchar*) phrase_word->pos, + phrase_word->len, + (uchar*) document_word->pos, document_word->len)) + return 0; + } + phrase_param->match++; + return 0; +} + + +static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param, + char *document, int len) +{ + FT_WORD word; + MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam; + const uchar *docend= (uchar*) document + len; + while (ft_simple_get_word(phrase_param->cs, (uchar**) &document, docend, + &word, FALSE)) + { + param->mysql_add_word(param, (char*) word.pos, word.len, 0); + if (phrase_param->match) + break; + } + return 0; +} + + +/* + Checks if given buffer matches phrase list. + + SYNOPSIS + _ftb_check_phrase() + s0 start of buffer + e0 end of buffer + phrase broken into list phrase + cs charset info + + RETURN VALUE + 1 is returned if phrase found, 0 else. + -1 is returned if error occurs. +*/ + +static int _ftb_check_phrase(FTB *ftb, const uchar *document, uint len, + FTB_EXPR *ftbe, struct st_mysql_ftparser *parser) +{ + MY_FTB_PHRASE_PARAM ftb_param; + MYSQL_FTPARSER_PARAM *param; + DBUG_ENTER("_ftb_check_phrase"); + DBUG_ASSERT(parser); + + if (! (param= ftparser_call_initializer(ftb->info, ftb->keynr, 1))) + DBUG_RETURN(0); + + ftb_param.phrase= ftbe->phrase; + ftb_param.document= ftbe->document; + ftb_param.cs= ftb->charset; + ftb_param.phrase_length= list_length(ftbe->phrase); + ftb_param.document_length= 1; + ftb_param.match= 0; + + param->mysql_parse= ftb_check_phrase_internal; + param->mysql_add_word= ftb_phrase_add_word; + param->mysql_ftparam= (void *)&ftb_param; + param->cs= ftb->charset; + param->doc= (char *) document; + param->length= len; + param->flags= 0; + param->mode= MYSQL_FTPARSER_WITH_STOPWORDS; + if (unlikely(parser->parse(param))) + return -1; + DBUG_RETURN(ftb_param.match ? 1 : 0); +} + + +static int _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_orig) +{ + FT_SEG_ITERATOR ftsi; + FTB_EXPR *ftbe; + float weight=ftbw->weight; + int yn_flag= ftbw->flags, ythresh, mode=(ftsi_orig != 0); + my_off_t curdoc=ftbw->docid[mode]; + struct st_mysql_ftparser *parser= ftb->keynr == NO_SUCH_KEY ? + &ft_default_parser : + ftb->info->s->keyinfo[ftb->keynr].parser; + + for (ftbe=ftbw->up; ftbe; ftbe=ftbe->up) + { + ythresh = ftbe->ythresh - (mode ? 0 : ftbe->yweaks); + if (ftbe->docid[mode] != curdoc) + { + ftbe->cur_weight=0; + ftbe->yesses=ftbe->nos=0; + ftbe->docid[mode]=curdoc; + } + if (ftbe->nos) + break; + if (yn_flag & FTB_FLAG_YES) + { + weight /= ftbe->ythresh; + ftbe->cur_weight += weight; + if ((int) ++ftbe->yesses == ythresh) + { + yn_flag=ftbe->flags; + weight=ftbe->cur_weight*ftbe->weight; + if (mode && ftbe->phrase) + { + int found= 0; + + memcpy(&ftsi, ftsi_orig, sizeof(ftsi)); + while (_mi_ft_segiterator(&ftsi) && !found) + { + if (!ftsi.pos) + continue; + found= _ftb_check_phrase(ftb, ftsi.pos, ftsi.len, ftbe, parser); + if (unlikely(found < 0)) + return 1; + } + if (!found) + break; + } /* ftbe->quot */ + } + else + break; + } + else + if (yn_flag & FTB_FLAG_NO) + { + /* + NOTE: special sort function of queue assures that all + (yn_flag & FTB_FLAG_NO) != 0 + events for every particular subexpression will + "auto-magically" happen BEFORE all the + (yn_flag & FTB_FLAG_YES) != 0 events. So no + already matched expression can become not-matched again. + */ + ++ftbe->nos; + break; + } + else + { + if (ftbe->ythresh) + weight/=3; + ftbe->cur_weight += weight; + if ((int) ftbe->yesses < ythresh) + break; + if (!(yn_flag & FTB_FLAG_WONLY)) + yn_flag= ((int) ftbe->yesses++ == ythresh) ? ftbe->flags : FTB_FLAG_WONLY ; + weight*= ftbe->weight; + } + } + return 0; +} + + +int ft_boolean_read_next(FT_INFO *ftb, char *record) +{ + FTB_EXPR *ftbe; + FTB_WORD *ftbw; + MI_INFO *info=ftb->info; + my_off_t curdoc; + + if (ftb->state != INDEX_SEARCH && ftb->state != INDEX_DONE) + return -1; + + /* black magic ON */ + if ((int) _mi_check_index(info, ftb->keynr) < 0) + return my_errno; + if (_mi_readinfo(info, F_RDLCK, 1)) + return my_errno; + /* black magic OFF */ + + if (!ftb->queue.elements) + return my_errno=HA_ERR_END_OF_FILE; + + /* Attention!!! Address of a local variable is used here! See err: label */ + ftb->queue.first_cmp_arg=(void *)&curdoc; + + while (ftb->state == INDEX_SEARCH && + (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) != + HA_OFFSET_ERROR) + { + while (curdoc == (ftbw=(FTB_WORD *)queue_top(& ftb->queue))->docid[0]) + { + if (unlikely(_ftb_climb_the_tree(ftb, ftbw, 0))) + { + my_errno= HA_ERR_OUT_OF_MEM; + goto err; + } + + /* update queue */ + _ft2_search(ftb, ftbw, 0); + queue_replaced(& ftb->queue); + } + + ftbe=ftb->root; + if (ftbe->docid[0]==curdoc && ftbe->cur_weight>0 && + ftbe->yesses>=(ftbe->ythresh-ftbe->yweaks) && !ftbe->nos) + { + /* curdoc matched ! */ + if (is_tree_inited(&ftb->no_dupes) && + tree_insert(&ftb->no_dupes, &curdoc, 0, + ftb->no_dupes.custom_arg)->count >1) + /* but it managed already to get past this line once */ + continue; + + info->lastpos=curdoc; + /* Clear all states, except that the table was updated */ + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + + if (!(*info->read_record)(info,curdoc, (uchar*) record)) + { + info->update|= HA_STATE_AKTIV; /* Record is read */ + if (ftb->with_scan && + ft_boolean_find_relevance(ftb,(uchar*) record,0)==0) + continue; /* no match */ + my_errno=0; + goto err; + } + goto err; + } + } + ftb->state=INDEX_DONE; + my_errno=HA_ERR_END_OF_FILE; +err: + ftb->queue.first_cmp_arg=(void *)0; + return my_errno; +} + + +typedef struct st_my_ftb_find_param +{ + FT_INFO *ftb; + FT_SEG_ITERATOR *ftsi; +} MY_FTB_FIND_PARAM; + + +static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param, + char *word, int len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused))) +{ + MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam; + FT_INFO *ftb= ftb_param->ftb; + FTB_WORD *ftbw; + int a, b, c; + for (a= 0, b= ftb->queue.elements, c= (a+b)/2; b-a>1; c= (a+b)/2) + { + ftbw= ftb->list[c]; + if (mi_compare_text(ftb->charset, (uchar*)word, len, + (uchar*)ftbw->word+1, ftbw->len-1, + (my_bool)(ftbw->flags&FTB_FLAG_TRUNC), 0) > 0) + b= c; + else + a= c; + } + for (; c >= 0; c--) + { + ftbw= ftb->list[c]; + if (mi_compare_text(ftb->charset, (uchar*)word, len, + (uchar*)ftbw->word + 1,ftbw->len - 1, + (my_bool)(ftbw->flags & FTB_FLAG_TRUNC), 0)) + break; + if (ftbw->docid[1] == ftb->info->lastpos) + continue; + ftbw->docid[1]= ftb->info->lastpos; + if (unlikely(_ftb_climb_the_tree(ftb, ftbw, ftb_param->ftsi))) + return 1; + } + return(0); +} + + +static int ftb_find_relevance_parse(MYSQL_FTPARSER_PARAM *param, + char *doc, int len) +{ + MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam; + FT_INFO *ftb= ftb_param->ftb; + uchar *end= (uchar*) doc + len; + FT_WORD w; + while (ft_simple_get_word(ftb->charset, (uchar**) &doc, end, &w, TRUE)) + param->mysql_add_word(param, (char*) w.pos, w.len, 0); + return(0); +} + + +float ft_boolean_find_relevance(FT_INFO *ftb, uchar *record, uint length) +{ + FTB_EXPR *ftbe; + FT_SEG_ITERATOR ftsi, ftsi2; + my_off_t docid=ftb->info->lastpos; + MY_FTB_FIND_PARAM ftb_param; + MYSQL_FTPARSER_PARAM *param; + struct st_mysql_ftparser *parser= ftb->keynr == NO_SUCH_KEY ? + &ft_default_parser : + ftb->info->s->keyinfo[ftb->keynr].parser; + + if (docid == HA_OFFSET_ERROR) + return -2.0; + if (!ftb->queue.elements) + return 0; + if (! (param= ftparser_call_initializer(ftb->info, ftb->keynr, 0))) + return 0; + + if (ftb->state != INDEX_SEARCH && docid <= ftb->lastpos) + { + FTB_EXPR *x; + uint i; + + for (i=0; i < ftb->queue.elements; i++) + { + ftb->list[i]->docid[1]=HA_OFFSET_ERROR; + for (x=ftb->list[i]->up; x; x=x->up) + x->docid[1]=HA_OFFSET_ERROR; + } + } + + ftb->lastpos=docid; + + if (ftb->keynr==NO_SUCH_KEY) + _mi_ft_segiterator_dummy_init(record, length, &ftsi); + else + _mi_ft_segiterator_init(ftb->info, ftb->keynr, record, &ftsi); + memcpy(&ftsi2, &ftsi, sizeof(ftsi)); + + ftb_param.ftb= ftb; + ftb_param.ftsi= &ftsi2; + param->mysql_parse= ftb_find_relevance_parse; + param->mysql_add_word= ftb_find_relevance_add_word; + param->mysql_ftparam= (void *)&ftb_param; + param->flags= 0; + param->cs= ftb->charset; + param->mode= MYSQL_FTPARSER_SIMPLE_MODE; + while (_mi_ft_segiterator(&ftsi)) + { + if (!ftsi.pos) + continue; + param->doc= (char *)ftsi.pos; + param->length= ftsi.len; + if (unlikely(parser->parse(param))) + return 0; + } + ftbe=ftb->root; + if (ftbe->docid[1]==docid && ftbe->cur_weight>0 && + ftbe->yesses>=ftbe->ythresh && !ftbe->nos) + { /* row matched ! */ + return ftbe->cur_weight; + } + else + { /* match failed ! */ + return 0.0; + } +} + + +void ft_boolean_close_search(FT_INFO *ftb) +{ + if (is_tree_inited(& ftb->no_dupes)) + { + delete_tree(& ftb->no_dupes); + } + free_root(& ftb->mem_root, MYF(0)); + my_free((uchar*)ftb,MYF(0)); +} + + +float ft_boolean_get_relevance(FT_INFO *ftb) +{ + return ftb->root->cur_weight; +} + + +void ft_boolean_reinit_search(FT_INFO *ftb) +{ + _ftb_init_index_search(ftb); +} + Added: trunk/src/ft_eval.h =================================================================== --- trunk/src/ft_eval.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_eval.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,41 @@ +/* Copyright (C) 2000 MySQL AB & Sergei A. Golubchik + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +const char **stopwordlist=ft_precompiled_stopwords; + +#define MAX_REC_LENGTH 128 +#define MAX_BLOB_LENGTH 60000 +char record[MAX_REC_LENGTH], read_record[MAX_REC_LENGTH+MAX_BLOB_LENGTH]; +char blob_record[MAX_BLOB_LENGTH+20*20]; + +char *filename= (char*) "EVAL"; + +int silent=0, error=0; + +uint key_length=MAX_BLOB_LENGTH,docid_length=32; +char *d_file, *q_file; +FILE *df,*qf; + +MI_COLUMNDEF recinfo[3]; +MI_KEYDEF keyinfo[2]; +HA_KEYSEG keyseg[10]; + +#define SWL_INIT 500 +#define SWL_PLUS 50 + +#define MAX_LINE_LENGTH 128 +char line[MAX_LINE_LENGTH]; Added: trunk/src/ft_nlq_search.c =================================================================== --- trunk/src/ft_nlq_search.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_nlq_search.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,373 @@ +/* Copyright (C) 2001-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +#define FT_CORE +#include "ftdefs.h" + +/* search with natural language queries */ + +typedef struct ft_doc_rec +{ + my_off_t dpos; + double weight; +} FT_DOC; + +struct st_ft_info +{ + struct _ft_vft *please; + MI_INFO *info; + int ndocs; + int curdoc; + FT_DOC doc[1]; +}; + +typedef struct st_all_in_one +{ + MI_INFO *info; + uint keynr; + CHARSET_INFO *charset; + uchar *keybuff; + TREE dtree; +} ALL_IN_ONE; + +typedef struct st_ft_superdoc +{ + FT_DOC doc; + FT_WORD *word_ptr; + double tmp_weight; +} FT_SUPERDOC; + +static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)), + FT_SUPERDOC *p1, FT_SUPERDOC *p2) +{ + if (p1->doc.dpos < p2->doc.dpos) + return -1; + if (p1->doc.dpos == p2->doc.dpos) + return 0; + return 1; +} + +static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) +{ + int subkeys, r; + uint keylen, doc_cnt; + FT_SUPERDOC sdoc, *sptr; + TREE_ELEMENT *selem; + double gweight=1; + MI_INFO *info=aio->info; + uchar *keybuff=aio->keybuff; + MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr; + my_off_t key_root=info->s->state.key_root[aio->keynr]; + uint extra=HA_FT_WLEN+info->s->base.rec_reflength; +#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT + float tmp_weight; +#else +#error +#endif + + DBUG_ENTER("walk_and_match"); + + word->weight=LWS_FOR_QUERY; + + keylen=_ft_make_key(info,aio->keynr,keybuff,word,0); + keylen-=HA_FT_WLEN; + doc_cnt=0; + + /* Skip rows inserted by current inserted */ + for (r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root) ; + !r && + (subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 && + info->lastpos >= info->state->data_file_length ; + r= _mi_search_next(info, keyinfo, info->lastkey, + info->lastkey_length, SEARCH_BIGGER, key_root)) + ; + + info->update|= HA_STATE_AKTIV; /* for _mi_test_if_changed() */ + + /* The following should be safe, even if we compare doubles */ + while (!r && gweight) + { + + if (keylen && + mi_compare_text(aio->charset,info->lastkey+1, + info->lastkey_length-extra-1, keybuff+1,keylen-1,0,0)) + break; + + if (subkeys<0) + { + if (doc_cnt) + DBUG_RETURN(1); /* index is corrupted */ + /* + TODO here: unsafe optimization, should this word + be skipped (based on subkeys) ? + */ + keybuff+=keylen; + keyinfo=& info->s->ft2_keyinfo; + key_root=info->lastpos; + keylen=0; + r=_mi_search_first(info, keyinfo, key_root); + goto do_skip; + } +#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT + tmp_weight=*(float*)&subkeys; +#else +#error +#endif + /* The following should be safe, even if we compare doubles */ + if (tmp_weight==0) + DBUG_RETURN(doc_cnt); /* stopword, doc_cnt should be 0 */ + + sdoc.doc.dpos=info->lastpos; + + /* saving document matched into dtree */ + if (!(selem=tree_insert(&aio->dtree, &sdoc, 0, aio->dtree.custom_arg))) + DBUG_RETURN(1); + + sptr=(FT_SUPERDOC *)ELEMENT_KEY((&aio->dtree), selem); + + if (selem->count==1) /* document's first match */ + sptr->doc.weight=0; + else + sptr->doc.weight+=sptr->tmp_weight*sptr->word_ptr->weight; + + sptr->word_ptr=word; + sptr->tmp_weight=tmp_weight; + + doc_cnt++; + + gweight=word->weight*GWS_IN_USE; + if (gweight < 0 || doc_cnt > 2000000) + gweight=0; + + if (_mi_test_if_changed(info) == 0) + r=_mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length, + SEARCH_BIGGER, key_root); + else + r=_mi_search(info, keyinfo, info->lastkey, info->lastkey_length, + SEARCH_BIGGER, key_root); +do_skip: + while ((subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 && + !r && info->lastpos >= info->state->data_file_length) + r= _mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length, + SEARCH_BIGGER, key_root); + + } + word->weight=gweight; + + DBUG_RETURN(0); +} + + +static int walk_and_copy(FT_SUPERDOC *from, + uint32 count __attribute__((unused)), FT_DOC **to) +{ + DBUG_ENTER("walk_and_copy"); + from->doc.weight+=from->tmp_weight*from->word_ptr->weight; + (*to)->dpos=from->doc.dpos; + (*to)->weight=from->doc.weight; + (*to)++; + DBUG_RETURN(0); +} + +static int walk_and_push(FT_SUPERDOC *from, + uint32 count __attribute__((unused)), QUEUE *best) +{ + DBUG_ENTER("walk_and_copy"); + from->doc.weight+=from->tmp_weight*from->word_ptr->weight; + set_if_smaller(best->elements, ft_query_expansion_limit-1); + queue_insert(best, (uchar *)& from->doc); + DBUG_RETURN(0); +} + + +static int FT_DOC_cmp(void *unused __attribute__((unused)), + FT_DOC *a, FT_DOC *b) +{ + return sgn(b->weight - a->weight); +} + + +FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, uchar *query, + uint query_len, uint flags, uchar *record) +{ + TREE wtree; + ALL_IN_ONE aio; + FT_DOC *dptr; + FT_INFO *dlist=NULL; + my_off_t saved_lastpos=info->lastpos; + struct st_mysql_ftparser *parser; + MYSQL_FTPARSER_PARAM *ftparser_param; + DBUG_ENTER("ft_init_nlq_search"); + +/* black magic ON */ + if ((int) (keynr = _mi_check_index(info,keynr)) < 0) + DBUG_RETURN(NULL); + if (_mi_readinfo(info,F_RDLCK,1)) + DBUG_RETURN(NULL); +/* black magic OFF */ + + aio.info=info; + aio.keynr=keynr; + aio.charset=info->s->keyinfo[keynr].seg->charset; + aio.keybuff=info->lastkey+info->s->base.max_key_length; + parser= info->s->keyinfo[keynr].parser; + if (! (ftparser_param= ftparser_call_initializer(info, keynr, 0))) + goto err; + + bzero(&wtree,sizeof(wtree)); + + init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,0, + NULL, NULL); + + ft_parse_init(&wtree, aio.charset); + ftparser_param->flags= 0; + if (ft_parse(&wtree, query, query_len, parser, ftparser_param, + &wtree.mem_root)) + goto err; + + if (tree_walk(&wtree, (tree_walk_action)&walk_and_match, &aio, + left_root_right)) + goto err; + + if (flags & FT_EXPAND && ft_query_expansion_limit) + { + QUEUE best; + init_queue(&best,ft_query_expansion_limit,0,0, (queue_compare) &FT_DOC_cmp, + 0); + tree_walk(&aio.dtree, (tree_walk_action) &walk_and_push, + &best, left_root_right); + while (best.elements) + { + my_off_t docid=((FT_DOC *)queue_remove(& best, 0))->dpos; + if (!(*info->read_record)(info,docid,record)) + { + info->update|= HA_STATE_AKTIV; + ftparser_param->flags= MYSQL_FTFLAGS_NEED_COPY; + if (unlikely(_mi_ft_parse(&wtree, info, keynr, record, ftparser_param, + &wtree.mem_root))) + { + delete_queue(&best); + goto err; + } + } + } + delete_queue(&best); + reset_tree(&aio.dtree); + if (tree_walk(&wtree, (tree_walk_action)&walk_and_match, &aio, + left_root_right)) + goto err; + + } + + /* + If ndocs == 0, this will not allocate RAM for FT_INFO.doc[], + so if ndocs == 0, FT_INFO.doc[] must not be accessed. + */ + dlist=(FT_INFO *)my_malloc(sizeof(FT_INFO)+ + sizeof(FT_DOC)* + (int)(aio.dtree.elements_in_tree-1), + MYF(0)); + if (!dlist) + goto err; + + dlist->please= (struct _ft_vft *) & _ft_vft_nlq; + dlist->ndocs=aio.dtree.elements_in_tree; + dlist->curdoc=-1; + dlist->info=aio.info; + dptr=dlist->doc; + + tree_walk(&aio.dtree, (tree_walk_action) &walk_and_copy, + &dptr, left_root_right); + + if (flags & FT_SORTED) + qsort2(dlist->doc, dlist->ndocs, sizeof(FT_DOC), (qsort2_cmp)&FT_DOC_cmp, 0); + +err: + delete_tree(&aio.dtree); + delete_tree(&wtree); + info->lastpos=saved_lastpos; + DBUG_RETURN(dlist); +} + + +int ft_nlq_read_next(FT_INFO *handler, char *record) +{ + MI_INFO *info= (MI_INFO *) handler->info; + + if (++handler->curdoc >= handler->ndocs) + { + --handler->curdoc; + return HA_ERR_END_OF_FILE; + } + + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + + info->lastpos=handler->doc[handler->curdoc].dpos; + if (!(*info->read_record)(info,info->lastpos,(uchar*) record)) + { + info->update|= HA_STATE_AKTIV; /* Record is read */ + return 0; + } + return my_errno; +} + + +float ft_nlq_find_relevance(FT_INFO *handler, + uchar *record __attribute__((unused)), + uint length __attribute__((unused))) +{ + int a,b,c; + FT_DOC *docs=handler->doc; + my_off_t docid=handler->info->lastpos; + + if (docid == HA_POS_ERROR) + return -5.0; + + /* Assuming docs[] is sorted by dpos... */ + + for (a=0, b=handler->ndocs, c=(a+b)/2; b-a>1; c=(a+b)/2) + { + if (docs[c].dpos > docid) + b=c; + else + a=c; + } + /* bounds check to avoid accessing unallocated handler->doc */ + if (a < handler->ndocs && docs[a].dpos == docid) + return (float) docs[a].weight; + else + return 0.0; +} + + +void ft_nlq_close_search(FT_INFO *handler) +{ + my_free((uchar*)handler,MYF(0)); +} + + +float ft_nlq_get_relevance(FT_INFO *handler) +{ + return (float) handler->doc[handler->curdoc].weight; +} + + +void ft_nlq_reinit_search(FT_INFO *handler) +{ + handler->curdoc=-1; +} + Added: trunk/src/ft_parser.c =================================================================== --- trunk/src/ft_parser.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_parser.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,431 @@ +/* Copyright (C) 2000-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +#include "ftdefs.h" + +typedef struct st_ft_docstat { + FT_WORD *list; + uint uniq; + double sum; +} FT_DOCSTAT; + +typedef struct st_my_ft_parser_param +{ + TREE *wtree; + MEM_ROOT *mem_root; +} MY_FT_PARSER_PARAM; + +static int FT_WORD_cmp(CHARSET_INFO* cs, FT_WORD *w1, FT_WORD *w2) +{ + return mi_compare_text(cs, (uchar*) w1->pos, w1->len, + (uchar*) w2->pos, w2->len, 0, 0); +} + +static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat) +{ + word->weight=LWS_IN_USE; + docstat->sum+=word->weight; + memcpy_fixed((docstat->list)++,word,sizeof(FT_WORD)); + return 0; +} + +/* transforms tree of words into the array, applying normalization */ + +FT_WORD * ft_linearize(TREE *wtree, MEM_ROOT *mem_root) +{ + FT_WORD *wlist,*p; + FT_DOCSTAT docstat; + DBUG_ENTER("ft_linearize"); + + if ((wlist=(FT_WORD *) alloc_root(mem_root, sizeof(FT_WORD)* + (1+wtree->elements_in_tree)))) + { + docstat.list=wlist; + docstat.uniq=wtree->elements_in_tree; + docstat.sum=0; + tree_walk(wtree,(tree_walk_action)&walk_and_copy,&docstat,left_root_right); + } + delete_tree(wtree); + if (!wlist) + DBUG_RETURN(NULL); + + docstat.list->pos=NULL; + + for (p=wlist;p->pos;p++) + { + p->weight=PRENORM_IN_USE; + } + + for (p=wlist;p->pos;p++) + { + p->weight/=NORM_IN_USE; + } + + DBUG_RETURN(wlist); +} + +my_bool ft_boolean_check_syntax_string(const uchar *str) +{ + uint i, j; + + if (!str || + (strlen((char*) str)+1 != sizeof(ft_boolean_syntax)) || + (str[0] != ' ' && str[1] != ' ')) + return 1; + for (i=0; i 127 || my_isalnum(default_charset_info, str[i])) + return 1; + for (j=0; jyesno=(FTB_YES==' ') ? 1 : (param->quot != 0); + param->weight_adjust= param->wasign= 0; + param->type= FT_TOKEN_EOF; + + while (doc 0 ? mbl : (mbl < 0 ? -mbl : 1))) + { + mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); + if (true_word_char(ctype, *doc)) + break; + if (*doc == FTB_RQUOT && param->quot) + { + param->quot= (char*) doc; + *start=doc+1; + param->type= FT_TOKEN_RIGHT_PAREN; + goto ret; + } + if (!param->quot) + { + if (*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT) + { + /* param->prev=' '; */ + *start=doc+1; + if (*doc == FTB_LQUOT) + param->quot= (char*) *start; + param->type= (*doc == FTB_RBR ? FT_TOKEN_RIGHT_PAREN : FT_TOKEN_LEFT_PAREN); + goto ret; + } + if (param->prev == ' ') + { + if (*doc == FTB_YES ) { param->yesno=+1; continue; } else + if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else + if (*doc == FTB_NO ) { param->yesno=-1; continue; } else + if (*doc == FTB_INC ) { param->weight_adjust++; continue; } else + if (*doc == FTB_DEC ) { param->weight_adjust--; continue; } else + if (*doc == FTB_NEG ) { param->wasign= !param->wasign; continue; } + } + } + param->prev=*doc; + param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0); + param->weight_adjust= param->wasign= 0; + } + + mwc=length=0; + for (word->pos= doc; doc < end; length++, + doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1))) + { + mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); + if (true_word_char(ctype, *doc)) + mwc=0; + else if (!misc_word_char(*doc) || mwc) + break; + else + mwc++; + } + param->prev='A'; /* be sure *prev is true_word_char */ + word->len= (uint)(doc-word->pos) - mwc; + if ((param->trunc=(doc= ft_min_word_len && !is_stopword((char*) word->pos, + word->len)) + || param->trunc) && length < ft_max_word_len) + { + *start=doc; + param->type= FT_TOKEN_WORD; + goto ret; + } + else if (length) /* make sure length > 0 (if start contains spaces only) */ + { + *start= doc; + param->type= FT_TOKEN_STOPWORD; + goto ret; + } + } + if (param->quot) + { + *start= doc; + param->quot= (char*) doc; + param->type= 3; /* FT_RBR */ + goto ret; + } +ret: + return param->type; +} + +uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end, + FT_WORD *word, my_bool skip_stopwords) +{ + uchar *doc= *start; + uint mwc, length; + int mbl; + int ctype; + DBUG_ENTER("ft_simple_get_word"); + + do + { + for (;; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1))) + { + if (doc >= end) + DBUG_RETURN(0); + mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); + if (true_word_char(ctype, *doc)) + break; + } + + mwc= length= 0; + for (word->pos= doc; doc < end; length++, + doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1))) + { + mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); + if (true_word_char(ctype, *doc)) + mwc= 0; + else if (!misc_word_char(*doc) || mwc) + break; + else + mwc++; + } + + word->len= (uint)(doc-word->pos) - mwc; + + if (skip_stopwords == FALSE || + (length >= ft_min_word_len && length < ft_max_word_len && + !is_stopword((char*) word->pos, word->len))) + { + *start= doc; + DBUG_RETURN(1); + } + } while (doc < end); + DBUG_RETURN(0); +} + +void ft_parse_init(TREE *wtree, CHARSET_INFO *cs) +{ + DBUG_ENTER("ft_parse_init"); + if (!is_tree_inited(wtree)) + init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,NULL, cs); + DBUG_VOID_RETURN; +} + + +static int ft_add_word(MYSQL_FTPARSER_PARAM *param, + char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused))) +{ + TREE *wtree; + FT_WORD w; + MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam; + DBUG_ENTER("ft_add_word"); + wtree= ft_param->wtree; + if (param->flags & MYSQL_FTFLAGS_NEED_COPY) + { + uchar *ptr; + DBUG_ASSERT(wtree->with_delete == 0); + ptr= (uchar *)alloc_root(ft_param->mem_root, word_len); + memcpy(ptr, word, word_len); + w.pos= ptr; + } + else + w.pos= (uchar*) word; + w.len= word_len; + if (!tree_insert(wtree, &w, 0, wtree->custom_arg)) + { + delete_tree(wtree); + DBUG_RETURN(1); + } + DBUG_RETURN(0); +} + + +static int ft_parse_internal(MYSQL_FTPARSER_PARAM *param, + char *doc_arg, int doc_len) +{ + uchar *doc= (uchar*) doc_arg; + uchar *end= doc + doc_len; + MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam; + TREE *wtree= ft_param->wtree; + FT_WORD w; + DBUG_ENTER("ft_parse_internal"); + + while (ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE)) + if (param->mysql_add_word(param, (char*) w.pos, w.len, 0)) + DBUG_RETURN(1); + DBUG_RETURN(0); +} + + +int ft_parse(TREE *wtree, uchar *doc, int doclen, + struct st_mysql_ftparser *parser, + MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root) +{ + MY_FT_PARSER_PARAM my_param; + DBUG_ENTER("ft_parse"); + DBUG_ASSERT(parser); + + my_param.wtree= wtree; + my_param.mem_root= mem_root; + + param->mysql_parse= ft_parse_internal; + param->mysql_add_word= ft_add_word; + param->mysql_ftparam= &my_param; + param->cs= wtree->custom_arg; + param->doc= (char*) doc; + param->length= doclen; + param->mode= MYSQL_FTPARSER_SIMPLE_MODE; + DBUG_RETURN(parser->parse(param)); +} + +#define MAX_PARAM_NR 2 +MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info, + uint keynr, uint paramnr) +{ + uint32 ftparser_nr; + struct st_mysql_ftparser *parser; + if (! info->ftparser_param) + { + /* info->ftparser_param can not be zero after the initialization, + because it always includes built-in fulltext parser. And built-in + parser can be called even if the table has no fulltext indexes and + no varchar/text fields. */ + if (! info->s->ftparsers) + { + /* It's ok that modification to shared structure is done w/o mutex + locks, because all threads would set the same variables to the + same values. */ + uint i, j, keys= info->s->state.header.keys, ftparsers= 1; + for (i= 0; i < keys; i++) + { + MI_KEYDEF *keyinfo= &info->s->keyinfo[i]; + if (keyinfo->flag & HA_FULLTEXT) + { + for (j= 0;; j++) + { + if (j == i) + { + keyinfo->ftparser_nr= ftparsers++; + break; + } + if (info->s->keyinfo[j].flag & HA_FULLTEXT && + keyinfo->parser == info->s->keyinfo[j].parser) + { + keyinfo->ftparser_nr= info->s->keyinfo[j].ftparser_nr; + break; + } + } + } + } + info->s->ftparsers= ftparsers; + } + /* + We have to allocate two MYSQL_FTPARSER_PARAM structures per plugin + because in a boolean search a parser is called recursively + ftb_find_relevance* calls ftb_check_phrase* + (MAX_PARAM_NR=2) + */ + info->ftparser_param= (MYSQL_FTPARSER_PARAM *) + my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) * + info->s->ftparsers, MYF(MY_WME|MY_ZEROFILL)); + init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + if (! info->ftparser_param) + return 0; + } + if (keynr == NO_SUCH_KEY) + { + ftparser_nr= 0; + parser= &ft_default_parser; + } + else + { + ftparser_nr= info->s->keyinfo[keynr].ftparser_nr; + parser= info->s->keyinfo[keynr].parser; + } + DBUG_ASSERT(paramnr < MAX_PARAM_NR); + ftparser_nr= ftparser_nr*MAX_PARAM_NR + paramnr; + if (! info->ftparser_param[ftparser_nr].mysql_add_word) + { + /* Note, that mysql_add_word is used here as a flag: + mysql_add_word == 0 - parser is not initialized + mysql_add_word != 0 - parser is initialized, or no + initialization needed. */ + info->ftparser_param[ftparser_nr].mysql_add_word= + (int (*)(struct st_mysql_ftparser_param *, char *, int, + MYSQL_FTPARSER_BOOLEAN_INFO *)) 1; + if (parser->init && parser->init(&info->ftparser_param[ftparser_nr])) + return 0; + } + return &info->ftparser_param[ftparser_nr]; +} + +void ftparser_call_deinitializer(MI_INFO *info) +{ + uint i, j, keys= info->s->state.header.keys; + free_root(&info->ft_memroot, MYF(0)); + if (! info->ftparser_param) + return; + for (i= 0; i < keys; i++) + { + MI_KEYDEF *keyinfo= &info->s->keyinfo[i]; + for (j=0; j < MAX_PARAM_NR; j++) + { + MYSQL_FTPARSER_PARAM *ftparser_param= + &info->ftparser_param[keyinfo->ftparser_nr*MAX_PARAM_NR + j]; + if (keyinfo->flag & HA_FULLTEXT && ftparser_param->mysql_add_word) + { + if (keyinfo->parser->deinit) + keyinfo->parser->deinit(ftparser_param); + ftparser_param->mysql_add_word= 0; + } + else + break; + } + } +} + Added: trunk/src/ft_static.c =================================================================== --- trunk/src/ft_static.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_static.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,638 @@ +/* Copyright (C) 2000-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +#include "ftdefs.h" + +ulong ft_min_word_len=4; +ulong ft_max_word_len=HA_FT_MAXCHARLEN; +ulong ft_query_expansion_limit=5; +char ft_boolean_syntax[]="+ -><()~*:\"\"&|"; + +const HA_KEYSEG ft_keysegs[FT_SEGS]={ +{ + 0, /* charset */ + HA_FT_WLEN, /* start */ + 0, /* null_pos */ + 0, /* Bit pos */ + HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */ + HA_FT_MAXBYTELEN, /* length */ + HA_KEYTYPE_VARTEXT2, /* type */ + 63, /* language (will be overwritten) */ + 0, /* null_bit */ + 2, 0, 0 /* bit_start, bit_end, bit_length */ +}, +{ + /* + Note, this (and the last HA_KEYTYPE_END) segment should NOT + be packed in any way, otherwise w_search() won't be able to + update key entry 'in vivo' + */ + 0, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, HA_FT_WTYPE, 63, 0, 0, 0, 0 +} +}; + +const struct _ft_vft _ft_vft_nlq = { + ft_nlq_read_next, ft_nlq_find_relevance, ft_nlq_close_search, + ft_nlq_get_relevance, ft_nlq_reinit_search +}; +const struct _ft_vft _ft_vft_boolean = { + ft_boolean_read_next, ft_boolean_find_relevance, ft_boolean_close_search, + ft_boolean_get_relevance, ft_boolean_reinit_search +}; + + +FT_INFO *ft_init_search(uint flags, void *info, uint keynr, + uchar *query, uint query_len, CHARSET_INFO *cs, + uchar *record) +{ + FT_INFO *res; + if (flags & FT_BOOL) + res= ft_init_boolean_search((MI_INFO *)info, keynr, query, query_len,cs); + else + res= ft_init_nlq_search((MI_INFO *)info, keynr, query, query_len, flags, + record); + return res; +} + +const char *ft_stopword_file = 0; +const char *ft_precompiled_stopwords[] = { + +#ifdef COMPILE_STOPWORDS_IN + +/* This particular stopword list was taken from SMART distribution + ftp://ftp.cs.cornell.edu/pub/smart/smart.11.0.tar.Z + it was slightly modified to my taste, though + */ + + "a's", + "able", + "about", + "above", + "according", + "accordingly", + "across", + "actually", + "after", + "afterwards", + "again", + "against", + "ain't", + "all", + "allow", + "allows", + "almost", + "alone", + "along", + "already", + "also", + "although", + "always", + "am", + "among", + "amongst", + "an", + "and", + "another", + "any", + "anybody", + "anyhow", + "anyone", + "anything", + "anyway", + "anyways", + "anywhere", + "apart", + "appear", + "appreciate", + "appropriate", + "are", + "aren't", + "around", + "as", + "aside", + "ask", + "asking", + "associated", + "at", + "available", + "away", + "awfully", + "be", + "became", + "because", + "become", + "becomes", + "becoming", + "been", + "before", + "beforehand", + "behind", + "being", + "believe", + "below", + "beside", + "besides", + "best", + "better", + "between", + "beyond", + "both", + "brief", + "but", + "by", + "c'mon", + "c's", + "came", + "can", + "can't", + "cannot", + "cant", + "cause", + "causes", + "certain", + "certainly", + "changes", + "clearly", + "co", + "com", + "come", + "comes", + "concerning", + "consequently", + "consider", + "considering", + "contain", + "containing", + "contains", + "corresponding", + "could", + "couldn't", + "course", + "currently", + "definitely", + "described", + "despite", + "did", + "didn't", + "different", + "do", + "does", + "doesn't", + "doing", + "don't", + "done", + "down", + "downwards", + "during", + "each", + "edu", + "eg", + "eight", + "either", + "else", + "elsewhere", + "enough", + "entirely", + "especially", + "et", + "etc", + "even", + "ever", + "every", + "everybody", + "everyone", + "everything", + "everywhere", + "ex", + "exactly", + "example", + "except", + "far", + "few", + "fifth", + "first", + "five", + "followed", + "following", + "follows", + "for", + "former", + "formerly", + "forth", + "four", + "from", + "further", + "furthermore", + "get", + "gets", + "getting", + "given", + "gives", + "go", + "goes", + "going", + "gone", + "got", + "gotten", + "greetings", + "had", + "hadn't", + "happens", + "hardly", + "has", + "hasn't", + "have", + "haven't", + "having", + "he", + "he's", + "hello", + "help", + "hence", + "her", + "here", + "here's", + "hereafter", + "hereby", + "herein", + "hereupon", + "hers", + "herself", + "hi", + "him", + "himself", + "his", + "hither", + "hopefully", + "how", + "howbeit", + "however", + "i'd", + "i'll", + "i'm", + "i've", + "ie", + "if", + "ignored", + "immediate", + "in", + "inasmuch", + "inc", + "indeed", + "indicate", + "indicated", + "indicates", + "inner", + "insofar", + "instead", + "into", + "inward", + "is", + "isn't", + "it", + "it'd", + "it'll", + "it's", + "its", + "itself", + "just", + "keep", + "keeps", + "kept", + "know", + "knows", + "known", + "last", + "lately", + "later", + "latter", + "latterly", + "least", + "less", + "lest", + "let", + "let's", + "like", + "liked", + "likely", + "little", + "look", + "looking", + "looks", + "ltd", + "mainly", + "many", + "may", + "maybe", + "me", + "mean", + "meanwhile", + "merely", + "might", + "more", + "moreover", + "most", + "mostly", + "much", + "must", + "my", + "myself", + "name", + "namely", + "nd", + "near", + "nearly", + "necessary", + "need", + "needs", + "neither", + "never", + "nevertheless", + "new", + "next", + "nine", + "no", + "nobody", + "non", + "none", + "noone", + "nor", + "normally", + "not", + "nothing", + "novel", + "now", + "nowhere", + "obviously", + "of", + "off", + "often", + "oh", + "ok", + "okay", + "old", + "on", + "once", + "one", + "ones", + "only", + "onto", + "or", + "other", + "others", + "otherwise", + "ought", + "our", + "ours", + "ourselves", + "out", + "outside", + "over", + "overall", + "own", + "particular", + "particularly", + "per", + "perhaps", + "placed", + "please", + "plus", + "possible", + "presumably", + "probably", + "provides", + "que", + "quite", + "qv", + "rather", + "rd", + "re", + "really", + "reasonably", + "regarding", + "regardless", + "regards", + "relatively", + "respectively", + "right", + "said", + "same", + "saw", + "say", + "saying", + "says", + "second", + "secondly", + "see", + "seeing", + "seem", + "seemed", + "seeming", + "seems", + "seen", + "self", + "selves", + "sensible", + "sent", + "serious", + "seriously", + "seven", + "several", + "shall", + "she", + "should", + "shouldn't", + "since", + "six", + "so", + "some", + "somebody", + "somehow", + "someone", + "something", + "sometime", + "sometimes", + "somewhat", + "somewhere", + "soon", + "sorry", + "specified", + "specify", + "specifying", + "still", + "sub", + "such", + "sup", + "sure", + "t's", + "take", + "taken", + "tell", + "tends", + "th", + "than", + "thank", + "thanks", + "thanx", + "that", + "that's", + "thats", + "the", + "their", + "theirs", + "them", + "themselves", + "then", + "thence", + "there", + "there's", + "thereafter", + "thereby", + "therefore", + "therein", + "theres", + "thereupon", + "these", + "they", + "they'd", + "they'll", + "they're", + "they've", + "think", + "third", + "this", + "thorough", + "thoroughly", + "those", + "though", + "three", + "through", + "throughout", + "thru", + "thus", + "to", + "together", + "too", + "took", + "toward", + "towards", + "tried", + "tries", + "truly", + "try", + "trying", + "twice", + "two", + "un", + "under", + "unfortunately", + "unless", + "unlikely", + "until", + "unto", + "up", + "upon", + "us", + "use", + "used", + "useful", + "uses", + "using", + "usually", + "value", + "various", + "very", + "via", + "viz", + "vs", + "want", + "wants", + "was", + "wasn't", + "way", + "we", + "we'd", + "we'll", + "we're", + "we've", + "welcome", + "well", + "went", + "were", + "weren't", + "what", + "what's", + "whatever", + "when", + "whence", + "whenever", + "where", + "where's", + "whereafter", + "whereas", + "whereby", + "wherein", + "whereupon", + "wherever", + "whether", + "which", + "while", + "whither", + "who", + "who's", + "whoever", + "whole", + "whom", + "whose", + "why", + "will", + "willing", + "wish", + "with", + "within", + "without", + "won't", + "wonder", + "would", + "would", + "wouldn't", + "yes", + "yet", + "you", + "you'd", + "you'll", + "you're", + "you've", + "your", + "yours", + "yourself", + "yourselves", + "zero", +#endif + + NULL }; + +static int ft_default_parser_parse(MYSQL_FTPARSER_PARAM *param) +{ + return param->mysql_parse(param, param->doc, param->length); +} + +struct st_mysql_ftparser ft_default_parser= +{ + MYSQL_FTPARSER_INTERFACE_VERSION, ft_default_parser_parse, 0, 0 +}; + Added: trunk/src/ft_stem.c =================================================================== --- trunk/src/ft_stem.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_stem.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,18 @@ +/* Copyright (C) 2000 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +/* mulitingual stem */ Added: trunk/src/ft_stopwords.c =================================================================== --- trunk/src/ft_stopwords.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_stopwords.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,128 @@ +/* Copyright (C) 2000-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +#include "ftdefs.h" +#include "my_handler.h" + +typedef struct st_ft_stopwords +{ + const char * pos; + uint len; +} FT_STOPWORD; + +static TREE *stopwords3=NULL; + +static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)), + FT_STOPWORD *w1, FT_STOPWORD *w2) +{ + return mi_compare_text(default_charset_info, + (uchar *)w1->pos,w1->len, + (uchar *)w2->pos,w2->len,0,0); +} + +static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action, + void *arg __attribute__((unused))) +{ + if (action == free_free) + my_free((uchar*) w->pos, MYF(0)); +} + +static int ft_add_stopword(const char *w) +{ + FT_STOPWORD sw; + return !w || + (((sw.len= (uint) strlen(sw.pos=w)) >= ft_min_word_len) && + (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL)); +} + +int ft_init_stopwords() +{ + if (!stopwords3) + { + if (!(stopwords3=(TREE *)my_malloc(sizeof(TREE),MYF(0)))) + return -1; + init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp, + 0, + (ft_stopword_file ? (tree_element_free)&FT_STOPWORD_free : 0), + NULL); + } + + if (ft_stopword_file) + { + File fd; + uint len; + uchar *buffer, *start, *end; + FT_WORD w; + int error=-1; + + if (!*ft_stopword_file) + return 0; + + if ((fd=my_open(ft_stopword_file, O_RDONLY, MYF(MY_WME))) == -1) + return -1; + len=(uint)my_seek(fd, 0L, MY_SEEK_END, MYF(0)); + my_seek(fd, 0L, MY_SEEK_SET, MYF(0)); + if (!(start=buffer=my_malloc(len+1, MYF(MY_WME)))) + goto err0; + len=my_read(fd, buffer, len, MYF(MY_WME)); + end=start+len; + while (ft_simple_get_word(default_charset_info, &start, end, &w, TRUE)) + { + if (ft_add_stopword(my_strndup((char*) w.pos, w.len, MYF(0)))) + goto err1; + } + error=0; +err1: + my_free(buffer, MYF(0)); +err0: + my_close(fd, MYF(MY_WME)); + return error; + } + else + { + /* compatibility mode: to be removed */ + char **sws=(char **)ft_precompiled_stopwords; + + for (;*sws;sws++) + { + if (ft_add_stopword(*sws)) + return -1; + } + ft_stopword_file="(built-in)"; /* for SHOW VARIABLES */ + } + return 0; +} + +int is_stopword(char *word, uint len) +{ + FT_STOPWORD sw; + sw.pos=word; + sw.len=len; + return tree_search(stopwords3,&sw, stopwords3->custom_arg) != NULL; +} + + +void ft_free_stopwords() +{ + if (stopwords3) + { + delete_tree(stopwords3); /* purecov: inspected */ + my_free((char*) stopwords3,MYF(0)); + stopwords3=0; + } + ft_stopword_file= 0; +} Added: trunk/src/ft_test1.h =================================================================== --- trunk/src/ft_test1.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_test1.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,420 @@ +/* Copyright (C) 2000-2001 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +#define NUPD 20 +#define NDATAS 389 +struct { const char *f0, *f2; } data[NDATAS] = { + {"1", "General Information about MySQL"}, + {"1.1", "What is MySQL?"}, + {"1.2", "About this manual"}, + {"1.3", "History of MySQL"}, + {"1.4", "The main features of MySQL"}, + {"1.5", "General SQL information and tutorials"}, + {"1.6", "Useful MySQL-related links"}, + {"1.7", "What are stored procedures and triggers and so on?"}, + {"2", "MySQL mailing lists and how to ask questions/give error (bug) reports"}, + {"2.1", "Subscribing to/un-subscribing from the MySQL mailing list"}, + {"2.2", "Asking questions or reporting bugs"}, + {"2.3", "I think I have found a bug. What information do you need to help me?"}, + {"2.3.1", "MySQL keeps crashing"}, + {"2.4", "Guidelines for answering questions on the mailing list"}, + {"3", "Licensing or When do I have/want to pay for MySQL?"}, + {"3.1", "How much does MySQL cost?"}, + {"3.2", "How do I get commercial support?"}, + {"3.2.1", "Types of commercial support"}, + {"3.2.1.1", "Basic email support"}, + {"3.2.1.2", "Extended email support"}, +/*------------------------------- NUPD=20 -------------------------------*/ + {"3.2.1.3", "Asking: Login support"}, + {"3.2.1.4", "Extended login support"}, + {"3.3", "How do I pay for licenses/support?"}, + {"3.4", "Who do I contact when I want more information about licensing/support?"}, + {"3.5", "What Copyright does MySQL use?"}, + {"3.6", "When may I distribute MySQL commercially without a fee?"}, + {"3.7", "I want to sell a product that can be configured to use MySQL"}, + {"3.8", "I am running a commercial web server using MySQL"}, + {"3.9", "Do I need a license to sell commercial Perl/tcl/PHP/Web+ etc applications?"}, + {"3.10", "Possible future changes in the licensing"}, + {"4", "Compiling and installing MySQL"}, + {"4.1", "How do I get MySQL?"}, + {"4.2", "Which MySQL version should I use?"}, + {"4.3", "How/when will you release updates?"}, + {"4.4", "What operating systems does MySQL support?"}, + {"4.5", "Compiling MySQL from source code"}, + {"4.5.1", "Quick installation overview"}, + {"4.5.2", "Usual configure switches"}, + {"4.5.3", "Applying a patch"}, + {"4.6", "Problems compiling?"}, + {"4.7", "General compilation notes"}, + {"4.8", "MIT-pthreads notes (FreeBSD)"}, + {"4.9", "Perl installation comments"}, + {"4.10", "Special things to consider for some machine/OS combinations"}, + {"4.10.1", "Solaris notes"}, + {"4.10.2", "SunOS 4 notes"}, + {"4.10.3", "Linux notes for all versions"}, + {"4.10.3.1", "Linux-x86 notes"}, + {"4.10.3.2", "RedHat 5.0"}, + {"4.10.3.3", "RedHat 5.1"}, + {"4.10.3.4", "Linux-Sparc notes"}, + {"4.10.3.5", "Linux-Alpha notes"}, + {"4.10.3.6", "MkLinux notes"}, + {"4.10.4", "Alpha-DEC-Unix notes"}, + {"4.10.5", "Alpha-DEC-OSF1 notes"}, + {"4.10.6", "SGI-IRIX notes"}, + {"4.10.7", "FreeBSD notes"}, + {"4.10.7.1", "FreeBSD-3.0 notes"}, + {"4.10.8", "BSD/OS 2.# notes"}, + {"4.10.8.1", "BSD/OS 3.# notes"}, + {"4.10.9", "SCO notes"}, + {"4.10.10", "SCO Unixware 7.0 notes"}, + {"4.10.11", "IBM-AIX notes"}, + {"4.10.12", "HP-UX notes"}, + {"4.11", "TcX binaries"}, + {"4.12", "Win32 notes"}, + {"4.13", "Installation instructions for MySQL binary releases"}, + {"4.13.1", "How to get MySQL Perl support working"}, + {"4.13.2", "Linux notes"}, + {"4.13.3", "HP-UX notes"}, + {"4.13.4", "Linking client libraries"}, + {"4.14", "Problems running mysql_install_db"}, + {"4.15", "Problems starting MySQL"}, + {"4.16", "Automatic start/stop of MySQL"}, + {"4.17", "Option files"}, + {"5", "How standards-compatible is MySQL?"}, + {"5.1", "What extensions has MySQL to ANSI SQL92?"}, + {"5.2", "What functionality is missing in MySQL?"}, + {"5.2.1", "Sub-selects"}, + {"5.2.2", "SELECT INTO TABLE"}, + {"5.2.3", "Transactions"}, + {"5.2.4", "Triggers"}, + {"5.2.5", "Foreign Keys"}, + {"5.2.5.1", "Some reasons NOT to use FOREIGN KEYS"}, + {"5.2.6", "Views"}, + {"5.2.7", "-- as start of a comment"}, + {"5.3", "What standards does MySQL follow?"}, + {"5.4", "What functions exist only for compatibility?"}, + {"5.5", "Limitations of BLOB and TEXT types"}, + {"5.6", "How to cope without COMMIT-ROLLBACK"}, + {"6", "The MySQL access privilege system"}, + {"6.1", "What the privilege system does"}, + {"6.2", "Connecting to the MySQL server"}, + {"6.2.1", "Keeping your password secure"}, + {"6.3", "Privileges provided by MySQL"}, + {"6.4", "How the privilege system works"}, + {"6.5", "The privilege tables"}, + {"6.6", "Setting up the initial MySQL privileges"}, + {"6.7", "Adding new user privileges to MySQL"}, + {"6.8", "An example permission setup"}, + {"6.9", "Causes of Access denied errors"}, + {"6.10", "How to make MySQL secure against crackers"}, + {"7", "MySQL language reference"}, + {"7.1", "Literals: how to write strings and numbers"}, + {"7.1.1", "Strings"}, + {"7.1.2", "Numbers"}, + {"7.1.3", "NULL values"}, + {"7.1.4", "Database, table, index, column and alias names"}, + {"7.1.4.1", "Case sensitivity in names"}, + {"7.2", "Column types"}, + {"7.2.1", "Column type storage requirements"}, + {"7.2.5", "Numeric types"}, + {"7.2.6", "Date and time types"}, + {"7.2.6.1", "The DATE type"}, + {"7.2.6.2", "The TIME type"}, + {"7.2.6.3", "The DATETIME type"}, + {"7.2.6.4", "The TIMESTAMP type"}, + {"7.2.6.5", "The YEAR type"}, + {"7.2.6.6", "Miscellaneous date and time properties"}, + {"7.2.7", "String types"}, + {"7.2.7.1", "The CHAR and VARCHAR types"}, + {"7.2.7.2", "The BLOB and TEXT types"}, + {"7.2.7.3", "The ENUM type"}, + {"7.2.7.4", "The SET type"}, + {"7.2.8", "Choosing the right type for a column"}, + {"7.2.9", "Column indexes"}, + {"7.2.10", "Multiple-column indexes"}, + {"7.2.11", "Using column types from other database engines"}, + {"7.3", "Functions for use in SELECT and WHERE clauses"}, + {"7.3.1", "Grouping functions"}, + {"7.3.2", "Normal arithmetic operations"}, + {"7.3.3", "Bit functions"}, + {"7.3.4", "Logical operations"}, + {"7.3.5", "Comparison operators"}, + {"7.3.6", "String comparison functions"}, + {"7.3.7", "Control flow functions"}, + {"7.3.8", "Mathematical functions"}, + {"7.3.9", "String functions"}, + {"7.3.10", "Date and time functions"}, + {"7.3.11", "Miscellaneous functions"}, + {"7.3.12", "Functions for use with GROUP BY clauses"}, + {"7.4", "CREATE DATABASE syntax"}, + {"7.5", "DROP DATABASE syntax"}, + {"7.6", "CREATE TABLE syntax"}, + {"7.7", "ALTER TABLE syntax"}, + {"7.8", "OPTIMIZE TABLE syntax"}, + {"7.9", "DROP TABLE syntax"}, + {"7.10", "DELETE syntax"}, + {"7.11", "SELECT syntax"}, + {"7.12", "JOIN syntax"}, + {"7.13", "INSERT syntax"}, + {"7.14", "REPLACE syntax"}, + {"7.15", "LOAD DATA INFILE syntax"}, + {"7.16", "UPDATE syntax"}, + {"7.17", "USE syntax"}, + {"7.18", "SHOW syntax (Get information about tables, columns...)"}, + {"7.19", "EXPLAIN syntax (Get information about a SELECT)"}, + {"7.20", "DESCRIBE syntax (Get information about columns)"}, + {"7.21", "LOCK TABLES/UNLOCK TABLES syntax"}, + {"7.22", "SET OPTION syntax"}, + {"7.23", "GRANT syntax (Compatibility function)"}, + {"7.24", "CREATE INDEX syntax (Compatibility function)"}, + {"7.25", "DROP INDEX syntax (Compatibility function)"}, + {"7.26", "Comment syntax"}, + {"7.27", "CREATE FUNCTION/DROP FUNCTION syntax"}, + {"7.28", "Is MySQL picky about reserved words?"}, + {"8", "Example SQL queries"}, + {"8.1", "Queries from twin project"}, + {"8.1.1", "Find all non-distributed twins"}, + {"8.1.2", "Show a table on twin pair status"}, + {"9", "How safe/stable is MySQL?"}, + {"9.1", "How stable is MySQL?"}, + {"9.2", "Why are there is so many releases of MySQL?"}, + {"9.3", "Checking a table for errors"}, + {"9.4", "How to repair tables"}, + {"9.5", "Is there anything special to do when upgrading/downgrading MySQL?"}, + {"9.5.1", "Upgrading from a 3.21 version to 3.22"}, + {"9.5.2", "Upgrading from a 3.20 version to 3.21"}, + {"9.5.3", "Upgrading to another architecture"}, + {"9.6", "Year 2000 compliance"}, + {"10", "MySQL Server functions"}, + {"10.1", "What languages are supported by MySQL?"}, + {"10.1.1", "Character set used for data & sorting"}, + {"10.2", "The update log"}, + {"10.3", "How big can MySQL tables be?"}, + {"11", "Getting maximum performance from MySQL"}, + {"11.1", "How does one change the size of MySQL buffers?"}, + {"11.2", "How compiling and linking affects the speed of MySQL"}, + {"11.3", "How does MySQL use memory?"}, + {"11.4", "How does MySQL use indexes?"}, + {"11.5", "What optimizations are done on WHERE clauses?"}, + {"11.6", "How does MySQL open & close tables?"}, + {"11.6.0.1", "What are the drawbacks of creating possibly thousands of tables in a database?"}, + {"11.7", "How does MySQL lock tables?"}, + {"11.8", "How should I arrange my table to be as fast/small as possible?"}, + {"11.9", "What affects the speed of INSERT statements?"}, + {"11.10", "What affects the speed DELETE statements?"}, + {"11.11", "How do I get MySQL to run at full speed?"}, + {"11.12", "What are the different row formats? Or, when should VARCHAR/CHAR be used?"}, + {"11.13", "Why so many open tables?"}, + {"12", "MySQL benchmark suite"}, + {"13", "MySQL Utilites"}, + {"13.1", "Overview of the different MySQL programs"}, + {"13.2", "The MySQL table check, optimize and repair program"}, + {"13.2.1", "isamchk memory use"}, + {"13.2.2", "Getting low-level table information"}, + {"13.3", "The MySQL compressed read-only table generator"}, + {"14", "Adding new functions to MySQL"}, + {"15", "MySQL ODBC Support"}, + {"15.1", "Operating systems supported by MyODBC"}, + {"15.2", "How to report problems with MyODBC"}, + {"15.3", "Programs known to work with MyODBC"}, + {"15.4", "How to fill in the various fields in the ODBC administrator program"}, + {"15.5", "How to get the value of an AUTO_INCREMENT column in ODBC"}, + {"16", "Problems and common errors"}, + {"16.1", "Some common errors when using MySQL"}, + {"16.1.1", "MySQL server has gone away error"}, + {"16.1.2", "Can't connect to local MySQL server error"}, + {"16.1.3", "Out of memory error"}, + {"16.1.4", "Packet too large error"}, + {"16.1.5", "The table is full error"}, + {"16.1.6", "Commands out of sync error in client"}, + {"16.1.7", "Removing user error"}, + {"16.2", "How MySQL handles a full disk"}, + {"16.3", "How to run SQL commands from a text file"}, + {"16.4", "Where MySQL stores temporary files"}, + {"16.5", "Access denied error"}, + {"16.6", "How to run MySQL as a normal user"}, + {"16.7", "Problems with file permissions"}, + {"16.8", "File not found"}, + {"16.9", "Problems using DATE columns"}, + {"16.10", "Case sensitivity in searches"}, + {"16.11", "Problems with NULL values"}, + {"17", "Solving some common problems with MySQL"}, + {"17.1", "Database replication"}, + {"17.2", "Database backups"}, + {"18", "MySQL client tools and API's"}, + {"18.1", "MySQL C API"}, + {"18.2", "C API datatypes"}, + {"18.3", "C API function overview"}, + {"18.4", "C API function descriptions"}, + {"18.4.1", "mysql_affected_rows()"}, + {"18.4.2", "mysql_close()"}, + {"18.4.3", "mysql_connect()"}, + {"18.4.4", "mysql_create_db()"}, + {"18.4.5", "mysql_data_seek()"}, + {"18.4.6", "mysql_debug()"}, + {"18.4.7", "mysql_drop_db()"}, + {"18.4.8", "mysql_dump_debug_info()"}, + {"18.4.9", "mysql_eof()"}, + {"18.4.10", "mysql_errno()"}, + {"18.4.11", "mysql_error()"}, + {"18.4.12", "mysql_escape_string()"}, + {"18.4.13", "mysql_fetch_field()"}, + {"18.4.14", "mysql_fetch_fields()"}, + {"18.4.15", "mysql_fetch_field_direct()"}, + {"18.4.16", "mysql_fetch_lengths()"}, + {"18.4.17", "mysql_fetch_row()"}, + {"18.4.18", "mysql_field_seek()"}, + {"18.4.19", "mysql_field_tell()"}, + {"18.4.20", "mysql_free_result()"}, + {"18.4.21", "mysql_get_client_info()"}, + {"18.4.22", "mysql_get_host_info()"}, + {"18.4.23", "mysql_get_proto_info()"}, + {"18.4.24", "mysql_get_server_info()"}, + {"18.4.25", "mysql_info()"}, + {"18.4.26", "mysql_init()"}, + {"18.4.27", "mysql_insert_id()"}, + {"18.4.28", "mysql_kill()"}, + {"18.4.29", "mysql_list_dbs()"}, + {"18.4.30", "mysql_list_fields()"}, + {"18.4.31", "mysql_list_processes()"}, + {"18.4.32", "mysql_list_tables()"}, + {"18.4.33", "mysql_num_fields()"}, + {"18.4.34", "mysql_num_rows()"}, + {"18.4.35", "mysql_query()"}, + {"18.4.36", "mysql_real_connect()"}, + {"18.4.37", "mysql_real_query()"}, + {"18.4.38", "mysql_reload()"}, + {"18.4.39", "mysql_row_tell()"}, + {"18.4.40", "mysql_select_db()"}, + {"18.4.41", "mysql_shutdown()"}, + {"18.4.42", "mysql_stat()"}, + {"18.4.43", "mysql_store_result()"}, + {"18.4.44", "mysql_thread_id()"}, + {"18.4.45", "mysql_use_result()"}, + {"18.4.46", "Why is it that after mysql_query() returns success, mysql_store_result() sometimes returns NULL?"}, + {"18.4.47", "What results can I get from a query?"}, + {"18.4.48", "How can I get the unique ID for the last inserted row?"}, + {"18.4.49", "Problems linking with the C API"}, + {"18.4.50", "How to make a thread-safe client"}, + {"18.5", "MySQL Perl API's"}, + {"18.5.1", "DBI with DBD::mysql"}, + {"18.5.1.1", "The DBI interface"}, + {"18.5.1.2", "More DBI/DBD information"}, + {"18.6", "MySQL Java connectivity (JDBC)"}, + {"18.7", "MySQL PHP API's"}, + {"18.8", "MySQL C++ API's"}, + {"18.9", "MySQL Python API's"}, + {"18.10", "MySQL TCL API's"}, + {"19", "How MySQL compares to other databases"}, + {"19.1", "How MySQL compares to mSQL"}, + {"19.1.1", "How to convert mSQL tools for MySQL"}, + {"19.1.2", "How mSQL and MySQL client/server communications protocols differ"}, + {"19.1.3", "How mSQL 2.0 SQL syntax differs from MySQL"}, + {"19.2", "How MySQL compares to PostgreSQL"}, + {"A", "Some users of MySQL"}, + {"B", "Contributed programs"}, + {"C", "Contributors to MySQL"}, + {"D", "MySQL change history"}, + {"19.3", "Changes in release 3.22.x (Alpha version)"}, + {"19.3.1", "Changes in release 3.22.7"}, + {"19.3.2", "Changes in release 3.22.6"}, + {"19.3.3", "Changes in release 3.22.5"}, + {"19.3.4", "Changes in release 3.22.4"}, + {"19.3.5", "Changes in release 3.22.3"}, + {"19.3.6", "Changes in release 3.22.2"}, + {"19.3.7", "Changes in release 3.22.1"}, + {"19.3.8", "Changes in release 3.22.0"}, + {"19.4", "Changes in release 3.21.x"}, + {"19.4.1", "Changes in release 3.21.33"}, + {"19.4.2", "Changes in release 3.21.32"}, + {"19.4.3", "Changes in release 3.21.31"}, + {"19.4.4", "Changes in release 3.21.30"}, + {"19.4.5", "Changes in release 3.21.29"}, + {"19.4.6", "Changes in release 3.21.28"}, + {"19.4.7", "Changes in release 3.21.27"}, + {"19.4.8", "Changes in release 3.21.26"}, + {"19.4.9", "Changes in release 3.21.25"}, + {"19.4.10", "Changes in release 3.21.24"}, + {"19.4.11", "Changes in release 3.21.23"}, + {"19.4.12", "Changes in release 3.21.22"}, + {"19.4.13", "Changes in release 3.21.21a"}, + {"19.4.14", "Changes in release 3.21.21"}, + {"19.4.15", "Changes in release 3.21.20"}, + {"19.4.16", "Changes in release 3.21.19"}, + {"19.4.17", "Changes in release 3.21.18"}, + {"19.4.18", "Changes in release 3.21.17"}, + {"19.4.19", "Changes in release 3.21.16"}, + {"19.4.20", "Changes in release 3.21.15"}, + {"19.4.21", "Changes in release 3.21.14b"}, + {"19.4.22", "Changes in release 3.21.14a"}, + {"19.4.23", "Changes in release 3.21.13"}, + {"19.4.24", "Changes in release 3.21.12"}, + {"19.4.25", "Changes in release 3.21.11"}, + {"19.4.26", "Changes in release 3.21.10"}, + {"19.4.27", "Changes in release 3.21.9"}, + {"19.4.28", "Changes in release 3.21.8"}, + {"19.4.29", "Changes in release 3.21.7"}, + {"19.4.30", "Changes in release 3.21.6"}, + {"19.4.31", "Changes in release 3.21.5"}, + {"19.4.32", "Changes in release 3.21.4"}, + {"19.4.33", "Changes in release 3.21.3"}, + {"19.4.34", "Changes in release 3.21.2"}, + {"19.4.35", "Changes in release 3.21.0"}, + {"19.5", "Changes in release 3.20.x"}, + {"19.5.1", "Changes in release 3.20.18"}, + {"19.5.2", "Changes in release 3.20.17"}, + {"19.5.3", "Changes in release 3.20.16"}, + {"19.5.4", "Changes in release 3.20.15"}, + {"19.5.5", "Changes in release 3.20.14"}, + {"19.5.6", "Changes in release 3.20.13"}, + {"19.5.7", "Changes in release 3.20.11"}, + {"19.5.8", "Changes in release 3.20.10"}, + {"19.5.9", "Changes in release 3.20.9"}, + {"19.5.10", "Changes in release 3.20.8"}, + {"19.5.11", "Changes in release 3.20.7"}, + {"19.5.12", "Changes in release 3.20.6"}, + {"19.5.13", "Changes in release 3.20.3"}, + {"19.5.14", "Changes in release 3.20.0"}, + {"19.6", "Changes in release 3.19.x"}, + {"19.6.1", "Changes in release 3.19.5"}, + {"19.6.2", "Changes in release 3.19.4"}, + {"19.6.3", "Changes in release 3.19.3"}, + {"E", "Known errors and design deficiencies in MySQL"}, + {"F", "List of things we want to add to MySQL in the future (The TODO)"}, + {"19.7", "Things that must done in the real near future"}, + {"19.8", "Things that have to be done sometime"}, + {"19.9", "Some things we don't have any plans to do"}, + {"G", "Comments on porting to other systems"}, + {"19.10", "Debugging MySQL"}, + {"19.11", "Comments about RTS threads"}, + {"19.12", "What is the difference between different thread packages?"}, + {"H", "Description of MySQL regular expression syntax"}, + {"I", "What is Unireg?"}, + {"J", "The MySQL server license"}, + {"K", "The MySQL license for Microsoft operating systems"}, + {"*", "SQL command, type and function index"}, + {"*", "Concept Index"} +}; + +#define NQUERIES 5 +const char *query[NQUERIES]={ + "mysql information and manual", + "upgrading from previous version", + "column indexes", + "against about after more right the with/without", /* stopwords test */ + "mysql license and copyright" +}; Added: trunk/src/ft_update.c =================================================================== --- trunk/src/ft_update.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ft_update.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,352 @@ +/* Copyright (C) 2000-2004, 2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +/* functions to work with full-text indices */ + +#include "ftdefs.h" +#include + +void _mi_ft_segiterator_init(MI_INFO *info, uint keynr, const uchar *record, + FT_SEG_ITERATOR *ftsi) +{ + DBUG_ENTER("_mi_ft_segiterator_init"); + + ftsi->num=info->s->keyinfo[keynr].keysegs; + ftsi->seg=info->s->keyinfo[keynr].seg; + ftsi->rec=record; + DBUG_VOID_RETURN; +} + +void _mi_ft_segiterator_dummy_init(const uchar *record, uint len, + FT_SEG_ITERATOR *ftsi) +{ + DBUG_ENTER("_mi_ft_segiterator_dummy_init"); + + ftsi->num=1; + ftsi->seg=0; + ftsi->pos=record; + ftsi->len=len; + DBUG_VOID_RETURN; +} + +/* + This function breaks convention "return 0 in success" + but it's easier to use like this + + while(_mi_ft_segiterator()) + + so "1" means "OK", "0" means "EOF" +*/ + +uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi) +{ + DBUG_ENTER("_mi_ft_segiterator"); + + if (!ftsi->num) + DBUG_RETURN(0); + + ftsi->num--; + if (!ftsi->seg) + DBUG_RETURN(1); + + ftsi->seg--; + + if (ftsi->seg->null_bit && + (ftsi->rec[ftsi->seg->null_pos] & ftsi->seg->null_bit)) + { + ftsi->pos=0; + DBUG_RETURN(1); + } + ftsi->pos= ftsi->rec+ftsi->seg->start; + if (ftsi->seg->flag & HA_VAR_LENGTH_PART) + { + uint pack_length= (ftsi->seg->bit_start); + ftsi->len= (pack_length == 1 ? (uint) *(uchar*) ftsi->pos : + uint2korr(ftsi->pos)); + ftsi->pos+= pack_length; /* Skip VARCHAR length */ + DBUG_RETURN(1); + } + if (ftsi->seg->flag & HA_BLOB_PART) + { + ftsi->len=_mi_calc_blob_length(ftsi->seg->bit_start,ftsi->pos); + memcpy_fixed((char*) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start, + sizeof(char*)); + DBUG_RETURN(1); + } + ftsi->len=ftsi->seg->length; + DBUG_RETURN(1); +} + + +/* parses a document i.e. calls ft_parse for every keyseg */ + +uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const uchar *record, + MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root) +{ + FT_SEG_ITERATOR ftsi; + struct st_mysql_ftparser *parser; + DBUG_ENTER("_mi_ft_parse"); + + _mi_ft_segiterator_init(info, keynr, record, &ftsi); + + ft_parse_init(parsed, info->s->keyinfo[keynr].seg->charset); + parser= info->s->keyinfo[keynr].parser; + while (_mi_ft_segiterator(&ftsi)) + { + if (ftsi.pos) + if (ft_parse(parsed, (uchar *)ftsi.pos, ftsi.len, parser, param, mem_root)) + DBUG_RETURN(1); + } + DBUG_RETURN(0); +} + +FT_WORD *_mi_ft_parserecord(MI_INFO *info, uint keynr, const uchar *record, + MEM_ROOT *mem_root) +{ + TREE ptree; + MYSQL_FTPARSER_PARAM *param; + DBUG_ENTER("_mi_ft_parserecord"); + if (! (param= ftparser_call_initializer(info, keynr, 0))) + DBUG_RETURN(NULL); + bzero((char*) &ptree, sizeof(ptree)); + param->flags= 0; + if (_mi_ft_parse(&ptree, info, keynr, record, param, mem_root)) + DBUG_RETURN(NULL); + + DBUG_RETURN(ft_linearize(&ptree, mem_root)); +} + +static int _mi_ft_store(MI_INFO *info, uint keynr, uchar *keybuf, + FT_WORD *wlist, my_off_t filepos) +{ + uint key_length; + DBUG_ENTER("_mi_ft_store"); + + for (; wlist->pos; wlist++) + { + key_length=_ft_make_key(info,keynr,keybuf,wlist,filepos); + if (_mi_ck_write(info,keynr,(uchar*) keybuf,key_length)) + DBUG_RETURN(1); + } + DBUG_RETURN(0); +} + +static int _mi_ft_erase(MI_INFO *info, uint keynr, uchar *keybuf, + FT_WORD *wlist, my_off_t filepos) +{ + uint key_length, err=0; + DBUG_ENTER("_mi_ft_erase"); + + for (; wlist->pos; wlist++) + { + key_length=_ft_make_key(info,keynr,keybuf,wlist,filepos); + if (_mi_ck_delete(info,keynr,(uchar*) keybuf,key_length)) + err=1; + } + DBUG_RETURN(err); +} + +/* + Compares an appropriate parts of two WORD_KEY keys directly out of records + returns 1 if they are different +*/ + +#define THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT 1 +#define GEE_THEY_ARE_ABSOLUTELY_IDENTICAL 0 + +int _mi_ft_cmp(MI_INFO *info, uint keynr, const uchar *rec1, const uchar *rec2) +{ + FT_SEG_ITERATOR ftsi1, ftsi2; + CHARSET_INFO *cs=info->s->keyinfo[keynr].seg->charset; + DBUG_ENTER("_mi_ft_cmp"); + _mi_ft_segiterator_init(info, keynr, rec1, &ftsi1); + _mi_ft_segiterator_init(info, keynr, rec2, &ftsi2); + + while (_mi_ft_segiterator(&ftsi1) && _mi_ft_segiterator(&ftsi2)) + { + if ((ftsi1.pos != ftsi2.pos) && + (!ftsi1.pos || !ftsi2.pos || + mi_compare_text(cs, (uchar*) ftsi1.pos,ftsi1.len, + (uchar*) ftsi2.pos,ftsi2.len,0,0))) + DBUG_RETURN(THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT); + } + DBUG_RETURN(GEE_THEY_ARE_ABSOLUTELY_IDENTICAL); +} + + +/* update a document entry */ + +int _mi_ft_update(MI_INFO *info, uint keynr, uchar *keybuf, + const uchar *oldrec, const uchar *newrec, my_off_t pos) +{ + int error= -1; + FT_WORD *oldlist,*newlist, *old_word, *new_word; + CHARSET_INFO *cs=info->s->keyinfo[keynr].seg->charset; + uint key_length; + int cmp, cmp2; + DBUG_ENTER("_mi_ft_update"); + + if (!(old_word=oldlist=_mi_ft_parserecord(info, keynr, oldrec, + &info->ft_memroot)) || + !(new_word=newlist=_mi_ft_parserecord(info, keynr, newrec, + &info->ft_memroot))) + goto err; + + error=0; + while(old_word->pos && new_word->pos) + { + cmp= mi_compare_text(cs, (uchar*) old_word->pos,old_word->len, + (uchar*) new_word->pos,new_word->len,0,0); + cmp2= cmp ? 0 : (fabs(old_word->weight - new_word->weight) > 1.e-5); + + if (cmp < 0 || cmp2) + { + key_length=_ft_make_key(info,keynr,keybuf,old_word,pos); + if ((error=_mi_ck_delete(info,keynr,(uchar*) keybuf,key_length))) + goto err; + } + if (cmp > 0 || cmp2) + { + key_length=_ft_make_key(info,keynr,keybuf,new_word,pos); + if ((error=_mi_ck_write(info,keynr,(uchar*) keybuf,key_length))) + goto err; + } + if (cmp<=0) old_word++; + if (cmp>=0) new_word++; + } + if (old_word->pos) + error=_mi_ft_erase(info,keynr,keybuf,old_word,pos); + else if (new_word->pos) + error=_mi_ft_store(info,keynr,keybuf,new_word,pos); + +err: + free_root(&info->ft_memroot, MYF(MY_MARK_BLOCKS_FREE)); + DBUG_RETURN(error); +} + + +/* adds a document to the collection */ + +int _mi_ft_add(MI_INFO *info, uint keynr, uchar *keybuf, const uchar *record, + my_off_t pos) +{ + int error= -1; + FT_WORD *wlist; + DBUG_ENTER("_mi_ft_add"); + DBUG_PRINT("enter",("keynr: %d",keynr)); + + if ((wlist=_mi_ft_parserecord(info, keynr, record, &info->ft_memroot))) + error=_mi_ft_store(info,keynr,keybuf,wlist,pos); + + free_root(&info->ft_memroot, MYF(MY_MARK_BLOCKS_FREE)); + DBUG_PRINT("exit",("Return: %d",error)); + DBUG_RETURN(error); +} + + +/* removes a document from the collection */ + +int _mi_ft_del(MI_INFO *info, uint keynr, uchar *keybuf, const uchar *record, + my_off_t pos) +{ + int error= -1; + FT_WORD *wlist; + DBUG_ENTER("_mi_ft_del"); + DBUG_PRINT("enter",("keynr: %d",keynr)); + + if ((wlist=_mi_ft_parserecord(info, keynr, record, &info->ft_memroot))) + error=_mi_ft_erase(info,keynr,keybuf,wlist,pos); + + free_root(&info->ft_memroot, MYF(MY_MARK_BLOCKS_FREE)); + DBUG_PRINT("exit",("Return: %d",error)); + DBUG_RETURN(error); +} + +uint _ft_make_key(MI_INFO *info, uint keynr, uchar *keybuf, FT_WORD *wptr, + my_off_t filepos) +{ + uchar buf[HA_FT_MAXBYTELEN+16]; + DBUG_ENTER("_ft_make_key"); + +#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT + { + float weight=(float) ((filepos==HA_OFFSET_ERROR) ? 0 : wptr->weight); + mi_float4store(buf,weight); + } +#else +#error +#endif + + int2store(buf+HA_FT_WLEN,wptr->len); + memcpy(buf+HA_FT_WLEN+2,wptr->pos,wptr->len); + DBUG_RETURN(_mi_make_key(info,keynr,(uchar*) keybuf,buf,filepos)); +} + + +/* + convert key value to ft2 +*/ + +uint _mi_ft_convert_to_ft2(MI_INFO *info, uint keynr, uchar *key) +{ + my_off_t root; + DYNAMIC_ARRAY *da=info->ft1_to_ft2; + MI_KEYDEF *keyinfo=&info->s->ft2_keyinfo; + uchar *key_ptr= (uchar*) dynamic_array_ptr(da, 0), *end; + uint length, key_length; + DBUG_ENTER("_mi_ft_convert_to_ft2"); + + /* we'll generate one pageful at once, and insert the rest one-by-one */ + /* calculating the length of this page ...*/ + length=(keyinfo->block_length-2) / keyinfo->keylength; + set_if_smaller(length, da->elements); + length=length * keyinfo->keylength; + + get_key_full_length_rdonly(key_length, key); + while (_mi_ck_delete(info, keynr, key, key_length) == 0) + { + /* + nothing to do here. + _mi_ck_delete() will populate info->ft1_to_ft2 with deleted keys + */ + } + + /* creating pageful of keys */ + mi_putint(info->buff,length+2,0); + memcpy(info->buff+2, key_ptr, length); + info->buff_used=info->page_changed=1; /* info->buff is used */ + if ((root= _mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR || + _mi_write_keypage(info,keyinfo,root,DFLT_INIT_HITS,info->buff)) + DBUG_RETURN(-1); + + /* inserting the rest of key values */ + end= (uchar*) dynamic_array_ptr(da, da->elements); + for (key_ptr+=length; key_ptr < end; key_ptr+=keyinfo->keylength) + if(_mi_ck_real_write_btree(info, keyinfo, key_ptr, 0, &root, SEARCH_SAME)) + DBUG_RETURN(-1); + + /* now, writing the word key entry */ + ft_intXstore(key+key_length, - (int) da->elements); + _mi_dpointer(info, key+key_length+HA_FT_WLEN, root); + + DBUG_RETURN(_mi_ck_real_write_btree(info, + info->s->keyinfo+keynr, + key, 0, + &info->s->state.key_root[keynr], + SEARCH_SAME)); +} + Added: trunk/src/ftdefs.h =================================================================== --- trunk/src/ftdefs.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ftdefs.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,152 @@ +/* Copyright (C) 2000-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +/* some definitions for full-text indices */ + +#include "fulltext.h" +#include +#include +#include +#include + +#define true_word_char(ctype, character) \ + ((ctype) & (_MY_U | _MY_L | _MY_NMR) || \ + (character) == '_') +#define misc_word_char(X) 0 + +#define FT_MAX_WORD_LEN_FOR_SORT 31 + +#define FTPARSER_MEMROOT_ALLOC_SIZE 65536 + +#define COMPILE_STOPWORDS_IN + +/* Interested readers may consult SMART + (ftp://ftp.cs.cornell.edu/pub/smart/smart.11.0.tar.Z) + for an excellent implementation of vector space model we use. + It also demonstrate the usage of different weghting techniques. + This code, though, is completely original and is not based on the + SMART code but was in some cases inspired by it. + + NORM_PIVOT was taken from the article + A.Singhal, C.Buckley, M.Mitra, "Pivoted Document Length Normalization", + ACM SIGIR'96, 21-29, 1996 + */ + +#define LWS_FOR_QUERY LWS_TF +#define LWS_IN_USE LWS_LOG +#define PRENORM_IN_USE PRENORM_AVG +#define NORM_IN_USE NORM_PIVOT +#define GWS_IN_USE GWS_PROB +/*==============================================================*/ +#define LWS_TF (count) +#define LWS_BINARY (count>0) +#define LWS_SQUARE (count*count) +#define LWS_LOG (count?(log( (double) count)+1):0) +/*--------------------------------------------------------------*/ +#define PRENORM_NONE (p->weight) +#define PRENORM_MAX (p->weight/docstat.max) +#define PRENORM_AUG (0.4+0.6*p->weight/docstat.max) +#define PRENORM_AVG (p->weight/docstat.sum*docstat.uniq) +#define PRENORM_AVGLOG ((1+log(p->weight))/(1+log(docstat.sum/docstat.uniq))) +/*--------------------------------------------------------------*/ +#define NORM_NONE (1) +#define NORM_SUM (docstat.nsum) +#define NORM_COS (sqrt(docstat.nsum2)) + +#define PIVOT_VAL (0.0115) +#define NORM_PIVOT (1+PIVOT_VAL*docstat.uniq) +/*---------------------------------------------------------------*/ +#define GWS_NORM (1/sqrt(sum2)) +#define GWS_GFIDF (sum/doc_cnt) +/* Mysterious, but w/o (double) GWS_IDF performs better :-o */ +#define GWS_IDF log(aio->info->state->records/doc_cnt) +#define GWS_IDF1 log((double)aio->info->state->records/doc_cnt) +#define GWS_PROB ((aio->info->state->records > doc_cnt) ? log(((double)(aio->info->state->records-doc_cnt))/doc_cnt) : 0 ) +#define GWS_FREQ (1.0/doc_cnt) +#define GWS_SQUARED pow(log((double)aio->info->state->records/doc_cnt),2) +#define GWS_CUBIC pow(log((double)aio->info->state->records/doc_cnt),3) +#define GWS_ENTROPY (1-(suml/sum-log(sum))/log(aio->info->state->records)) +/*=================================================================*/ + +/* Boolean search operators */ +#define FTB_YES (ft_boolean_syntax[0]) +#define FTB_EGAL (ft_boolean_syntax[1]) +#define FTB_NO (ft_boolean_syntax[2]) +#define FTB_INC (ft_boolean_syntax[3]) +#define FTB_DEC (ft_boolean_syntax[4]) +#define FTB_LBR (ft_boolean_syntax[5]) +#define FTB_RBR (ft_boolean_syntax[6]) +#define FTB_NEG (ft_boolean_syntax[7]) +#define FTB_TRUNC (ft_boolean_syntax[8]) +#define FTB_LQUOT (ft_boolean_syntax[10]) +#define FTB_RQUOT (ft_boolean_syntax[11]) + +typedef struct st_ft_word { + uchar * pos; + uint len; + double weight; +} FT_WORD; + +int is_stopword(char *word, uint len); + +uint _ft_make_key(MI_INFO *, uint , uchar *, FT_WORD *, my_off_t); + +uchar ft_get_word(CHARSET_INFO *, uchar **, uchar *, FT_WORD *, + MYSQL_FTPARSER_BOOLEAN_INFO *); +uchar ft_simple_get_word(CHARSET_INFO *, uchar **, const uchar *, + FT_WORD *, my_bool); + +typedef struct _st_ft_seg_iterator { + uint num, len; + HA_KEYSEG *seg; + const uchar *rec, *pos; +} FT_SEG_ITERATOR; + +void _mi_ft_segiterator_init(MI_INFO *, uint, const uchar *, FT_SEG_ITERATOR *); +void _mi_ft_segiterator_dummy_init(const uchar *, uint, FT_SEG_ITERATOR *); +uint _mi_ft_segiterator(FT_SEG_ITERATOR *); + +void ft_parse_init(TREE *, CHARSET_INFO *); +int ft_parse(TREE *, uchar *, int, struct st_mysql_ftparser *parser, + MYSQL_FTPARSER_PARAM *, MEM_ROOT *); +FT_WORD * ft_linearize(TREE *, MEM_ROOT *); +FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, const uchar *, MEM_ROOT *); +uint _mi_ft_parse(TREE *, MI_INFO *, uint, const uchar *, + MYSQL_FTPARSER_PARAM *, MEM_ROOT *); + +FT_INFO *ft_init_nlq_search(MI_INFO *, uint, uchar *, uint, uint, uchar *); +FT_INFO *ft_init_boolean_search(MI_INFO *, uint, uchar *, uint, CHARSET_INFO *); + +extern const struct _ft_vft _ft_vft_nlq; +int ft_nlq_read_next(FT_INFO *, char *); +float ft_nlq_find_relevance(FT_INFO *, uchar *, uint); +void ft_nlq_close_search(FT_INFO *); +float ft_nlq_get_relevance(FT_INFO *); +my_off_t ft_nlq_get_docid(FT_INFO *); +void ft_nlq_reinit_search(FT_INFO *); + +extern const struct _ft_vft _ft_vft_boolean; +int ft_boolean_read_next(FT_INFO *, char *); +float ft_boolean_find_relevance(FT_INFO *, uchar *, uint); +void ft_boolean_close_search(FT_INFO *); +float ft_boolean_get_relevance(FT_INFO *); +my_off_t ft_boolean_get_docid(FT_INFO *); +void ft_boolean_reinit_search(FT_INFO *); +extern MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info, + uint keynr, + uint paramnr); +extern void ftparser_call_deinitializer(MI_INFO *info); Added: trunk/src/fulltext.h =================================================================== --- trunk/src/fulltext.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/fulltext.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,37 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ + +/* some definitions for full-text indices */ + +#include "myisamdef.h" +#include "ft_global.h" + +#define HA_FT_WTYPE HA_KEYTYPE_FLOAT +#define HA_FT_WLEN 4 +#define FT_SEGS 2 + +#define ft_sintXkorr(A) mi_sint4korr(A) +#define ft_intXstore(T,A) mi_int4store(T,A) + +extern const HA_KEYSEG ft_keysegs[FT_SEGS]; + +int _mi_ft_cmp(MI_INFO *, uint, const uchar *, const uchar *); +int _mi_ft_add(MI_INFO *, uint, uchar *, const uchar *, my_off_t); +int _mi_ft_del(MI_INFO *, uint, uchar *, const uchar *, my_off_t); + +uint _mi_ft_convert_to_ft2(MI_INFO *, uint, uchar *); + Added: trunk/src/ha_tritonn.cc =================================================================== --- trunk/src/ha_tritonn.cc 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ha_tritonn.cc 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,2121 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif + +#define MYSQL_SERVER 1 +#include "mysql_priv.h" +#include +#include +#include +#include "ha_tritonn.h" +#include +#include "myisamdef.h" +#include "rt_index.h" + +ulong myisam_recover_options= HA_RECOVER_NONE; + +/* bits in myisam_recover_options */ +const char *myisam_recover_names[] = +{ "DEFAULT", "BACKUP", "FORCE", "QUICK", NullS}; +TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"", + myisam_recover_names, NULL}; + +const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal", + "nulls_ignored", NullS}; +TYPELIB myisam_stats_method_typelib= { + array_elements(myisam_stats_method_names) - 1, "", + myisam_stats_method_names, NULL}; + + +/***************************************************************************** +** MyISAM tables +*****************************************************************************/ + +static handler *myisam_create_handler(handlerton *hton, + TABLE_SHARE *table, + MEM_ROOT *mem_root) +{ + return new (mem_root) ha_tritonn(hton, table); +} + +// collect errors printed by mi_check routines + +static void mi_check_print_msg(MI_CHECK *param, const char* msg_type, + const char *fmt, va_list args) +{ + THD* thd = (THD*)param->thd; + Protocol *protocol= thd->protocol; + uint length, msg_length; + char msgbuf[MI_MAX_MSG_BUF]; + char name[NAME_LEN*2+2]; + + msg_length= my_vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); + msgbuf[sizeof(msgbuf) - 1] = 0; // healthy paranoia + + DBUG_PRINT(msg_type,("message: %s",msgbuf)); + + if (!thd->vio_ok()) + { + sql_print_error(msgbuf); + return; + } + + if (param->testflag & (T_CREATE_MISSING_KEYS | T_SAFE_REPAIR | + T_AUTO_REPAIR)) + { + my_message(ER_NOT_KEYFILE,msgbuf,MYF(MY_WME)); + return; + } + length=(uint) (strxmov(name, param->db_name,".",param->table_name,NullS) - + name); + /* + TODO: switch from protocol to push_warning here. The main reason we didn't + it yet is parallel repair. Due to following trace: + mi_check_print_msg/push_warning/sql_alloc/my_pthread_getspecific_ptr. + + Also we likely need to lock mutex here (in both cases with protocol and + push_warning). + */ + protocol->prepare_for_resend(); + protocol->store(name, length, system_charset_info); + protocol->store(param->op_name, system_charset_info); + protocol->store(msg_type, system_charset_info); + protocol->store(msgbuf, msg_length, system_charset_info); + if (protocol->write()) + sql_print_error("Failed on my_net_write, writing to stderr instead: %s\n", + msgbuf); + return; +} + + +/* + Convert TABLE object to MyISAM key and column definition + + SYNOPSIS + table2myisam() + table_arg in TABLE object. + keydef_out out MyISAM key definition. + recinfo_out out MyISAM column definition. + records_out out Number of fields. + + DESCRIPTION + This function will allocate and initialize MyISAM key and column + definition for further use in mi_create or for a check for underlying + table conformance in merge engine. + + RETURN VALUE + 0 OK + !0 error code +*/ + +int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out, + MI_COLUMNDEF **recinfo_out, uint *records_out) +{ + uint i, j, recpos, minpos, fieldpos, temp_length, length; + enum ha_base_keytype type= HA_KEYTYPE_BINARY; + uchar *record; + KEY *pos; + MI_KEYDEF *keydef; + MI_COLUMNDEF *recinfo, *recinfo_pos; + HA_KEYSEG *keyseg; + TABLE_SHARE *share= table_arg->s; + uint options= share->db_options_in_use; + DBUG_ENTER("table2myisam"); + if (!(my_multi_malloc(MYF(MY_WME), + recinfo_out, (share->fields * 2 + 2) * sizeof(MI_COLUMNDEF), + keydef_out, share->keys * sizeof(MI_KEYDEF), + &keyseg, + (share->key_parts + share->keys) * sizeof(HA_KEYSEG), + NullS))) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); /* purecov: inspected */ + keydef= *keydef_out; + recinfo= *recinfo_out; + pos= table_arg->key_info; + for (i= 0; i < share->keys; i++, pos++) + { + keydef[i].flag= (pos->flags & (HA_NOSAME | HA_FULLTEXT | HA_SPATIAL)); + keydef[i].key_alg= pos->algorithm == HA_KEY_ALG_UNDEF ? + (pos->flags & HA_SPATIAL ? HA_KEY_ALG_RTREE : HA_KEY_ALG_BTREE) : + pos->algorithm; + keydef[i].block_length= pos->block_size; + keydef[i].seg= keyseg; + keydef[i].keysegs= pos->key_parts; + for (j= 0; j < pos->key_parts; j++) + { + Field *field= pos->key_part[j].field; + type= field->key_type(); + keydef[i].seg[j].flag= pos->key_part[j].key_part_flag; + + if (options & HA_OPTION_PACK_KEYS || + (pos->flags & (HA_PACK_KEY | HA_BINARY_PACK_KEY | + HA_SPACE_PACK_USED))) + { + if (pos->key_part[j].length > 8 && + (type == HA_KEYTYPE_TEXT || + type == HA_KEYTYPE_NUM || + (type == HA_KEYTYPE_BINARY && !field->zero_pack()))) + { + /* No blobs here */ + if (j == 0) + keydef[i].flag|= HA_PACK_KEY; + if (!(field->flags & ZEROFILL_FLAG) && + (field->type() == MYSQL_TYPE_STRING || + field->type() == MYSQL_TYPE_VAR_STRING || + ((int) (pos->key_part[j].length - field->decimals())) >= 4)) + keydef[i].seg[j].flag|= HA_SPACE_PACK; + } + else if (j == 0 && (!(pos->flags & HA_NOSAME) || pos->key_length > 16)) + keydef[i].flag|= HA_BINARY_PACK_KEY; + } + keydef[i].seg[j].type= (int) type; + keydef[i].seg[j].start= pos->key_part[j].offset; + keydef[i].seg[j].length= pos->key_part[j].length; + keydef[i].seg[j].bit_start= keydef[i].seg[j].bit_end= + keydef[i].seg[j].bit_length= 0; + keydef[i].seg[j].bit_pos= 0; + keydef[i].seg[j].language= field->charset()->number; + + if (field->null_ptr) + { + keydef[i].seg[j].null_bit= field->null_bit; + keydef[i].seg[j].null_pos= (uint) (field->null_ptr- + (uchar*) table_arg->record[0]); + } + else + { + keydef[i].seg[j].null_bit= 0; + keydef[i].seg[j].null_pos= 0; + } + if (field->type() == MYSQL_TYPE_BLOB || + field->type() == MYSQL_TYPE_GEOMETRY) + { + keydef[i].seg[j].flag|= HA_BLOB_PART; + /* save number of bytes used to pack length */ + keydef[i].seg[j].bit_start= (uint) (field->pack_length() - + share->blob_ptr_size); + } + else if (field->type() == MYSQL_TYPE_BIT) + { + keydef[i].seg[j].bit_length= ((Field_bit *) field)->bit_len; + keydef[i].seg[j].bit_start= ((Field_bit *) field)->bit_ofs; + keydef[i].seg[j].bit_pos= (uint) (((Field_bit *) field)->bit_ptr - + (uchar*) table_arg->record[0]); + } + } + keyseg+= pos->key_parts; + } + if (table_arg->found_next_number_field) + keydef[share->next_number_index].flag|= HA_AUTO_KEY; + record= table_arg->record[0]; + recpos= 0; + recinfo_pos= recinfo; + while (recpos < (uint) share->reclength) + { + Field **field, *found= 0; + minpos= share->reclength; + length= 0; + + for (field= table_arg->field; *field; field++) + { + if ((fieldpos= (*field)->offset(record)) >= recpos && + fieldpos <= minpos) + { + /* skip null fields */ + if (!(temp_length= (*field)->pack_length_in_rec())) + continue; /* Skip null-fields */ + if (! found || fieldpos < minpos || + (fieldpos == minpos && temp_length < length)) + { + minpos= fieldpos; + found= *field; + length= temp_length; + } + } + } + DBUG_PRINT("loop", ("found: 0x%lx recpos: %d minpos: %d length: %d", + (long) found, recpos, minpos, length)); + if (recpos != minpos) + { // Reserved space (Null bits?) + bzero((char*) recinfo_pos, sizeof(*recinfo_pos)); + recinfo_pos->type= (int) FIELD_NORMAL; + recinfo_pos++->length= (uint16) (minpos - recpos); + } + if (!found) + break; + + if (found->flags & BLOB_FLAG) + recinfo_pos->type= (int) FIELD_BLOB; + else if (found->type() == MYSQL_TYPE_VARCHAR) + recinfo_pos->type= FIELD_VARCHAR; + else if (!(options & HA_OPTION_PACK_RECORD)) + recinfo_pos->type= (int) FIELD_NORMAL; + else if (found->zero_pack()) + recinfo_pos->type= (int) FIELD_SKIP_ZERO; + else + recinfo_pos->type= (int) ((length <= 3 || + (found->flags & ZEROFILL_FLAG)) ? + FIELD_NORMAL : + found->type() == MYSQL_TYPE_STRING || + found->type() == MYSQL_TYPE_VAR_STRING ? + FIELD_SKIP_ENDSPACE : + FIELD_SKIP_PRESPACE); + if (found->null_ptr) + { + recinfo_pos->null_bit= found->null_bit; + recinfo_pos->null_pos= (uint) (found->null_ptr - + (uchar*) table_arg->record[0]); + } + else + { + recinfo_pos->null_bit= 0; + recinfo_pos->null_pos= 0; + } + (recinfo_pos++)->length= (uint16) length; + recpos= minpos + length; + DBUG_PRINT("loop", ("length: %d type: %d", + recinfo_pos[-1].length,recinfo_pos[-1].type)); + } + *records_out= (uint) (recinfo_pos - recinfo); + DBUG_RETURN(0); +} + + +/* + Check for underlying table conformance + + SYNOPSIS + check_definition() + t1_keyinfo in First table key definition + t1_recinfo in First table record definition + t1_keys in Number of keys in first table + t1_recs in Number of records in first table + t2_keyinfo in Second table key definition + t2_recinfo in Second table record definition + t2_keys in Number of keys in second table + t2_recs in Number of records in second table + strict in Strict check switch + + DESCRIPTION + This function compares two MyISAM definitions. By intention it was done + to compare merge table definition against underlying table definition. + It may also be used to compare dot-frm and MYI definitions of MyISAM + table as well to compare different MyISAM table definitions. + + For merge table it is not required that number of keys in merge table + must exactly match number of keys in underlying table. When calling this + function for underlying table conformance check, 'strict' flag must be + set to false, and converted merge definition must be passed as t1_*. + + Otherwise 'strict' flag must be set to 1 and it is not required to pass + converted dot-frm definition as t1_*. + + RETURN VALUE + 0 - Equal definitions. + 1 - Different definitions. + + TODO + - compare FULLTEXT keys; + - compare SPATIAL keys; + - compare FIELD_SKIP_ZERO which is converted to FIELD_NORMAL correctly + (should be corretly detected in table2myisam). +*/ + +int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, + uint t1_keys, uint t1_recs, + MI_KEYDEF *t2_keyinfo, MI_COLUMNDEF *t2_recinfo, + uint t2_keys, uint t2_recs, bool strict) +{ + uint i, j; + DBUG_ENTER("check_definition"); + if ((strict ? t1_keys != t2_keys : t1_keys > t2_keys)) + { + DBUG_PRINT("error", ("Number of keys differs: t1_keys=%u, t2_keys=%u", + t1_keys, t2_keys)); + DBUG_RETURN(1); + } + if (t1_recs != t2_recs) + { + DBUG_PRINT("error", ("Number of recs differs: t1_recs=%u, t2_recs=%u", + t1_recs, t2_recs)); + DBUG_RETURN(1); + } + for (i= 0; i < t1_keys; i++) + { + HA_KEYSEG *t1_keysegs= t1_keyinfo[i].seg; + HA_KEYSEG *t2_keysegs= t2_keyinfo[i].seg; + if (t1_keyinfo[i].flag & HA_FULLTEXT && t2_keyinfo[i].flag & HA_FULLTEXT) + continue; + else if (t1_keyinfo[i].flag & HA_FULLTEXT || + t2_keyinfo[i].flag & HA_FULLTEXT) + { + DBUG_PRINT("error", ("Key %d has different definition", i)); + DBUG_PRINT("error", ("t1_fulltext= %d, t2_fulltext=%d", + test(t1_keyinfo[i].flag & HA_FULLTEXT), + test(t2_keyinfo[i].flag & HA_FULLTEXT))); + DBUG_RETURN(1); + } + if (t1_keyinfo[i].flag & HA_SPATIAL && t2_keyinfo[i].flag & HA_SPATIAL) + continue; + else if (t1_keyinfo[i].flag & HA_SPATIAL || + t2_keyinfo[i].flag & HA_SPATIAL) + { + DBUG_PRINT("error", ("Key %d has different definition", i)); + DBUG_PRINT("error", ("t1_spatial= %d, t2_spatial=%d", + test(t1_keyinfo[i].flag & HA_SPATIAL), + test(t2_keyinfo[i].flag & HA_SPATIAL))); + DBUG_RETURN(1); + } + if (t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs || + t1_keyinfo[i].key_alg != t2_keyinfo[i].key_alg) + { + DBUG_PRINT("error", ("Key %d has different definition", i)); + DBUG_PRINT("error", ("t1_keysegs=%d, t1_key_alg=%d", + t1_keyinfo[i].keysegs, t1_keyinfo[i].key_alg)); + DBUG_PRINT("error", ("t2_keysegs=%d, t2_key_alg=%d", + t2_keyinfo[i].keysegs, t2_keyinfo[i].key_alg)); + DBUG_RETURN(1); + } + for (j= t1_keyinfo[i].keysegs; j--;) + { + if (t1_keysegs[j].type != t2_keysegs[j].type || + t1_keysegs[j].language != t2_keysegs[j].language || + t1_keysegs[j].null_bit != t2_keysegs[j].null_bit || + t1_keysegs[j].length != t2_keysegs[j].length) + { + DBUG_PRINT("error", ("Key segment %d (key %d) has different " + "definition", j, i)); + DBUG_PRINT("error", ("t1_type=%d, t1_language=%d, t1_null_bit=%d, " + "t1_length=%d", + t1_keysegs[j].type, t1_keysegs[j].language, + t1_keysegs[j].null_bit, t1_keysegs[j].length)); + DBUG_PRINT("error", ("t2_type=%d, t2_language=%d, t2_null_bit=%d, " + "t2_length=%d", + t2_keysegs[j].type, t2_keysegs[j].language, + t2_keysegs[j].null_bit, t2_keysegs[j].length)); + + DBUG_RETURN(1); + } + } + } + for (i= 0; i < t1_recs; i++) + { + MI_COLUMNDEF *t1_rec= &t1_recinfo[i]; + MI_COLUMNDEF *t2_rec= &t2_recinfo[i]; + /* + FIELD_SKIP_ZERO can be changed to FIELD_NORMAL in mi_create, + see NOTE1 in mi_create.c + */ + if ((t1_rec->type != t2_rec->type && + !(t1_rec->type == (int) FIELD_SKIP_ZERO && + t1_rec->length == 1 && + t2_rec->type == (int) FIELD_NORMAL)) || + t1_rec->length != t2_rec->length || + t1_rec->null_bit != t2_rec->null_bit) + { + DBUG_PRINT("error", ("Field %d has different definition", i)); + DBUG_PRINT("error", ("t1_type=%d, t1_length=%d, t1_null_bit=%d", + t1_rec->type, t1_rec->length, t1_rec->null_bit)); + DBUG_PRINT("error", ("t2_type=%d, t2_length=%d, t2_null_bit=%d", + t2_rec->type, t2_rec->length, t2_rec->null_bit)); + DBUG_RETURN(1); + } + } + DBUG_RETURN(0); +} + + +extern "C" { + +volatile int *killed_ptr(MI_CHECK *param) +{ + /* In theory Unsafe conversion, but should be ok for now */ + return (int*) &(((THD *)(param->thd))->killed); +} + +void mi_check_print_error(MI_CHECK *param, const char *fmt,...) +{ + param->error_printed|=1; + param->out_flag|= O_DATA_LOST; + va_list args; + va_start(args, fmt); + mi_check_print_msg(param, "error", fmt, args); + va_end(args); +} + +void mi_check_print_info(MI_CHECK *param, const char *fmt,...) +{ + va_list args; + va_start(args, fmt); + mi_check_print_msg(param, "info", fmt, args); + va_end(args); +} + +void mi_check_print_warning(MI_CHECK *param, const char *fmt,...) +{ + param->warning_printed=1; + param->out_flag|= O_DATA_LOST; + va_list args; + va_start(args, fmt); + mi_check_print_msg(param, "warning", fmt, args); + va_end(args); +} + +} + + +ha_tritonn::ha_tritonn(handlerton *hton, TABLE_SHARE *table_arg) + :handler(hton, table_arg), file(0), + int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | + HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | + HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS | + HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | + HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT), + can_enable_indexes(1) +{} + +handler *ha_tritonn::clone(MEM_ROOT *mem_root) +{ + ha_tritonn *new_handler= static_cast (handler::clone(mem_root)); + if (new_handler) + new_handler->file->state= file->state; + return new_handler; +} + + +static const char *ha_tritonn_exts[] = { + ".MYI", + ".MYD", + NullS +}; + +const char **ha_tritonn::bas_ext() const +{ + return ha_tritonn_exts; +} + + +const char *ha_tritonn::index_type(uint key_number) +{ + return ((table->key_info[key_number].flags & HA_FULLTEXT) ? + "FULLTEXT" : + (table->key_info[key_number].flags & HA_SPATIAL) ? + "SPATIAL" : + (table->key_info[key_number].algorithm == HA_KEY_ALG_RTREE) ? + "RTREE" : + "BTREE"); +} + +#ifdef HAVE_REPLICATION +int ha_tritonn::net_read_dump(NET* net) +{ + int data_fd = file->dfile; + int error = 0; + + my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME)); + for (;;) + { + ulong packet_len = my_net_read(net); + if (!packet_len) + break ; // end of file + if (packet_len == packet_error) + { + sql_print_error("ha_tritonn::net_read_dump - read error "); + error= -1; + goto err; + } + if (my_write(data_fd, (uchar*)net->read_pos, (uint) packet_len, + MYF(MY_WME|MY_FNABP))) + { + error = errno; + goto err; + } + } +err: + return error; +} + + +int ha_tritonn::dump(THD* thd, int fd) +{ + MYISAM_SHARE* share = file->s; + NET* net = &thd->net; + uint blocksize = share->blocksize; + my_off_t bytes_to_read = share->state.state.data_file_length; + int data_fd = file->dfile; + uchar *buf = (uchar*) my_malloc(blocksize, MYF(MY_WME)); + if (!buf) + return ENOMEM; + + int error = 0; + my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME)); + for (; bytes_to_read > 0;) + { + size_t bytes = my_read(data_fd, buf, blocksize, MYF(MY_WME)); + if (bytes == MY_FILE_ERROR) + { + error = errno; + goto err; + } + + if (fd >= 0) + { + if (my_write(fd, buf, bytes, MYF(MY_WME | MY_FNABP))) + { + error = errno ? errno : EPIPE; + goto err; + } + } + else + { + if (my_net_write(net, buf, bytes)) + { + error = errno ? errno : EPIPE; + goto err; + } + } + bytes_to_read -= bytes; + } + + if (fd < 0) + { + if (my_net_write(net, (uchar*) "", 0)) + error = errno ? errno : EPIPE; + net_flush(net); + } + +err: + my_free((uchar*) buf, MYF(0)); + return error; +} +#endif /* HAVE_REPLICATION */ + + +/* Name is here without an extension */ +int ha_tritonn::open(const char *name, int mode, uint test_if_locked) +{ + MI_KEYDEF *keyinfo; + MI_COLUMNDEF *recinfo= 0; + uint recs; + uint i; + + /* + If the user wants to have memory mapped data files, add an + open_flag. Do not memory map temporary tables because they are + expected to be inserted and thus extended a lot. Memory mapping is + efficient for files that keep their size, but very inefficient for + growing files. Using an open_flag instead of calling mi_extra(... + HA_EXTRA_MMAP ...) after mi_open() has the advantage that the + mapping is not repeated for every open, but just done on the initial + open, when the MyISAM share is created. Everytime the server + requires to open a new instance of a table it calls this method. We + will always supply HA_OPEN_MMAP for a permanent table. However, the + MyISAM storage engine will ignore this flag if this is a secondary + open of a table that is in use by other threads already (if the + MyISAM share exists already). + */ + if (!(test_if_locked & HA_OPEN_TMP_TABLE) && opt_myisam_use_mmap) + test_if_locked|= HA_OPEN_MMAP; + + if (!(file=mi_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER))) + return (my_errno ? my_errno : -1); + if (!table->s->tmp_table) /* No need to perform a check for tmp table */ + { + if ((my_errno= table2myisam(table, &keyinfo, &recinfo, &recs))) + { + /* purecov: begin inspected */ + DBUG_PRINT("error", ("Failed to convert TABLE object to MyISAM " + "key and column definition")); + goto err; + /* purecov: end */ + } + if (check_definition(keyinfo, recinfo, table->s->keys, recs, + file->s->keyinfo, file->s->rec, + file->s->base.keys, file->s->base.fields, true)) + { + /* purecov: begin inspected */ + my_errno= HA_ERR_CRASHED; + goto err; + /* purecov: end */ + } + } + + if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE)) + VOID(mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0)); + + info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST); + if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED)) + VOID(mi_extra(file, HA_EXTRA_WAIT_LOCK, 0)); + if (!table->s->db_record_offset) + int_table_flags|=HA_REC_NOT_IN_SEQ; + if (file->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)) + int_table_flags|=HA_HAS_CHECKSUM; + + for (i= 0; i < table->s->keys; i++) + { + plugin_ref parser= table->key_info[i].parser; + if (table->key_info[i].flags & HA_USES_PARSER) + file->s->keyinfo[i].parser= + (struct st_mysql_ftparser *)plugin_decl(parser)->info; + table->key_info[i].block_size= file->s->keyinfo[i].block_length; + } + my_errno= 0; + goto end; + err: + this->close(); + end: + /* + Both recinfo and keydef are allocated by my_multi_malloc(), thus only + recinfo must be freed. + */ + if (recinfo) + my_free((uchar*) recinfo, MYF(0)); + return my_errno; +} + +int ha_tritonn::close(void) +{ + MI_INFO *tmp=file; + file=0; + return mi_close(tmp); +} + +int ha_tritonn::write_row(uchar *buf) +{ + ha_statistic_increment(&SSV::ha_write_count); + + /* If we have a timestamp column, update it to the current time */ + if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) + table->timestamp_field->set_time(); + + /* + If we have an auto_increment column and we are writing a changed row + or a new row, then update the auto_increment value in the record. + */ + if (table->next_number_field && buf == table->record[0]) + { + int error; + if ((error= update_auto_increment())) + return error; + } + return mi_write(file,buf); +} + +int ha_tritonn::check(THD* thd, HA_CHECK_OPT* check_opt) +{ + if (!file) return HA_ADMIN_INTERNAL_ERROR; + int error; + MI_CHECK param; + MYISAM_SHARE* share = file->s; + const char *old_proc_info=thd->proc_info; + + thd->proc_info="Checking table"; + myisamchk_init(¶m); + param.thd = thd; + param.op_name = "check"; + param.db_name= table->s->db.str; + param.table_name= table->alias; + param.testflag = check_opt->flags | T_CHECK | T_SILENT; + param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; + + if (!(table->db_stat & HA_READ_ONLY)) + param.testflag|= T_STATISTICS; + param.using_global_keycache = 1; + + if (!mi_is_crashed(file) && + (((param.testflag & T_CHECK_ONLY_CHANGED) && + !(share->state.changed & (STATE_CHANGED | STATE_CRASHED | + STATE_CRASHED_ON_REPAIR)) && + share->state.open_count == 0) || + ((param.testflag & T_FAST) && (share->state.open_count == + (uint) (share->global_changed ? 1 : 0))))) + return HA_ADMIN_ALREADY_DONE; + + error = chk_status(¶m, file); // Not fatal + error = chk_size(¶m, file); + if (!error) + error |= chk_del(¶m, file, param.testflag); + if (!error) + error = chk_key(¶m, file); + if (!error) + { + if ((!(param.testflag & T_QUICK) && + ((share->options & + (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) || + (param.testflag & (T_EXTEND | T_MEDIUM)))) || + mi_is_crashed(file)) + { + uint old_testflag=param.testflag; + param.testflag|=T_MEDIUM; + if (!(error= init_io_cache(¶m.read_cache, file->dfile, + my_default_record_cache_size, READ_CACHE, + share->pack.header_length, 1, MYF(MY_WME)))) + { + error= chk_data_link(¶m, file, param.testflag & T_EXTEND); + end_io_cache(&(param.read_cache)); + } + param.testflag= old_testflag; + } + } + if (!error) + { + if ((share->state.changed & (STATE_CHANGED | + STATE_CRASHED_ON_REPAIR | + STATE_CRASHED | STATE_NOT_ANALYZED)) || + (param.testflag & T_STATISTICS) || + mi_is_crashed(file)) + { + file->update|=HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; + pthread_mutex_lock(&share->intern_lock); + share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED | + STATE_CRASHED_ON_REPAIR); + if (!(table->db_stat & HA_READ_ONLY)) + error=update_state_info(¶m,file,UPDATE_TIME | UPDATE_OPEN_COUNT | + UPDATE_STAT); + pthread_mutex_unlock(&share->intern_lock); + info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE | + HA_STATUS_CONST); + } + } + else if (!mi_is_crashed(file) && !thd->killed) + { + mi_mark_crashed(file); + file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; + } + + thd->proc_info=old_proc_info; + return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK; +} + + +/* + analyze the key distribution in the table + As the table may be only locked for read, we have to take into account that + two threads may do an analyze at the same time! +*/ + +int ha_tritonn::analyze(THD *thd, HA_CHECK_OPT* check_opt) +{ + int error=0; + MI_CHECK param; + MYISAM_SHARE* share = file->s; + + myisamchk_init(¶m); + param.thd = thd; + param.op_name= "analyze"; + param.db_name= table->s->db.str; + param.table_name= table->alias; + param.testflag= (T_FAST | T_CHECK | T_SILENT | T_STATISTICS | + T_DONT_CHECK_CHECKSUM); + param.using_global_keycache = 1; + param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; + + if (!(share->state.changed & STATE_NOT_ANALYZED)) + return HA_ADMIN_ALREADY_DONE; + + error = chk_key(¶m, file); + if (!error) + { + pthread_mutex_lock(&share->intern_lock); + error=update_state_info(¶m,file,UPDATE_STAT); + pthread_mutex_unlock(&share->intern_lock); + } + else if (!mi_is_crashed(file) && !thd->killed) + mi_mark_crashed(file); + return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK; +} + + +int ha_tritonn::restore(THD* thd, HA_CHECK_OPT *check_opt) +{ + HA_CHECK_OPT tmp_check_opt; + char *backup_dir= thd->lex->backup_dir; + char src_path[FN_REFLEN], dst_path[FN_REFLEN]; + char table_name[FN_REFLEN]; + int error; + const char* errmsg; + DBUG_ENTER("restore"); + + VOID(tablename_to_filename(table->s->table_name.str, table_name, + sizeof(table_name))); + + if (fn_format_relative_to_data_home(src_path, table_name, backup_dir, + MI_NAME_DEXT)) + DBUG_RETURN(HA_ADMIN_INVALID); + + strxmov(dst_path, table->s->normalized_path.str, MI_NAME_DEXT, NullS); + if (my_copy(src_path, dst_path, MYF(MY_WME))) + { + error= HA_ADMIN_FAILED; + errmsg= "Failed in my_copy (Error %d)"; + goto err; + } + + tmp_check_opt.init(); + tmp_check_opt.flags |= T_VERY_SILENT | T_CALC_CHECKSUM | T_QUICK; + DBUG_RETURN(repair(thd, &tmp_check_opt)); + + err: + { + MI_CHECK param; + myisamchk_init(¶m); + param.thd= thd; + param.op_name= "restore"; + param.db_name= table->s->db.str; + param.table_name= table->s->table_name.str; + param.testflag= 0; + mi_check_print_error(¶m, errmsg, my_errno); + DBUG_RETURN(error); + } +} + + +int ha_tritonn::backup(THD* thd, HA_CHECK_OPT *check_opt) +{ + char *backup_dir= thd->lex->backup_dir; + char src_path[FN_REFLEN], dst_path[FN_REFLEN]; + char table_name[FN_REFLEN]; + int error; + const char *errmsg; + DBUG_ENTER("ha_tritonn::backup"); + + VOID(tablename_to_filename(table->s->table_name.str, table_name, + sizeof(table_name))); + + if (fn_format_relative_to_data_home(dst_path, table_name, backup_dir, + reg_ext)) + { + errmsg= "Failed in fn_format() for .frm file (errno: %d)"; + error= HA_ADMIN_INVALID; + goto err; + } + + strxmov(src_path, table->s->normalized_path.str, reg_ext, NullS); + if (my_copy(src_path, dst_path, + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) + { + error = HA_ADMIN_FAILED; + errmsg = "Failed copying .frm file (errno: %d)"; + goto err; + } + + /* Change extension */ + if (fn_format_relative_to_data_home(dst_path, table_name, backup_dir, + MI_NAME_DEXT)) + { + errmsg = "Failed in fn_format() for .MYD file (errno: %d)"; + error = HA_ADMIN_INVALID; + goto err; + } + + strxmov(src_path, table->s->normalized_path.str, MI_NAME_DEXT, NullS); + if (my_copy(src_path, dst_path, + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) + { + errmsg = "Failed copying .MYD file (errno: %d)"; + error= HA_ADMIN_FAILED; + goto err; + } + DBUG_RETURN(HA_ADMIN_OK); + + err: + { + MI_CHECK param; + myisamchk_init(¶m); + param.thd= thd; + param.op_name= "backup"; + param.db_name= table->s->db.str; + param.table_name= table->s->table_name.str; + param.testflag = 0; + mi_check_print_error(¶m,errmsg, my_errno); + DBUG_RETURN(error); + } +} + + +int ha_tritonn::repair(THD* thd, HA_CHECK_OPT *check_opt) +{ + int error; + MI_CHECK param; + ha_rows start_records; + + if (!file) return HA_ADMIN_INTERNAL_ERROR; + + myisamchk_init(¶m); + param.thd = thd; + param.op_name= "repair"; + param.testflag= ((check_opt->flags & ~(T_EXTEND)) | + T_SILENT | T_FORCE_CREATE | T_CALC_CHECKSUM | + (check_opt->flags & T_EXTEND ? T_REP : T_REP_BY_SORT)); + param.sort_buffer_length= check_opt->sort_buffer_size; + start_records=file->state->records; + while ((error=repair(thd,param,0)) && param.retry_repair) + { + param.retry_repair=0; + if (test_all_bits(param.testflag, + (uint) (T_RETRY_WITHOUT_QUICK | T_QUICK))) + { + param.testflag&= ~T_RETRY_WITHOUT_QUICK; + sql_print_information("Retrying repair of: '%s' without quick", + table->s->path.str); + continue; + } + param.testflag&= ~T_QUICK; + if ((param.testflag & T_REP_BY_SORT)) + { + param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP; + sql_print_information("Retrying repair of: '%s' with keycache", + table->s->path.str); + continue; + } + break; + } + if (!error && start_records != file->state->records && + !(check_opt->flags & T_VERY_SILENT)) + { + char llbuff[22],llbuff2[22]; + sql_print_information("Found %s of %s rows when repairing '%s'", + llstr(file->state->records, llbuff), + llstr(start_records, llbuff2), + table->s->path.str); + } + return error; +} + +int ha_tritonn::optimize(THD* thd, HA_CHECK_OPT *check_opt) +{ + int error; + if (!file) return HA_ADMIN_INTERNAL_ERROR; + MI_CHECK param; + + myisamchk_init(¶m); + param.thd = thd; + param.op_name= "optimize"; + param.testflag= (check_opt->flags | T_SILENT | T_FORCE_CREATE | + T_REP_BY_SORT | T_STATISTICS | T_SORT_INDEX); + param.sort_buffer_length= check_opt->sort_buffer_size; + if ((error= repair(thd,param,1)) && param.retry_repair) + { + sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying", + my_errno, param.db_name, param.table_name); + param.testflag&= ~T_REP_BY_SORT; + error= repair(thd,param,1); + } + return error; +} + + +int ha_tritonn::repair(THD *thd, MI_CHECK ¶m, bool do_optimize) +{ + int error=0; + uint local_testflag=param.testflag; + bool optimize_done= !do_optimize, statistics_done=0; + const char *old_proc_info=thd->proc_info; + char fixed_name[FN_REFLEN]; + MYISAM_SHARE* share = file->s; + ha_rows rows= file->state->records; + DBUG_ENTER("ha_tritonn::repair"); + + /* + Normally this method is entered with a properly opened table. If the + repair fails, it can be repeated with more elaborate options. Under + special circumstances it can happen that a repair fails so that it + closed the data file and cannot re-open it. In this case file->dfile + is set to -1. We must not try another repair without an open data + file. (Bug #25289) + */ + if (file->dfile == -1) + { + sql_print_information("Retrying repair of: '%s' failed. " + "Please try REPAIR EXTENDED or myisamchk", + table->s->path.str); + DBUG_RETURN(HA_ADMIN_FAILED); + } + + param.db_name= table->s->db.str; + param.table_name= table->alias; + param.tmpfile_createflag = O_RDWR | O_TRUNC; + param.using_global_keycache = 1; + param.thd= thd; + param.tmpdir= &mysql_tmpdir_list; + param.out_flag= 0; + strmov(fixed_name,file->filename); + + // Don't lock tables if we have used LOCK TABLE + if (!thd->locked_tables && + mi_lock_database(file, table->s->tmp_table ? F_EXTRA_LCK : F_WRLCK)) + { + mi_check_print_error(¶m,ER(ER_CANT_LOCK),my_errno); + DBUG_RETURN(HA_ADMIN_FAILED); + } + + if (!do_optimize || + ((file->state->del || share->state.split != file->state->records) && + (!(param.testflag & T_QUICK) || + !(share->state.changed & STATE_NOT_OPTIMIZED_KEYS)))) + { + ulonglong key_map= ((local_testflag & T_CREATE_MISSING_KEYS) ? + mi_get_mask_all_keys_active(share->base.keys) : + share->state.key_map); + uint testflag=param.testflag; + if (mi_test_if_sort_rep(file,file->state->records,key_map,0) && + (local_testflag & T_REP_BY_SORT)) + { + local_testflag|= T_STATISTICS; + param.testflag|= T_STATISTICS; // We get this for free + statistics_done=1; + if (thd->variables.myisam_repair_threads>1) + { + char buf[40]; + /* TODO: respect myisam_repair_threads variable */ + my_snprintf(buf, 40, "Repair with %d threads", my_count_bits(key_map)); + thd->proc_info=buf; + error = mi_repair_parallel(¶m, file, fixed_name, + param.testflag & T_QUICK); + thd->proc_info="Repair done"; // to reset proc_info, as + // it was pointing to local buffer + } + else + { + thd->proc_info="Repair by sorting"; + error = mi_repair_by_sort(¶m, file, fixed_name, + param.testflag & T_QUICK); + } + } + else + { + thd->proc_info="Repair with keycache"; + param.testflag &= ~T_REP_BY_SORT; + error= mi_repair(¶m, file, fixed_name, + param.testflag & T_QUICK); + } + param.testflag=testflag; + optimize_done=1; + } + if (!error) + { + if ((local_testflag & T_SORT_INDEX) && + (share->state.changed & STATE_NOT_SORTED_PAGES)) + { + optimize_done=1; + thd->proc_info="Sorting index"; + error=mi_sort_index(¶m,file,fixed_name); + } + if (!statistics_done && (local_testflag & T_STATISTICS)) + { + if (share->state.changed & STATE_NOT_ANALYZED) + { + optimize_done=1; + thd->proc_info="Analyzing"; + error = chk_key(¶m, file); + } + else + local_testflag&= ~T_STATISTICS; // Don't update statistics + } + } + thd->proc_info="Saving state"; + if (!error) + { + if ((share->state.changed & STATE_CHANGED) || mi_is_crashed(file)) + { + share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED | + STATE_CRASHED_ON_REPAIR); + file->update|=HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; + } + /* + the following 'if', thought conceptually wrong, + is a useful optimization nevertheless. + */ + if (file->state != &file->s->state.state) + file->s->state.state = *file->state; + if (file->s->base.auto_key) + update_auto_increment_key(¶m, file, 1); + if (optimize_done) + error = update_state_info(¶m, file, + UPDATE_TIME | UPDATE_OPEN_COUNT | + (local_testflag & + T_STATISTICS ? UPDATE_STAT : 0)); + info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE | + HA_STATUS_CONST); + if (rows != file->state->records && ! (param.testflag & T_VERY_SILENT)) + { + char llbuff[22],llbuff2[22]; + mi_check_print_warning(¶m,"Number of rows changed from %s to %s", + llstr(rows,llbuff), + llstr(file->state->records,llbuff2)); + } + } + else + { + mi_mark_crashed_on_repair(file); + file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; + update_state_info(¶m, file, 0); + } + thd->proc_info=old_proc_info; + if (!thd->locked_tables) + mi_lock_database(file,F_UNLCK); + DBUG_RETURN(error ? HA_ADMIN_FAILED : + !optimize_done ? HA_ADMIN_ALREADY_DONE : HA_ADMIN_OK); +} + + +/* + Assign table indexes to a specific key cache. +*/ + +int ha_tritonn::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt) +{ + KEY_CACHE *new_key_cache= check_opt->key_cache; + const char *errmsg= 0; + int error= HA_ADMIN_OK; + ulonglong map; + TABLE_LIST *table_list= table->pos_in_table_list; + DBUG_ENTER("ha_tritonn::assign_to_keycache"); + + table->keys_in_use_for_query.clear_all(); + + if (table_list->process_index_hints(table)) + DBUG_RETURN(HA_ADMIN_FAILED); + map= ~(ulonglong) 0; + if (!table->keys_in_use_for_query.is_clear_all()) + /* use all keys if there's no list specified by the user through hints */ + map= table->keys_in_use_for_query.to_ulonglong(); + + if ((error= mi_assign_to_key_cache(file, map, new_key_cache))) + { + char buf[STRING_BUFFER_USUAL_SIZE]; + my_snprintf(buf, sizeof(buf), + "Failed to flush to index file (errno: %d)", error); + errmsg= buf; + error= HA_ADMIN_CORRUPT; + } + + if (error != HA_ADMIN_OK) + { + /* Send error to user */ + MI_CHECK param; + myisamchk_init(¶m); + param.thd= thd; + param.op_name= "assign_to_keycache"; + param.db_name= table->s->db.str; + param.table_name= table->s->table_name.str; + param.testflag= 0; + mi_check_print_error(¶m, errmsg); + } + DBUG_RETURN(error); +} + + +/* + Preload pages of the index file for a table into the key cache. +*/ + +int ha_tritonn::preload_keys(THD* thd, HA_CHECK_OPT *check_opt) +{ + int error; + const char *errmsg; + ulonglong map; + TABLE_LIST *table_list= table->pos_in_table_list; + my_bool ignore_leaves= table_list->ignore_leaves; + char buf[ERRMSGSIZE+20]; + + DBUG_ENTER("ha_tritonn::preload_keys"); + + table->keys_in_use_for_query.clear_all(); + + if (table_list->process_index_hints(table)) + DBUG_RETURN(HA_ADMIN_FAILED); + + map= ~(ulonglong) 0; + /* Check validity of the index references */ + if (!table->keys_in_use_for_query.is_clear_all()) + /* use all keys if there's no list specified by the user through hints */ + map= table->keys_in_use_for_query.to_ulonglong(); + + mi_extra(file, HA_EXTRA_PRELOAD_BUFFER_SIZE, + (void *) &thd->variables.preload_buff_size); + + if ((error= mi_preload(file, map, ignore_leaves))) + { + switch (error) { + case HA_ERR_NON_UNIQUE_BLOCK_SIZE: + errmsg= "Indexes use different block sizes"; + break; + case HA_ERR_OUT_OF_MEM: + errmsg= "Failed to allocate buffer"; + break; + default: + my_snprintf(buf, ERRMSGSIZE, + "Failed to read from index file (errno: %d)", my_errno); + errmsg= buf; + } + error= HA_ADMIN_FAILED; + goto err; + } + + DBUG_RETURN(HA_ADMIN_OK); + + err: + { + MI_CHECK param; + myisamchk_init(¶m); + param.thd= thd; + param.op_name= "preload_keys"; + param.db_name= table->s->db.str; + param.table_name= table->s->table_name.str; + param.testflag= 0; + mi_check_print_error(¶m, errmsg); + DBUG_RETURN(error); + } +} + + +/* + Disable indexes, making it persistent if requested. + + SYNOPSIS + disable_indexes() + mode mode of operation: + HA_KEY_SWITCH_NONUNIQ disable all non-unique keys + HA_KEY_SWITCH_ALL disable all keys + HA_KEY_SWITCH_NONUNIQ_SAVE dis. non-uni. and make persistent + HA_KEY_SWITCH_ALL_SAVE dis. all keys and make persistent + + IMPLEMENTATION + HA_KEY_SWITCH_NONUNIQ is not implemented. + HA_KEY_SWITCH_ALL_SAVE is not implemented. + + RETURN + 0 ok + HA_ERR_WRONG_COMMAND mode not implemented. +*/ + +int ha_tritonn::disable_indexes(uint mode) +{ + int error; + + if (mode == HA_KEY_SWITCH_ALL) + { + /* call a storage engine function to switch the key map */ + error= mi_disable_indexes(file); + } + else if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE) + { + mi_extra(file, HA_EXTRA_NO_KEYS, 0); + info(HA_STATUS_CONST); // Read new key info + error= 0; + } + else + { + /* mode not implemented */ + error= HA_ERR_WRONG_COMMAND; + } + return error; +} + + +/* + Enable indexes, making it persistent if requested. + + SYNOPSIS + enable_indexes() + mode mode of operation: + HA_KEY_SWITCH_NONUNIQ enable all non-unique keys + HA_KEY_SWITCH_ALL enable all keys + HA_KEY_SWITCH_NONUNIQ_SAVE en. non-uni. and make persistent + HA_KEY_SWITCH_ALL_SAVE en. all keys and make persistent + + DESCRIPTION + Enable indexes, which might have been disabled by disable_index() before. + The modes without _SAVE work only if both data and indexes are empty, + since the MyISAM repair would enable them persistently. + To be sure in these cases, call handler::delete_all_rows() before. + + IMPLEMENTATION + HA_KEY_SWITCH_NONUNIQ is not implemented. + HA_KEY_SWITCH_ALL_SAVE is not implemented. + + RETURN + 0 ok + !=0 Error, among others: + HA_ERR_CRASHED data or index is non-empty. Delete all rows and retry. + HA_ERR_WRONG_COMMAND mode not implemented. +*/ + +int ha_tritonn::enable_indexes(uint mode) +{ + int error; + + if (mi_is_all_keys_active(file->s->state.key_map, file->s->base.keys)) + { + /* All indexes are enabled already. */ + return 0; + } + + if (mode == HA_KEY_SWITCH_ALL) + { + error= mi_enable_indexes(file); + /* + Do not try to repair on error, + as this could make the enabled state persistent, + but mode==HA_KEY_SWITCH_ALL forbids it. + */ + } + else if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE) + { + THD *thd=current_thd; + MI_CHECK param; + const char *save_proc_info=thd->proc_info; + thd->proc_info="Creating index"; + myisamchk_init(¶m); + param.op_name= "recreating_index"; + param.testflag= (T_SILENT | T_REP_BY_SORT | T_QUICK | + T_CREATE_MISSING_KEYS); + param.myf_rw&= ~MY_WAIT_IF_FULL; + param.sort_buffer_length= thd->variables.myisam_sort_buff_size; + param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; + param.tmpdir=&mysql_tmpdir_list; + if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair) + { + sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying", + my_errno, param.db_name, param.table_name); + /* Repairing by sort failed. Now try standard repair method. */ + param.testflag&= ~(T_REP_BY_SORT | T_QUICK); + error= (repair(thd,param,0) != HA_ADMIN_OK); + /* + If the standard repair succeeded, clear all error messages which + might have been set by the first repair. They can still be seen + with SHOW WARNINGS then. + */ +#ifndef EMBEDDED_LIBRARY + if (! error) + thd->clear_error(); +#endif /* EMBEDDED_LIBRARY */ + } + info(HA_STATUS_CONST); + thd->proc_info=save_proc_info; + } + else + { + /* mode not implemented */ + error= HA_ERR_WRONG_COMMAND; + } + return error; +} + + +/* + Test if indexes are disabled. + + + SYNOPSIS + indexes_are_disabled() + no parameters + + + RETURN + 0 indexes are not disabled + 1 all indexes are disabled + [2 non-unique indexes are disabled - NOT YET IMPLEMENTED] +*/ + +int ha_tritonn::indexes_are_disabled(void) +{ + + return mi_indexes_are_disabled(file); +} + + +/* + prepare for a many-rows insert operation + e.g. - disable indexes (if they can be recreated fast) or + activate special bulk-insert optimizations + + SYNOPSIS + start_bulk_insert(rows) + rows Rows to be inserted + 0 if we don't know + + NOTICE + Do not forget to call end_bulk_insert() later! +*/ + +void ha_tritonn::start_bulk_insert(ha_rows rows) +{ + DBUG_ENTER("ha_tritonn::start_bulk_insert"); + THD *thd= current_thd; + ulong size= min(thd->variables.read_buff_size, + table->s->avg_row_length*rows); + DBUG_PRINT("info",("start_bulk_insert: rows %lu size %lu", + (ulong) rows, size)); + + /* don't enable row cache if too few rows */ + if (! rows || (rows > MI_MIN_ROWS_TO_USE_WRITE_CACHE)) + mi_extra(file, HA_EXTRA_WRITE_CACHE, (void*) &size); + + can_enable_indexes= mi_is_all_keys_active(file->s->state.key_map, + file->s->base.keys); + + if (!(specialflag & SPECIAL_SAFE_MODE)) + { + /* + Only disable old index if the table was empty and we are inserting + a lot of rows. + We should not do this for only a few rows as this is slower and + we don't want to update the key statistics based of only a few rows. + */ + if (file->state->records == 0 && can_enable_indexes && + (!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES)) + mi_disable_non_unique_index(file,rows); + else + if (!file->bulk_insert && + (!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT)) + { + mi_init_bulk_insert(file, thd->variables.bulk_insert_buff_size, rows); + } + } + DBUG_VOID_RETURN; +} + +/* + end special bulk-insert optimizations, + which have been activated by start_bulk_insert(). + + SYNOPSIS + end_bulk_insert() + no arguments + + RETURN + 0 OK + != 0 Error +*/ + +int ha_tritonn::end_bulk_insert() +{ + mi_end_bulk_insert(file); + int err=mi_extra(file, HA_EXTRA_NO_CACHE, 0); + return err ? err : can_enable_indexes ? + enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE) : 0; +} + + +bool ha_tritonn::check_and_repair(THD *thd) +{ + int error=0; + int marked_crashed; + char *old_query; + uint old_query_length; + HA_CHECK_OPT check_opt; + DBUG_ENTER("ha_tritonn::check_and_repair"); + + check_opt.init(); + check_opt.flags= T_MEDIUM | T_AUTO_REPAIR; + // Don't use quick if deleted rows + if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK)) + check_opt.flags|=T_QUICK; + sql_print_warning("Checking table: '%s'",table->s->path.str); + + old_query= thd->query; + old_query_length= thd->query_length; + pthread_mutex_lock(&LOCK_thread_count); + thd->query= table->s->table_name.str; + thd->query_length= table->s->table_name.length; + pthread_mutex_unlock(&LOCK_thread_count); + + if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt)) + { + sql_print_warning("Recovering table: '%s'",table->s->path.str); + check_opt.flags= + ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) | + (marked_crashed ? 0 : T_QUICK) | + (myisam_recover_options & HA_RECOVER_FORCE ? 0 : T_SAFE_REPAIR) | + T_AUTO_REPAIR); + if (repair(thd, &check_opt)) + error=1; + } + pthread_mutex_lock(&LOCK_thread_count); + thd->query= old_query; + thd->query_length= old_query_length; + pthread_mutex_unlock(&LOCK_thread_count); + DBUG_RETURN(error); +} + +bool ha_tritonn::is_crashed() const +{ + return (file->s->state.changed & STATE_CRASHED || + (my_disable_locking && file->s->state.open_count)); +} + +int ha_tritonn::update_row(const uchar *old_data, uchar *new_data) +{ + ha_statistic_increment(&SSV::ha_update_count); + if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) + table->timestamp_field->set_time(); + return mi_update(file,old_data,new_data); +} + +int ha_tritonn::delete_row(const uchar *buf) +{ + ha_statistic_increment(&SSV::ha_delete_count); + return mi_delete(file,buf); +} + +int ha_tritonn::index_read_map(uchar *buf, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag) +{ + DBUG_ASSERT(inited==INDEX); + ha_statistic_increment(&SSV::ha_read_key_count); + int error=mi_rkey(file, buf, active_index, key, keypart_map, find_flag); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +int ha_tritonn::index_read_idx_map(uchar *buf, uint index, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag) +{ + ha_statistic_increment(&SSV::ha_read_key_count); + int error=mi_rkey(file, buf, index, key, keypart_map, find_flag); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +int ha_tritonn::index_read_last_map(uchar *buf, const uchar *key, + key_part_map keypart_map) +{ + DBUG_ENTER("ha_tritonn::index_read_last"); + DBUG_ASSERT(inited==INDEX); + ha_statistic_increment(&SSV::ha_read_key_count); + int error=mi_rkey(file, buf, active_index, key, keypart_map, + HA_READ_PREFIX_LAST); + table->status=error ? STATUS_NOT_FOUND: 0; + DBUG_RETURN(error); +} + +int ha_tritonn::index_next(uchar *buf) +{ + DBUG_ASSERT(inited==INDEX); + ha_statistic_increment(&SSV::ha_read_next_count); + int error=mi_rnext(file,buf,active_index); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +int ha_tritonn::index_prev(uchar *buf) +{ + DBUG_ASSERT(inited==INDEX); + ha_statistic_increment(&SSV::ha_read_prev_count); + int error=mi_rprev(file,buf, active_index); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +int ha_tritonn::index_first(uchar *buf) +{ + DBUG_ASSERT(inited==INDEX); + ha_statistic_increment(&SSV::ha_read_first_count); + int error=mi_rfirst(file, buf, active_index); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +int ha_tritonn::index_last(uchar *buf) +{ + DBUG_ASSERT(inited==INDEX); + ha_statistic_increment(&SSV::ha_read_last_count); + int error=mi_rlast(file, buf, active_index); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +int ha_tritonn::index_next_same(uchar *buf, + const uchar *key __attribute__((unused)), + uint length __attribute__((unused))) +{ + DBUG_ASSERT(inited==INDEX); + ha_statistic_increment(&SSV::ha_read_next_count); + int error=mi_rnext_same(file,buf); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + + +int ha_tritonn::rnd_init(bool scan) +{ + if (scan) + return mi_scan_init(file); + return mi_reset(file); // Free buffers +} + +int ha_tritonn::rnd_next(uchar *buf) +{ + ha_statistic_increment(&SSV::ha_read_rnd_next_count); + int error=mi_scan(file, buf); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +int ha_tritonn::restart_rnd_next(uchar *buf, uchar *pos) +{ + return rnd_pos(buf,pos); +} + +int ha_tritonn::rnd_pos(uchar *buf, uchar *pos) +{ + ha_statistic_increment(&SSV::ha_read_rnd_count); + int error=mi_rrnd(file, buf, my_get_ptr(pos,ref_length)); + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +void ha_tritonn::position(const uchar *record) +{ + my_off_t row_position= mi_position(file); + my_store_ptr(ref, ref_length, row_position); +} + +int ha_tritonn::info(uint flag) +{ + MI_ISAMINFO misam_info; + char name_buff[FN_REFLEN]; + + (void) mi_status(file,&misam_info,flag); + if (flag & HA_STATUS_VARIABLE) + { + stats.records= misam_info.records; + stats.deleted= misam_info.deleted; + stats.data_file_length= misam_info.data_file_length; + stats.index_file_length= misam_info.index_file_length; + stats.delete_length= misam_info.delete_length; + stats.check_time= misam_info.check_time; + stats.mean_rec_length= misam_info.mean_reclength; + } + if (flag & HA_STATUS_CONST) + { + TABLE_SHARE *share= table->s; + stats.max_data_file_length= misam_info.max_data_file_length; + stats.max_index_file_length= misam_info.max_index_file_length; + stats.create_time= misam_info.create_time; + ref_length= misam_info.reflength; + share->db_options_in_use= misam_info.options; + stats.block_size= myisam_block_size; /* record block size */ + + /* Update share */ + if (share->tmp_table == NO_TMP_TABLE) + pthread_mutex_lock(&share->mutex); + share->keys_in_use.set_prefix(share->keys); + share->keys_in_use.intersect_extended(misam_info.key_map); + share->keys_for_keyread.intersect(share->keys_in_use); + share->db_record_offset= misam_info.record_offset; + if (share->key_parts) + memcpy((char*) table->key_info[0].rec_per_key, + (char*) misam_info.rec_per_key, + sizeof(table->key_info[0].rec_per_key)*share->key_parts); + if (share->tmp_table == NO_TMP_TABLE) + pthread_mutex_unlock(&share->mutex); + + /* + Set data_file_name and index_file_name to point at the symlink value + if table is symlinked (Ie; Real name is not same as generated name) + */ + data_file_name= index_file_name= 0; + fn_format(name_buff, file->filename, "", MI_NAME_DEXT, + MY_APPEND_EXT | MY_UNPACK_FILENAME); + if (strcmp(name_buff, misam_info.data_file_name)) + data_file_name=misam_info.data_file_name; + fn_format(name_buff, file->filename, "", MI_NAME_IEXT, + MY_APPEND_EXT | MY_UNPACK_FILENAME); + if (strcmp(name_buff, misam_info.index_file_name)) + index_file_name=misam_info.index_file_name; + } + if (flag & HA_STATUS_ERRKEY) + { + errkey = misam_info.errkey; + my_store_ptr(dup_ref, ref_length, misam_info.dupp_key_pos); + } + if (flag & HA_STATUS_TIME) + stats.update_time = misam_info.update_time; + if (flag & HA_STATUS_AUTO) + stats.auto_increment_value= misam_info.auto_increment; + + return 0; +} + + +int ha_tritonn::extra(enum ha_extra_function operation) +{ + if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_KEYREAD) + return 0; + return mi_extra(file, operation, 0); +} + +int ha_tritonn::reset(void) +{ + return mi_reset(file); +} + +/* To be used with WRITE_CACHE and EXTRA_CACHE */ + +int ha_tritonn::extra_opt(enum ha_extra_function operation, ulong cache_size) +{ + if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_WRITE_CACHE) + return 0; + return mi_extra(file, operation, (void*) &cache_size); +} + +int ha_tritonn::delete_all_rows() +{ + return mi_delete_all_rows(file); +} + +int ha_tritonn::delete_table(const char *name) +{ + return mi_delete_table(name); +} + + +int ha_tritonn::external_lock(THD *thd, int lock_type) +{ + return mi_lock_database(file, !table->s->tmp_table ? + lock_type : ((lock_type == F_UNLCK) ? + F_UNLCK : F_EXTRA_LCK)); +} + +THR_LOCK_DATA **ha_tritonn::store_lock(THD *thd, + THR_LOCK_DATA **to, + enum thr_lock_type lock_type) +{ + if (lock_type != TL_IGNORE && file->lock.type == TL_UNLOCK) + file->lock.type=lock_type; + *to++= &file->lock; + return to; +} + +void ha_tritonn::update_create_info(HA_CREATE_INFO *create_info) +{ + ha_tritonn::info(HA_STATUS_AUTO | HA_STATUS_CONST); + if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) + { + create_info->auto_increment_value= stats.auto_increment_value; + } + create_info->data_file_name=data_file_name; + create_info->index_file_name=index_file_name; +} + + +int ha_tritonn::create(const char *name, register TABLE *table_arg, + HA_CREATE_INFO *ha_create_info) +{ + int error; + uint create_flags= 0, records, i; + char buff[FN_REFLEN]; + MI_KEYDEF *keydef; + MI_COLUMNDEF *recinfo; + MI_CREATE_INFO create_info; + TABLE_SHARE *share= table_arg->s; + uint options= share->db_options_in_use; + DBUG_ENTER("ha_tritonn::create"); + for (i= 0; i < share->keys; i++) + { + if (table_arg->key_info[i].flags & HA_USES_PARSER) + { + create_flags|= HA_CREATE_RELIES_ON_SQL_LAYER; + break; + } + } + if ((error= table2myisam(table_arg, &keydef, &recinfo, &records))) + DBUG_RETURN(error); /* purecov: inspected */ + bzero((char*) &create_info, sizeof(create_info)); + create_info.max_rows= share->max_rows; + create_info.reloc_rows= share->min_rows; + create_info.with_auto_increment= share->next_number_key_offset == 0; + create_info.auto_increment= (ha_create_info->auto_increment_value ? + ha_create_info->auto_increment_value -1 : + (ulonglong) 0); + create_info.data_file_length= ((ulonglong) share->max_rows * + share->avg_row_length); + create_info.data_file_name= ha_create_info->data_file_name; + create_info.index_file_name= ha_create_info->index_file_name; + + if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE) + create_flags|= HA_CREATE_TMP_TABLE; + if (ha_create_info->options & HA_CREATE_KEEP_FILES) + create_flags|= HA_CREATE_KEEP_FILES; + if (options & HA_OPTION_PACK_RECORD) + create_flags|= HA_PACK_RECORD; + if (options & HA_OPTION_CHECKSUM) + create_flags|= HA_CREATE_CHECKSUM; + if (options & HA_OPTION_DELAY_KEY_WRITE) + create_flags|= HA_CREATE_DELAY_KEY_WRITE; + + /* TODO: Check that the following fn_format is really needed */ + error= mi_create(fn_format(buff, name, "", "", + MY_UNPACK_FILENAME|MY_APPEND_EXT), + share->keys, keydef, + records, recinfo, + 0, (MI_UNIQUEDEF*) 0, + &create_info, create_flags); + my_free((uchar*) recinfo, MYF(0)); + DBUG_RETURN(error); +} + + +int ha_tritonn::rename_table(const char * from, const char * to) +{ + return mi_rename(from,to); +} + + +void ha_tritonn::get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values) +{ + ulonglong nr; + int error; + uchar key[MI_MAX_KEY_LENGTH]; + + if (!table->s->next_number_key_offset) + { // Autoincrement at key-start + ha_tritonn::info(HA_STATUS_AUTO); + *first_value= stats.auto_increment_value; + /* MyISAM has only table-level lock, so reserves to +inf */ + *nb_reserved_values= ULONGLONG_MAX; + return; + } + + /* it's safe to call the following if bulk_insert isn't on */ + mi_flush_bulk_insert(file, table->s->next_number_index); + + (void) extra(HA_EXTRA_KEYREAD); + key_copy(key, table->record[0], + table->key_info + table->s->next_number_index, + table->s->next_number_key_offset); + error= mi_rkey(file, table->record[1], (int) table->s->next_number_index, + key, make_prev_keypart_map(table->s->next_number_keypart), + HA_READ_PREFIX_LAST); + if (error) + nr= 1; + else + { + /* Get data from record[1] */ + nr= ((ulonglong) table->next_number_field-> + val_int_offset(table->s->rec_buff_length)+1); + } + extra(HA_EXTRA_NO_KEYREAD); + *first_value= nr; + /* + MySQL needs to call us for next row: assume we are inserting ("a",null) + here, we return 3, and next this statement will want to insert ("b",null): + there is no reason why ("b",3+1) would be the good row to insert: maybe it + already exists, maybe 3+1 is too large... + */ + *nb_reserved_values= 1; +} + + +/* + Find out how many rows there is in the given range + + SYNOPSIS + records_in_range() + inx Index to use + min_key Start of range. Null pointer if from first key + max_key End of range. Null pointer if to last key + + NOTES + min_key.flag can have one of the following values: + HA_READ_KEY_EXACT Include the key in the range + HA_READ_AFTER_KEY Don't include key in range + + max_key.flag can have one of the following values: + HA_READ_BEFORE_KEY Don't include key in range + HA_READ_AFTER_KEY Include all 'end_key' values in the range + + RETURN + HA_POS_ERROR Something is wrong with the index tree. + 0 There is no matching keys in the given range + number > 0 There is approximately 'number' matching rows in + the range. +*/ + +ha_rows ha_tritonn::records_in_range(uint inx, key_range *min_key, + key_range *max_key) +{ + return (ha_rows) mi_records_in_range(file, (int) inx, min_key, max_key); +} + + +int ha_tritonn::ft_read(uchar *buf) +{ + int error; + + if (!ft_handler) + return -1; + + thread_safe_increment(table->in_use->status_var.ha_read_next_count, + &LOCK_status); // why ? + + error=ft_handler->please->read_next(ft_handler,(char*) buf); + + table->status=error ? STATUS_NOT_FOUND: 0; + return error; +} + +uint ha_tritonn::checksum() const +{ + return (uint)file->state->checksum; +} + + +bool ha_tritonn::check_if_incompatible_data(HA_CREATE_INFO *info, + uint table_changes) +{ + uint options= table->s->db_options_in_use; + + if (info->auto_increment_value != stats.auto_increment_value || + info->data_file_name != data_file_name || + info->index_file_name != index_file_name || + table_changes == IS_EQUAL_NO || + table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet + return COMPATIBLE_DATA_NO; + + if ((options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM | + HA_OPTION_DELAY_KEY_WRITE)) != + (info->table_options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM | + HA_OPTION_DELAY_KEY_WRITE))) + return COMPATIBLE_DATA_NO; + return COMPATIBLE_DATA_YES; +} + +extern int mi_panic(enum ha_panic_function flag); +int myisam_panic(handlerton *hton, ha_panic_function flag) +{ + return mi_panic(flag); +} + +static int myisam_init(void *p) +{ + handlerton *myisam_hton; + + myisam_hton= (handlerton *)p; + myisam_hton->state= SHOW_OPTION_YES; + /* myisam_hton->db_type= DB_TYPE_MYISAM; */ + myisam_hton->create= myisam_create_handler; + myisam_hton->panic= myisam_panic; + myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES; + return 0; +} + +struct st_mysql_storage_engine tritonn_storage_engine= +{ MYSQL_HANDLERTON_INTERFACE_VERSION }; + +mysql_declare_plugin(myisam) +{ + MYSQL_STORAGE_ENGINE_PLUGIN, + &tritonn_storage_engine, + "Tritonn", + "Tetsuro IKEDA", + "MyISAM engine enchanced with Senna embedded fulltext search engine", + PLUGIN_LICENSE_GPL, + myisam_init, /* Plugin Init */ + NULL, /* Plugin Deinit */ + 0x0100, /* 1.0 */ + NULL, /* status variables */ + NULL, /* system variables */ + NULL /* config options */ +} +mysql_declare_plugin_end; + + +#ifdef HAVE_QUERY_CACHE +/** + @brief Register a named table with a call back function to the query cache. + + @param thd The thread handle + @param table_key A pointer to the table name in the table cache + @param key_length The length of the table name + @param[out] engine_callback The pointer to the storage engine call back + function, currently 0 + @param[out] engine_data Engine data will be set to 0. + + @note Despite the name of this function, it is used to check each statement + before it is cached and not to register a table or callback function. + + @see handler::register_query_cache_table + + @return The error code. The engine_data and engine_callback will be set to 0. + @retval TRUE Success + @retval FALSE An error occured +*/ + +my_bool ha_tritonn::register_query_cache_table(THD *thd, char *table_name, + uint table_name_len, + qc_engine_callback + *engine_callback, + ulonglong *engine_data) +{ + /* + No call back function is needed to determine if a cached statement + is valid or not. + */ + *engine_callback= 0; + + /* + No engine data is needed. + */ + *engine_data= 0; + + /* + If a concurrent INSERT has happened just before the currently processed + SELECT statement, the total size of the table is unknown. + + To determine if the table size is known, the current thread's snap shot of + the table size with the actual table size are compared. + + If the table size is unknown the SELECT statement can't be cached. + */ + ulonglong actual_data_file_length; + ulonglong current_data_file_length; + + /* + POSIX visibility rules specify that "2. Whatever memory values a + thread can see when it unlocks a mutex <...> can also be seen by any + thread that later locks the same mutex". In this particular case, + concurrent insert thread had modified the data_file_length in + MYISAM_SHARE before it has unlocked (or even locked) + structure_guard_mutex. So, here we're guaranteed to see at least that + value after we've locked the same mutex. We can see a later value + (modified by some other thread) though, but it's ok, as we only want + to know if the variable was changed, the actual new value doesn't matter + */ + actual_data_file_length= file->s->state.state.data_file_length; + current_data_file_length= file->save_state.data_file_length; + + if (current_data_file_length != actual_data_file_length) + { + /* Don't cache current statement. */ + return FALSE; + } + + /* It is ok to try to cache current statement. */ + return TRUE; +} +#endif Added: trunk/src/ha_tritonn.h =================================================================== --- trunk/src/ha_tritonn.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/ha_tritonn.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,143 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#ifdef USE_PRAGMA_INTERFACE +#pragma interface /* gcc class implementation */ +#endif + +/* class for the the myisam handler */ + +#include +#include + +#define HA_RECOVER_NONE 0 /* No automatic recover */ +#define HA_RECOVER_DEFAULT 1 /* Automatic recover active */ +#define HA_RECOVER_BACKUP 2 /* Make a backupfile on recover */ +#define HA_RECOVER_FORCE 4 /* Recover even if we loose rows */ +#define HA_RECOVER_QUICK 8 /* Don't check rows in data file */ + +extern ulong myisam_sort_buffer_size; +extern TYPELIB myisam_recover_typelib; +extern ulong myisam_recover_options; + +class ha_tritonn: public handler +{ + MI_INFO *file; + ulonglong int_table_flags; + char *data_file_name, *index_file_name; + bool can_enable_indexes; + int repair(THD *thd, MI_CHECK ¶m, bool optimize); + + public: + ha_tritonn(handlerton *hton, TABLE_SHARE *table_arg); + ~ha_tritonn() {} + handler *clone(MEM_ROOT *mem_root); + const char *table_type() const { return "Tritonn"; } + const char *index_type(uint key_number); + const char **bas_ext() const; + ulonglong table_flags() const { return int_table_flags; } + ulong index_flags(uint inx, uint part, bool all_parts) const + { + return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? + 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | + HA_READ_ORDER | HA_KEYREAD_ONLY); + } + uint max_supported_keys() const { return MI_MAX_KEY; } + uint max_supported_key_length() const { return MI_MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; } + uint checksum() const; + + int open(const char *name, int mode, uint test_if_locked); + int close(void); + int write_row(uchar * buf); + int update_row(const uchar * old_data, uchar * new_data); + int delete_row(const uchar * buf); + int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, + enum ha_rkey_function find_flag); + int index_read_idx_map(uchar *buf, uint index, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag); + int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map); + int index_next(uchar * buf); + int index_prev(uchar * buf); + int index_first(uchar * buf); + int index_last(uchar * buf); + int index_next_same(uchar *buf, const uchar *key, uint keylen); + int ft_init() + { + if (!ft_handler) + return 1; + ft_handler->please->reinit_search(ft_handler); + return 0; + } + FT_INFO *ft_init_ext(uint flags, uint inx,String *key) + { + return ft_init_search(flags,file,inx, + (uchar *)key->ptr(), key->length(), key->charset(), + table->record[0]); + } + int ft_read(uchar *buf); + int rnd_init(bool scan); + int rnd_next(uchar *buf); + int rnd_pos(uchar * buf, uchar *pos); + int restart_rnd_next(uchar *buf, uchar *pos); + void position(const uchar *record); + int info(uint); + int extra(enum ha_extra_function operation); + int extra_opt(enum ha_extra_function operation, ulong cache_size); + int reset(void); + int external_lock(THD *thd, int lock_type); + int delete_all_rows(void); + int disable_indexes(uint mode); + int enable_indexes(uint mode); + int indexes_are_disabled(void); + void start_bulk_insert(ha_rows rows); + int end_bulk_insert(); + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); + void update_create_info(HA_CREATE_INFO *create_info); + int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); + THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type); + virtual void get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values); + int rename_table(const char * from, const char * to); + int delete_table(const char *name); + int check(THD* thd, HA_CHECK_OPT* check_opt); + int analyze(THD* thd,HA_CHECK_OPT* check_opt); + int repair(THD* thd, HA_CHECK_OPT* check_opt); + bool check_and_repair(THD *thd); + bool is_crashed() const; + bool auto_repair() const { return myisam_recover_options != 0; } + int optimize(THD* thd, HA_CHECK_OPT* check_opt); + int restore(THD* thd, HA_CHECK_OPT* check_opt); + int backup(THD* thd, HA_CHECK_OPT* check_opt); + int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt); + int preload_keys(THD* thd, HA_CHECK_OPT* check_opt); + bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); +#ifdef HAVE_REPLICATION + int dump(THD* thd, int fd); + int net_read_dump(NET* net); +#endif +#ifdef HAVE_QUERY_CACHE + my_bool register_query_cache_table(THD *thd, char *table_key, + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data); +#endif +}; Added: trunk/src/mi_cache.c =================================================================== --- trunk/src/mi_cache.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_cache.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,107 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Functions for read record cacheing with myisam + Used for reading dynamic/compressed records from datafile. + + Can fetch data directly from file (outside cache), + if reading a small chunk straight before the cached part (with possible + overlap). + + Can be explicitly asked not to use cache (by not setting READING_NEXT in + flag) - useful for occasional out-of-cache reads, when the next read is + expected to hit the cache again. + + Allows "partial read" errors in the record header (when READING_HEADER flag + is set) - unread part is bzero'ed + + Note: out-of-cache reads are enabled for shared IO_CACHE's too, + as these reads will be cached by OS cache (and my_pread is always atomic) +*/ + + +#include "myisamdef.h" + +int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length, + int flag) +{ + uint read_length,in_buff_length; + my_off_t offset; + uchar *in_buff_pos; + DBUG_ENTER("_mi_read_cache"); + + if (pos < info->pos_in_file) + { + read_length=length; + if ((my_off_t) read_length > (my_off_t) (info->pos_in_file-pos)) + read_length=(uint) (info->pos_in_file-pos); + info->seek_not_done=1; + if (my_pread(info->file,buff,read_length,pos,MYF(MY_NABP))) + DBUG_RETURN(1); + if (!(length-=read_length)) + DBUG_RETURN(0); + pos+=read_length; + buff+=read_length; + } + if (pos >= info->pos_in_file && + (offset= (my_off_t) (pos - info->pos_in_file)) < + (my_off_t) (info->read_end - info->request_pos)) + { + in_buff_pos=info->request_pos+(uint) offset; + in_buff_length= min(length, (size_t) (info->read_end-in_buff_pos)); + memcpy(buff,info->request_pos+(uint) offset,(size_t) in_buff_length); + if (!(length-=in_buff_length)) + DBUG_RETURN(0); + pos+=in_buff_length; + buff+=in_buff_length; + } + else + in_buff_length=0; + if (flag & READING_NEXT) + { + if (pos != (info->pos_in_file + + (uint) (info->read_end - info->request_pos))) + { + info->pos_in_file=pos; /* Force start here */ + info->read_pos=info->read_end=info->request_pos; /* Everything used */ + info->seek_not_done=1; + } + else + info->read_pos=info->read_end; /* All block used */ + if (!(*info->read_function)(info,buff,length)) + DBUG_RETURN(0); + read_length=info->error; + } + else + { + info->seek_not_done=1; + if ((read_length=my_pread(info->file,buff,length,pos,MYF(0))) == length) + DBUG_RETURN(0); + } + if (!(flag & READING_HEADER) || (int) read_length == -1 || + read_length+in_buff_length < 3) + { + DBUG_PRINT("error", + ("Error %d reading next-multi-part block (Got %d bytes)", + my_errno, (int) read_length)); + if (!my_errno || my_errno == -1) + my_errno=HA_ERR_WRONG_IN_RECORD; + DBUG_RETURN(1); + } + bzero(buff+read_length,MI_BLOCK_INFO_HEADER_LENGTH - in_buff_length - + read_length); + DBUG_RETURN(0); +} /* _mi_read_cache */ Added: trunk/src/mi_changed.c =================================================================== --- trunk/src/mi_changed.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_changed.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,33 @@ +/* Copyright (C) 2000-2001 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Check if somebody has changed table since last check. */ + +#include "myisamdef.h" + + /* Return 0 if table isn't changed */ + +int mi_is_changed(MI_INFO *info) +{ + int result; + DBUG_ENTER("mi_is_changed"); + if (fast_mi_readinfo(info)) + DBUG_RETURN(-1); + VOID(_mi_writeinfo(info,0)); + result=(int) info->data_changed; + info->data_changed=0; + DBUG_PRINT("exit",("result: %d",result)); + DBUG_RETURN(result); +} Added: trunk/src/mi_check.c =================================================================== --- trunk/src/mi_check.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_check.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,4610 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Describe, check and repair of MyISAM tables */ + +/* + About checksum calculation. + + There are two types of checksums. Table checksum and row checksum. + + Row checksum is an additional byte at the end of dynamic length + records. It must be calculated if the table is configured for them. + Otherwise they must not be used. The variable + MYISAM_SHARE::calc_checksum determines if row checksums are used. + MI_INFO::checksum is used as temporary storage during row handling. + For parallel repair we must assure that only one thread can use this + variable. There is no problem on the write side as this is done by one + thread only. But when checking a record after read this could go + wrong. But since all threads read through a common read buffer, it is + sufficient if only one thread checks it. + + Table checksum is an eight byte value in the header of the index file. + It can be calculated even if row checksums are not used. The variable + MI_CHECK::glob_crc is calculated over all records. + MI_SORT_PARAM::calc_checksum determines if this should be done. This + variable is not part of MI_CHECK because it must be set per thread for + parallel repair. The global glob_crc must be changed by one thread + only. And it is sufficient to calculate the checksum once only. +*/ + +#include "ftdefs.h" +#include +#include +#include +#ifdef HAVE_SYS_VADVISE_H +#include +#endif +#ifdef HAVE_SYS_MMAN_H +#include +#endif +#include "rt_index.h" + +#ifndef USE_RAID +#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G) +#define my_raid_delete(A,B,C) my_delete(A,B) +#endif + + /* Functions defined in this file */ + +static int check_k_link(MI_CHECK *param, MI_INFO *info,uint nr); +static int chk_index(MI_CHECK *param, MI_INFO *info,MI_KEYDEF *keyinfo, + my_off_t page, uchar *buff, ha_rows *keys, + ha_checksum *key_checksum, uint level); +static uint isam_key_length(MI_INFO *info,MI_KEYDEF *keyinfo); +static ha_checksum calc_checksum(ha_rows count); +static int writekeys(MI_SORT_PARAM *sort_param); +static int sort_one_index(MI_CHECK *param, MI_INFO *info,MI_KEYDEF *keyinfo, + my_off_t pagepos, File new_file); +static int sort_key_read(MI_SORT_PARAM *sort_param,void *key); +static int sort_ft_key_read(MI_SORT_PARAM *sort_param,void *key); +static int sort_get_next_record(MI_SORT_PARAM *sort_param); +static int sort_key_cmp(MI_SORT_PARAM *sort_param, const void *a,const void *b); +static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a); +static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a); +static my_off_t get_record_for_key(MI_INFO *info,MI_KEYDEF *keyinfo, + uchar *key); +static int sort_insert_key(MI_SORT_PARAM *sort_param, + reg1 SORT_KEY_BLOCKS *key_block, + uchar *key, my_off_t prev_block); +static int sort_delete_record(MI_SORT_PARAM *sort_param); +/*static int flush_pending_blocks(MI_CHECK *param);*/ +static SORT_KEY_BLOCKS *alloc_key_blocks(MI_CHECK *param, uint blocks, + uint buffer_length); +static ha_checksum mi_byte_checksum(const uchar *buf, uint length); +static void set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share); + +void myisamchk_init(MI_CHECK *param) +{ + bzero((uchar*) param,sizeof(*param)); + param->opt_follow_links=1; + param->keys_in_use= ~(ulonglong) 0; + param->search_after_block=HA_OFFSET_ERROR; + param->auto_increment_value= 0; + param->use_buffers=USE_BUFFER_INIT; + param->read_buffer_length=READ_BUFFER_INIT; + param->write_buffer_length=READ_BUFFER_INIT; + param->sort_buffer_length=SORT_BUFFER_INIT; + param->sort_key_blocks=BUFFERS_WHEN_SORTING; + param->tmpfile_createflag=O_RDWR | O_TRUNC | O_EXCL; + param->myf_rw=MYF(MY_NABP | MY_WME | MY_WAIT_IF_FULL); + param->start_check_pos=0; + param->max_record_length= LONGLONG_MAX; + param->key_cache_block_size= KEY_CACHE_BLOCK_SIZE; + param->stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL; +} + + /* Check the status flags for the table */ + +int chk_status(MI_CHECK *param, register MI_INFO *info) +{ + MYISAM_SHARE *share=info->s; + + if (mi_is_crashed_on_repair(info)) + mi_check_print_warning(param, + "Table is marked as crashed and last repair failed"); + else if (mi_is_crashed(info)) + mi_check_print_warning(param, + "Table is marked as crashed"); + if (share->state.open_count != (uint) (info->s->global_changed ? 1 : 0)) + { + /* Don't count this as a real warning, as check can correct this ! */ + uint save=param->warning_printed; + mi_check_print_warning(param, + share->state.open_count==1 ? + "%d client is using or hasn't closed the table properly" : + "%d clients are using or haven't closed the table properly", + share->state.open_count); + /* If this will be fixed by the check, forget the warning */ + if (param->testflag & T_UPDATE_STATE) + param->warning_printed=save; + } + return 0; +} + + /* Check delete links */ + +int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag) +{ + reg2 ha_rows i; + uint delete_link_length; + my_off_t empty,next_link,old_link; + char buff[22],buff2[22]; + DBUG_ENTER("chk_del"); + + LINT_INIT(old_link); + param->record_checksum=0; + delete_link_length=((info->s->options & HA_OPTION_PACK_RECORD) ? 20 : + info->s->rec_reflength+1); + + if (!(test_flag & T_SILENT)) + puts("- check record delete-chain"); + + next_link=info->s->state.dellink; + if (info->state->del == 0) + { + if (test_flag & T_VERBOSE) + { + puts("No recordlinks"); + } + } + else + { + if (test_flag & T_VERBOSE) + printf("Recordlinks: "); + empty=0; + for (i= info->state->del ; i > 0L && next_link != HA_OFFSET_ERROR ; i--) + { + if (*killed_ptr(param)) + DBUG_RETURN(1); + if (test_flag & T_VERBOSE) + printf(" %9s",llstr(next_link,buff)); + if (next_link >= info->state->data_file_length) + goto wrong; + if (my_pread(info->dfile, (uchar*) buff,delete_link_length, + next_link,MYF(MY_NABP))) + { + if (test_flag & T_VERBOSE) puts(""); + mi_check_print_error(param,"Can't read delete-link at filepos: %s", + llstr(next_link,buff)); + DBUG_RETURN(1); + } + if (*buff != '\0') + { + if (test_flag & T_VERBOSE) puts(""); + mi_check_print_error(param,"Record at pos: %s is not remove-marked", + llstr(next_link,buff)); + goto wrong; + } + if (info->s->options & HA_OPTION_PACK_RECORD) + { + my_off_t prev_link=mi_sizekorr(buff+12); + if (empty && prev_link != old_link) + { + if (test_flag & T_VERBOSE) puts(""); + mi_check_print_error(param,"Deleted block at %s doesn't point back at previous delete link",llstr(next_link,buff2)); + goto wrong; + } + old_link=next_link; + next_link=mi_sizekorr(buff+4); + empty+=mi_uint3korr(buff+1); + } + else + { + param->record_checksum+=(ha_checksum) next_link; + next_link=_mi_rec_pos(info->s,(uchar*) buff+1); + empty+=info->s->base.pack_reclength; + } + } + if (test_flag & T_VERBOSE) + puts("\n"); + if (empty != info->state->empty) + { + mi_check_print_warning(param, + "Found %s deleted space in delete link chain. Should be %s", + llstr(empty,buff2), + llstr(info->state->empty,buff)); + } + if (next_link != HA_OFFSET_ERROR) + { + mi_check_print_error(param, + "Found more than the expected %s deleted rows in delete link chain", + llstr(info->state->del, buff)); + goto wrong; + } + if (i != 0) + { + mi_check_print_error(param, + "Found %s deleted rows in delete link chain. Should be %s", + llstr(info->state->del - i, buff2), + llstr(info->state->del, buff)); + goto wrong; + } + } + DBUG_RETURN(0); + +wrong: + param->testflag|=T_RETRY_WITHOUT_QUICK; + if (test_flag & T_VERBOSE) puts(""); + mi_check_print_error(param,"record delete-link-chain corrupted"); + DBUG_RETURN(1); +} /* chk_del */ + + + /* Check delete links in index file */ + +static int check_k_link(MI_CHECK *param, register MI_INFO *info, uint nr) +{ + my_off_t next_link; + uint block_size=(nr+1)*MI_MIN_KEY_BLOCK_LENGTH; + ha_rows records; + char llbuff[21], llbuff2[21]; + uchar *buff; + DBUG_ENTER("check_k_link"); + DBUG_PRINT("enter", ("block_size: %u", block_size)); + + if (param->testflag & T_VERBOSE) + printf("block_size %4u:", block_size); /* purecov: tested */ + + next_link=info->s->state.key_del[nr]; + records= (ha_rows) (info->state->key_file_length / block_size); + while (next_link != HA_OFFSET_ERROR && records > 0) + { + if (*killed_ptr(param)) + DBUG_RETURN(1); + if (param->testflag & T_VERBOSE) + printf("%16s",llstr(next_link,llbuff)); + + /* Key blocks must lay within the key file length entirely. */ + if (next_link + block_size > info->state->key_file_length) + { + /* purecov: begin tested */ + mi_check_print_error(param, "Invalid key block position: %s " + "key block size: %u file_length: %s", + llstr(next_link, llbuff), block_size, + llstr(info->state->key_file_length, llbuff2)); + DBUG_RETURN(1); + /* purecov: end */ + } + + /* Key blocks must be aligned at MI_MIN_KEY_BLOCK_LENGTH. */ + if (next_link & (MI_MIN_KEY_BLOCK_LENGTH - 1)) + { + /* purecov: begin tested */ + mi_check_print_error(param, "Mis-aligned key block: %s " + "minimum key block length: %u", + llstr(next_link, llbuff), MI_MIN_KEY_BLOCK_LENGTH); + DBUG_RETURN(1); + /* purecov: end */ + } + + /* + Read the key block with MI_MIN_KEY_BLOCK_LENGTH to find next link. + If the key cache block size is smaller than block_size, we can so + avoid unecessary eviction of cache block. + */ + if (!(buff=key_cache_read(info->s->key_cache, + info->s->kfile, next_link, DFLT_INIT_HITS, + (uchar*) info->buff, MI_MIN_KEY_BLOCK_LENGTH, + MI_MIN_KEY_BLOCK_LENGTH, 1))) + { + /* purecov: begin tested */ + mi_check_print_error(param, "key cache read error for block: %s", + llstr(next_link,llbuff)); + DBUG_RETURN(1); + /* purecov: end */ + } + next_link=mi_sizekorr(buff); + records--; + param->key_file_blocks+=block_size; + } + if (param->testflag & T_VERBOSE) + { + if (next_link != HA_OFFSET_ERROR) + printf("%16s\n",llstr(next_link,llbuff)); + else + puts(""); + } + DBUG_RETURN (next_link != HA_OFFSET_ERROR); +} /* check_k_link */ + + + /* Check sizes of files */ + +int chk_size(MI_CHECK *param, register MI_INFO *info) +{ + int error=0; + register my_off_t skr,size; + char buff[22],buff2[22]; + DBUG_ENTER("chk_size"); + + if (!(param->testflag & T_SILENT)) puts("- check file-size"); + + /* The following is needed if called externally (not from myisamchk) */ + flush_key_blocks(info->s->key_cache, + info->s->kfile, FLUSH_FORCE_WRITE); + + size= my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE)); + if ((skr=(my_off_t) info->state->key_file_length) != size) + { + /* Don't give error if file generated by myisampack */ + if (skr > size && mi_is_any_key_active(info->s->state.key_map)) + { + error=1; + mi_check_print_error(param, + "Size of indexfile is: %-8s Should be: %s", + llstr(size,buff), llstr(skr,buff2)); + } + else + mi_check_print_warning(param, + "Size of indexfile is: %-8s Should be: %s", + llstr(size,buff), llstr(skr,buff2)); + } + if (!(param->testflag & T_VERY_SILENT) && + ! (info->s->options & HA_OPTION_COMPRESS_RECORD) && + ulonglong2double(info->state->key_file_length) > + ulonglong2double(info->s->base.margin_key_file_length)*0.9) + mi_check_print_warning(param,"Keyfile is almost full, %10s of %10s used", + llstr(info->state->key_file_length,buff), + llstr(info->s->base.max_key_file_length-1,buff)); + + size=my_seek(info->dfile,0L,MY_SEEK_END,MYF(0)); + skr=(my_off_t) info->state->data_file_length; + if (info->s->options & HA_OPTION_COMPRESS_RECORD) + skr+= MEMMAP_EXTRA_MARGIN; +#ifdef USE_RELOC + if (info->data_file_type == STATIC_RECORD && + skr < (my_off_t) info->s->base.reloc*info->s->base.min_pack_length) + skr=(my_off_t) info->s->base.reloc*info->s->base.min_pack_length; +#endif + if (skr != size) + { + info->state->data_file_length=size; /* Skip other errors */ + if (skr > size && skr != size + MEMMAP_EXTRA_MARGIN) + { + error=1; + mi_check_print_error(param,"Size of datafile is: %-9s Should be: %s", + llstr(size,buff), llstr(skr,buff2)); + param->testflag|=T_RETRY_WITHOUT_QUICK; + } + else + { + mi_check_print_warning(param, + "Size of datafile is: %-9s Should be: %s", + llstr(size,buff), llstr(skr,buff2)); + } + } + if (!(param->testflag & T_VERY_SILENT) && + !(info->s->options & HA_OPTION_COMPRESS_RECORD) && + ulonglong2double(info->state->data_file_length) > + (ulonglong2double(info->s->base.max_data_file_length)*0.9)) + mi_check_print_warning(param, "Datafile is almost full, %10s of %10s used", + llstr(info->state->data_file_length,buff), + llstr(info->s->base.max_data_file_length-1,buff2)); + DBUG_RETURN(error); +} /* chk_size */ + + + /* Check keys */ + +int chk_key(MI_CHECK *param, register MI_INFO *info) +{ + uint key,found_keys=0,full_text_keys=0,result=0; + ha_rows keys; + ha_checksum old_record_checksum,init_checksum; + my_off_t all_keydata,all_totaldata,key_totlength,length; + ulong *rec_per_key_part; + MYISAM_SHARE *share=info->s; + MI_KEYDEF *keyinfo; + char buff[22],buff2[22]; + DBUG_ENTER("chk_key"); + + if (!(param->testflag & T_SILENT)) + puts("- check key delete-chain"); + + param->key_file_blocks=info->s->base.keystart; + for (key=0 ; key < info->s->state.header.max_block_size_index ; key++) + if (check_k_link(param,info,key)) + { + if (param->testflag & T_VERBOSE) puts(""); + mi_check_print_error(param,"key delete-link-chain corrupted"); + DBUG_RETURN(-1); + } + + if (!(param->testflag & T_SILENT)) puts("- check index reference"); + + all_keydata=all_totaldata=key_totlength=0; + old_record_checksum=0; + init_checksum=param->record_checksum; + if (!(share->options & + (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD))) + old_record_checksum=calc_checksum(info->state->records+info->state->del-1)* + share->base.pack_reclength; + rec_per_key_part= param->rec_per_key_part; + for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ; + rec_per_key_part+=keyinfo->keysegs, key++, keyinfo++) + { + param->key_crc[key]=0; + if (! mi_is_key_active(share->state.key_map, key)) + { + /* Remember old statistics for key */ + memcpy((char*) rec_per_key_part, + (char*) (share->state.rec_per_key_part + + (uint) (rec_per_key_part - param->rec_per_key_part)), + keyinfo->keysegs*sizeof(*rec_per_key_part)); + continue; + } + found_keys++; + + param->record_checksum=init_checksum; + + bzero((char*) ¶m->unique_count,sizeof(param->unique_count)); + bzero((char*) ¶m->notnull_count,sizeof(param->notnull_count)); + + if ((!(param->testflag & T_SILENT))) + printf ("- check data record references index: %d\n",key+1); + if (keyinfo->flag & HA_FULLTEXT) + full_text_keys++; + if (share->state.key_root[key] == HA_OFFSET_ERROR && + (info->state->records == 0 || keyinfo->flag & HA_FULLTEXT)) + goto do_stat; + if (!_mi_fetch_keypage(info,keyinfo,share->state.key_root[key], + DFLT_INIT_HITS,info->buff,0)) + { + mi_check_print_error(param,"Can't read indexpage from filepos: %s", + llstr(share->state.key_root[key],buff)); + if (!(param->testflag & T_INFO)) + DBUG_RETURN(-1); + result= -1; + continue; + } + param->key_file_blocks+=keyinfo->block_length; + keys=0; + param->keydata=param->totaldata=0; + param->key_blocks=0; + param->max_level=0; + if (chk_index(param,info,keyinfo,share->state.key_root[key],info->buff, + &keys, param->key_crc+key,1)) + DBUG_RETURN(-1); + if(!(keyinfo->flag & (HA_FULLTEXT | HA_SPATIAL))) + { + if (keys != info->state->records) + { + mi_check_print_error(param,"Found %s keys of %s",llstr(keys,buff), + llstr(info->state->records,buff2)); + if (!(param->testflag & T_INFO)) + DBUG_RETURN(-1); + result= -1; + continue; + } + if (found_keys - full_text_keys == 1 && + ((share->options & + (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) || + (param->testflag & T_DONT_CHECK_CHECKSUM))) + old_record_checksum=param->record_checksum; + else if (old_record_checksum != param->record_checksum) + { + if (key) + mi_check_print_error(param,"Key %u doesn't point at same records that key 1", + key+1); + else + mi_check_print_error(param,"Key 1 doesn't point at all records"); + if (!(param->testflag & T_INFO)) + DBUG_RETURN(-1); + result= -1; + continue; + } + } + if ((uint) share->base.auto_key -1 == key) + { + /* Check that auto_increment key is bigger than max key value */ + ulonglong auto_increment; + info->lastinx=key; + _mi_read_key_record(info, 0L, info->rec_buff); + auto_increment= retrieve_auto_increment(info, info->rec_buff); + if (auto_increment > info->s->state.auto_increment) + { + mi_check_print_warning(param, "Auto-increment value: %s is smaller " + "than max used value: %s", + llstr(info->s->state.auto_increment,buff2), + llstr(auto_increment, buff)); + } + if (param->testflag & T_AUTO_INC) + { + set_if_bigger(info->s->state.auto_increment, + auto_increment); + set_if_bigger(info->s->state.auto_increment, + param->auto_increment_value); + } + + /* Check that there isn't a row with auto_increment = 0 in the table */ + mi_extra(info,HA_EXTRA_KEYREAD,0); + bzero(info->lastkey,keyinfo->seg->length); + if (!mi_rkey(info, info->rec_buff, key, (const uchar*) info->lastkey, + (key_part_map)1, HA_READ_KEY_EXACT)) + { + /* Don't count this as a real warning, as myisamchk can't correct it */ + uint save=param->warning_printed; + mi_check_print_warning(param, "Found row where the auto_increment " + "column has the value 0"); + param->warning_printed=save; + } + mi_extra(info,HA_EXTRA_NO_KEYREAD,0); + } + + length=(my_off_t) isam_key_length(info,keyinfo)*keys + param->key_blocks*2; + if (param->testflag & T_INFO && param->totaldata != 0L && keys != 0L) + printf("Key: %2d: Keyblocks used: %3d%% Packed: %4d%% Max levels: %2d\n", + key+1, + (int) (my_off_t2double(param->keydata)*100.0/my_off_t2double(param->totaldata)), + (int) ((my_off_t2double(length) - my_off_t2double(param->keydata))*100.0/ + my_off_t2double(length)), + param->max_level); + all_keydata+=param->keydata; all_totaldata+=param->totaldata; key_totlength+=length; + +do_stat: + if (param->testflag & T_STATISTICS) + update_key_parts(keyinfo, rec_per_key_part, param->unique_count, + param->stats_method == MI_STATS_METHOD_IGNORE_NULLS? + param->notnull_count: NULL, + (ulonglong)info->state->records); + } + if (param->testflag & T_INFO) + { + if (all_totaldata != 0L && found_keys > 0) + printf("Total: Keyblocks used: %3d%% Packed: %4d%%\n\n", + (int) (my_off_t2double(all_keydata)*100.0/ + my_off_t2double(all_totaldata)), + (int) ((my_off_t2double(key_totlength) - + my_off_t2double(all_keydata))*100.0/ + my_off_t2double(key_totlength))); + else if (all_totaldata != 0L && mi_is_any_key_active(share->state.key_map)) + puts(""); + } + if (param->key_file_blocks != info->state->key_file_length && + param->keys_in_use != ~(ulonglong) 0) + mi_check_print_warning(param, "Some data are unreferenced in keyfile"); + if (found_keys != full_text_keys) + param->record_checksum=old_record_checksum-init_checksum; /* Remove delete links */ + else + param->record_checksum=0; + DBUG_RETURN(result); +} /* chk_key */ + + +static int chk_index_down(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, + my_off_t page, uchar *buff, ha_rows *keys, + ha_checksum *key_checksum, uint level) +{ + char llbuff[22],llbuff2[22]; + DBUG_ENTER("chk_index_down"); + + /* Key blocks must lay within the key file length entirely. */ + if (page + keyinfo->block_length > info->state->key_file_length) + { + /* purecov: begin tested */ + /* Give it a chance to fit in the real file size. */ + my_off_t max_length= my_seek(info->s->kfile, 0L, MY_SEEK_END, + MYF(MY_THREADSAFE)); + mi_check_print_error(param, "Invalid key block position: %s " + "key block size: %u file_length: %s", + llstr(page, llbuff), keyinfo->block_length, + llstr(info->state->key_file_length, llbuff2)); + if (page + keyinfo->block_length > max_length) + goto err; + /* Fix the remebered key file length. */ + info->state->key_file_length= (max_length & + ~ (my_off_t) (keyinfo->block_length - 1)); + /* purecov: end */ + } + + /* Key blocks must be aligned at MI_MIN_KEY_BLOCK_LENGTH. */ + if (page & (MI_MIN_KEY_BLOCK_LENGTH - 1)) + { + /* purecov: begin tested */ + mi_check_print_error(param, "Mis-aligned key block: %s " + "minimum key block length: %u", + llstr(page, llbuff), MI_MIN_KEY_BLOCK_LENGTH); + goto err; + /* purecov: end */ + } + + if (!_mi_fetch_keypage(info,keyinfo,page, DFLT_INIT_HITS,buff,0)) + { + mi_check_print_error(param,"Can't read key from filepos: %s", + llstr(page,llbuff)); + goto err; + } + param->key_file_blocks+=keyinfo->block_length; + if (chk_index(param,info,keyinfo,page,buff,keys,key_checksum,level)) + goto err; + + DBUG_RETURN(0); + + /* purecov: begin tested */ +err: + DBUG_RETURN(1); + /* purecov: end */ +} + + +/* + "Ignore NULLs" statistics collection method: process first index tuple. + + SYNOPSIS + mi_collect_stats_nonulls_first() + keyseg IN Array of key part descriptions + notnull INOUT Array, notnull[i] = (number of {keypart1...keypart_i} + tuples that don't contain NULLs) + key IN Key values tuple + + DESCRIPTION + Process the first index tuple - find out which prefix tuples don't + contain NULLs, and update the array of notnull counters accordingly. +*/ + +static +void mi_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull, + uchar *key) +{ + uint first_null, kp; + first_null= ha_find_null(keyseg, key) - keyseg; + /* + All prefix tuples that don't include keypart_{first_null} are not-null + tuples (and all others aren't), increment counters for them. + */ + for (kp= 0; kp < first_null; kp++) + notnull[kp]++; +} + + +/* + "Ignore NULLs" statistics collection method: process next index tuple. + + SYNOPSIS + mi_collect_stats_nonulls_next() + keyseg IN Array of key part descriptions + notnull INOUT Array, notnull[i] = (number of {keypart1...keypart_i} + tuples that don't contain NULLs) + prev_key IN Previous key values tuple + last_key IN Next key values tuple + + DESCRIPTION + Process the next index tuple: + 1. Find out which prefix tuples of last_key don't contain NULLs, and + update the array of notnull counters accordingly. + 2. Find the first keypart number where the prev_key and last_key tuples + are different(A), or last_key has NULL value(B), and return it, so the + caller can count number of unique tuples for each key prefix. We don't + need (B) to be counted, and that is compensated back in + update_key_parts(). + + RETURN + 1 + number of first keypart where values differ or last_key tuple has NULL +*/ + +static +int mi_collect_stats_nonulls_next(HA_KEYSEG *keyseg, ulonglong *notnull, + uchar *prev_key, uchar *last_key) +{ + uint diffs[2]; + uint first_null_seg, kp; + HA_KEYSEG *seg; + + /* + Find the first keypart where values are different or either of them is + NULL. We get results in diffs array: + diffs[0]= 1 + number of first different keypart + diffs[1]=offset: (last_key + diffs[1]) points to first value in + last_key that is NULL or different from corresponding + value in prev_key. + */ + ha_key_cmp(keyseg, prev_key, last_key, USE_WHOLE_KEY, + SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, diffs); + seg= keyseg + diffs[0] - 1; + + /* Find first NULL in last_key */ + first_null_seg= ha_find_null(seg, last_key + diffs[1]) - keyseg; + for (kp= 0; kp < first_null_seg; kp++) + notnull[kp]++; + + /* + Return 1+ number of first key part where values differ. Don't care if + these were NULLs and not .... We compensate for that in + update_key_parts. + */ + return diffs[0]; +} + + + /* Check if index is ok */ + +static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, + my_off_t page, uchar *buff, ha_rows *keys, + ha_checksum *key_checksum, uint level) +{ + int flag; + uint used_length,comp_flag,nod_flag,key_length=0; + uchar key[MI_MAX_POSSIBLE_KEY_BUFF],*temp_buff,*keypos,*old_keypos,*endpos; + my_off_t next_page,record; + char llbuff[22]; + uint diff_pos[2]; + DBUG_ENTER("chk_index"); + DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff)); + + /* TODO: implement appropriate check for RTree keys */ + if (keyinfo->flag & HA_SPATIAL) + DBUG_RETURN(0); + + if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length))) + { + mi_check_print_error(param,"Not enough memory for keyblock"); + DBUG_RETURN(-1); + } + + if (keyinfo->flag & HA_NOSAME) + comp_flag=SEARCH_FIND | SEARCH_UPDATE; /* Not real duplicates */ + else + comp_flag=SEARCH_SAME; /* Keys in positionorder */ + nod_flag=mi_test_if_nod(buff); + used_length=mi_getint(buff); + keypos=buff+2+nod_flag; + endpos=buff+used_length; + + param->keydata+=used_length; param->totaldata+=keyinfo->block_length; /* INFO */ + param->key_blocks++; + if (level > param->max_level) + param->max_level=level; + + if (used_length > keyinfo->block_length) + { + mi_check_print_error(param,"Wrong pageinfo at page: %s", + llstr(page,llbuff)); + goto err; + } + for ( ;; ) + { + if (*killed_ptr(param)) + goto err; + memcpy((char*) info->lastkey,(char*) key,key_length); + info->lastkey_length=key_length; + if (nod_flag) + { + next_page=_mi_kpos(nod_flag,keypos); + if (chk_index_down(param,info,keyinfo,next_page, + temp_buff,keys,key_checksum,level+1)) + goto err; + } + old_keypos=keypos; + if (keypos >= endpos || + (key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,key)) == 0) + break; + if (keypos > endpos) + { + mi_check_print_error(param,"Wrong key block length at page: %s",llstr(page,llbuff)); + goto err; + } + if ((*keys)++ && + (flag=ha_key_cmp(keyinfo->seg,info->lastkey,key,key_length, + comp_flag, diff_pos)) >=0) + { + DBUG_DUMP("old",(uchar*) info->lastkey, info->lastkey_length); + DBUG_DUMP("new",(uchar*) key, key_length); + DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos)); + + if (comp_flag & SEARCH_FIND && flag == 0) + mi_check_print_error(param,"Found duplicated key at page %s",llstr(page,llbuff)); + else + mi_check_print_error(param,"Key in wrong position at page %s",llstr(page,llbuff)); + goto err; + } + if (param->testflag & T_STATISTICS) + { + if (*keys != 1L) /* not first_key */ + { + if (param->stats_method == MI_STATS_METHOD_NULLS_NOT_EQUAL) + ha_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY, + SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, + diff_pos); + else if (param->stats_method == MI_STATS_METHOD_IGNORE_NULLS) + { + diff_pos[0]= mi_collect_stats_nonulls_next(keyinfo->seg, + param->notnull_count, + info->lastkey, key); + } + param->unique_count[diff_pos[0]-1]++; + } + else + { + if (param->stats_method == MI_STATS_METHOD_IGNORE_NULLS) + mi_collect_stats_nonulls_first(keyinfo->seg, param->notnull_count, + key); + } + } + (*key_checksum)+= mi_byte_checksum((uchar*) key, + key_length- info->s->rec_reflength); + record= _mi_dpos(info,0,key+key_length); + if (keyinfo->flag & HA_FULLTEXT) /* special handling for ft2 */ + { + uint off; + int subkeys; + get_key_full_length_rdonly(off, key); + subkeys=ft_sintXkorr(key+off); + if (subkeys < 0) + { + ha_rows tmp_keys=0; + if (chk_index_down(param,info,&info->s->ft2_keyinfo,record, + temp_buff,&tmp_keys,key_checksum,1)) + goto err; + if (tmp_keys + subkeys) + { + mi_check_print_error(param, + "Number of words in the 2nd level tree " + "does not match the number in the header. " + "Parent word in on the page %s, offset %u", + llstr(page,llbuff), (uint) (old_keypos-buff)); + goto err; + } + (*keys)+=tmp_keys-1; + continue; + } + /* fall through */ + } + if (record >= info->state->data_file_length) + { +#ifndef DBUG_OFF + char llbuff2[22], llbuff3[22]; +#endif + mi_check_print_error(param,"Found key at page %s that points to record outside datafile",llstr(page,llbuff)); + DBUG_PRINT("test",("page: %s record: %s filelength: %s", + llstr(page,llbuff),llstr(record,llbuff2), + llstr(info->state->data_file_length,llbuff3))); + DBUG_DUMP("key",(uchar*) key,key_length); + DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos)); + goto err; + } + param->record_checksum+=(ha_checksum) record; + } + if (keypos != endpos) + { + mi_check_print_error(param,"Keyblock size at page %s is not correct. Block length: %d key length: %d", + llstr(page,llbuff), used_length, (keypos - buff)); + goto err; + } + my_afree((uchar*) temp_buff); + DBUG_RETURN(0); + err: + my_afree((uchar*) temp_buff); + DBUG_RETURN(1); +} /* chk_index */ + + + /* Calculate a checksum of 1+2+3+4...N = N*(N+1)/2 without overflow */ + +static ha_checksum calc_checksum(ha_rows count) +{ + ulonglong sum,a,b; + DBUG_ENTER("calc_checksum"); + + sum=0; + a=count; b=count+1; + if (a & 1) + b>>=1; + else + a>>=1; + while (b) + { + if (b & 1) + sum+=a; + a<<=1; b>>=1; + } + DBUG_PRINT("exit",("sum: %lx",(ulong) sum)); + DBUG_RETURN((ha_checksum) sum); +} /* calc_checksum */ + + + /* Calc length of key in normal isam */ + +static uint isam_key_length(MI_INFO *info, register MI_KEYDEF *keyinfo) +{ + uint length; + HA_KEYSEG *keyseg; + DBUG_ENTER("isam_key_length"); + + length= info->s->rec_reflength; + for (keyseg=keyinfo->seg ; keyseg->type ; keyseg++) + length+= keyseg->length; + + DBUG_PRINT("exit",("length: %d",length)); + DBUG_RETURN(length); +} /* key_length */ + + + /* Check that record-link is ok */ + +int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) +{ + int error,got_error,flag; + uint key,left_length,b_type,field; + ha_rows records,del_blocks; + my_off_t used,empty,pos,splits,start_recpos, + del_length,link_used,start_block; + uchar *record,*to; + char llbuff[22],llbuff2[22],llbuff3[22]; + ha_checksum intern_record_checksum; + ha_checksum key_checksum[MI_MAX_POSSIBLE_KEY]; + my_bool static_row_size; + MI_KEYDEF *keyinfo; + MI_BLOCK_INFO block_info; + DBUG_ENTER("chk_data_link"); + + if (!(param->testflag & T_SILENT)) + { + if (extend) + puts("- check records and index references"); + else + puts("- check record links"); + } + + if (!(record= (uchar*) my_malloc(info->s->base.pack_reclength,MYF(0)))) + { + mi_check_print_error(param,"Not enough memory for record"); + DBUG_RETURN(-1); + } + records=del_blocks=0; + used=link_used=splits=del_length=0; + intern_record_checksum=param->glob_crc=0; + LINT_INIT(left_length); LINT_INIT(start_recpos); LINT_INIT(to); + got_error=error=0; + empty=info->s->pack.header_length; + + /* Check how to calculate checksum of rows */ + static_row_size=1; + if (info->s->data_file_type == COMPRESSED_RECORD) + { + for (field=0 ; field < info->s->base.fields ; field++) + { + if (info->s->rec[field].base_type == FIELD_BLOB || + info->s->rec[field].base_type == FIELD_VARCHAR) + { + static_row_size=0; + break; + } + } + } + + pos=my_b_tell(¶m->read_cache); + bzero((char*) key_checksum, info->s->base.keys * sizeof(key_checksum[0])); + while (pos < info->state->data_file_length) + { + if (*killed_ptr(param)) + goto err2; + switch (info->s->data_file_type) { + case STATIC_RECORD: + if (my_b_read(¶m->read_cache,(uchar*) record, + info->s->base.pack_reclength)) + goto err; + start_recpos=pos; + pos+=info->s->base.pack_reclength; + splits++; + if (*record == '\0') + { + del_blocks++; + del_length+=info->s->base.pack_reclength; + continue; /* Record removed */ + } + param->glob_crc+= mi_static_checksum(info,record); + used+=info->s->base.pack_reclength; + break; + case DYNAMIC_RECORD: + flag=block_info.second_read=0; + block_info.next_filepos=pos; + do + { + if (_mi_read_cache(¶m->read_cache,(uchar*) block_info.header, + (start_block=block_info.next_filepos), + sizeof(block_info.header), + (flag ? 0 : READING_NEXT) | READING_HEADER)) + goto err; + if (start_block & (MI_DYN_ALIGN_SIZE-1)) + { + mi_check_print_error(param,"Wrong aligned block at %s", + llstr(start_block,llbuff)); + goto err2; + } + b_type=_mi_get_block_info(&block_info,-1,start_block); + if (b_type & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | + BLOCK_FATAL_ERROR)) + { + if (b_type & BLOCK_SYNC_ERROR) + { + if (flag) + { + mi_check_print_error(param,"Unexpected byte: %d at link: %s", + (int) block_info.header[0], + llstr(start_block,llbuff)); + goto err2; + } + pos=block_info.filepos+block_info.block_len; + goto next; + } + if (b_type & BLOCK_DELETED) + { + if (block_info.block_len < info->s->base.min_block_length) + { + mi_check_print_error(param, + "Deleted block with impossible length %lu at %s", + block_info.block_len,llstr(pos,llbuff)); + goto err2; + } + if ((block_info.next_filepos != HA_OFFSET_ERROR && + block_info.next_filepos >= info->state->data_file_length) || + (block_info.prev_filepos != HA_OFFSET_ERROR && + block_info.prev_filepos >= info->state->data_file_length)) + { + mi_check_print_error(param,"Delete link points outside datafile at %s", + llstr(pos,llbuff)); + goto err2; + } + del_blocks++; + del_length+=block_info.block_len; + pos=block_info.filepos+block_info.block_len; + splits++; + goto next; + } + mi_check_print_error(param,"Wrong bytesec: %d-%d-%d at linkstart: %s", + block_info.header[0],block_info.header[1], + block_info.header[2], + llstr(start_block,llbuff)); + goto err2; + } + if (info->state->data_file_length < block_info.filepos+ + block_info.block_len) + { + mi_check_print_error(param, + "Recordlink that points outside datafile at %s", + llstr(pos,llbuff)); + got_error=1; + break; + } + splits++; + if (!flag++) /* First block */ + { + start_recpos=pos; + pos=block_info.filepos+block_info.block_len; + if (block_info.rec_len > (uint) info->s->base.max_pack_length) + { + mi_check_print_error(param,"Found too long record (%lu) at %s", + (ulong) block_info.rec_len, + llstr(start_recpos,llbuff)); + got_error=1; + break; + } + if (info->s->base.blobs) + { + if (!(to= mi_alloc_rec_buff(info, block_info.rec_len, + &info->rec_buff))) + { + mi_check_print_error(param, + "Not enough memory (%lu) for blob at %s", + (ulong) block_info.rec_len, + llstr(start_recpos,llbuff)); + got_error=1; + break; + } + } + else + to= info->rec_buff; + left_length=block_info.rec_len; + } + if (left_length < block_info.data_len) + { + mi_check_print_error(param,"Found too long record (%lu) at %s", + (ulong) block_info.data_len, + llstr(start_recpos,llbuff)); + got_error=1; + break; + } + if (_mi_read_cache(¶m->read_cache,(uchar*) to,block_info.filepos, + (uint) block_info.data_len, + flag == 1 ? READING_NEXT : 0)) + goto err; + to+=block_info.data_len; + link_used+= block_info.filepos-start_block; + used+= block_info.filepos - start_block + block_info.data_len; + empty+=block_info.block_len-block_info.data_len; + left_length-=block_info.data_len; + if (left_length) + { + if (b_type & BLOCK_LAST) + { + mi_check_print_error(param, + "Wrong record length %s of %s at %s", + llstr(block_info.rec_len-left_length,llbuff), + llstr(block_info.rec_len, llbuff2), + llstr(start_recpos,llbuff3)); + got_error=1; + break; + } + if (info->state->data_file_length < block_info.next_filepos) + { + mi_check_print_error(param, + "Found next-recordlink that points outside datafile at %s", + llstr(block_info.filepos,llbuff)); + got_error=1; + break; + } + } + } while (left_length); + if (! got_error) + { + if (_mi_rec_unpack(info,record,info->rec_buff,block_info.rec_len) == + MY_FILE_ERROR) + { + mi_check_print_error(param,"Found wrong record at %s", + llstr(start_recpos,llbuff)); + got_error=1; + } + else + { + info->checksum=mi_checksum(info,record); + if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE)) + { + if (_mi_rec_check(info,record, info->rec_buff,block_info.rec_len, + test(info->s->calc_checksum))) + { + mi_check_print_error(param,"Found wrong packed record at %s", + llstr(start_recpos,llbuff)); + got_error=1; + } + } + if (!got_error) + param->glob_crc+= info->checksum; + } + } + else if (!flag) + pos=block_info.filepos+block_info.block_len; + break; + case COMPRESSED_RECORD: + if (_mi_read_cache(¶m->read_cache,(uchar*) block_info.header, pos, + info->s->pack.ref_length, READING_NEXT)) + goto err; + start_recpos=pos; + splits++; + VOID(_mi_pack_get_block_info(info, &info->bit_buff, &block_info, + &info->rec_buff, -1, start_recpos)); + pos=block_info.filepos+block_info.rec_len; + if (block_info.rec_len < (uint) info->s->min_pack_length || + block_info.rec_len > (uint) info->s->max_pack_length) + { + mi_check_print_error(param, + "Found block with wrong recordlength: %d at %s", + block_info.rec_len, llstr(start_recpos,llbuff)); + got_error=1; + break; + } + if (_mi_read_cache(¶m->read_cache,(uchar*) info->rec_buff, + block_info.filepos, block_info.rec_len, READING_NEXT)) + goto err; + if (_mi_pack_rec_unpack(info, &info->bit_buff, record, + info->rec_buff, block_info.rec_len)) + { + mi_check_print_error(param,"Found wrong record at %s", + llstr(start_recpos,llbuff)); + got_error=1; + } + if (static_row_size) + param->glob_crc+= mi_static_checksum(info,record); + else + param->glob_crc+= mi_checksum(info,record); + link_used+= (block_info.filepos - start_recpos); + used+= (pos-start_recpos); + } /* switch */ + if (! got_error) + { + intern_record_checksum+=(ha_checksum) start_recpos; + records++; + if (param->testflag & T_WRITE_LOOP && records % WRITE_COUNT == 0) + { + printf("%s\r", llstr(records,llbuff)); VOID(fflush(stdout)); + } + + /* Check if keys match the record */ + + for (key=0,keyinfo= info->s->keyinfo; key < info->s->base.keys; + key++,keyinfo++) + { + if (mi_is_key_active(info->s->state.key_map, key)) + { + if(!(keyinfo->flag & HA_FULLTEXT)) + { + uint key_length=_mi_make_key(info,key,info->lastkey,record, + start_recpos); + if (extend) + { + /* We don't need to lock the key tree here as we don't allow + concurrent threads when running myisamchk + */ + int search_result= +#ifdef HAVE_RTREE_KEYS + (keyinfo->flag & HA_SPATIAL) ? + rtree_find_first(info, key, info->lastkey, key_length, + MBR_EQUAL | MBR_DATA) : +#endif + _mi_search(info,keyinfo,info->lastkey,key_length, + SEARCH_SAME, info->s->state.key_root[key]); + if (search_result) + { + mi_check_print_error(param,"Record at: %10s " + "Can't find key for index: %2d", + llstr(start_recpos,llbuff),key+1); + if (error++ > MAXERR || !(param->testflag & T_VERBOSE)) + goto err2; + } + } + else + key_checksum[key]+=mi_byte_checksum((uchar*) info->lastkey, + key_length); + } + } + } + } + else + { + got_error=0; + if (error++ > MAXERR || !(param->testflag & T_VERBOSE)) + goto err2; + } + next:; /* Next record */ + } + if (param->testflag & T_WRITE_LOOP) + { + VOID(fputs(" \r",stdout)); VOID(fflush(stdout)); + } + if (records != info->state->records) + { + mi_check_print_error(param,"Record-count is not ok; is %-10s Should be: %s", + llstr(records,llbuff), llstr(info->state->records,llbuff2)); + error=1; + } + else if (param->record_checksum && + param->record_checksum != intern_record_checksum) + { + mi_check_print_error(param, + "Keypointers and record positions doesn't match"); + error=1; + } + else if (param->glob_crc != info->state->checksum && + (info->s->options & + (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))) + { + mi_check_print_warning(param, + "Record checksum is not the same as checksum stored in the index file\n"); + error=1; + } + else if (!extend) + { + for (key=0 ; key < info->s->base.keys; key++) + { + if (key_checksum[key] != param->key_crc[key] && + !(info->s->keyinfo[key].flag & (HA_FULLTEXT | HA_SPATIAL))) + { + mi_check_print_error(param,"Checksum for key: %2d doesn't match checksum for records", + key+1); + error=1; + } + } + } + + if (del_length != info->state->empty) + { + mi_check_print_warning(param, + "Found %s deleted space. Should be %s", + llstr(del_length,llbuff2), + llstr(info->state->empty,llbuff)); + } + if (used+empty+del_length != info->state->data_file_length) + { + mi_check_print_warning(param, + "Found %s record-data and %s unused data and %s deleted-data", + llstr(used,llbuff),llstr(empty,llbuff2), + llstr(del_length,llbuff3)); + mi_check_print_warning(param, + "Total %s, Should be: %s", + llstr((used+empty+del_length),llbuff), + llstr(info->state->data_file_length,llbuff2)); + } + if (del_blocks != info->state->del) + { + mi_check_print_warning(param, + "Found %10s deleted blocks Should be: %s", + llstr(del_blocks,llbuff), + llstr(info->state->del,llbuff2)); + } + if (splits != info->s->state.split) + { + mi_check_print_warning(param, + "Found %10s parts Should be: %s parts", + llstr(splits,llbuff), + llstr(info->s->state.split,llbuff2)); + } + if (param->testflag & T_INFO) + { + if (param->warning_printed || param->error_printed) + puts(""); + if (used != 0 && ! param->error_printed) + { + printf("Records:%18s M.recordlength:%9lu Packed:%14.0f%%\n", + llstr(records,llbuff), (long)((used-link_used)/records), + (info->s->base.blobs ? 0.0 : + (ulonglong2double((ulonglong) info->s->base.reclength*records)- + my_off_t2double(used))/ + ulonglong2double((ulonglong) info->s->base.reclength*records)*100.0)); + printf("Recordspace used:%9.0f%% Empty space:%12d%% Blocks/Record: %6.2f\n", + (ulonglong2double(used-link_used)/ulonglong2double(used-link_used+empty)*100.0), + (!records ? 100 : (int) (ulonglong2double(del_length+empty)/ + my_off_t2double(used)*100.0)), + ulonglong2double(splits - del_blocks) / records); + } + printf("Record blocks:%12s Delete blocks:%10s\n", + llstr(splits-del_blocks,llbuff),llstr(del_blocks,llbuff2)); + printf("Record data: %12s Deleted data: %10s\n", + llstr(used-link_used,llbuff),llstr(del_length,llbuff2)); + printf("Lost space: %12s Linkdata: %10s\n", + llstr(empty,llbuff),llstr(link_used,llbuff2)); + } + my_free((uchar*) record,MYF(0)); + DBUG_RETURN (error); + err: + mi_check_print_error(param,"got error: %d when reading datafile at record: %s",my_errno, llstr(records,llbuff)); + err2: + my_free((uchar*) record,MYF(0)); + param->testflag|=T_RETRY_WITHOUT_QUICK; + DBUG_RETURN(1); +} /* chk_data_link */ + + + /* Recover old table by reading each record and writing all keys */ + /* Save new datafile-name in temp_filename */ + +int mi_repair(MI_CHECK *param, register MI_INFO *info, + char * name, int rep_quick) +{ + int error,got_error; + uint i; + ha_rows start_records,new_header_length; + my_off_t del; + File new_file; + MYISAM_SHARE *share=info->s; + char llbuff[22],llbuff2[22]; + SORT_INFO sort_info; + MI_SORT_PARAM sort_param; + DBUG_ENTER("mi_repair"); + + bzero((char *)&sort_info, sizeof(sort_info)); + bzero((char *)&sort_param, sizeof(sort_param)); + start_records=info->state->records; + new_header_length=(param->testflag & T_UNPACK) ? 0L : + share->pack.header_length; + got_error=1; + new_file= -1; + sort_param.sort_info=&sort_info; + + if (!(param->testflag & T_SILENT)) + { + printf("- recovering (with keycache) MyISAM-table '%s'\n",name); + printf("Data records: %s\n", llstr(info->state->records,llbuff)); + } + param->testflag|=T_REP; /* for easy checking */ + + if (info->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)) + param->testflag|=T_CALC_CHECKSUM; + + if (!param->using_global_keycache) + VOID(init_key_cache(dflt_key_cache, param->key_cache_block_size, + param->use_buffers, 0, 0)); + + if (init_io_cache(¶m->read_cache,info->dfile, + (uint) param->read_buffer_length, + READ_CACHE,share->pack.header_length,1,MYF(MY_WME))) + { + bzero(&info->rec_cache,sizeof(info->rec_cache)); + goto err; + } + if (!rep_quick) + if (init_io_cache(&info->rec_cache,-1,(uint) param->write_buffer_length, + WRITE_CACHE, new_header_length, 1, + MYF(MY_WME | MY_WAIT_IF_FULL))) + goto err; + info->opt_flag|=WRITE_CACHE_USED; + if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength, + MYF(0))) || + !mi_alloc_rec_buff(info, -1, &sort_param.rec_buff)) + { + mi_check_print_error(param, "Not enough memory for extra record"); + goto err; + } + + if (!rep_quick) + { + /* Get real path for data file */ + if ((new_file=my_raid_create(fn_format(param->temp_filename, + share->data_file_name, "", + DATA_TMP_EXT, 2+4), + 0,param->tmpfile_createflag, + share->base.raid_type, + share->base.raid_chunks, + share->base.raid_chunksize, + MYF(0))) < 0) + { + mi_check_print_error(param,"Can't create new tempfile: '%s'", + param->temp_filename); + goto err; + } + if (new_header_length && + filecopy(param,new_file,info->dfile,0L,new_header_length, + "datafile-header")) + goto err; + info->s->state.dellink= HA_OFFSET_ERROR; + info->rec_cache.file=new_file; + if (param->testflag & T_UNPACK) + { + share->options&= ~HA_OPTION_COMPRESS_RECORD; + mi_int2store(share->state.header.options,share->options); + } + } + sort_info.info=info; + sort_info.param = param; + sort_param.read_cache=param->read_cache; + sort_param.pos=sort_param.max_pos=share->pack.header_length; + sort_param.filepos=new_header_length; + param->read_cache.end_of_file=sort_info.filelength= + my_seek(info->dfile,0L,MY_SEEK_END,MYF(0)); + sort_info.dupp=0; + sort_param.fix_datafile= (my_bool) (! rep_quick); + sort_param.master=1; + sort_info.max_records= ~(ha_rows) 0; + + set_data_file_type(&sort_info, share); + del=info->state->del; + info->state->records=info->state->del=share->state.split=0; + info->state->empty=0; + param->glob_crc=0; + if (param->testflag & T_CALC_CHECKSUM) + sort_param.calc_checksum= 1; + + info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + + /* + Clear all keys. Note that all key blocks allocated until now remain + "dead" parts of the key file. (Bug #4692) + */ + for (i=0 ; i < info->s->base.keys ; i++) + share->state.key_root[i]= HA_OFFSET_ERROR; + + /* Drop the delete chain. */ + for (i=0 ; i < share->state.header.max_block_size_index ; i++) + share->state.key_del[i]= HA_OFFSET_ERROR; + + /* + If requested, activate (enable) all keys in key_map. In this case, + all indexes will be (re-)built. + */ + if (param->testflag & T_CREATE_MISSING_KEYS) + mi_set_all_keys_active(share->state.key_map, share->base.keys); + + info->state->key_file_length=share->base.keystart; + + lock_memory(param); /* Everything is alloced */ + + /* Re-create all keys, which are set in key_map. */ + while (!(error=sort_get_next_record(&sort_param))) + { + if (writekeys(&sort_param)) + { + if (my_errno != HA_ERR_FOUND_DUPP_KEY) + goto err; + DBUG_DUMP("record",(uchar*) sort_param.record,share->base.pack_reclength); + mi_check_print_info(param,"Duplicate key %2d for record at %10s against new record at %10s", + info->errkey+1, + llstr(sort_param.start_recpos,llbuff), + llstr(info->dupp_key_pos,llbuff2)); + if (param->testflag & T_VERBOSE) + { + VOID(_mi_make_key(info,(uint) info->errkey,info->lastkey, + sort_param.record,0L)); + _mi_print_key(stdout,share->keyinfo[info->errkey].seg,info->lastkey, + USE_WHOLE_KEY); + } + sort_info.dupp++; + if ((param->testflag & (T_FORCE_UNIQUENESS|T_QUICK)) == T_QUICK) + { + param->testflag|=T_RETRY_WITHOUT_QUICK; + param->error_printed=1; + goto err; + } + continue; + } + if (sort_write_record(&sort_param)) + goto err; + } + if (error > 0 || write_data_suffix(&sort_info, (my_bool)!rep_quick) || + flush_io_cache(&info->rec_cache) || param->read_cache.error < 0) + goto err; + + if (param->testflag & T_WRITE_LOOP) + { + VOID(fputs(" \r",stdout)); VOID(fflush(stdout)); + } + if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0))) + { + mi_check_print_warning(param, + "Can't change size of indexfile, error: %d", + my_errno); + goto err; + } + + if (rep_quick && del+sort_info.dupp != info->state->del) + { + mi_check_print_error(param,"Couldn't fix table with quick recovery: Found wrong number of deleted records"); + mi_check_print_error(param,"Run recovery again without -q"); + got_error=1; + param->retry_repair=1; + param->testflag|=T_RETRY_WITHOUT_QUICK; + goto err; + } + if (param->testflag & T_SAFE_REPAIR) + { + /* Don't repair if we loosed more than one row */ + if (info->state->records+1 < start_records) + { + info->state->records=start_records; + got_error=1; + goto err; + } + } + + if (!rep_quick) + { + my_close(info->dfile,MYF(0)); + info->dfile=new_file; + info->state->data_file_length=sort_param.filepos; + share->state.version=(ulong) time((time_t*) 0); /* Force reopen */ + } + else + { + info->state->data_file_length=sort_param.max_pos; + } + if (param->testflag & T_CALC_CHECKSUM) + info->state->checksum=param->glob_crc; + + if (!(param->testflag & T_SILENT)) + { + if (start_records != info->state->records) + printf("Data records: %s\n", llstr(info->state->records,llbuff)); + if (sort_info.dupp) + mi_check_print_warning(param, + "%s records have been removed", + llstr(sort_info.dupp,llbuff)); + } + + got_error=0; + /* If invoked by external program that uses thr_lock */ + if (&share->state.state != info->state) + memcpy( &share->state.state, info->state, sizeof(*info->state)); + +err: + if (!got_error) + { + /* Replace the actual file with the temporary file */ + if (new_file >= 0) + { + my_close(new_file,MYF(0)); + info->dfile=new_file= -1; + if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, + DATA_TMP_EXT, share->base.raid_chunks, + (param->testflag & T_BACKUP_DATA ? + MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) || + mi_open_datafile(info,share,-1)) + got_error=1; + } + } + if (got_error) + { + if (! param->error_printed) + mi_check_print_error(param,"%d for record at pos %s",my_errno, + llstr(sort_param.start_recpos,llbuff)); + if (new_file >= 0) + { + VOID(my_close(new_file,MYF(0))); + VOID(my_raid_delete(param->temp_filename,info->s->base.raid_chunks, + MYF(MY_WME))); + info->rec_cache.file=-1; /* don't flush data to new_file, it's closed */ + } + mi_mark_crashed_on_repair(info); + } + my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff), + MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + VOID(end_io_cache(¶m->read_cache)); + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + VOID(end_io_cache(&info->rec_cache)); + got_error|=flush_blocks(param, share->key_cache, share->kfile); + if (!got_error && param->testflag & T_UNPACK) + { + share->state.header.options[0]&= (uchar) ~HA_OPTION_COMPRESS_RECORD; + share->pack.header_length=0; + share->data_file_type=sort_info.new_data_file_type; + } + share->state.changed|= (STATE_NOT_OPTIMIZED_KEYS | STATE_NOT_SORTED_PAGES | + STATE_NOT_ANALYZED); + DBUG_RETURN(got_error); +} + + +/* Uppate keyfile when doing repair */ + +static int writekeys(MI_SORT_PARAM *sort_param) +{ + register uint i; + uchar *key; + MI_INFO *info= sort_param->sort_info->info; + uchar *buff= sort_param->record; + my_off_t filepos= sort_param->filepos; + DBUG_ENTER("writekeys"); + + key=info->lastkey+info->s->base.max_key_length; + for (i=0 ; i < info->s->base.keys ; i++) + { + if (mi_is_key_active(info->s->state.key_map, i)) + { + if (info->s->keyinfo[i].flag & HA_FULLTEXT ) + { + if (_mi_ft_add(info, i, key, buff, filepos)) + goto err; + } +#ifdef HAVE_SPATIAL + else if (info->s->keyinfo[i].flag & HA_SPATIAL) + { + uint key_length=_mi_make_key(info,i,key,buff,filepos); + if (rtree_insert(info, i, key, key_length)) + goto err; + } +#endif /*HAVE_SPATIAL*/ + else + { + uint key_length=_mi_make_key(info,i,key,buff,filepos); + if (_mi_ck_write(info,i,key,key_length)) + goto err; + } + } + } + DBUG_RETURN(0); + + err: + if (my_errno == HA_ERR_FOUND_DUPP_KEY) + { + info->errkey=(int) i; /* This key was found */ + while ( i-- > 0 ) + { + if (mi_is_key_active(info->s->state.key_map, i)) + { + if (info->s->keyinfo[i].flag & HA_FULLTEXT) + { + if (_mi_ft_del(info,i, key,buff,filepos)) + break; + } + else + { + uint key_length=_mi_make_key(info,i,key,buff,filepos); + if (_mi_ck_delete(info,i,key,key_length)) + break; + } + } + } + } + /* Remove checksum that was added to glob_crc in sort_get_next_record */ + if (sort_param->calc_checksum) + sort_param->sort_info->param->glob_crc-= info->checksum; + DBUG_PRINT("error",("errno: %d",my_errno)); + DBUG_RETURN(-1); +} /* writekeys */ + + + /* Change all key-pointers that points to a records */ + +int movepoint(register MI_INFO *info, uchar *record, my_off_t oldpos, + my_off_t newpos, uint prot_key) +{ + register uint i; + uchar *key; + uint key_length; + DBUG_ENTER("movepoint"); + + key=info->lastkey+info->s->base.max_key_length; + for (i=0 ; i < info->s->base.keys; i++) + { + if (i != prot_key && mi_is_key_active(info->s->state.key_map, i)) + { + key_length=_mi_make_key(info,i,key,record,oldpos); + if (info->s->keyinfo[i].flag & HA_NOSAME) + { /* Change pointer direct */ + uint nod_flag; + MI_KEYDEF *keyinfo; + keyinfo=info->s->keyinfo+i; + if (_mi_search(info,keyinfo,key,USE_WHOLE_KEY, + (uint) (SEARCH_SAME | SEARCH_SAVE_BUFF), + info->s->state.key_root[i])) + DBUG_RETURN(-1); + nod_flag=mi_test_if_nod(info->buff); + _mi_dpointer(info,info->int_keypos-nod_flag- + info->s->rec_reflength,newpos); + if (_mi_write_keypage(info,keyinfo,info->last_keypage, + DFLT_INIT_HITS,info->buff)) + DBUG_RETURN(-1); + } + else + { /* Change old key to new */ + if (_mi_ck_delete(info,i,key,key_length)) + DBUG_RETURN(-1); + key_length=_mi_make_key(info,i,key,record,newpos); + if (_mi_ck_write(info,i,key,key_length)) + DBUG_RETURN(-1); + } + } + } + DBUG_RETURN(0); +} /* movepoint */ + + + /* Tell system that we want all memory for our cache */ + +void lock_memory(MI_CHECK *param __attribute__((unused))) +{ +#ifdef SUN_OS /* Key-cacheing thrases on sun 4.1 */ + if (param->opt_lock_memory) + { + int success = mlockall(MCL_CURRENT); /* or plock(DATLOCK); */ + if (geteuid() == 0 && success != 0) + mi_check_print_warning(param, + "Failed to lock memory. errno %d",my_errno); + } +#endif +} /* lock_memory */ + + + /* Flush all changed blocks to disk */ + +int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file) +{ + if (flush_key_blocks(key_cache, file, FLUSH_RELEASE)) + { + mi_check_print_error(param,"%d when trying to write bufferts",my_errno); + return(1); + } + if (!param->using_global_keycache) + end_key_cache(key_cache,1); + return 0; +} /* flush_blocks */ + + + /* Sort index for more efficent reads */ + +int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name) +{ + reg2 uint key; + reg1 MI_KEYDEF *keyinfo; + File new_file; + my_off_t index_pos[MI_MAX_POSSIBLE_KEY]; + uint r_locks,w_locks; + int old_lock; + MYISAM_SHARE *share=info->s; + MI_STATE_INFO old_state; + DBUG_ENTER("mi_sort_index"); + + /* cannot sort index files with R-tree indexes */ + for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ; + key++,keyinfo++) + if (keyinfo->key_alg == HA_KEY_ALG_RTREE) + DBUG_RETURN(0); + + if (!(param->testflag & T_SILENT)) + printf("- Sorting index for MyISAM-table '%s'\n",name); + + /* Get real path for index file */ + fn_format(param->temp_filename,name,"", MI_NAME_IEXT,2+4+32); + if ((new_file=my_create(fn_format(param->temp_filename,param->temp_filename, + "", INDEX_TMP_EXT,2+4), + 0,param->tmpfile_createflag,MYF(0))) <= 0) + { + mi_check_print_error(param,"Can't create new tempfile: '%s'", + param->temp_filename); + DBUG_RETURN(-1); + } + if (filecopy(param, new_file,share->kfile,0L, + (ulong) share->base.keystart, "headerblock")) + goto err; + + param->new_file_pos=share->base.keystart; + for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ; + key++,keyinfo++) + { + if (! mi_is_key_active(info->s->state.key_map, key)) + continue; + + if (share->state.key_root[key] != HA_OFFSET_ERROR) + { + index_pos[key]=param->new_file_pos; /* Write first block here */ + if (sort_one_index(param,info,keyinfo,share->state.key_root[key], + new_file)) + goto err; + } + else + index_pos[key]= HA_OFFSET_ERROR; /* No blocks */ + } + + /* Flush key cache for this file if we are calling this outside myisamchk */ + flush_key_blocks(share->key_cache,share->kfile, FLUSH_IGNORE_CHANGED); + + share->state.version=(ulong) time((time_t*) 0); + old_state= share->state; /* save state if not stored */ + r_locks= share->r_locks; + w_locks= share->w_locks; + old_lock= info->lock_type; + + /* Put same locks as old file */ + share->r_locks= share->w_locks= share->tot_locks= 0; + (void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE); + VOID(my_close(share->kfile,MYF(MY_WME))); + share->kfile = -1; + VOID(my_close(new_file,MYF(MY_WME))); + if (change_to_newfile(share->index_file_name,MI_NAME_IEXT,INDEX_TMP_EXT,0, + MYF(0)) || + mi_open_keyfile(share)) + goto err2; + info->lock_type= F_UNLCK; /* Force mi_readinfo to lock */ + _mi_readinfo(info,F_WRLCK,0); /* Will lock the table */ + info->lock_type= old_lock; + share->r_locks= r_locks; + share->w_locks= w_locks; + share->tot_locks= r_locks+w_locks; + share->state= old_state; /* Restore old state */ + + info->state->key_file_length=param->new_file_pos; + info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + for (key=0 ; key < info->s->base.keys ; key++) + info->s->state.key_root[key]=index_pos[key]; + for (key=0 ; key < info->s->state.header.max_block_size_index ; key++) + info->s->state.key_del[key]= HA_OFFSET_ERROR; + + info->s->state.changed&= ~STATE_NOT_SORTED_PAGES; + DBUG_RETURN(0); + +err: + VOID(my_close(new_file,MYF(MY_WME))); +err2: + VOID(my_delete(param->temp_filename,MYF(MY_WME))); + DBUG_RETURN(-1); +} /* mi_sort_index */ + + + /* Sort records recursive using one index */ + +static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, + my_off_t pagepos, File new_file) +{ + uint length,nod_flag,used_length, key_length; + uchar *buff,*keypos,*endpos; + uchar key[MI_MAX_POSSIBLE_KEY_BUFF]; + my_off_t new_page_pos,next_page; + char llbuff[22]; + DBUG_ENTER("sort_one_index"); + + /* cannot walk over R-tree indices */ + DBUG_ASSERT(keyinfo->key_alg != HA_KEY_ALG_RTREE); + new_page_pos=param->new_file_pos; + param->new_file_pos+=keyinfo->block_length; + + if (!(buff=(uchar*) my_alloca((uint) keyinfo->block_length))) + { + mi_check_print_error(param,"Not enough memory for key block"); + DBUG_RETURN(-1); + } + if (!_mi_fetch_keypage(info,keyinfo,pagepos,DFLT_INIT_HITS,buff,0)) + { + mi_check_print_error(param,"Can't read key block from filepos: %s", + llstr(pagepos,llbuff)); + goto err; + } + if ((nod_flag=mi_test_if_nod(buff)) || keyinfo->flag & HA_FULLTEXT) + { + used_length=mi_getint(buff); + keypos=buff+2+nod_flag; + endpos=buff+used_length; + for ( ;; ) + { + if (nod_flag) + { + next_page=_mi_kpos(nod_flag,keypos); + _mi_kpointer(info,keypos-nod_flag,param->new_file_pos); /* Save new pos */ + if (sort_one_index(param,info,keyinfo,next_page,new_file)) + { + DBUG_PRINT("error", + ("From page: %ld, keyoffset: %lu used_length: %d", + (ulong) pagepos, (ulong) (keypos - buff), + (int) used_length)); + DBUG_DUMP("buff",(uchar*) buff,used_length); + goto err; + } + } + if (keypos >= endpos || + (key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,key)) == 0) + break; + DBUG_ASSERT(keypos <= endpos); + if (keyinfo->flag & HA_FULLTEXT) + { + uint off; + int subkeys; + get_key_full_length_rdonly(off, key); + subkeys=ft_sintXkorr(key+off); + if (subkeys < 0) + { + next_page= _mi_dpos(info,0,key+key_length); + _mi_dpointer(info,keypos-nod_flag-info->s->rec_reflength, + param->new_file_pos); /* Save new pos */ + if (sort_one_index(param,info,&info->s->ft2_keyinfo, + next_page,new_file)) + goto err; + } + } + } + } + + /* Fill block with zero and write it to the new index file */ + length=mi_getint(buff); + bzero((uchar*) buff+length,keyinfo->block_length-length); + if (my_pwrite(new_file,(uchar*) buff,(uint) keyinfo->block_length, + new_page_pos,MYF(MY_NABP | MY_WAIT_IF_FULL))) + { + mi_check_print_error(param,"Can't write indexblock, error: %d",my_errno); + goto err; + } + my_afree((uchar*) buff); + DBUG_RETURN(0); +err: + my_afree((uchar*) buff); + DBUG_RETURN(1); +} /* sort_one_index */ + + + /* + Let temporary file replace old file. + This assumes that the new file was created in the same + directory as given by realpath(filename). + This will ensure that any symlinks that are used will still work. + Copy stats from old file to new file, deletes orignal and + changes new file name to old file name + */ + +int change_to_newfile(const char * filename, const char * old_ext, + const char * new_ext, + uint raid_chunks __attribute__((unused)), + myf MyFlags) +{ + char old_filename[FN_REFLEN],new_filename[FN_REFLEN]; +#ifdef USE_RAID + if (raid_chunks) + return my_raid_redel(fn_format(old_filename,filename,"",old_ext,2+4), + fn_format(new_filename,filename,"",new_ext,2+4), + raid_chunks, + MYF(MY_WME | MY_LINK_WARNING | MyFlags)); +#endif + /* Get real path to filename */ + (void) fn_format(old_filename,filename,"",old_ext,2+4+32); + return my_redel(old_filename, + fn_format(new_filename,old_filename,"",new_ext,2+4), + MYF(MY_WME | MY_LINK_WARNING | MyFlags)); +} /* change_to_newfile */ + + + /* Locks a whole file */ + /* Gives an error-message if file can't be locked */ + +int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type, + const char *filetype, const char *filename) +{ + if (my_lock(file,lock_type,start,F_TO_EOF, + param->testflag & T_WAIT_FOREVER ? MYF(MY_SEEK_NOT_DONE) : + MYF(MY_SEEK_NOT_DONE | MY_DONT_WAIT))) + { + mi_check_print_error(param," %d when locking %s '%s'",my_errno,filetype,filename); + param->error_printed=2; /* Don't give that data is crashed */ + return 1; + } + return 0; +} /* lock_file */ + + + /* Copy a block between two files */ + +int filecopy(MI_CHECK *param, File to,File from,my_off_t start, + my_off_t length, const char *type) +{ + char tmp_buff[IO_SIZE],*buff; + ulong buff_length; + DBUG_ENTER("filecopy"); + + buff_length=(ulong) min(param->write_buffer_length,length); + if (!(buff=my_malloc(buff_length,MYF(0)))) + { + buff=tmp_buff; buff_length=IO_SIZE; + } + + VOID(my_seek(from,start,MY_SEEK_SET,MYF(0))); + while (length > buff_length) + { + if (my_read(from,(uchar*) buff,buff_length,MYF(MY_NABP)) || + my_write(to,(uchar*) buff,buff_length,param->myf_rw)) + goto err; + length-= buff_length; + } + if (my_read(from,(uchar*) buff,(uint) length,MYF(MY_NABP)) || + my_write(to,(uchar*) buff,(uint) length,param->myf_rw)) + goto err; + if (buff != tmp_buff) + my_free(buff,MYF(0)); + DBUG_RETURN(0); +err: + if (buff != tmp_buff) + my_free(buff,MYF(0)); + mi_check_print_error(param,"Can't copy %s to tempfile, error %d", + type,my_errno); + DBUG_RETURN(1); +} + + +/* + Repair table or given index using sorting + + SYNOPSIS + mi_repair_by_sort() + param Repair parameters + info MyISAM handler to repair + name Name of table (for warnings) + rep_quick set to <> 0 if we should not change data file + + RESULT + 0 ok + <>0 Error +*/ + +int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, + const char * name, int rep_quick) +{ + int got_error; + uint i; + ulong length; + ha_rows start_records; + my_off_t new_header_length,del; + File new_file; + MI_SORT_PARAM sort_param; + MYISAM_SHARE *share=info->s; + HA_KEYSEG *keyseg; + ulong *rec_per_key_part; + char llbuff[22]; + SORT_INFO sort_info; + ulonglong key_map=share->state.key_map; + DBUG_ENTER("mi_repair_by_sort"); + + start_records=info->state->records; + got_error=1; + new_file= -1; + new_header_length=(param->testflag & T_UNPACK) ? 0 : + share->pack.header_length; + if (!(param->testflag & T_SILENT)) + { + printf("- recovering (with sort) MyISAM-table '%s'\n",name); + printf("Data records: %s\n", llstr(start_records,llbuff)); + } + param->testflag|=T_REP; /* for easy checking */ + + if (info->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)) + param->testflag|=T_CALC_CHECKSUM; + + bzero((char*)&sort_info,sizeof(sort_info)); + bzero((char *)&sort_param, sizeof(sort_param)); + if (!(sort_info.key_block= + alloc_key_blocks(param, + (uint) param->sort_key_blocks, + share->base.max_key_block_length)) + || init_io_cache(¶m->read_cache,info->dfile, + (uint) param->read_buffer_length, + READ_CACHE,share->pack.header_length,1,MYF(MY_WME)) || + (! rep_quick && + init_io_cache(&info->rec_cache,info->dfile, + (uint) param->write_buffer_length, + WRITE_CACHE,new_header_length,1, + MYF(MY_WME | MY_WAIT_IF_FULL) & param->myf_rw))) + goto err; + sort_info.key_block_end=sort_info.key_block+param->sort_key_blocks; + info->opt_flag|=WRITE_CACHE_USED; + info->rec_cache.file=info->dfile; /* for sort_delete_record */ + + if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength, + MYF(0))) || + !mi_alloc_rec_buff(info, -1, &sort_param.rec_buff)) + { + mi_check_print_error(param, "Not enough memory for extra record"); + goto err; + } + if (!rep_quick) + { + /* Get real path for data file */ + if ((new_file=my_raid_create(fn_format(param->temp_filename, + share->data_file_name, "", + DATA_TMP_EXT, 2+4), + 0,param->tmpfile_createflag, + share->base.raid_type, + share->base.raid_chunks, + share->base.raid_chunksize, + MYF(0))) < 0) + { + mi_check_print_error(param,"Can't create new tempfile: '%s'", + param->temp_filename); + goto err; + } + if (new_header_length && + filecopy(param, new_file,info->dfile,0L,new_header_length, + "datafile-header")) + goto err; + if (param->testflag & T_UNPACK) + { + share->options&= ~HA_OPTION_COMPRESS_RECORD; + mi_int2store(share->state.header.options,share->options); + } + share->state.dellink= HA_OFFSET_ERROR; + info->rec_cache.file=new_file; + } + + info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + if (!(param->testflag & T_CREATE_MISSING_KEYS)) + { + /* + Flush key cache for this file if we are calling this outside + myisamchk + */ + flush_key_blocks(share->key_cache,share->kfile, FLUSH_IGNORE_CHANGED); + /* Clear the pointers to the given rows */ + for (i=0 ; i < share->base.keys ; i++) + share->state.key_root[i]= HA_OFFSET_ERROR; + for (i=0 ; i < share->state.header.max_block_size_index ; i++) + share->state.key_del[i]= HA_OFFSET_ERROR; + info->state->key_file_length=share->base.keystart; + } + else + { + if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_FORCE_WRITE)) + goto err; + key_map= ~key_map; /* Create the missing keys */ + } + + sort_info.info=info; + sort_info.param = param; + + set_data_file_type(&sort_info, share); + sort_param.filepos=new_header_length; + sort_info.dupp=0; + sort_info.buff=0; + param->read_cache.end_of_file=sort_info.filelength= + my_seek(param->read_cache.file,0L,MY_SEEK_END,MYF(0)); + + sort_param.wordlist=NULL; + init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + + if (share->data_file_type == DYNAMIC_RECORD) + length=max(share->base.min_pack_length+1,share->base.min_block_length); + else if (share->data_file_type == COMPRESSED_RECORD) + length=share->base.min_block_length; + else + length=share->base.pack_reclength; + sort_info.max_records= + ((param->testflag & T_CREATE_MISSING_KEYS) ? info->state->records : + (ha_rows) (sort_info.filelength/length+1)); + sort_param.key_cmp=sort_key_cmp; + sort_param.lock_in_memory=lock_memory; + sort_param.tmpdir=param->tmpdir; + sort_param.sort_info=&sort_info; + sort_param.fix_datafile= (my_bool) (! rep_quick); + sort_param.master =1; + + del=info->state->del; + param->glob_crc=0; + if (param->testflag & T_CALC_CHECKSUM) + sort_param.calc_checksum= 1; + + rec_per_key_part= param->rec_per_key_part; + for (sort_param.key=0 ; sort_param.key < share->base.keys ; + rec_per_key_part+=sort_param.keyinfo->keysegs, sort_param.key++) + { + sort_param.read_cache=param->read_cache; + sort_param.keyinfo=share->keyinfo+sort_param.key; + sort_param.seg=sort_param.keyinfo->seg; + if (! mi_is_key_active(key_map, sort_param.key)) + { + /* Remember old statistics for key */ + memcpy((char*) rec_per_key_part, + (char*) (share->state.rec_per_key_part + + (uint) (rec_per_key_part - param->rec_per_key_part)), + sort_param.keyinfo->keysegs*sizeof(*rec_per_key_part)); + continue; + } + + if ((!(param->testflag & T_SILENT))) + printf ("- Fixing index %d\n",sort_param.key+1); + sort_param.max_pos=sort_param.pos=share->pack.header_length; + keyseg=sort_param.seg; + bzero((char*) sort_param.unique,sizeof(sort_param.unique)); + sort_param.key_length=share->rec_reflength; + for (i=0 ; keyseg[i].type != HA_KEYTYPE_END; i++) + { + sort_param.key_length+=keyseg[i].length; + if (keyseg[i].flag & HA_SPACE_PACK) + sort_param.key_length+=get_pack_length(keyseg[i].length); + if (keyseg[i].flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART)) + sort_param.key_length+=2 + test(keyseg[i].length >= 127); + if (keyseg[i].flag & HA_NULL_PART) + sort_param.key_length++; + } + info->state->records=info->state->del=share->state.split=0; + info->state->empty=0; + + if (sort_param.keyinfo->flag & HA_FULLTEXT) + { + uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* + sort_param.keyinfo->seg->charset->mbmaxlen; + sort_param.key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; + /* + fulltext indexes may have much more entries than the + number of rows in the table. We estimate the number here. + + Note, built-in parser is always nr. 0 - see ftparser_call_initializer() + */ + if (sort_param.keyinfo->ftparser_nr == 0) + { + /* + for built-in parser the number of generated index entries + cannot be larger than the size of the data file divided + by the minimal word's length + */ + sort_info.max_records= + (ha_rows) (sort_info.filelength/ft_min_word_len+1); + } + else + { + /* + for external plugin parser we cannot tell anything at all :( + so, we'll use all the sort memory and start from ~10 buffpeks. + (see _create_index_by_sort) + */ + sort_info.max_records= + 10*param->sort_buffer_length/sort_param.key_length; + } + + sort_param.key_read=sort_ft_key_read; + sort_param.key_write=sort_ft_key_write; + } + else + { + sort_param.key_read=sort_key_read; + sort_param.key_write=sort_key_write; + } + + if (_create_index_by_sort(&sort_param, + (my_bool) (!(param->testflag & T_VERBOSE)), + (uint) param->sort_buffer_length)) + { + param->retry_repair=1; + goto err; + } + /* No need to calculate checksum again. */ + sort_param.calc_checksum= 0; + free_root(&sort_param.wordroot, MYF(0)); + + /* Set for next loop */ + sort_info.max_records= (ha_rows) info->state->records; + + if (param->testflag & T_STATISTICS) + update_key_parts(sort_param.keyinfo, rec_per_key_part, sort_param.unique, + param->stats_method == MI_STATS_METHOD_IGNORE_NULLS? + sort_param.notnull: NULL,(ulonglong) info->state->records); + mi_set_key_active(share->state.key_map, sort_param.key); + + if (sort_param.fix_datafile) + { + param->read_cache.end_of_file=sort_param.filepos; + if (write_data_suffix(&sort_info,1) || end_io_cache(&info->rec_cache)) + goto err; + if (param->testflag & T_SAFE_REPAIR) + { + /* Don't repair if we loosed more than one row */ + if (info->state->records+1 < start_records) + { + info->state->records=start_records; + goto err; + } + } + share->state.state.data_file_length = info->state->data_file_length= + sort_param.filepos; + /* Only whole records */ + share->state.version=(ulong) time((time_t*) 0); + my_close(info->dfile,MYF(0)); + info->dfile=new_file; + share->data_file_type=sort_info.new_data_file_type; + share->pack.header_length=(ulong) new_header_length; + sort_param.fix_datafile=0; + } + else + info->state->data_file_length=sort_param.max_pos; + + param->read_cache.file=info->dfile; /* re-init read cache */ + reinit_io_cache(¶m->read_cache,READ_CACHE,share->pack.header_length, + 1,1); + } + + if (param->testflag & T_WRITE_LOOP) + { + VOID(fputs(" \r",stdout)); VOID(fflush(stdout)); + } + + if (rep_quick && del+sort_info.dupp != info->state->del) + { + mi_check_print_error(param,"Couldn't fix table with quick recovery: Found wrong number of deleted records"); + mi_check_print_error(param,"Run recovery again without -q"); + got_error=1; + param->retry_repair=1; + param->testflag|=T_RETRY_WITHOUT_QUICK; + goto err; + } + + if (rep_quick & T_FORCE_UNIQUENESS) + { + my_off_t skr=info->state->data_file_length+ + (share->options & HA_OPTION_COMPRESS_RECORD ? + MEMMAP_EXTRA_MARGIN : 0); +#ifdef USE_RELOC + if (share->data_file_type == STATIC_RECORD && + skr < share->base.reloc*share->base.min_pack_length) + skr=share->base.reloc*share->base.min_pack_length; +#endif + if (skr != sort_info.filelength && !info->s->base.raid_type) + if (my_chsize(info->dfile,skr,0,MYF(0))) + mi_check_print_warning(param, + "Can't change size of datafile, error: %d", + my_errno); + } + if (param->testflag & T_CALC_CHECKSUM) + info->state->checksum=param->glob_crc; + + if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0))) + mi_check_print_warning(param, + "Can't change size of indexfile, error: %d", + my_errno); + + if (!(param->testflag & T_SILENT)) + { + if (start_records != info->state->records) + printf("Data records: %s\n", llstr(info->state->records,llbuff)); + if (sort_info.dupp) + mi_check_print_warning(param, + "%s records have been removed", + llstr(sort_info.dupp,llbuff)); + } + got_error=0; + + if (&share->state.state != info->state) + memcpy( &share->state.state, info->state, sizeof(*info->state)); + +err: + got_error|= flush_blocks(param, share->key_cache, share->kfile); + VOID(end_io_cache(&info->rec_cache)); + if (!got_error) + { + /* Replace the actual file with the temporary file */ + if (new_file >= 0) + { + my_close(new_file,MYF(0)); + info->dfile=new_file= -1; + if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, + DATA_TMP_EXT, share->base.raid_chunks, + (param->testflag & T_BACKUP_DATA ? + MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) || + mi_open_datafile(info,share,-1)) + got_error=1; + } + } + if (got_error) + { + if (! param->error_printed) + mi_check_print_error(param,"%d when fixing table",my_errno); + if (new_file >= 0) + { + VOID(my_close(new_file,MYF(0))); + VOID(my_raid_delete(param->temp_filename,share->base.raid_chunks, + MYF(MY_WME))); + if (info->dfile == new_file) + info->dfile= -1; + } + mi_mark_crashed_on_repair(info); + } + else if (key_map == share->state.key_map) + share->state.changed&= ~STATE_NOT_OPTIMIZED_KEYS; + share->state.changed|=STATE_NOT_SORTED_PAGES; + + my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff), + MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR)); + my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR)); + my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + VOID(end_io_cache(¶m->read_cache)); + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + if (!got_error && (param->testflag & T_UNPACK)) + { + share->state.header.options[0]&= (uchar) ~HA_OPTION_COMPRESS_RECORD; + share->pack.header_length=0; + } + DBUG_RETURN(got_error); +} + +/* + Threaded repair of table using sorting + + SYNOPSIS + mi_repair_parallel() + param Repair parameters + info MyISAM handler to repair + name Name of table (for warnings) + rep_quick set to <> 0 if we should not change data file + + DESCRIPTION + Same as mi_repair_by_sort but do it multithreaded + Each key is handled by a separate thread. + TODO: make a number of threads a parameter + + In parallel repair we use one thread per index. There are two modes: + + Quick + + Only the indexes are rebuilt. All threads share a read buffer. + Every thread that needs fresh data in the buffer enters the shared + cache lock. The last thread joining the lock reads the buffer from + the data file and wakes all other threads. + + Non-quick + + The data file is rebuilt and all indexes are rebuilt to point to + the new record positions. One thread is the master thread. It + reads from the old data file and writes to the new data file. It + also creates one of the indexes. The other threads read from a + buffer which is filled by the master. If they need fresh data, + they enter the shared cache lock. If the masters write buffer is + full, it flushes it to the new data file and enters the shared + cache lock too. When all threads joined in the lock, the master + copies its write buffer to the read buffer for the other threads + and wakes them. + + RESULT + 0 ok + <>0 Error +*/ + +int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, + const char * name, int rep_quick) +{ +#ifndef THREAD + return mi_repair_by_sort(param, info, name, rep_quick); +#else + int got_error; + uint i,key, total_key_length, istep; + ulong rec_length; + ha_rows start_records; + my_off_t new_header_length,del; + File new_file; + MI_SORT_PARAM *sort_param=0; + MYISAM_SHARE *share=info->s; + ulong *rec_per_key_part; + HA_KEYSEG *keyseg; + char llbuff[22]; + IO_CACHE new_data_cache; /* For non-quick repair. */ + IO_CACHE_SHARE io_share; + SORT_INFO sort_info; + ulonglong key_map=share->state.key_map; + pthread_attr_t thr_attr; + DBUG_ENTER("mi_repair_parallel"); + + start_records=info->state->records; + got_error=1; + new_file= -1; + new_header_length=(param->testflag & T_UNPACK) ? 0 : + share->pack.header_length; + if (!(param->testflag & T_SILENT)) + { + printf("- parallel recovering (with sort) MyISAM-table '%s'\n",name); + printf("Data records: %s\n", llstr(start_records,llbuff)); + } + param->testflag|=T_REP; /* for easy checking */ + + if (info->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)) + param->testflag|=T_CALC_CHECKSUM; + + /* + Quick repair (not touching data file, rebuilding indexes): + { + Read cache is (MI_CHECK *param)->read_cache using info->dfile. + } + + Non-quick repair (rebuilding data file and indexes): + { + Master thread: + + Read cache is (MI_CHECK *param)->read_cache using info->dfile. + Write cache is (MI_INFO *info)->rec_cache using new_file. + + Slave threads: + + Read cache is new_data_cache synced to master rec_cache. + + The final assignment of the filedescriptor for rec_cache is done + after the cache creation. + + Don't check file size on new_data_cache, as the resulting file size + is not known yet. + + As rec_cache and new_data_cache are synced, write_buffer_length is + used for the read cache 'new_data_cache'. Both start at the same + position 'new_header_length'. + } + */ + DBUG_PRINT("info", ("is quick repair: %d", rep_quick)); + bzero((char*)&sort_info,sizeof(sort_info)); + /* Initialize pthread structures before goto err. */ + pthread_mutex_init(&sort_info.mutex, MY_MUTEX_INIT_FAST); + pthread_cond_init(&sort_info.cond, 0); + + if (!(sort_info.key_block= + alloc_key_blocks(param, (uint) param->sort_key_blocks, + share->base.max_key_block_length)) || + init_io_cache(¶m->read_cache, info->dfile, + (uint) param->read_buffer_length, + READ_CACHE, share->pack.header_length, 1, MYF(MY_WME)) || + (!rep_quick && + (init_io_cache(&info->rec_cache, info->dfile, + (uint) param->write_buffer_length, + WRITE_CACHE, new_header_length, 1, + MYF(MY_WME | MY_WAIT_IF_FULL) & param->myf_rw) || + init_io_cache(&new_data_cache, -1, + (uint) param->write_buffer_length, + READ_CACHE, new_header_length, 1, + MYF(MY_WME | MY_DONT_CHECK_FILESIZE))))) + goto err; + sort_info.key_block_end=sort_info.key_block+param->sort_key_blocks; + info->opt_flag|=WRITE_CACHE_USED; + info->rec_cache.file=info->dfile; /* for sort_delete_record */ + + if (!rep_quick) + { + /* Get real path for data file */ + if ((new_file=my_raid_create(fn_format(param->temp_filename, + share->data_file_name, "", + DATA_TMP_EXT, + 2+4), + 0,param->tmpfile_createflag, + share->base.raid_type, + share->base.raid_chunks, + share->base.raid_chunksize, + MYF(0))) < 0) + { + mi_check_print_error(param,"Can't create new tempfile: '%s'", + param->temp_filename); + goto err; + } + if (new_header_length && + filecopy(param, new_file,info->dfile,0L,new_header_length, + "datafile-header")) + goto err; + if (param->testflag & T_UNPACK) + { + share->options&= ~HA_OPTION_COMPRESS_RECORD; + mi_int2store(share->state.header.options,share->options); + } + share->state.dellink= HA_OFFSET_ERROR; + info->rec_cache.file=new_file; + } + + info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + if (!(param->testflag & T_CREATE_MISSING_KEYS)) + { + /* + Flush key cache for this file if we are calling this outside + myisamchk + */ + flush_key_blocks(share->key_cache,share->kfile, FLUSH_IGNORE_CHANGED); + /* Clear the pointers to the given rows */ + for (i=0 ; i < share->base.keys ; i++) + share->state.key_root[i]= HA_OFFSET_ERROR; + for (i=0 ; i < share->state.header.max_block_size_index ; i++) + share->state.key_del[i]= HA_OFFSET_ERROR; + info->state->key_file_length=share->base.keystart; + } + else + { + if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_FORCE_WRITE)) + goto err; + key_map= ~key_map; /* Create the missing keys */ + } + + sort_info.info=info; + sort_info.param = param; + + set_data_file_type(&sort_info, share); + sort_info.dupp=0; + sort_info.buff=0; + param->read_cache.end_of_file=sort_info.filelength= + my_seek(param->read_cache.file,0L,MY_SEEK_END,MYF(0)); + + if (share->data_file_type == DYNAMIC_RECORD) + rec_length=max(share->base.min_pack_length+1,share->base.min_block_length); + else if (share->data_file_type == COMPRESSED_RECORD) + rec_length=share->base.min_block_length; + else + rec_length=share->base.pack_reclength; + /* + +1 below is required hack for parallel repair mode. + The info->state->records value, that is compared later + to sort_info.max_records and cannot exceed it, is + increased in sort_key_write. In mi_repair_by_sort, sort_key_write + is called after sort_key_read, where the comparison is performed, + but in parallel mode master thread can call sort_key_write + before some other repair thread calls sort_key_read. + Furthermore I'm not even sure +1 would be enough. + May be sort_info.max_records shold be always set to max value in + parallel mode. + */ + sort_info.max_records= + ((param->testflag & T_CREATE_MISSING_KEYS) ? info->state->records + 1: + (ha_rows) (sort_info.filelength/rec_length+1)); + + del=info->state->del; + param->glob_crc=0; + + if (!(sort_param=(MI_SORT_PARAM *) + my_malloc((uint) share->base.keys * + (sizeof(MI_SORT_PARAM) + share->base.pack_reclength), + MYF(MY_ZEROFILL)))) + { + mi_check_print_error(param,"Not enough memory for key!"); + goto err; + } + total_key_length=0; + rec_per_key_part= param->rec_per_key_part; + info->state->records=info->state->del=share->state.split=0; + info->state->empty=0; + + for (i=key=0, istep=1 ; key < share->base.keys ; + rec_per_key_part+=sort_param[i].keyinfo->keysegs, i+=istep, key++) + { + sort_param[i].key=key; + sort_param[i].keyinfo=share->keyinfo+key; + sort_param[i].seg=sort_param[i].keyinfo->seg; + if (! mi_is_key_active(key_map, key)) + { + /* Remember old statistics for key */ + memcpy((char*) rec_per_key_part, + (char*) (share->state.rec_per_key_part+ + (uint) (rec_per_key_part - param->rec_per_key_part)), + sort_param[i].keyinfo->keysegs*sizeof(*rec_per_key_part)); + istep=0; + continue; + } + istep=1; + if ((!(param->testflag & T_SILENT))) + printf ("- Fixing index %d\n",key+1); + if (sort_param[i].keyinfo->flag & HA_FULLTEXT) + { + sort_param[i].key_read=sort_ft_key_read; + sort_param[i].key_write=sort_ft_key_write; + } + else + { + sort_param[i].key_read=sort_key_read; + sort_param[i].key_write=sort_key_write; + } + sort_param[i].key_cmp=sort_key_cmp; + sort_param[i].lock_in_memory=lock_memory; + sort_param[i].tmpdir=param->tmpdir; + sort_param[i].sort_info=&sort_info; + sort_param[i].master=0; + sort_param[i].fix_datafile=0; + sort_param[i].calc_checksum= 0; + + sort_param[i].filepos=new_header_length; + sort_param[i].max_pos=sort_param[i].pos=share->pack.header_length; + + sort_param[i].record= (((uchar *)(sort_param+share->base.keys))+ + (share->base.pack_reclength * i)); + if (!mi_alloc_rec_buff(info, -1, &sort_param[i].rec_buff)) + { + mi_check_print_error(param,"Not enough memory!"); + goto err; + } + + sort_param[i].key_length=share->rec_reflength; + for (keyseg=sort_param[i].seg; keyseg->type != HA_KEYTYPE_END; + keyseg++) + { + sort_param[i].key_length+=keyseg->length; + if (keyseg->flag & HA_SPACE_PACK) + sort_param[i].key_length+=get_pack_length(keyseg->length); + if (keyseg->flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART)) + sort_param[i].key_length+=2 + test(keyseg->length >= 127); + if (keyseg->flag & HA_NULL_PART) + sort_param[i].key_length++; + } + total_key_length+=sort_param[i].key_length; + + if (sort_param[i].keyinfo->flag & HA_FULLTEXT) + { + uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* + sort_param[i].keyinfo->seg->charset->mbmaxlen; + sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; + init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + } + } + sort_info.total_keys=i; + sort_param[0].master= 1; + sort_param[0].fix_datafile= (my_bool)(! rep_quick); + sort_param[0].calc_checksum= test(param->testflag & T_CALC_CHECKSUM); + + sort_info.got_error=0; + pthread_mutex_lock(&sort_info.mutex); + + /* + Initialize the I/O cache share for use with the read caches and, in + case of non-quick repair, the write cache. When all threads join on + the cache lock, the writer copies the write cache contents to the + read caches. + */ + if (i > 1) + { + if (rep_quick) + init_io_cache_share(¶m->read_cache, &io_share, NULL, i); + else + init_io_cache_share(&new_data_cache, &io_share, &info->rec_cache, i); + } + else + io_share.total_threads= 0; /* share not used */ + + (void) pthread_attr_init(&thr_attr); + (void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED); + + for (i=0 ; i < sort_info.total_keys ; i++) + { + /* + Copy the properly initialized IO_CACHE structure so that every + thread has its own copy. In quick mode param->read_cache is shared + for use by all threads. In non-quick mode all threads but the + first copy the shared new_data_cache, which is synchronized to the + write cache of the first thread. The first thread copies + param->read_cache, which is not shared. + */ + sort_param[i].read_cache= ((rep_quick || !i) ? param->read_cache : + new_data_cache); + DBUG_PRINT("io_cache_share", ("thread: %u read_cache: 0x%lx", + i, (long) &sort_param[i].read_cache)); + + /* + two approaches: the same amount of memory for each thread + or the memory for the same number of keys for each thread... + In the second one all the threads will fill their sort_buffers + (and call write_keys) at the same time, putting more stress on i/o. + */ + sort_param[i].sortbuff_size= +#ifndef USING_SECOND_APPROACH + param->sort_buffer_length/sort_info.total_keys; +#else + param->sort_buffer_length*sort_param[i].key_length/total_key_length; +#endif + if (pthread_create(&sort_param[i].thr, &thr_attr, + thr_find_all_keys, + (void *) (sort_param+i))) + { + mi_check_print_error(param,"Cannot start a repair thread"); + /* Cleanup: Detach from the share. Avoid others to be blocked. */ + if (io_share.total_threads) + remove_io_thread(&sort_param[i].read_cache); + DBUG_PRINT("error", ("Cannot start a repair thread")); + sort_info.got_error=1; + } + else + sort_info.threads_running++; + } + (void) pthread_attr_destroy(&thr_attr); + + /* waiting for all threads to finish */ + while (sort_info.threads_running) + pthread_cond_wait(&sort_info.cond, &sort_info.mutex); + pthread_mutex_unlock(&sort_info.mutex); + + if ((got_error= thr_write_keys(sort_param))) + { + param->retry_repair=1; + goto err; + } + got_error=1; /* Assume the following may go wrong */ + + if (sort_param[0].fix_datafile) + { + /* + Append some nuls to the end of a memory mapped file. Destroy the + write cache. The master thread did already detach from the share + by remove_io_thread() in sort.c:thr_find_all_keys(). + */ + if (write_data_suffix(&sort_info,1) || end_io_cache(&info->rec_cache)) + goto err; + if (param->testflag & T_SAFE_REPAIR) + { + /* Don't repair if we loosed more than one row */ + if (info->state->records+1 < start_records) + { + info->state->records=start_records; + goto err; + } + } + share->state.state.data_file_length= info->state->data_file_length= + sort_param->filepos; + /* Only whole records */ + share->state.version=(ulong) time((time_t*) 0); + + /* + Exchange the data file descriptor of the table, so that we use the + new file from now on. + */ + my_close(info->dfile,MYF(0)); + info->dfile=new_file; + + share->data_file_type=sort_info.new_data_file_type; + share->pack.header_length=(ulong) new_header_length; + } + else + info->state->data_file_length=sort_param->max_pos; + + if (rep_quick && del+sort_info.dupp != info->state->del) + { + mi_check_print_error(param,"Couldn't fix table with quick recovery: Found wrong number of deleted records"); + mi_check_print_error(param,"Run recovery again without -q"); + param->retry_repair=1; + param->testflag|=T_RETRY_WITHOUT_QUICK; + goto err; + } + + if (rep_quick & T_FORCE_UNIQUENESS) + { + my_off_t skr=info->state->data_file_length+ + (share->options & HA_OPTION_COMPRESS_RECORD ? + MEMMAP_EXTRA_MARGIN : 0); +#ifdef USE_RELOC + if (share->data_file_type == STATIC_RECORD && + skr < share->base.reloc*share->base.min_pack_length) + skr=share->base.reloc*share->base.min_pack_length; +#endif + if (skr != sort_info.filelength && !info->s->base.raid_type) + if (my_chsize(info->dfile,skr,0,MYF(0))) + mi_check_print_warning(param, + "Can't change size of datafile, error: %d", + my_errno); + } + if (param->testflag & T_CALC_CHECKSUM) + info->state->checksum=param->glob_crc; + + if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0))) + mi_check_print_warning(param, + "Can't change size of indexfile, error: %d", my_errno); + + if (!(param->testflag & T_SILENT)) + { + if (start_records != info->state->records) + printf("Data records: %s\n", llstr(info->state->records,llbuff)); + if (sort_info.dupp) + mi_check_print_warning(param, + "%s records have been removed", + llstr(sort_info.dupp,llbuff)); + } + got_error=0; + + if (&share->state.state != info->state) + memcpy(&share->state.state, info->state, sizeof(*info->state)); + +err: + got_error|= flush_blocks(param, share->key_cache, share->kfile); + /* + Destroy the write cache. The master thread did already detach from + the share by remove_io_thread() or it was not yet started (if the + error happend before creating the thread). + */ + VOID(end_io_cache(&info->rec_cache)); + /* + Destroy the new data cache in case of non-quick repair. All slave + threads did either detach from the share by remove_io_thread() + already or they were not yet started (if the error happend before + creating the threads). + */ + if (!rep_quick) + VOID(end_io_cache(&new_data_cache)); + if (!got_error) + { + /* Replace the actual file with the temporary file */ + if (new_file >= 0) + { + my_close(new_file,MYF(0)); + info->dfile=new_file= -1; + if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, + DATA_TMP_EXT, share->base.raid_chunks, + (param->testflag & T_BACKUP_DATA ? + MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) || + mi_open_datafile(info,share,-1)) + got_error=1; + } + } + if (got_error) + { + if (! param->error_printed) + mi_check_print_error(param,"%d when fixing table",my_errno); + if (new_file >= 0) + { + VOID(my_close(new_file,MYF(0))); + VOID(my_raid_delete(param->temp_filename,share->base.raid_chunks, + MYF(MY_WME))); + if (info->dfile == new_file) + info->dfile= -1; + } + mi_mark_crashed_on_repair(info); + } + else if (key_map == share->state.key_map) + share->state.changed&= ~STATE_NOT_OPTIMIZED_KEYS; + share->state.changed|=STATE_NOT_SORTED_PAGES; + + pthread_cond_destroy (&sort_info.cond); + pthread_mutex_destroy(&sort_info.mutex); + + my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR)); + my_free((uchar*) sort_param,MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + VOID(end_io_cache(¶m->read_cache)); + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + if (!got_error && (param->testflag & T_UNPACK)) + { + share->state.header.options[0]&= (uchar) ~HA_OPTION_COMPRESS_RECORD; + share->pack.header_length=0; + } + DBUG_RETURN(got_error); +#endif /* THREAD */ +} + + /* Read next record and return next key */ + +static int sort_key_read(MI_SORT_PARAM *sort_param, void *key) +{ + int error; + SORT_INFO *sort_info=sort_param->sort_info; + MI_INFO *info=sort_info->info; + DBUG_ENTER("sort_key_read"); + + if ((error=sort_get_next_record(sort_param))) + DBUG_RETURN(error); + if (info->state->records == sort_info->max_records) + { + mi_check_print_error(sort_info->param, + "Key %d - Found too many records; Can't continue", + sort_param->key+1); + DBUG_RETURN(1); + } + sort_param->real_key_length= + (info->s->rec_reflength+ + _mi_make_key(info, sort_param->key, (uchar*) key, + sort_param->record, sort_param->filepos)); +#ifdef HAVE_purify + bzero(key+sort_param->real_key_length, + (sort_param->key_length-sort_param->real_key_length)); +#endif + DBUG_RETURN(sort_write_record(sort_param)); +} /* sort_key_read */ + +static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key) +{ + int error; + SORT_INFO *sort_info=sort_param->sort_info; + MI_INFO *info=sort_info->info; + FT_WORD *wptr=0; + DBUG_ENTER("sort_ft_key_read"); + + if (!sort_param->wordlist) + { + for (;;) + { + free_root(&sort_param->wordroot, MYF(MY_MARK_BLOCKS_FREE)); + if ((error=sort_get_next_record(sort_param))) + DBUG_RETURN(error); + if (!(wptr=_mi_ft_parserecord(info,sort_param->key,sort_param->record, + &sort_param->wordroot))) + DBUG_RETURN(1); + if (wptr->pos) + break; + error=sort_write_record(sort_param); + } + sort_param->wordptr=sort_param->wordlist=wptr; + } + else + { + error=0; + wptr=(FT_WORD*)(sort_param->wordptr); + } + + sort_param->real_key_length=(info->s->rec_reflength+ + _ft_make_key(info, sort_param->key, + key, wptr++, sort_param->filepos)); +#ifdef HAVE_purify + if (sort_param->key_length > sort_param->real_key_length) + bzero(key+sort_param->real_key_length, + (sort_param->key_length-sort_param->real_key_length)); +#endif + if (!wptr->pos) + { + free_root(&sort_param->wordroot, MYF(MY_MARK_BLOCKS_FREE)); + sort_param->wordlist=0; + error=sort_write_record(sort_param); + } + else + sort_param->wordptr=(void*)wptr; + + DBUG_RETURN(error); +} /* sort_ft_key_read */ + + +/* + Read next record from file using parameters in sort_info. + + SYNOPSIS + sort_get_next_record() + sort_param Information about and for the sort process + + NOTE + + Dynamic Records With Non-Quick Parallel Repair + + For non-quick parallel repair we use a synchronized read/write + cache. This means that one thread is the master who fixes the data + file by reading each record from the old data file and writing it + to the new data file. By doing this the records in the new data + file are written contiguously. Whenever the write buffer is full, + it is copied to the read buffer. The slaves read from the read + buffer, which is not associated with a file. Thus read_cache.file + is -1. When using _mi_read_cache(), the slaves must always set + flag to READING_NEXT so that the function never tries to read from + file. This is safe because the records are contiguous. There is no + need to read outside the cache. This condition is evaluated in the + variable 'parallel_flag' for quick reference. read_cache.file must + be >= 0 in every other case. + + RETURN + -1 end of file + 0 ok + > 0 error +*/ + +static int sort_get_next_record(MI_SORT_PARAM *sort_param) +{ + int searching; + int parallel_flag; + uint found_record,b_type,left_length; + my_off_t pos; + uchar *to; + MI_BLOCK_INFO block_info; + SORT_INFO *sort_info=sort_param->sort_info; + MI_CHECK *param=sort_info->param; + MI_INFO *info=sort_info->info; + MYISAM_SHARE *share=info->s; + char llbuff[22],llbuff2[22]; + DBUG_ENTER("sort_get_next_record"); + + if (*killed_ptr(param)) + DBUG_RETURN(1); + + switch (share->data_file_type) { + case STATIC_RECORD: + for (;;) + { + if (my_b_read(&sort_param->read_cache,sort_param->record, + share->base.pack_reclength)) + { + if (sort_param->read_cache.error) + param->out_flag |= O_DATA_LOST; + param->retry_repair=1; + param->testflag|=T_RETRY_WITHOUT_QUICK; + DBUG_RETURN(-1); + } + sort_param->start_recpos=sort_param->pos; + if (!sort_param->fix_datafile) + { + sort_param->filepos=sort_param->pos; + if (sort_param->master) + share->state.split++; + } + sort_param->max_pos=(sort_param->pos+=share->base.pack_reclength); + if (*sort_param->record) + { + if (sort_param->calc_checksum) + param->glob_crc+= (info->checksum= + mi_static_checksum(info,sort_param->record)); + DBUG_RETURN(0); + } + if (!sort_param->fix_datafile && sort_param->master) + { + info->state->del++; + info->state->empty+=share->base.pack_reclength; + } + } + case DYNAMIC_RECORD: + LINT_INIT(to); + pos=sort_param->pos; + searching=(sort_param->fix_datafile && (param->testflag & T_EXTEND)); + parallel_flag= (sort_param->read_cache.file < 0) ? READING_NEXT : 0; + for (;;) + { + found_record=block_info.second_read= 0; + left_length=1; + if (searching) + { + pos=MY_ALIGN(pos,MI_DYN_ALIGN_SIZE); + param->testflag|=T_RETRY_WITHOUT_QUICK; + sort_param->start_recpos=pos; + } + do + { + if (pos > sort_param->max_pos) + sort_param->max_pos=pos; + if (pos & (MI_DYN_ALIGN_SIZE-1)) + { + if ((param->testflag & T_VERBOSE) || searching == 0) + mi_check_print_info(param,"Wrong aligned block at %s", + llstr(pos,llbuff)); + if (searching) + goto try_next; + } + if (found_record && pos == param->search_after_block) + mi_check_print_info(param,"Block: %s used by record at %s", + llstr(param->search_after_block,llbuff), + llstr(sort_param->start_recpos,llbuff2)); + if (_mi_read_cache(&sort_param->read_cache, + (uchar*) block_info.header,pos, + MI_BLOCK_INFO_HEADER_LENGTH, + (! found_record ? READING_NEXT : 0) | + parallel_flag | READING_HEADER)) + { + if (found_record) + { + mi_check_print_info(param, + "Can't read whole record at %s (errno: %d)", + llstr(sort_param->start_recpos,llbuff),errno); + goto try_next; + } + DBUG_RETURN(-1); + } + if (searching && ! sort_param->fix_datafile) + { + param->error_printed=1; + param->retry_repair=1; + param->testflag|=T_RETRY_WITHOUT_QUICK; + DBUG_RETURN(1); /* Something wrong with data */ + } + b_type=_mi_get_block_info(&block_info,-1,pos); + if ((b_type & (BLOCK_ERROR | BLOCK_FATAL_ERROR)) || + ((b_type & BLOCK_FIRST) && + (block_info.rec_len < (uint) share->base.min_pack_length || + block_info.rec_len > (uint) share->base.max_pack_length))) + { + uint i; + if (param->testflag & T_VERBOSE || searching == 0) + mi_check_print_info(param, + "Wrong bytesec: %3d-%3d-%3d at %10s; Skipped", + block_info.header[0],block_info.header[1], + block_info.header[2],llstr(pos,llbuff)); + if (found_record) + goto try_next; + block_info.second_read=0; + searching=1; + /* Search after block in read header string */ + for (i=MI_DYN_ALIGN_SIZE ; + i < MI_BLOCK_INFO_HEADER_LENGTH ; + i+= MI_DYN_ALIGN_SIZE) + if (block_info.header[i] >= 1 && + block_info.header[i] <= MI_MAX_DYN_HEADER_BYTE) + break; + pos+=(ulong) i; + sort_param->start_recpos=pos; + continue; + } + if (b_type & BLOCK_DELETED) + { + bool error=0; + if (block_info.block_len+ (uint) (block_info.filepos-pos) < + share->base.min_block_length) + { + if (!searching) + mi_check_print_info(param, + "Deleted block with impossible length %u at %s", + block_info.block_len,llstr(pos,llbuff)); + error=1; + } + else + { + if ((block_info.next_filepos != HA_OFFSET_ERROR && + block_info.next_filepos >= + info->state->data_file_length) || + (block_info.prev_filepos != HA_OFFSET_ERROR && + block_info.prev_filepos >= info->state->data_file_length)) + { + if (!searching) + mi_check_print_info(param, + "Delete link points outside datafile at %s", + llstr(pos,llbuff)); + error=1; + } + } + if (error) + { + if (found_record) + goto try_next; + searching=1; + pos+= MI_DYN_ALIGN_SIZE; + sort_param->start_recpos=pos; + block_info.second_read=0; + continue; + } + } + else + { + if (block_info.block_len+ (uint) (block_info.filepos-pos) < + share->base.min_block_length || + block_info.block_len > (uint) share->base.max_pack_length+ + MI_SPLIT_LENGTH) + { + if (!searching) + mi_check_print_info(param, + "Found block with impossible length %u at %s; Skipped", + block_info.block_len+ (uint) (block_info.filepos-pos), + llstr(pos,llbuff)); + if (found_record) + goto try_next; + searching=1; + pos+= MI_DYN_ALIGN_SIZE; + sort_param->start_recpos=pos; + block_info.second_read=0; + continue; + } + } + if (b_type & (BLOCK_DELETED | BLOCK_SYNC_ERROR)) + { + if (!sort_param->fix_datafile && sort_param->master && + (b_type & BLOCK_DELETED)) + { + info->state->empty+=block_info.block_len; + info->state->del++; + share->state.split++; + } + if (found_record) + goto try_next; + if (searching) + { + pos+=MI_DYN_ALIGN_SIZE; + sort_param->start_recpos=pos; + } + else + pos=block_info.filepos+block_info.block_len; + block_info.second_read=0; + continue; + } + + if (!sort_param->fix_datafile && sort_param->master) + share->state.split++; + if (! found_record++) + { + sort_param->find_length=left_length=block_info.rec_len; + sort_param->start_recpos=pos; + if (!sort_param->fix_datafile) + sort_param->filepos=sort_param->start_recpos; + if (sort_param->fix_datafile && (param->testflag & T_EXTEND)) + sort_param->pos=block_info.filepos+1; + else + sort_param->pos=block_info.filepos+block_info.block_len; + if (share->base.blobs) + { + if (!(to=mi_alloc_rec_buff(info,block_info.rec_len, + &(sort_param->rec_buff)))) + { + if (param->max_record_length >= block_info.rec_len) + { + mi_check_print_error(param,"Not enough memory for blob at %s (need %lu)", + llstr(sort_param->start_recpos,llbuff), + (ulong) block_info.rec_len); + DBUG_RETURN(1); + } + else + { + mi_check_print_info(param,"Not enough memory for blob at %s (need %lu); Row skipped", + llstr(sort_param->start_recpos,llbuff), + (ulong) block_info.rec_len); + goto try_next; + } + } + } + else + to= sort_param->rec_buff; + } + if (left_length < block_info.data_len || ! block_info.data_len) + { + mi_check_print_info(param, + "Found block with too small length at %s; Skipped", + llstr(sort_param->start_recpos,llbuff)); + goto try_next; + } + if (block_info.filepos + block_info.data_len > + sort_param->read_cache.end_of_file) + { + mi_check_print_info(param, + "Found block that points outside data file at %s", + llstr(sort_param->start_recpos,llbuff)); + goto try_next; + } + /* + Copy information that is already read. Avoid accessing data + below the cache start. This could happen if the header + streched over the end of the previous buffer contents. + */ + { + uint header_len= (uint) (block_info.filepos - pos); + uint prefetch_len= (MI_BLOCK_INFO_HEADER_LENGTH - header_len); + + if (prefetch_len > block_info.data_len) + prefetch_len= block_info.data_len; + if (prefetch_len) + { + memcpy(to, block_info.header + header_len, prefetch_len); + block_info.filepos+= prefetch_len; + block_info.data_len-= prefetch_len; + left_length-= prefetch_len; + to+= prefetch_len; + } + } + if (block_info.data_len && + _mi_read_cache(&sort_param->read_cache,to,block_info.filepos, + block_info.data_len, + (found_record == 1 ? READING_NEXT : 0) | + parallel_flag)) + { + mi_check_print_info(param, + "Read error for block at: %s (error: %d); Skipped", + llstr(block_info.filepos,llbuff),my_errno); + goto try_next; + } + left_length-=block_info.data_len; + to+=block_info.data_len; + pos=block_info.next_filepos; + if (pos == HA_OFFSET_ERROR && left_length) + { + mi_check_print_info(param,"Wrong block with wrong total length starting at %s", + llstr(sort_param->start_recpos,llbuff)); + goto try_next; + } + if (pos + MI_BLOCK_INFO_HEADER_LENGTH > sort_param->read_cache.end_of_file) + { + mi_check_print_info(param,"Found link that points at %s (outside data file) at %s", + llstr(pos,llbuff2), + llstr(sort_param->start_recpos,llbuff)); + goto try_next; + } + } while (left_length); + + if (_mi_rec_unpack(info,sort_param->record,sort_param->rec_buff, + sort_param->find_length) != MY_FILE_ERROR) + { + if (sort_param->read_cache.error < 0) + DBUG_RETURN(1); + if (sort_param->calc_checksum) + info->checksum= mi_checksum(info, sort_param->record); + if ((param->testflag & (T_EXTEND | T_REP)) || searching) + { + if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff, + sort_param->find_length, + (param->testflag & T_QUICK) && + sort_param->calc_checksum && + test(info->s->calc_checksum))) + { + mi_check_print_info(param,"Found wrong packed record at %s", + llstr(sort_param->start_recpos,llbuff)); + goto try_next; + } + } + if (sort_param->calc_checksum) + param->glob_crc+= info->checksum; + DBUG_RETURN(0); + } + if (!searching) + mi_check_print_info(param,"Key %d - Found wrong stored record at %s", + sort_param->key+1, + llstr(sort_param->start_recpos,llbuff)); + try_next: + pos=(sort_param->start_recpos+=MI_DYN_ALIGN_SIZE); + searching=1; + } + case COMPRESSED_RECORD: + for (searching=0 ;; searching=1, sort_param->pos++) + { + if (_mi_read_cache(&sort_param->read_cache,(uchar*) block_info.header, + sort_param->pos, + share->pack.ref_length,READING_NEXT)) + DBUG_RETURN(-1); + if (searching && ! sort_param->fix_datafile) + { + param->error_printed=1; + param->retry_repair=1; + param->testflag|=T_RETRY_WITHOUT_QUICK; + DBUG_RETURN(1); /* Something wrong with data */ + } + sort_param->start_recpos=sort_param->pos; + if (_mi_pack_get_block_info(info, &sort_param->bit_buff, &block_info, + &sort_param->rec_buff, -1, sort_param->pos)) + DBUG_RETURN(-1); + if (!block_info.rec_len && + sort_param->pos + MEMMAP_EXTRA_MARGIN == + sort_param->read_cache.end_of_file) + DBUG_RETURN(-1); + if (block_info.rec_len < (uint) share->min_pack_length || + block_info.rec_len > (uint) share->max_pack_length) + { + if (! searching) + mi_check_print_info(param,"Found block with wrong recordlength: %d at %s\n", + block_info.rec_len, + llstr(sort_param->pos,llbuff)); + continue; + } + if (_mi_read_cache(&sort_param->read_cache,(uchar*) sort_param->rec_buff, + block_info.filepos, block_info.rec_len, + READING_NEXT)) + { + if (! searching) + mi_check_print_info(param,"Couldn't read whole record from %s", + llstr(sort_param->pos,llbuff)); + continue; + } + if (_mi_pack_rec_unpack(info, &sort_param->bit_buff, sort_param->record, + sort_param->rec_buff, block_info.rec_len)) + { + if (! searching) + mi_check_print_info(param,"Found wrong record at %s", + llstr(sort_param->pos,llbuff)); + continue; + } + if (!sort_param->fix_datafile) + { + sort_param->filepos=sort_param->pos; + if (sort_param->master) + share->state.split++; + } + sort_param->max_pos=(sort_param->pos=block_info.filepos+ + block_info.rec_len); + info->packed_length=block_info.rec_len; + if (sort_param->calc_checksum) + param->glob_crc+= (info->checksum= + mi_checksum(info, sort_param->record)); + DBUG_RETURN(0); + } + } + DBUG_RETURN(1); /* Impossible */ +} + + +/* + Write record to new file. + + SYNOPSIS + sort_write_record() + sort_param Sort parameters. + + NOTE + This is only called by a master thread if parallel repair is used. + + RETURN + 0 OK + 1 Error +*/ + +int sort_write_record(MI_SORT_PARAM *sort_param) +{ + int flag; + uint length; + ulong block_length,reclength; + uchar *from; + uchar block_buff[8]; + SORT_INFO *sort_info=sort_param->sort_info; + MI_CHECK *param=sort_info->param; + MI_INFO *info=sort_info->info; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("sort_write_record"); + + if (sort_param->fix_datafile) + { + switch (sort_info->new_data_file_type) { + case STATIC_RECORD: + if (my_b_write(&info->rec_cache,sort_param->record, + share->base.pack_reclength)) + { + mi_check_print_error(param,"%d when writing to datafile",my_errno); + DBUG_RETURN(1); + } + sort_param->filepos+=share->base.pack_reclength; + info->s->state.split++; + /* sort_info->param->glob_crc+=mi_static_checksum(info, sort_param->record); */ + break; + case DYNAMIC_RECORD: + if (! info->blobs) + from=sort_param->rec_buff; + else + { + /* must be sure that local buffer is big enough */ + reclength=info->s->base.pack_reclength+ + _my_calc_total_blob_length(info,sort_param->record)+ + ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ + MI_DYN_DELETE_BLOCK_HEADER; + if (sort_info->buff_length < reclength) + { + if (!(sort_info->buff=my_realloc(sort_info->buff, (uint) reclength, + MYF(MY_FREE_ON_ERROR | + MY_ALLOW_ZERO_PTR)))) + DBUG_RETURN(1); + sort_info->buff_length=reclength; + } + from= sort_info->buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER); + } + /* We can use info->checksum here as only one thread calls this. */ + info->checksum=mi_checksum(info,sort_param->record); + reclength=_mi_rec_pack(info,from,sort_param->record); + flag=0; + /* sort_info->param->glob_crc+=info->checksum; */ + + do + { + block_length=reclength+ 3 + test(reclength >= (65520-3)); + if (block_length < share->base.min_block_length) + block_length=share->base.min_block_length; + info->update|=HA_STATE_WRITE_AT_END; + block_length=MY_ALIGN(block_length,MI_DYN_ALIGN_SIZE); + if (block_length > MI_MAX_BLOCK_LENGTH) + block_length=MI_MAX_BLOCK_LENGTH; + if (_mi_write_part_record(info,0L,block_length, + sort_param->filepos+block_length, + &from,&reclength,&flag)) + { + mi_check_print_error(param,"%d when writing to datafile",my_errno); + DBUG_RETURN(1); + } + sort_param->filepos+=block_length; + info->s->state.split++; + } while (reclength); + /* sort_info->param->glob_crc+=info->checksum; */ + break; + case COMPRESSED_RECORD: + reclength=info->packed_length; + length= save_pack_length((uint) share->pack.version, block_buff, + reclength); + if (info->s->base.blobs) + length+= save_pack_length((uint) share->pack.version, + block_buff + length, info->blob_length); + if (my_b_write(&info->rec_cache,block_buff,length) || + my_b_write(&info->rec_cache,(uchar*) sort_param->rec_buff,reclength)) + { + mi_check_print_error(param,"%d when writing to datafile",my_errno); + DBUG_RETURN(1); + } + /* sort_info->param->glob_crc+=info->checksum; */ + sort_param->filepos+=reclength+length; + info->s->state.split++; + break; + } + } + if (sort_param->master) + { + info->state->records++; + if ((param->testflag & T_WRITE_LOOP) && + (info->state->records % WRITE_COUNT) == 0) + { + char llbuff[22]; + printf("%s\r", llstr(info->state->records,llbuff)); + VOID(fflush(stdout)); + } + } + DBUG_RETURN(0); +} /* sort_write_record */ + + + /* Compare two keys from _create_index_by_sort */ + +static int sort_key_cmp(MI_SORT_PARAM *sort_param, const void *a, + const void *b) +{ + uint not_used[2]; + return (ha_key_cmp(sort_param->seg, *((uchar**) a), *((uchar**) b), + USE_WHOLE_KEY, SEARCH_SAME, not_used)); +} /* sort_key_cmp */ + + +static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a) +{ + uint diff_pos[2]; + char llbuff[22],llbuff2[22]; + SORT_INFO *sort_info=sort_param->sort_info; + MI_CHECK *param= sort_info->param; + int cmp; + + if (sort_info->key_block->inited) + { + cmp=ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey, + (uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_UPDATE, + diff_pos); + if (param->stats_method == MI_STATS_METHOD_NULLS_NOT_EQUAL) + ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey, + (uchar*) a, USE_WHOLE_KEY, + SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, diff_pos); + else if (param->stats_method == MI_STATS_METHOD_IGNORE_NULLS) + { + diff_pos[0]= mi_collect_stats_nonulls_next(sort_param->seg, + sort_param->notnull, + sort_info->key_block->lastkey, + (uchar*)a); + } + sort_param->unique[diff_pos[0]-1]++; + } + else + { + cmp= -1; + if (param->stats_method == MI_STATS_METHOD_IGNORE_NULLS) + mi_collect_stats_nonulls_first(sort_param->seg, sort_param->notnull, + (uchar*)a); + } + if ((sort_param->keyinfo->flag & HA_NOSAME) && cmp == 0) + { + sort_info->dupp++; + sort_info->info->lastpos=get_record_for_key(sort_info->info, + sort_param->keyinfo, + (uchar*) a); + mi_check_print_warning(param, + "Duplicate key for record at %10s against record at %10s", + llstr(sort_info->info->lastpos,llbuff), + llstr(get_record_for_key(sort_info->info, + sort_param->keyinfo, + sort_info->key_block-> + lastkey), + llbuff2)); + param->testflag|=T_RETRY_WITHOUT_QUICK; + if (sort_info->param->testflag & T_VERBOSE) + _mi_print_key(stdout,sort_param->seg,(uchar*) a, USE_WHOLE_KEY); + return (sort_delete_record(sort_param)); + } +#ifndef DBUG_OFF + if (cmp > 0) + { + mi_check_print_error(param, + "Internal error: Keys are not in order from sort"); + return(1); + } +#endif + return (sort_insert_key(sort_param,sort_info->key_block, + (uchar*) a, HA_OFFSET_ERROR)); +} /* sort_key_write */ + +int sort_ft_buf_flush(MI_SORT_PARAM *sort_param) +{ + SORT_INFO *sort_info=sort_param->sort_info; + SORT_KEY_BLOCKS *key_block=sort_info->key_block; + MYISAM_SHARE *share=sort_info->info->s; + uint val_off, val_len; + int error; + SORT_FT_BUF *ft_buf=sort_info->ft_buf; + uchar *from, *to; + + val_len=share->ft2_keyinfo.keylength; + get_key_full_length_rdonly(val_off, ft_buf->lastkey); + to=ft_buf->lastkey+val_off; + + if (ft_buf->buf) + { + /* flushing first-level tree */ + error=sort_insert_key(sort_param,key_block,ft_buf->lastkey, + HA_OFFSET_ERROR); + for (from=to+val_len; + !error && from < ft_buf->buf; + from+= val_len) + { + memcpy(to, from, val_len); + error=sort_insert_key(sort_param,key_block,ft_buf->lastkey, + HA_OFFSET_ERROR); + } + return error; + } + /* flushing second-level tree keyblocks */ + error=flush_pending_blocks(sort_param); + /* updating lastkey with second-level tree info */ + ft_intXstore(ft_buf->lastkey+val_off, -ft_buf->count); + _mi_dpointer(sort_info->info, ft_buf->lastkey+val_off+HA_FT_WLEN, + share->state.key_root[sort_param->key]); + /* restoring first level tree data in sort_info/sort_param */ + sort_info->key_block=sort_info->key_block_end- sort_info->param->sort_key_blocks; + sort_param->keyinfo=share->keyinfo+sort_param->key; + share->state.key_root[sort_param->key]=HA_OFFSET_ERROR; + /* writing lastkey in first-level tree */ + return error ? error : + sort_insert_key(sort_param,sort_info->key_block, + ft_buf->lastkey,HA_OFFSET_ERROR); +} + +static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a) +{ + uint a_len, val_off, val_len, error; + uchar *p; + SORT_INFO *sort_info=sort_param->sort_info; + SORT_FT_BUF *ft_buf=sort_info->ft_buf; + SORT_KEY_BLOCKS *key_block=sort_info->key_block; + + val_len=HA_FT_WLEN+sort_info->info->s->base.rec_reflength; + get_key_full_length_rdonly(a_len, (uchar *)a); + + if (!ft_buf) + { + /* + use two-level tree only if key_reflength fits in rec_reflength place + and row format is NOT static - for _mi_dpointer not to garble offsets + */ + if ((sort_info->info->s->base.key_reflength <= + sort_info->info->s->base.rec_reflength) && + (sort_info->info->s->options & + (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD))) + ft_buf=(SORT_FT_BUF *)my_malloc(sort_param->keyinfo->block_length + + sizeof(SORT_FT_BUF), MYF(MY_WME)); + + if (!ft_buf) + { + sort_param->key_write=sort_key_write; + return sort_key_write(sort_param, a); + } + sort_info->ft_buf=ft_buf; + goto word_init_ft_buf; /* no need to duplicate the code */ + } + get_key_full_length_rdonly(val_off, ft_buf->lastkey); + + if (mi_compare_text(sort_param->seg->charset, + ((uchar *)a)+1,a_len-1, + ft_buf->lastkey+1,val_off-1, 0, 0)==0) + { + if (!ft_buf->buf) /* store in second-level tree */ + { + ft_buf->count++; + return sort_insert_key(sort_param,key_block, + ((uchar *)a)+a_len, HA_OFFSET_ERROR); + } + + /* storing the key in the buffer. */ + memcpy (ft_buf->buf, (char *)a+a_len, val_len); + ft_buf->buf+=val_len; + if (ft_buf->buf < ft_buf->end) + return 0; + + /* converting to two-level tree */ + p=ft_buf->lastkey+val_off; + + while (key_block->inited) + key_block++; + sort_info->key_block=key_block; + sort_param->keyinfo=& sort_info->info->s->ft2_keyinfo; + ft_buf->count=(ft_buf->buf - p)/val_len; + + /* flushing buffer to second-level tree */ + for (error=0; !error && p < ft_buf->buf; p+= val_len) + error=sort_insert_key(sort_param,key_block,p,HA_OFFSET_ERROR); + ft_buf->buf=0; + return error; + } + + /* flushing buffer */ + if ((error=sort_ft_buf_flush(sort_param))) + return error; + +word_init_ft_buf: + a_len+=val_len; + memcpy(ft_buf->lastkey, a, a_len); + ft_buf->buf=ft_buf->lastkey+a_len; + /* + 32 is just a safety margin here + (at least max(val_len, sizeof(nod_flag)) should be there). + May be better performance could be achieved if we'd put + (sort_info->keyinfo->block_length-32)/XXX + instead. + TODO: benchmark the best value for XXX. + */ + ft_buf->end=ft_buf->lastkey+ (sort_param->keyinfo->block_length-32); + return 0; +} /* sort_ft_key_write */ + + + /* get pointer to record from a key */ + +static my_off_t get_record_for_key(MI_INFO *info, MI_KEYDEF *keyinfo, + uchar *key) +{ + return _mi_dpos(info,0,key+_mi_keylength(keyinfo,key)); +} /* get_record_for_key */ + + + /* Insert a key in sort-key-blocks */ + +static int sort_insert_key(MI_SORT_PARAM *sort_param, + register SORT_KEY_BLOCKS *key_block, uchar *key, + my_off_t prev_block) +{ + uint a_length,t_length,nod_flag; + my_off_t filepos,key_file_length; + uchar *anc_buff,*lastkey; + MI_KEY_PARAM s_temp; + MI_INFO *info; + MI_KEYDEF *keyinfo=sort_param->keyinfo; + SORT_INFO *sort_info= sort_param->sort_info; + MI_CHECK *param=sort_info->param; + DBUG_ENTER("sort_insert_key"); + + anc_buff=key_block->buff; + info=sort_info->info; + lastkey=key_block->lastkey; + nod_flag= (key_block == sort_info->key_block ? 0 : + info->s->base.key_reflength); + + if (!key_block->inited) + { + key_block->inited=1; + if (key_block == sort_info->key_block_end) + { + mi_check_print_error(param,"To many key-block-levels; Try increasing sort_key_blocks"); + DBUG_RETURN(1); + } + a_length=2+nod_flag; + key_block->end_pos=anc_buff+2; + lastkey=0; /* No previous key in block */ + } + else + a_length=mi_getint(anc_buff); + + /* Save pointer to previous block */ + if (nod_flag) + _mi_kpointer(info,key_block->end_pos,prev_block); + + t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, + (uchar*) 0,lastkey,lastkey,key, + &s_temp); + (*keyinfo->store_key)(keyinfo, key_block->end_pos+nod_flag,&s_temp); + a_length+=t_length; + mi_putint(anc_buff,a_length,nod_flag); + key_block->end_pos+=t_length; + if (a_length <= keyinfo->block_length) + { + VOID(_mi_move_key(keyinfo,key_block->lastkey,key)); + key_block->last_length=a_length-t_length; + DBUG_RETURN(0); + } + + /* Fill block with end-zero and write filled block */ + mi_putint(anc_buff,key_block->last_length,nod_flag); + bzero((uchar*) anc_buff+key_block->last_length, + keyinfo->block_length- key_block->last_length); + key_file_length=info->state->key_file_length; + if ((filepos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR) + DBUG_RETURN(1); + + /* If we read the page from the key cache, we have to write it back to it */ + if (key_file_length == info->state->key_file_length) + { + if (_mi_write_keypage(info, keyinfo, filepos, DFLT_INIT_HITS, anc_buff)) + DBUG_RETURN(1); + } + else if (my_pwrite(info->s->kfile,(uchar*) anc_buff, + (uint) keyinfo->block_length,filepos, param->myf_rw)) + DBUG_RETURN(1); + DBUG_DUMP("buff",(uchar*) anc_buff,mi_getint(anc_buff)); + + /* Write separator-key to block in next level */ + if (sort_insert_key(sort_param,key_block+1,key_block->lastkey,filepos)) + DBUG_RETURN(1); + + /* clear old block and write new key in it */ + key_block->inited=0; + DBUG_RETURN(sort_insert_key(sort_param, key_block,key,prev_block)); +} /* sort_insert_key */ + + + /* Delete record when we found a duplicated key */ + +static int sort_delete_record(MI_SORT_PARAM *sort_param) +{ + uint i; + int old_file,error; + uchar *key; + SORT_INFO *sort_info=sort_param->sort_info; + MI_CHECK *param=sort_info->param; + MI_INFO *info=sort_info->info; + DBUG_ENTER("sort_delete_record"); + + if ((param->testflag & (T_FORCE_UNIQUENESS|T_QUICK)) == T_QUICK) + { + mi_check_print_error(param, + "Quick-recover aborted; Run recovery without switch -q or with switch -qq"); + DBUG_RETURN(1); + } + if (info->s->options & HA_OPTION_COMPRESS_RECORD) + { + mi_check_print_error(param, + "Recover aborted; Can't run standard recovery on compressed tables with errors in data-file. Use switch 'myisamchk --safe-recover' to fix it\n",stderr);; + DBUG_RETURN(1); + } + + old_file=info->dfile; + info->dfile=info->rec_cache.file; + if (sort_info->current_key) + { + key=info->lastkey+info->s->base.max_key_length; + if ((error=(*info->s->read_rnd)(info,sort_param->record,info->lastpos,0)) && + error != HA_ERR_RECORD_DELETED) + { + mi_check_print_error(param,"Can't read record to be removed"); + info->dfile=old_file; + DBUG_RETURN(1); + } + + for (i=0 ; i < sort_info->current_key ; i++) + { + uint key_length=_mi_make_key(info,i,key,sort_param->record,info->lastpos); + if (_mi_ck_delete(info,i,key,key_length)) + { + mi_check_print_error(param,"Can't delete key %d from record to be removed",i+1); + info->dfile=old_file; + DBUG_RETURN(1); + } + } + if (sort_param->calc_checksum) + param->glob_crc-=(*info->s->calc_checksum)(info, sort_param->record); + } + error=flush_io_cache(&info->rec_cache) || (*info->s->delete_record)(info); + info->dfile=old_file; /* restore actual value */ + info->state->records--; + DBUG_RETURN(error); +} /* sort_delete_record */ + + /* Fix all pending blocks and flush everything to disk */ + +int flush_pending_blocks(MI_SORT_PARAM *sort_param) +{ + uint nod_flag,length; + my_off_t filepos,key_file_length; + SORT_KEY_BLOCKS *key_block; + SORT_INFO *sort_info= sort_param->sort_info; + myf myf_rw=sort_info->param->myf_rw; + MI_INFO *info=sort_info->info; + MI_KEYDEF *keyinfo=sort_param->keyinfo; + DBUG_ENTER("flush_pending_blocks"); + + filepos= HA_OFFSET_ERROR; /* if empty file */ + nod_flag=0; + for (key_block=sort_info->key_block ; key_block->inited ; key_block++) + { + key_block->inited=0; + length=mi_getint(key_block->buff); + if (nod_flag) + _mi_kpointer(info,key_block->end_pos,filepos); + key_file_length=info->state->key_file_length; + bzero((uchar*) key_block->buff+length, keyinfo->block_length-length); + if ((filepos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR) + DBUG_RETURN(1); + + /* If we read the page from the key cache, we have to write it back */ + if (key_file_length == info->state->key_file_length) + { + if (_mi_write_keypage(info, keyinfo, filepos, + DFLT_INIT_HITS, key_block->buff)) + DBUG_RETURN(1); + } + else if (my_pwrite(info->s->kfile,(uchar*) key_block->buff, + (uint) keyinfo->block_length,filepos, myf_rw)) + DBUG_RETURN(1); + DBUG_DUMP("buff",(uchar*) key_block->buff,length); + nod_flag=1; + } + info->s->state.key_root[sort_param->key]=filepos; /* Last is root for tree */ + DBUG_RETURN(0); +} /* flush_pending_blocks */ + + /* alloc space and pointers for key_blocks */ + +static SORT_KEY_BLOCKS *alloc_key_blocks(MI_CHECK *param, uint blocks, + uint buffer_length) +{ + reg1 uint i; + SORT_KEY_BLOCKS *block; + DBUG_ENTER("alloc_key_blocks"); + + if (!(block=(SORT_KEY_BLOCKS*) my_malloc((sizeof(SORT_KEY_BLOCKS)+ + buffer_length+IO_SIZE)*blocks, + MYF(0)))) + { + mi_check_print_error(param,"Not enough memory for sort-key-blocks"); + return(0); + } + for (i=0 ; i < blocks ; i++) + { + block[i].inited=0; + block[i].buff=(uchar*) (block+blocks)+(buffer_length+IO_SIZE)*i; + } + DBUG_RETURN(block); +} /* alloc_key_blocks */ + + + /* Check if file is almost full */ + +int test_if_almost_full(MI_INFO *info) +{ + if (info->s->options & HA_OPTION_COMPRESS_RECORD) + return 0; + return my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE)) / 10 * 9 > + (my_off_t) info->s->base.max_key_file_length || + my_seek(info->dfile, 0L, MY_SEEK_END, MYF(0)) / 10 * 9 > + (my_off_t) info->s->base.max_data_file_length; +} + + /* Recreate table with bigger more alloced record-data */ + +int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) +{ + int error; + MI_INFO info; + MYISAM_SHARE share; + MI_KEYDEF *keyinfo,*key,*key_end; + HA_KEYSEG *keysegs,*keyseg; + MI_COLUMNDEF *recdef,*rec,*end; + MI_UNIQUEDEF *uniquedef,*u_ptr,*u_end; + MI_STATUS_INFO status_info; + uint unpack,key_parts; + ha_rows max_records; + ulonglong file_length,tmp_length; + MI_CREATE_INFO create_info; + DBUG_ENTER("recreate_table"); + + error=1; /* Default error */ + info= **org_info; + status_info= (*org_info)->state[0]; + info.state= &status_info; + share= *(*org_info)->s; + unpack= (share.options & HA_OPTION_COMPRESS_RECORD) && + (param->testflag & T_UNPACK); + if (!(keyinfo=(MI_KEYDEF*) my_alloca(sizeof(MI_KEYDEF)*share.base.keys))) + DBUG_RETURN(0); + memcpy((uchar*) keyinfo,(uchar*) share.keyinfo, + (size_t) (sizeof(MI_KEYDEF)*share.base.keys)); + + key_parts= share.base.all_key_parts; + if (!(keysegs=(HA_KEYSEG*) my_alloca(sizeof(HA_KEYSEG)* + (key_parts+share.base.keys)))) + { + my_afree((uchar*) keyinfo); + DBUG_RETURN(1); + } + if (!(recdef=(MI_COLUMNDEF*) + my_alloca(sizeof(MI_COLUMNDEF)*(share.base.fields+1)))) + { + my_afree((uchar*) keyinfo); + my_afree((uchar*) keysegs); + DBUG_RETURN(1); + } + if (!(uniquedef=(MI_UNIQUEDEF*) + my_alloca(sizeof(MI_UNIQUEDEF)*(share.state.header.uniques+1)))) + { + my_afree((uchar*) recdef); + my_afree((uchar*) keyinfo); + my_afree((uchar*) keysegs); + DBUG_RETURN(1); + } + + /* Copy the column definitions */ + memcpy((uchar*) recdef,(uchar*) share.rec, + (size_t) (sizeof(MI_COLUMNDEF)*(share.base.fields+1))); + for (rec=recdef,end=recdef+share.base.fields; rec != end ; rec++) + { + if (unpack && !(share.options & HA_OPTION_PACK_RECORD) && + rec->type != FIELD_BLOB && + rec->type != FIELD_VARCHAR && + rec->type != FIELD_CHECK) + rec->type=(int) FIELD_NORMAL; + } + + /* Change the new key to point at the saved key segments */ + memcpy((uchar*) keysegs,(uchar*) share.keyparts, + (size_t) (sizeof(HA_KEYSEG)*(key_parts+share.base.keys+ + share.state.header.uniques))); + keyseg=keysegs; + for (key=keyinfo,key_end=keyinfo+share.base.keys; key != key_end ; key++) + { + key->seg=keyseg; + for (; keyseg->type ; keyseg++) + { + if (param->language) + keyseg->language=param->language; /* change language */ + } + keyseg++; /* Skip end pointer */ + } + + /* Copy the unique definitions and change them to point at the new key + segments*/ + memcpy((uchar*) uniquedef,(uchar*) share.uniqueinfo, + (size_t) (sizeof(MI_UNIQUEDEF)*(share.state.header.uniques))); + for (u_ptr=uniquedef,u_end=uniquedef+share.state.header.uniques; + u_ptr != u_end ; u_ptr++) + { + u_ptr->seg=keyseg; + keyseg+=u_ptr->keysegs+1; + } + if (share.options & HA_OPTION_COMPRESS_RECORD) + share.base.records=max_records=info.state->records; + else if (share.base.min_pack_length) + max_records=(ha_rows) (my_seek(info.dfile,0L,MY_SEEK_END,MYF(0)) / + (ulong) share.base.min_pack_length); + else + max_records=0; + unpack= (share.options & HA_OPTION_COMPRESS_RECORD) && + (param->testflag & T_UNPACK); + share.options&= ~HA_OPTION_TEMP_COMPRESS_RECORD; + + file_length=(ulonglong) my_seek(info.dfile,0L,MY_SEEK_END,MYF(0)); + tmp_length= file_length+file_length/10; + set_if_bigger(file_length,param->max_data_file_length); + set_if_bigger(file_length,tmp_length); + set_if_bigger(file_length,(ulonglong) share.base.max_data_file_length); + + VOID(mi_close(*org_info)); + bzero((char*) &create_info,sizeof(create_info)); + create_info.max_rows=max(max_records,share.base.records); + create_info.reloc_rows=share.base.reloc; + create_info.old_options=(share.options | + (unpack ? HA_OPTION_TEMP_COMPRESS_RECORD : 0)); + + create_info.data_file_length=file_length; + create_info.auto_increment=share.state.auto_increment; + create_info.language = (param->language ? param->language : + share.state.header.language); + create_info.key_file_length= status_info.key_file_length; + /* + Allow for creating an auto_increment key. This has an effect only if + an auto_increment key exists in the original table. + */ + create_info.with_auto_increment= TRUE; + /* We don't have to handle symlinks here because we are using + HA_DONT_TOUCH_DATA */ + if (mi_create(filename, + share.base.keys - share.state.header.uniques, + keyinfo, share.base.fields, recdef, + share.state.header.uniques, uniquedef, + &create_info, + HA_DONT_TOUCH_DATA)) + { + mi_check_print_error(param,"Got error %d when trying to recreate indexfile",my_errno); + goto end; + } + *org_info=mi_open(filename,O_RDWR, + (param->testflag & T_WAIT_FOREVER) ? HA_OPEN_WAIT_IF_LOCKED : + (param->testflag & T_DESCRIPT) ? HA_OPEN_IGNORE_IF_LOCKED : + HA_OPEN_ABORT_IF_LOCKED); + if (!*org_info) + { + mi_check_print_error(param,"Got error %d when trying to open re-created indexfile", + my_errno); + goto end; + } + /* We are modifing */ + (*org_info)->s->options&= ~HA_OPTION_READ_ONLY_DATA; + VOID(_mi_readinfo(*org_info,F_WRLCK,0)); + (*org_info)->state->records=info.state->records; + if (share.state.create_time) + (*org_info)->s->state.create_time=share.state.create_time; + (*org_info)->s->state.unique=(*org_info)->this_unique= + share.state.unique; + (*org_info)->state->checksum=info.state->checksum; + (*org_info)->state->del=info.state->del; + (*org_info)->s->state.dellink=share.state.dellink; + (*org_info)->state->empty=info.state->empty; + (*org_info)->state->data_file_length=info.state->data_file_length; + if (update_state_info(param,*org_info,UPDATE_TIME | UPDATE_STAT | + UPDATE_OPEN_COUNT)) + goto end; + error=0; +end: + my_afree((uchar*) uniquedef); + my_afree((uchar*) keyinfo); + my_afree((uchar*) recdef); + my_afree((uchar*) keysegs); + DBUG_RETURN(error); +} + + + /* write suffix to data file if neaded */ + +int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile) +{ + MI_INFO *info=sort_info->info; + + if (info->s->options & HA_OPTION_COMPRESS_RECORD && fix_datafile) + { + uchar buff[MEMMAP_EXTRA_MARGIN]; + bzero(buff,sizeof(buff)); + if (my_b_write(&info->rec_cache,buff,sizeof(buff))) + { + mi_check_print_error(sort_info->param, + "%d when writing to datafile",my_errno); + return 1; + } + sort_info->param->read_cache.end_of_file+=sizeof(buff); + } + return 0; +} + + /* Update state and myisamchk_time of indexfile */ + +int update_state_info(MI_CHECK *param, MI_INFO *info,uint update) +{ + MYISAM_SHARE *share=info->s; + + if (update & UPDATE_OPEN_COUNT) + { + share->state.open_count=0; + share->global_changed=0; + } + if (update & UPDATE_STAT) + { + uint i, key_parts= mi_uint2korr(share->state.header.key_parts); + share->state.rec_per_key_rows=info->state->records; + share->state.changed&= ~STATE_NOT_ANALYZED; + if (info->state->records) + { + for (i=0; istate.rec_per_key_part[i]=param->rec_per_key_part[i])) + share->state.changed|= STATE_NOT_ANALYZED; + } + } + } + if (update & (UPDATE_STAT | UPDATE_SORT | UPDATE_TIME | UPDATE_AUTO_INC)) + { + if (update & UPDATE_TIME) + { + share->state.check_time= (long) time((time_t*) 0); + if (!share->state.create_time) + share->state.create_time=share->state.check_time; + } + /* + When tables are locked we haven't synched the share state and the + real state for a while so we better do it here before synching + the share state to disk. Only when table is write locked is it + necessary to perform this synch. + */ + if (info->lock_type == F_WRLCK) + share->state.state= *info->state; + if (mi_state_info_write(share->kfile,&share->state,1+2)) + goto err; + share->changed=0; + } + { /* Force update of status */ + int error; + uint r_locks=share->r_locks,w_locks=share->w_locks; + share->r_locks= share->w_locks= share->tot_locks= 0; + error=_mi_writeinfo(info,WRITEINFO_NO_UNLOCK); + share->r_locks=r_locks; + share->w_locks=w_locks; + share->tot_locks=r_locks+w_locks; + if (!error) + return 0; + } +err: + mi_check_print_error(param,"%d when updating keyfile",my_errno); + return 1; +} + + /* + Update auto increment value for a table + When setting the 'repair_only' flag we only want to change the + old auto_increment value if its wrong (smaller than some given key). + The reason is that we shouldn't change the auto_increment value + for a table without good reason when only doing a repair; If the + user have inserted and deleted rows, the auto_increment value + may be bigger than the biggest current row and this is ok. + + If repair_only is not set, we will update the flag to the value in + param->auto_increment is bigger than the biggest key. + */ + +void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, + my_bool repair_only) +{ + uchar *record; + DBUG_ENTER("update_auto_increment_key"); + + if (!info->s->base.auto_key || + ! mi_is_key_active(info->s->state.key_map, info->s->base.auto_key - 1)) + { + if (!(param->testflag & T_VERY_SILENT)) + mi_check_print_info(param, + "Table: %s doesn't have an auto increment key\n", + param->isam_file_name); + DBUG_VOID_RETURN; + } + if (!(param->testflag & T_SILENT) && + !(param->testflag & T_REP)) + printf("Updating MyISAM file: %s\n", param->isam_file_name); + /* + We have to use an allocated buffer instead of info->rec_buff as + _mi_put_key_in_record() may use info->rec_buff + */ + if (!(record= (uchar*) my_malloc((uint) info->s->base.pack_reclength, + MYF(0)))) + { + mi_check_print_error(param,"Not enough memory for extra record"); + DBUG_VOID_RETURN; + } + + mi_extra(info,HA_EXTRA_KEYREAD,0); + if (mi_rlast(info, record, info->s->base.auto_key-1)) + { + if (my_errno != HA_ERR_END_OF_FILE) + { + mi_extra(info,HA_EXTRA_NO_KEYREAD,0); + my_free((char*) record, MYF(0)); + mi_check_print_error(param,"%d when reading last record",my_errno); + DBUG_VOID_RETURN; + } + if (!repair_only) + info->s->state.auto_increment=param->auto_increment_value; + } + else + { + ulonglong auto_increment= retrieve_auto_increment(info, record); + set_if_bigger(info->s->state.auto_increment,auto_increment); + if (!repair_only) + set_if_bigger(info->s->state.auto_increment, param->auto_increment_value); + } + mi_extra(info,HA_EXTRA_NO_KEYREAD,0); + my_free((char*) record, MYF(0)); + update_state_info(param, info, UPDATE_AUTO_INC); + DBUG_VOID_RETURN; +} + + +/* + Update statistics for each part of an index + + SYNOPSIS + update_key_parts() + keyinfo IN Index information (only key->keysegs used) + rec_per_key_part OUT Store statistics here + unique IN Array of (#distinct tuples) + notnull_tuples IN Array of (#tuples), or NULL + records Number of records in the table + + DESCRIPTION + This function is called produce index statistics values from unique and + notnull_tuples arrays after these arrays were produced with sequential + index scan (the scan is done in two places: chk_index() and + sort_key_write()). + + This function handles all 3 index statistics collection methods. + + Unique is an array: + unique[0]= (#different values of {keypart1}) - 1 + unique[1]= (#different values of {keypart1,keypart2} tuple)-unique[0]-1 + ... + + For MI_STATS_METHOD_IGNORE_NULLS method, notnull_tuples is an array too: + notnull_tuples[0]= (#of {keypart1} tuples such that keypart1 is not NULL) + notnull_tuples[1]= (#of {keypart1,keypart2} tuples such that all + keypart{i} are not NULL) + ... + For all other statistics collection methods notnull_tuples==NULL. + + Output is an array: + rec_per_key_part[k] = + = E(#records in the table such that keypart_1=c_1 AND ... AND + keypart_k=c_k for arbitrary constants c_1 ... c_k) + + = {assuming that values have uniform distribution and index contains all + tuples from the domain (or that {c_1, ..., c_k} tuple is choosen from + index tuples} + + = #tuples-in-the-index / #distinct-tuples-in-the-index. + + The #tuples-in-the-index and #distinct-tuples-in-the-index have different + meaning depending on which statistics collection method is used: + + MI_STATS_METHOD_* how are nulls compared? which tuples are counted? + NULLS_EQUAL NULL == NULL all tuples in table + NULLS_NOT_EQUAL NULL != NULL all tuples in table + IGNORE_NULLS n/a tuples that don't have NULLs +*/ + +void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part, + ulonglong *unique, ulonglong *notnull, + ulonglong records) +{ + ulonglong count=0,tmp, unique_tuples; + ulonglong tuples= records; + uint parts; + for (parts=0 ; parts < keyinfo->keysegs ; parts++) + { + count+=unique[parts]; + unique_tuples= count + 1; + if (notnull) + { + tuples= notnull[parts]; + /* + #(unique_tuples not counting tuples with NULLs) = + #(unique_tuples counting tuples with NULLs as different) - + #(tuples with NULLs) + */ + unique_tuples -= (records - notnull[parts]); + } + + if (unique_tuples == 0) + tmp= 1; + else if (count == 0) + tmp= tuples; /* 1 unique tuple */ + else + tmp= (tuples + unique_tuples/2) / unique_tuples; + + /* + for some weird keys (e.g. FULLTEXT) tmp can be <1 here. + let's ensure it is not + */ + set_if_bigger(tmp,1); + if (tmp >= (ulonglong) ~(ulong) 0) + tmp=(ulonglong) ~(ulong) 0; + + *rec_per_key_part=(ulong) tmp; + rec_per_key_part++; + } +} + + +static ha_checksum mi_byte_checksum(const uchar *buf, uint length) +{ + ha_checksum crc; + const uchar *end=buf+length; + for (crc=0; buf != end; buf++) + crc=((crc << 1) + *((uchar*) buf)) + + test(crc & (((ha_checksum) 1) << (8*sizeof(ha_checksum)-1))); + return crc; +} + +static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) +{ + uint key_maxlength=key->maxlength; + if (key->flag & HA_FULLTEXT) + { + uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* + key->seg->charset->mbmaxlen; + key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; + } + return (key->flag & HA_SPATIAL) || + (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && + ((ulonglong) rows * key_maxlength > + (ulonglong) myisam_max_temp_length)); +} + +/* + Deactivate all not unique index that can be recreated fast + These include packed keys on which sorting will use more temporary + space than the max allowed file length or for which the unpacked keys + will take much more space than packed keys. + Note that 'rows' may be zero for the case when we don't know how many + rows we will put into the file. + */ + +void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows) +{ + MYISAM_SHARE *share=info->s; + MI_KEYDEF *key=share->keyinfo; + uint i; + + DBUG_ASSERT(info->state->records == 0 && + (!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES)); + for (i=0 ; i < share->base.keys ; i++,key++) + { + if (!(key->flag & (HA_NOSAME | HA_SPATIAL | HA_AUTO_KEY)) && + ! mi_too_big_key_for_sort(key,rows) && info->s->base.auto_key != i+1) + { + mi_clear_key_active(share->state.key_map, i); + info->update|= HA_STATE_CHANGED; + } + } +} + + +/* + Return TRUE if we can use repair by sorting + One can set the force argument to force to use sorting + even if the temporary file would be quite big! +*/ + +my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, + ulonglong key_map, my_bool force) +{ + MYISAM_SHARE *share=info->s; + MI_KEYDEF *key=share->keyinfo; + uint i; + + /* + mi_repair_by_sort only works if we have at least one key. If we don't + have any keys, we should use the normal repair. + */ + if (! mi_is_any_key_active(key_map)) + return FALSE; /* Can't use sort */ + for (i=0 ; i < share->base.keys ; i++,key++) + { + if (!force && mi_too_big_key_for_sort(key,rows)) + return FALSE; + } + return TRUE; +} + + +static void +set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share) +{ + if ((sort_info->new_data_file_type=share->data_file_type) == + COMPRESSED_RECORD && sort_info->param->testflag & T_UNPACK) + { + MYISAM_SHARE tmp; + + if (share->options & HA_OPTION_PACK_RECORD) + sort_info->new_data_file_type = DYNAMIC_RECORD; + else + sort_info->new_data_file_type = STATIC_RECORD; + + /* Set delete_function for sort_delete_record() */ + memcpy((char*) &tmp, share, sizeof(*share)); + tmp.options= ~HA_OPTION_COMPRESS_RECORD; + mi_setup_functions(&tmp); + share->delete_record=tmp.delete_record; + } +} Added: trunk/src/mi_checksum.c =================================================================== --- trunk/src/mi_checksum.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_checksum.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,64 @@ +/* Copyright (C) 2000-2001, 2003-2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Calculate a checksum for a row */ + +#include "myisamdef.h" + +ha_checksum mi_checksum(MI_INFO *info, const uchar *buf) +{ + uint i; + ha_checksum crc=0; + MI_COLUMNDEF *rec=info->s->rec; + + for (i=info->s->base.fields ; i-- ; buf+=(rec++)->length) + { + const uchar *pos; + ulong length; + switch (rec->type) { + case FIELD_BLOB: + { + length=_mi_calc_blob_length(rec->length- + mi_portable_sizeof_char_ptr, + buf); + memcpy((char*) &pos, buf+rec->length- mi_portable_sizeof_char_ptr, + sizeof(char*)); + break; + } + case FIELD_VARCHAR: + { + uint pack_length= HA_VARCHAR_PACKLENGTH(rec->length-1); + if (pack_length == 1) + length= (ulong) *(uchar*) buf; + else + length= uint2korr(buf); + pos= buf+pack_length; + break; + } + default: + length=rec->length; + pos=buf; + break; + } + crc=my_checksum(crc, pos ? pos : (uchar*) "", length); + } + return crc; +} + + +ha_checksum mi_static_checksum(MI_INFO *info, const uchar *pos) +{ + return my_checksum(0, pos, info->s->base.reclength); +} Added: trunk/src/mi_close.c =================================================================== --- trunk/src/mi_close.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_close.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,124 @@ +/* Copyright (C) 2000-2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* close a isam-database */ +/* + TODO: + We need to have a separate mutex on the closed file to allow other threads + to open other files during the time we flush the cache and close this file +*/ + +#include "myisamdef.h" + +int mi_close(register MI_INFO *info) +{ + int error=0,flag; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("mi_close"); + DBUG_PRINT("enter",("base: 0x%lx reopen: %u locks: %u", + (long) info, (uint) share->reopen, + (uint) share->tot_locks)); + + pthread_mutex_lock(&THR_LOCK_myisam); + if (info->lock_type == F_EXTRA_LCK) + info->lock_type=F_UNLCK; /* HA_EXTRA_NO_USER_CHANGE */ + + if (share->reopen == 1 && share->kfile >= 0) + _mi_decrement_open_count(info); + + if (info->lock_type != F_UNLCK) + { + if (mi_lock_database(info,F_UNLCK)) + error=my_errno; + } + pthread_mutex_lock(&share->intern_lock); + + if (share->options & HA_OPTION_READ_ONLY_DATA) + { + share->r_locks--; + share->tot_locks--; + } + if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) + { + if (end_io_cache(&info->rec_cache)) + error=my_errno; + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + } + flag= !--share->reopen; + myisam_open_list=list_delete(myisam_open_list,&info->open_list); + pthread_mutex_unlock(&share->intern_lock); + + my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); + if (flag) + { + if (share->kfile >= 0 && + flush_key_blocks(share->key_cache, share->kfile, + share->temporary ? FLUSH_IGNORE_CHANGED : + FLUSH_RELEASE)) + error=my_errno; + if (share->kfile >= 0) + { + /* + If we are crashed, we can safely flush the current state as it will + not change the crashed state. + We can NOT write the state in other cases as other threads + may be using the file at this point + */ + if (share->mode != O_RDONLY && mi_is_crashed(info)) + mi_state_info_write(share->kfile, &share->state, 1); + if (my_close(share->kfile,MYF(0))) + error = my_errno; + } +#ifdef HAVE_MMAP + if (share->file_map) + _mi_unmap_file(info); +#endif + if (share->decode_trees) + { + my_free((uchar*) share->decode_trees,MYF(0)); + my_free((uchar*) share->decode_tables,MYF(0)); + } +#ifdef THREAD + thr_lock_delete(&share->lock); + VOID(pthread_mutex_destroy(&share->intern_lock)); + { + int i,keys; + keys = share->state.header.keys; + VOID(rwlock_destroy(&share->mmap_lock)); + for(i=0; ikey_root_lock[i])); + } + } +#endif + my_free((uchar*) info->s,MYF(0)); + } + pthread_mutex_unlock(&THR_LOCK_myisam); + if (info->ftparser_param) + { + my_free((uchar*)info->ftparser_param, MYF(0)); + info->ftparser_param= 0; + } + if (info->dfile >= 0 && my_close(info->dfile,MYF(0))) + error = my_errno; + + myisam_log_command(MI_LOG_CLOSE,info,NULL,0,error); + my_free((uchar*) info,MYF(0)); + + if (error) + { + DBUG_RETURN(my_errno=error); + } + DBUG_RETURN(0); +} /* mi_close */ Added: trunk/src/mi_create.c =================================================================== --- trunk/src/mi_create.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_create.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,884 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Create a MyISAM table */ + +#include "ftdefs.h" +#include "sp_defs.h" + +#if defined(MSDOS) || defined(__WIN__) +#ifdef __WIN__ +#include +#else +#include /* Prototype for getpid */ +#endif +#endif +#include + +/* + Old options is used when recreating database, from myisamchk +*/ + +int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, + uint columns, MI_COLUMNDEF *recinfo, + uint uniques, MI_UNIQUEDEF *uniquedefs, + MI_CREATE_INFO *ci,uint flags) +{ + register uint i,j; + File dfile,file; + int errpos,save_errno, create_mode= O_RDWR | O_TRUNC; + myf create_flag; + uint fields,length,max_key_length,packed,pointer,real_length_diff, + key_length,info_length,key_segs,options,min_key_length_skip, + base_pos,long_varchar_count,varchar_length, + max_key_block_length,unique_key_parts,fulltext_keys,offset; + uint aligned_key_start, block_length; + ulong reclength, real_reclength,min_pack_length; + char filename[FN_REFLEN],linkname[FN_REFLEN], *linkname_ptr; + ulong pack_reclength; + ulonglong tot_length,max_rows, tmp; + enum en_fieldtype type; + MYISAM_SHARE share; + MI_KEYDEF *keydef,tmp_keydef; + MI_UNIQUEDEF *uniquedef; + HA_KEYSEG *keyseg,tmp_keyseg; + MI_COLUMNDEF *rec; + ulong *rec_per_key_part; + my_off_t key_root[MI_MAX_POSSIBLE_KEY],key_del[MI_MAX_KEY_BLOCK_SIZE]; + MI_CREATE_INFO tmp_create_info; + DBUG_ENTER("mi_create"); + DBUG_PRINT("enter", ("keys: %u columns: %u uniques: %u flags: %u", + keys, columns, uniques, flags)); + + if (!ci) + { + bzero((char*) &tmp_create_info,sizeof(tmp_create_info)); + ci=&tmp_create_info; + } + + if (keys + uniques > MI_MAX_KEY || columns == 0) + { + DBUG_RETURN(my_errno=HA_WRONG_CREATE_OPTION); + } + LINT_INIT(dfile); + LINT_INIT(file); + errpos=0; + options=0; + bzero((uchar*) &share,sizeof(share)); + + if (flags & HA_DONT_TOUCH_DATA) + { + if (!(ci->old_options & HA_OPTION_TEMP_COMPRESS_RECORD)) + options=ci->old_options & + (HA_OPTION_COMPRESS_RECORD | HA_OPTION_PACK_RECORD | + HA_OPTION_READ_ONLY_DATA | HA_OPTION_CHECKSUM | + HA_OPTION_TMP_TABLE | HA_OPTION_DELAY_KEY_WRITE); + else + options=ci->old_options & + (HA_OPTION_CHECKSUM | HA_OPTION_TMP_TABLE | HA_OPTION_DELAY_KEY_WRITE); + } + + if (ci->reloc_rows > ci->max_rows) + ci->reloc_rows=ci->max_rows; /* Check if wrong parameter */ + + if (!(rec_per_key_part= + (ulong*) my_malloc((keys + uniques)*MI_MAX_KEY_SEG*sizeof(long), + MYF(MY_WME | MY_ZEROFILL)))) + DBUG_RETURN(my_errno); + + /* Start by checking fields and field-types used */ + + reclength=varchar_length=long_varchar_count=packed= + min_pack_length=pack_reclength=0; + for (rec=recinfo, fields=0 ; + fields != columns ; + rec++,fields++) + { + reclength+=rec->length; + if ((type=(enum en_fieldtype) rec->type) != FIELD_NORMAL && + type != FIELD_CHECK) + { + packed++; + if (type == FIELD_BLOB) + { + share.base.blobs++; + if (pack_reclength != INT_MAX32) + { + if (rec->length == 4+mi_portable_sizeof_char_ptr) + pack_reclength= INT_MAX32; + else + pack_reclength+=(1 << ((rec->length-mi_portable_sizeof_char_ptr)*8)); /* Max blob length */ + } + } + else if (type == FIELD_SKIP_PRESPACE || + type == FIELD_SKIP_ENDSPACE) + { + if (pack_reclength != INT_MAX32) + pack_reclength+= rec->length > 255 ? 2 : 1; + min_pack_length++; + } + else if (type == FIELD_VARCHAR) + { + varchar_length+= rec->length-1; /* Used for min_pack_length */ + packed--; + pack_reclength++; + min_pack_length++; + /* We must test for 257 as length includes pack-length */ + if (test(rec->length >= 257)) + { + long_varchar_count++; + pack_reclength+= 2; /* May be packed on 3 bytes */ + } + } + else if (type != FIELD_SKIP_ZERO) + { + min_pack_length+=rec->length; + packed--; /* Not a pack record type */ + } + } + else /* FIELD_NORMAL */ + min_pack_length+=rec->length; + } + if ((packed & 7) == 1) + { /* Bad packing, try to remove a zero-field */ + while (rec != recinfo) + { + rec--; + if (rec->type == (int) FIELD_SKIP_ZERO && rec->length == 1) + { + /* + NOTE1: here we change a field type FIELD_SKIP_ZERO -> + FIELD_NORMAL + */ + rec->type=(int) FIELD_NORMAL; + packed--; + min_pack_length++; + break; + } + } + } + + if (packed || (flags & HA_PACK_RECORD)) + options|=HA_OPTION_PACK_RECORD; /* Must use packed records */ + /* We can't use checksum with static length rows */ + if (!(options & HA_OPTION_PACK_RECORD)) + options&= ~HA_OPTION_CHECKSUM; + if (!(options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD))) + min_pack_length+= varchar_length; + if (flags & HA_CREATE_TMP_TABLE) + { + options|= HA_OPTION_TMP_TABLE; + create_mode|= O_EXCL | O_NOFOLLOW; + } + if (flags & HA_CREATE_CHECKSUM || (options & HA_OPTION_CHECKSUM)) + { + options|= HA_OPTION_CHECKSUM; + min_pack_length++; + } + if (flags & HA_CREATE_DELAY_KEY_WRITE) + options|= HA_OPTION_DELAY_KEY_WRITE; + if (flags & HA_CREATE_RELIES_ON_SQL_LAYER) + options|= HA_OPTION_RELIES_ON_SQL_LAYER; + + packed=(packed+7)/8; + if (pack_reclength != INT_MAX32) + pack_reclength+= reclength+packed + + test(test_all_bits(options, HA_OPTION_CHECKSUM | HA_PACK_RECORD)); + min_pack_length+=packed; + + if (!ci->data_file_length && ci->max_rows) + { + if (pack_reclength == INT_MAX32 || + (~(ulonglong) 0)/ci->max_rows < (ulonglong) pack_reclength) + ci->data_file_length= ~(ulonglong) 0; + else + ci->data_file_length=(ulonglong) ci->max_rows*pack_reclength; + } + else if (!ci->max_rows) + ci->max_rows=(ha_rows) (ci->data_file_length/(min_pack_length + + ((options & HA_OPTION_PACK_RECORD) ? + 3 : 0))); + + if (options & (HA_OPTION_COMPRESS_RECORD | HA_OPTION_PACK_RECORD)) + pointer=mi_get_pointer_length(ci->data_file_length,myisam_data_pointer_size); + else + pointer=mi_get_pointer_length(ci->max_rows,myisam_data_pointer_size); + if (!(max_rows=(ulonglong) ci->max_rows)) + max_rows= ((((ulonglong) 1 << (pointer*8)) -1) / min_pack_length); + + + real_reclength=reclength; + if (!(options & (HA_OPTION_COMPRESS_RECORD | HA_OPTION_PACK_RECORD))) + { + if (reclength <= pointer) + reclength=pointer+1; /* reserve place for delete link */ + } + else + reclength+= long_varchar_count; /* We need space for varchar! */ + + max_key_length=0; tot_length=0 ; key_segs=0; + fulltext_keys=0; + max_key_block_length=0; + share.state.rec_per_key_part=rec_per_key_part; + share.state.key_root=key_root; + share.state.key_del=key_del; + if (uniques) + { + max_key_block_length= myisam_block_size; + max_key_length= MI_UNIQUE_HASH_LENGTH + pointer; + } + + for (i=0, keydef=keydefs ; i < keys ; i++ , keydef++) + { + + share.state.key_root[i]= HA_OFFSET_ERROR; + min_key_length_skip=length=real_length_diff=0; + key_length=pointer; + if (keydef->flag & HA_SPATIAL) + { +#ifdef HAVE_SPATIAL + /* BAR TODO to support 3D and more dimensions in the future */ + uint sp_segs=SPDIMS*2; + keydef->flag=HA_SPATIAL; + + if (flags & HA_DONT_TOUCH_DATA) + { + /* + called by myisamchk - i.e. table structure was taken from + MYI file and SPATIAL key *does have* additional sp_segs keysegs. + keydef->seg here points right at the GEOMETRY segment, + so we only need to decrease keydef->keysegs. + (see recreate_table() in mi_check.c) + */ + keydef->keysegs-=sp_segs-1; + } + + for (j=0, keyseg=keydef->seg ; (int) j < keydef->keysegs ; + j++, keyseg++) + { + if (keyseg->type != HA_KEYTYPE_BINARY && + keyseg->type != HA_KEYTYPE_VARBINARY1 && + keyseg->type != HA_KEYTYPE_VARBINARY2) + { + my_errno=HA_WRONG_CREATE_OPTION; + goto err; + } + } + keydef->keysegs+=sp_segs; + key_length+=SPLEN*sp_segs; + length++; /* At least one length byte */ + min_key_length_skip+=SPLEN*2*SPDIMS; +#else + my_errno= HA_ERR_UNSUPPORTED; + goto err; +#endif /*HAVE_SPATIAL*/ + } + else if (keydef->flag & HA_FULLTEXT) + { + keydef->flag=HA_FULLTEXT | HA_PACK_KEY | HA_VAR_LENGTH_KEY; + options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ + + for (j=0, keyseg=keydef->seg ; (int) j < keydef->keysegs ; + j++, keyseg++) + { + if (keyseg->type != HA_KEYTYPE_TEXT && + keyseg->type != HA_KEYTYPE_VARTEXT1 && + keyseg->type != HA_KEYTYPE_VARTEXT2) + { + my_errno=HA_WRONG_CREATE_OPTION; + goto err; + } + if (!(keyseg->flag & HA_BLOB_PART) && + (keyseg->type == HA_KEYTYPE_VARTEXT1 || + keyseg->type == HA_KEYTYPE_VARTEXT2)) + { + /* Make a flag that this is a VARCHAR */ + keyseg->flag|= HA_VAR_LENGTH_PART; + /* Store in bit_start number of bytes used to pack the length */ + keyseg->bit_start= ((keyseg->type == HA_KEYTYPE_VARTEXT1)? + 1 : 2); + } + } + + fulltext_keys++; + key_length+= HA_FT_MAXBYTELEN+HA_FT_WLEN; + length++; /* At least one length byte */ + min_key_length_skip+=HA_FT_MAXBYTELEN; + real_length_diff=HA_FT_MAXBYTELEN-FT_MAX_WORD_LEN_FOR_SORT; + } + else + { + /* Test if prefix compression */ + if (keydef->flag & HA_PACK_KEY) + { + /* Can't use space_compression on number keys */ + if ((keydef->seg[0].flag & HA_SPACE_PACK) && + keydef->seg[0].type == (int) HA_KEYTYPE_NUM) + keydef->seg[0].flag&= ~HA_SPACE_PACK; + + /* Only use HA_PACK_KEY when first segment is a variable length key */ + if (!(keydef->seg[0].flag & (HA_SPACE_PACK | HA_BLOB_PART | + HA_VAR_LENGTH_PART))) + { + /* pack relative to previous key */ + keydef->flag&= ~HA_PACK_KEY; + keydef->flag|= HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY; + } + else + { + keydef->seg[0].flag|=HA_PACK_KEY; /* for easyer intern test */ + keydef->flag|=HA_VAR_LENGTH_KEY; + options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ + } + } + if (keydef->flag & HA_BINARY_PACK_KEY) + options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ + + if (keydef->flag & HA_AUTO_KEY && ci->with_auto_increment) + share.base.auto_key=i+1; + for (j=0, keyseg=keydef->seg ; j < keydef->keysegs ; j++, keyseg++) + { + /* numbers are stored with high by first to make compression easier */ + switch (keyseg->type) { + case HA_KEYTYPE_SHORT_INT: + case HA_KEYTYPE_LONG_INT: + case HA_KEYTYPE_FLOAT: + case HA_KEYTYPE_DOUBLE: + case HA_KEYTYPE_USHORT_INT: + case HA_KEYTYPE_ULONG_INT: + case HA_KEYTYPE_LONGLONG: + case HA_KEYTYPE_ULONGLONG: + case HA_KEYTYPE_INT24: + case HA_KEYTYPE_UINT24: + case HA_KEYTYPE_INT8: + keyseg->flag|= HA_SWAP_KEY; + break; + case HA_KEYTYPE_VARTEXT1: + case HA_KEYTYPE_VARTEXT2: + case HA_KEYTYPE_VARBINARY1: + case HA_KEYTYPE_VARBINARY2: + if (!(keyseg->flag & HA_BLOB_PART)) + { + /* Make a flag that this is a VARCHAR */ + keyseg->flag|= HA_VAR_LENGTH_PART; + /* Store in bit_start number of bytes used to pack the length */ + keyseg->bit_start= ((keyseg->type == HA_KEYTYPE_VARTEXT1 || + keyseg->type == HA_KEYTYPE_VARBINARY1) ? + 1 : 2); + } + break; + default: + break; + } + if (keyseg->flag & HA_SPACE_PACK) + { + DBUG_ASSERT(!(keyseg->flag & HA_VAR_LENGTH_PART)); + keydef->flag |= HA_SPACE_PACK_USED | HA_VAR_LENGTH_KEY; + options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ + length++; /* At least one length byte */ + min_key_length_skip+=keyseg->length; + if (keyseg->length >= 255) + { /* prefix may be 3 bytes */ + min_key_length_skip+=2; + length+=2; + } + } + if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) + { + DBUG_ASSERT(!test_all_bits(keyseg->flag, + (HA_VAR_LENGTH_PART | HA_BLOB_PART))); + keydef->flag|=HA_VAR_LENGTH_KEY; + length++; /* At least one length byte */ + options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ + min_key_length_skip+=keyseg->length; + if (keyseg->length >= 255) + { /* prefix may be 3 bytes */ + min_key_length_skip+=2; + length+=2; + } + } + key_length+= keyseg->length; + if (keyseg->null_bit) + { + key_length++; + options|=HA_OPTION_PACK_KEYS; + keyseg->flag|=HA_NULL_PART; + keydef->flag|=HA_VAR_LENGTH_KEY | HA_NULL_PART_KEY; + } + } + } /* if HA_FULLTEXT */ + key_segs+=keydef->keysegs; + if (keydef->keysegs > MI_MAX_KEY_SEG) + { + my_errno=HA_WRONG_CREATE_OPTION; + goto err; + } + /* + key_segs may be 0 in the case when we only want to be able to + add on row into the table. This can happen with some DISTINCT queries + in MySQL + */ + if ((keydef->flag & (HA_NOSAME | HA_NULL_PART_KEY)) == HA_NOSAME && + key_segs) + share.state.rec_per_key_part[key_segs-1]=1L; + length+=key_length; + /* Get block length for key, if defined by user */ + block_length= (keydef->block_length ? + my_round_up_to_next_power(keydef->block_length) : + myisam_block_size); + block_length= max(block_length, MI_MIN_KEY_BLOCK_LENGTH); + block_length= min(block_length, MI_MAX_KEY_BLOCK_LENGTH); + + keydef->block_length= (uint16) MI_BLOCK_SIZE(length-real_length_diff, + pointer,MI_MAX_KEYPTR_SIZE, + block_length); + if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH || + length >= MI_MAX_KEY_BUFF) + { + my_errno=HA_WRONG_CREATE_OPTION; + goto err; + } + set_if_bigger(max_key_block_length,keydef->block_length); + keydef->keylength= (uint16) key_length; + keydef->minlength= (uint16) (length-min_key_length_skip); + keydef->maxlength= (uint16) length; + + if (length > max_key_length) + max_key_length= length; + tot_length+= (max_rows/(ulong) (((uint) keydef->block_length-5)/ + (length*2)))* + (ulong) keydef->block_length; + } + for (i=max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH ; i-- ; ) + key_del[i]=HA_OFFSET_ERROR; + + unique_key_parts=0; + offset=reclength-uniques*MI_UNIQUE_HASH_LENGTH; + for (i=0, uniquedef=uniquedefs ; i < uniques ; i++ , uniquedef++) + { + uniquedef->key=keys+i; + unique_key_parts+=uniquedef->keysegs; + share.state.key_root[keys+i]= HA_OFFSET_ERROR; + tot_length+= (max_rows/(ulong) (((uint) myisam_block_size-5)/ + ((MI_UNIQUE_HASH_LENGTH + pointer)*2)))* + (ulong) myisam_block_size; + } + keys+=uniques; /* Each unique has 1 key */ + key_segs+=uniques; /* Each unique has 1 key seg */ + + base_pos=(MI_STATE_INFO_SIZE + keys * MI_STATE_KEY_SIZE + + max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH* + MI_STATE_KEYBLOCK_SIZE+ + key_segs*MI_STATE_KEYSEG_SIZE); + info_length=base_pos+(uint) (MI_BASE_INFO_SIZE+ + keys * MI_KEYDEF_SIZE+ + uniques * MI_UNIQUEDEF_SIZE + + (key_segs + unique_key_parts)*HA_KEYSEG_SIZE+ + columns*MI_COLUMNDEF_SIZE); + DBUG_PRINT("info", ("info_length: %u", info_length)); + /* There are only 16 bits for the total header length. */ + if (info_length > 65535) + { + my_printf_error(0, "MyISAM table '%s' has too many columns and/or " + "indexes and/or unique constraints.", + MYF(0), name + dirname_length(name)); + my_errno= HA_WRONG_CREATE_OPTION; + goto err; + } + + bmove(share.state.header.file_version,(uchar*) myisam_file_magic,4); + ci->old_options=options| (ci->old_options & HA_OPTION_TEMP_COMPRESS_RECORD ? + HA_OPTION_COMPRESS_RECORD | + HA_OPTION_TEMP_COMPRESS_RECORD: 0); + mi_int2store(share.state.header.options,ci->old_options); + mi_int2store(share.state.header.header_length,info_length); + mi_int2store(share.state.header.state_info_length,MI_STATE_INFO_SIZE); + mi_int2store(share.state.header.base_info_length,MI_BASE_INFO_SIZE); + mi_int2store(share.state.header.base_pos,base_pos); + share.state.header.language= (ci->language ? + ci->language : default_charset_info->number); + share.state.header.max_block_size_index= max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH; + + share.state.dellink = HA_OFFSET_ERROR; + share.state.process= (ulong) getpid(); + share.state.unique= (ulong) 0; + share.state.update_count=(ulong) 0; + share.state.version= (ulong) time((time_t*) 0); + share.state.sortkey= (ushort) ~0; + share.state.auto_increment=ci->auto_increment; + share.options=options; + share.base.rec_reflength=pointer; + /* Get estimate for index file length (this may be wrong for FT keys) */ + tmp= (tot_length + max_key_block_length * keys * + MI_INDEX_BLOCK_MARGIN) / MI_MIN_KEY_BLOCK_LENGTH; + /* + use maximum of key_file_length we calculated and key_file_length value we + got from MYI file header (see also myisampack.c:save_state) + */ + share.base.key_reflength= + mi_get_pointer_length(max(ci->key_file_length,tmp),3); + share.base.keys= share.state.header.keys= keys; + share.state.header.uniques= uniques; + share.state.header.fulltext_keys= fulltext_keys; + mi_int2store(share.state.header.key_parts,key_segs); + mi_int2store(share.state.header.unique_key_parts,unique_key_parts); + + mi_set_all_keys_active(share.state.key_map, keys); + aligned_key_start= my_round_up_to_next_power(max_key_block_length ? + max_key_block_length : + myisam_block_size); + + share.base.keystart= share.state.state.key_file_length= + MY_ALIGN(info_length, aligned_key_start); + share.base.max_key_block_length=max_key_block_length; + share.base.max_key_length=ALIGN_SIZE(max_key_length+4); + share.base.records=ci->max_rows; + share.base.reloc= ci->reloc_rows; + share.base.reclength=real_reclength; + share.base.pack_reclength=reclength+ test(options & HA_OPTION_CHECKSUM); + share.base.max_pack_length=pack_reclength; + share.base.min_pack_length=min_pack_length; + share.base.pack_bits=packed; + share.base.fields=fields; + share.base.pack_fields=packed; +#ifdef USE_RAID + share.base.raid_type=ci->raid_type; + share.base.raid_chunks=ci->raid_chunks; + share.base.raid_chunksize=ci->raid_chunksize; +#endif + + /* max_data_file_length and max_key_file_length are recalculated on open */ + if (options & HA_OPTION_TMP_TABLE) + share.base.max_data_file_length=(my_off_t) ci->data_file_length; + + share.base.min_block_length= + (share.base.pack_reclength+3 < MI_EXTEND_BLOCK_LENGTH && + ! share.base.blobs) ? + max(share.base.pack_reclength,MI_MIN_BLOCK_LENGTH) : + MI_EXTEND_BLOCK_LENGTH; + if (! (flags & HA_DONT_TOUCH_DATA)) + share.state.create_time= (long) time((time_t*) 0); + + pthread_mutex_lock(&THR_LOCK_myisam); + + /* + NOTE: For test_if_reopen() we need a real path name. Hence we need + MY_RETURN_REAL_PATH for every fn_format(filename, ...). + */ + if (ci->index_file_name) + { + char *iext= strrchr(ci->index_file_name, '.'); + int have_iext= iext && !strcmp(iext, MI_NAME_IEXT); + if (options & HA_OPTION_TMP_TABLE) + { + char *path; + /* chop off the table name, tempory tables use generated name */ + if ((path= strrchr(ci->index_file_name, FN_LIBCHAR))) + *path= '\0'; + fn_format(filename, name, ci->index_file_name, MI_NAME_IEXT, + MY_REPLACE_DIR | MY_UNPACK_FILENAME | + MY_RETURN_REAL_PATH | MY_APPEND_EXT); + } + else + { + fn_format(filename, ci->index_file_name, "", MI_NAME_IEXT, + MY_UNPACK_FILENAME | MY_RETURN_REAL_PATH | + (have_iext ? MY_REPLACE_EXT : MY_APPEND_EXT)); + } + fn_format(linkname, name, "", MI_NAME_IEXT, + MY_UNPACK_FILENAME|MY_APPEND_EXT); + linkname_ptr=linkname; + /* + Don't create the table if the link or file exists to ensure that one + doesn't accidently destroy another table. + */ + create_flag=0; + } + else + { + char *iext= strrchr(name, '.'); + int have_iext= iext && !strcmp(iext, MI_NAME_IEXT); + fn_format(filename, name, "", MI_NAME_IEXT, + MY_UNPACK_FILENAME | MY_RETURN_REAL_PATH | + (have_iext ? MY_REPLACE_EXT : MY_APPEND_EXT)); + linkname_ptr=0; + /* Replace the current file */ + create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD; + } + + /* + If a MRG_MyISAM table is in use, the mapped MyISAM tables are open, + but no entry is made in the table cache for them. + A TRUNCATE command checks for the table in the cache only and could + be fooled to believe, the table is not open. + Pull the emergency brake in this situation. (Bug #8306) + + NOTE: The filename is compared against unique_file_name of every + open table. Hence we need a real path here. + */ + if (test_if_reopen(filename)) + { + my_printf_error(0, "MyISAM table '%s' is in use " + "(most likely by a MERGE table). Try FLUSH TABLES.", + MYF(0), name + dirname_length(name)); + goto err; + } + + if ((file= my_create_with_symlink(linkname_ptr, filename, 0, create_mode, + MYF(MY_WME | create_flag))) < 0) + goto err; + errpos=1; + + if (!(flags & HA_DONT_TOUCH_DATA)) + { +#ifdef USE_RAID + if (share.base.raid_type) + { + (void) fn_format(filename, name, "", MI_NAME_DEXT, + MY_UNPACK_FILENAME | MY_APPEND_EXT); + if ((dfile=my_raid_create(filename, 0, create_mode, + share.base.raid_type, + share.base.raid_chunks, + share.base.raid_chunksize, + MYF(MY_WME | MY_RAID))) < 0) + goto err; + } + else +#endif + { + if (ci->data_file_name) + { + char *dext= strrchr(ci->data_file_name, '.'); + int have_dext= dext && !strcmp(dext, MI_NAME_DEXT); + + if (options & HA_OPTION_TMP_TABLE) + { + char *path; + /* chop off the table name, tempory tables use generated name */ + if ((path= strrchr(ci->data_file_name, FN_LIBCHAR))) + *path= '\0'; + fn_format(filename, name, ci->data_file_name, MI_NAME_DEXT, + MY_REPLACE_DIR | MY_UNPACK_FILENAME | MY_APPEND_EXT); + } + else + { + fn_format(filename, ci->data_file_name, "", MI_NAME_DEXT, + MY_UNPACK_FILENAME | + (have_dext ? MY_REPLACE_EXT : MY_APPEND_EXT)); + } + + fn_format(linkname, name, "",MI_NAME_DEXT, + MY_UNPACK_FILENAME | MY_APPEND_EXT); + linkname_ptr=linkname; + create_flag=0; + } + else + { + fn_format(filename,name,"", MI_NAME_DEXT, + MY_UNPACK_FILENAME | MY_APPEND_EXT); + linkname_ptr=0; + create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD; + } + if ((dfile= + my_create_with_symlink(linkname_ptr, filename, 0, create_mode, + MYF(MY_WME | create_flag))) < 0) + goto err; + } + errpos=3; + } + + DBUG_PRINT("info", ("write state info and base info")); + if (mi_state_info_write(file, &share.state, 2) || + mi_base_info_write(file, &share.base)) + goto err; +#ifndef DBUG_OFF + if ((uint) my_tell(file,MYF(0)) != base_pos+ MI_BASE_INFO_SIZE) + { + uint pos=(uint) my_tell(file,MYF(0)); + DBUG_PRINT("warning",("base_length: %d != used_length: %d", + base_pos+ MI_BASE_INFO_SIZE, pos)); + } +#endif + + /* Write key and keyseg definitions */ + DBUG_PRINT("info", ("write key and keyseg definitions")); + for (i=0 ; i < share.base.keys - uniques; i++) + { + uint sp_segs=(keydefs[i].flag & HA_SPATIAL) ? 2*SPDIMS : 0; + + if (mi_keydef_write(file, &keydefs[i])) + goto err; + for (j=0 ; j < keydefs[i].keysegs-sp_segs ; j++) + if (mi_keyseg_write(file, &keydefs[i].seg[j])) + goto err; +#ifdef HAVE_SPATIAL + for (j=0 ; j < sp_segs ; j++) + { + HA_KEYSEG sseg; + sseg.type=SPTYPE; + sseg.language= 7; /* Binary */ + sseg.null_bit=0; + sseg.bit_start=0; + sseg.bit_end=0; + sseg.bit_length= 0; + sseg.bit_pos= 0; + sseg.length=SPLEN; + sseg.null_pos=0; + sseg.start=j*SPLEN; + sseg.flag= HA_SWAP_KEY; + if (mi_keyseg_write(file, &sseg)) + goto err; + } +#endif + } + /* Create extra keys for unique definitions */ + offset=reclength-uniques*MI_UNIQUE_HASH_LENGTH; + bzero((char*) &tmp_keydef,sizeof(tmp_keydef)); + bzero((char*) &tmp_keyseg,sizeof(tmp_keyseg)); + for (i=0; i < uniques ; i++) + { + tmp_keydef.keysegs=1; + tmp_keydef.flag= HA_UNIQUE_CHECK; + tmp_keydef.block_length= (uint16)myisam_block_size; + tmp_keydef.keylength= MI_UNIQUE_HASH_LENGTH + pointer; + tmp_keydef.minlength=tmp_keydef.maxlength=tmp_keydef.keylength; + tmp_keyseg.type= MI_UNIQUE_HASH_TYPE; + tmp_keyseg.length= MI_UNIQUE_HASH_LENGTH; + tmp_keyseg.start= offset; + offset+= MI_UNIQUE_HASH_LENGTH; + if (mi_keydef_write(file,&tmp_keydef) || + mi_keyseg_write(file,(&tmp_keyseg))) + goto err; + } + + /* Save unique definition */ + DBUG_PRINT("info", ("write unique definitions")); + for (i=0 ; i < share.state.header.uniques ; i++) + { + HA_KEYSEG *keyseg_end; + keyseg= uniquedefs[i].seg; + if (mi_uniquedef_write(file, &uniquedefs[i])) + goto err; + for (keyseg= uniquedefs[i].seg, keyseg_end= keyseg+ uniquedefs[i].keysegs; + keyseg < keyseg_end; + keyseg++) + { + switch (keyseg->type) { + case HA_KEYTYPE_VARTEXT1: + case HA_KEYTYPE_VARTEXT2: + case HA_KEYTYPE_VARBINARY1: + case HA_KEYTYPE_VARBINARY2: + if (!(keyseg->flag & HA_BLOB_PART)) + { + keyseg->flag|= HA_VAR_LENGTH_PART; + keyseg->bit_start= ((keyseg->type == HA_KEYTYPE_VARTEXT1 || + keyseg->type == HA_KEYTYPE_VARBINARY1) ? + 1 : 2); + } + break; + default: + break; + } + if (mi_keyseg_write(file, keyseg)) + goto err; + } + } + DBUG_PRINT("info", ("write field definitions")); + for (i=0 ; i < share.base.fields ; i++) + if (mi_recinfo_write(file, &recinfo[i])) + goto err; + +#ifndef DBUG_OFF + if ((uint) my_tell(file,MYF(0)) != info_length) + { + uint pos= (uint) my_tell(file,MYF(0)); + DBUG_PRINT("warning",("info_length: %d != used_length: %d", + info_length, pos)); + } +#endif + + /* Enlarge files */ + DBUG_PRINT("info", ("enlarge to keystart: %lu", (ulong) share.base.keystart)); + if (my_chsize(file,(ulong) share.base.keystart,0,MYF(0))) + goto err; + + if (! (flags & HA_DONT_TOUCH_DATA)) + { +#ifdef USE_RELOC + if (my_chsize(dfile,share.base.min_pack_length*ci->reloc_rows,0,MYF(0))) + goto err; +#endif + errpos=2; + if (my_close(dfile,MYF(0))) + goto err; + } + errpos=0; + pthread_mutex_unlock(&THR_LOCK_myisam); + if (my_close(file,MYF(0))) + goto err; + my_free((char*) rec_per_key_part,MYF(0)); + DBUG_RETURN(0); + +err: + pthread_mutex_unlock(&THR_LOCK_myisam); + save_errno=my_errno; + switch (errpos) { + case 3: + VOID(my_close(dfile,MYF(0))); + /* fall through */ + case 2: + /* QQ: T?u should add a call to my_raid_delete() here */ + if (! (flags & HA_DONT_TOUCH_DATA)) + my_delete_with_symlink(fn_format(filename,name,"",MI_NAME_DEXT, + MY_UNPACK_FILENAME | MY_APPEND_EXT), + MYF(0)); + /* fall through */ + case 1: + VOID(my_close(file,MYF(0))); + if (! (flags & HA_DONT_TOUCH_DATA)) + my_delete_with_symlink(fn_format(filename,name,"",MI_NAME_IEXT, + MY_UNPACK_FILENAME | MY_APPEND_EXT), + MYF(0)); + } + my_free((char*) rec_per_key_part, MYF(0)); + DBUG_RETURN(my_errno=save_errno); /* return the fatal errno */ +} + + +uint mi_get_pointer_length(ulonglong file_length, uint def) +{ + DBUG_ASSERT(def >= 2 && def <= 7); + if (file_length) /* If not default */ + { +#ifdef NOT_YET_READY_FOR_8_BYTE_POINTERS + if (file_length >= ULL(1) << 56) + def=8; + else +#endif + if (file_length >= ULL(1) << 48) + def=7; + else if (file_length >= ULL(1) << 40) + def=6; + else if (file_length >= ULL(1) << 32) + def=5; + else if (file_length >= ULL(1) << 24) + def=4; + else if (file_length >= ULL(1) << 16) + def=3; + else + def=2; + } + return def; +} Added: trunk/src/mi_dbug.c =================================================================== --- trunk/src/mi_dbug.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_dbug.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,192 @@ +/* Copyright (C) 2000-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Support rutiner with are using with dbug */ + +#include "myisamdef.h" + + /* Print a key in user understandable format */ + +void _mi_print_key(FILE *stream, register HA_KEYSEG *keyseg, + const uchar *key, uint length) +{ + int flag; + short int s_1; + long int l_1; + float f_1; + double d_1; + const uchar *end; + const uchar *key_end=key+length; + + VOID(fputs("Key: \"",stream)); + flag=0; + for (; keyseg->type && key < key_end ;keyseg++) + { + if (flag++) + VOID(putc('-',stream)); + end= key+ keyseg->length; + if (keyseg->flag & HA_NULL_PART) + { + /* A NULL value is encoded by a 1-byte flag. Zero means NULL. */ + if (! *(key++)) + { + fprintf(stream,"NULL"); + continue; + } + } + + switch (keyseg->type) { + case HA_KEYTYPE_BINARY: + if (!(keyseg->flag & HA_SPACE_PACK) && keyseg->length == 1) + { /* packed binary digit */ + VOID(fprintf(stream,"%d",(uint) *key++)); + break; + } + /* fall through */ + case HA_KEYTYPE_TEXT: + case HA_KEYTYPE_NUM: + if (keyseg->flag & HA_SPACE_PACK) + { + VOID(fprintf(stream,"%.*s",(int) *key,key+1)); + key+= (int) *key+1; + } + else + { + VOID(fprintf(stream,"%.*s",(int) keyseg->length,key)); + key=end; + } + break; + case HA_KEYTYPE_INT8: + VOID(fprintf(stream,"%d",(int) *((signed char*) key))); + key=end; + break; + case HA_KEYTYPE_SHORT_INT: + s_1= mi_sint2korr(key); + VOID(fprintf(stream,"%d",(int) s_1)); + key=end; + break; + case HA_KEYTYPE_USHORT_INT: + { + ushort u_1; + u_1= mi_uint2korr(key); + VOID(fprintf(stream,"%u",(uint) u_1)); + key=end; + break; + } + case HA_KEYTYPE_LONG_INT: + l_1=mi_sint4korr(key); + VOID(fprintf(stream,"%ld",l_1)); + key=end; + break; + case HA_KEYTYPE_ULONG_INT: + l_1=mi_sint4korr(key); + VOID(fprintf(stream,"%lu",(ulong) l_1)); + key=end; + break; + case HA_KEYTYPE_INT24: + VOID(fprintf(stream,"%ld",(long) mi_sint3korr(key))); + key=end; + break; + case HA_KEYTYPE_UINT24: + VOID(fprintf(stream,"%lu",(ulong) mi_uint3korr(key))); + key=end; + break; + case HA_KEYTYPE_FLOAT: + mi_float4get(f_1,key); + VOID(fprintf(stream,"%g",(double) f_1)); + key=end; + break; + case HA_KEYTYPE_DOUBLE: + mi_float8get(d_1,key); + VOID(fprintf(stream,"%g",d_1)); + key=end; + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + { + char buff[21]; + longlong2str(mi_sint8korr(key),buff,-10); + VOID(fprintf(stream,"%s",buff)); + key=end; + break; + } + case HA_KEYTYPE_ULONGLONG: + { + char buff[21]; + longlong2str(mi_sint8korr(key),buff,10); + VOID(fprintf(stream,"%s",buff)); + key=end; + break; + } + case HA_KEYTYPE_BIT: + { + uint i; + fputs("0x",stream); + for (i=0 ; i < keyseg->length ; i++) + fprintf(stream, "%02x", (uint) *key++); + key= end; + break; + } + +#endif + case HA_KEYTYPE_VARTEXT1: /* VARCHAR and TEXT */ + case HA_KEYTYPE_VARTEXT2: /* VARCHAR and TEXT */ + case HA_KEYTYPE_VARBINARY1: /* VARBINARY and BLOB */ + case HA_KEYTYPE_VARBINARY2: /* VARBINARY and BLOB */ + { + uint tmp_length; + get_key_length(tmp_length,key); + /* + The following command sometimes gives a warning from valgrind. + Not yet sure if the bug is in valgrind, glibc or mysqld + */ + VOID(fprintf(stream,"%.*s",(int) tmp_length,key)); + key+=tmp_length; + break; + } + default: break; /* This never happens */ + } + } + VOID(fputs("\"\n",stream)); + return; +} /* print_key */ + + +#ifdef EXTRA_DEBUG + +my_bool check_table_is_closed(const char *name, const char *where) +{ + char filename[FN_REFLEN]; + LIST *pos; + DBUG_ENTER("check_table_is_closed"); + + (void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32); + for (pos=myisam_open_list ; pos ; pos=pos->next) + { + MI_INFO *info=(MI_INFO*) pos->data; + MYISAM_SHARE *share=info->s; + if (!strcmp(share->unique_file_name,filename)) + { + if (share->last_version) + { + fprintf(stderr,"Warning: Table: %s is open on %s\n", name,where); + DBUG_PRINT("warning",("Table: %s is open on %s", name,where)); + DBUG_RETURN(1); + } + } + } + DBUG_RETURN(0); +} +#endif /* EXTRA_DEBUG */ Added: trunk/src/mi_delete.c =================================================================== --- trunk/src/mi_delete.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_delete.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,892 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Remove a row from a MyISAM table */ + +#include "fulltext.h" +#include "rt_index.h" + +static int d_search(MI_INFO *info,MI_KEYDEF *keyinfo,uint comp_flag, + uchar *key,uint key_length,my_off_t page,uchar *anc_buff); +static int del(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,uchar *anc_buff, + my_off_t leaf_page,uchar *leaf_buff,uchar *keypos, + my_off_t next_block,uchar *ret_key); +static int underflow(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *anc_buff, + my_off_t leaf_page,uchar *leaf_buff,uchar *keypos); +static uint remove_key(MI_KEYDEF *keyinfo,uint nod_flag,uchar *keypos, + uchar *lastkey,uchar *page_end, + my_off_t *next_block); +static int _mi_ck_real_delete(register MI_INFO *info,MI_KEYDEF *keyinfo, + uchar *key, uint key_length, my_off_t *root); + + +int mi_delete(MI_INFO *info,const uchar *record) +{ + uint i; + uchar *old_key; + int save_errno; + char lastpos[8]; + + MYISAM_SHARE *share=info->s; + DBUG_ENTER("mi_delete"); + + /* Test if record is in datafile */ + + DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_usage", + mi_print_error(info->s, HA_ERR_CRASHED); + DBUG_RETURN(my_errno= HA_ERR_CRASHED);); + DBUG_EXECUTE_IF("my_error_test_undefined_error", + mi_print_error(info->s, INT_MAX); + DBUG_RETURN(my_errno= INT_MAX);); + if (!(info->update & HA_STATE_AKTIV)) + { + DBUG_RETURN(my_errno=HA_ERR_KEY_NOT_FOUND); /* No database read */ + } + if (share->options & HA_OPTION_READ_ONLY_DATA) + { + DBUG_RETURN(my_errno=EACCES); + } + if (_mi_readinfo(info,F_WRLCK,1)) + DBUG_RETURN(my_errno); + if (info->s->calc_checksum) + info->checksum=(*info->s->calc_checksum)(info,record); + if ((*share->compare_record)(info,record)) + goto err; /* Error on read-check */ + + if (_mi_mark_file_changed(info)) + goto err; + + /* Remove all keys from the .ISAM file */ + + old_key=info->lastkey2; + for (i=0 ; i < share->base.keys ; i++ ) + { + if (mi_is_key_active(info->s->state.key_map, i)) + { + info->s->keyinfo[i].version++; + if (info->s->keyinfo[i].flag & HA_FULLTEXT ) + { + if (_mi_ft_del(info,i, old_key,record,info->lastpos)) + goto err; + } + else + { + if (info->s->keyinfo[i].ck_delete(info,i,old_key, + _mi_make_key(info,i,old_key,record,info->lastpos))) + goto err; + } + /* The above changed info->lastkey2. Inform mi_rnext_same(). */ + info->update&= ~HA_STATE_RNEXT_SAME; + } + } + + if ((*share->delete_record)(info)) + goto err; /* Remove record from database */ + info->state->checksum-=info->checksum; + + info->update= HA_STATE_CHANGED+HA_STATE_DELETED+HA_STATE_ROW_CHANGED; + info->state->records--; + + mi_sizestore(lastpos,info->lastpos); + myisam_log_command(MI_LOG_DELETE,info,(uchar*) lastpos,sizeof(lastpos),0); + VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE)); + allow_break(); /* Allow SIGHUP & SIGINT */ + if (info->invalidator != 0) + { + DBUG_PRINT("info", ("invalidator... '%s' (delete)", info->filename)); + (*info->invalidator)(info->filename); + info->invalidator=0; + } + DBUG_RETURN(0); + +err: + save_errno=my_errno; + mi_sizestore(lastpos,info->lastpos); + myisam_log_command(MI_LOG_DELETE,info,(uchar*) lastpos, sizeof(lastpos),0); + if (save_errno != HA_ERR_RECORD_CHANGED) + { + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); /* mark table crashed */ + } + VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE)); + info->update|=HA_STATE_WRITTEN; /* Buffer changed */ + allow_break(); /* Allow SIGHUP & SIGINT */ + my_errno=save_errno; + if (save_errno == HA_ERR_KEY_NOT_FOUND) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + } + + DBUG_RETURN(my_errno); +} /* mi_delete */ + + + /* Remove a key from the btree index */ + +int _mi_ck_delete(register MI_INFO *info, uint keynr, uchar *key, + uint key_length) +{ + return _mi_ck_real_delete(info, info->s->keyinfo+keynr, key, key_length, + &info->s->state.key_root[keynr]); +} /* _mi_ck_delete */ + + +static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo, + uchar *key, uint key_length, my_off_t *root) +{ + int error; + uint nod_flag; + my_off_t old_root; + uchar *root_buff; + DBUG_ENTER("_mi_ck_real_delete"); + + if ((old_root=*root) == HA_OFFSET_ERROR) + { + mi_print_error(info->s, HA_ERR_CRASHED); + DBUG_RETURN(my_errno=HA_ERR_CRASHED); + } + if (!(root_buff= (uchar*) my_alloca((uint) keyinfo->block_length+ + MI_MAX_KEY_BUFF*2))) + { + DBUG_PRINT("error",("Couldn't allocate memory")); + DBUG_RETURN(my_errno=ENOMEM); + } + DBUG_PRINT("info",("root_page: %ld", (long) old_root)); + if (!_mi_fetch_keypage(info,keyinfo,old_root,DFLT_INIT_HITS,root_buff,0)) + { + error= -1; + goto err; + } + if ((error=d_search(info,keyinfo, + (keyinfo->flag & HA_FULLTEXT ? SEARCH_FIND | SEARCH_UPDATE + : SEARCH_SAME), + key,key_length,old_root,root_buff)) >0) + { + if (error == 2) + { + DBUG_PRINT("test",("Enlarging of root when deleting")); + error=_mi_enlarge_root(info,keyinfo,key,root); + } + else /* error == 1 */ + { + if (mi_getint(root_buff) <= (nod_flag=mi_test_if_nod(root_buff))+3) + { + error=0; + if (nod_flag) + *root=_mi_kpos(nod_flag,root_buff+2+nod_flag); + else + *root=HA_OFFSET_ERROR; + if (_mi_dispose(info,keyinfo,old_root,DFLT_INIT_HITS)) + error= -1; + } + else + error=_mi_write_keypage(info,keyinfo,old_root, + DFLT_INIT_HITS,root_buff); + } + } +err: + my_afree((uchar*) root_buff); + DBUG_PRINT("exit",("Return: %d",error)); + DBUG_RETURN(error); +} /* _mi_ck_real_delete */ + + + /* + ** Remove key below key root + ** Return values: + ** 1 if there are less buffers; In this case anc_buff is not saved + ** 2 if there are more buffers + ** -1 on errors + */ + +static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, + uint comp_flag, uchar *key, uint key_length, + my_off_t page, uchar *anc_buff) +{ + int flag,ret_value,save_flag; + uint length,nod_flag,search_key_length; + my_bool last_key; + uchar *leaf_buff,*keypos; + my_off_t leaf_page,next_block; + uchar lastkey[MI_MAX_KEY_BUFF]; + DBUG_ENTER("d_search"); + DBUG_DUMP("page",(uchar*) anc_buff,mi_getint(anc_buff)); + + search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY; + flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key, search_key_length, + comp_flag, &keypos, lastkey, &last_key); + if (flag == MI_FOUND_WRONG_KEY) + { + DBUG_PRINT("error",("Found wrong key")); + DBUG_RETURN(-1); + } + nod_flag=mi_test_if_nod(anc_buff); + + if (!flag && keyinfo->flag & HA_FULLTEXT) + { + uint off; + int subkeys; + + get_key_full_length_rdonly(off, lastkey); + subkeys=ft_sintXkorr(lastkey+off); + DBUG_ASSERT(info->ft1_to_ft2==0 || subkeys >=0); + comp_flag=SEARCH_SAME; + if (subkeys >= 0) + { + /* normal word, one-level tree structure */ + if (info->ft1_to_ft2) + { + /* we're in ft1->ft2 conversion mode. Saving key data */ + insert_dynamic(info->ft1_to_ft2, (lastkey+off)); + } + else + { + /* we need exact match only if not in ft1->ft2 conversion mode */ + flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key,USE_WHOLE_KEY, + comp_flag, &keypos, lastkey, &last_key); + } + /* fall through to normal delete */ + } + else + { + /* popular word. two-level tree. going down */ + uint tmp_key_length; + my_off_t root; + uchar *kpos=keypos; + + if (!(tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&kpos,lastkey))) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno= HA_ERR_CRASHED; + DBUG_RETURN(-1); + } + root=_mi_dpos(info,nod_flag,kpos); + if (subkeys == -1) + { + /* the last entry in sub-tree */ + if (_mi_dispose(info, keyinfo, root,DFLT_INIT_HITS)) + DBUG_RETURN(-1); + /* fall through to normal delete */ + } + else + { + keyinfo=&info->s->ft2_keyinfo; + kpos-=keyinfo->keylength+nod_flag; /* we'll modify key entry 'in vivo' */ + get_key_full_length_rdonly(off, key); + key+=off; + ret_value=_mi_ck_real_delete(info, &info->s->ft2_keyinfo, + key, HA_FT_WLEN, &root); + _mi_dpointer(info, kpos+HA_FT_WLEN, root); + subkeys++; + ft_intXstore(kpos, subkeys); + if (!ret_value) + ret_value=_mi_write_keypage(info,keyinfo,page, + DFLT_INIT_HITS,anc_buff); + DBUG_PRINT("exit",("Return: %d",ret_value)); + DBUG_RETURN(ret_value); + } + } + } + leaf_buff=0; + LINT_INIT(leaf_page); + if (nod_flag) + { + leaf_page=_mi_kpos(nod_flag,keypos); + if (!(leaf_buff= (uchar*) my_alloca((uint) keyinfo->block_length+ + MI_MAX_KEY_BUFF*2))) + { + DBUG_PRINT("error",("Couldn't allocate memory")); + my_errno=ENOMEM; + DBUG_PRINT("exit",("Return: %d",-1)); + DBUG_RETURN(-1); + } + if (!_mi_fetch_keypage(info,keyinfo,leaf_page,DFLT_INIT_HITS,leaf_buff,0)) + goto err; + } + + if (flag != 0) + { + if (!nod_flag) + { + DBUG_PRINT("error",("Didn't find key")); + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; /* This should newer happend */ + goto err; + } + save_flag=0; + ret_value=d_search(info,keyinfo,comp_flag,key,key_length, + leaf_page,leaf_buff); + } + else + { /* Found key */ + uint tmp; + length=mi_getint(anc_buff); + if (!(tmp= remove_key(keyinfo,nod_flag,keypos,lastkey,anc_buff+length, + &next_block))) + goto err; + + length-= tmp; + + mi_putint(anc_buff,length,nod_flag); + if (!nod_flag) + { /* On leaf page */ + if (_mi_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,anc_buff)) + { + DBUG_PRINT("exit",("Return: %d",-1)); + DBUG_RETURN(-1); + } + /* Page will be update later if we return 1 */ + DBUG_RETURN(test(length <= (info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH : + (uint) keyinfo->underflow_block_length))); + } + save_flag=1; + ret_value=del(info,keyinfo,key,anc_buff,leaf_page,leaf_buff,keypos, + next_block,lastkey); + } + if (ret_value >0) + { + save_flag=1; + if (ret_value == 1) + ret_value= underflow(info,keyinfo,anc_buff,leaf_page,leaf_buff,keypos); + else + { /* This happens only with packed keys */ + DBUG_PRINT("test",("Enlarging of key when deleting")); + if (!_mi_get_last_key(info,keyinfo,anc_buff,lastkey,keypos,&length)) + { + goto err; + } + ret_value=_mi_insert(info,keyinfo,key,anc_buff,keypos,lastkey, + (uchar*) 0,(uchar*) 0,(my_off_t) 0,(my_bool) 0); + } + } + if (ret_value == 0 && mi_getint(anc_buff) > keyinfo->block_length) + { + save_flag=1; + ret_value=_mi_split_page(info,keyinfo,key,anc_buff,lastkey,0) | 2; + } + if (save_flag && ret_value != 1) + ret_value|=_mi_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,anc_buff); + else + { + DBUG_DUMP("page",(uchar*) anc_buff,mi_getint(anc_buff)); + } + my_afree((uchar*) leaf_buff); + DBUG_PRINT("exit",("Return: %d",ret_value)); + DBUG_RETURN(ret_value); + +err: + my_afree((uchar*) leaf_buff); + DBUG_PRINT("exit",("Error: %d",my_errno)); + DBUG_RETURN (-1); +} /* d_search */ + + + /* Remove a key that has a page-reference */ + +static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key, + uchar *anc_buff, my_off_t leaf_page, uchar *leaf_buff, + uchar *keypos, /* Pos to where deleted key was */ + my_off_t next_block, + uchar *ret_key) /* key before keypos in anc_buff */ +{ + int ret_value,length; + uint a_length,nod_flag,tmp; + my_off_t next_page; + uchar keybuff[MI_MAX_KEY_BUFF],*endpos,*next_buff,*key_start, *prev_key; + MYISAM_SHARE *share=info->s; + MI_KEY_PARAM s_temp; + DBUG_ENTER("del"); + DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", (long) leaf_page, + (ulong) keypos)); + DBUG_DUMP("leaf_buff",(uchar*) leaf_buff,mi_getint(leaf_buff)); + + endpos=leaf_buff+mi_getint(leaf_buff); + if (!(key_start=_mi_get_last_key(info,keyinfo,leaf_buff,keybuff,endpos, + &tmp))) + DBUG_RETURN(-1); + + if ((nod_flag=mi_test_if_nod(leaf_buff))) + { + next_page= _mi_kpos(nod_flag,endpos); + if (!(next_buff= (uchar*) my_alloca((uint) keyinfo->block_length+ + MI_MAX_KEY_BUFF*2))) + DBUG_RETURN(-1); + if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,next_buff,0)) + ret_value= -1; + else + { + DBUG_DUMP("next_page",(uchar*) next_buff,mi_getint(next_buff)); + if ((ret_value=del(info,keyinfo,key,anc_buff,next_page,next_buff, + keypos,next_block,ret_key)) >0) + { + endpos=leaf_buff+mi_getint(leaf_buff); + if (ret_value == 1) + { + ret_value=underflow(info,keyinfo,leaf_buff,next_page, + next_buff,endpos); + if (ret_value == 0 && mi_getint(leaf_buff) > keyinfo->block_length) + { + ret_value=_mi_split_page(info,keyinfo,key,leaf_buff,ret_key,0) | 2; + } + } + else + { + DBUG_PRINT("test",("Inserting of key when deleting")); + if (!_mi_get_last_key(info,keyinfo,leaf_buff,keybuff,endpos, + &tmp)) + goto err; + ret_value=_mi_insert(info,keyinfo,key,leaf_buff,endpos,keybuff, + (uchar*) 0,(uchar*) 0,(my_off_t) 0,0); + } + } + if (_mi_write_keypage(info,keyinfo,leaf_page,DFLT_INIT_HITS,leaf_buff)) + goto err; + } + my_afree((uchar*) next_buff); + DBUG_RETURN(ret_value); + } + + /* Remove last key from leaf page */ + + mi_putint(leaf_buff,key_start-leaf_buff,nod_flag); + if (_mi_write_keypage(info,keyinfo,leaf_page,DFLT_INIT_HITS,leaf_buff)) + goto err; + + /* Place last key in ancestor page on deleted key position */ + + a_length=mi_getint(anc_buff); + endpos=anc_buff+a_length; + if (keypos != anc_buff+2+share->base.key_reflength && + !_mi_get_last_key(info,keyinfo,anc_buff,ret_key,keypos,&tmp)) + goto err; + prev_key=(keypos == anc_buff+2+share->base.key_reflength ? + 0 : ret_key); + length=(*keyinfo->pack_key)(keyinfo,share->base.key_reflength, + keypos == endpos ? (uchar*) 0 : keypos, + prev_key, prev_key, + keybuff,&s_temp); + if (length > 0) + bmove_upp((uchar*) endpos+length,(uchar*) endpos,(uint) (endpos-keypos)); + else + bmove(keypos,keypos-length, (int) (endpos-keypos)+length); + (*keyinfo->store_key)(keyinfo,keypos,&s_temp); + /* Save pointer to next leaf */ + if (!(*keyinfo->get_key)(keyinfo,share->base.key_reflength,&keypos,ret_key)) + goto err; + _mi_kpointer(info,keypos - share->base.key_reflength,next_block); + mi_putint(anc_buff,a_length+length,share->base.key_reflength); + + DBUG_RETURN( mi_getint(leaf_buff) <= + (info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH : + (uint) keyinfo->underflow_block_length)); +err: + DBUG_RETURN(-1); +} /* del */ + + + /* Balances adjacent pages if underflow occours */ + +static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo, + uchar *anc_buff, + my_off_t leaf_page,/* Ancestor page and underflow page */ + uchar *leaf_buff, + uchar *keypos) /* Position to pos after key */ +{ + int t_length; + uint length,anc_length,buff_length,leaf_length,p_length,s_length,nod_flag, + key_reflength,key_length; + my_off_t next_page; + uchar anc_key[MI_MAX_KEY_BUFF],leaf_key[MI_MAX_KEY_BUFF], + *buff,*endpos,*next_keypos,*anc_pos,*half_pos,*temp_pos,*prev_key, + *after_key; + MI_KEY_PARAM s_temp; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("underflow"); + DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx",(long) leaf_page, + (ulong) keypos)); + DBUG_DUMP("anc_buff",(uchar*) anc_buff,mi_getint(anc_buff)); + DBUG_DUMP("leaf_buff",(uchar*) leaf_buff,mi_getint(leaf_buff)); + + buff=info->buff; + info->buff_used=1; + next_keypos=keypos; + nod_flag=mi_test_if_nod(leaf_buff); + p_length=nod_flag+2; + anc_length=mi_getint(anc_buff); + leaf_length=mi_getint(leaf_buff); + key_reflength=share->base.key_reflength; + if (info->s->keyinfo+info->lastinx == keyinfo) + info->page_changed=1; + + if ((keypos < anc_buff+anc_length && (info->state->records & 1)) || + keypos == anc_buff+2+key_reflength) + { /* Use page right of anc-page */ + DBUG_PRINT("test",("use right page")); + + if (keyinfo->flag & HA_BINARY_PACK_KEY) + { + if (!(next_keypos=_mi_get_key(info, keyinfo, + anc_buff, buff, keypos, &length))) + goto err; + } + else + { + /* Got to end of found key */ + buff[0]=buff[1]=0; /* Avoid length error check if packed key */ + if (!(*keyinfo->get_key)(keyinfo,key_reflength,&next_keypos, + buff)) + goto err; + } + next_page= _mi_kpos(key_reflength,next_keypos); + if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff,0)) + goto err; + buff_length=mi_getint(buff); + DBUG_DUMP("next",(uchar*) buff,buff_length); + + /* find keys to make a big key-page */ + bmove((uchar*) next_keypos-key_reflength,(uchar*) buff+2, + key_reflength); + if (!_mi_get_last_key(info,keyinfo,anc_buff,anc_key,next_keypos,&length) + || !_mi_get_last_key(info,keyinfo,leaf_buff,leaf_key, + leaf_buff+leaf_length,&length)) + goto err; + + /* merge pages and put parting key from anc_buff between */ + prev_key=(leaf_length == p_length ? (uchar*) 0 : leaf_key); + t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,buff+p_length, + prev_key, prev_key, + anc_key, &s_temp); + length=buff_length-p_length; + endpos=buff+length+leaf_length+t_length; + /* buff will always be larger than before !*/ + bmove_upp((uchar*) endpos, (uchar*) buff+buff_length,length); + memcpy((uchar*) buff, (uchar*) leaf_buff,(size_t) leaf_length); + (*keyinfo->store_key)(keyinfo,buff+leaf_length,&s_temp); + buff_length=(uint) (endpos-buff); + mi_putint(buff,buff_length,nod_flag); + + /* remove key from anc_buff */ + + if (!(s_length=remove_key(keyinfo,key_reflength,keypos,anc_key, + anc_buff+anc_length,(my_off_t *) 0))) + goto err; + + anc_length-=s_length; + mi_putint(anc_buff,anc_length,key_reflength); + + if (buff_length <= keyinfo->block_length) + { /* Keys in one page */ + memcpy((uchar*) leaf_buff,(uchar*) buff,(size_t) buff_length); + if (_mi_dispose(info,keyinfo,next_page,DFLT_INIT_HITS)) + goto err; + } + else + { /* Page is full */ + endpos=anc_buff+anc_length; + DBUG_PRINT("test",("anc_buff: 0x%lx endpos: 0x%lx", + (long) anc_buff, (long) endpos)); + if (keypos != anc_buff+2+key_reflength && + !_mi_get_last_key(info,keyinfo,anc_buff,anc_key,keypos,&length)) + goto err; + if (!(half_pos=_mi_find_half_pos(nod_flag, keyinfo, buff, leaf_key, + &key_length, &after_key))) + goto err; + length=(uint) (half_pos-buff); + memcpy((uchar*) leaf_buff,(uchar*) buff,(size_t) length); + mi_putint(leaf_buff,length,nod_flag); + + /* Correct new keypointer to leaf_page */ + half_pos=after_key; + _mi_kpointer(info,leaf_key+key_length,next_page); + /* Save key in anc_buff */ + prev_key=(keypos == anc_buff+2+key_reflength ? (uchar*) 0 : anc_key), + t_length=(*keyinfo->pack_key)(keyinfo,key_reflength, + (keypos == endpos ? (uchar*) 0 : + keypos), + prev_key, prev_key, + leaf_key, &s_temp); + if (t_length >= 0) + bmove_upp((uchar*) endpos+t_length,(uchar*) endpos, + (uint) (endpos-keypos)); + else + bmove(keypos,keypos-t_length,(uint) (endpos-keypos)+t_length); + (*keyinfo->store_key)(keyinfo,keypos,&s_temp); + mi_putint(anc_buff,(anc_length+=t_length),key_reflength); + + /* Store key first in new page */ + if (nod_flag) + bmove((uchar*) buff+2,(uchar*) half_pos-nod_flag,(size_t) nod_flag); + if (!(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key)) + goto err; + t_length=(int) (*keyinfo->pack_key)(keyinfo, nod_flag, (uchar*) 0, + (uchar*) 0, (uchar *) 0, + leaf_key, &s_temp); + /* t_length will always be > 0 for a new page !*/ + length=(uint) ((buff+mi_getint(buff))-half_pos); + bmove((uchar*) buff+p_length+t_length,(uchar*) half_pos,(size_t) length); + (*keyinfo->store_key)(keyinfo,buff+p_length,&s_temp); + mi_putint(buff,length+t_length+p_length,nod_flag); + + if (_mi_write_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff)) + goto err; + } + if (_mi_write_keypage(info,keyinfo,leaf_page,DFLT_INIT_HITS,leaf_buff)) + goto err; + DBUG_RETURN(anc_length <= ((info->quick_mode ? MI_MIN_BLOCK_LENGTH : + (uint) keyinfo->underflow_block_length))); + } + + DBUG_PRINT("test",("use left page")); + + keypos=_mi_get_last_key(info,keyinfo,anc_buff,anc_key,keypos,&length); + if (!keypos) + goto err; + next_page= _mi_kpos(key_reflength,keypos); + if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff,0)) + goto err; + buff_length=mi_getint(buff); + endpos=buff+buff_length; + DBUG_DUMP("prev",(uchar*) buff,buff_length); + + /* find keys to make a big key-page */ + bmove((uchar*) next_keypos - key_reflength,(uchar*) leaf_buff+2, + key_reflength); + next_keypos=keypos; + if (!(*keyinfo->get_key)(keyinfo,key_reflength,&next_keypos, + anc_key)) + goto err; + if (!_mi_get_last_key(info,keyinfo,buff,leaf_key,endpos,&length)) + goto err; + + /* merge pages and put parting key from anc_buff between */ + prev_key=(leaf_length == p_length ? (uchar*) 0 : leaf_key); + t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, + (leaf_length == p_length ? + (uchar*) 0 : leaf_buff+p_length), + prev_key, prev_key, + anc_key, &s_temp); + if (t_length >= 0) + bmove((uchar*) endpos+t_length,(uchar*) leaf_buff+p_length, + (size_t) (leaf_length-p_length)); + else /* We gained space */ + bmove((uchar*) endpos,(uchar*) leaf_buff+((int) p_length-t_length), + (size_t) (leaf_length-p_length+t_length)); + + (*keyinfo->store_key)(keyinfo,endpos,&s_temp); + buff_length=buff_length+leaf_length-p_length+t_length; + mi_putint(buff,buff_length,nod_flag); + + /* remove key from anc_buff */ + if (!(s_length= remove_key(keyinfo,key_reflength,keypos,anc_key, + anc_buff+anc_length,(my_off_t *) 0))) + goto err; + + anc_length-=s_length; + mi_putint(anc_buff,anc_length,key_reflength); + + if (buff_length <= keyinfo->block_length) + { /* Keys in one page */ + if (_mi_dispose(info,keyinfo,leaf_page,DFLT_INIT_HITS)) + goto err; + } + else + { /* Page is full */ + if (keypos == anc_buff+2+key_reflength) + anc_pos=0; /* First key */ + else if (!_mi_get_last_key(info,keyinfo,anc_buff,anc_pos=anc_key,keypos, + &length)) + goto err; + endpos=_mi_find_half_pos(nod_flag,keyinfo,buff,leaf_key, + &key_length, &half_pos); + if (!endpos) + goto err; + _mi_kpointer(info,leaf_key+key_length,leaf_page); + /* Save key in anc_buff */ + DBUG_DUMP("anc_buff",(uchar*) anc_buff,anc_length); + DBUG_DUMP("key_to_anc",(uchar*) leaf_key,key_length); + + temp_pos=anc_buff+anc_length; + t_length=(*keyinfo->pack_key)(keyinfo,key_reflength, + keypos == temp_pos ? (uchar*) 0 + : keypos, + anc_pos, anc_pos, + leaf_key,&s_temp); + if (t_length > 0) + bmove_upp((uchar*) temp_pos+t_length,(uchar*) temp_pos, + (uint) (temp_pos-keypos)); + else + bmove(keypos,keypos-t_length,(uint) (temp_pos-keypos)+t_length); + (*keyinfo->store_key)(keyinfo,keypos,&s_temp); + mi_putint(anc_buff,(anc_length+=t_length),key_reflength); + + /* Store first key on new page */ + if (nod_flag) + bmove((uchar*) leaf_buff+2,(uchar*) half_pos-nod_flag,(size_t) nod_flag); + if (!(length=(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key))) + goto err; + DBUG_DUMP("key_to_leaf",(uchar*) leaf_key,length); + t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, (uchar*) 0, + (uchar*) 0, (uchar*) 0, leaf_key, &s_temp); + length=(uint) ((buff+buff_length)-half_pos); + DBUG_PRINT("info",("t_length: %d length: %d",t_length,(int) length)); + bmove((uchar*) leaf_buff+p_length+t_length,(uchar*) half_pos, + (size_t) length); + (*keyinfo->store_key)(keyinfo,leaf_buff+p_length,&s_temp); + mi_putint(leaf_buff,length+t_length+p_length,nod_flag); + if (_mi_write_keypage(info,keyinfo,leaf_page,DFLT_INIT_HITS,leaf_buff)) + goto err; + mi_putint(buff,endpos-buff,nod_flag); + } + if (_mi_write_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff)) + goto err; + DBUG_RETURN(anc_length <= (uint) keyinfo->block_length/2); + +err: + DBUG_RETURN(-1); +} /* underflow */ + + + /* + remove a key from packed buffert + The current code doesn't handle the case that the next key may be + packed better against the previous key if there is a case difference + returns how many chars was removed or 0 on error + */ + +static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag, + uchar *keypos, /* Where key starts */ + uchar *lastkey, /* key to be removed */ + uchar *page_end, /* End of page */ + my_off_t *next_block) /* ptr to next block */ +{ + int s_length; + uchar *start; + DBUG_ENTER("remove_key"); + DBUG_PRINT("enter",("keypos: 0x%lx page_end: 0x%lx",(long) keypos, (long) page_end)); + + start=keypos; + if (!(keyinfo->flag & + (HA_PACK_KEY | HA_SPACE_PACK_USED | HA_VAR_LENGTH_KEY | + HA_BINARY_PACK_KEY))) + { + s_length=(int) (keyinfo->keylength+nod_flag); + if (next_block && nod_flag) + *next_block= _mi_kpos(nod_flag,keypos+s_length); + } + else + { /* Let keypos point at next key */ + /* Calculate length of key */ + if (!(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,lastkey)) + DBUG_RETURN(0); /* Error */ + + if (next_block && nod_flag) + *next_block= _mi_kpos(nod_flag,keypos); + s_length=(int) (keypos-start); + if (keypos != page_end) + { + if (keyinfo->flag & HA_BINARY_PACK_KEY) + { + uchar *old_key=start; + uint next_length,prev_length,prev_pack_length; + get_key_length(next_length,keypos); + get_key_pack_length(prev_length,prev_pack_length,old_key); + if (next_length > prev_length) + { + /* We have to copy data from the current key to the next key */ + bmove_upp(keypos, (lastkey+next_length), + (next_length-prev_length)); + keypos-=(next_length-prev_length)+prev_pack_length; + store_key_length(keypos,prev_length); + s_length=(int) (keypos-start); + } + } + else + { + /* Check if a variable length first key part */ + if ((keyinfo->seg->flag & HA_PACK_KEY) && *keypos & 128) + { + /* Next key is packed against the current one */ + uint next_length,prev_length,prev_pack_length,lastkey_length, + rest_length; + if (keyinfo->seg[0].length >= 127) + { + if (!(prev_length=mi_uint2korr(start) & 32767)) + goto end; + next_length=mi_uint2korr(keypos) & 32767; + keypos+=2; + prev_pack_length=2; + } + else + { + if (!(prev_length= *start & 127)) + goto end; /* Same key as previous*/ + next_length= *keypos & 127; + keypos++; + prev_pack_length=1; + } + if (!(*start & 128)) + prev_length=0; /* prev key not packed */ + if (keyinfo->seg[0].flag & HA_NULL_PART) + lastkey++; /* Skip null marker */ + get_key_length(lastkey_length,lastkey); + if (!next_length) /* Same key after */ + { + next_length=lastkey_length; + rest_length=0; + } + else + get_key_length(rest_length,keypos); + + if (next_length >= prev_length) + { /* Key after is based on deleted key */ + uint pack_length,tmp; + bmove_upp(keypos, (lastkey+next_length), + tmp=(next_length-prev_length)); + rest_length+=tmp; + pack_length= prev_length ? get_pack_length(rest_length): 0; + keypos-=tmp+pack_length+prev_pack_length; + s_length=(int) (keypos-start); + if (prev_length) /* Pack against prev key */ + { + *keypos++= start[0]; + if (prev_pack_length == 2) + *keypos++= start[1]; + store_key_length(keypos,rest_length); + } + else + { + /* Next key is not packed anymore */ + if (keyinfo->seg[0].flag & HA_NULL_PART) + { + rest_length++; /* Mark not null */ + } + if (prev_pack_length == 2) + { + mi_int2store(keypos,rest_length); + } + else + *keypos= rest_length; + } + } + } + } + } + } + end: + bmove((uchar*) start,(uchar*) start+s_length, + (uint) (page_end-start-s_length)); + DBUG_RETURN((uint) s_length); +} /* remove_key */ Added: trunk/src/mi_delete_all.c =================================================================== --- trunk/src/mi_delete_all.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_delete_all.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,77 @@ +/* Copyright (C) 2000-2003, 2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Remove all rows from a MyISAM table */ +/* This clears the status information and truncates files */ + +#include "myisamdef.h" + +int mi_delete_all_rows(MI_INFO *info) +{ + uint i; + MYISAM_SHARE *share=info->s; + MI_STATE_INFO *state=&share->state; + DBUG_ENTER("mi_delete_all_rows"); + + if (share->options & HA_OPTION_READ_ONLY_DATA) + { + DBUG_RETURN(my_errno=EACCES); + } + if (_mi_readinfo(info,F_WRLCK,1)) + DBUG_RETURN(my_errno); + if (_mi_mark_file_changed(info)) + goto err; + + info->state->records=info->state->del=state->split=0; + state->dellink = HA_OFFSET_ERROR; + state->sortkey= (ushort) ~0; + info->state->key_file_length=share->base.keystart; + info->state->data_file_length=0; + info->state->empty=info->state->key_empty=0; + info->state->checksum=0; + + for (i=share->base.max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH ; i-- ; ) + state->key_del[i]= HA_OFFSET_ERROR; + for (i=0 ; i < share->base.keys ; i++) + state->key_root[i]= HA_OFFSET_ERROR; + + myisam_log_command(MI_LOG_DELETE_ALL,info,(uchar*) 0,0,0); + /* + If we are using delayed keys or if the user has done changes to the tables + since it was locked then there may be key blocks in the key cache + */ + flush_key_blocks(share->key_cache, share->kfile, FLUSH_IGNORE_CHANGED); + if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)) || + my_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)) ) + goto err; + VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE)); +#ifdef HAVE_MMAP + /* Resize mmaped area */ + rw_wrlock(&info->s->mmap_lock); + mi_remap_file(info, (my_off_t)0); + rw_unlock(&info->s->mmap_lock); +#endif + allow_break(); /* Allow SIGHUP & SIGINT */ + DBUG_RETURN(0); + +err: + { + int save_errno=my_errno; + VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE)); + info->update|=HA_STATE_WRITTEN; /* Buffer changed */ + allow_break(); /* Allow SIGHUP & SIGINT */ + DBUG_RETURN(my_errno=save_errno); + } +} /* mi_delete */ Added: trunk/src/mi_delete_table.c =================================================================== --- trunk/src/mi_delete_table.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_delete_table.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,69 @@ +/* Copyright (C) 2000-2001, 2004, 2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + deletes a table +*/ + +#include "fulltext.h" + +int mi_delete_table(const char *name) +{ + char from[FN_REFLEN]; +#ifdef USE_RAID + uint raid_type=0,raid_chunks=0; +#endif + DBUG_ENTER("mi_delete_table"); + +#ifdef EXTRA_DEBUG + check_table_is_closed(name,"delete"); +#endif +#ifdef USE_RAID + { + MI_INFO *info; + /* + When built with RAID support, we need to determine if this table + makes use of the raid feature. If yes, we need to remove all raid + chunks. This is done with my_raid_delete(). Unfortunately it is + necessary to open the table just to check this. We use + 'open_for_repair' to be able to open even a crashed table. If even + this open fails, we assume no raid configuration for this table + and try to remove the normal data file only. This may however + leave the raid chunks behind. + */ + if (!(info= mi_open(name, O_RDONLY, HA_OPEN_FOR_REPAIR))) + raid_type= 0; + else + { + raid_type= info->s->base.raid_type; + raid_chunks= info->s->base.raid_chunks; + mi_close(info); + } + } +#ifdef EXTRA_DEBUG + check_table_is_closed(name,"delete"); +#endif +#endif /* USE_RAID */ + + fn_format(from,name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); + if (my_delete_with_symlink(from, MYF(MY_WME))) + DBUG_RETURN(my_errno); + fn_format(from,name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); +#ifdef USE_RAID + if (raid_type) + DBUG_RETURN(my_raid_delete(from, raid_chunks, MYF(MY_WME)) ? my_errno : 0); +#endif + DBUG_RETURN(my_delete_with_symlink(from, MYF(MY_WME)) ? my_errno : 0); +} Added: trunk/src/mi_dynrec.c =================================================================== --- trunk/src/mi_dynrec.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_dynrec.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1936 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Functions to handle space-packed-records and blobs + + A row may be stored in one or more linked blocks. + The block size is between MI_MIN_BLOCK_LENGTH and MI_MAX_BLOCK_LENGTH. + Each block is aligned on MI_DYN_ALIGN_SIZE. + The reson for the max block size is to not have too many different types + of blocks. For the differnet block types, look at _mi_get_block_info() +*/ + +#include "myisamdef.h" + +/* Enough for comparing if number is zero */ +static char zero_string[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + +static int write_dynamic_record(MI_INFO *info,const uchar *record, + ulong reclength); +static int _mi_find_writepos(MI_INFO *info,ulong reclength,my_off_t *filepos, + ulong *length); +static int update_dynamic_record(MI_INFO *info,my_off_t filepos,uchar *record, + ulong reclength); +static int delete_dynamic_record(MI_INFO *info,my_off_t filepos, + uint second_read); +static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, + uint length); + +#ifdef THREAD +/* Play it safe; We have a small stack when using threads */ +#undef my_alloca +#undef my_afree +#define my_alloca(A) my_malloc((A),MYF(0)) +#define my_afree(A) my_free((A),MYF(0)) +#endif + + /* Interface function from MI_INFO */ + +#ifdef HAVE_MMAP + +/* + Create mmaped area for MyISAM handler + + SYNOPSIS + mi_dynmap_file() + info MyISAM handler + + RETURN + 0 ok + 1 error. +*/ + +my_bool mi_dynmap_file(MI_INFO *info, my_off_t size) +{ + DBUG_ENTER("mi_dynmap_file"); + if (size > (my_off_t) (~((size_t) 0)) - MEMMAP_EXTRA_MARGIN) + { + DBUG_PRINT("warning", ("File is too large for mmap")); + DBUG_RETURN(1); + } + /* + I wonder if it is good to use MAP_NORESERVE. From the Linux man page: + MAP_NORESERVE + Do not reserve swap space for this mapping. When swap space is + reserved, one has the guarantee that it is possible to modify the + mapping. When swap space is not reserved one might get SIGSEGV + upon a write if no physical memory is available. + */ + info->s->file_map= (uchar*) + my_mmap(0, (size_t)(size + MEMMAP_EXTRA_MARGIN), + info->s->mode==O_RDONLY ? PROT_READ : + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_NORESERVE, + info->dfile, 0L); + if (info->s->file_map == (uchar*) MAP_FAILED) + { + info->s->file_map= NULL; + DBUG_RETURN(1); + } +#if defined(HAVE_MADVISE) + madvise((char*) info->s->file_map, size, MADV_RANDOM); +#endif + info->s->mmaped_length= size; + DBUG_RETURN(0); +} + + +/* + Resize mmaped area for MyISAM handler + + SYNOPSIS + mi_remap_file() + info MyISAM handler + + RETURN +*/ + +void mi_remap_file(MI_INFO *info, my_off_t size) +{ + if (info->s->file_map) + { + VOID(my_munmap((char*) info->s->file_map, + (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN)); + mi_dynmap_file(info, size); + } +} +#endif + + +/* + Read bytes from MySAM handler, using mmap or pread + + SYNOPSIS + mi_mmap_pread() + info MyISAM handler + Buffer Input buffer + Count Count of bytes for read + offset Start position + MyFlags + + RETURN + 0 ok +*/ + +size_t mi_mmap_pread(MI_INFO *info, uchar *Buffer, + size_t Count, my_off_t offset, myf MyFlags) +{ + DBUG_PRINT("info", ("mi_read with mmap %d\n", info->dfile)); + if (info->s->concurrent_insert) + rw_rdlock(&info->s->mmap_lock); + + /* + The following test may fail in the following cases: + - We failed to remap a memory area (fragmented memory?) + - This thread has done some writes, but not yet extended the + memory mapped area. + */ + + if (info->s->mmaped_length >= offset + Count) + { + memcpy(Buffer, info->s->file_map + offset, Count); + if (info->s->concurrent_insert) + rw_unlock(&info->s->mmap_lock); + return 0; + } + else + { + if (info->s->concurrent_insert) + rw_unlock(&info->s->mmap_lock); + return my_pread(info->dfile, Buffer, Count, offset, MyFlags); + } +} + + + /* wrapper for my_pread in case if mmap isn't used */ + +size_t mi_nommap_pread(MI_INFO *info, uchar *Buffer, + size_t Count, my_off_t offset, myf MyFlags) +{ + return my_pread(info->dfile, Buffer, Count, offset, MyFlags); +} + + +/* + Write bytes to MySAM handler, using mmap or pwrite + + SYNOPSIS + mi_mmap_pwrite() + info MyISAM handler + Buffer Output buffer + Count Count of bytes for write + offset Start position + MyFlags + + RETURN + 0 ok + !=0 error. In this case return error from pwrite +*/ + +size_t mi_mmap_pwrite(MI_INFO *info, const uchar *Buffer, + size_t Count, my_off_t offset, myf MyFlags) +{ + DBUG_PRINT("info", ("mi_write with mmap %d\n", info->dfile)); + if (info->s->concurrent_insert) + rw_rdlock(&info->s->mmap_lock); + + /* + The following test may fail in the following cases: + - We failed to remap a memory area (fragmented memory?) + - This thread has done some writes, but not yet extended the + memory mapped area. + */ + + if (info->s->mmaped_length >= offset + Count) + { + memcpy(info->s->file_map + offset, Buffer, Count); + if (info->s->concurrent_insert) + rw_unlock(&info->s->mmap_lock); + return 0; + } + else + { + info->s->nonmmaped_inserts++; + if (info->s->concurrent_insert) + rw_unlock(&info->s->mmap_lock); + return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags); + } + +} + + + /* wrapper for my_pwrite in case if mmap isn't used */ + +size_t mi_nommap_pwrite(MI_INFO *info, const uchar *Buffer, + size_t Count, my_off_t offset, myf MyFlags) +{ + return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags); +} + + +int _mi_write_dynamic_record(MI_INFO *info, const uchar *record) +{ + ulong reclength=_mi_rec_pack(info,info->rec_buff,record); + return (write_dynamic_record(info,info->rec_buff,reclength)); +} + +int _mi_update_dynamic_record(MI_INFO *info, my_off_t pos, const uchar *record) +{ + uint length=_mi_rec_pack(info,info->rec_buff,record); + return (update_dynamic_record(info,pos,info->rec_buff,length)); +} + +int _mi_write_blob_record(MI_INFO *info, const uchar *record) +{ + uchar *rec_buff; + int error; + ulong reclength,reclength2,extra; + + extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ + MI_DYN_DELETE_BLOCK_HEADER+1); + reclength= (info->s->base.pack_reclength + + _my_calc_total_blob_length(info,record)+ extra); +#ifdef NOT_USED /* We now support big rows */ + if (reclength > MI_DYN_MAX_ROW_LENGTH) + { + my_errno=HA_ERR_TO_BIG_ROW; + return -1; + } +#endif + if (!(rec_buff=(uchar*) my_alloca(reclength))) + { + my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */ + return(-1); + } + reclength2= _mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), + record); + DBUG_PRINT("info",("reclength: %lu reclength2: %lu", + reclength, reclength2)); + DBUG_ASSERT(reclength2 <= reclength); + error=write_dynamic_record(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), + reclength2); + my_afree(rec_buff); + return(error); +} + + +int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const uchar *record) +{ + uchar *rec_buff; + int error; + ulong reclength,extra; + + extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ + MI_DYN_DELETE_BLOCK_HEADER); + reclength= (info->s->base.pack_reclength+ + _my_calc_total_blob_length(info,record)+ extra); +#ifdef NOT_USED /* We now support big rows */ + if (reclength > MI_DYN_MAX_ROW_LENGTH) + { + my_errno=HA_ERR_TO_BIG_ROW; + return -1; + } +#endif + if (!(rec_buff=(uchar*) my_alloca(reclength))) + { + my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */ + return(-1); + } + reclength=_mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), + record); + error=update_dynamic_record(info,pos, + rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), + reclength); + my_afree(rec_buff); + return(error); +} + + +int _mi_delete_dynamic_record(MI_INFO *info) +{ + return delete_dynamic_record(info,info->lastpos,0); +} + + + /* Write record to data-file */ + +static int write_dynamic_record(MI_INFO *info, const uchar *record, + ulong reclength) +{ + int flag; + ulong length; + my_off_t filepos; + DBUG_ENTER("write_dynamic_record"); + + flag=0; + do + { + if (_mi_find_writepos(info,reclength,&filepos,&length)) + goto err; + if (_mi_write_part_record(info,filepos,length, + (info->append_insert_at_end ? + HA_OFFSET_ERROR : info->s->state.dellink), + (uchar**) &record,&reclength,&flag)) + goto err; + } while (reclength); + + DBUG_RETURN(0); +err: + DBUG_RETURN(1); +} + + + /* Get a block for data ; The given data-area must be used !! */ + +static int _mi_find_writepos(MI_INFO *info, + ulong reclength, /* record length */ + my_off_t *filepos, /* Return file pos */ + ulong *length) /* length of block at filepos */ +{ + MI_BLOCK_INFO block_info; + ulong tmp; + DBUG_ENTER("_mi_find_writepos"); + + if (info->s->state.dellink != HA_OFFSET_ERROR && + !info->append_insert_at_end) + { + /* Deleted blocks exists; Get last used block */ + *filepos=info->s->state.dellink; + block_info.second_read=0; + info->rec_cache.seek_not_done=1; + if (!(_mi_get_block_info(&block_info,info->dfile,info->s->state.dellink) & + BLOCK_DELETED)) + { + DBUG_PRINT("error",("Delete link crashed")); + my_errno=HA_ERR_WRONG_IN_RECORD; + DBUG_RETURN(-1); + } + info->s->state.dellink=block_info.next_filepos; + info->state->del--; + info->state->empty-= block_info.block_len; + *length= block_info.block_len; + } + else + { + /* No deleted blocks; Allocate a new block */ + *filepos=info->state->data_file_length; + if ((tmp=reclength+3 + test(reclength >= (65520-3))) < + info->s->base.min_block_length) + tmp= info->s->base.min_block_length; + else + tmp= ((tmp+MI_DYN_ALIGN_SIZE-1) & + (~ (ulong) (MI_DYN_ALIGN_SIZE-1))); + if (info->state->data_file_length > + (info->s->base.max_data_file_length - tmp)) + { + my_errno=HA_ERR_RECORD_FILE_FULL; + DBUG_RETURN(-1); + } + if (tmp > MI_MAX_BLOCK_LENGTH) + tmp=MI_MAX_BLOCK_LENGTH; + *length= tmp; + info->state->data_file_length+= tmp; + info->s->state.split++; + info->update|=HA_STATE_WRITE_AT_END; + } + DBUG_RETURN(0); +} /* _mi_find_writepos */ + + + +/* + Unlink a deleted block from the deleted list. + This block will be combined with the preceding or next block to form + a big block. +*/ + +static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info) +{ + DBUG_ENTER("unlink_deleted_block"); + if (block_info->filepos == info->s->state.dellink) + { + /* First deleted block; We can just use this ! */ + info->s->state.dellink=block_info->next_filepos; + } + else + { + MI_BLOCK_INFO tmp; + tmp.second_read=0; + /* Unlink block from the previous block */ + if (!(_mi_get_block_info(&tmp,info->dfile,block_info->prev_filepos) + & BLOCK_DELETED)) + DBUG_RETURN(1); /* Something is wrong */ + mi_sizestore(tmp.header+4,block_info->next_filepos); + if (info->s->file_write(info, tmp.header+4,8, + block_info->prev_filepos+4, MYF(MY_NABP))) + DBUG_RETURN(1); + /* Unlink block from next block */ + if (block_info->next_filepos != HA_OFFSET_ERROR) + { + if (!(_mi_get_block_info(&tmp,info->dfile,block_info->next_filepos) + & BLOCK_DELETED)) + DBUG_RETURN(1); /* Something is wrong */ + mi_sizestore(tmp.header+12,block_info->prev_filepos); + if (info->s->file_write(info, tmp.header+12,8, + block_info->next_filepos+12, + MYF(MY_NABP))) + DBUG_RETURN(1); + } + } + /* We now have one less deleted block */ + info->state->del--; + info->state->empty-= block_info->block_len; + info->s->state.split--; + + /* + If this was a block that we where accessing through table scan + (mi_rrnd() or mi_scan(), then ensure that we skip over this block + when doing next mi_rrnd() or mi_scan(). + */ + if (info->nextpos == block_info->filepos) + info->nextpos+=block_info->block_len; + DBUG_RETURN(0); +} + + +/* + Add a backward link to delete block + + SYNOPSIS + update_backward_delete_link() + info MyISAM handler + delete_block Position to delete block to update. + If this is 'HA_OFFSET_ERROR', nothing will be done + filepos Position to block that 'delete_block' should point to + + RETURN + 0 ok + 1 error. In this case my_error is set. +*/ + +static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block, + my_off_t filepos) +{ + MI_BLOCK_INFO block_info; + DBUG_ENTER("update_backward_delete_link"); + + if (delete_block != HA_OFFSET_ERROR) + { + block_info.second_read=0; + if (_mi_get_block_info(&block_info,info->dfile,delete_block) + & BLOCK_DELETED) + { + uchar buff[8]; + mi_sizestore(buff,filepos); + if (info->s->file_write(info,buff, 8, delete_block+12, MYF(MY_NABP))) + DBUG_RETURN(1); /* Error on write */ + } + else + { + my_errno=HA_ERR_WRONG_IN_RECORD; + DBUG_RETURN(1); /* Wrong delete link */ + } + } + DBUG_RETURN(0); +} + + /* Delete datarecord from database */ + /* info->rec_cache.seek_not_done is updated in cmp_record */ + +static int delete_dynamic_record(MI_INFO *info, my_off_t filepos, + uint second_read) +{ + uint length,b_type; + MI_BLOCK_INFO block_info,del_block; + int error; + my_bool remove_next_block; + DBUG_ENTER("delete_dynamic_record"); + + /* First add a link from the last block to the new one */ + error= update_backward_delete_link(info, info->s->state.dellink, filepos); + + block_info.second_read=second_read; + do + { + /* Remove block at 'filepos' */ + if ((b_type=_mi_get_block_info(&block_info,info->dfile,filepos)) + & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | + BLOCK_FATAL_ERROR) || + (length=(uint) (block_info.filepos-filepos) +block_info.block_len) < + MI_MIN_BLOCK_LENGTH) + { + my_errno=HA_ERR_WRONG_IN_RECORD; + DBUG_RETURN(1); + } + /* Check if next block is a delete block */ + del_block.second_read=0; + remove_next_block=0; + if (_mi_get_block_info(&del_block,info->dfile,filepos+length) & + BLOCK_DELETED && del_block.block_len+length < MI_DYN_MAX_BLOCK_LENGTH) + { + /* We can't remove this yet as this block may be the head block */ + remove_next_block=1; + length+=del_block.block_len; + } + + block_info.header[0]=0; + mi_int3store(block_info.header+1,length); + mi_sizestore(block_info.header+4,info->s->state.dellink); + if (b_type & BLOCK_LAST) + bfill(block_info.header+12,8,255); + else + mi_sizestore(block_info.header+12,block_info.next_filepos); + if (info->s->file_write(info,(uchar*) block_info.header,20,filepos, + MYF(MY_NABP))) + DBUG_RETURN(1); + info->s->state.dellink = filepos; + info->state->del++; + info->state->empty+=length; + filepos=block_info.next_filepos; + + /* Now it's safe to unlink the deleted block directly after this one */ + if (remove_next_block && unlink_deleted_block(info,&del_block)) + error=1; + } while (!(b_type & BLOCK_LAST)); + + DBUG_RETURN(error); +} + + + /* Write a block to datafile */ + +int _mi_write_part_record(MI_INFO *info, + my_off_t filepos, /* points at empty block */ + ulong length, /* length of block */ + my_off_t next_filepos,/* Next empty block */ + uchar **record, /* pointer to record ptr */ + ulong *reclength, /* length of *record */ + int *flag) /* *flag == 0 if header */ +{ + ulong head_length,res_length,extra_length,long_block,del_length; + uchar *pos,*record_end; + my_off_t next_delete_block; + uchar temp[MI_SPLIT_LENGTH+MI_DYN_DELETE_BLOCK_HEADER]; + DBUG_ENTER("_mi_write_part_record"); + + next_delete_block=HA_OFFSET_ERROR; + + res_length=extra_length=0; + if (length > *reclength + MI_SPLIT_LENGTH) + { /* Splitt big block */ + res_length=MY_ALIGN(length- *reclength - MI_EXTEND_BLOCK_LENGTH, + MI_DYN_ALIGN_SIZE); + length-= res_length; /* Use this for first part */ + } + long_block= (length < 65520L && *reclength < 65520L) ? 0 : 1; + if (length == *reclength+ 3 + long_block) + { + /* Block is exactly of the right length */ + temp[0]=(uchar) (1+ *flag)+(uchar) long_block; /* Flag is 0 or 6 */ + if (long_block) + { + mi_int3store(temp+1,*reclength); + head_length=4; + } + else + { + mi_int2store(temp+1,*reclength); + head_length=3; + } + } + else if (length-long_block < *reclength+4) + { /* To short block */ + if (next_filepos == HA_OFFSET_ERROR) + next_filepos= (info->s->state.dellink != HA_OFFSET_ERROR && + !info->append_insert_at_end ? + info->s->state.dellink : info->state->data_file_length); + if (*flag == 0) /* First block */ + { + if (*reclength > MI_MAX_BLOCK_LENGTH) + { + head_length= 16; + temp[0]=13; + mi_int4store(temp+1,*reclength); + mi_int3store(temp+5,length-head_length); + mi_sizestore((uchar*) temp+8,next_filepos); + } + else + { + head_length=5+8+long_block*2; + temp[0]=5+(uchar) long_block; + if (long_block) + { + mi_int3store(temp+1,*reclength); + mi_int3store(temp+4,length-head_length); + mi_sizestore((uchar*) temp+7,next_filepos); + } + else + { + mi_int2store(temp+1,*reclength); + mi_int2store(temp+3,length-head_length); + mi_sizestore((uchar*) temp+5,next_filepos); + } + } + } + else + { + head_length=3+8+long_block; + temp[0]=11+(uchar) long_block; + if (long_block) + { + mi_int3store(temp+1,length-head_length); + mi_sizestore((uchar*) temp+4,next_filepos); + } + else + { + mi_int2store(temp+1,length-head_length); + mi_sizestore((uchar*) temp+3,next_filepos); + } + } + } + else + { /* Block with empty info last */ + head_length=4+long_block; + extra_length= length- *reclength-head_length; + temp[0]= (uchar) (3+ *flag)+(uchar) long_block; /* 3,4 or 9,10 */ + if (long_block) + { + mi_int3store(temp+1,*reclength); + temp[4]= (uchar) (extra_length); + } + else + { + mi_int2store(temp+1,*reclength); + temp[3]= (uchar) (extra_length); + } + length= *reclength+head_length; /* Write only what is needed */ + } + DBUG_DUMP("header",(uchar*) temp,head_length); + + /* Make a long block for one write */ + record_end= *record+length-head_length; + del_length=(res_length ? MI_DYN_DELETE_BLOCK_HEADER : 0); + bmove((uchar*) (*record-head_length),(uchar*) temp,head_length); + memcpy(temp,record_end,(size_t) (extra_length+del_length)); + bzero((uchar*) record_end,extra_length); + + if (res_length) + { + /* Check first if we can join this block with the next one */ + MI_BLOCK_INFO del_block; + my_off_t next_block=filepos+length+extra_length+res_length; + + del_block.second_read=0; + if (next_block < info->state->data_file_length && + info->s->state.dellink != HA_OFFSET_ERROR) + { + if ((_mi_get_block_info(&del_block,info->dfile,next_block) + & BLOCK_DELETED) && + res_length + del_block.block_len < MI_DYN_MAX_BLOCK_LENGTH) + { + if (unlink_deleted_block(info,&del_block)) + goto err; + res_length+=del_block.block_len; + } + } + + /* Create a delete link of the last part of the block */ + pos=record_end+extra_length; + pos[0]= '\0'; + mi_int3store(pos+1,res_length); + mi_sizestore(pos+4,info->s->state.dellink); + bfill(pos+12,8,255); /* End link */ + next_delete_block=info->s->state.dellink; + info->s->state.dellink= filepos+length+extra_length; + info->state->del++; + info->state->empty+=res_length; + info->s->state.split++; + } + if (info->opt_flag & WRITE_CACHE_USED && + info->update & HA_STATE_WRITE_AT_END) + { + if (info->update & HA_STATE_EXTEND_BLOCK) + { + info->update&= ~HA_STATE_EXTEND_BLOCK; + if (my_block_write(&info->rec_cache,(uchar*) *record-head_length, + length+extra_length+del_length,filepos)) + goto err; + } + else if (my_b_write(&info->rec_cache,(uchar*) *record-head_length, + length+extra_length+del_length)) + goto err; + } + else + { + info->rec_cache.seek_not_done=1; + if (info->s->file_write(info,(uchar*) *record-head_length,length+extra_length+ + del_length,filepos,info->s->write_flag)) + goto err; + } + memcpy(record_end,temp,(size_t) (extra_length+del_length)); + *record=record_end; + *reclength-=(length-head_length); + *flag=6; + + if (del_length) + { + /* link the next delete block to this */ + if (update_backward_delete_link(info, next_delete_block, + info->s->state.dellink)) + goto err; + } + + DBUG_RETURN(0); +err: + DBUG_PRINT("exit",("errno: %d",my_errno)); + DBUG_RETURN(1); +} /*_mi_write_part_record */ + + + /* update record from datafile */ + +static int update_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *record, + ulong reclength) +{ + int flag; + uint error; + ulong length; + MI_BLOCK_INFO block_info; + DBUG_ENTER("update_dynamic_record"); + + flag=block_info.second_read=0; + while (reclength > 0) + { + if (filepos != info->s->state.dellink) + { + block_info.next_filepos= HA_OFFSET_ERROR; + if ((error=_mi_get_block_info(&block_info,info->dfile,filepos)) + & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | + BLOCK_FATAL_ERROR)) + { + DBUG_PRINT("error",("Got wrong block info")); + if (!(error & BLOCK_FATAL_ERROR)) + my_errno=HA_ERR_WRONG_IN_RECORD; + goto err; + } + length=(ulong) (block_info.filepos-filepos) + block_info.block_len; + if (length < reclength) + { + uint tmp=MY_ALIGN(reclength - length + 3 + + test(reclength >= 65520L),MI_DYN_ALIGN_SIZE); + /* Don't create a block bigger than MI_MAX_BLOCK_LENGTH */ + tmp= min(length+tmp, MI_MAX_BLOCK_LENGTH)-length; + /* Check if we can extend this block */ + if (block_info.filepos + block_info.block_len == + info->state->data_file_length && + info->state->data_file_length < + info->s->base.max_data_file_length-tmp) + { + /* extend file */ + DBUG_PRINT("info",("Extending file with %d bytes",tmp)); + if (info->nextpos == info->state->data_file_length) + info->nextpos+= tmp; + info->state->data_file_length+= tmp; + info->update|= HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK; + length+=tmp; + } + else if (length < MI_MAX_BLOCK_LENGTH - MI_MIN_BLOCK_LENGTH) + { + /* + Check if next block is a deleted block + Above we have MI_MIN_BLOCK_LENGTH to avoid the problem where + the next block is so small it can't be splited which could + casue problems + */ + + MI_BLOCK_INFO del_block; + del_block.second_read=0; + if (_mi_get_block_info(&del_block,info->dfile, + block_info.filepos + block_info.block_len) & + BLOCK_DELETED) + { + /* Use; Unlink it and extend the current block */ + DBUG_PRINT("info",("Extending current block")); + if (unlink_deleted_block(info,&del_block)) + goto err; + if ((length+=del_block.block_len) > MI_MAX_BLOCK_LENGTH) + { + /* + New block was too big, link overflow part back to + delete list + */ + my_off_t next_pos; + ulong rest_length= length-MI_MAX_BLOCK_LENGTH; + set_if_bigger(rest_length, MI_MIN_BLOCK_LENGTH); + next_pos= del_block.filepos+ del_block.block_len - rest_length; + + if (update_backward_delete_link(info, info->s->state.dellink, + next_pos)) + DBUG_RETURN(1); + + /* create delete link for data that didn't fit into the page */ + del_block.header[0]=0; + mi_int3store(del_block.header+1, rest_length); + mi_sizestore(del_block.header+4,info->s->state.dellink); + bfill(del_block.header+12,8,255); + if (info->s->file_write(info,(uchar*) del_block.header,20, next_pos, + MYF(MY_NABP))) + DBUG_RETURN(1); + info->s->state.dellink= next_pos; + info->s->state.split++; + info->state->del++; + info->state->empty+= rest_length; + length-= rest_length; + } + } + } + } + } + else + { + if (_mi_find_writepos(info,reclength,&filepos,&length)) + goto err; + } + if (_mi_write_part_record(info,filepos,length,block_info.next_filepos, + &record,&reclength,&flag)) + goto err; + if ((filepos=block_info.next_filepos) == HA_OFFSET_ERROR) + { + /* Start writing data on deleted blocks */ + filepos=info->s->state.dellink; + } + } + + if (block_info.next_filepos != HA_OFFSET_ERROR) + if (delete_dynamic_record(info,block_info.next_filepos,1)) + goto err; + DBUG_RETURN(0); +err: + DBUG_RETURN(1); +} + + + /* Pack a record. Return new reclength */ + +uint _mi_rec_pack(MI_INFO *info, register uchar *to, + register const uchar *from) +{ + uint length,new_length,flag,bit,i; + uchar *pos,*end,*startpos,*packpos; + enum en_fieldtype type; + reg3 MI_COLUMNDEF *rec; + MI_BLOB *blob; + DBUG_ENTER("_mi_rec_pack"); + + flag=0 ; bit=1; + startpos=packpos=to; to+= info->s->base.pack_bits; blob=info->blobs; + rec=info->s->rec; + + for (i=info->s->base.fields ; i-- > 0; from+= length,rec++) + { + length=(uint) rec->length; + if ((type = (enum en_fieldtype) rec->type) != FIELD_NORMAL) + { + if (type == FIELD_BLOB) + { + if (!blob->length) + flag|=bit; + else + { + char *temp_pos; + size_t tmp_length=length-mi_portable_sizeof_char_ptr; + memcpy((uchar*) to,from,tmp_length); + memcpy_fixed(&temp_pos,from+tmp_length,sizeof(char*)); + memcpy(to+tmp_length,temp_pos,(size_t) blob->length); + to+=tmp_length+blob->length; + } + blob++; + } + else if (type == FIELD_SKIP_ZERO) + { + if (memcmp((uchar*) from,zero_string,length) == 0) + flag|=bit; + else + { + memcpy((uchar*) to,from,(size_t) length); to+=length; + } + } + else if (type == FIELD_SKIP_ENDSPACE || + type == FIELD_SKIP_PRESPACE) + { + pos= (uchar*) from; end= (uchar*) from + length; + if (type == FIELD_SKIP_ENDSPACE) + { /* Pack trailing spaces */ + while (end > from && *(end-1) == ' ') + end--; + } + else + { /* Pack pref-spaces */ + while (pos < end && *pos == ' ') + pos++; + } + new_length=(uint) (end-pos); + if (new_length +1 + test(rec->length > 255 && new_length > 127) + < length) + { + if (rec->length > 255 && new_length > 127) + { + to[0]=(char) ((new_length & 127)+128); + to[1]=(char) (new_length >> 7); + to+=2; + } + else + *to++= (char) new_length; + memcpy((uchar*) to,pos,(size_t) new_length); to+=new_length; + flag|=bit; + } + else + { + memcpy(to,from,(size_t) length); to+=length; + } + } + else if (type == FIELD_VARCHAR) + { + uint pack_length= HA_VARCHAR_PACKLENGTH(rec->length -1); + uint tmp_length; + if (pack_length == 1) + { + tmp_length= (uint) *(uchar*) from; + *to++= *from; + } + else + { + tmp_length= uint2korr(from); + store_key_length_inc(to,tmp_length); + } + memcpy(to, from+pack_length,tmp_length); + to+= tmp_length; + continue; + } + else + { + memcpy(to,from,(size_t) length); to+=length; + continue; /* Normal field */ + } + if ((bit= bit << 1) >= 256) + { + *packpos++ = (char) (uchar) flag; + bit=1; flag=0; + } + } + else + { + memcpy(to,from,(size_t) length); to+=length; + } + } + if (bit != 1) + *packpos= (char) (uchar) flag; + if (info->s->calc_checksum) + *to++=(char) info->checksum; + DBUG_PRINT("exit",("packed length: %d",(int) (to-startpos))); + DBUG_RETURN((uint) (to-startpos)); +} /* _mi_rec_pack */ + + + +/* + Check if a record was correctly packed. Used only by myisamchk + Returns 0 if record is ok. +*/ + +my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *rec_buff, + ulong packed_length, my_bool with_checksum) +{ + uint length,new_length,flag,bit,i; + uchar *pos,*end,*packpos,*to; + enum en_fieldtype type; + reg3 MI_COLUMNDEF *rec; + DBUG_ENTER("_mi_rec_check"); + + packpos=rec_buff; to= rec_buff+info->s->base.pack_bits; + rec=info->s->rec; + flag= *packpos; bit=1; + + for (i=info->s->base.fields ; i-- > 0; record+= length, rec++) + { + length=(uint) rec->length; + if ((type = (enum en_fieldtype) rec->type) != FIELD_NORMAL) + { + if (type == FIELD_BLOB) + { + uint blob_length= + _mi_calc_blob_length(length-mi_portable_sizeof_char_ptr,record); + if (!blob_length && !(flag & bit)) + goto err; + if (blob_length) + to+=length - mi_portable_sizeof_char_ptr+ blob_length; + } + else if (type == FIELD_SKIP_ZERO) + { + if (memcmp((uchar*) record,zero_string,length) == 0) + { + if (!(flag & bit)) + goto err; + } + else + to+=length; + } + else if (type == FIELD_SKIP_ENDSPACE || + type == FIELD_SKIP_PRESPACE) + { + pos= (uchar*) record; end= (uchar*) record + length; + if (type == FIELD_SKIP_ENDSPACE) + { /* Pack trailing spaces */ + while (end > record && *(end-1) == ' ') + end--; + } + else + { /* Pack pre-spaces */ + while (pos < end && *pos == ' ') + pos++; + } + new_length=(uint) (end-pos); + if (new_length +1 + test(rec->length > 255 && new_length > 127) + < length) + { + if (!(flag & bit)) + goto err; + if (rec->length > 255 && new_length > 127) + { + if (to[0] != (char) ((new_length & 127)+128) || + to[1] != (char) (new_length >> 7)) + goto err; + to+=2; + } + else if (*to++ != (char) new_length) + goto err; + to+=new_length; + } + else + to+=length; + } + else if (type == FIELD_VARCHAR) + { + uint pack_length= HA_VARCHAR_PACKLENGTH(rec->length -1); + uint tmp_length; + if (pack_length == 1) + { + tmp_length= (uint) *(uchar*) record; + to+= 1+ tmp_length; + continue; + } + else + { + tmp_length= uint2korr(record); + to+= get_pack_length(tmp_length)+tmp_length; + } + continue; + } + else + { + to+=length; + continue; /* Normal field */ + } + if ((bit= bit << 1) >= 256) + { + flag= *++packpos; + bit=1; + } + } + else + to+= length; + } + if (packed_length != (uint) (to - rec_buff) + test(info->s->calc_checksum) || + (bit != 1 && (flag & ~(bit - 1)))) + goto err; + if (with_checksum && ((uchar) info->checksum != (uchar) *to)) + { + DBUG_PRINT("error",("wrong checksum for row")); + goto err; + } + DBUG_RETURN(0); + +err: + DBUG_RETURN(1); +} + + + + /* Unpacks a record */ + /* Returns -1 and my_errno =HA_ERR_RECORD_DELETED if reclength isn't */ + /* right. Returns reclength (>0) if ok */ + +ulong _mi_rec_unpack(register MI_INFO *info, register uchar *to, uchar *from, + ulong found_length) +{ + uint flag,bit,length,rec_length,min_pack_length; + enum en_fieldtype type; + uchar *from_end,*to_end,*packpos; + reg3 MI_COLUMNDEF *rec,*end_field; + DBUG_ENTER("_mi_rec_unpack"); + + to_end=to + info->s->base.reclength; + from_end=from+found_length; + flag= (uchar) *from; bit=1; packpos=from; + if (found_length < info->s->base.min_pack_length) + goto err; + from+= info->s->base.pack_bits; + min_pack_length=info->s->base.min_pack_length - info->s->base.pack_bits; + + for (rec=info->s->rec , end_field=rec+info->s->base.fields ; + rec < end_field ; to+= rec_length, rec++) + { + rec_length=rec->length; + if ((type = (enum en_fieldtype) rec->type) != FIELD_NORMAL && + (type != FIELD_CHECK)) + { + if (type == FIELD_VARCHAR) + { + uint pack_length= HA_VARCHAR_PACKLENGTH(rec_length-1); + if (pack_length == 1) + { + length= (uint) *(uchar*) from; + if (length > rec_length-1) + goto err; + *to= *from++; + } + else + { + get_key_length(length, from); + if (length > rec_length-2) + goto err; + int2store(to,length); + } + if (from+length > from_end) + goto err; + memcpy(to+pack_length, from, length); + from+= length; + min_pack_length--; + continue; + } + if (flag & bit) + { + if (type == FIELD_BLOB || type == FIELD_SKIP_ZERO) + bzero((uchar*) to,rec_length); + else if (type == FIELD_SKIP_ENDSPACE || + type == FIELD_SKIP_PRESPACE) + { + if (rec->length > 255 && *from & 128) + { + if (from + 1 >= from_end) + goto err; + length= (*from & 127)+ ((uint) (uchar) *(from+1) << 7); from+=2; + } + else + { + if (from == from_end) + goto err; + length= (uchar) *from++; + } + min_pack_length--; + if (length >= rec_length || + min_pack_length + length > (uint) (from_end - from)) + goto err; + if (type == FIELD_SKIP_ENDSPACE) + { + memcpy(to,(uchar*) from,(size_t) length); + bfill((uchar*) to+length,rec_length-length,' '); + } + else + { + bfill((uchar*) to,rec_length-length,' '); + memcpy(to+rec_length-length,(uchar*) from,(size_t) length); + } + from+=length; + } + } + else if (type == FIELD_BLOB) + { + uint size_length=rec_length- mi_portable_sizeof_char_ptr; + ulong blob_length=_mi_calc_blob_length(size_length,from); + ulong from_left= (ulong) (from_end - from); + if (from_left < size_length || + from_left - size_length < blob_length || + from_left - size_length - blob_length < min_pack_length) + goto err; + memcpy((uchar*) to,(uchar*) from,(size_t) size_length); + from+=size_length; + memcpy_fixed((uchar*) to+size_length,(uchar*) &from,sizeof(char*)); + from+=blob_length; + } + else + { + if (type == FIELD_SKIP_ENDSPACE || type == FIELD_SKIP_PRESPACE) + min_pack_length--; + if (min_pack_length + rec_length > (uint) (from_end - from)) + goto err; + memcpy(to,(uchar*) from,(size_t) rec_length); from+=rec_length; + } + if ((bit= bit << 1) >= 256) + { + flag= (uchar) *++packpos; bit=1; + } + } + else + { + if (min_pack_length > (uint) (from_end - from)) + goto err; + min_pack_length-=rec_length; + memcpy(to, (uchar*) from, (size_t) rec_length); + from+=rec_length; + } + } + if (info->s->calc_checksum) + from++; + if (to == to_end && from == from_end && (bit == 1 || !(flag & ~(bit-1)))) + DBUG_RETURN(found_length); + +err: + my_errno= HA_ERR_WRONG_IN_RECORD; + DBUG_PRINT("error",("to_end: 0x%lx -> 0x%lx from_end: 0x%lx -> 0x%lx", + (long) to, (long) to_end, (long) from, (long) from_end)); + DBUG_DUMP("from",(uchar*) info->rec_buff,info->s->base.min_pack_length); + DBUG_RETURN(MY_FILE_ERROR); +} /* _mi_rec_unpack */ + + + /* Calc length of blob. Update info in blobs->length */ + +ulong _my_calc_total_blob_length(MI_INFO *info, const uchar *record) +{ + ulong length; + MI_BLOB *blob,*end; + + for (length=0, blob= info->blobs, end=blob+info->s->base.blobs ; + blob != end; + blob++) + { + blob->length=_mi_calc_blob_length(blob->pack_length,record + blob->offset); + length+=blob->length; + } + return length; +} + + +ulong _mi_calc_blob_length(uint length, const uchar *pos) +{ + switch (length) { + case 1: + return (uint) (uchar) *pos; + case 2: + return (uint) uint2korr(pos); + case 3: + return uint3korr(pos); + case 4: + return uint4korr(pos); + default: + break; + } + return 0; /* Impossible */ +} + + +void _my_store_blob_length(uchar *pos,uint pack_length,uint length) +{ + switch (pack_length) { + case 1: + *pos= (uchar) length; + break; + case 2: + int2store(pos,length); + break; + case 3: + int3store(pos,length); + break; + case 4: + int4store(pos,length); + default: + break; + } + return; +} + + +/* + Read record from datafile. + + SYNOPSIS + _mi_read_dynamic_record() + info MI_INFO pointer to table. + filepos From where to read the record. + buf Destination for record. + + NOTE + + If a write buffer is active, it needs to be flushed if its contents + intersects with the record to read. We always check if the position + of the first byte of the write buffer is lower than the position + past the last byte to read. In theory this is also true if the write + buffer is completely below the read segment. That is, if there is no + intersection. But this case is unusual. We flush anyway. Only if the + first byte in the write buffer is above the last byte to read, we do + not flush. + + A dynamic record may need several reads. So this check must be done + before every read. Reading a dynamic record starts with reading the + block header. If the record does not fit into the free space of the + header, the block may be longer than the header. In this case a + second read is necessary. These one or two reads repeat for every + part of the record. + + RETURN + 0 OK + -1 Error +*/ + +int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *buf) +{ + int block_of_record; + uint b_type,left_length; + uchar *to; + MI_BLOCK_INFO block_info; + File file; + DBUG_ENTER("mi_read_dynamic_record"); + + if (filepos != HA_OFFSET_ERROR) + { + LINT_INIT(to); + LINT_INIT(left_length); + file=info->dfile; + block_of_record= 0; /* First block of record is numbered as zero. */ + block_info.second_read= 0; + do + { + /* A corrupted table can have wrong pointers. (Bug# 19835) */ + if (filepos == HA_OFFSET_ERROR) + goto panic; + if (info->opt_flag & WRITE_CACHE_USED && + info->rec_cache.pos_in_file < filepos + MI_BLOCK_INFO_HEADER_LENGTH && + flush_io_cache(&info->rec_cache)) + goto err; + info->rec_cache.seek_not_done=1; + if ((b_type= _mi_get_block_info(&block_info, file, filepos)) + & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | + BLOCK_FATAL_ERROR)) + { + if (b_type & (BLOCK_SYNC_ERROR | BLOCK_DELETED)) + my_errno=HA_ERR_RECORD_DELETED; + goto err; + } + if (block_of_record++ == 0) /* First block */ + { + if (block_info.rec_len > (uint) info->s->base.max_pack_length) + goto panic; + if (info->s->base.blobs) + { + if (!(to=mi_alloc_rec_buff(info, block_info.rec_len, + &info->rec_buff))) + goto err; + } + else + to= info->rec_buff; + left_length=block_info.rec_len; + } + if (left_length < block_info.data_len || ! block_info.data_len) + goto panic; /* Wrong linked record */ + /* copy information that is already read */ + { + uint offset= (uint) (block_info.filepos - filepos); + uint prefetch_len= (sizeof(block_info.header) - offset); + filepos+= sizeof(block_info.header); + + if (prefetch_len > block_info.data_len) + prefetch_len= block_info.data_len; + if (prefetch_len) + { + memcpy((uchar*) to, block_info.header + offset, prefetch_len); + block_info.data_len-= prefetch_len; + left_length-= prefetch_len; + to+= prefetch_len; + } + } + /* read rest of record from file */ + if (block_info.data_len) + { + if (info->opt_flag & WRITE_CACHE_USED && + info->rec_cache.pos_in_file < filepos + block_info.data_len && + flush_io_cache(&info->rec_cache)) + goto err; + /* + What a pity that this method is not called 'file_pread' and that + there is no equivalent without seeking. We are at the right + position already. :( + */ + if (info->s->file_read(info, (uchar*) to, block_info.data_len, + filepos, MYF(MY_NABP))) + goto panic; + left_length-=block_info.data_len; + to+=block_info.data_len; + } + filepos= block_info.next_filepos; + } while (left_length); + + info->update|= HA_STATE_AKTIV; /* We have a aktive record */ + fast_mi_writeinfo(info); + DBUG_RETURN(_mi_rec_unpack(info,buf,info->rec_buff,block_info.rec_len) != + MY_FILE_ERROR ? 0 : -1); + } + fast_mi_writeinfo(info); + DBUG_RETURN(-1); /* Wrong data to read */ + +panic: + my_errno=HA_ERR_WRONG_IN_RECORD; +err: + VOID(_mi_writeinfo(info,0)); + DBUG_RETURN(-1); +} + + /* compare unique constraint between stored rows */ + +int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def, + const uchar *record, my_off_t pos) +{ + uchar *rec_buff,*old_record; + int error; + DBUG_ENTER("_mi_cmp_dynamic_unique"); + + if (!(old_record=my_alloca(info->s->base.reclength))) + DBUG_RETURN(1); + + /* Don't let the compare destroy blobs that may be in use */ + rec_buff=info->rec_buff; + if (info->s->base.blobs) + info->rec_buff=0; + error=_mi_read_dynamic_record(info,pos,old_record); + if (!error) + error=mi_unique_comp(def, record, old_record, def->null_are_equal); + if (info->s->base.blobs) + { + my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); + info->rec_buff=rec_buff; + } + my_afree(old_record); + DBUG_RETURN(error); +} + + + /* Compare of record one disk with packed record in memory */ + +int _mi_cmp_dynamic_record(register MI_INFO *info, register const uchar *record) +{ + uint flag,reclength,b_type; + my_off_t filepos; + uchar *buffer; + MI_BLOCK_INFO block_info; + DBUG_ENTER("_mi_cmp_dynamic_record"); + + /* We are going to do changes; dont let anybody disturb */ + dont_break(); /* Dont allow SIGHUP or SIGINT */ + + if (info->opt_flag & WRITE_CACHE_USED) + { + info->update&= ~(HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK); + if (flush_io_cache(&info->rec_cache)) + DBUG_RETURN(-1); + } + info->rec_cache.seek_not_done=1; + + /* If nobody have touched the database we don't have to test rec */ + + buffer=info->rec_buff; + if ((info->opt_flag & READ_CHECK_USED)) + { /* If check isn't disabled */ + if (info->s->base.blobs) + { + if (!(buffer=(uchar*) my_alloca(info->s->base.pack_reclength+ + _my_calc_total_blob_length(info,record)))) + DBUG_RETURN(-1); + } + reclength=_mi_rec_pack(info,buffer,record); + record= buffer; + + filepos=info->lastpos; + flag=block_info.second_read=0; + block_info.next_filepos=filepos; + while (reclength > 0) + { + if ((b_type=_mi_get_block_info(&block_info,info->dfile, + block_info.next_filepos)) + & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | + BLOCK_FATAL_ERROR)) + { + if (b_type & (BLOCK_SYNC_ERROR | BLOCK_DELETED)) + my_errno=HA_ERR_RECORD_CHANGED; + goto err; + } + if (flag == 0) /* First block */ + { + flag=1; + if (reclength != block_info.rec_len) + { + my_errno=HA_ERR_RECORD_CHANGED; + goto err; + } + } else if (reclength < block_info.data_len) + { + my_errno=HA_ERR_WRONG_IN_RECORD; + goto err; + } + reclength-=block_info.data_len; + if (_mi_cmp_buffer(info->dfile,record,block_info.filepos, + block_info.data_len)) + { + my_errno=HA_ERR_RECORD_CHANGED; + goto err; + } + flag=1; + record+=block_info.data_len; + } + } + my_errno=0; +err: + if (buffer != info->rec_buff) + my_afree((uchar*) buffer); + DBUG_RETURN(my_errno); +} + + + /* Compare file to buffert */ + +static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, + uint length) +{ + uint next_length; + uchar temp_buff[IO_SIZE*2]; + DBUG_ENTER("_mi_cmp_buffer"); + + next_length= IO_SIZE*2 - (uint) (filepos & (IO_SIZE-1)); + + while (length > IO_SIZE*2) + { + if (my_pread(file,temp_buff,next_length,filepos, MYF(MY_NABP)) || + memcmp(buff, temp_buff, next_length)) + goto err; + filepos+=next_length; + buff+=next_length; + length-= next_length; + next_length=IO_SIZE*2; + } + if (my_pread(file,temp_buff,length,filepos,MYF(MY_NABP))) + goto err; + DBUG_RETURN(memcmp(buff,temp_buff,length)); +err: + DBUG_RETURN(1); +} + + +/* + Read record from datafile. + + SYNOPSIS + _mi_read_rnd_dynamic_record() + info MI_INFO pointer to table. + buf Destination for record. + filepos From where to read the record. + skip_deleted_blocks If to repeat reading until a non-deleted + record is found. + + NOTE + + If a write buffer is active, it needs to be flushed if its contents + intersects with the record to read. We always check if the position + of the first byte of the write buffer is lower than the position + past the last byte to read. In theory this is also true if the write + buffer is completely below the read segment. That is, if there is no + intersection. But this case is unusual. We flush anyway. Only if the + first byte in the write buffer is above the last byte to read, we do + not flush. + + A dynamic record may need several reads. So this check must be done + before every read. Reading a dynamic record starts with reading the + block header. If the record does not fit into the free space of the + header, the block may be longer than the header. In this case a + second read is necessary. These one or two reads repeat for every + part of the record. + + RETURN + 0 OK + != 0 Error +*/ + +int _mi_read_rnd_dynamic_record(MI_INFO *info, uchar *buf, + register my_off_t filepos, + my_bool skip_deleted_blocks) +{ + int block_of_record, info_read, save_errno; + uint left_len,b_type; + uchar *to; + MI_BLOCK_INFO block_info; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("_mi_read_rnd_dynamic_record"); + + info_read=0; + LINT_INIT(to); + + if (info->lock_type == F_UNLCK) + { +#ifndef UNSAFE_LOCKING + if (share->tot_locks == 0) + { + if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, + MYF(MY_SEEK_NOT_DONE) | info->lock_wait)) + DBUG_RETURN(my_errno); + } +#else + info->tmp_lock_type=F_RDLCK; +#endif + } + else + info_read=1; /* memory-keyinfoblock is ok */ + + block_of_record= 0; /* First block of record is numbered as zero. */ + block_info.second_read= 0; + left_len=1; + do + { + if (filepos >= info->state->data_file_length) + { + if (!info_read) + { /* Check if changed */ + info_read=1; + info->rec_cache.seek_not_done=1; + if (mi_state_info_read_dsk(share->kfile,&share->state,1)) + goto panic; + } + if (filepos >= info->state->data_file_length) + { + my_errno= HA_ERR_END_OF_FILE; + goto err; + } + } + if (info->opt_flag & READ_CACHE_USED) + { + if (_mi_read_cache(&info->rec_cache,(uchar*) block_info.header,filepos, + sizeof(block_info.header), + (!block_of_record && skip_deleted_blocks ? + READING_NEXT : 0) | READING_HEADER)) + goto panic; + b_type=_mi_get_block_info(&block_info,-1,filepos); + } + else + { + if (info->opt_flag & WRITE_CACHE_USED && + info->rec_cache.pos_in_file < filepos + MI_BLOCK_INFO_HEADER_LENGTH && + flush_io_cache(&info->rec_cache)) + DBUG_RETURN(my_errno); + info->rec_cache.seek_not_done=1; + b_type=_mi_get_block_info(&block_info,info->dfile,filepos); + } + + if (b_type & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | + BLOCK_FATAL_ERROR)) + { + if ((b_type & (BLOCK_DELETED | BLOCK_SYNC_ERROR)) + && skip_deleted_blocks) + { + filepos=block_info.filepos+block_info.block_len; + block_info.second_read=0; + continue; /* Search after next_record */ + } + if (b_type & (BLOCK_DELETED | BLOCK_SYNC_ERROR)) + { + my_errno=HA_ERR_RECORD_DELETED; + info->lastpos=block_info.filepos; + info->nextpos=block_info.filepos+block_info.block_len; + } + goto err; + } + if (block_of_record == 0) /* First block */ + { + if (block_info.rec_len > (uint) share->base.max_pack_length) + goto panic; + info->lastpos=filepos; + if (share->base.blobs) + { + if (!(to= mi_alloc_rec_buff(info, block_info.rec_len, + &info->rec_buff))) + goto err; + } + else + to= info->rec_buff; + left_len=block_info.rec_len; + } + if (left_len < block_info.data_len) + goto panic; /* Wrong linked record */ + + /* copy information that is already read */ + { + uint offset=(uint) (block_info.filepos - filepos); + uint tmp_length= (sizeof(block_info.header) - offset); + filepos=block_info.filepos; + + if (tmp_length > block_info.data_len) + tmp_length= block_info.data_len; + if (tmp_length) + { + memcpy((uchar*) to, block_info.header+offset,tmp_length); + block_info.data_len-=tmp_length; + left_len-=tmp_length; + to+=tmp_length; + filepos+=tmp_length; + } + } + /* read rest of record from file */ + if (block_info.data_len) + { + if (info->opt_flag & READ_CACHE_USED) + { + if (_mi_read_cache(&info->rec_cache,(uchar*) to,filepos, + block_info.data_len, + (!block_of_record && skip_deleted_blocks) ? + READING_NEXT : 0)) + goto panic; + } + else + { + if (info->opt_flag & WRITE_CACHE_USED && + info->rec_cache.pos_in_file < + block_info.filepos + block_info.data_len && + flush_io_cache(&info->rec_cache)) + goto err; + /* VOID(my_seek(info->dfile,filepos,MY_SEEK_SET,MYF(0))); */ + if (my_read(info->dfile,(uchar*) to,block_info.data_len,MYF(MY_NABP))) + { + if (my_errno == -1) + my_errno= HA_ERR_WRONG_IN_RECORD; /* Unexpected end of file */ + goto err; + } + } + } + /* + Increment block-of-record counter. If it was the first block, + remember the position behind the block for the next call. + */ + if (block_of_record++ == 0) + { + info->nextpos= block_info.filepos + block_info.block_len; + skip_deleted_blocks= 0; + } + left_len-=block_info.data_len; + to+=block_info.data_len; + filepos=block_info.next_filepos; + } while (left_len); + + info->update|= HA_STATE_AKTIV | HA_STATE_KEY_CHANGED; + fast_mi_writeinfo(info); + if (_mi_rec_unpack(info,buf,info->rec_buff,block_info.rec_len) != + MY_FILE_ERROR) + DBUG_RETURN(0); + DBUG_RETURN(my_errno); /* Wrong record */ + +panic: + my_errno=HA_ERR_WRONG_IN_RECORD; /* Something is fatal wrong */ +err: + save_errno=my_errno; + VOID(_mi_writeinfo(info,0)); + DBUG_RETURN(my_errno=save_errno); +} + + + /* Read and process header from a dynamic-record-file */ + +uint _mi_get_block_info(MI_BLOCK_INFO *info, File file, my_off_t filepos) +{ + uint return_val=0; + uchar *header=info->header; + + if (file >= 0) + { + /* + We do not use my_pread() here because we want to have the file + pointer set to the end of the header after this function. + my_pread() may leave the file pointer untouched. + */ + VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0))); + if (my_read(file, header, sizeof(info->header),MYF(0)) != + sizeof(info->header)) + goto err; + } + DBUG_DUMP("header",header,MI_BLOCK_INFO_HEADER_LENGTH); + if (info->second_read) + { + if (info->header[0] <= 6 || info->header[0] == 13) + return_val=BLOCK_SYNC_ERROR; + } + else + { + if (info->header[0] > 6 && info->header[0] != 13) + return_val=BLOCK_SYNC_ERROR; + } + info->next_filepos= HA_OFFSET_ERROR; /* Dummy if no next block */ + + switch (info->header[0]) { + case 0: + if ((info->block_len=(uint) mi_uint3korr(header+1)) < + MI_MIN_BLOCK_LENGTH || + (info->block_len & (MI_DYN_ALIGN_SIZE -1))) + goto err; + info->filepos=filepos; + info->next_filepos=mi_sizekorr(header+4); + info->prev_filepos=mi_sizekorr(header+12); +#if SIZEOF_OFF_T == 4 + if ((mi_uint4korr(header+4) != 0 && + (mi_uint4korr(header+4) != (ulong) ~0 || + info->next_filepos != (ulong) ~0)) || + (mi_uint4korr(header+12) != 0 && + (mi_uint4korr(header+12) != (ulong) ~0 || + info->prev_filepos != (ulong) ~0))) + goto err; +#endif + return return_val | BLOCK_DELETED; /* Deleted block */ + + case 1: + info->rec_len=info->data_len=info->block_len=mi_uint2korr(header+1); + info->filepos=filepos+3; + return return_val | BLOCK_FIRST | BLOCK_LAST; + case 2: + info->rec_len=info->data_len=info->block_len=mi_uint3korr(header+1); + info->filepos=filepos+4; + return return_val | BLOCK_FIRST | BLOCK_LAST; + + case 13: + info->rec_len=mi_uint4korr(header+1); + info->block_len=info->data_len=mi_uint3korr(header+5); + info->next_filepos=mi_sizekorr(header+8); + info->second_read=1; + info->filepos=filepos+16; + return return_val | BLOCK_FIRST; + + case 3: + info->rec_len=info->data_len=mi_uint2korr(header+1); + info->block_len=info->rec_len+ (uint) header[3]; + info->filepos=filepos+4; + return return_val | BLOCK_FIRST | BLOCK_LAST; + case 4: + info->rec_len=info->data_len=mi_uint3korr(header+1); + info->block_len=info->rec_len+ (uint) header[4]; + info->filepos=filepos+5; + return return_val | BLOCK_FIRST | BLOCK_LAST; + + case 5: + info->rec_len=mi_uint2korr(header+1); + info->block_len=info->data_len=mi_uint2korr(header+3); + info->next_filepos=mi_sizekorr(header+5); + info->second_read=1; + info->filepos=filepos+13; + return return_val | BLOCK_FIRST; + case 6: + info->rec_len=mi_uint3korr(header+1); + info->block_len=info->data_len=mi_uint3korr(header+4); + info->next_filepos=mi_sizekorr(header+7); + info->second_read=1; + info->filepos=filepos+15; + return return_val | BLOCK_FIRST; + + /* The following blocks are identical to 1-6 without rec_len */ + case 7: + info->data_len=info->block_len=mi_uint2korr(header+1); + info->filepos=filepos+3; + return return_val | BLOCK_LAST; + case 8: + info->data_len=info->block_len=mi_uint3korr(header+1); + info->filepos=filepos+4; + return return_val | BLOCK_LAST; + + case 9: + info->data_len=mi_uint2korr(header+1); + info->block_len=info->data_len+ (uint) header[3]; + info->filepos=filepos+4; + return return_val | BLOCK_LAST; + case 10: + info->data_len=mi_uint3korr(header+1); + info->block_len=info->data_len+ (uint) header[4]; + info->filepos=filepos+5; + return return_val | BLOCK_LAST; + + case 11: + info->data_len=info->block_len=mi_uint2korr(header+1); + info->next_filepos=mi_sizekorr(header+3); + info->second_read=1; + info->filepos=filepos+11; + return return_val; + case 12: + info->data_len=info->block_len=mi_uint3korr(header+1); + info->next_filepos=mi_sizekorr(header+4); + info->second_read=1; + info->filepos=filepos+12; + return return_val; + } + +err: + my_errno=HA_ERR_WRONG_IN_RECORD; /* Garbage */ + return BLOCK_ERROR; +} Added: trunk/src/mi_extra.c =================================================================== --- trunk/src/mi_extra.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_extra.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,450 @@ +/* Copyright (C) 2000-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +static void mi_extra_keyflag(MI_INFO *info, enum ha_extra_function function); + + +/* + Set options and buffers to optimize table handling + + SYNOPSIS + mi_extra() + info open table + function operation + extra_arg Pointer to extra argument (normally pointer to ulong) + Used when function is one of: + HA_EXTRA_WRITE_CACHE + HA_EXTRA_CACHE + RETURN VALUES + 0 ok + # error +*/ + +int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) +{ + int error=0; + ulong cache_size; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("mi_extra"); + DBUG_PRINT("enter",("function: %d",(int) function)); + + switch (function) { + case HA_EXTRA_RESET_STATE: /* Reset state (don't free buffers) */ + info->lastinx= 0; /* Use first index as def */ + info->last_search_keypage=info->lastpos= HA_OFFSET_ERROR; + info->page_changed=1; + /* Next/prev gives first/last */ + if (info->opt_flag & READ_CACHE_USED) + { + reinit_io_cache(&info->rec_cache,READ_CACHE,0, + (pbool) (info->lock_type != F_UNLCK), + (pbool) test(info->update & HA_STATE_ROW_CHANGED) + ); + } + info->update= ((info->update & HA_STATE_CHANGED) | HA_STATE_NEXT_FOUND | + HA_STATE_PREV_FOUND); + break; + case HA_EXTRA_CACHE: + if (info->lock_type == F_UNLCK && + (share->options & HA_OPTION_PACK_RECORD)) + { + error=1; /* Not possibly if not locked */ + my_errno=EACCES; + break; + } + if (info->s->file_map) /* Don't use cache if mmap */ + break; +#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) + if ((share->options & HA_OPTION_COMPRESS_RECORD)) + { + pthread_mutex_lock(&share->intern_lock); + if (_mi_memmap_file(info)) + { + /* We don't nead MADV_SEQUENTIAL if small file */ + madvise((char*) share->file_map, share->state.state.data_file_length, + share->state.state.data_file_length <= RECORD_CACHE_SIZE*16 ? + MADV_RANDOM : MADV_SEQUENTIAL); + pthread_mutex_unlock(&share->intern_lock); + break; + } + pthread_mutex_unlock(&share->intern_lock); + } +#endif + if (info->opt_flag & WRITE_CACHE_USED) + { + info->opt_flag&= ~WRITE_CACHE_USED; + if ((error=end_io_cache(&info->rec_cache))) + break; + } + if (!(info->opt_flag & + (READ_CACHE_USED | WRITE_CACHE_USED | MEMMAP_USED))) + { + cache_size= (extra_arg ? *(ulong*) extra_arg : + my_default_record_cache_size); + if (!(init_io_cache(&info->rec_cache,info->dfile, + (uint) min(info->state->data_file_length+1, + cache_size), + READ_CACHE,0L,(pbool) (info->lock_type != F_UNLCK), + MYF(share->write_flag & MY_WAIT_IF_FULL)))) + { + info->opt_flag|=READ_CACHE_USED; + info->update&= ~HA_STATE_ROW_CHANGED; + } + if (share->concurrent_insert) + info->rec_cache.end_of_file=info->state->data_file_length; + } + break; + case HA_EXTRA_REINIT_CACHE: + if (info->opt_flag & READ_CACHE_USED) + { + reinit_io_cache(&info->rec_cache,READ_CACHE,info->nextpos, + (pbool) (info->lock_type != F_UNLCK), + (pbool) test(info->update & HA_STATE_ROW_CHANGED)); + info->update&= ~HA_STATE_ROW_CHANGED; + if (share->concurrent_insert) + info->rec_cache.end_of_file=info->state->data_file_length; + } + break; + case HA_EXTRA_WRITE_CACHE: + if (info->lock_type == F_UNLCK) + { + error=1; /* Not possibly if not locked */ + break; + } + + cache_size= (extra_arg ? *(ulong*) extra_arg : + my_default_record_cache_size); + if (!(info->opt_flag & + (READ_CACHE_USED | WRITE_CACHE_USED | OPT_NO_ROWS)) && + !share->state.header.uniques) + if (!(init_io_cache(&info->rec_cache,info->dfile, cache_size, + WRITE_CACHE,info->state->data_file_length, + (pbool) (info->lock_type != F_UNLCK), + MYF(share->write_flag & MY_WAIT_IF_FULL)))) + { + info->opt_flag|=WRITE_CACHE_USED; + info->update&= ~(HA_STATE_ROW_CHANGED | + HA_STATE_WRITE_AT_END | + HA_STATE_EXTEND_BLOCK); + } + break; + case HA_EXTRA_PREPARE_FOR_UPDATE: + if (info->s->data_file_type != DYNAMIC_RECORD) + break; + /* Remove read/write cache if dynamic rows */ + case HA_EXTRA_NO_CACHE: + if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) + { + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + error=end_io_cache(&info->rec_cache); + /* Sergei will insert full text index caching here */ + } +#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) + if (info->opt_flag & MEMMAP_USED) + madvise((char*) share->file_map, share->state.state.data_file_length, + MADV_RANDOM); +#endif + break; + case HA_EXTRA_FLUSH_CACHE: + if (info->opt_flag & WRITE_CACHE_USED) + { + if ((error=flush_io_cache(&info->rec_cache))) + { + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); /* Fatal error found */ + } + } + break; + case HA_EXTRA_NO_READCHECK: + info->opt_flag&= ~READ_CHECK_USED; /* No readcheck */ + break; + case HA_EXTRA_READCHECK: + info->opt_flag|= READ_CHECK_USED; + break; + case HA_EXTRA_KEYREAD: /* Read only keys to record */ + case HA_EXTRA_REMEMBER_POS: + info->opt_flag |= REMEMBER_OLD_POS; + bmove((uchar*) info->lastkey+share->base.max_key_length*2, + (uchar*) info->lastkey,info->lastkey_length); + info->save_update= info->update; + info->save_lastinx= info->lastinx; + info->save_lastpos= info->lastpos; + info->save_lastkey_length=info->lastkey_length; + if (function == HA_EXTRA_REMEMBER_POS) + break; + /* fall through */ + case HA_EXTRA_KEYREAD_CHANGE_POS: + info->opt_flag |= KEY_READ_USED; + info->read_record=_mi_read_key_record; + break; + case HA_EXTRA_NO_KEYREAD: + case HA_EXTRA_RESTORE_POS: + if (info->opt_flag & REMEMBER_OLD_POS) + { + bmove((uchar*) info->lastkey, + (uchar*) info->lastkey+share->base.max_key_length*2, + info->save_lastkey_length); + info->update= info->save_update | HA_STATE_WRITTEN; + info->lastinx= info->save_lastinx; + info->lastpos= info->save_lastpos; + info->lastkey_length=info->save_lastkey_length; + } + info->read_record= share->read_record; + info->opt_flag&= ~(KEY_READ_USED | REMEMBER_OLD_POS); + break; + case HA_EXTRA_NO_USER_CHANGE: /* Database is somehow locked agains changes */ + info->lock_type= F_EXTRA_LCK; /* Simulate as locked */ + break; + case HA_EXTRA_WAIT_LOCK: + info->lock_wait=0; + break; + case HA_EXTRA_NO_WAIT_LOCK: + info->lock_wait=MY_DONT_WAIT; + break; + case HA_EXTRA_NO_KEYS: + if (info->lock_type == F_UNLCK) + { + error=1; /* Not possibly if not lock */ + break; + } + if (mi_is_any_key_active(share->state.key_map)) + { + MI_KEYDEF *key=share->keyinfo; + uint i; + for (i=0 ; i < share->base.keys ; i++,key++) + { + if (!(key->flag & HA_NOSAME) && info->s->base.auto_key != i+1) + { + mi_clear_key_active(share->state.key_map, i); + info->update|= HA_STATE_CHANGED; + } + } + + if (!share->changed) + { + share->state.changed|= STATE_CHANGED | STATE_NOT_ANALYZED; + share->changed=1; /* Update on close */ + if (!share->global_changed) + { + share->global_changed=1; + share->state.open_count++; + } + } + share->state.state= *info->state; + error=mi_state_info_write(share->kfile,&share->state,1 | 2); + } + break; + case HA_EXTRA_FORCE_REOPEN: + pthread_mutex_lock(&THR_LOCK_myisam); + share->last_version= 0L; /* Impossible version */ + pthread_mutex_unlock(&THR_LOCK_myisam); + break; + case HA_EXTRA_PREPARE_FOR_DELETE: + pthread_mutex_lock(&THR_LOCK_myisam); + share->last_version= 0L; /* Impossible version */ +#ifdef __WIN__REMOVE_OBSOLETE_WORKAROUND + /* Close the isam and data files as Win32 can't drop an open table */ + pthread_mutex_lock(&share->intern_lock); + if (flush_key_blocks(share->key_cache, share->kfile, + (function == HA_EXTRA_FORCE_REOPEN ? + FLUSH_RELEASE : FLUSH_IGNORE_CHANGED))) + { + error=my_errno; + share->changed=1; + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); /* Fatal error found */ + } + if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) + { + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + error=end_io_cache(&info->rec_cache); + } + if (info->lock_type != F_UNLCK && ! info->was_locked) + { + info->was_locked=info->lock_type; + if (mi_lock_database(info,F_UNLCK)) + error=my_errno; + info->lock_type = F_UNLCK; + } + if (share->kfile >= 0) + _mi_decrement_open_count(info); + if (share->kfile >= 0 && my_close(share->kfile,MYF(0))) + error=my_errno; + { + LIST *list_element ; + for (list_element=myisam_open_list ; + list_element ; + list_element=list_element->next) + { + MI_INFO *tmpinfo=(MI_INFO*) list_element->data; + if (tmpinfo->s == info->s) + { + if (tmpinfo->dfile >= 0 && my_close(tmpinfo->dfile,MYF(0))) + error = my_errno; + tmpinfo->dfile= -1; + } + } + } + share->kfile= -1; /* Files aren't open anymore */ + pthread_mutex_unlock(&share->intern_lock); +#endif + pthread_mutex_unlock(&THR_LOCK_myisam); + break; + case HA_EXTRA_FLUSH: + if (!share->temporary) + flush_key_blocks(share->key_cache, share->kfile, FLUSH_KEEP); +#ifdef HAVE_PWRITE + _mi_decrement_open_count(info); +#endif + if (share->not_flushed) + { + share->not_flushed=0; + if (my_sync(share->kfile, MYF(0))) + error= my_errno; + if (my_sync(info->dfile, MYF(0))) + error= my_errno; + if (error) + { + share->changed=1; + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); /* Fatal error found */ + } + } + if (share->base.blobs) + mi_alloc_rec_buff(info, -1, &info->rec_buff); + break; + case HA_EXTRA_NORMAL: /* Theese isn't in use */ + info->quick_mode=0; + break; + case HA_EXTRA_QUICK: + info->quick_mode=1; + break; + case HA_EXTRA_NO_ROWS: + if (!share->state.header.uniques) + info->opt_flag|= OPT_NO_ROWS; + break; + case HA_EXTRA_PRELOAD_BUFFER_SIZE: + info->preload_buff_size= *((ulong *) extra_arg); + break; + case HA_EXTRA_CHANGE_KEY_TO_UNIQUE: + case HA_EXTRA_CHANGE_KEY_TO_DUP: + mi_extra_keyflag(info, function); + break; + case HA_EXTRA_MMAP: +#ifdef HAVE_MMAP + pthread_mutex_lock(&share->intern_lock); + /* + Memory map the data file if it is not already mapped. It is safe + to memory map a file while other threads are using file I/O on it. + Assigning a new address to a function pointer is an atomic + operation. intern_lock prevents that two or more mappings are done + at the same time. + */ + if (!share->file_map) + { + if (mi_dynmap_file(info, share->state.state.data_file_length)) + { + DBUG_PRINT("warning",("mmap failed: errno: %d",errno)); + error= my_errno= errno; + } + else + { + share->file_read= mi_mmap_pread; + share->file_write= mi_mmap_pwrite; + } + } + pthread_mutex_unlock(&share->intern_lock); +#endif + break; + case HA_EXTRA_MARK_AS_LOG_TABLE: + pthread_mutex_lock(&share->intern_lock); + share->is_log_table= TRUE; + pthread_mutex_unlock(&share->intern_lock); + break; + case HA_EXTRA_KEY_CACHE: + case HA_EXTRA_NO_KEY_CACHE: + default: + break; + } + { + char tmp[1]; + tmp[0]=function; + myisam_log_command(MI_LOG_EXTRA,info,(uchar*) tmp,1,error); + } + DBUG_RETURN(error); +} /* mi_extra */ + + +/* + Start/Stop Inserting Duplicates Into a Table, WL#1648. + */ +static void mi_extra_keyflag(MI_INFO *info, enum ha_extra_function function) +{ + uint idx; + + for (idx= 0; idx< info->s->base.keys; idx++) + { + switch (function) { + case HA_EXTRA_CHANGE_KEY_TO_UNIQUE: + info->s->keyinfo[idx].flag|= HA_NOSAME; + break; + case HA_EXTRA_CHANGE_KEY_TO_DUP: + info->s->keyinfo[idx].flag&= ~(HA_NOSAME); + break; + default: + break; + } + } +} + + +int mi_reset(MI_INFO *info) +{ + int error= 0; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("mi_reset"); + /* + Free buffers and reset the following flags: + EXTRA_CACHE, EXTRA_WRITE_CACHE, EXTRA_KEYREAD, EXTRA_QUICK + + If the row buffer cache is large (for dynamic tables), reduce it + to save memory. + */ + if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) + { + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + error= end_io_cache(&info->rec_cache); + } + if (share->base.blobs) + mi_alloc_rec_buff(info, -1, &info->rec_buff); +#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) + if (info->opt_flag & MEMMAP_USED) + madvise((char*) share->file_map, share->state.state.data_file_length, + MADV_RANDOM); +#endif + info->opt_flag&= ~(KEY_READ_USED | REMEMBER_OLD_POS); + info->quick_mode=0; + info->lastinx= 0; /* Use first index as def */ + info->last_search_keypage= info->lastpos= HA_OFFSET_ERROR; + info->page_changed= 1; + info->update= ((info->update & HA_STATE_CHANGED) | HA_STATE_NEXT_FOUND | + HA_STATE_PREV_FOUND); + DBUG_RETURN(error); +} Added: trunk/src/mi_info.c =================================================================== --- trunk/src/mi_info.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_info.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,132 @@ +/* Copyright (C) 2000-2001, 2003-2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Return useful base information for an open table */ + +#include "myisamdef.h" +#ifdef __WIN__ +#include +#endif + + /* Get position to last record */ + +my_off_t mi_position(MI_INFO *info) +{ + return info->lastpos; +} + + +/* Get information about the table */ +/* if flag == 2 one get current info (no sync from database */ + +int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag) +{ + MY_STAT state; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("mi_status"); + + x->recpos = info->lastpos; + if (flag == HA_STATUS_POS) + DBUG_RETURN(0); /* Compatible with ISAM */ + if (!(flag & HA_STATUS_NO_LOCK)) + { + pthread_mutex_lock(&share->intern_lock); + VOID(_mi_readinfo(info,F_RDLCK,0)); + fast_mi_writeinfo(info); + pthread_mutex_unlock(&share->intern_lock); + } + if (flag & HA_STATUS_VARIABLE) + { + x->records = info->state->records; + x->deleted = info->state->del; + x->delete_length = info->state->empty; + x->data_file_length =info->state->data_file_length; + x->index_file_length=info->state->key_file_length; + + x->keys = share->state.header.keys; + x->check_time = share->state.check_time; + x->mean_reclength= x->records ? + (ulong) ((x->data_file_length - x->delete_length) / x->records) : + (ulong) share->min_pack_length; + } + if (flag & HA_STATUS_ERRKEY) + { + x->errkey = info->errkey; + x->dupp_key_pos= info->dupp_key_pos; + } + if (flag & HA_STATUS_CONST) + { + x->reclength = share->base.reclength; + x->max_data_file_length=share->base.max_data_file_length; + x->max_index_file_length=info->s->base.max_key_file_length; + x->filenr = info->dfile; + x->options = share->options; + x->create_time=share->state.create_time; + x->reflength= mi_get_pointer_length(share->base.max_data_file_length, + myisam_data_pointer_size); + x->record_offset= ((share->options & + (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ? + 0L : share->base.pack_reclength); + x->sortkey= -1; /* No clustering */ + x->rec_per_key = share->state.rec_per_key_part; + x->key_map = share->state.key_map; + x->data_file_name = share->data_file_name; + x->index_file_name = share->index_file_name; + } + if ((flag & HA_STATUS_TIME) && !my_fstat(info->dfile,&state,MYF(0))) + x->update_time=state.st_mtime; + else + x->update_time=0; + if (flag & HA_STATUS_AUTO) + { + x->auto_increment= share->state.auto_increment+1; + if (!x->auto_increment) /* This shouldn't happen */ + x->auto_increment= ~(ulonglong) 0; + } + DBUG_RETURN(0); +} + + +/* + Write a message to the error log. + + SYNOPSIS + mi_report_error() + file_name Name of table file (e.g. index_file_name). + errcode Error number. + + DESCRIPTION + This function supplies my_error() with a table name. Most error + messages need one. Since string arguments in error messages are limited + to 64 characters by convention, we ensure that in case of truncation, + that the end of the index file path is in the message. This contains + the most valuable information (the table name and the database name). + + RETURN + void +*/ + +void mi_report_error(int errcode, const char *file_name) +{ + size_t lgt; + DBUG_ENTER("mi_report_error"); + DBUG_PRINT("enter",("errcode %d, table '%s'", errcode, file_name)); + + if ((lgt= strlen(file_name)) > 64) + file_name+= lgt - 64; + my_error(errcode, MYF(ME_NOREFRESH), file_name); + DBUG_VOID_RETURN; +} + Added: trunk/src/mi_key.c =================================================================== --- trunk/src/mi_key.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_key.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,568 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Functions to handle keys */ + +#include "myisamdef.h" +#include "m_ctype.h" +#include "sp_defs.h" +#ifdef HAVE_IEEEFP_H +#include +#endif + +#define CHECK_KEYS /* Enable safety checks */ + +#define FIX_LENGTH(cs, pos, length, char_length) \ + do { \ + if (length > char_length) \ + char_length= my_charpos(cs, pos, pos+length, char_length); \ + set_if_smaller(char_length,length); \ + } while(0) + +static int _mi_put_key_in_record(MI_INFO *info,uint keynr,uchar *record); + +/* + Make a intern key from a record + + SYNOPSIS + _mi_make_key() + info MyiSAM handler + keynr key number + key Store created key here + record Record + filepos Position to record in the data file + + RETURN + Length of key +*/ + +uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, + const uchar *record, my_off_t filepos) +{ + uchar *pos; + uchar *start; + reg1 HA_KEYSEG *keyseg; + my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT; + DBUG_ENTER("_mi_make_key"); + + if (info->s->keyinfo[keynr].flag & HA_SPATIAL) + { + /* + TODO: nulls processing + */ +#ifdef HAVE_SPATIAL + DBUG_RETURN(sp_make_key(info,keynr,key,record,filepos)); +#else + DBUG_ASSERT(0); /* mi_open should check that this never happens*/ +#endif + } + + start=key; + for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++) + { + enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type; + uint length=keyseg->length; + uint char_length; + CHARSET_INFO *cs=keyseg->charset; + + if (keyseg->null_bit) + { + if (record[keyseg->null_pos] & keyseg->null_bit) + { + *key++= 0; /* NULL in key */ + continue; + } + *key++=1; /* Not NULL */ + } + + char_length= ((!is_ft && cs && cs->mbmaxlen > 1) ? length/cs->mbmaxlen : + length); + + pos= (uchar*) record+keyseg->start; + if (type == HA_KEYTYPE_BIT) + { + if (keyseg->bit_length) + { + uchar bits= get_rec_bits((uchar*) record + keyseg->bit_pos, + keyseg->bit_start, keyseg->bit_length); + *key++= bits; + length--; + } + memcpy((uchar*) key, pos, length); + key+= length; + continue; + } + if (keyseg->flag & HA_SPACE_PACK) + { + if (type != HA_KEYTYPE_NUM) + { + length= cs->cset->lengthsp(cs, (char*) pos, length); + } + else + { + uchar *end= pos + length; + while (pos < end && pos[0] == ' ') + pos++; + length=(uint) (end-pos); + } + FIX_LENGTH(cs, pos, length, char_length); + store_key_length_inc(key,char_length); + memcpy((uchar*) key,(uchar*) pos,(size_t) char_length); + key+=char_length; + continue; + } + if (keyseg->flag & HA_VAR_LENGTH_PART) + { + uint pack_length= (keyseg->bit_start == 1 ? 1 : 2); + uint tmp_length= (pack_length == 1 ? (uint) *(uchar*) pos : + uint2korr(pos)); + pos+= pack_length; /* Skip VARCHAR length */ + set_if_smaller(length,tmp_length); + FIX_LENGTH(cs, pos, length, char_length); + store_key_length_inc(key,char_length); + memcpy((uchar*) key,(uchar*) pos,(size_t) char_length); + key+= char_length; + continue; + } + else if (keyseg->flag & HA_BLOB_PART) + { + uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos); + memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*)); + set_if_smaller(length,tmp_length); + FIX_LENGTH(cs, pos, length, char_length); + store_key_length_inc(key,char_length); + memcpy((uchar*) key,(uchar*) pos,(size_t) char_length); + key+= char_length; + continue; + } + else if (keyseg->flag & HA_SWAP_KEY) + { /* Numerical column */ +#ifdef HAVE_ISNAN + if (type == HA_KEYTYPE_FLOAT) + { + float nr; + float4get(nr,pos); + if (isnan(nr)) + { + /* Replace NAN with zero */ + bzero(key,length); + key+=length; + continue; + } + } + else if (type == HA_KEYTYPE_DOUBLE) + { + double nr; + float8get(nr,pos); + if (isnan(nr)) + { + bzero(key,length); + key+=length; + continue; + } + } +#endif + pos+=length; + while (length--) + { + *key++ = *--pos; + } + continue; + } + FIX_LENGTH(cs, pos, length, char_length); + memcpy((uchar*) key, pos, char_length); + if (length > char_length) + cs->cset->fill(cs, (char*) key+char_length, length-char_length, ' '); + key+= length; + } + _mi_dpointer(info,key,filepos); + DBUG_PRINT("exit",("keynr: %d",keynr)); + DBUG_DUMP("key",(uchar*) start,(uint) (key-start)+keyseg->length); + DBUG_EXECUTE("key", + _mi_print_key(DBUG_FILE,info->s->keyinfo[keynr].seg,start, + (uint) (key-start));); + DBUG_RETURN((uint) (key-start)); /* Return keylength */ +} /* _mi_make_key */ + + +/* + Pack a key to intern format from given format (c_rkey) + + SYNOPSIS + _mi_pack_key() + info MyISAM handler + uint keynr key number + key Store packed key here + old Not packed key + keypart_map bitmap of used keyparts + last_used_keyseg out parameter. May be NULL + + RETURN + length of packed key + + last_use_keyseg Store pointer to the keyseg after the last used one +*/ + +uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, + key_part_map keypart_map, HA_KEYSEG **last_used_keyseg) +{ + uchar *start_key=key; + HA_KEYSEG *keyseg; + my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT; + DBUG_ENTER("_mi_pack_key"); + + /* "one part" rtree key is 2*SPDIMS part key in MyISAM */ + if (info->s->keyinfo[keynr].key_alg == HA_KEY_ALG_RTREE) + keypart_map= (((key_part_map)1) << (2*SPDIMS)) - 1; + + /* only key prefixes are supported */ + DBUG_ASSERT(((keypart_map+1) & keypart_map) == 0); + + for (keyseg= info->s->keyinfo[keynr].seg ; keyseg->type && keypart_map; + old+= keyseg->length, keyseg++) + { + enum ha_base_keytype type= (enum ha_base_keytype) keyseg->type; + uint length= keyseg->length; + uint char_length; + uchar *pos; + CHARSET_INFO *cs=keyseg->charset; + + keypart_map>>= 1; + if (keyseg->null_bit) + { + if (!(*key++= (char) 1-*old++)) /* Copy null marker */ + { + if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) + old+= 2; + continue; /* Found NULL */ + } + } + char_length= (!is_ft && cs && cs->mbmaxlen > 1) ? length/cs->mbmaxlen : length; + pos=old; + if (keyseg->flag & HA_SPACE_PACK) + { + uchar *end=pos+length; + if (type == HA_KEYTYPE_NUM) + { + while (pos < end && pos[0] == ' ') + pos++; + } + else if (type != HA_KEYTYPE_BINARY) + { + while (end > pos && end[-1] == ' ') + end--; + } + length=(uint) (end-pos); + FIX_LENGTH(cs, pos, length, char_length); + store_key_length_inc(key,char_length); + memcpy((uchar*) key,pos,(size_t) char_length); + key+= char_length; + continue; + } + else if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) + { + /* Length of key-part used with mi_rkey() always 2 */ + uint tmp_length=uint2korr(pos); + pos+=2; + set_if_smaller(length,tmp_length); /* Safety */ + FIX_LENGTH(cs, pos, length, char_length); + store_key_length_inc(key,char_length); + old+=2; /* Skip length */ + memcpy((uchar*) key, pos,(size_t) char_length); + key+= char_length; + continue; + } + else if (keyseg->flag & HA_SWAP_KEY) + { /* Numerical column */ + pos+=length; + while (length--) + *key++ = *--pos; + continue; + } + FIX_LENGTH(cs, pos, length, char_length); + memcpy((uchar*) key, pos, char_length); + if (length > char_length) + cs->cset->fill(cs, (char*) key+char_length, length-char_length, ' '); + key+= length; + } + if (last_used_keyseg) + *last_used_keyseg= keyseg; + + DBUG_RETURN((uint) (key-start_key)); +} /* _mi_pack_key */ + + + +/* + Store found key in record + + SYNOPSIS + _mi_put_key_in_record() + info MyISAM handler + keynr Key number that was used + record Store key here + + Last read key is in info->lastkey + + NOTES + Used when only-keyread is wanted + + RETURN + 0 ok + 1 error +*/ + +static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, + uchar *record) +{ + reg2 uchar *key; + uchar *pos,*key_end; + reg1 HA_KEYSEG *keyseg; + uchar *blob_ptr; + DBUG_ENTER("_mi_put_key_in_record"); + + blob_ptr= (uchar*) info->lastkey2; /* Place to put blob parts */ + key=(uchar*) info->lastkey; /* KEy that was read */ + key_end=key+info->lastkey_length; + for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++) + { + if (keyseg->null_bit) + { + if (!*key++) + { + record[keyseg->null_pos]|= keyseg->null_bit; + continue; + } + record[keyseg->null_pos]&= ~keyseg->null_bit; + } + if (keyseg->type == HA_KEYTYPE_BIT) + { + uint length= keyseg->length; + + if (keyseg->bit_length) + { + uchar bits= *key++; + set_rec_bits(bits, record + keyseg->bit_pos, keyseg->bit_start, + keyseg->bit_length); + length--; + } + else + { + clr_rec_bits(record + keyseg->bit_pos, keyseg->bit_start, + keyseg->bit_length); + } + memcpy(record + keyseg->start, (uchar*) key, length); + key+= length; + continue; + } + if (keyseg->flag & HA_SPACE_PACK) + { + uint length; + get_key_length(length,key); +#ifdef CHECK_KEYS + if (length > keyseg->length || key+length > key_end) + goto err; +#endif + pos= record+keyseg->start; + if (keyseg->type != (int) HA_KEYTYPE_NUM) + { + memcpy(pos,key,(size_t) length); + keyseg->charset->cset->fill(keyseg->charset, + (char*) pos + length, + keyseg->length - length, + ' '); + } + else + { + bfill(pos,keyseg->length-length,' '); + memcpy(pos+keyseg->length-length,key,(size_t) length); + } + key+=length; + continue; + } + + if (keyseg->flag & HA_VAR_LENGTH_PART) + { + uint length; + get_key_length(length,key); +#ifdef CHECK_KEYS + if (length > keyseg->length || key+length > key_end) + goto err; +#endif + /* Store key length */ + if (keyseg->bit_start == 1) + *(uchar*) (record+keyseg->start)= (uchar) length; + else + int2store(record+keyseg->start, length); + /* And key data */ + memcpy(record+keyseg->start + keyseg->bit_start, (uchar*) key, length); + key+= length; + } + else if (keyseg->flag & HA_BLOB_PART) + { + uint length; + get_key_length(length,key); +#ifdef CHECK_KEYS + if (length > keyseg->length || key+length > key_end) + goto err; +#endif + memcpy(record+keyseg->start+keyseg->bit_start, + (char*) &blob_ptr,sizeof(char*)); + memcpy(blob_ptr,key,length); + blob_ptr+=length; + + /* The above changed info->lastkey2. Inform mi_rnext_same(). */ + info->update&= ~HA_STATE_RNEXT_SAME; + + _my_store_blob_length(record+keyseg->start, + (uint) keyseg->bit_start,length); + key+=length; + } + else if (keyseg->flag & HA_SWAP_KEY) + { + uchar *to= record+keyseg->start+keyseg->length; + uchar *end= key+keyseg->length; +#ifdef CHECK_KEYS + if (end > key_end) + goto err; +#endif + do + { + *--to= *key++; + } while (key != end); + continue; + } + else + { +#ifdef CHECK_KEYS + if (key+keyseg->length > key_end) + goto err; +#endif + memcpy(record+keyseg->start,(uchar*) key, + (size_t) keyseg->length); + key+= keyseg->length; + } + } + DBUG_RETURN(0); + +err: + DBUG_RETURN(1); /* Crashed row */ +} /* _mi_put_key_in_record */ + + + /* Here when key reads are used */ + +int _mi_read_key_record(MI_INFO *info, my_off_t filepos, uchar *buf) +{ + fast_mi_writeinfo(info); + if (filepos != HA_OFFSET_ERROR) + { + if (info->lastinx >= 0) + { /* Read only key */ + if (_mi_put_key_in_record(info,(uint) info->lastinx,buf)) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + return -1; + } + info->update|= HA_STATE_AKTIV; /* We should find a record */ + return 0; + } + my_errno=HA_ERR_WRONG_INDEX; + } + return(-1); /* Wrong data to read */ +} + + +/* + Retrieve auto_increment info + + SYNOPSIS + retrieve_auto_increment() + info MyISAM handler + record Row to update + + IMPLEMENTATION + For signed columns we don't retrieve the auto increment value if it's + less than zero. +*/ + +ulonglong retrieve_auto_increment(MI_INFO *info,const uchar *record) +{ + ulonglong value= 0; /* Store unsigned values here */ + longlong s_value= 0; /* Store signed values here */ + HA_KEYSEG *keyseg= info->s->keyinfo[info->s->base.auto_key-1].seg; + const uchar *key= (uchar*) record + keyseg->start; + + switch (keyseg->type) { + case HA_KEYTYPE_INT8: + s_value= (longlong) *(char*)key; + break; + case HA_KEYTYPE_BINARY: + value=(ulonglong) *(uchar*) key; + break; + case HA_KEYTYPE_SHORT_INT: + s_value= (longlong) sint2korr(key); + break; + case HA_KEYTYPE_USHORT_INT: + value=(ulonglong) uint2korr(key); + break; + case HA_KEYTYPE_LONG_INT: + s_value= (longlong) sint4korr(key); + break; + case HA_KEYTYPE_ULONG_INT: + value=(ulonglong) uint4korr(key); + break; + case HA_KEYTYPE_INT24: + s_value= (longlong) sint3korr(key); + break; + case HA_KEYTYPE_UINT24: + value=(ulonglong) uint3korr(key); + break; + case HA_KEYTYPE_FLOAT: /* This shouldn't be used */ + { + float f_1; + float4get(f_1,key); + /* Ignore negative values */ + value = (f_1 < (float) 0.0) ? 0 : (ulonglong) f_1; + break; + } + case HA_KEYTYPE_DOUBLE: /* This shouldn't be used */ + { + double f_1; + float8get(f_1,key); + /* Ignore negative values */ + value = (f_1 < 0.0) ? 0 : (ulonglong) f_1; + break; + } + case HA_KEYTYPE_LONGLONG: + s_value= sint8korr(key); + break; + case HA_KEYTYPE_ULONGLONG: + value= uint8korr(key); + break; + default: + DBUG_ASSERT(0); + value=0; /* Error */ + break; + } + + /* + The following code works becasue if s_value < 0 then value is 0 + and if s_value == 0 then value will contain either s_value or the + correct value. + */ + return (s_value > 0) ? (ulonglong) s_value : value; +} Added: trunk/src/mi_keycache.c =================================================================== --- trunk/src/mi_keycache.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_keycache.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,163 @@ +/* Copyright (C) 2003 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Key cache assignments +*/ + +#include "myisamdef.h" + +/* + Assign pages of the index file for a table to a key cache + + SYNOPSIS + mi_assign_to_key_cache() + info open table + key_map map of indexes to assign to the key cache + key_cache_ptr pointer to the key cache handle + assign_lock Mutex to lock during assignment + + PREREQUESTS + One must have a READ lock or a WRITE lock on the table when calling + the function to ensure that there is no other writers to it. + + The caller must also ensure that one doesn't call this function from + two different threads with the same table. + + NOTES + At present pages for all indexes must be assigned to the same key cache. + In future only pages for indexes specified in the key_map parameter + of the table will be assigned to the specified key cache. + + RETURN VALUE + 0 If a success + # Error code +*/ + +int mi_assign_to_key_cache(MI_INFO *info, + ulonglong key_map __attribute__((unused)), + KEY_CACHE *key_cache) +{ + int error= 0; + MYISAM_SHARE* share= info->s; + DBUG_ENTER("mi_assign_to_key_cache"); + DBUG_PRINT("enter",("old_key_cache_handle: 0x%lx new_key_cache_handle: 0x%lx", + (long) share->key_cache, (long) key_cache)); + + /* + Skip operation if we didn't change key cache. This can happen if we + call this for all open instances of the same table + */ + if (share->key_cache == key_cache) + DBUG_RETURN(0); + + /* + First flush all blocks for the table in the old key cache. + This is to ensure that the disk is consistent with the data pages + in memory (which may not be the case if the table uses delayed_key_write) + + Note that some other read thread may still fill in the key cache with + new blocks during this call and after, but this doesn't matter as + all threads will start using the new key cache for their next call to + myisam library and we know that there will not be any changed blocks + in the old key cache. + */ + + if (flush_key_blocks(share->key_cache, share->kfile, FLUSH_RELEASE)) + { + error= my_errno; + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); /* Mark that table must be checked */ + } + + /* + Flush the new key cache for this file. This is needed to ensure + that there is no old blocks (with outdated data) left in the new key + cache from an earlier assign_to_keycache operation + + (This can never fail as there is never any not written data in the + new key cache) + */ + (void) flush_key_blocks(key_cache, share->kfile, FLUSH_RELEASE); + + /* + ensure that setting the key cache and changing the multi_key_cache + is done atomicly + */ + pthread_mutex_lock(&share->intern_lock); + /* + Tell all threads to use the new key cache + This should be seen at the lastes for the next call to an myisam function. + */ + share->key_cache= key_cache; + + /* store the key cache in the global hash structure for future opens */ + if (multi_key_cache_set((uchar*) share->unique_file_name, + share->unique_name_length, + share->key_cache)) + error= my_errno; + pthread_mutex_unlock(&share->intern_lock); + DBUG_RETURN(error); +} + + +/* + Change all MyISAM entries that uses one key cache to another key cache + + SYNOPSIS + mi_change_key_cache() + old_key_cache Old key cache + new_key_cache New key cache + + NOTES + This is used when we delete one key cache. + + To handle the case where some other threads tries to open an MyISAM + table associated with the to-be-deleted key cache while this operation + is running, we have to call 'multi_key_cache_change()' from this + function while we have a lock on the MyISAM table list structure. + + This is safe as long as it's only MyISAM that is using this specific + key cache. +*/ + + +void mi_change_key_cache(KEY_CACHE *old_key_cache, + KEY_CACHE *new_key_cache) +{ + LIST *pos; + DBUG_ENTER("mi_change_key_cache"); + + /* + Lock list to ensure that no one can close the table while we manipulate it + */ + pthread_mutex_lock(&THR_LOCK_myisam); + for (pos=myisam_open_list ; pos ; pos=pos->next) + { + MI_INFO *info= (MI_INFO*) pos->data; + MYISAM_SHARE *share= info->s; + if (share->key_cache == old_key_cache) + mi_assign_to_key_cache(info, (ulonglong) ~0, new_key_cache); + } + + /* + We have to do the following call while we have the lock on the + MyISAM list structure to ensure that another thread is not trying to + open a new table that will be associted with the old key cache + */ + multi_key_cache_change(old_key_cache, new_key_cache); + pthread_mutex_unlock(&THR_LOCK_myisam); + DBUG_VOID_RETURN; +} Added: trunk/src/mi_locking.c =================================================================== --- trunk/src/mi_locking.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_locking.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,577 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + locking of isam-tables. + reads info from a isam-table. Must be first request before doing any furter + calls to any isamfunktion. Is used to allow many process use the same + isamdatabase. +*/ + +#include "ftdefs.h" + + /* lock table by F_UNLCK, F_RDLCK or F_WRLCK */ + +int mi_lock_database(MI_INFO *info, int lock_type) +{ + int error; + uint count; + MYISAM_SHARE *share=info->s; + uint flag; + DBUG_ENTER("mi_lock_database"); + DBUG_PRINT("enter",("lock_type: %d old lock %d r_locks: %u w_locks: %u " + "global_changed: %d open_count: %u name: '%s'", + lock_type, info->lock_type, share->r_locks, + share->w_locks, + share->global_changed, share->state.open_count, + share->index_file_name)); + if (share->options & HA_OPTION_READ_ONLY_DATA || + info->lock_type == lock_type) + DBUG_RETURN(0); + if (lock_type == F_EXTRA_LCK) /* Used by TMP tables */ + { + ++share->w_locks; + ++share->tot_locks; + info->lock_type= lock_type; + DBUG_RETURN(0); + } + + flag=error=0; + pthread_mutex_lock(&share->intern_lock); + if (share->kfile >= 0) /* May only be false on windows */ + { + switch (lock_type) { + case F_UNLCK: + ftparser_call_deinitializer(info); + if (info->lock_type == F_RDLCK) + count= --share->r_locks; + else + count= --share->w_locks; + --share->tot_locks; + if (info->lock_type == F_WRLCK && !share->w_locks && + !share->delay_key_write && flush_key_blocks(share->key_cache, + share->kfile,FLUSH_KEEP)) + { + error=my_errno; + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); /* Mark that table must be checked */ + } + if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) + { + if (end_io_cache(&info->rec_cache)) + { + error=my_errno; + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); + } + } + if (!count) + { + DBUG_PRINT("info",("changed: %u w_locks: %u", + (uint) share->changed, share->w_locks)); + if (share->changed && !share->w_locks) + { +#ifdef HAVE_MMAP + if ((info->s->mmaped_length != info->s->state.state.data_file_length) && + (info->s->nonmmaped_inserts > MAX_NONMAPPED_INSERTS)) + { + if (info->s->concurrent_insert) + rw_wrlock(&info->s->mmap_lock); + mi_remap_file(info, info->s->state.state.data_file_length); + info->s->nonmmaped_inserts= 0; + if (info->s->concurrent_insert) + rw_unlock(&info->s->mmap_lock); + } +#endif + share->state.process= share->last_process=share->this_process; + share->state.unique= info->last_unique= info->this_unique; + share->state.update_count= info->last_loop= ++info->this_loop; + if (mi_state_info_write(share->kfile, &share->state, 1)) + error=my_errno; + share->changed=0; + if (myisam_flush) + { + if (my_sync(share->kfile, MYF(0))) + error= my_errno; + if (my_sync(info->dfile, MYF(0))) + error= my_errno; + } + else + share->not_flushed=1; + if (error) + { + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); + } + } + if (info->lock_type != F_EXTRA_LCK) + { + if (share->r_locks) + { /* Only read locks left */ + flag=1; + if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, + MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) + error=my_errno; + } + else if (!share->w_locks) + { /* No more locks */ + flag=1; + if (my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF, + MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) + error=my_errno; + } + } + } + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + info->lock_type= F_UNLCK; + break; + case F_RDLCK: + if (info->lock_type == F_WRLCK) + { + /* + Change RW to READONLY + + mysqld does not turn write locks to read locks, + so we're never here in mysqld. + */ + if (share->w_locks == 1) + { + flag=1; + if (my_lock(share->kfile,lock_type,0L,F_TO_EOF, + MYF(MY_SEEK_NOT_DONE))) + { + error=my_errno; + break; + } + } + share->w_locks--; + share->r_locks++; + info->lock_type=lock_type; + break; + } + if (!share->r_locks && !share->w_locks) + { + flag=1; + if (my_lock(share->kfile,lock_type,0L,F_TO_EOF, + info->lock_wait | MY_SEEK_NOT_DONE)) + { + error=my_errno; + break; + } + if (mi_state_info_read_dsk(share->kfile, &share->state, 1)) + { + error=my_errno; + VOID(my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE))); + my_errno=error; + break; + } + } + VOID(_mi_test_if_changed(info)); + share->r_locks++; + share->tot_locks++; + info->lock_type=lock_type; + break; + case F_WRLCK: + if (info->lock_type == F_RDLCK) + { /* Change READONLY to RW */ + if (share->r_locks == 1) + { + flag=1; + if (my_lock(share->kfile,lock_type,0L,F_TO_EOF, + MYF(info->lock_wait | MY_SEEK_NOT_DONE))) + { + error=my_errno; + break; + } + share->r_locks--; + share->w_locks++; + info->lock_type=lock_type; + break; + } + } + if (!(share->options & HA_OPTION_READ_ONLY_DATA)) + { + if (!share->w_locks) + { + flag=1; + if (my_lock(share->kfile,lock_type,0L,F_TO_EOF, + info->lock_wait | MY_SEEK_NOT_DONE)) + { + error=my_errno; + break; + } + if (!share->r_locks) + { + if (mi_state_info_read_dsk(share->kfile, &share->state, 1)) + { + error=my_errno; + VOID(my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF, + info->lock_wait | MY_SEEK_NOT_DONE)); + my_errno=error; + break; + } + } + } + } + VOID(_mi_test_if_changed(info)); + + info->lock_type=lock_type; + info->invalidator=info->s->invalidator; + share->w_locks++; + share->tot_locks++; + break; + default: + break; /* Impossible */ + } + } +#ifdef __WIN__ + else + { + /* + Check for bad file descriptors if this table is part + of a merge union. Failing to capture this may cause + a crash on windows if the table is renamed and + later on referenced by the merge table. + */ + if( info->owned_by_merge && (info->s)->kfile < 0 ) + { + error = HA_ERR_NO_SUCH_TABLE; + } + } +#endif + pthread_mutex_unlock(&share->intern_lock); +#if defined(FULL_LOG) || defined(_lint) + lock_type|=(int) (flag << 8); /* Set bit to set if real lock */ + myisam_log_command(MI_LOG_LOCK,info,(uchar*) &lock_type,sizeof(lock_type), + error); +#endif + DBUG_RETURN(error); +} /* mi_lock_database */ + + +/**************************************************************************** + The following functions are called by thr_lock() in threaded applications +****************************************************************************/ + +/* + Create a copy of the current status for the table + + SYNOPSIS + mi_get_status() + param Pointer to Myisam handler + concurrent_insert Set to 1 if we are going to do concurrent inserts + (THR_WRITE_CONCURRENT_INSERT was used) +*/ + +void mi_get_status(void* param, int concurrent_insert) +{ + MI_INFO *info=(MI_INFO*) param; + DBUG_ENTER("mi_get_status"); + DBUG_PRINT("info",("key_file: %ld data_file: %ld concurrent_insert: %d", + (long) info->s->state.state.key_file_length, + (long) info->s->state.state.data_file_length, + concurrent_insert)); +#ifndef DBUG_OFF + if (info->state->key_file_length > info->s->state.state.key_file_length || + info->state->data_file_length > info->s->state.state.data_file_length) + DBUG_PRINT("warning",("old info: key_file: %ld data_file: %ld", + (long) info->state->key_file_length, + (long) info->state->data_file_length)); +#endif + info->save_state=info->s->state.state; + info->state= &info->save_state; + info->append_insert_at_end= concurrent_insert; + DBUG_VOID_RETURN; +} + + +void mi_update_status(void* param) +{ + MI_INFO *info=(MI_INFO*) param; + /* + Because someone may have closed the table we point at, we only + update the state if its our own state. This isn't a problem as + we are always pointing at our own lock or at a read lock. + (This is enforced by thr_multi_lock.c) + */ + if (info->state == &info->save_state) + { +#ifndef DBUG_OFF + DBUG_PRINT("info",("updating status: key_file: %ld data_file: %ld", + (long) info->state->key_file_length, + (long) info->state->data_file_length)); + if (info->state->key_file_length < info->s->state.state.key_file_length || + info->state->data_file_length < info->s->state.state.data_file_length) + DBUG_PRINT("warning",("old info: key_file: %ld data_file: %ld", + (long) info->s->state.state.key_file_length, + (long) info->s->state.state.data_file_length)); +#endif + info->s->state.state= *info->state; + info->state= &info->s->state.state; + } + info->append_insert_at_end= 0; + + /* + We have to flush the write cache here as other threads may start + reading the table before mi_lock_database() is called + */ + if (info->opt_flag & WRITE_CACHE_USED) + { + if (end_io_cache(&info->rec_cache)) + { + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); + } + info->opt_flag&= ~WRITE_CACHE_USED; + } +} + + +void mi_restore_status(void *param) +{ + MI_INFO *info= (MI_INFO*) param; + info->state= &info->s->state.state; + info->append_insert_at_end= 0; +} + + +void mi_copy_status(void* to,void *from) +{ + ((MI_INFO*) to)->state= &((MI_INFO*) from)->save_state; +} + + +/* + Check if should allow concurrent inserts + + IMPLEMENTATION + Allow concurrent inserts if we don't have a hole in the table or + if there is no active write lock and there is active read locks and + myisam_concurrent_insert == 2. In this last case the new + row('s) are inserted at end of file instead of filling up the hole. + + The last case is to allow one to inserts into a heavily read-used table + even if there is holes. + + NOTES + If there is a an rtree indexes in the table, concurrent inserts are + disabled in mi_open() + + RETURN + 0 ok to use concurrent inserts + 1 not ok +*/ + +my_bool mi_check_status(void *param) +{ + MI_INFO *info=(MI_INFO*) param; + /* + The test for w_locks == 1 is here because this thread has already done an + external lock (in other words: w_locks == 1 means no other threads has + a write lock) + */ + DBUG_PRINT("info",("dellink: %ld r_locks: %u w_locks: %u", + (long) info->s->state.dellink, (uint) info->s->r_locks, + (uint) info->s->w_locks)); + return (my_bool) !(info->s->state.dellink == HA_OFFSET_ERROR || + (myisam_concurrent_insert == 2 && info->s->r_locks && + info->s->w_locks == 1)); +} + + +/**************************************************************************** + ** functions to read / write the state +****************************************************************************/ + +int _mi_readinfo(register MI_INFO *info, int lock_type, int check_keybuffer) +{ + DBUG_ENTER("_mi_readinfo"); + + if (info->lock_type == F_UNLCK) + { + MYISAM_SHARE *share=info->s; + if (!share->tot_locks) + { + if (my_lock(share->kfile,lock_type,0L,F_TO_EOF, + info->lock_wait | MY_SEEK_NOT_DONE)) + DBUG_RETURN(1); + if (mi_state_info_read_dsk(share->kfile, &share->state, 1)) + { + int error=my_errno ? my_errno : -1; + VOID(my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF, + MYF(MY_SEEK_NOT_DONE))); + my_errno=error; + DBUG_RETURN(1); + } + } + if (check_keybuffer) + VOID(_mi_test_if_changed(info)); + info->invalidator=info->s->invalidator; + } + else if (lock_type == F_WRLCK && info->lock_type == F_RDLCK) + { + my_errno=EACCES; /* Not allowed to change */ + DBUG_RETURN(-1); /* when have read_lock() */ + } + DBUG_RETURN(0); +} /* _mi_readinfo */ + + +/* + Every isam-function that uppdates the isam-database MUST end with this + request +*/ + +int _mi_writeinfo(register MI_INFO *info, uint operation) +{ + int error,olderror; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("_mi_writeinfo"); + DBUG_PRINT("info",("operation: %u tot_locks: %u", operation, + share->tot_locks)); + + error=0; + if (share->tot_locks == 0) + { + olderror=my_errno; /* Remember last error */ + if (operation) + { /* Two threads can't be here */ + share->state.process= share->last_process= share->this_process; + share->state.unique= info->last_unique= info->this_unique; + share->state.update_count= info->last_loop= ++info->this_loop; + if ((error=mi_state_info_write(share->kfile, &share->state, 1))) + olderror=my_errno; +#ifdef __WIN__ + if (myisam_flush) + { + _commit(share->kfile); + _commit(info->dfile); + } +#endif + } + if (!(operation & WRITEINFO_NO_UNLOCK) && + my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF, + MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) + DBUG_RETURN(1); + my_errno=olderror; + } + else if (operation) + share->changed= 1; /* Mark keyfile changed */ + DBUG_RETURN(error); +} /* _mi_writeinfo */ + + + /* Test if someone has changed the database */ + /* (Should be called after readinfo) */ + +int _mi_test_if_changed(register MI_INFO *info) +{ + MYISAM_SHARE *share=info->s; + if (share->state.process != share->last_process || + share->state.unique != info->last_unique || + share->state.update_count != info->last_loop) + { /* Keyfile has changed */ + DBUG_PRINT("info",("index file changed")); + if (share->state.process != share->this_process) + VOID(flush_key_blocks(share->key_cache, share->kfile, FLUSH_RELEASE)); + share->last_process=share->state.process; + info->last_unique= share->state.unique; + info->last_loop= share->state.update_count; + info->update|= HA_STATE_WRITTEN; /* Must use file on next */ + info->data_changed= 1; /* For mi_is_changed */ + return 1; + } + return (!(info->update & HA_STATE_AKTIV) || + (info->update & (HA_STATE_WRITTEN | HA_STATE_DELETED | + HA_STATE_KEY_CHANGED))); +} /* _mi_test_if_changed */ + + +/* + Put a mark in the .MYI file that someone is updating the table + + + DOCUMENTATION + + state.open_count in the .MYI file is used the following way: + - For the first change of the .MYI file in this process open_count is + incremented by mi_mark_file_change(). (We have a write lock on the file + when this happens) + - In mi_close() it's decremented by _mi_decrement_open_count() if it + was incremented in the same process. + + This mean that if we are the only process using the file, the open_count + tells us if the MYISAM file wasn't properly closed. (This is true if + my_disable_locking is set). +*/ + + +int _mi_mark_file_changed(MI_INFO *info) +{ + uchar buff[3]; + register MYISAM_SHARE *share=info->s; + DBUG_ENTER("_mi_mark_file_changed"); + + if (!(share->state.changed & STATE_CHANGED) || ! share->global_changed) + { + share->state.changed|=(STATE_CHANGED | STATE_NOT_ANALYZED | + STATE_NOT_OPTIMIZED_KEYS); + if (!share->global_changed) + { + share->global_changed=1; + share->state.open_count++; + } + if (!share->temporary) + { + mi_int2store(buff,share->state.open_count); + buff[2]=1; /* Mark that it's changed */ + DBUG_RETURN(my_pwrite(share->kfile,buff,sizeof(buff), + sizeof(share->state.header), + MYF(MY_NABP))); + } + } + DBUG_RETURN(0); +} + + +/* + This is only called by close or by extra(HA_FLUSH) if the OS has the pwrite() + call. In these context the following code should be safe! + */ + +int _mi_decrement_open_count(MI_INFO *info) +{ + uchar buff[2]; + register MYISAM_SHARE *share=info->s; + int lock_error=0,write_error=0; + if (share->global_changed) + { + uint old_lock=info->lock_type; + share->global_changed=0; + lock_error=mi_lock_database(info,F_WRLCK); + /* Its not fatal even if we couldn't get the lock ! */ + if (share->state.open_count > 0) + { + share->state.open_count--; + mi_int2store(buff,share->state.open_count); + write_error=my_pwrite(share->kfile,buff,sizeof(buff), + sizeof(share->state.header), + MYF(MY_NABP)); + } + if (!lock_error) + lock_error=mi_lock_database(info,old_lock); + } + return test(lock_error || write_error); +} Added: trunk/src/mi_log.c =================================================================== --- trunk/src/mi_log.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_log.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,164 @@ +/* Copyright (C) 2000-2001, 2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Logging of MyISAM commands and records on logfile for debugging + The log can be examined with help of the myisamlog command. +*/ + +#include "myisamdef.h" +#if defined(MSDOS) || defined(__WIN__) +#include +#ifndef __WIN__ +#include +#endif +#endif +#ifdef VMS +#include +#endif + +#undef GETPID /* For HPUX */ +#ifdef THREAD +#define GETPID() (log_type == 1 ? (long) myisam_pid : (long) my_thread_dbug_id()) +#else +#define GETPID() myisam_pid +#endif + + /* Activate logging if flag is 1 and reset logging if flag is 0 */ + +static int log_type=0; +ulong myisam_pid=0; + +int mi_log(int activate_log) +{ + int error=0; + char buff[FN_REFLEN]; + DBUG_ENTER("mi_log"); + + log_type=activate_log; + if (activate_log) + { + if (!myisam_pid) + myisam_pid=(ulong) getpid(); + if (myisam_log_file < 0) + { + if ((myisam_log_file = my_create(fn_format(buff,myisam_log_filename, + "",".log",4), + 0,(O_RDWR | O_BINARY | O_APPEND),MYF(0))) + < 0) + DBUG_RETURN(my_errno); + } + } + else if (myisam_log_file >= 0) + { + error=my_close(myisam_log_file,MYF(0)) ? my_errno : 0 ; + myisam_log_file= -1; + } + DBUG_RETURN(error); +} + + + /* Logging of records and commands on logfile */ + /* All logs starts with command(1) dfile(2) process(4) result(2) */ + +void _myisam_log(enum myisam_log_commands command, MI_INFO *info, + const uchar *buffert, uint length) +{ + uchar buff[11]; + int error,old_errno; + ulong pid=(ulong) GETPID(); + old_errno=my_errno; + bzero(buff,sizeof(buff)); + buff[0]=(char) command; + mi_int2store(buff+1,info->dfile); + mi_int4store(buff+3,pid); + mi_int2store(buff+9,length); + + pthread_mutex_lock(&THR_LOCK_myisam); + error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE)); + VOID(my_write(myisam_log_file,buff,sizeof(buff),MYF(0))); + VOID(my_write(myisam_log_file,buffert,length,MYF(0))); + if (!error) + error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE)); + pthread_mutex_unlock(&THR_LOCK_myisam); + my_errno=old_errno; +} + + +void _myisam_log_command(enum myisam_log_commands command, MI_INFO *info, + const uchar *buffert, uint length, int result) +{ + uchar buff[9]; + int error,old_errno; + ulong pid=(ulong) GETPID(); + + old_errno=my_errno; + buff[0]=(char) command; + mi_int2store(buff+1,info->dfile); + mi_int4store(buff+3,pid); + mi_int2store(buff+7,result); + pthread_mutex_lock(&THR_LOCK_myisam); + error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE)); + VOID(my_write(myisam_log_file,buff,sizeof(buff),MYF(0))); + if (buffert) + VOID(my_write(myisam_log_file,buffert,length,MYF(0))); + if (!error) + error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE)); + pthread_mutex_unlock(&THR_LOCK_myisam); + my_errno=old_errno; +} + + +void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info, + const uchar *record, my_off_t filepos, int result) +{ + uchar buff[21],*pos; + int error,old_errno; + uint length; + ulong pid=(ulong) GETPID(); + + old_errno=my_errno; + if (!info->s->base.blobs) + length=info->s->base.reclength; + else + length=info->s->base.reclength+ _my_calc_total_blob_length(info,record); + buff[0]=(uchar) command; + mi_int2store(buff+1,info->dfile); + mi_int4store(buff+3,pid); + mi_int2store(buff+7,result); + mi_sizestore(buff+9,filepos); + mi_int4store(buff+17,length); + pthread_mutex_lock(&THR_LOCK_myisam); + error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE)); + VOID(my_write(myisam_log_file, buff,sizeof(buff),MYF(0))); + VOID(my_write(myisam_log_file, record,info->s->base.reclength,MYF(0))); + if (info->s->base.blobs) + { + MI_BLOB *blob,*end; + + for (end=info->blobs+info->s->base.blobs, blob= info->blobs; + blob != end ; + blob++) + { + memcpy_fixed((uchar*) &pos, record+blob->offset+blob->pack_length, + sizeof(char*)); + VOID(my_write(myisam_log_file,pos,blob->length,MYF(0))); + } + } + if (!error) + error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE)); + pthread_mutex_unlock(&THR_LOCK_myisam); + my_errno=old_errno; +} Added: trunk/src/mi_open.c =================================================================== --- trunk/src/mi_open.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_open.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1333 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* open a isam-database */ + +#include "fulltext.h" +#include "sp_defs.h" +#include "rt_index.h" +#include + +#if defined(MSDOS) || defined(__WIN__) +#ifdef __WIN__ +#include +#else +#include /* Prototype for getpid */ +#endif +#endif +#ifdef VMS +#include "static.c" +#endif + +static void setup_key_functions(MI_KEYDEF *keyinfo); +#define get_next_element(to,pos,size) { memcpy((char*) to,pos,(size_t) size); \ + pos+=size;} + + +#define disk_pos_assert(pos, end_pos) \ +if (pos > end_pos) \ +{ \ + my_errno=HA_ERR_CRASHED; \ + goto err; \ +} + + +/****************************************************************************** +** Return the shared struct if the table is already open. +** In MySQL the server will handle version issues. +******************************************************************************/ + +MI_INFO *test_if_reopen(char *filename) +{ + LIST *pos; + + for (pos=myisam_open_list ; pos ; pos=pos->next) + { + MI_INFO *info=(MI_INFO*) pos->data; + MYISAM_SHARE *share=info->s; + if (!strcmp(share->unique_file_name,filename) && share->last_version) + return info; + } + return 0; +} + + +/****************************************************************************** + open a MyISAM database. + See my_base.h for the handle_locking argument + if handle_locking and HA_OPEN_ABORT_IF_CRASHED then abort if the table + is marked crashed or if we are not using locking and the table doesn't + have an open count of 0. +******************************************************************************/ + +MI_INFO *mi_open(const char *name, int mode, uint open_flags) +{ + int lock_error,kfile,open_mode,save_errno,have_rtree=0; + uint i,j,len,errpos,head_length,base_pos,offset,info_length,keys, + key_parts,unique_key_parts,fulltext_keys,uniques; + char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN], + data_name[FN_REFLEN]; + uchar *disk_cache, *disk_pos, *end_pos; + MI_INFO info,*m_info,*old_info; + MYISAM_SHARE share_buff,*share; + ulong rec_per_key_part[MI_MAX_POSSIBLE_KEY*MI_MAX_KEY_SEG]; + my_off_t key_root[MI_MAX_POSSIBLE_KEY],key_del[MI_MAX_KEY_BLOCK_SIZE]; + ulonglong max_key_file_length, max_data_file_length; + DBUG_ENTER("mi_open"); + + LINT_INIT(m_info); + kfile= -1; + lock_error=1; + errpos=0; + head_length=sizeof(share_buff.state.header); + bzero((uchar*) &info,sizeof(info)); + + my_realpath(name_buff, fn_format(org_name,name,"",MI_NAME_IEXT, + MY_UNPACK_FILENAME),MYF(0)); + pthread_mutex_lock(&THR_LOCK_myisam); + if (!(old_info=test_if_reopen(name_buff))) + { + share= &share_buff; + bzero((uchar*) &share_buff,sizeof(share_buff)); + share_buff.state.rec_per_key_part=rec_per_key_part; + share_buff.state.key_root=key_root; + share_buff.state.key_del=key_del; + share_buff.key_cache= multi_key_cache_search((uchar*) name_buff, + strlen(name_buff)); + + DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_open", + if (strstr(name, "/t1")) + { + my_errno= HA_ERR_CRASHED; + goto err; + }); + if ((kfile=my_open(name_buff,(open_mode=O_RDWR) | O_SHARE,MYF(0))) < 0) + { + if ((errno != EROFS && errno != EACCES) || + mode != O_RDONLY || + (kfile=my_open(name_buff,(open_mode=O_RDONLY) | O_SHARE,MYF(0))) < 0) + goto err; + } + share->mode=open_mode; + errpos=1; + if (my_read(kfile, share->state.header.file_version, head_length, + MYF(MY_NABP))) + { + my_errno= HA_ERR_NOT_A_TABLE; + goto err; + } + if (memcmp((uchar*) share->state.header.file_version, + (uchar*) myisam_file_magic, 4)) + { + DBUG_PRINT("error",("Wrong header in %s",name_buff)); + DBUG_DUMP("error_dump",(char*) share->state.header.file_version, + head_length); + my_errno=HA_ERR_NOT_A_TABLE; + goto err; + } + share->options= mi_uint2korr(share->state.header.options); + if (share->options & + ~(HA_OPTION_PACK_RECORD | HA_OPTION_PACK_KEYS | + HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA | + HA_OPTION_TEMP_COMPRESS_RECORD | HA_OPTION_CHECKSUM | + HA_OPTION_TMP_TABLE | HA_OPTION_DELAY_KEY_WRITE | + HA_OPTION_RELIES_ON_SQL_LAYER)) + { + DBUG_PRINT("error",("wrong options: 0x%lx", share->options)); + my_errno=HA_ERR_OLD_FILE; + goto err; + } + if ((share->options & HA_OPTION_RELIES_ON_SQL_LAYER) && + ! (open_flags & HA_OPEN_FROM_SQL_LAYER)) + { + DBUG_PRINT("error", ("table cannot be openned from non-sql layer")); + my_errno= HA_ERR_UNSUPPORTED; + goto err; + } + /* Don't call realpath() if the name can't be a link */ + if (!strcmp(name_buff, org_name) || + my_readlink(index_name, org_name, MYF(0)) == -1) + (void) strmov(index_name, org_name); + *strrchr(org_name, '.')= '\0'; + (void) fn_format(data_name,org_name,"",MI_NAME_DEXT, + MY_APPEND_EXT|MY_UNPACK_FILENAME|MY_RESOLVE_SYMLINKS); + + info_length=mi_uint2korr(share->state.header.header_length); + base_pos=mi_uint2korr(share->state.header.base_pos); + if (!(disk_cache= (uchar*) my_alloca(info_length+128))) + { + my_errno=ENOMEM; + goto err; + } + end_pos=disk_cache+info_length; + errpos=2; + + VOID(my_seek(kfile,0L,MY_SEEK_SET,MYF(0))); + if (!(open_flags & HA_OPEN_TMP_TABLE)) + { + if ((lock_error=my_lock(kfile,F_RDLCK,0L,F_TO_EOF, + MYF(open_flags & HA_OPEN_WAIT_IF_LOCKED ? + 0 : MY_DONT_WAIT))) && + !(open_flags & HA_OPEN_IGNORE_IF_LOCKED)) + goto err; + } + errpos=3; + if (my_read(kfile,disk_cache,info_length,MYF(MY_NABP))) + { + my_errno=HA_ERR_CRASHED; + goto err; + } + len=mi_uint2korr(share->state.header.state_info_length); + keys= (uint) share->state.header.keys; + uniques= (uint) share->state.header.uniques; + fulltext_keys= (uint) share->state.header.fulltext_keys; + key_parts= mi_uint2korr(share->state.header.key_parts); + unique_key_parts= mi_uint2korr(share->state.header.unique_key_parts); + if (len != MI_STATE_INFO_SIZE) + { + DBUG_PRINT("warning", + ("saved_state_info_length: %d state_info_length: %d", + len,MI_STATE_INFO_SIZE)); + } + share->state_diff_length=len-MI_STATE_INFO_SIZE; + + mi_state_info_read(disk_cache, &share->state); + len= mi_uint2korr(share->state.header.base_info_length); + if (len != MI_BASE_INFO_SIZE) + { + DBUG_PRINT("warning",("saved_base_info_length: %d base_info_length: %d", + len,MI_BASE_INFO_SIZE)); + } + disk_pos= my_n_base_info_read(disk_cache + base_pos, &share->base); + share->state.state_length=base_pos; + + if (!(open_flags & HA_OPEN_FOR_REPAIR) && + ((share->state.changed & STATE_CRASHED) || + ((open_flags & HA_OPEN_ABORT_IF_CRASHED) && + (my_disable_locking && share->state.open_count)))) + { + DBUG_PRINT("error",("Table is marked as crashed. open_flags: %u " + "changed: %u open_count: %u !locking: %d", + open_flags, share->state.changed, + share->state.open_count, my_disable_locking)); + my_errno=((share->state.changed & STATE_CRASHED_ON_REPAIR) ? + HA_ERR_CRASHED_ON_REPAIR : HA_ERR_CRASHED_ON_USAGE); + goto err; + } + + /* sanity check */ + if (share->base.keystart > 65535 || share->base.rec_reflength > 8) + { + my_errno=HA_ERR_CRASHED; + goto err; + } + + key_parts+=fulltext_keys*FT_SEGS; + if (share->base.max_key_length > MI_MAX_KEY_BUFF || keys > MI_MAX_KEY || + key_parts > MI_MAX_KEY * MI_MAX_KEY_SEG) + { + DBUG_PRINT("error",("Wrong key info: Max_key_length: %d keys: %d key_parts: %d", share->base.max_key_length, keys, key_parts)); + my_errno=HA_ERR_UNSUPPORTED; + goto err; + } + + /* Correct max_file_length based on length of sizeof(off_t) */ + max_data_file_length= + (share->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ? + (((ulonglong) 1 << (share->base.rec_reflength*8))-1) : + (mi_safe_mul(share->base.pack_reclength, + (ulonglong) 1 << (share->base.rec_reflength*8))-1); + max_key_file_length= + mi_safe_mul(MI_MIN_KEY_BLOCK_LENGTH, + ((ulonglong) 1 << (share->base.key_reflength*8))-1); +#if SIZEOF_OFF_T == 4 + set_if_smaller(max_data_file_length, INT_MAX32); + set_if_smaller(max_key_file_length, INT_MAX32); +#endif +#if USE_RAID && SYSTEM_SIZEOF_OFF_T == 4 + set_if_smaller(max_key_file_length, INT_MAX32); + if (!share->base.raid_type) + { + set_if_smaller(max_data_file_length, INT_MAX32); + } + else + { + set_if_smaller(max_data_file_length, + (ulonglong) share->base.raid_chunks << 31); + } +#elif !defined(USE_RAID) + if (share->base.raid_type) + { + DBUG_PRINT("error",("Table uses RAID but we don't have RAID support")); + my_errno=HA_ERR_UNSUPPORTED; + goto err; + } +#endif + share->base.max_data_file_length=(my_off_t) max_data_file_length; + share->base.max_key_file_length=(my_off_t) max_key_file_length; + + if (share->options & HA_OPTION_COMPRESS_RECORD) + share->base.max_key_length+=2; /* For safety */ + + if (!my_multi_malloc(MY_WME, + &share,sizeof(*share), + &share->state.rec_per_key_part,sizeof(long)*key_parts, + &share->keyinfo,keys*sizeof(MI_KEYDEF), + &share->uniqueinfo,uniques*sizeof(MI_UNIQUEDEF), + &share->keyparts, + (key_parts+unique_key_parts+keys+uniques) * + sizeof(HA_KEYSEG), + &share->rec, + (share->base.fields+1)*sizeof(MI_COLUMNDEF), + &share->blobs,sizeof(MI_BLOB)*share->base.blobs, + &share->unique_file_name,strlen(name_buff)+1, + &share->index_file_name,strlen(index_name)+1, + &share->data_file_name,strlen(data_name)+1, + &share->state.key_root,keys*sizeof(my_off_t), + &share->state.key_del, + (share->state.header.max_block_size_index*sizeof(my_off_t)), +#ifdef THREAD + &share->key_root_lock,sizeof(rw_lock_t)*keys, +#endif + &share->mmap_lock,sizeof(rw_lock_t), + NullS)) + goto err; + errpos=4; + *share=share_buff; + memcpy((char*) share->state.rec_per_key_part, + (char*) rec_per_key_part, sizeof(long)*key_parts); + memcpy((char*) share->state.key_root, + (char*) key_root, sizeof(my_off_t)*keys); + memcpy((char*) share->state.key_del, + (char*) key_del, (sizeof(my_off_t) * + share->state.header.max_block_size_index)); + strmov(share->unique_file_name, name_buff); + share->unique_name_length= strlen(name_buff); + strmov(share->index_file_name, index_name); + strmov(share->data_file_name, data_name); + + share->blocksize=min(IO_SIZE,myisam_block_size); + { + HA_KEYSEG *pos=share->keyparts; + for (i=0 ; i < keys ; i++) + { + share->keyinfo[i].share= share; + disk_pos=mi_keydef_read(disk_pos, &share->keyinfo[i]); + disk_pos_assert(disk_pos + share->keyinfo[i].keysegs * HA_KEYSEG_SIZE, + end_pos); + if (share->keyinfo[i].key_alg == HA_KEY_ALG_RTREE) + have_rtree=1; + set_if_smaller(share->blocksize,share->keyinfo[i].block_length); + share->keyinfo[i].seg=pos; + for (j=0 ; j < share->keyinfo[i].keysegs; j++,pos++) + { + disk_pos=mi_keyseg_read(disk_pos, pos); + if (pos->flag & HA_BLOB_PART && + ! (share->options & (HA_OPTION_COMPRESS_RECORD | + HA_OPTION_PACK_RECORD))) + { + my_errno= HA_ERR_CRASHED; + goto err; + } + if (pos->type == HA_KEYTYPE_TEXT || + pos->type == HA_KEYTYPE_VARTEXT1 || + pos->type == HA_KEYTYPE_VARTEXT2) + { + if (!pos->language) + pos->charset=default_charset_info; + else if (!(pos->charset= get_charset(pos->language, MYF(MY_WME)))) + { + my_errno=HA_ERR_UNKNOWN_CHARSET; + goto err; + } + } + else if (pos->type == HA_KEYTYPE_BINARY) + pos->charset= &my_charset_bin; + } + if (share->keyinfo[i].flag & HA_SPATIAL) + { +#ifdef HAVE_SPATIAL + uint sp_segs=SPDIMS*2; + share->keyinfo[i].seg=pos-sp_segs; + share->keyinfo[i].keysegs--; +#else + my_errno=HA_ERR_UNSUPPORTED; + goto err; +#endif + } + else if (share->keyinfo[i].flag & HA_FULLTEXT) + { + if (!fulltext_keys) + { /* 4.0 compatibility code, to be removed in 5.0 */ + share->keyinfo[i].seg=pos-FT_SEGS; + share->keyinfo[i].keysegs-=FT_SEGS; + } + else + { + uint k; + share->keyinfo[i].seg=pos; + for (k=0; k < FT_SEGS; k++) + { + *pos= ft_keysegs[k]; + pos[0].language= pos[-1].language; + if (!(pos[0].charset= pos[-1].charset)) + { + my_errno=HA_ERR_CRASHED; + goto err; + } + pos++; + } + } + if (!share->ft2_keyinfo.seg) + { + memcpy(& share->ft2_keyinfo, & share->keyinfo[i], sizeof(MI_KEYDEF)); + share->ft2_keyinfo.keysegs=1; + share->ft2_keyinfo.flag=0; + share->ft2_keyinfo.keylength= + share->ft2_keyinfo.minlength= + share->ft2_keyinfo.maxlength=HA_FT_WLEN+share->base.rec_reflength; + share->ft2_keyinfo.seg=pos-1; + share->ft2_keyinfo.end=pos; + setup_key_functions(& share->ft2_keyinfo); + } + } + setup_key_functions(share->keyinfo+i); + share->keyinfo[i].end=pos; + pos->type=HA_KEYTYPE_END; /* End */ + pos->length=share->base.rec_reflength; + pos->null_bit=0; + pos->flag=0; /* For purify */ + pos++; + } + for (i=0 ; i < uniques ; i++) + { + disk_pos=mi_uniquedef_read(disk_pos, &share->uniqueinfo[i]); + disk_pos_assert(disk_pos + share->uniqueinfo[i].keysegs * + HA_KEYSEG_SIZE, end_pos); + share->uniqueinfo[i].seg=pos; + for (j=0 ; j < share->uniqueinfo[i].keysegs; j++,pos++) + { + disk_pos=mi_keyseg_read(disk_pos, pos); + if (pos->type == HA_KEYTYPE_TEXT || + pos->type == HA_KEYTYPE_VARTEXT1 || + pos->type == HA_KEYTYPE_VARTEXT2) + { + if (!pos->language) + pos->charset=default_charset_info; + else if (!(pos->charset= get_charset(pos->language, MYF(MY_WME)))) + { + my_errno=HA_ERR_UNKNOWN_CHARSET; + goto err; + } + } + } + share->uniqueinfo[i].end=pos; + pos->type=HA_KEYTYPE_END; /* End */ + pos->null_bit=0; + pos->flag=0; + pos++; + } + share->ftparsers= 0; + } + + disk_pos_assert(disk_pos + share->base.fields *MI_COLUMNDEF_SIZE, end_pos); + for (i=j=offset=0 ; i < share->base.fields ; i++) + { + disk_pos=mi_recinfo_read(disk_pos,&share->rec[i]); + share->rec[i].pack_type=0; + share->rec[i].huff_tree=0; + share->rec[i].offset=offset; + if (share->rec[i].type == (int) FIELD_BLOB) + { + share->blobs[j].pack_length= + share->rec[i].length-mi_portable_sizeof_char_ptr;; + share->blobs[j].offset=offset; + j++; + } + offset+=share->rec[i].length; + } + share->rec[i].type=(int) FIELD_LAST; /* End marker */ + if (offset > share->base.reclength) + { + /* purecov: begin inspected */ + my_errno= HA_ERR_CRASHED; + goto err; + /* purecov: end */ + } + + if (! lock_error) + { + VOID(my_lock(kfile,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE))); + lock_error=1; /* Database unlocked */ + } + + if (mi_open_datafile(&info, share, -1)) + goto err; + errpos=5; + + share->kfile=kfile; + share->this_process=(ulong) getpid(); + share->last_process= share->state.process; + share->base.key_parts=key_parts; + share->base.all_key_parts=key_parts+unique_key_parts; + if (!(share->last_version=share->state.version)) + share->last_version=1; /* Safety */ + share->rec_reflength=share->base.rec_reflength; /* May be changed */ + share->base.margin_key_file_length=(share->base.max_key_file_length - + (keys ? MI_INDEX_BLOCK_MARGIN * + share->blocksize * keys : 0)); + share->blocksize=min(IO_SIZE,myisam_block_size); + share->data_file_type=STATIC_RECORD; + if (share->options & HA_OPTION_COMPRESS_RECORD) + { + share->data_file_type = COMPRESSED_RECORD; + share->options|= HA_OPTION_READ_ONLY_DATA; + info.s=share; + if (_mi_read_pack_info(&info, + (pbool) + test(!(share->options & + (HA_OPTION_PACK_RECORD | + HA_OPTION_TEMP_COMPRESS_RECORD))))) + goto err; + } + else if (share->options & HA_OPTION_PACK_RECORD) + share->data_file_type = DYNAMIC_RECORD; + my_afree(disk_cache); + mi_setup_functions(share); + share->is_log_table= FALSE; +#ifdef THREAD + thr_lock_init(&share->lock); + VOID(pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST)); + for (i=0; ikey_root_lock[i], NULL)); + VOID(my_rwlock_init(&share->mmap_lock, NULL)); + if (!thr_lock_inited) + { + /* Probably a single threaded program; Don't use concurrent inserts */ + myisam_concurrent_insert=0; + } + else if (myisam_concurrent_insert) + { + share->concurrent_insert= + ((share->options & (HA_OPTION_READ_ONLY_DATA | HA_OPTION_TMP_TABLE | + HA_OPTION_COMPRESS_RECORD | + HA_OPTION_TEMP_COMPRESS_RECORD)) || + (open_flags & HA_OPEN_TMP_TABLE) || + have_rtree) ? 0 : 1; + if (share->concurrent_insert) + { + share->lock.get_status=mi_get_status; + share->lock.copy_status=mi_copy_status; + share->lock.update_status=mi_update_status; + share->lock.restore_status= mi_restore_status; + share->lock.check_status=mi_check_status; + } + } +#endif + /* + Memory mapping can only be requested after initializing intern_lock. + */ + if (open_flags & HA_OPEN_MMAP) + { + info.s= share; + mi_extra(&info, HA_EXTRA_MMAP, 0); + } + } + else + { + share= old_info->s; + if (mode == O_RDWR && share->mode == O_RDONLY) + { + my_errno=EACCES; /* Can't open in write mode */ + goto err; + } + if (mi_open_datafile(&info, share, old_info->dfile)) + goto err; + errpos=5; + have_rtree= old_info->rtree_recursion_state != NULL; + } + + /* alloc and set up private structure parts */ + if (!my_multi_malloc(MY_WME, + &m_info,sizeof(MI_INFO), + &info.blobs,sizeof(MI_BLOB)*share->base.blobs, + &info.buff,(share->base.max_key_block_length*2+ + share->base.max_key_length), + &info.lastkey,share->base.max_key_length*3+1, + &info.first_mbr_key, share->base.max_key_length, + &info.filename,strlen(name)+1, + &info.rtree_recursion_state,have_rtree ? 1024 : 0, + NullS)) + goto err; + errpos=6; + + if (!have_rtree) + info.rtree_recursion_state= NULL; + + strmov(info.filename,name); + memcpy(info.blobs,share->blobs,sizeof(MI_BLOB)*share->base.blobs); + info.lastkey2=info.lastkey+share->base.max_key_length; + + info.s=share; + info.lastpos= HA_OFFSET_ERROR; + info.update= (short) (HA_STATE_NEXT_FOUND+HA_STATE_PREV_FOUND); + info.opt_flag=READ_CHECK_USED; + info.this_unique= (ulong) info.dfile; /* Uniq number in process */ + if (share->data_file_type == COMPRESSED_RECORD) + info.this_unique= share->state.unique; + info.this_loop=0; /* Update counter */ + info.last_unique= share->state.unique; + info.last_loop= share->state.update_count; + if (mode == O_RDONLY) + share->options|=HA_OPTION_READ_ONLY_DATA; + info.lock_type=F_UNLCK; + info.quick_mode=0; + info.bulk_insert=0; + info.ft1_to_ft2=0; + info.errkey= -1; + info.page_changed=1; + pthread_mutex_lock(&share->intern_lock); + info.read_record=share->read_record; + share->reopen++; + share->write_flag=MYF(MY_NABP | MY_WAIT_IF_FULL); + if (share->options & HA_OPTION_READ_ONLY_DATA) + { + info.lock_type=F_RDLCK; + share->r_locks++; + share->tot_locks++; + } + if ((open_flags & HA_OPEN_TMP_TABLE) || + (share->options & HA_OPTION_TMP_TABLE)) + { + share->temporary=share->delay_key_write=1; + share->write_flag=MYF(MY_NABP); + share->w_locks++; /* We don't have to update status */ + share->tot_locks++; + info.lock_type=F_WRLCK; + } + if (((open_flags & HA_OPEN_DELAY_KEY_WRITE) || + (share->options & HA_OPTION_DELAY_KEY_WRITE)) && + myisam_delay_key_write) + share->delay_key_write=1; + info.state= &share->state.state; /* Change global values by default */ + pthread_mutex_unlock(&share->intern_lock); + + /* Allocate buffer for one record */ + + /* prerequisites: bzero(info) && info->s=share; are met. */ + if (!mi_alloc_rec_buff(&info, -1, &info.rec_buff)) + goto err; + bzero(info.rec_buff, mi_get_rec_buff_len(&info, info.rec_buff)); + + *m_info=info; +#ifdef THREAD + thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info); +#endif + m_info->open_list.data=(void*) m_info; + myisam_open_list=list_add(myisam_open_list,&m_info->open_list); + + pthread_mutex_unlock(&THR_LOCK_myisam); + if (myisam_log_file >= 0) + { + intern_filename(name_buff,share->index_file_name); + _myisam_log(MI_LOG_OPEN, m_info, (uchar*) name_buff, strlen(name_buff)); + } + DBUG_RETURN(m_info); + +err: + save_errno=my_errno ? my_errno : HA_ERR_END_OF_FILE; + if ((save_errno == HA_ERR_CRASHED) || + (save_errno == HA_ERR_CRASHED_ON_USAGE) || + (save_errno == HA_ERR_CRASHED_ON_REPAIR)) + mi_report_error(save_errno, name); + switch (errpos) { + case 6: + my_free((uchar*) m_info,MYF(0)); + /* fall through */ + case 5: + VOID(my_close(info.dfile,MYF(0))); + if (old_info) + break; /* Don't remove open table */ + /* fall through */ + case 4: + my_free((uchar*) share,MYF(0)); + /* fall through */ + case 3: + if (! lock_error) + VOID(my_lock(kfile, F_UNLCK, 0L, F_TO_EOF, MYF(MY_SEEK_NOT_DONE))); + /* fall through */ + case 2: + my_afree(disk_cache); + /* fall through */ + case 1: + VOID(my_close(kfile,MYF(0))); + /* fall through */ + case 0: + default: + break; + } + pthread_mutex_unlock(&THR_LOCK_myisam); + my_errno=save_errno; + DBUG_RETURN (NULL); +} /* mi_open */ + + +uchar *mi_alloc_rec_buff(MI_INFO *info, ulong length, uchar **buf) +{ + uint extra; + uint32 old_length; + LINT_INIT(old_length); + + if (! *buf || length > (old_length=mi_get_rec_buff_len(info, *buf))) + { + uchar *newptr = *buf; + + /* to simplify initial init of info->rec_buf in mi_open and mi_extra */ + if (length == (ulong) -1) + { + length= max(info->s->base.pack_reclength, + info->s->base.max_key_length); + /* Avoid unnecessary realloc */ + if (newptr && length == old_length) + return newptr; + } + + extra= ((info->s->options & HA_OPTION_PACK_RECORD) ? + ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ + MI_REC_BUFF_OFFSET : 0); + if (extra && newptr) + newptr-= MI_REC_BUFF_OFFSET; + if (!(newptr=(uchar*) my_realloc((uchar*)newptr, length+extra+8, + MYF(MY_ALLOW_ZERO_PTR)))) + return newptr; + *((uint32 *) newptr)= (uint32) length; + *buf= newptr+(extra ? MI_REC_BUFF_OFFSET : 0); + } + return *buf; +} + + +ulonglong mi_safe_mul(ulonglong a, ulonglong b) +{ + ulonglong max_val= ~ (ulonglong) 0; /* my_off_t is unsigned */ + + if (!a || max_val / a < b) + return max_val; + return a*b; +} + + /* Set up functions in structs */ + +void mi_setup_functions(register MYISAM_SHARE *share) +{ + if (share->options & HA_OPTION_COMPRESS_RECORD) + { + share->read_record=_mi_read_pack_record; + share->read_rnd=_mi_read_rnd_pack_record; + if (!(share->options & HA_OPTION_TEMP_COMPRESS_RECORD)) + share->calc_checksum=0; /* No checksum */ + else if (share->options & HA_OPTION_PACK_RECORD) + share->calc_checksum= mi_checksum; + else + share->calc_checksum= mi_static_checksum; + } + else if (share->options & HA_OPTION_PACK_RECORD) + { + share->read_record=_mi_read_dynamic_record; + share->read_rnd=_mi_read_rnd_dynamic_record; + share->delete_record=_mi_delete_dynamic_record; + share->compare_record=_mi_cmp_dynamic_record; + share->compare_unique=_mi_cmp_dynamic_unique; + share->calc_checksum= mi_checksum; + + /* add bits used to pack data to pack_reclength for faster allocation */ + share->base.pack_reclength+= share->base.pack_bits; + if (share->base.blobs) + { + share->update_record=_mi_update_blob_record; + share->write_record=_mi_write_blob_record; + } + else + { + share->write_record=_mi_write_dynamic_record; + share->update_record=_mi_update_dynamic_record; + } + } + else + { + share->read_record=_mi_read_static_record; + share->read_rnd=_mi_read_rnd_static_record; + share->delete_record=_mi_delete_static_record; + share->compare_record=_mi_cmp_static_record; + share->update_record=_mi_update_static_record; + share->write_record=_mi_write_static_record; + share->compare_unique=_mi_cmp_static_unique; + share->calc_checksum= mi_static_checksum; + } + share->file_read= mi_nommap_pread; + share->file_write= mi_nommap_pwrite; + if (!(share->options & HA_OPTION_CHECKSUM)) + share->calc_checksum=0; + return; +} + + +static void setup_key_functions(register MI_KEYDEF *keyinfo) +{ + if (keyinfo->key_alg == HA_KEY_ALG_RTREE) + { +#ifdef HAVE_RTREE_KEYS + keyinfo->ck_insert = rtree_insert; + keyinfo->ck_delete = rtree_delete; +#else + DBUG_ASSERT(0); /* mi_open should check it never happens */ +#endif + } + else + { + keyinfo->ck_insert = _mi_ck_write; + keyinfo->ck_delete = _mi_ck_delete; + } + if (keyinfo->flag & HA_BINARY_PACK_KEY) + { /* Simple prefix compression */ + keyinfo->bin_search=_mi_seq_search; + keyinfo->get_key=_mi_get_binary_pack_key; + keyinfo->pack_key=_mi_calc_bin_pack_key_length; + keyinfo->store_key=_mi_store_bin_pack_key; + } + else if (keyinfo->flag & HA_VAR_LENGTH_KEY) + { + keyinfo->get_key= _mi_get_pack_key; + if (keyinfo->seg[0].flag & HA_PACK_KEY) + { /* Prefix compression */ + if (!keyinfo->seg->charset || use_strnxfrm(keyinfo->seg->charset) || + (keyinfo->seg->flag & HA_NULL_PART)) + keyinfo->bin_search=_mi_seq_search; + else + keyinfo->bin_search=_mi_prefix_search; + keyinfo->pack_key=_mi_calc_var_pack_key_length; + keyinfo->store_key=_mi_store_var_pack_key; + } + else + { + keyinfo->bin_search=_mi_seq_search; + keyinfo->pack_key=_mi_calc_var_key_length; /* Variable length key */ + keyinfo->store_key=_mi_store_static_key; + } + } + else + { + keyinfo->bin_search=_mi_bin_search; + keyinfo->get_key=_mi_get_static_key; + keyinfo->pack_key=_mi_calc_static_key_length; + keyinfo->store_key=_mi_store_static_key; + } + return; +} + + +/* + Function to save and store the header in the index file (.MYI) +*/ + +uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite) +{ + uchar buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE]; + uchar *ptr=buff; + uint i, keys= (uint) state->header.keys, + key_blocks=state->header.max_block_size_index; + DBUG_ENTER("mi_state_info_write"); + + memcpy_fixed(ptr,&state->header,sizeof(state->header)); + ptr+=sizeof(state->header); + + /* open_count must be first because of _mi_mark_file_changed ! */ + mi_int2store(ptr,state->open_count); ptr +=2; + *ptr++= (uchar)state->changed; *ptr++= state->sortkey; + mi_rowstore(ptr,state->state.records); ptr +=8; + mi_rowstore(ptr,state->state.del); ptr +=8; + mi_rowstore(ptr,state->split); ptr +=8; + mi_sizestore(ptr,state->dellink); ptr +=8; + mi_sizestore(ptr,state->state.key_file_length); ptr +=8; + mi_sizestore(ptr,state->state.data_file_length); ptr +=8; + mi_sizestore(ptr,state->state.empty); ptr +=8; + mi_sizestore(ptr,state->state.key_empty); ptr +=8; + mi_int8store(ptr,state->auto_increment); ptr +=8; + mi_int8store(ptr,(ulonglong) state->state.checksum);ptr +=8; + mi_int4store(ptr,state->process); ptr +=4; + mi_int4store(ptr,state->unique); ptr +=4; + mi_int4store(ptr,state->status); ptr +=4; + mi_int4store(ptr,state->update_count); ptr +=4; + + ptr+=state->state_diff_length; + + for (i=0; i < keys; i++) + { + mi_sizestore(ptr,state->key_root[i]); ptr +=8; + } + for (i=0; i < key_blocks; i++) + { + mi_sizestore(ptr,state->key_del[i]); ptr +=8; + } + if (pWrite & 2) /* From isamchk */ + { + uint key_parts= mi_uint2korr(state->header.key_parts); + mi_int4store(ptr,state->sec_index_changed); ptr +=4; + mi_int4store(ptr,state->sec_index_used); ptr +=4; + mi_int4store(ptr,state->version); ptr +=4; + mi_int8store(ptr,state->key_map); ptr +=8; + mi_int8store(ptr,(ulonglong) state->create_time); ptr +=8; + mi_int8store(ptr,(ulonglong) state->recover_time); ptr +=8; + mi_int8store(ptr,(ulonglong) state->check_time); ptr +=8; + mi_sizestore(ptr,state->rec_per_key_rows); ptr+=8; + for (i=0 ; i < key_parts ; i++) + { + mi_int4store(ptr,state->rec_per_key_part[i]); ptr+=4; + } + } + + if (pWrite & 1) + DBUG_RETURN(my_pwrite(file, buff, (size_t) (ptr-buff), 0L, + MYF(MY_NABP | MY_THREADSAFE)) != 0); + DBUG_RETURN(my_write(file, buff, (size_t) (ptr-buff), + MYF(MY_NABP)) != 0); +} + + +uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state) +{ + uint i,keys,key_parts,key_blocks; + memcpy_fixed(&state->header,ptr, sizeof(state->header)); + ptr +=sizeof(state->header); + keys=(uint) state->header.keys; + key_parts=mi_uint2korr(state->header.key_parts); + key_blocks=state->header.max_block_size_index; + + state->open_count = mi_uint2korr(ptr); ptr +=2; + state->changed= (bool) *ptr++; + state->sortkey = (uint) *ptr++; + state->state.records= mi_rowkorr(ptr); ptr +=8; + state->state.del = mi_rowkorr(ptr); ptr +=8; + state->split = mi_rowkorr(ptr); ptr +=8; + state->dellink= mi_sizekorr(ptr); ptr +=8; + state->state.key_file_length = mi_sizekorr(ptr); ptr +=8; + state->state.data_file_length= mi_sizekorr(ptr); ptr +=8; + state->state.empty = mi_sizekorr(ptr); ptr +=8; + state->state.key_empty= mi_sizekorr(ptr); ptr +=8; + state->auto_increment=mi_uint8korr(ptr); ptr +=8; + state->state.checksum=(ha_checksum) mi_uint8korr(ptr); ptr +=8; + state->process= mi_uint4korr(ptr); ptr +=4; + state->unique = mi_uint4korr(ptr); ptr +=4; + state->status = mi_uint4korr(ptr); ptr +=4; + state->update_count=mi_uint4korr(ptr); ptr +=4; + + ptr+= state->state_diff_length; + + for (i=0; i < keys; i++) + { + state->key_root[i]= mi_sizekorr(ptr); ptr +=8; + } + for (i=0; i < key_blocks; i++) + { + state->key_del[i] = mi_sizekorr(ptr); ptr +=8; + } + state->sec_index_changed = mi_uint4korr(ptr); ptr +=4; + state->sec_index_used = mi_uint4korr(ptr); ptr +=4; + state->version = mi_uint4korr(ptr); ptr +=4; + state->key_map = mi_uint8korr(ptr); ptr +=8; + state->create_time = (time_t) mi_sizekorr(ptr); ptr +=8; + state->recover_time =(time_t) mi_sizekorr(ptr); ptr +=8; + state->check_time = (time_t) mi_sizekorr(ptr); ptr +=8; + state->rec_per_key_rows=mi_sizekorr(ptr); ptr +=8; + for (i=0 ; i < key_parts ; i++) + { + state->rec_per_key_part[i]= mi_uint4korr(ptr); ptr+=4; + } + return ptr; +} + + +uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead) +{ + uchar buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE]; + + if (!myisam_single_user) + { + if (pRead) + { + if (my_pread(file, buff, state->state_length,0L, MYF(MY_NABP))) + return 1; + } + else if (my_read(file, buff, state->state_length,MYF(MY_NABP))) + return 1; + mi_state_info_read(buff, state); + } + return 0; +} + + +/**************************************************************************** +** store and read of MI_BASE_INFO +****************************************************************************/ + +uint mi_base_info_write(File file, MI_BASE_INFO *base) +{ + uchar buff[MI_BASE_INFO_SIZE], *ptr=buff; + + mi_sizestore(ptr,base->keystart); ptr +=8; + mi_sizestore(ptr,base->max_data_file_length); ptr +=8; + mi_sizestore(ptr,base->max_key_file_length); ptr +=8; + mi_rowstore(ptr,base->records); ptr +=8; + mi_rowstore(ptr,base->reloc); ptr +=8; + mi_int4store(ptr,base->mean_row_length); ptr +=4; + mi_int4store(ptr,base->reclength); ptr +=4; + mi_int4store(ptr,base->pack_reclength); ptr +=4; + mi_int4store(ptr,base->min_pack_length); ptr +=4; + mi_int4store(ptr,base->max_pack_length); ptr +=4; + mi_int4store(ptr,base->min_block_length); ptr +=4; + mi_int4store(ptr,base->fields); ptr +=4; + mi_int4store(ptr,base->pack_fields); ptr +=4; + *ptr++=base->rec_reflength; + *ptr++=base->key_reflength; + *ptr++=base->keys; + *ptr++=base->auto_key; + mi_int2store(ptr,base->pack_bits); ptr +=2; + mi_int2store(ptr,base->blobs); ptr +=2; + mi_int2store(ptr,base->max_key_block_length); ptr +=2; + mi_int2store(ptr,base->max_key_length); ptr +=2; + mi_int2store(ptr,base->extra_alloc_bytes); ptr +=2; + *ptr++= base->extra_alloc_procent; + *ptr++= base->raid_type; + mi_int2store(ptr,base->raid_chunks); ptr +=2; + mi_int4store(ptr,base->raid_chunksize); ptr +=4; + bzero(ptr,6); ptr +=6; /* extra */ + return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; +} + + +uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base) +{ + base->keystart = mi_sizekorr(ptr); ptr +=8; + base->max_data_file_length = mi_sizekorr(ptr); ptr +=8; + base->max_key_file_length = mi_sizekorr(ptr); ptr +=8; + base->records = (ha_rows) mi_sizekorr(ptr); ptr +=8; + base->reloc = (ha_rows) mi_sizekorr(ptr); ptr +=8; + base->mean_row_length = mi_uint4korr(ptr); ptr +=4; + base->reclength = mi_uint4korr(ptr); ptr +=4; + base->pack_reclength = mi_uint4korr(ptr); ptr +=4; + base->min_pack_length = mi_uint4korr(ptr); ptr +=4; + base->max_pack_length = mi_uint4korr(ptr); ptr +=4; + base->min_block_length = mi_uint4korr(ptr); ptr +=4; + base->fields = mi_uint4korr(ptr); ptr +=4; + base->pack_fields = mi_uint4korr(ptr); ptr +=4; + + base->rec_reflength = *ptr++; + base->key_reflength = *ptr++; + base->keys= *ptr++; + base->auto_key= *ptr++; + base->pack_bits = mi_uint2korr(ptr); ptr +=2; + base->blobs = mi_uint2korr(ptr); ptr +=2; + base->max_key_block_length= mi_uint2korr(ptr); ptr +=2; + base->max_key_length = mi_uint2korr(ptr); ptr +=2; + base->extra_alloc_bytes = mi_uint2korr(ptr); ptr +=2; + base->extra_alloc_procent = *ptr++; + base->raid_type= *ptr++; + base->raid_chunks= mi_uint2korr(ptr); ptr +=2; + base->raid_chunksize= mi_uint4korr(ptr); ptr +=4; + /* TO BE REMOVED: Fix for old RAID files */ + if (base->raid_type == 0) + { + base->raid_chunks=0; + base->raid_chunksize=0; + } + + ptr+=6; + return ptr; +} + +/*-------------------------------------------------------------------------- + mi_keydef +---------------------------------------------------------------------------*/ + +uint mi_keydef_write(File file, MI_KEYDEF *keydef) +{ + uchar buff[MI_KEYDEF_SIZE]; + uchar *ptr=buff; + + *ptr++ = (uchar) keydef->keysegs; + *ptr++ = keydef->key_alg; /* Rtree or Btree */ + mi_int2store(ptr,keydef->flag); ptr +=2; + mi_int2store(ptr,keydef->block_length); ptr +=2; + mi_int2store(ptr,keydef->keylength); ptr +=2; + mi_int2store(ptr,keydef->minlength); ptr +=2; + mi_int2store(ptr,keydef->maxlength); ptr +=2; + return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; +} + +uchar *mi_keydef_read(uchar *ptr, MI_KEYDEF *keydef) +{ + keydef->keysegs = (uint) *ptr++; + keydef->key_alg = *ptr++; /* Rtree or Btree */ + + keydef->flag = mi_uint2korr(ptr); ptr +=2; + keydef->block_length = mi_uint2korr(ptr); ptr +=2; + keydef->keylength = mi_uint2korr(ptr); ptr +=2; + keydef->minlength = mi_uint2korr(ptr); ptr +=2; + keydef->maxlength = mi_uint2korr(ptr); ptr +=2; + keydef->block_size_index= keydef->block_length/MI_MIN_KEY_BLOCK_LENGTH-1; + keydef->underflow_block_length=keydef->block_length/3; + keydef->version = 0; /* Not saved */ + keydef->parser = &ft_default_parser; + keydef->ftparser_nr = 0; + return ptr; +} + +/*************************************************************************** +** mi_keyseg +***************************************************************************/ + +int mi_keyseg_write(File file, const HA_KEYSEG *keyseg) +{ + uchar buff[HA_KEYSEG_SIZE]; + uchar *ptr=buff; + ulong pos; + + *ptr++= keyseg->type; + *ptr++= keyseg->language; + *ptr++= keyseg->null_bit; + *ptr++= keyseg->bit_start; + *ptr++= keyseg->bit_end; + *ptr++= keyseg->bit_length; + mi_int2store(ptr,keyseg->flag); ptr+=2; + mi_int2store(ptr,keyseg->length); ptr+=2; + mi_int4store(ptr,keyseg->start); ptr+=4; + pos= keyseg->null_bit ? keyseg->null_pos : keyseg->bit_pos; + mi_int4store(ptr, pos); + ptr+=4; + + return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; +} + + +uchar *mi_keyseg_read(uchar *ptr, HA_KEYSEG *keyseg) +{ + keyseg->type = *ptr++; + keyseg->language = *ptr++; + keyseg->null_bit = *ptr++; + keyseg->bit_start = *ptr++; + keyseg->bit_end = *ptr++; + keyseg->bit_length = *ptr++; + keyseg->flag = mi_uint2korr(ptr); ptr +=2; + keyseg->length = mi_uint2korr(ptr); ptr +=2; + keyseg->start = mi_uint4korr(ptr); ptr +=4; + keyseg->null_pos = mi_uint4korr(ptr); ptr +=4; + keyseg->charset=0; /* Will be filled in later */ + if (keyseg->null_bit) + keyseg->bit_pos= (uint16)(keyseg->null_pos + (keyseg->null_bit == 7)); + else + { + keyseg->bit_pos= (uint16)keyseg->null_pos; + keyseg->null_pos= 0; + } + return ptr; +} + +/*-------------------------------------------------------------------------- + mi_uniquedef +---------------------------------------------------------------------------*/ + +uint mi_uniquedef_write(File file, MI_UNIQUEDEF *def) +{ + uchar buff[MI_UNIQUEDEF_SIZE]; + uchar *ptr=buff; + + mi_int2store(ptr,def->keysegs); ptr+=2; + *ptr++= (uchar) def->key; + *ptr++ = (uchar) def->null_are_equal; + + return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; +} + +uchar *mi_uniquedef_read(uchar *ptr, MI_UNIQUEDEF *def) +{ + def->keysegs = mi_uint2korr(ptr); + def->key = ptr[2]; + def->null_are_equal=ptr[3]; + return ptr+4; /* 1 extra byte */ +} + +/*************************************************************************** +** MI_COLUMNDEF +***************************************************************************/ + +uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo) +{ + uchar buff[MI_COLUMNDEF_SIZE]; + uchar *ptr=buff; + + mi_int2store(ptr,recinfo->type); ptr +=2; + mi_int2store(ptr,recinfo->length); ptr +=2; + *ptr++ = recinfo->null_bit; + mi_int2store(ptr,recinfo->null_pos); ptr+= 2; + return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; +} + +uchar *mi_recinfo_read(uchar *ptr, MI_COLUMNDEF *recinfo) +{ + recinfo->type= mi_sint2korr(ptr); ptr +=2; + recinfo->length=mi_uint2korr(ptr); ptr +=2; + recinfo->null_bit= (uint8) *ptr++; + recinfo->null_pos=mi_uint2korr(ptr); ptr +=2; + return ptr; +} + +/************************************************************************** +Open data file with or without RAID +We can't use dup() here as the data file descriptors need to have different +active seek-positions. + +The argument file_to_dup is here for the future if there would on some OS +exist a dup()-like call that would give us two different file descriptors. +*************************************************************************/ + +int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, + File file_to_dup __attribute__((unused))) +{ +#ifdef USE_RAID + if (share->base.raid_type) + { + info->dfile=my_raid_open(share->data_file_name, + share->mode | O_SHARE, + share->base.raid_type, + share->base.raid_chunks, + share->base.raid_chunksize, + MYF(MY_WME | MY_RAID)); + } + else +#endif + info->dfile=my_open(share->data_file_name, share->mode | O_SHARE, + MYF(MY_WME)); + return info->dfile >= 0 ? 0 : 1; +} + + +int mi_open_keyfile(MYISAM_SHARE *share) +{ + if ((share->kfile=my_open(share->unique_file_name, share->mode | O_SHARE, + MYF(MY_WME))) < 0) + return 1; + return 0; +} + + +/* + Disable all indexes. + + SYNOPSIS + mi_disable_indexes() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Disable all indexes. + + RETURN + 0 ok +*/ + +int mi_disable_indexes(MI_INFO *info) +{ + MYISAM_SHARE *share= info->s; + + mi_clear_all_keys_active(share->state.key_map); + return 0; +} + + +/* + Enable all indexes + + SYNOPSIS + mi_enable_indexes() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Enable all indexes. The indexes might have been disabled + by mi_disable_index() before. + The function works only if both data and indexes are empty, + otherwise a repair is required. + To be sure, call handler::delete_all_rows() before. + + RETURN + 0 ok + HA_ERR_CRASHED data or index is non-empty. +*/ + +int mi_enable_indexes(MI_INFO *info) +{ + int error= 0; + MYISAM_SHARE *share= info->s; + + if (share->state.state.data_file_length || + (share->state.state.key_file_length != share->base.keystart)) + { + mi_print_error(info->s, HA_ERR_CRASHED); + error= HA_ERR_CRASHED; + } + else + mi_set_all_keys_active(share->state.key_map, share->base.keys); + return error; +} + + +/* + Test if indexes are disabled. + + SYNOPSIS + mi_indexes_are_disabled() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Test if indexes are disabled. + + RETURN + 0 indexes are not disabled + 1 all indexes are disabled + 2 non-unique indexes are disabled +*/ + +int mi_indexes_are_disabled(MI_INFO *info) +{ + MYISAM_SHARE *share= info->s; + + /* + No keys or all are enabled. keys is the number of keys. Left shifted + gives us only one bit set. When decreased by one, gives us all all bits + up to this one set and it gets unset. + */ + if (!share->base.keys || + (mi_is_all_keys_active(share->state.key_map, share->base.keys))) + return 0; + + /* All are disabled */ + if (mi_is_any_key_active(share->state.key_map)) + return 1; + + /* + We have keys. Some enabled, some disabled. + Don't check for any non-unique disabled but return directly 2 + */ + return 2; +} + Added: trunk/src/mi_packrec.c =================================================================== --- trunk/src/mi_packrec.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_packrec.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1656 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + /* Functions to compressed records */ + +#include "fulltext.h" + +#define IS_CHAR ((uint) 32768) /* Bit if char (not offset) in tree */ + +/* Some definitions to keep in sync with myisampack.c */ +#define HEAD_LENGTH 32 /* Length of fixed header */ + +#if INT_MAX > 32767 +#define BITS_SAVED 32 +#define MAX_QUICK_TABLE_BITS 9 /* Because we may shift in 24 bits */ +#else +#define BITS_SAVED 16 +#define MAX_QUICK_TABLE_BITS 6 +#endif + +#define get_bit(BU) ((BU)->bits ? \ + (BU)->current_byte & ((mi_bit_type) 1 << --(BU)->bits) :\ + (fill_buffer(BU), (BU)->bits= BITS_SAVED-1,\ + (BU)->current_byte & ((mi_bit_type) 1 << (BITS_SAVED-1)))) +#define skip_to_next_byte(BU) ((BU)->bits&=~7) +#define get_bits(BU,count) (((BU)->bits >= count) ? (((BU)->current_byte >> ((BU)->bits-=count)) & mask[count]) : fill_and_get_bits(BU,count)) + +#define decode_bytes_test_bit(bit) \ + if (low_byte & (1 << (7-bit))) \ + pos++; \ + if (*pos & IS_CHAR) \ + { bits-=(bit+1); break; } \ + pos+= *pos + +/* Size in uint16 of a Huffman tree for byte compression of 256 byte values. */ +#define OFFSET_TABLE_SIZE 512 + +static uint read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, + uint16 **decode_table,uchar **intervall_buff, + uint16 *tmp_buff); +static void make_quick_table(uint16 *to_table,uint16 *decode_table, + uint *next_free,uint value,uint bits, + uint max_bits); +static void fill_quick_table(uint16 *table,uint bits, uint max_bits, + uint value); +static uint copy_decode_table(uint16 *to_pos,uint offset, + uint16 *decode_table); +static uint find_longest_bitstream(uint16 *table, uint16 *end); +static void (*get_unpack_function(MI_COLUMNDEF *rec))(MI_COLUMNDEF *field, + MI_BIT_BUFF *buff, + uchar *to, + uchar *end); +static void uf_zerofill_skip_zero(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_skip_zero(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_space_normal(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_space_endspace_selected(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end); +static void uf_endspace_selected(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_space_endspace(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_endspace(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_space_prespace_selected(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end); +static void uf_prespace_selected(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_space_prespace(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_prespace(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_zerofill_normal(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_constant(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_intervall(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_zero(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end); +static void uf_varchar1(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end); +static void uf_varchar2(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end); +static void decode_bytes(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff, + uchar *to,uchar *end); +static uint decode_pos(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree); +static void init_bit_buffer(MI_BIT_BUFF *bit_buff,uchar *buffer,uint length); +static uint fill_and_get_bits(MI_BIT_BUFF *bit_buff,uint count); +static void fill_buffer(MI_BIT_BUFF *bit_buff); +static uint max_bit(uint value); +#ifdef HAVE_MMAP +static uchar *_mi_mempack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff, + MI_BLOCK_INFO *info, uchar **rec_buff_p, + uchar *header); +#endif + +static mi_bit_type mask[]= +{ + 0x00000000, + 0x00000001, 0x00000003, 0x00000007, 0x0000000f, + 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, + 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, + 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff, +#if BITS_SAVED > 16 + 0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff, + 0x001fffff, 0x003fffff, 0x007fffff, 0x00ffffff, + 0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff, + 0x1fffffff, 0x3fffffff, 0x7fffffff, 0xffffffff, +#endif + }; + + + /* Read all packed info, allocate memory and fix field structs */ + +my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) +{ + File file; + int diff_length; + uint i,trees,huff_tree_bits,rec_reflength,length; + uint16 *decode_table,*tmp_buff; + ulong elements,intervall_length; + uchar *disk_cache; + uchar *intervall_buff; + uchar header[HEAD_LENGTH]; + MYISAM_SHARE *share=info->s; + MI_BIT_BUFF bit_buff; + DBUG_ENTER("_mi_read_pack_info"); + + if (myisam_quick_table_bits < 4) + myisam_quick_table_bits=4; + else if (myisam_quick_table_bits > MAX_QUICK_TABLE_BITS) + myisam_quick_table_bits=MAX_QUICK_TABLE_BITS; + + file=info->dfile; + my_errno=0; + if (my_read(file,(uchar*) header,sizeof(header),MYF(MY_NABP))) + { + if (!my_errno) + my_errno=HA_ERR_END_OF_FILE; + goto err0; + } + /* Only the first three bytes of magic number are independent of version. */ + if (memcmp((uchar*) header, (uchar*) myisam_pack_file_magic, 3)) + { + my_errno=HA_ERR_WRONG_IN_RECORD; + goto err0; + } + share->pack.version= header[3]; /* fourth byte of magic number */ + share->pack.header_length= uint4korr(header+4); + share->min_pack_length=(uint) uint4korr(header+8); + share->max_pack_length=(uint) uint4korr(header+12); + set_if_bigger(share->base.pack_reclength,share->max_pack_length); + elements=uint4korr(header+16); + intervall_length=uint4korr(header+20); + trees=uint2korr(header+24); + share->pack.ref_length=header[26]; + rec_reflength=header[27]; + diff_length=(int) rec_reflength - (int) share->base.rec_reflength; + if (fix_keys) + share->rec_reflength=rec_reflength; + share->base.min_block_length=share->min_pack_length+1; + if (share->min_pack_length > 254) + share->base.min_block_length+=2; + DBUG_PRINT("info", ("fixed header length: %u", HEAD_LENGTH)); + DBUG_PRINT("info", ("total header length: %lu", share->pack.header_length)); + DBUG_PRINT("info", ("pack file version: %u", share->pack.version)); + DBUG_PRINT("info", ("min pack length: %lu", share->min_pack_length)); + DBUG_PRINT("info", ("max pack length: %lu", share->max_pack_length)); + DBUG_PRINT("info", ("elements of all trees: %lu", elements)); + DBUG_PRINT("info", ("distinct values bytes: %lu", intervall_length)); + DBUG_PRINT("info", ("number of code trees: %u", trees)); + DBUG_PRINT("info", ("bytes for record lgt: %u", share->pack.ref_length)); + DBUG_PRINT("info", ("record pointer length: %u", rec_reflength)); + + /* + Memory segment #1: + - Decode tree heads + - Distinct column values + */ + if (!(share->decode_trees=(MI_DECODE_TREE*) + my_malloc((uint) (trees*sizeof(MI_DECODE_TREE)+ + intervall_length*sizeof(uchar)), + MYF(MY_WME)))) + goto err0; + intervall_buff=(uchar*) (share->decode_trees+trees); + + /* + Memory segment #2: + - Decode tables + - Quick decode tables + - Temporary decode table + - Compressed data file header cache + This segment will be reallocated after construction of the tables. + */ + length=(uint) (elements*2+trees*(1 << myisam_quick_table_bits)); + if (!(share->decode_tables=(uint16*) + my_malloc((length + OFFSET_TABLE_SIZE) * sizeof(uint16) + + (uint) (share->pack.header_length - sizeof(header)), + MYF(MY_WME | MY_ZEROFILL)))) + goto err1; + tmp_buff=share->decode_tables+length; + disk_cache= (uchar*) (tmp_buff+OFFSET_TABLE_SIZE); + + if (my_read(file,disk_cache, + (uint) (share->pack.header_length-sizeof(header)), + MYF(MY_NABP))) + goto err2; + + huff_tree_bits=max_bit(trees ? trees-1 : 0); + init_bit_buffer(&bit_buff, disk_cache, + (uint) (share->pack.header_length-sizeof(header))); + /* Read new info for each field */ + for (i=0 ; i < share->base.fields ; i++) + { + share->rec[i].base_type=(enum en_fieldtype) get_bits(&bit_buff,5); + share->rec[i].pack_type=(uint) get_bits(&bit_buff,6); + share->rec[i].space_length_bits=get_bits(&bit_buff,5); + share->rec[i].huff_tree=share->decode_trees+(uint) get_bits(&bit_buff, + huff_tree_bits); + share->rec[i].unpack=get_unpack_function(share->rec+i); + DBUG_PRINT("info", ("col: %2u type: %2u pack: %u slbits: %2u", + i, share->rec[i].base_type, share->rec[i].pack_type, + share->rec[i].space_length_bits)); + } + skip_to_next_byte(&bit_buff); + /* + Construct the decoding tables from the file header. Keep track of + the used memory. + */ + decode_table=share->decode_tables; + for (i=0 ; i < trees ; i++) + if (read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, + &intervall_buff,tmp_buff)) + goto err3; + /* Reallocate the decoding tables to the used size. */ + decode_table=(uint16*) + my_realloc((uchar*) share->decode_tables, + (uint) ((uchar*) decode_table - (uchar*) share->decode_tables), + MYF(MY_HOLD_ON_ERROR)); + /* Fix the table addresses in the tree heads. */ + { + long diff=PTR_BYTE_DIFF(decode_table,share->decode_tables); + share->decode_tables=decode_table; + for (i=0 ; i < trees ; i++) + share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table, + diff, uint16*); + } + + /* Fix record-ref-length for keys */ + if (fix_keys) + { + for (i=0 ; i < share->base.keys ; i++) + { + MI_KEYDEF *keyinfo= &share->keyinfo[i]; + keyinfo->keylength+= (uint16) diff_length; + keyinfo->minlength+= (uint16) diff_length; + keyinfo->maxlength+= (uint16) diff_length; + keyinfo->seg[keyinfo->flag & HA_FULLTEXT ? + FT_SEGS : keyinfo->keysegs].length= (uint16) rec_reflength; + } + if (share->ft2_keyinfo.seg) + { + MI_KEYDEF *ft2_keyinfo= &share->ft2_keyinfo; + ft2_keyinfo->keylength+= (uint16) diff_length; + ft2_keyinfo->minlength+= (uint16) diff_length; + ft2_keyinfo->maxlength+= (uint16) diff_length; + } + } + + if (bit_buff.error || bit_buff.pos < bit_buff.end) + goto err3; + + DBUG_RETURN(0); + +err3: + my_errno=HA_ERR_WRONG_IN_RECORD; +err2: + my_free((uchar*) share->decode_tables,MYF(0)); +err1: + my_free((uchar*) share->decode_trees,MYF(0)); +err0: + DBUG_RETURN(1); +} + + +/* + Read a huff-code-table from datafile. + + SYNOPSIS + read_huff_table() + bit_buff Bit buffer pointing at start of the + decoding table in the file header cache. + decode_tree Pointer to the decode tree head. + decode_table IN/OUT Address of a pointer to the next free space. + intervall_buff IN/OUT Address of a pointer to the next unused values. + tmp_buff Buffer for temporary extraction of a full + decoding table as read from bit_buff. + + RETURN + 0 OK. + 1 Error. +*/ + +static uint read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, + uint16 **decode_table, uchar **intervall_buff, + uint16 *tmp_buff) +{ + uint min_chr,elements,char_bits,offset_bits,size,intervall_length,table_bits, + next_free_offset; + uint16 *ptr,*end; + DBUG_ENTER("read_huff_table"); + + if (!get_bits(bit_buff,1)) + { + /* Byte value compression. */ + min_chr=get_bits(bit_buff,8); + elements=get_bits(bit_buff,9); + char_bits=get_bits(bit_buff,5); + offset_bits=get_bits(bit_buff,5); + intervall_length=0; + ptr=tmp_buff; + DBUG_PRINT("info", ("byte value compression")); + DBUG_PRINT("info", ("minimum byte value: %u", min_chr)); + DBUG_PRINT("info", ("number of tree nodes: %u", elements)); + DBUG_PRINT("info", ("bits for values: %u", char_bits)); + DBUG_PRINT("info", ("bits for tree offsets: %u", offset_bits)); + if (elements > 256) + { + DBUG_PRINT("error", ("ERROR: illegal number of tree elements: %u", + elements)); + DBUG_RETURN(1); + } + } + else + { + /* Distinct column value compression. */ + min_chr=0; + elements=get_bits(bit_buff,15); + intervall_length=get_bits(bit_buff,16); + char_bits=get_bits(bit_buff,5); + offset_bits=get_bits(bit_buff,5); + decode_tree->quick_table_bits=0; + ptr= *decode_table; + DBUG_PRINT("info", ("distinct column value compression")); + DBUG_PRINT("info", ("number of tree nodes: %u", elements)); + DBUG_PRINT("info", ("value buffer length: %u", intervall_length)); + DBUG_PRINT("info", ("bits for value index: %u", char_bits)); + DBUG_PRINT("info", ("bits for tree offsets: %u", offset_bits)); + } + size=elements*2-2; + DBUG_PRINT("info", ("tree size in uint16: %u", size)); + DBUG_PRINT("info", ("tree size in bytes: %u", + size * (uint) sizeof(uint16))); + + for (end=ptr+size ; ptr < end ; ptr++) + { + if (get_bit(bit_buff)) + { + *ptr= (uint16) get_bits(bit_buff,offset_bits); + if ((ptr + *ptr >= end) || !*ptr) + { + DBUG_PRINT("error", ("ERROR: illegal pointer in decode tree")); + DBUG_RETURN(1); + } + } + else + *ptr= (uint16) (IS_CHAR + (get_bits(bit_buff,char_bits) + min_chr)); + } + skip_to_next_byte(bit_buff); + + decode_tree->table= *decode_table; + decode_tree->intervalls= *intervall_buff; + if (! intervall_length) + { + /* Byte value compression. ptr started from tmp_buff. */ + /* Find longest Huffman code from begin to end of tree in bits. */ + table_bits= find_longest_bitstream(tmp_buff, ptr); + if (table_bits >= OFFSET_TABLE_SIZE) + DBUG_RETURN(1); + if (table_bits > myisam_quick_table_bits) + table_bits=myisam_quick_table_bits; + DBUG_PRINT("info", ("table bits: %u", table_bits)); + + next_free_offset= (1 << table_bits); + make_quick_table(*decode_table,tmp_buff,&next_free_offset,0,table_bits, + table_bits); + (*decode_table)+= next_free_offset; + decode_tree->quick_table_bits=table_bits; + } + else + { + /* Distinct column value compression. ptr started from *decode_table */ + (*decode_table)=end; + /* + get_bits() moves some bytes to a cache buffer in advance. May need + to step back. + */ + bit_buff->pos-= bit_buff->bits/8; + /* Copy the distinct column values from the buffer. */ + memcpy(*intervall_buff,bit_buff->pos,(size_t) intervall_length); + (*intervall_buff)+=intervall_length; + bit_buff->pos+=intervall_length; + bit_buff->bits=0; + } + DBUG_RETURN(0); +} + + +/* + Make a quick_table for faster decoding. + + SYNOPSIS + make_quick_table() + to_table Target quick_table and remaining decode table. + decode_table Source Huffman (sub-)tree within tmp_buff. + next_free_offset IN/OUT Next free offset from to_table. + Starts behind quick_table on the top-level. + value Huffman bits found so far. + bits Remaining bits to be collected. + max_bits Total number of bits to collect (table_bits). + + DESCRIPTION + + The quick table is an array of 16-bit values. There exists one value + for each possible code representable by max_bits (table_bits) bits. + In most cases table_bits is 9. So there are 512 16-bit values. + + If the high-order bit (16) is set (IS_CHAR) then the array slot for + this value is a valid Huffman code for a resulting byte value. + + The low-order 8 bits (1..8) are the resulting byte value. + + Bits 9..14 are the length of the Huffman code for this byte value. + This means so many bits from the input stream were needed to + represent this byte value. The remaining bits belong to later + Huffman codes. This also means that for every Huffman code shorter + than table_bits there are multiple entires in the array, which + differ just in the unused bits. + + If the high-order bit (16) is clear (0) then the remaining bits are + the position of the remaining Huffman decode tree segment behind the + quick table. + + RETURN + void +*/ + +static void make_quick_table(uint16 *to_table, uint16 *decode_table, + uint *next_free_offset, uint value, uint bits, + uint max_bits) +{ + DBUG_ENTER("make_quick_table"); + + /* + When down the table to the requested maximum, copy the rest of the + Huffman table. + */ + if (!bits--) + { + /* + Remaining left Huffman tree segment starts behind quick table. + Remaining right Huffman tree segment starts behind left segment. + */ + to_table[value]= (uint16) *next_free_offset; + /* + Re-construct the remaining Huffman tree segment at + next_free_offset in to_table. + */ + *next_free_offset= copy_decode_table(to_table, *next_free_offset, + decode_table); + DBUG_VOID_RETURN; + } + + /* Descent on the left side. Left side bits are clear (0). */ + if (!(*decode_table & IS_CHAR)) + { + /* Not a leaf. Follow the pointer. */ + make_quick_table(to_table, decode_table + *decode_table, + next_free_offset, value, bits, max_bits); + } + else + { + /* + A leaf. A Huffman code is complete. Fill the quick_table + array for all possible bit strings starting with this Huffman + code. + */ + fill_quick_table(to_table + value, bits, max_bits, (uint) *decode_table); + } + + /* Descent on the right side. Right side bits are set (1). */ + decode_table++; + value|= (1 << bits); + if (!(*decode_table & IS_CHAR)) + { + /* Not a leaf. Follow the pointer. */ + make_quick_table(to_table, decode_table + *decode_table, + next_free_offset, value, bits, max_bits); + } + else + { + /* + A leaf. A Huffman code is complete. Fill the quick_table + array for all possible bit strings starting with this Huffman + code. + */ + fill_quick_table(to_table + value, bits, max_bits, (uint) *decode_table); + } + + DBUG_VOID_RETURN; +} + + +/* + Fill quick_table for all possible values starting with this Huffman code. + + SYNOPSIS + fill_quick_table() + table Target quick_table position. + bits Unused bits from max_bits. + max_bits Total number of bits to collect (table_bits). + value The byte encoded by the found Huffman code. + + DESCRIPTION + + Fill the segment (all slots) of the quick_table array with the + resulting value for the found Huffman code. There are as many slots + as there are combinations representable by the unused bits. + + In most cases we use 9 table bits. Assume a 3-bit Huffman code. Then + there are 6 unused bits. Hence we fill 2**6 = 64 slots with the + value. + + RETURN + void +*/ + +static void fill_quick_table(uint16 *table, uint bits, uint max_bits, + uint value) +{ + uint16 *end; + DBUG_ENTER("fill_quick_table"); + + /* + Bits 1..8 of value represent the decoded byte value. + Bits 9..14 become the length of the Huffman code for this byte value. + Bit 16 flags a valid code (IS_CHAR). + */ + value|= (max_bits - bits) << 8 | IS_CHAR; + + for (end= table + (uint) (((uint) 1 << bits)); table < end; table++) + { + *table= (uint16) value; + } + DBUG_VOID_RETURN; +} + + +/* + Reconstruct a decode subtree at the target position. + + SYNOPSIS + copy_decode_table() + to_pos Target quick_table and remaining decode table. + offset Next free offset from to_pos. + decode_table Source Huffman subtree within tmp_buff. + + NOTE + Pointers in the decode tree are relative to the pointers position. + + RETURN + next free offset from to_pos. +*/ + +static uint copy_decode_table(uint16 *to_pos, uint offset, + uint16 *decode_table) +{ + uint prev_offset= offset; + DBUG_ENTER("copy_decode_table"); + + /* Descent on the left side. */ + if (!(*decode_table & IS_CHAR)) + { + /* Set a pointer to the next target node. */ + to_pos[offset]=2; + /* Copy the left hand subtree there. */ + offset=copy_decode_table(to_pos,offset+2,decode_table+ *decode_table); + } + else + { + /* Copy the byte value. */ + to_pos[offset]= *decode_table; + /* Step behind this node. */ + offset+=2; + } + + /* Descent on the right side. */ + decode_table++; + if (!(*decode_table & IS_CHAR)) + { + /* Set a pointer to the next free target node. */ + to_pos[prev_offset+1]=(uint16) (offset-prev_offset-1); + /* Copy the right hand subtree to the entry of that node. */ + offset=copy_decode_table(to_pos,offset,decode_table+ *decode_table); + } + else + { + /* Copy the byte value. */ + to_pos[prev_offset+1]= *decode_table; + } + DBUG_RETURN(offset); +} + + +/* + Find the length of the longest Huffman code in this table in bits. + + SYNOPSIS + find_longest_bitstream() + table Code (sub-)table start. + end End of code table. + + IMPLEMENTATION + + Recursively follow the branch(es) of the code pair on every level of + the tree until two byte values (and no branch) are found. Add one to + each level when returning back from each recursion stage. + + 'end' is used for error checking only. A clean tree terminates + before reaching 'end'. Hence the exact value of 'end' is not too + important. However having it higher than necessary could lead to + misbehaviour should 'next' jump into the dirty area. + + RETURN + length Length of longest Huffman code in bits. + >= OFFSET_TABLE_SIZE Error, broken tree. It does not end before 'end'. +*/ + +static uint find_longest_bitstream(uint16 *table, uint16 *end) +{ + uint length= 1; + uint length2; + + if (!(*table & IS_CHAR)) + { + uint16 *next= table + *table; + if (next > end || next == table) + { + DBUG_PRINT("error", ("ERROR: illegal pointer in decode tree")); + return OFFSET_TABLE_SIZE; + } + length= find_longest_bitstream(next, end) + 1; + } + table++; + if (!(*table & IS_CHAR)) + { + uint16 *next= table + *table; + if (next > end || next == table) + { + DBUG_PRINT("error", ("ERROR: illegal pointer in decode tree")); + return OFFSET_TABLE_SIZE; + } + length2= find_longest_bitstream(next, end) + 1; + length=max(length,length2); + } + return length; +} + + +/* + Read record from datafile. + + SYNOPSIS + _mi_read_pack_record() + info A pointer to MI_INFO. + filepos File offset of the record. + buf RETURN The buffer to receive the record. + + RETURN + 0 on success + HA_ERR_WRONG_IN_RECORD or -1 on error +*/ + +int _mi_read_pack_record(MI_INFO *info, my_off_t filepos, uchar *buf) +{ + MI_BLOCK_INFO block_info; + File file; + DBUG_ENTER("mi_read_pack_record"); + + if (filepos == HA_OFFSET_ERROR) + DBUG_RETURN(-1); /* _search() didn't find record */ + + file=info->dfile; + if (_mi_pack_get_block_info(info, &info->bit_buff, &block_info, + &info->rec_buff, file, filepos)) + goto err; + if (my_read(file,(uchar*) info->rec_buff + block_info.offset , + block_info.rec_len - block_info.offset, MYF(MY_NABP))) + goto panic; + info->update|= HA_STATE_AKTIV; + DBUG_RETURN(_mi_pack_rec_unpack(info, &info->bit_buff, buf, + info->rec_buff, block_info.rec_len)); +panic: + my_errno=HA_ERR_WRONG_IN_RECORD; +err: + DBUG_RETURN(-1); +} + + + +int _mi_pack_rec_unpack(register MI_INFO *info, MI_BIT_BUFF *bit_buff, + register uchar *to, uchar *from, ulong reclength) +{ + uchar *end_field; + reg3 MI_COLUMNDEF *end; + MI_COLUMNDEF *current_field; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("_mi_pack_rec_unpack"); + + init_bit_buffer(bit_buff, (uchar*) from, reclength); + + for (current_field=share->rec, end=current_field+share->base.fields ; + current_field < end ; + current_field++,to=end_field) + { + end_field=to+current_field->length; + (*current_field->unpack)(current_field, bit_buff, (uchar*) to, + (uchar*) end_field); + } + if (!bit_buff->error && + bit_buff->pos - bit_buff->bits / 8 == bit_buff->end) + DBUG_RETURN(0); + info->update&= ~HA_STATE_AKTIV; + DBUG_RETURN(my_errno=HA_ERR_WRONG_IN_RECORD); +} /* _mi_pack_rec_unpack */ + + + /* Return function to unpack field */ + +static void (*get_unpack_function(MI_COLUMNDEF *rec)) +(MI_COLUMNDEF *, MI_BIT_BUFF *, uchar *, uchar *) +{ + switch (rec->base_type) { + case FIELD_SKIP_ZERO: + if (rec->pack_type & PACK_TYPE_ZERO_FILL) + return &uf_zerofill_skip_zero; + return &uf_skip_zero; + case FIELD_NORMAL: + if (rec->pack_type & PACK_TYPE_SPACE_FIELDS) + return &uf_space_normal; + if (rec->pack_type & PACK_TYPE_ZERO_FILL) + return &uf_zerofill_normal; + return &decode_bytes; + case FIELD_SKIP_ENDSPACE: + if (rec->pack_type & PACK_TYPE_SPACE_FIELDS) + { + if (rec->pack_type & PACK_TYPE_SELECTED) + return &uf_space_endspace_selected; + return &uf_space_endspace; + } + if (rec->pack_type & PACK_TYPE_SELECTED) + return &uf_endspace_selected; + return &uf_endspace; + case FIELD_SKIP_PRESPACE: + if (rec->pack_type & PACK_TYPE_SPACE_FIELDS) + { + if (rec->pack_type & PACK_TYPE_SELECTED) + return &uf_space_prespace_selected; + return &uf_space_prespace; + } + if (rec->pack_type & PACK_TYPE_SELECTED) + return &uf_prespace_selected; + return &uf_prespace; + case FIELD_CONSTANT: + return &uf_constant; + case FIELD_INTERVALL: + return &uf_intervall; + case FIELD_ZERO: + case FIELD_CHECK: + return &uf_zero; + case FIELD_BLOB: + return &uf_blob; + case FIELD_VARCHAR: + if (rec->length <= 256) /* 255 + 1 byte length */ + return &uf_varchar1; + return &uf_varchar2; + case FIELD_LAST: + default: + return 0; /* This should never happend */ + } +} + + /* The different functions to unpack a field */ + +static void uf_zerofill_skip_zero(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end) +{ + if (get_bit(bit_buff)) + bzero((char*) to,(uint) (end-to)); + else + { + end-=rec->space_length_bits; + decode_bytes(rec,bit_buff,to,end); + bzero((char*) end,rec->space_length_bits); + } +} + +static void uf_skip_zero(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + if (get_bit(bit_buff)) + bzero((char*) to,(uint) (end-to)); + else + decode_bytes(rec,bit_buff,to,end); +} + +static void uf_space_normal(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + if (get_bit(bit_buff)) + bfill((uchar*) to,(end-to),' '); + else + decode_bytes(rec,bit_buff,to,end); +} + +static void uf_space_endspace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end) +{ + uint spaces; + if (get_bit(bit_buff)) + bfill((uchar*) to,(end-to),' '); + else + { + if (get_bit(bit_buff)) + { + if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) + { + bit_buff->error=1; + return; + } + if (to+spaces != end) + decode_bytes(rec,bit_buff,to,end-spaces); + bfill((uchar*) end-spaces,spaces,' '); + } + else + decode_bytes(rec,bit_buff,to,end); + } +} + +static void uf_endspace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end) +{ + uint spaces; + if (get_bit(bit_buff)) + { + if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) + { + bit_buff->error=1; + return; + } + if (to+spaces != end) + decode_bytes(rec,bit_buff,to,end-spaces); + bfill((uchar*) end-spaces,spaces,' '); + } + else + decode_bytes(rec,bit_buff,to,end); +} + +static void uf_space_endspace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + uint spaces; + if (get_bit(bit_buff)) + bfill((uchar*) to,(end-to),' '); + else + { + if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) + { + bit_buff->error=1; + return; + } + if (to+spaces != end) + decode_bytes(rec,bit_buff,to,end-spaces); + bfill((uchar*) end-spaces,spaces,' '); + } +} + +static void uf_endspace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + uint spaces; + if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) + { + bit_buff->error=1; + return; + } + if (to+spaces != end) + decode_bytes(rec,bit_buff,to,end-spaces); + bfill((uchar*) end-spaces,spaces,' '); +} + +static void uf_space_prespace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end) +{ + uint spaces; + if (get_bit(bit_buff)) + bfill((uchar*) to,(end-to),' '); + else + { + if (get_bit(bit_buff)) + { + if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) + { + bit_buff->error=1; + return; + } + bfill((uchar*) to,spaces,' '); + if (to+spaces != end) + decode_bytes(rec,bit_buff,to+spaces,end); + } + else + decode_bytes(rec,bit_buff,to,end); + } +} + + +static void uf_prespace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end) +{ + uint spaces; + if (get_bit(bit_buff)) + { + if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) + { + bit_buff->error=1; + return; + } + bfill((uchar*) to,spaces,' '); + if (to+spaces != end) + decode_bytes(rec,bit_buff,to+spaces,end); + } + else + decode_bytes(rec,bit_buff,to,end); +} + + +static void uf_space_prespace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + uint spaces; + if (get_bit(bit_buff)) + bfill((uchar*) to,(end-to),' '); + else + { + if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) + { + bit_buff->error=1; + return; + } + bfill((uchar*) to,spaces,' '); + if (to+spaces != end) + decode_bytes(rec,bit_buff,to+spaces,end); + } +} + +static void uf_prespace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + uint spaces; + if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) + { + bit_buff->error=1; + return; + } + bfill((uchar*) to,spaces,' '); + if (to+spaces != end) + decode_bytes(rec,bit_buff,to+spaces,end); +} + +static void uf_zerofill_normal(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + end-=rec->space_length_bits; + decode_bytes(rec,bit_buff,(uchar*) to,end); + bzero((char*) end,rec->space_length_bits); +} + +static void uf_constant(MI_COLUMNDEF *rec, + MI_BIT_BUFF *bit_buff __attribute__((unused)), + uchar *to, + uchar *end) +{ + memcpy(to,rec->huff_tree->intervalls,(size_t) (end-to)); +} + +static void uf_intervall(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + reg1 uint field_length=(uint) (end-to); + memcpy(to,rec->huff_tree->intervalls+field_length*decode_pos(bit_buff, + rec->huff_tree), + (size_t) field_length); +} + + +/*ARGSUSED*/ +static void uf_zero(MI_COLUMNDEF *rec __attribute__((unused)), + MI_BIT_BUFF *bit_buff __attribute__((unused)), + uchar *to, uchar *end) +{ + bzero((char*) to,(uint) (end-to)); +} + +static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end) +{ + if (get_bit(bit_buff)) + bzero((uchar*) to,(end-to)); + else + { + ulong length=get_bits(bit_buff,rec->space_length_bits); + uint pack_length=(uint) (end-to)-mi_portable_sizeof_char_ptr; + if (bit_buff->blob_pos+length > bit_buff->blob_end) + { + bit_buff->error=1; + bzero((uchar*) to,(end-to)); + return; + } + decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length); + _my_store_blob_length((uchar*) to,pack_length,length); + memcpy_fixed((char*) to+pack_length,(char*) &bit_buff->blob_pos, + sizeof(char*)); + bit_buff->blob_pos+=length; + } +} + + +static void uf_varchar1(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end __attribute__((unused))) +{ + if (get_bit(bit_buff)) + to[0]= 0; /* Zero lengths */ + else + { + ulong length=get_bits(bit_buff,rec->space_length_bits); + *to= (uchar) length; + decode_bytes(rec,bit_buff,to+1,to+1+length); + } +} + + +static void uf_varchar2(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *end __attribute__((unused))) +{ + if (get_bit(bit_buff)) + to[0]=to[1]=0; /* Zero lengths */ + else + { + ulong length=get_bits(bit_buff,rec->space_length_bits); + int2store(to,length); + decode_bytes(rec,bit_buff,to+2,to+2+length); + } +} + + /* Functions to decode of buffer of bits */ + +#if BITS_SAVED == 64 + +static void decode_bytes(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff,uchar *to, + uchar *end) +{ + reg1 uint bits,low_byte; + reg3 uint16 *pos; + reg4 uint table_bits,table_and; + MI_DECODE_TREE *decode_tree; + + decode_tree=rec->decode_tree; + bits=bit_buff->bits; /* Save in reg for quicker access */ + table_bits=decode_tree->quick_table_bits; + table_and= (1 << table_bits)-1; + + do + { + if (bits <= 32) + { + if (bit_buff->pos > bit_buff->end+4) + { + bit_buff->error=1; + return; /* Can't be right */ + } + bit_buff->current_byte= (bit_buff->current_byte << 32) + + ((((uint) bit_buff->pos[3])) + + (((uint) bit_buff->pos[2]) << 8) + + (((uint) bit_buff->pos[1]) << 16) + + (((uint) bit_buff->pos[0]) << 24)); + bit_buff->pos+=4; + bits+=32; + } + /* + First use info in quick_table. + + The quick table is an array of 16-bit values. There exists one + value for each possible code representable by table_bits bits. + In most cases table_bits is 9. So there are 512 16-bit values. + + If the high-order bit (16) is set (IS_CHAR) then the array slot + for this value is a valid Huffman code for a resulting byte value. + + The low-order 8 bits (1..8) are the resulting byte value. + + Bits 9..14 are the length of the Huffman code for this byte value. + This means so many bits from the input stream were needed to + represent this byte value. The remaining bits belong to later + Huffman codes. This also means that for every Huffman code shorter + than table_bits there are multiple entires in the array, which + differ just in the unused bits. + + If the high-order bit (16) is clear (0) then the remaining bits are + the position of the remaining Huffman decode tree segment behind the + quick table. + */ + low_byte=(uint) (bit_buff->current_byte >> (bits - table_bits)) & table_and; + low_byte=decode_tree->table[low_byte]; + if (low_byte & IS_CHAR) + { + /* + All Huffman codes of less or equal table_bits length are in the + quick table. This is one of them. + */ + *to++ = (low_byte & 255); /* Found char in quick table */ + bits-= ((low_byte >> 8) & 31); /* Remove bits used */ + } + else + { /* Map through rest of decode-table */ + /* This means that the Huffman code must be longer than table_bits. */ + pos=decode_tree->table+low_byte; + bits-=table_bits; + /* NOTE: decode_bytes_test_bit() is a macro wich contains a break !!! */ + for (;;) + { + low_byte=(uint) (bit_buff->current_byte >> (bits-8)); + decode_bytes_test_bit(0); + decode_bytes_test_bit(1); + decode_bytes_test_bit(2); + decode_bytes_test_bit(3); + decode_bytes_test_bit(4); + decode_bytes_test_bit(5); + decode_bytes_test_bit(6); + decode_bytes_test_bit(7); + bits-=8; + } + *to++ = *pos; + } + } while (to != end); + + bit_buff->bits=bits; + return; +} + +#else + +static void decode_bytes(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, + uchar *end) +{ + reg1 uint bits,low_byte; + reg3 uint16 *pos; + reg4 uint table_bits,table_and; + MI_DECODE_TREE *decode_tree; + + decode_tree=rec->huff_tree; + bits=bit_buff->bits; /* Save in reg for quicker access */ + table_bits=decode_tree->quick_table_bits; + table_and= (1 << table_bits)-1; + + do + { + if (bits < table_bits) + { + if (bit_buff->pos > bit_buff->end+1) + { + bit_buff->error=1; + return; /* Can't be right */ + } +#if BITS_SAVED == 32 + bit_buff->current_byte= (bit_buff->current_byte << 24) + + (((uint) ((uchar) bit_buff->pos[2]))) + + (((uint) ((uchar) bit_buff->pos[1])) << 8) + + (((uint) ((uchar) bit_buff->pos[0])) << 16); + bit_buff->pos+=3; + bits+=24; +#else + if (bits) /* We must have at leasts 9 bits */ + { + bit_buff->current_byte= (bit_buff->current_byte << 8) + + (uint) ((uchar) bit_buff->pos[0]); + bit_buff->pos++; + bits+=8; + } + else + { + bit_buff->current_byte= ((uint) ((uchar) bit_buff->pos[0]) << 8) + + ((uint) ((uchar) bit_buff->pos[1])); + bit_buff->pos+=2; + bits+=16; + } +#endif + } + /* First use info in quick_table */ + low_byte=(bit_buff->current_byte >> (bits - table_bits)) & table_and; + low_byte=decode_tree->table[low_byte]; + if (low_byte & IS_CHAR) + { + *to++ = (low_byte & 255); /* Found char in quick table */ + bits-= ((low_byte >> 8) & 31); /* Remove bits used */ + } + else + { /* Map through rest of decode-table */ + pos=decode_tree->table+low_byte; + bits-=table_bits; + for (;;) + { + if (bits < 8) + { /* We don't need to check end */ +#if BITS_SAVED == 32 + bit_buff->current_byte= (bit_buff->current_byte << 24) + + (((uint) ((uchar) bit_buff->pos[2]))) + + (((uint) ((uchar) bit_buff->pos[1])) << 8) + + (((uint) ((uchar) bit_buff->pos[0])) << 16); + bit_buff->pos+=3; + bits+=24; +#else + bit_buff->current_byte= (bit_buff->current_byte << 8) + + (uint) ((uchar) bit_buff->pos[0]); + bit_buff->pos+=1; + bits+=8; +#endif + } + low_byte=(uint) (bit_buff->current_byte >> (bits-8)); + decode_bytes_test_bit(0); + decode_bytes_test_bit(1); + decode_bytes_test_bit(2); + decode_bytes_test_bit(3); + decode_bytes_test_bit(4); + decode_bytes_test_bit(5); + decode_bytes_test_bit(6); + decode_bytes_test_bit(7); + bits-=8; + } + *to++ = (uchar) *pos; + } + } while (to != end); + + bit_buff->bits=bits; + return; +} +#endif /* BIT_SAVED == 64 */ + + +static uint decode_pos(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree) +{ + uint16 *pos=decode_tree->table; + for (;;) + { + if (get_bit(bit_buff)) + pos++; + if (*pos & IS_CHAR) + return (uint) (*pos & ~IS_CHAR); + pos+= *pos; + } +} + + +int _mi_read_rnd_pack_record(MI_INFO *info, uchar *buf, + register my_off_t filepos, + my_bool skip_deleted_blocks) +{ + uint b_type; + MI_BLOCK_INFO block_info; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("_mi_read_rnd_pack_record"); + + if (filepos >= info->state->data_file_length) + { + my_errno= HA_ERR_END_OF_FILE; + goto err; + } + + if (info->opt_flag & READ_CACHE_USED) + { + if (_mi_read_cache(&info->rec_cache, (uchar*) block_info.header, + filepos, share->pack.ref_length, + skip_deleted_blocks ? READING_NEXT : 0)) + goto err; + b_type=_mi_pack_get_block_info(info, &info->bit_buff, &block_info, + &info->rec_buff, -1, filepos); + } + else + b_type=_mi_pack_get_block_info(info, &info->bit_buff, &block_info, + &info->rec_buff, info->dfile, filepos); + if (b_type) + goto err; /* Error code is already set */ +#ifndef DBUG_OFF + if (block_info.rec_len > share->max_pack_length) + { + my_errno=HA_ERR_WRONG_IN_RECORD; + goto err; + } +#endif + + if (info->opt_flag & READ_CACHE_USED) + { + if (_mi_read_cache(&info->rec_cache, (uchar*) info->rec_buff, + block_info.filepos, block_info.rec_len, + skip_deleted_blocks ? READING_NEXT : 0)) + goto err; + } + else + { + if (my_read(info->dfile,(uchar*) info->rec_buff + block_info.offset, + block_info.rec_len-block_info.offset, + MYF(MY_NABP))) + goto err; + } + info->packed_length=block_info.rec_len; + info->lastpos=filepos; + info->nextpos=block_info.filepos+block_info.rec_len; + info->update|= HA_STATE_AKTIV | HA_STATE_KEY_CHANGED; + + DBUG_RETURN (_mi_pack_rec_unpack(info, &info->bit_buff, buf, + info->rec_buff, block_info.rec_len)); + err: + DBUG_RETURN(my_errno); +} + + + /* Read and process header from a huff-record-file */ + +uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff, + MI_BLOCK_INFO *info, uchar **rec_buff_p, + File file, my_off_t filepos) +{ + uchar *header=info->header; + uint head_length,ref_length; + LINT_INIT(ref_length); + + if (file >= 0) + { + ref_length=myisam->s->pack.ref_length; + /* + We can't use my_pread() here because mi_read_rnd_pack_record assumes + position is ok + */ + VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0))); + if (my_read(file, header,ref_length,MYF(MY_NABP))) + return BLOCK_FATAL_ERROR; + DBUG_DUMP("header",(uchar*) header,ref_length); + } + head_length= read_pack_length((uint) myisam->s->pack.version, header, + &info->rec_len); + if (myisam->s->base.blobs) + { + head_length+= read_pack_length((uint) myisam->s->pack.version, + header + head_length, &info->blob_len); + /* + Ensure that the record buffer is big enough for the compressed + record plus all expanded blobs. [We do not have an extra buffer + for the resulting blobs. Sigh.] + */ + if (!(mi_alloc_rec_buff(myisam,info->rec_len + info->blob_len, + rec_buff_p))) + return BLOCK_FATAL_ERROR; /* not enough memory */ + bit_buff->blob_pos= (uchar*) *rec_buff_p + info->rec_len; + bit_buff->blob_end= bit_buff->blob_pos + info->blob_len; + myisam->blob_length=info->blob_len; + } + info->filepos=filepos+head_length; + if (file > 0) + { + info->offset=min(info->rec_len, ref_length - head_length); + memcpy(*rec_buff_p, header + head_length, info->offset); + } + return 0; +} + + + /* rutines for bit buffer */ + /* Note buffer must be 6 byte bigger than longest row */ + +static void init_bit_buffer(MI_BIT_BUFF *bit_buff, uchar *buffer, uint length) +{ + bit_buff->pos=buffer; + bit_buff->end=buffer+length; + bit_buff->bits=bit_buff->error=0; + bit_buff->current_byte=0; /* Avoid purify errors */ +} + +static uint fill_and_get_bits(MI_BIT_BUFF *bit_buff, uint count) +{ + uint tmp; + count-=bit_buff->bits; + tmp=(bit_buff->current_byte & mask[bit_buff->bits]) << count; + fill_buffer(bit_buff); + bit_buff->bits=BITS_SAVED - count; + return tmp+(bit_buff->current_byte >> (BITS_SAVED - count)); +} + + /* Fill in empty bit_buff->current_byte from buffer */ + /* Sets bit_buff->error if buffer is exhausted */ + +static void fill_buffer(MI_BIT_BUFF *bit_buff) +{ + if (bit_buff->pos >= bit_buff->end) + { + bit_buff->error= 1; + bit_buff->current_byte=0; + return; + } +#if BITS_SAVED == 64 + bit_buff->current_byte= ((((uint) ((uchar) bit_buff->pos[7]))) + + (((uint) ((uchar) bit_buff->pos[6])) << 8) + + (((uint) ((uchar) bit_buff->pos[5])) << 16) + + (((uint) ((uchar) bit_buff->pos[4])) << 24) + + ((ulonglong) + ((((uint) ((uchar) bit_buff->pos[3]))) + + (((uint) ((uchar) bit_buff->pos[2])) << 8) + + (((uint) ((uchar) bit_buff->pos[1])) << 16) + + (((uint) ((uchar) bit_buff->pos[0])) << 24)) << 32)); + bit_buff->pos+=8; +#else +#if BITS_SAVED == 32 + bit_buff->current_byte= (((uint) ((uchar) bit_buff->pos[3])) + + (((uint) ((uchar) bit_buff->pos[2])) << 8) + + (((uint) ((uchar) bit_buff->pos[1])) << 16) + + (((uint) ((uchar) bit_buff->pos[0])) << 24)); + bit_buff->pos+=4; +#else + bit_buff->current_byte= (uint) (((uint) ((uchar) bit_buff->pos[1]))+ + (((uint) ((uchar) bit_buff->pos[0])) << 8)); + bit_buff->pos+=2; +#endif +#endif +} + + /* Get number of bits neaded to represent value */ + +static uint max_bit(register uint value) +{ + reg2 uint power=1; + + while ((value>>=1)) + power++; + return (power); +} + + +/***************************************************************************** + Some redefined functions to handle files when we are using memmap +*****************************************************************************/ +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#ifdef HAVE_MMAP + +static int _mi_read_mempack_record(MI_INFO *info,my_off_t filepos,uchar *buf); +static int _mi_read_rnd_mempack_record(MI_INFO*, uchar *,my_off_t, my_bool); + +my_bool _mi_memmap_file(MI_INFO *info) +{ + MYISAM_SHARE *share=info->s; + DBUG_ENTER("mi_memmap_file"); + + if (!info->s->file_map) + { + if (my_seek(info->dfile,0L,MY_SEEK_END,MYF(0)) < + share->state.state.data_file_length+MEMMAP_EXTRA_MARGIN) + { + DBUG_PRINT("warning",("File isn't extended for memmap")); + DBUG_RETURN(0); + } + if (mi_dynmap_file(info, share->state.state.data_file_length)) + DBUG_RETURN(0); + } + info->opt_flag|= MEMMAP_USED; + info->read_record= share->read_record= _mi_read_mempack_record; + share->read_rnd= _mi_read_rnd_mempack_record; + DBUG_RETURN(1); +} + + +void _mi_unmap_file(MI_INFO *info) +{ + VOID(my_munmap((char*) info->s->file_map, + (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN)); +} + + +static uchar *_mi_mempack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff, + MI_BLOCK_INFO *info, uchar **rec_buff_p, + uchar *header) +{ + header+= read_pack_length((uint) myisam->s->pack.version, header, + &info->rec_len); + if (myisam->s->base.blobs) + { + header+= read_pack_length((uint) myisam->s->pack.version, header, + &info->blob_len); + /* mi_alloc_rec_buff sets my_errno on error */ + if (!(mi_alloc_rec_buff(myisam, info->blob_len, + rec_buff_p))) + return 0; /* not enough memory */ + bit_buff->blob_pos= (uchar*) *rec_buff_p; + bit_buff->blob_end= (uchar*) *rec_buff_p + info->blob_len; + } + return header; +} + + +static int _mi_read_mempack_record(MI_INFO *info, my_off_t filepos, uchar *buf) +{ + MI_BLOCK_INFO block_info; + MYISAM_SHARE *share=info->s; + uchar *pos; + DBUG_ENTER("mi_read_mempack_record"); + + if (filepos == HA_OFFSET_ERROR) + DBUG_RETURN(-1); /* _search() didn't find record */ + + if (!(pos= (uchar*) _mi_mempack_get_block_info(info, &info->bit_buff, + &block_info, &info->rec_buff, + (uchar*) share->file_map+ + filepos))) + DBUG_RETURN(-1); + DBUG_RETURN(_mi_pack_rec_unpack(info, &info->bit_buff, buf, + pos, block_info.rec_len)); +} + + +/*ARGSUSED*/ +static int _mi_read_rnd_mempack_record(MI_INFO *info, uchar *buf, + register my_off_t filepos, + my_bool skip_deleted_blocks + __attribute__((unused))) +{ + MI_BLOCK_INFO block_info; + MYISAM_SHARE *share=info->s; + uchar *pos,*start; + DBUG_ENTER("_mi_read_rnd_mempack_record"); + + if (filepos >= share->state.state.data_file_length) + { + my_errno=HA_ERR_END_OF_FILE; + goto err; + } + if (!(pos= (uchar*) _mi_mempack_get_block_info(info, &info->bit_buff, + &block_info, &info->rec_buff, + (uchar*) + (start=share->file_map+ + filepos)))) + goto err; +#ifndef DBUG_OFF + if (block_info.rec_len > info->s->max_pack_length) + { + my_errno=HA_ERR_WRONG_IN_RECORD; + goto err; + } +#endif + info->packed_length=block_info.rec_len; + info->lastpos=filepos; + info->nextpos=filepos+(uint) (pos-start)+block_info.rec_len; + info->update|= HA_STATE_AKTIV | HA_STATE_KEY_CHANGED; + + DBUG_RETURN (_mi_pack_rec_unpack(info, &info->bit_buff, buf, + pos, block_info.rec_len)); + err: + DBUG_RETURN(my_errno); +} + +#endif /* HAVE_MMAP */ + + /* Save length of row */ + +uint save_pack_length(uint version, uchar *block_buff, ulong length) +{ + if (length < 254) + { + *(uchar*) block_buff= (uchar) length; + return 1; + } + if (length <= 65535) + { + *(uchar*) block_buff=254; + int2store(block_buff+1,(uint) length); + return 3; + } + *(uchar*) block_buff=255; + if (version == 1) /* old format */ + { + DBUG_ASSERT(length <= 0xFFFFFF); + int3store(block_buff + 1, (ulong) length); + return 4; + } + else + { + int4store(block_buff + 1, (ulong) length); + return 5; + } +} + + +uint read_pack_length(uint version, const uchar *buf, ulong *length) +{ + if (buf[0] < 254) + { + *length= buf[0]; + return 1; + } + else if (buf[0] == 254) + { + *length= uint2korr(buf + 1); + return 3; + } + if (version == 1) /* old format */ + { + *length= uint3korr(buf + 1); + return 4; + } + else + { + *length= uint4korr(buf + 1); + return 5; + } +} + + +uint calc_pack_length(uint version, ulong length) +{ + return (length < 254) ? 1 : (length < 65536) ? 3 : (version == 1) ? 4 : 5; +} Added: trunk/src/mi_page.c =================================================================== --- trunk/src/mi_page.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_page.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,160 @@ +/* Copyright (C) 2000-2004, 2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Read and write key blocks */ + +#include "myisamdef.h" + + /* Fetch a key-page in memory */ + +uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo, + my_off_t page, int level, + uchar *buff, int return_buffer) +{ + uchar *tmp; + uint page_size; + DBUG_ENTER("_mi_fetch_keypage"); + DBUG_PRINT("enter",("page: %ld", (long) page)); + + tmp=(uchar*) key_cache_read(info->s->key_cache, + info->s->kfile, page, level, (uchar*) buff, + (uint) keyinfo->block_length, + (uint) keyinfo->block_length, + return_buffer); + if (tmp == info->buff) + info->buff_used=1; + else if (!tmp) + { + DBUG_PRINT("error",("Got errno: %d from key_cache_read",my_errno)); + info->last_keypage=HA_OFFSET_ERROR; + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(0); + } + info->last_keypage=page; + page_size=mi_getint(tmp); + if (page_size < 4 || page_size > keyinfo->block_length) + { + DBUG_PRINT("error",("page %lu had wrong page length: %u", + (ulong) page, page_size)); + DBUG_DUMP("page", (char*) tmp, keyinfo->block_length); + info->last_keypage = HA_OFFSET_ERROR; + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno = HA_ERR_CRASHED; + tmp = 0; + } + DBUG_RETURN(tmp); +} /* _mi_fetch_keypage */ + + + /* Write a key-page on disk */ + +int _mi_write_keypage(register MI_INFO *info, register MI_KEYDEF *keyinfo, + my_off_t page, int level, uchar *buff) +{ + reg3 uint length; + DBUG_ENTER("_mi_write_keypage"); + +#ifndef FAST /* Safety check */ + if (page < info->s->base.keystart || + page+keyinfo->block_length > info->state->key_file_length || + (page & (MI_MIN_KEY_BLOCK_LENGTH-1))) + { + DBUG_PRINT("error",("Trying to write inside key status region: key_start: %lu length: %lu page: %lu", + (long) info->s->base.keystart, + (long) info->state->key_file_length, + (long) page)); + my_errno=EINVAL; + DBUG_RETURN((-1)); + } + DBUG_PRINT("page",("write page at: %lu",(long) page)); + DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff)); +#endif + + if ((length=keyinfo->block_length) > IO_SIZE*2 && + info->state->key_file_length != page+length) + length= ((mi_getint(buff)+IO_SIZE-1) & (uint) ~(IO_SIZE-1)); +#ifdef HAVE_purify + { + length=mi_getint(buff); + bzero((uchar*) buff+length,keyinfo->block_length-length); + length=keyinfo->block_length; + } +#endif + DBUG_RETURN((key_cache_write(info->s->key_cache, + info->s->kfile,page, level, (uchar*) buff,length, + (uint) keyinfo->block_length, + (int) ((info->lock_type != F_UNLCK) || + info->s->delay_key_write)))); +} /* mi_write_keypage */ + + + /* Remove page from disk */ + +int _mi_dispose(register MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos, + int level) +{ + my_off_t old_link; + uchar buff[8]; + DBUG_ENTER("_mi_dispose"); + DBUG_PRINT("enter",("pos: %ld", (long) pos)); + + old_link= info->s->state.key_del[keyinfo->block_size_index]; + info->s->state.key_del[keyinfo->block_size_index]= pos; + mi_sizestore(buff,old_link); + info->s->state.changed|= STATE_NOT_SORTED_PAGES; + DBUG_RETURN(key_cache_write(info->s->key_cache, + info->s->kfile, pos , level, buff, + sizeof(buff), + (uint) keyinfo->block_length, + (int) (info->lock_type != F_UNLCK))); +} /* _mi_dispose */ + + + /* Make new page on disk */ + +my_off_t _mi_new(register MI_INFO *info, MI_KEYDEF *keyinfo, int level) +{ + my_off_t pos; + uchar buff[8]; + DBUG_ENTER("_mi_new"); + + if ((pos= info->s->state.key_del[keyinfo->block_size_index]) == + HA_OFFSET_ERROR) + { + if (info->state->key_file_length >= + info->s->base.max_key_file_length - keyinfo->block_length) + { + my_errno=HA_ERR_INDEX_FILE_FULL; + DBUG_RETURN(HA_OFFSET_ERROR); + } + pos=info->state->key_file_length; + info->state->key_file_length+= keyinfo->block_length; + } + else + { + if (!key_cache_read(info->s->key_cache, + info->s->kfile, pos, level, + buff, + (uint) sizeof(buff), + (uint) keyinfo->block_length,0)) + pos= HA_OFFSET_ERROR; + else + info->s->state.key_del[keyinfo->block_size_index]= mi_sizekorr(buff); + } + info->s->state.changed|= STATE_NOT_SORTED_PAGES; + DBUG_PRINT("exit",("Pos: %ld",(long) pos)); + DBUG_RETURN(pos); +} /* _mi_new */ Added: trunk/src/mi_panic.c =================================================================== --- trunk/src/mi_panic.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_panic.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,113 @@ +/* Copyright (C) 2000-2001, 2003 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "fulltext.h" + + /* if flag == HA_PANIC_CLOSE then all misam files are closed */ + /* if flag == HA_PANIC_WRITE then all misam files are unlocked and + all changed data in single user misam is written to file */ + /* if flag == HA_PANIC_READ then all misam files that was locked when + mi_panic(HA_PANIC_WRITE) was done is locked. A mi_readinfo() is + done for all single user files to get changes in database */ + + +int mi_panic(enum ha_panic_function flag) +{ + int error=0; + LIST *list_element,*next_open; + MI_INFO *info; + DBUG_ENTER("mi_panic"); + + pthread_mutex_lock(&THR_LOCK_myisam); + for (list_element=myisam_open_list ; list_element ; list_element=next_open) + { + next_open=list_element->next; /* Save if close */ + info=(MI_INFO*) list_element->data; + switch (flag) { + case HA_PANIC_CLOSE: + pthread_mutex_unlock(&THR_LOCK_myisam); /* Not exactly right... */ + if (mi_close(info)) + error=my_errno; + pthread_mutex_lock(&THR_LOCK_myisam); + break; + case HA_PANIC_WRITE: /* Do this to free databases */ +#ifdef CANT_OPEN_FILES_TWICE + if (info->s->options & HA_OPTION_READ_ONLY_DATA) + break; +#endif + if (flush_key_blocks(info->s->key_cache, info->s->kfile, FLUSH_RELEASE)) + error=my_errno; + if (info->opt_flag & WRITE_CACHE_USED) + if (flush_io_cache(&info->rec_cache)) + error=my_errno; + if (info->opt_flag & READ_CACHE_USED) + { + if (flush_io_cache(&info->rec_cache)) + error=my_errno; + reinit_io_cache(&info->rec_cache,READ_CACHE,0, + (pbool) (info->lock_type != F_UNLCK),1); + } + if (info->lock_type != F_UNLCK && ! info->was_locked) + { + info->was_locked=info->lock_type; + if (mi_lock_database(info,F_UNLCK)) + error=my_errno; + } +#ifdef CANT_OPEN_FILES_TWICE + if (info->s->kfile >= 0 && my_close(info->s->kfile,MYF(0))) + error = my_errno; + if (info->dfile >= 0 && my_close(info->dfile,MYF(0))) + error = my_errno; + info->s->kfile=info->dfile= -1; /* Files aren't open anymore */ + break; +#endif + case HA_PANIC_READ: /* Restore to before WRITE */ +#ifdef CANT_OPEN_FILES_TWICE + { /* Open closed files */ + char name_buff[FN_REFLEN]; + if (info->s->kfile < 0) + if ((info->s->kfile= my_open(fn_format(name_buff,info->filename,"", + N_NAME_IEXT,4),info->mode, + MYF(MY_WME))) < 0) + error = my_errno; + if (info->dfile < 0) + { + if ((info->dfile= my_open(fn_format(name_buff,info->filename,"", + N_NAME_DEXT,4),info->mode, + MYF(MY_WME))) < 0) + error = my_errno; + info->rec_cache.file=info->dfile; + } + } +#endif + if (info->was_locked) + { + if (mi_lock_database(info, info->was_locked)) + error=my_errno; + info->was_locked=0; + } + break; + } + } + if (flag == HA_PANIC_CLOSE) + { + VOID(mi_log(0)); /* Close log if neaded */ + ft_free_stopwords(); + } + pthread_mutex_unlock(&THR_LOCK_myisam); + if (!error) + DBUG_RETURN(0); + DBUG_RETURN(my_errno=error); +} /* mi_panic */ Added: trunk/src/mi_preload.c =================================================================== --- trunk/src/mi_preload.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_preload.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,122 @@ +/* Copyright (C) 2003, 2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Preload indexes into key cache +*/ + +#include "myisamdef.h" + + +/* + Preload pages of the index file for a table into the key cache + + SYNOPSIS + mi_preload() + info open table + map map of indexes to preload into key cache + ignore_leaves only non-leaves pages are to be preloaded + + RETURN VALUE + 0 if a success. error code - otherwise. + + NOTES. + At present pages for all indexes are preloaded. + In future only pages for indexes specified in the key_map parameter + of the table will be preloaded. +*/ + +int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) +{ + uint i; + ulong length, block_length= 0; + uchar *buff= NULL; + MYISAM_SHARE* share= info->s; + uint keys= share->state.header.keys; + MI_KEYDEF *keyinfo= share->keyinfo; + my_off_t key_file_length= share->state.state.key_file_length; + my_off_t pos= share->base.keystart; + DBUG_ENTER("mi_preload"); + + if (!keys || !mi_is_any_key_active(key_map) || key_file_length == pos) + DBUG_RETURN(0); + + block_length= keyinfo[0].block_length; + + if (ignore_leaves) + { + /* Check whether all indexes use the same block size */ + for (i= 1 ; i < keys ; i++) + { + if (keyinfo[i].block_length != block_length) + DBUG_RETURN(my_errno= HA_ERR_NON_UNIQUE_BLOCK_SIZE); + } + } + else + block_length= share->key_cache->key_cache_block_size; + + length= info->preload_buff_size/block_length * block_length; + set_if_bigger(length, block_length); + + if (!(buff= (uchar *) my_malloc(length, MYF(MY_WME)))) + DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM); + + if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_RELEASE)) + goto err; + + do + { + /* Read the next block of index file into the preload buffer */ + if ((my_off_t) length > (key_file_length-pos)) + length= (ulong) (key_file_length-pos); + if (my_pread(share->kfile, (uchar*) buff, length, pos, MYF(MY_FAE|MY_FNABP))) + goto err; + + if (ignore_leaves) + { + uchar *end= buff+length; + do + { + if (mi_test_if_nod(buff)) + { + if (key_cache_insert(share->key_cache, + share->kfile, pos, DFLT_INIT_HITS, + (uchar*) buff, block_length)) + goto err; + } + pos+= block_length; + } + while ((buff+= block_length) != end); + buff= end-length; + } + else + { + if (key_cache_insert(share->key_cache, + share->kfile, pos, DFLT_INIT_HITS, + (uchar*) buff, length)) + goto err; + pos+= length; + } + } + while (pos != key_file_length); + + my_free((char*) buff, MYF(0)); + DBUG_RETURN(0); + +err: + my_free((char*) buff, MYF(MY_ALLOW_ZERO_PTR)); + DBUG_RETURN(my_errno= errno); +} + Added: trunk/src/mi_range.c =================================================================== --- trunk/src/mi_range.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_range.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,287 @@ +/* Copyright (C) 2000-2004, 2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Gives a approximated number of how many records there is between two keys. + Used when optimizing querries. + */ + +#include "myisamdef.h" +#include "rt_index.h" + +static ha_rows _mi_record_pos(MI_INFO *, const uchar *, key_part_map, + enum ha_rkey_function); +static double _mi_search_pos(MI_INFO *,MI_KEYDEF *,uchar *, uint,uint,my_off_t); +static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *,uchar *, uchar *,uint *); + +/* + Estimate how many records there is in a given range + + SYNOPSIS + mi_records_in_range() + info MyISAM handler + inx Index to use + min_key Min key. Is = 0 if no min range + max_key Max key. Is = 0 if no max range + + NOTES + We should ONLY return 0 if there is no rows in range + + RETURN + HA_POS_ERROR error (or we can't estimate number of rows) + number Estimated number of rows +*/ + +ha_rows mi_records_in_range(MI_INFO *info, int inx, + key_range *min_key, key_range *max_key) +{ + ha_rows start_pos,end_pos,res; + DBUG_ENTER("mi_records_in_range"); + + if ((inx = _mi_check_index(info,inx)) < 0) + DBUG_RETURN(HA_POS_ERROR); + + if (fast_mi_readinfo(info)) + DBUG_RETURN(HA_POS_ERROR); + info->update&= (HA_STATE_CHANGED+HA_STATE_ROW_CHANGED); + if (info->s->concurrent_insert) + rw_rdlock(&info->s->key_root_lock[inx]); + + switch(info->s->keyinfo[inx].key_alg){ +#ifdef HAVE_RTREE_KEYS + case HA_KEY_ALG_RTREE: + { + uchar * key_buff; + uint start_key_len; + + /* + The problem is that the optimizer doesn't support + RTree keys properly at the moment. + Hope this will be fixed some day. + But now NULL in the min_key means that we + didn't make the task for the RTree key + and expect BTree functionality from it. + As it's not able to handle such request + we return the error. + */ + if (!min_key) + { + res= HA_POS_ERROR; + break; + } + key_buff= info->lastkey+info->s->base.max_key_length; + start_key_len= _mi_pack_key(info,inx, key_buff, + (uchar*) min_key->key, min_key->keypart_map, + (HA_KEYSEG**) 0); + res= rtree_estimate(info, inx, key_buff, start_key_len, + myisam_read_vec[min_key->flag]); + res= res ? res : 1; /* Don't return 0 */ + break; + } +#endif + case HA_KEY_ALG_BTREE: + default: + start_pos= (min_key ? _mi_record_pos(info, min_key->key, + min_key->keypart_map, min_key->flag) + : (ha_rows) 0); + end_pos= (max_key ? _mi_record_pos(info, max_key->key, + max_key->keypart_map, max_key->flag) + : info->state->records + (ha_rows) 1); + res= (end_pos < start_pos ? (ha_rows) 0 : + (end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos)); + if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR) + res=HA_POS_ERROR; + } + + if (info->s->concurrent_insert) + rw_unlock(&info->s->key_root_lock[inx]); + fast_mi_writeinfo(info); + + DBUG_PRINT("info",("records: %ld",(ulong) (res))); + DBUG_RETURN(res); +} + + + /* Find relative position (in records) for key in index-tree */ + +static ha_rows _mi_record_pos(MI_INFO *info, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function search_flag) +{ + uint inx=(uint) info->lastinx, nextflag, key_len; + MI_KEYDEF *keyinfo=info->s->keyinfo+inx; + uchar *key_buff; + double pos; + + DBUG_ENTER("_mi_record_pos"); + DBUG_PRINT("enter",("search_flag: %d",search_flag)); + DBUG_ASSERT(keypart_map); + + key_buff=info->lastkey+info->s->base.max_key_length; + key_len=_mi_pack_key(info,inx,key_buff,(uchar*) key, keypart_map, + (HA_KEYSEG**) 0); + DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg, + (uchar*) key_buff,key_len);); + nextflag=myisam_read_vec[search_flag]; + if (!(nextflag & (SEARCH_FIND | SEARCH_NO_FIND | SEARCH_LAST))) + key_len=USE_WHOLE_KEY; + + /* + my_handler.c:mi_compare_text() has a flag 'skip_end_space'. + This is set in my_handler.c:ha_key_cmp() in dependence on the + compare flags 'nextflag' and the column type. + + TEXT columns are of type HA_KEYTYPE_VARTEXT. In this case the + condition is skip_end_space= ((nextflag & (SEARCH_FIND | + SEARCH_UPDATE)) == SEARCH_FIND). + + SEARCH_FIND is used for an exact key search. The combination + SEARCH_FIND | SEARCH_UPDATE is used in write/update/delete + operations with a comment like "Not real duplicates", whatever this + means. From the condition above we can see that 'skip_end_space' is + always false for these operations. The result is that trailing space + counts in key comparison and hence, emtpy strings ('', string length + zero, but not NULL) compare less that strings starting with control + characters and these in turn compare less than strings starting with + blanks. + + When estimating the number of records in a key range, we request an + exact search for the minimum key. This translates into a plain + SEARCH_FIND flag. Using this alone would lead to a 'skip_end_space' + compare. Empty strings would be expected above control characters. + Their keys would not be found because they are located below control + characters. + + This is the reason that we add the SEARCH_UPDATE flag here. It makes + the key estimation compare in the same way like key write operations + do. Olny so we will find the keys where they have been inserted. + + Adding the flag unconditionally does not hurt as it is used in the + above mentioned condition only. So it can safely be used together + with other flags. + */ + pos=_mi_search_pos(info,keyinfo,key_buff,key_len, + nextflag | SEARCH_SAVE_BUFF | SEARCH_UPDATE, + info->s->state.key_root[inx]); + if (pos >= 0.0) + { + DBUG_PRINT("exit",("pos: %ld",(ulong) (pos*info->state->records))); + DBUG_RETURN((ulong) (pos*info->state->records+0.5)); + } + DBUG_RETURN(HA_POS_ERROR); +} + + + /* This is a modified version of _mi_search */ + /* Returns offset for key in indextable (decimal 0.0 <= x <= 1.0) */ + +static double _mi_search_pos(register MI_INFO *info, + register MI_KEYDEF *keyinfo, + uchar *key, uint key_len, uint nextflag, + register my_off_t pos) +{ + int flag; + uint nod_flag,keynr,max_keynr; + my_bool after_key; + uchar *keypos,*buff; + double offset; + DBUG_ENTER("_mi_search_pos"); + LINT_INIT(max_keynr); + + if (pos == HA_OFFSET_ERROR) + DBUG_RETURN(0.5); + + if (!(buff=_mi_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,info->buff,1))) + goto err; + flag=(*keyinfo->bin_search)(info,keyinfo,buff,key,key_len,nextflag, + &keypos,info->lastkey, &after_key); + nod_flag=mi_test_if_nod(buff); + keynr=_mi_keynr(info,keyinfo,buff,keypos,&max_keynr); + + if (flag) + { + if (flag == MI_FOUND_WRONG_KEY) + DBUG_RETURN(-1); /* error */ + /* + Didn't found match. keypos points at next (bigger) key + Try to find a smaller, better matching key. + Matches keynr + [0-1] + */ + if (flag > 0 && ! nod_flag) + offset= 1.0; + else if ((offset=_mi_search_pos(info,keyinfo,key,key_len,nextflag, + _mi_kpos(nod_flag,keypos))) < 0) + DBUG_RETURN(offset); + } + else + { + /* + Found match. Keypos points at the start of the found key + Matches keynr+1 + */ + offset=1.0; /* Matches keynr+1 */ + if ((nextflag & SEARCH_FIND) && nod_flag && + ((keyinfo->flag & (HA_NOSAME | HA_NULL_PART)) != HA_NOSAME || + key_len != USE_WHOLE_KEY)) + { + /* + There may be identical keys in the tree. Try to match on of those. + Matches keynr + [0-1] + */ + if ((offset=_mi_search_pos(info,keyinfo,key,key_len,SEARCH_FIND, + _mi_kpos(nod_flag,keypos))) < 0) + DBUG_RETURN(offset); /* Read error */ + } + } + DBUG_PRINT("info",("keynr: %d offset: %g max_keynr: %d nod: %d flag: %d", + keynr,offset,max_keynr,nod_flag,flag)); + DBUG_RETURN((keynr+offset)/(max_keynr+1)); +err: + DBUG_PRINT("exit",("Error: %d",my_errno)); + DBUG_RETURN (-1.0); +} + + + /* Get keynummer of current key and max number of keys in nod */ + +static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, + uchar *keypos, uint *ret_max_key) +{ + uint nod_flag,keynr,max_key; + uchar t_buff[MI_MAX_KEY_BUFF],*end; + + end= page+mi_getint(page); + nod_flag=mi_test_if_nod(page); + page+=2+nod_flag; + + if (!(keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) + { + *ret_max_key= (uint) (end-page)/(keyinfo->keylength+nod_flag); + return (uint) (keypos-page)/(keyinfo->keylength+nod_flag); + } + + max_key=keynr=0; + t_buff[0]=0; /* Safety */ + while (page < end) + { + if (!(*keyinfo->get_key)(keyinfo,nod_flag,&page,t_buff)) + return 0; /* Error */ + max_key++; + if (page == keypos) + keynr=max_key; + } + *ret_max_key=max_key; + return(keynr); +} Added: trunk/src/mi_rename.c =================================================================== --- trunk/src/mi_rename.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rename.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,60 @@ +/* Copyright (C) 2000-2001, 2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Rename a table +*/ + +#include "fulltext.h" + +int mi_rename(const char *old_name, const char *new_name) +{ + char from[FN_REFLEN],to[FN_REFLEN]; +#ifdef USE_RAID + uint raid_type=0,raid_chunks=0; +#endif + DBUG_ENTER("mi_rename"); + +#ifdef EXTRA_DEBUG + check_table_is_closed(old_name,"rename old_table"); + check_table_is_closed(new_name,"rename new table2"); +#endif +#ifdef USE_RAID + { + MI_INFO *info; + if (!(info=mi_open(old_name, O_RDONLY, 0))) + DBUG_RETURN(my_errno); + raid_type = info->s->base.raid_type; + raid_chunks = info->s->base.raid_chunks; + mi_close(info); + } +#ifdef EXTRA_DEBUG + check_table_is_closed(old_name,"rename raidcheck"); +#endif +#endif /* USE_RAID */ + + fn_format(from,old_name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); + fn_format(to,new_name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); + if (my_rename_with_symlink(from, to, MYF(MY_WME))) + DBUG_RETURN(my_errno); + fn_format(from,old_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); + fn_format(to,new_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); +#ifdef USE_RAID + if (raid_type) + DBUG_RETURN(my_raid_rename(from, to, raid_chunks, MYF(MY_WME)) ? my_errno : + 0); +#endif + DBUG_RETURN(my_rename_with_symlink(from, to,MYF(MY_WME)) ? my_errno : 0); +} Added: trunk/src/mi_rfirst.c =================================================================== --- trunk/src/mi_rfirst.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rfirst.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,26 @@ +/* Copyright (C) 2000-2001 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + + /* Read first row through a specfic key */ + +int mi_rfirst(MI_INFO *info, uchar *buf, int inx) +{ + DBUG_ENTER("mi_rfirst"); + info->lastpos= HA_OFFSET_ERROR; + info->update|= HA_STATE_PREV_FOUND; + DBUG_RETURN(mi_rnext(info,buf,inx)); +} /* mi_rfirst */ Added: trunk/src/mi_rkey.c =================================================================== --- trunk/src/mi_rkey.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rkey.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,191 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Read record based on a key */ + +#include "myisamdef.h" +#include "rt_index.h" + + /* Read a record using key */ + /* Ordinary search_flag is 0 ; Give error if no record with key */ + +int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, + key_part_map keypart_map, enum ha_rkey_function search_flag) +{ + uchar *key_buff; + MYISAM_SHARE *share=info->s; + MI_KEYDEF *keyinfo; + HA_KEYSEG *last_used_keyseg; + uint pack_key_length, use_key_length, nextflag; + DBUG_ENTER("mi_rkey"); + DBUG_PRINT("enter", ("base: 0x%lx buf: 0x%lx inx: %d search_flag: %d", + (long) info, (long) buf, inx, search_flag)); + + if ((inx = _mi_check_index(info,inx)) < 0) + DBUG_RETURN(my_errno); + + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + info->last_key_func= search_flag; + keyinfo= share->keyinfo + inx; + + if (info->once_flags & USE_PACKED_KEYS) + { + info->once_flags&= ~USE_PACKED_KEYS; /* Reset flag */ + /* + key is already packed!; This happens when we are using a MERGE TABLE + In this key 'key_part_map' is the length of the key ! + */ + key_buff=info->lastkey+info->s->base.max_key_length; + pack_key_length= keypart_map; + bmove(key_buff, key, pack_key_length); + last_used_keyseg= info->s->keyinfo[inx].seg + info->last_used_keyseg; + } + else + { + DBUG_ASSERT(keypart_map); + /* Save the packed key for later use in the second buffer of lastkey. */ + key_buff=info->lastkey+info->s->base.max_key_length; + pack_key_length=_mi_pack_key(info,(uint) inx, key_buff, (uchar*) key, + keypart_map, &last_used_keyseg); + /* Save packed_key_length for use by the MERGE engine. */ + info->pack_key_length= pack_key_length; + info->last_used_keyseg= (uint16) (last_used_keyseg - + info->s->keyinfo[inx].seg); + DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg, + key_buff, pack_key_length);); + } + + if (fast_mi_readinfo(info)) + goto err; + + if (share->concurrent_insert) + rw_rdlock(&share->key_root_lock[inx]); + + nextflag=myisam_read_vec[search_flag]; + use_key_length=pack_key_length; + if (!(nextflag & (SEARCH_FIND | SEARCH_NO_FIND | SEARCH_LAST))) + use_key_length=USE_WHOLE_KEY; + + switch (info->s->keyinfo[inx].key_alg) { +#ifdef HAVE_RTREE_KEYS + case HA_KEY_ALG_RTREE: + if (rtree_find_first(info,inx,key_buff,use_key_length,nextflag) < 0) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + goto err; + } + break; +#endif + case HA_KEY_ALG_BTREE: + default: + if (!_mi_search(info, keyinfo, key_buff, use_key_length, + myisam_read_vec[search_flag], info->s->state.key_root[inx])) + { + /* + Found a key, but it might not be usable. We cannot use rows that + are inserted by other threads after we got our table lock + ("concurrent inserts"). The record may not even be present yet. + Keys are inserted into the index(es) before the record is + inserted into the data file. When we got our table lock, we + saved the current data_file_length. Concurrent inserts always go + to the end of the file. So we can test if the found key + references a new record. + */ + if (info->lastpos >= info->state->data_file_length) + { + /* The key references a concurrently inserted record. */ + if (search_flag == HA_READ_KEY_EXACT && + last_used_keyseg == keyinfo->seg + keyinfo->keysegs) + { + /* Simply ignore the key if it matches exactly. (Bug #29838) */ + my_errno= HA_ERR_KEY_NOT_FOUND; + info->lastpos= HA_OFFSET_ERROR; + } + else + { + /* + If searching for a partial key (or using >, >=, < or <=) and + the data is outside of the data file, we need to continue + searching for the first key inside the data file. + */ + do + { + uint not_used[2]; + /* + Skip rows that are inserted by other threads since we got + a lock. Note that this can only happen if we are not + searching after a full length exact key, because the keys + are sorted according to position. + */ + if (_mi_search_next(info, keyinfo, info->lastkey, + info->lastkey_length, + myisam_readnext_vec[search_flag], + info->s->state.key_root[inx])) + break; /* purecov: inspected */ + /* + Check that the found key does still match the search. + _mi_search_next() delivers the next key regardless of its + value. + */ + if (search_flag == HA_READ_KEY_EXACT && + ha_key_cmp(keyinfo->seg, key_buff, info->lastkey, + use_key_length, SEARCH_FIND, not_used)) + { + /* purecov: begin inspected */ + my_errno= HA_ERR_KEY_NOT_FOUND; + info->lastpos= HA_OFFSET_ERROR; + break; + /* purecov: end */ + } + } while (info->lastpos >= info->state->data_file_length); + } + } + } + } + if (share->concurrent_insert) + rw_unlock(&share->key_root_lock[inx]); + + /* Calculate length of the found key; Used by mi_rnext_same */ + if ((keyinfo->flag & HA_VAR_LENGTH_KEY) && last_used_keyseg && + info->lastpos != HA_OFFSET_ERROR) + info->last_rkey_length= _mi_keylength_part(keyinfo, info->lastkey, + last_used_keyseg); + else + info->last_rkey_length= pack_key_length; + + /* Check if we don't want to have record back, only error message */ + if (!buf) + DBUG_RETURN(info->lastpos == HA_OFFSET_ERROR ? my_errno : 0); + + if (!(*info->read_record)(info,info->lastpos,buf)) + { + info->update|= HA_STATE_AKTIV; /* Record is read */ + DBUG_RETURN(0); + } + + info->lastpos = HA_OFFSET_ERROR; /* Didn't find key */ + + /* Store last used key as a base for read next */ + memcpy(info->lastkey,key_buff,pack_key_length); + info->last_rkey_length= pack_key_length; + bzero((char*) info->lastkey+pack_key_length,info->s->base.rec_reflength); + info->lastkey_length=pack_key_length+info->s->base.rec_reflength; + + if (search_flag == HA_READ_AFTER_KEY) + info->update|=HA_STATE_NEXT_FOUND; /* Previous gives last row */ +err: + DBUG_RETURN(my_errno); +} /* _mi_rkey */ Added: trunk/src/mi_rlast.c =================================================================== --- trunk/src/mi_rlast.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rlast.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,26 @@ +/* Copyright (C) 2000-2001 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + + /* Read last row with the same key as the previous read. */ + +int mi_rlast(MI_INFO *info, uchar *buf, int inx) +{ + DBUG_ENTER("mi_rlast"); + info->lastpos= HA_OFFSET_ERROR; + info->update|= HA_STATE_NEXT_FOUND; + DBUG_RETURN(mi_rprev(info,buf,inx)); +} /* mi_rlast */ Added: trunk/src/mi_rnext.c =================================================================== --- trunk/src/mi_rnext.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rnext.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,121 @@ +/* Copyright (C) 2000-2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + +#include "rt_index.h" + + /* + Read next row with the same key as previous read + One may have done a write, update or delete of the previous row. + NOTE! Even if one changes the previous row, the next read is done + based on the position of the last used key! + */ + +int mi_rnext(MI_INFO *info, uchar *buf, int inx) +{ + int error,changed; + uint flag; + DBUG_ENTER("mi_rnext"); + + if ((inx = _mi_check_index(info,inx)) < 0) + DBUG_RETURN(my_errno); + flag=SEARCH_BIGGER; /* Read next */ + if (info->lastpos == HA_OFFSET_ERROR && info->update & HA_STATE_PREV_FOUND) + flag=0; /* Read first */ + + if (fast_mi_readinfo(info)) + DBUG_RETURN(my_errno); + if (info->s->concurrent_insert) + rw_rdlock(&info->s->key_root_lock[inx]); + changed=_mi_test_if_changed(info); + if (!flag) + { + switch(info->s->keyinfo[inx].key_alg){ +#ifdef HAVE_RTREE_KEYS + case HA_KEY_ALG_RTREE: + error=rtree_get_first(info,inx,info->lastkey_length); + break; +#endif + case HA_KEY_ALG_BTREE: + default: + error=_mi_search_first(info,info->s->keyinfo+inx, + info->s->state.key_root[inx]); + break; + } + } + else + { + switch (info->s->keyinfo[inx].key_alg) { +#ifdef HAVE_RTREE_KEYS + case HA_KEY_ALG_RTREE: + /* + Note that rtree doesn't support that the table + may be changed since last call, so we do need + to skip rows inserted by other threads like in btree + */ + error= rtree_get_next(info,inx,info->lastkey_length); + break; +#endif + case HA_KEY_ALG_BTREE: + default: + if (!changed) + error= _mi_search_next(info,info->s->keyinfo+inx,info->lastkey, + info->lastkey_length,flag, + info->s->state.key_root[inx]); + else + error= _mi_search(info,info->s->keyinfo+inx,info->lastkey, + USE_WHOLE_KEY,flag, info->s->state.key_root[inx]); + } + } + + if (info->s->concurrent_insert) + { + if (!error) + { + while (info->lastpos >= info->state->data_file_length) + { + /* Skip rows inserted by other threads since we got a lock */ + if ((error=_mi_search_next(info,info->s->keyinfo+inx, + info->lastkey, + info->lastkey_length, + SEARCH_BIGGER, + info->s->state.key_root[inx]))) + break; + } + } + rw_unlock(&info->s->key_root_lock[inx]); + } + /* Don't clear if database-changed */ + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + info->update|= HA_STATE_NEXT_FOUND; + + if (error) + { + if (my_errno == HA_ERR_KEY_NOT_FOUND) + my_errno=HA_ERR_END_OF_FILE; + } + else if (!buf) + { + DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0); + } + else if (!(*info->read_record)(info,info->lastpos,buf)) + { + info->update|= HA_STATE_AKTIV; /* Record is read */ + DBUG_RETURN(0); + } + DBUG_PRINT("error",("Got error: %d, errno: %d",error, my_errno)); + DBUG_RETURN(my_errno); +} /* mi_rnext */ Added: trunk/src/mi_rnext_same.c =================================================================== --- trunk/src/mi_rnext_same.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rnext_same.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,104 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" +#include "rt_index.h" + + /* + Read next row with the same key as previous read, but abort if + the key changes. + One may have done a write, update or delete of the previous row. + NOTE! Even if one changes the previous row, the next read is done + based on the position of the last used key! + */ + +int mi_rnext_same(MI_INFO *info, uchar *buf) +{ + int error; + uint inx,not_used[2]; + MI_KEYDEF *keyinfo; + DBUG_ENTER("mi_rnext_same"); + + if ((int) (inx=info->lastinx) < 0 || info->lastpos == HA_OFFSET_ERROR) + DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX); + keyinfo=info->s->keyinfo+inx; + if (fast_mi_readinfo(info)) + DBUG_RETURN(my_errno); + + if (info->s->concurrent_insert) + rw_rdlock(&info->s->key_root_lock[inx]); + + switch (keyinfo->key_alg) + { +#ifdef HAVE_RTREE_KEYS + case HA_KEY_ALG_RTREE: + if ((error=rtree_find_next(info,inx, + myisam_read_vec[info->last_key_func]))) + { + error=1; + my_errno=HA_ERR_END_OF_FILE; + info->lastpos= HA_OFFSET_ERROR; + break; + } + break; +#endif + case HA_KEY_ALG_BTREE: + default: + if (!(info->update & HA_STATE_RNEXT_SAME)) + { + /* First rnext_same; Store old key */ + memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); + } + for (;;) + { + if ((error=_mi_search_next(info,keyinfo,info->lastkey, + info->lastkey_length,SEARCH_BIGGER, + info->s->state.key_root[inx]))) + break; + if (ha_key_cmp(keyinfo->seg, info->lastkey, info->lastkey2, + info->last_rkey_length, SEARCH_FIND, not_used)) + { + error=1; + my_errno=HA_ERR_END_OF_FILE; + info->lastpos= HA_OFFSET_ERROR; + break; + } + /* Skip rows that are inserted by other threads since we got a lock */ + if (info->lastpos < info->state->data_file_length) + break; + } + } + if (info->s->concurrent_insert) + rw_unlock(&info->s->key_root_lock[inx]); + /* Don't clear if database-changed */ + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME; + + if (error) + { + if (my_errno == HA_ERR_KEY_NOT_FOUND) + my_errno=HA_ERR_END_OF_FILE; + } + else if (!buf) + { + DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0); + } + else if (!(*info->read_record)(info,info->lastpos,buf)) + { + info->update|= HA_STATE_AKTIV; /* Record is read */ + DBUG_RETURN(0); + } + DBUG_RETURN(my_errno); +} /* mi_rnext_same */ Added: trunk/src/mi_rprev.c =================================================================== --- trunk/src/mi_rprev.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rprev.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,87 @@ +/* Copyright (C) 2000-2001, 2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + + /* + Read previous row with the same key as previous read + One may have done a write, update or delete of the previous row. + NOTE! Even if one changes the previous row, the next read is done + based on the position of the last used key! + */ + +int mi_rprev(MI_INFO *info, uchar *buf, int inx) +{ + int error,changed; + register uint flag; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("mi_rprev"); + + if ((inx = _mi_check_index(info,inx)) < 0) + DBUG_RETURN(my_errno); + flag=SEARCH_SMALLER; /* Read previous */ + if (info->lastpos == HA_OFFSET_ERROR && info->update & HA_STATE_NEXT_FOUND) + flag=0; /* Read last */ + + if (fast_mi_readinfo(info)) + DBUG_RETURN(my_errno); + changed=_mi_test_if_changed(info); + if (share->concurrent_insert) + rw_rdlock(&share->key_root_lock[inx]); + if (!flag) + error=_mi_search_last(info, share->keyinfo+inx, + share->state.key_root[inx]); + else if (!changed) + error=_mi_search_next(info,share->keyinfo+inx,info->lastkey, + info->lastkey_length,flag, + share->state.key_root[inx]); + else + error=_mi_search(info,share->keyinfo+inx,info->lastkey, + USE_WHOLE_KEY, flag, share->state.key_root[inx]); + + if (share->concurrent_insert) + { + if (!error) + { + while (info->lastpos >= info->state->data_file_length) + { + /* Skip rows that are inserted by other threads since we got a lock */ + if ((error=_mi_search_next(info,share->keyinfo+inx,info->lastkey, + info->lastkey_length, + SEARCH_SMALLER, + share->state.key_root[inx]))) + break; + } + } + rw_unlock(&share->key_root_lock[inx]); + } + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + info->update|= HA_STATE_PREV_FOUND; + if (error) + { + if (my_errno == HA_ERR_KEY_NOT_FOUND) + my_errno=HA_ERR_END_OF_FILE; + } + else if (!buf) + { + DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0); + } + else if (!(*info->read_record)(info,info->lastpos,buf)) + { + info->update|= HA_STATE_AKTIV; /* Record is read */ + DBUG_RETURN(0); + } + DBUG_RETURN(my_errno); +} /* mi_rprev */ Added: trunk/src/mi_rrnd.c =================================================================== --- trunk/src/mi_rrnd.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rrnd.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,59 @@ +/* Copyright (C) 2000-2002, 2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Read a record with random-access. The position to the record must + get by MI_INFO. The next record can be read with pos= MI_POS_ERROR */ + + +#include "myisamdef.h" + +/* + Read a row based on position. + If filepos= HA_OFFSET_ERROR then read next row + Return values + Returns one of following values: + 0 = Ok. + HA_ERR_RECORD_DELETED = Record is deleted. + HA_ERR_END_OF_FILE = EOF. +*/ + +int mi_rrnd(MI_INFO *info, uchar *buf, register my_off_t filepos) +{ + my_bool skip_deleted_blocks; + DBUG_ENTER("mi_rrnd"); + + skip_deleted_blocks=0; + + if (filepos == HA_OFFSET_ERROR) + { + skip_deleted_blocks=1; + if (info->lastpos == HA_OFFSET_ERROR) /* First read ? */ + filepos= info->s->pack.header_length; /* Read first record */ + else + filepos= info->nextpos; + } + + if (info->once_flags & RRND_PRESERVE_LASTINX) + info->once_flags&= ~RRND_PRESERVE_LASTINX; + else + info->lastinx= -1; /* Can't forward or backward */ + /* Init all but update-flag */ + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + + if (info->opt_flag & WRITE_CACHE_USED && flush_io_cache(&info->rec_cache)) + DBUG_RETURN(my_errno); + + DBUG_RETURN ((*info->s->read_rnd)(info,buf,filepos,skip_deleted_blocks)); +} Added: trunk/src/mi_rsame.c =================================================================== --- trunk/src/mi_rsame.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rsame.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,65 @@ +/* Copyright (C) 2000-2001, 2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + + /* + ** Find current row with read on position or read on key + ** If inx >= 0 find record using key + ** Return values: + ** 0 = Ok. + ** HA_ERR_KEY_NOT_FOUND = Row is deleted + ** HA_ERR_END_OF_FILE = End of file + */ + + +int mi_rsame(MI_INFO *info, uchar *record, int inx) +{ + DBUG_ENTER("mi_rsame"); + + if (inx != -1 && ! mi_is_key_active(info->s->state.key_map, inx)) + { + DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX); + } + if (info->lastpos == HA_OFFSET_ERROR || info->update & HA_STATE_DELETED) + { + DBUG_RETURN(my_errno=HA_ERR_KEY_NOT_FOUND); /* No current record */ + } + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + + /* Read row from data file */ + if (fast_mi_readinfo(info)) + DBUG_RETURN(my_errno); + + if (inx >= 0) + { + info->lastinx=inx; + info->lastkey_length=_mi_make_key(info,(uint) inx,info->lastkey,record, + info->lastpos); + if (info->s->concurrent_insert) + rw_rdlock(&info->s->key_root_lock[inx]); + VOID(_mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY, + SEARCH_SAME, + info->s->state.key_root[inx])); + if (info->s->concurrent_insert) + rw_unlock(&info->s->key_root_lock[inx]); + } + + if (!(*info->read_record)(info,info->lastpos,record)) + DBUG_RETURN(0); + if (my_errno == HA_ERR_RECORD_DELETED) + my_errno=HA_ERR_KEY_NOT_FOUND; + DBUG_RETURN(my_errno); +} /* mi_rsame */ Added: trunk/src/mi_rsamepos.c =================================================================== --- trunk/src/mi_rsamepos.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_rsamepos.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,57 @@ +/* Copyright (C) 2000-2001, 2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* read record through position and fix key-position */ +/* As mi_rsame but supply a position */ + +#include "myisamdef.h" + + + /* + ** If inx >= 0 update index pointer + ** Returns one of the following values: + ** 0 = Ok. + ** HA_ERR_KEY_NOT_FOUND = Row is deleted + ** HA_ERR_END_OF_FILE = End of file + */ + +int mi_rsame_with_pos(MI_INFO *info, uchar *record, int inx, my_off_t filepos) +{ + DBUG_ENTER("mi_rsame_with_pos"); + DBUG_PRINT("enter",("index: %d filepos: %ld", inx, (long) filepos)); + + if (inx < -1 || + (inx >= 0 && ! mi_is_key_active(info->s->state.key_map, inx))) + { + DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX); + } + + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + if ((*info->s->read_rnd)(info,record,filepos,0)) + { + if (my_errno == HA_ERR_RECORD_DELETED) + my_errno=HA_ERR_KEY_NOT_FOUND; + DBUG_RETURN(my_errno); + } + info->lastpos=filepos; + info->lastinx=inx; + if (inx >= 0) + { + info->lastkey_length=_mi_make_key(info,(uint) inx,info->lastkey,record, + info->lastpos); + info->update|=HA_STATE_KEY_CHANGED; /* Don't use indexposition */ + } + DBUG_RETURN(0); +} /* mi_rsame_pos */ Added: trunk/src/mi_scan.c =================================================================== --- trunk/src/mi_scan.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_scan.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,45 @@ +/* Copyright (C) 2000-2001 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Read through all rows sequntially */ + +#include "myisamdef.h" + +int mi_scan_init(register MI_INFO *info) +{ + DBUG_ENTER("mi_scan_init"); + info->nextpos=info->s->pack.header_length; /* Read first record */ + info->lastinx= -1; /* Can't forward or backward */ + if (info->opt_flag & WRITE_CACHE_USED && flush_io_cache(&info->rec_cache)) + DBUG_RETURN(my_errno); + DBUG_RETURN(0); +} + +/* + Read a row based on position. + If filepos= HA_OFFSET_ERROR then read next row + Return values + Returns one of following values: + 0 = Ok. + HA_ERR_END_OF_FILE = EOF. +*/ + +int mi_scan(MI_INFO *info, uchar *buf) +{ + DBUG_ENTER("mi_scan"); + /* Init all but update-flag */ + info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + DBUG_RETURN ((*info->s->read_rnd)(info,buf,info->nextpos,1)); +} Added: trunk/src/mi_search.c =================================================================== --- trunk/src/mi_search.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_search.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1921 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* key handling functions */ + +#include "fulltext.h" +#include "m_ctype.h" + +static my_bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uchar *keypos, + uint *return_key_length); + + /* Check index */ + +int _mi_check_index(MI_INFO *info, int inx) +{ + if (inx == -1) /* Use last index */ + inx=info->lastinx; + if (inx < 0 || ! mi_is_key_active(info->s->state.key_map, inx)) + { + my_errno=HA_ERR_WRONG_INDEX; + return -1; + } + if (info->lastinx != inx) /* Index changed */ + { + info->lastinx = inx; + info->page_changed=1; + info->update= ((info->update & (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED)) | + HA_STATE_NEXT_FOUND | HA_STATE_PREV_FOUND); + } + if (info->opt_flag & WRITE_CACHE_USED && flush_io_cache(&info->rec_cache)) + return(-1); + return(inx); +} /* mi_check_index */ + + + /* + ** Search after row by a key + ** Position to row is stored in info->lastpos + ** Return: -1 if not found + ** 1 if one should continue search on higher level + */ + +int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, + uchar *key, uint key_len, uint nextflag, register my_off_t pos) +{ + my_bool last_key; + int error,flag; + uint nod_flag; + uchar *keypos,*maxpos; + uchar lastkey[MI_MAX_KEY_BUFF],*buff; + DBUG_ENTER("_mi_search"); + DBUG_PRINT("enter",("pos: %lu nextflag: %u lastpos: %lu", + (ulong) pos, nextflag, (ulong) info->lastpos)); + DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,key_len);); + + if (pos == HA_OFFSET_ERROR) + { + my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */ + info->lastpos= HA_OFFSET_ERROR; + if (!(nextflag & (SEARCH_SMALLER | SEARCH_BIGGER | SEARCH_LAST))) + DBUG_RETURN(-1); /* Not found ; return error */ + DBUG_RETURN(1); /* Search at upper levels */ + } + + if (!(buff=_mi_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,info->buff, + test(!(nextflag & SEARCH_SAVE_BUFF))))) + goto err; + DBUG_DUMP("page",(uchar*) buff,mi_getint(buff)); + + flag=(*keyinfo->bin_search)(info,keyinfo,buff,key,key_len,nextflag, + &keypos,lastkey, &last_key); + if (flag == MI_FOUND_WRONG_KEY) + DBUG_RETURN(-1); + nod_flag=mi_test_if_nod(buff); + maxpos=buff+mi_getint(buff)-1; + + if (flag) + { + if ((error=_mi_search(info,keyinfo,key,key_len,nextflag, + _mi_kpos(nod_flag,keypos))) <= 0) + DBUG_RETURN(error); + + if (flag >0) + { + if (nextflag & (SEARCH_SMALLER | SEARCH_LAST) && + keypos == buff+2+nod_flag) + DBUG_RETURN(1); /* Bigger than key */ + } + else if (nextflag & SEARCH_BIGGER && keypos >= maxpos) + DBUG_RETURN(1); /* Smaller than key */ + } + else + { + if ((nextflag & SEARCH_FIND) && nod_flag && + ((keyinfo->flag & (HA_NOSAME | HA_NULL_PART)) != HA_NOSAME || + key_len != USE_WHOLE_KEY)) + { + if ((error=_mi_search(info,keyinfo,key,key_len,SEARCH_FIND, + _mi_kpos(nod_flag,keypos))) >= 0 || + my_errno != HA_ERR_KEY_NOT_FOUND) + DBUG_RETURN(error); + info->last_keypage= HA_OFFSET_ERROR; /* Buffer not in mem */ + } + } + if (pos != info->last_keypage) + { + uchar *old_buff=buff; + if (!(buff=_mi_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,info->buff, + test(!(nextflag & SEARCH_SAVE_BUFF))))) + goto err; + keypos=buff+(keypos-old_buff); + maxpos=buff+(maxpos-old_buff); + } + + if ((nextflag & (SEARCH_SMALLER | SEARCH_LAST)) && flag != 0) + { + uint not_used[2]; + if (_mi_get_prev_key(info,keyinfo, buff, info->lastkey, keypos, + &info->lastkey_length)) + goto err; + if (!(nextflag & SEARCH_SMALLER) && + ha_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND, + not_used)) + { + my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */ + goto err; + } + } + else + { + info->lastkey_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,lastkey); + if (!info->lastkey_length) + goto err; + memcpy(info->lastkey,lastkey,info->lastkey_length); + } + info->lastpos=_mi_dpos(info,0,info->lastkey+info->lastkey_length); + /* Save position for a possible read next / previous */ + info->int_keypos=info->buff+ (keypos-buff); + info->int_maxpos=info->buff+ (maxpos-buff); + info->int_nod_flag=nod_flag; + info->int_keytree_version=keyinfo->version; + info->last_search_keypage=info->last_keypage; + info->page_changed=0; + info->buff_used= (info->buff != buff); /* If we have to reread buff */ + + DBUG_PRINT("exit",("found key at %lu",(ulong) info->lastpos)); + DBUG_RETURN(0); + +err: + DBUG_PRINT("exit",("Error: %d",my_errno)); + info->lastpos= HA_OFFSET_ERROR; + info->page_changed=1; + DBUG_RETURN (-1); +} /* _mi_search */ + + + /* Search after key in page-block */ + /* If packed key puts smaller or identical key in buff */ + /* ret_pos point to where find or bigger key starts */ + /* ARGSUSED */ + +int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uint key_len, uint comp_flag, uchar **ret_pos, + uchar *buff __attribute__((unused)), my_bool *last_key) +{ + reg4 int start,mid,end,save_end; + int flag; + uint totlength,nod_flag,not_used[2]; + DBUG_ENTER("_mi_bin_search"); + + LINT_INIT(flag); + totlength=keyinfo->keylength+(nod_flag=mi_test_if_nod(page)); + start=0; mid=1; + save_end=end=(int) ((mi_getint(page)-2-nod_flag)/totlength-1); + DBUG_PRINT("test",("mi_getint: %d end: %d",mi_getint(page),end)); + page+=2+nod_flag; + + while (start != end) + { + mid= (start+end)/2; + if ((flag=ha_key_cmp(keyinfo->seg,page+(uint) mid*totlength,key,key_len, + comp_flag, not_used)) + >= 0) + end=mid; + else + start=mid+1; + } + if (mid != start) + flag=ha_key_cmp(keyinfo->seg,page+(uint) start*totlength,key,key_len, + comp_flag, not_used); + if (flag < 0) + start++; /* point at next, bigger key */ + *ret_pos=page+(uint) start*totlength; + *last_key= end == save_end; + DBUG_PRINT("exit",("flag: %d keypos: %d",flag,start)); + DBUG_RETURN(flag); +} /* _mi_bin_search */ + + +/* + Locate a packed key in a key page. + + SYNOPSIS + _mi_seq_search() + info Open table information. + keyinfo Key definition information. + page Key page (beginning). + key Search key. + key_len Length to use from search key or USE_WHOLE_KEY + comp_flag Search flags like SEARCH_SAME etc. + ret_pos RETURN Position in key page behind this key. + buff RETURN Copy of previous or identical unpacked key. + last_key RETURN If key is last in page. + + DESCRIPTION + Used instead of _mi_bin_search() when key is packed. + Puts smaller or identical key in buff. + Key is searched sequentially. + + RETURN + > 0 Key in 'buff' is smaller than search key. + 0 Key in 'buff' is identical to search key. + < 0 Not found. +*/ + +int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uint key_len, uint comp_flag, uchar **ret_pos, + uchar *buff, my_bool *last_key) +{ + int flag; + uint nod_flag,length,not_used[2]; + uchar t_buff[MI_MAX_KEY_BUFF],*end; + DBUG_ENTER("_mi_seq_search"); + + LINT_INIT(flag); LINT_INIT(length); + end= page+mi_getint(page); + nod_flag=mi_test_if_nod(page); + page+=2+nod_flag; + *ret_pos=page; + t_buff[0]=0; /* Avoid bugs */ + while (page < end) + { + length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,t_buff); + if (length == 0 || page > end) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_PRINT("error", + ("Found wrong key: length: %u page: 0x%lx end: 0x%lx", + length, (long) page, (long) end)); + DBUG_RETURN(MI_FOUND_WRONG_KEY); + } + if ((flag=ha_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag, + not_used)) >= 0) + break; +#ifdef EXTRA_DEBUG + DBUG_PRINT("loop",("page: 0x%lx key: '%s' flag: %d", (long) page, t_buff, + flag)); +#endif + memcpy(buff,t_buff,length); + *ret_pos=page; + } + if (flag == 0) + memcpy(buff,t_buff,length); /* Result is first key */ + *last_key= page == end; + DBUG_PRINT("exit",("flag: %d ret_pos: 0x%lx", flag, (long) *ret_pos)); + DBUG_RETURN(flag); +} /* _mi_seq_search */ + + +int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uint key_len, uint nextflag, uchar **ret_pos, + uchar *buff, my_bool *last_key) +{ + /* + my_flag is raw comparison result to be changed according to + SEARCH_NO_FIND,SEARCH_LAST and HA_REVERSE_SORT flags. + flag is the value returned by ha_key_cmp and as treated as final + */ + int flag=0, my_flag=-1; + uint nod_flag, length, len, matched, cmplen, kseg_len; + uint prefix_len,suffix_len; + int key_len_skip, seg_len_pack, key_len_left; + uchar *end, *kseg, *vseg; + uchar *sort_order=keyinfo->seg->charset->sort_order; + uchar tt_buff[MI_MAX_KEY_BUFF+2], *t_buff=tt_buff+2; + uchar *saved_from, *saved_to, *saved_vseg; + uint saved_length=0, saved_prefix_len=0; + uint length_pack; + DBUG_ENTER("_mi_prefix_search"); + + LINT_INIT(length); + LINT_INIT(prefix_len); + LINT_INIT(seg_len_pack); + LINT_INIT(saved_from); + LINT_INIT(saved_to); + LINT_INIT(saved_vseg); + + t_buff[0]=0; /* Avoid bugs */ + end= page+mi_getint(page); + nod_flag=mi_test_if_nod(page); + page+=2+nod_flag; + *ret_pos=page; + kseg=key; + + get_key_pack_length(kseg_len,length_pack,kseg); + key_len_skip=length_pack+kseg_len; + key_len_left=(int) key_len- (int) key_len_skip; + /* If key_len is 0, then lenght_pack is 1, then key_len_left is -1. */ + cmplen=(key_len_left>=0) ? kseg_len : key_len-length_pack; + DBUG_PRINT("info",("key: '%.*s'",kseg_len,kseg)); + + /* + Keys are compressed the following way: + + If the max length of first key segment <= 127 bytes the prefix is + 1 byte else it's 2 byte + + (prefix) length The high bit is set if this is a prefix for the prev key. + [suffix length] Packed length of suffix if the previous was a prefix. + (suffix) data Key data bytes (past the common prefix or whole segment). + [next-key-seg] Next key segments (([packed length], data), ...) + pointer Reference to the data file (last_keyseg->length). + */ + + matched=0; /* how many char's from prefix were alredy matched */ + len=0; /* length of previous key unpacked */ + + while (page < end) + { + uint packed= *page & 128; + + vseg=page; + if (keyinfo->seg->length >= 127) + { + suffix_len=mi_uint2korr(vseg) & 32767; + vseg+=2; + } + else + suffix_len= *vseg++ & 127; + + if (packed) + { + if (suffix_len == 0) + { + /* == 0x80 or 0x8000, same key, prefix length == old key length. */ + prefix_len=len; + } + else + { + /* > 0x80 or 0x8000, this is prefix lgt, packed suffix lgt follows. */ + prefix_len=suffix_len; + get_key_length(suffix_len,vseg); + } + } + else + { + /* Not packed. No prefix used from last key. */ + prefix_len=0; + } + + len=prefix_len+suffix_len; + seg_len_pack=get_pack_length(len); + t_buff=tt_buff+3-seg_len_pack; + store_key_length(t_buff,len); + + if (prefix_len > saved_prefix_len) + memcpy(t_buff+seg_len_pack+saved_prefix_len,saved_vseg, + prefix_len-saved_prefix_len); + saved_vseg=vseg; + saved_prefix_len=prefix_len; + + DBUG_PRINT("loop",("page: '%.*s%.*s'",prefix_len,t_buff+seg_len_pack, + suffix_len,vseg)); + { + uchar *from=vseg+suffix_len; + HA_KEYSEG *keyseg; + uint l; + + for (keyseg=keyinfo->seg+1 ; keyseg->type ; keyseg++ ) + { + + if (keyseg->flag & HA_NULL_PART) + { + if (!(*from++)) + continue; + } + if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART | HA_SPACE_PACK)) + { + get_key_length(l,from); + } + else + l=keyseg->length; + + from+=l; + } + from+=keyseg->length; + page=from+nod_flag; + length=from-vseg; + } + + if (page > end) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_PRINT("error", + ("Found wrong key: length: %u page: 0x%lx end: %lx", + length, (long) page, (long) end)); + DBUG_RETURN(MI_FOUND_WRONG_KEY); + } + + if (matched >= prefix_len) + { + /* We have to compare. But we can still skip part of the key */ + uint left; + uchar *k=kseg+prefix_len; + + /* + If prefix_len > cmplen then we are in the end-space comparison + phase. Do not try to acces the key any more ==> left= 0. + */ + left= ((len <= cmplen) ? suffix_len : + ((prefix_len < cmplen) ? cmplen - prefix_len : 0)); + + matched=prefix_len+left; + + if (sort_order) + { + for (my_flag=0;left;left--) + if ((my_flag= (int) sort_order[*vseg++] - (int) sort_order[*k++])) + break; + } + else + { + for (my_flag=0;left;left--) + if ((my_flag= (int) *vseg++ - (int) *k++)) + break; + } + + if (my_flag>0) /* mismatch */ + break; + if (my_flag==0) /* match */ + { + /* + ** len cmplen seg_left_len more_segs + ** < matched=len; continue search + ** > = prefix ? found : (matched=len; continue search) + ** > < - ok, found + ** = < - ok, found + ** = = - ok, found + ** = = + next seg + */ + if (len < cmplen) + { + if ((keyinfo->seg->type != HA_KEYTYPE_TEXT && + keyinfo->seg->type != HA_KEYTYPE_VARTEXT1 && + keyinfo->seg->type != HA_KEYTYPE_VARTEXT2)) + my_flag= -1; + else + { + /* We have to compare k and vseg as if they were space extended */ + uchar *k_end= k+ (cmplen - len); + for ( ; k < k_end && *k == ' '; k++) ; + if (k == k_end) + goto cmp_rest; /* should never happen */ + if (*k < (uchar) ' ') + { + my_flag= 1; /* Compared string is smaller */ + break; + } + my_flag= -1; /* Continue searching */ + } + } + else if (len > cmplen) + { + uchar *vseg_end; + if ((nextflag & SEARCH_PREFIX) && key_len_left == 0) + goto fix_flag; + + /* We have to compare k and vseg as if they were space extended */ + for (vseg_end= vseg + (len-cmplen) ; + vseg < vseg_end && *vseg == (uchar) ' '; + vseg++, matched++) ; + DBUG_ASSERT(vseg < vseg_end); + + if (*vseg > (uchar) ' ') + { + my_flag= 1; /* Compared string is smaller */ + break; + } + my_flag= -1; /* Continue searching */ + } + else + { + cmp_rest: + if (key_len_left>0) + { + uint not_used[2]; + if ((flag = ha_key_cmp(keyinfo->seg+1,vseg, + k, key_len_left, nextflag, not_used)) >= 0) + break; + } + else + { + /* + at this line flag==-1 if the following lines were already + visited and 0 otherwise, i.e. flag <=0 here always !!! + */ + fix_flag: + DBUG_ASSERT(flag <= 0); + if (nextflag & (SEARCH_NO_FIND | SEARCH_LAST)) + flag=(nextflag & (SEARCH_BIGGER | SEARCH_LAST)) ? -1 : 1; + if (flag>=0) + break; + } + } + } + matched-=left; + } + /* else (matched < prefix_len) ---> do nothing. */ + + memcpy(buff,t_buff,saved_length=seg_len_pack+prefix_len); + saved_to=buff+saved_length; + saved_from=saved_vseg; + saved_length=length; + *ret_pos=page; + } + if (my_flag) + flag=(keyinfo->seg->flag & HA_REVERSE_SORT) ? -my_flag : my_flag; + if (flag == 0) + { + memcpy(buff,t_buff,saved_length=seg_len_pack+prefix_len); + saved_to=buff+saved_length; + saved_from=saved_vseg; + saved_length=length; + } + if (saved_length) + memcpy(saved_to,saved_from,saved_length); + + *last_key= page == end; + + DBUG_PRINT("exit",("flag: %d ret_pos: 0x%lx", flag, (long) *ret_pos)); + DBUG_RETURN(flag); +} /* _mi_prefix_search */ + + + /* Get pos to a key_block */ + +my_off_t _mi_kpos(uint nod_flag, uchar *after_key) +{ + after_key-=nod_flag; + switch (nod_flag) { +#if SIZEOF_OFF_T > 4 + case 7: + return mi_uint7korr(after_key)*MI_MIN_KEY_BLOCK_LENGTH; + case 6: + return mi_uint6korr(after_key)*MI_MIN_KEY_BLOCK_LENGTH; + case 5: + return mi_uint5korr(after_key)*MI_MIN_KEY_BLOCK_LENGTH; +#else + case 7: + after_key++; + case 6: + after_key++; + case 5: + after_key++; +#endif + case 4: + return ((my_off_t) mi_uint4korr(after_key))*MI_MIN_KEY_BLOCK_LENGTH; + case 3: + return ((my_off_t) mi_uint3korr(after_key))*MI_MIN_KEY_BLOCK_LENGTH; + case 2: + return (my_off_t) (mi_uint2korr(after_key)*MI_MIN_KEY_BLOCK_LENGTH); + case 1: + return (uint) (*after_key)*MI_MIN_KEY_BLOCK_LENGTH; + case 0: /* At leaf page */ + default: /* Impossible */ + return(HA_OFFSET_ERROR); + } +} /* _kpos */ + + + /* Save pos to a key_block */ + +void _mi_kpointer(register MI_INFO *info, register uchar *buff, my_off_t pos) +{ + pos/=MI_MIN_KEY_BLOCK_LENGTH; + switch (info->s->base.key_reflength) { +#if SIZEOF_OFF_T > 4 + case 7: mi_int7store(buff,pos); break; + case 6: mi_int6store(buff,pos); break; + case 5: mi_int5store(buff,pos); break; +#else + case 7: *buff++=0; + /* fall trough */ + case 6: *buff++=0; + /* fall trough */ + case 5: *buff++=0; + /* fall trough */ +#endif + case 4: mi_int4store(buff,pos); break; + case 3: mi_int3store(buff,pos); break; + case 2: mi_int2store(buff,(uint) pos); break; + case 1: buff[0]= (uchar) pos; break; + default: abort(); /* impossible */ + } +} /* _mi_kpointer */ + + + /* Calc pos to a data-record from a key */ + + +my_off_t _mi_dpos(MI_INFO *info, uint nod_flag, uchar *after_key) +{ + my_off_t pos; + after_key-=(nod_flag + info->s->rec_reflength); + switch (info->s->rec_reflength) { +#if SIZEOF_OFF_T > 4 + case 8: pos= (my_off_t) mi_uint8korr(after_key); break; + case 7: pos= (my_off_t) mi_uint7korr(after_key); break; + case 6: pos= (my_off_t) mi_uint6korr(after_key); break; + case 5: pos= (my_off_t) mi_uint5korr(after_key); break; +#else + case 8: pos= (my_off_t) mi_uint4korr(after_key+4); break; + case 7: pos= (my_off_t) mi_uint4korr(after_key+3); break; + case 6: pos= (my_off_t) mi_uint4korr(after_key+2); break; + case 5: pos= (my_off_t) mi_uint4korr(after_key+1); break; +#endif + case 4: pos= (my_off_t) mi_uint4korr(after_key); break; + case 3: pos= (my_off_t) mi_uint3korr(after_key); break; + case 2: pos= (my_off_t) mi_uint2korr(after_key); break; + default: + pos=0L; /* Shut compiler up */ + } + return (info->s->options & + (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ? pos : + pos*info->s->base.pack_reclength; +} + + +/* Calc position from a record pointer ( in delete link chain ) */ + +my_off_t _mi_rec_pos(MYISAM_SHARE *s, uchar *ptr) +{ + my_off_t pos; + switch (s->rec_reflength) { +#if SIZEOF_OFF_T > 4 + case 8: + pos= (my_off_t) mi_uint8korr(ptr); + if (pos == HA_OFFSET_ERROR) + return HA_OFFSET_ERROR; /* end of list */ + break; + case 7: + pos= (my_off_t) mi_uint7korr(ptr); + if (pos == (((my_off_t) 1) << 56) -1) + return HA_OFFSET_ERROR; /* end of list */ + break; + case 6: + pos= (my_off_t) mi_uint6korr(ptr); + if (pos == (((my_off_t) 1) << 48) -1) + return HA_OFFSET_ERROR; /* end of list */ + break; + case 5: + pos= (my_off_t) mi_uint5korr(ptr); + if (pos == (((my_off_t) 1) << 40) -1) + return HA_OFFSET_ERROR; /* end of list */ + break; +#else + case 8: + case 7: + case 6: + case 5: + ptr+= (s->rec_reflength-4); + /* fall through */ +#endif + case 4: + pos= (my_off_t) mi_uint4korr(ptr); + if (pos == (my_off_t) (uint32) ~0L) + return HA_OFFSET_ERROR; + break; + case 3: + pos= (my_off_t) mi_uint3korr(ptr); + if (pos == (my_off_t) (1 << 24) -1) + return HA_OFFSET_ERROR; + break; + case 2: + pos= (my_off_t) mi_uint2korr(ptr); + if (pos == (my_off_t) (1 << 16) -1) + return HA_OFFSET_ERROR; + break; + default: abort(); /* Impossible */ + } + return ((s->options & + (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ? pos : + pos*s->base.pack_reclength); +} + + + /* save position to record */ + +void _mi_dpointer(MI_INFO *info, uchar *buff, my_off_t pos) +{ + if (!(info->s->options & + (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) && + pos != HA_OFFSET_ERROR) + pos/=info->s->base.pack_reclength; + + switch (info->s->rec_reflength) { +#if SIZEOF_OFF_T > 4 + case 8: mi_int8store(buff,pos); break; + case 7: mi_int7store(buff,pos); break; + case 6: mi_int6store(buff,pos); break; + case 5: mi_int5store(buff,pos); break; +#else + case 8: *buff++=0; + /* fall trough */ + case 7: *buff++=0; + /* fall trough */ + case 6: *buff++=0; + /* fall trough */ + case 5: *buff++=0; + /* fall trough */ +#endif + case 4: mi_int4store(buff,pos); break; + case 3: mi_int3store(buff,pos); break; + case 2: mi_int2store(buff,(uint) pos); break; + default: abort(); /* Impossible */ + } +} /* _mi_dpointer */ + + + /* Get key from key-block */ + /* page points at previous key; its advanced to point at next key */ + /* key should contain previous key */ + /* Returns length of found key + pointers */ + /* nod_flag is a flag if we are on nod */ + + /* same as _mi_get_key but used with fixed length keys */ + +uint _mi_get_static_key(register MI_KEYDEF *keyinfo, uint nod_flag, + register uchar **page, register uchar *key) +{ + memcpy((uchar*) key,(uchar*) *page, + (size_t) (keyinfo->keylength+nod_flag)); + *page+=keyinfo->keylength+nod_flag; + return(keyinfo->keylength); +} /* _mi_get_static_key */ + + +/* + get key witch is packed against previous key or key with a NULL column. + + SYNOPSIS + _mi_get_pack_key() + keyinfo key definition information. + nod_flag If nod: Length of node pointer, else zero. + page_pos RETURN position in key page behind this key. + key IN/OUT in: prev key, out: unpacked key. + + RETURN + key_length + length of data pointer +*/ + +uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, + register uchar **page_pos, register uchar *key) +{ + reg1 HA_KEYSEG *keyseg; + uchar *start_key,*page=*page_pos; + uint length; + + start_key=key; + for (keyseg=keyinfo->seg ; keyseg->type ;keyseg++) + { + if (keyseg->flag & HA_PACK_KEY) + { + /* key with length, packed to previous key */ + uchar *start=key; + uint packed= *page & 128,tot_length,rest_length; + if (keyseg->length >= 127) + { + length=mi_uint2korr(page) & 32767; + page+=2; + } + else + length= *page++ & 127; + + if (packed) + { + if (length > (uint) keyseg->length) + { + mi_print_error(keyinfo->share, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + return 0; /* Error */ + } + if (length == 0) /* Same key */ + { + if (keyseg->flag & HA_NULL_PART) + *key++=1; /* Can't be NULL */ + get_key_length(length,key); + key+= length; /* Same diff_key as prev */ + if (length > keyseg->length) + { + DBUG_PRINT("error", + ("Found too long null packed key: %u of %u at 0x%lx", + length, keyseg->length, (long) *page_pos)); + DBUG_DUMP("key",(char*) *page_pos,16); + mi_print_error(keyinfo->share, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + return 0; + } + continue; + } + if (keyseg->flag & HA_NULL_PART) + { + key++; /* Skip null marker*/ + start++; + } + + get_key_length(rest_length,page); + tot_length=rest_length+length; + + /* If the stored length has changed, we must move the key */ + if (tot_length >= 255 && *start != 255) + { + /* length prefix changed from a length of one to a length of 3 */ + bmove_upp(key+length+3, key+length+1, length); + *key=255; + mi_int2store(key+1,tot_length); + key+=3+length; + } + else if (tot_length < 255 && *start == 255) + { + bmove(key+1,key+3,length); + *key=tot_length; + key+=1+length; + } + else + { + store_key_length_inc(key,tot_length); + key+=length; + } + memcpy(key,page,rest_length); + page+=rest_length; + key+=rest_length; + continue; + } + else + { + if (keyseg->flag & HA_NULL_PART) + { + if (!length--) /* Null part */ + { + *key++=0; + continue; + } + *key++=1; /* Not null */ + } + } + if (length > (uint) keyseg->length) + { + DBUG_PRINT("error",("Found too long packed key: %u of %u at 0x%lx", + length, keyseg->length, (long) *page_pos)); + DBUG_DUMP("key",(char*) *page_pos,16); + mi_print_error(keyinfo->share, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + return 0; /* Error */ + } + store_key_length_inc(key,length); + } + else + { + if (keyseg->flag & HA_NULL_PART) + { + if (!(*key++ = *page++)) + continue; + } + if (keyseg->flag & + (HA_VAR_LENGTH_PART | HA_BLOB_PART | HA_SPACE_PACK)) + { + uchar *tmp=page; + get_key_length(length,tmp); + length+=(uint) (tmp-page); + } + else + length=keyseg->length; + } + memcpy((uchar*) key,(uchar*) page,(size_t) length); + key+=length; + page+=length; + } + length=keyseg->length+nod_flag; + bmove((uchar*) key,(uchar*) page,length); + *page_pos= page+length; + return ((uint) (key-start_key)+keyseg->length); +} /* _mi_get_pack_key */ + + + +/* key that is packed relatively to previous */ + +uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, + register uchar **page_pos, register uchar *key) +{ + reg1 HA_KEYSEG *keyseg; + uchar *start_key,*page,*page_end,*from,*from_end; + uint length,tmp; + DBUG_ENTER("_mi_get_binary_pack_key"); + + page= *page_pos; + page_end=page+MI_MAX_KEY_BUFF+1; + start_key=key; + + /* + Keys are compressed the following way: + + prefix length Packed length of prefix common with prev key (1 or 3 bytes) + for each key segment: + [is null] Null indicator if can be null (1 byte, zero means null) + [length] Packed length if varlength (1 or 3 bytes) + key segment 'length' bytes of key segment value + pointer Reference to the data file (last_keyseg->length). + + get_key_length() is a macro. It gets the prefix length from 'page' + and puts it into 'length'. It increments 'page' by 1 or 3, depending + on the packed length of the prefix length. + */ + get_key_length(length,page); + if (length) + { + if (length > keyinfo->maxlength) + { + DBUG_PRINT("error", + ("Found too long binary packed key: %u of %u at 0x%lx", + length, keyinfo->maxlength, (long) *page_pos)); + DBUG_DUMP("key",(char*) *page_pos,16); + mi_print_error(keyinfo->share, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(0); /* Wrong key */ + } + /* Key is packed against prev key, take prefix from prev key. */ + from= key; + from_end= key + length; + } + else + { + /* Key is not packed against prev key, take all from page buffer. */ + from= page; + from_end= page_end; + } + + /* + The trouble is that key can be split in two parts: + The first part (prefix) is in from .. from_end - 1. + The second part starts at page. + The split can be at every byte position. So we need to check for + the end of the first part before using every byte. + */ + for (keyseg=keyinfo->seg ; keyseg->type ;keyseg++) + { + if (keyseg->flag & HA_NULL_PART) + { + /* If prefix is used up, switch to rest. */ + if (from == from_end) { from=page; from_end=page_end; } + if (!(*key++ = *from++)) + continue; /* Null part */ + } + if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART | HA_SPACE_PACK)) + { + /* If prefix is used up, switch to rest. */ + if (from == from_end) { from=page; from_end=page_end; } + /* Get length of dynamic length key part */ + if ((length= (*key++ = *from++)) == 255) + { + /* If prefix is used up, switch to rest. */ + if (from == from_end) { from=page; from_end=page_end; } + length= (uint) ((*key++ = *from++)) << 8; + /* If prefix is used up, switch to rest. */ + if (from == from_end) { from=page; from_end=page_end; } + length+= (uint) ((*key++ = *from++)); + } + } + else + length=keyseg->length; + + if ((tmp=(uint) (from_end-from)) <= length) + { + key+=tmp; /* Use old key */ + length-=tmp; + from=page; from_end=page_end; + } + DBUG_PRINT("info",("key: 0x%lx from: 0x%lx length: %u", + (long) key, (long) from, length)); + memmove((uchar*) key, (uchar*) from, (size_t) length); + key+=length; + from+=length; + } + /* + Last segment (type == 0) contains length of data pointer. + If we have mixed key blocks with data pointer and key block pointer, + we have to copy both. + */ + length=keyseg->length+nod_flag; + if ((tmp=(uint) (from_end-from)) <= length) + { + /* Remaining length is less or equal max possible length. */ + memcpy(key+tmp,page,length-tmp); /* Get last part of key */ + *page_pos= page+length-tmp; + } + else + { + /* + Remaining length is greater than max possible length. + This can happen only if we switched to the new key bytes already. + 'page_end' is calculated with MI_MAX_KEY_BUFF. So it can be far + behind the real end of the key. + */ + if (from_end != page_end) + { + DBUG_PRINT("error",("Error when unpacking key")); + mi_print_error(keyinfo->share, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(0); /* Error */ + } + /* Copy data pointer and, if appropriate, key block pointer. */ + memcpy((uchar*) key,(uchar*) from,(size_t) length); + *page_pos= from+length; + } + DBUG_RETURN((uint) (key-start_key)+keyseg->length); +} + + + /* Get key at position without knowledge of previous key */ + /* Returns pointer to next key */ + +uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uchar *keypos, uint *return_key_length) +{ + uint nod_flag; + DBUG_ENTER("_mi_get_key"); + + nod_flag=mi_test_if_nod(page); + if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) + { + bmove((uchar*) key,(uchar*) keypos,keyinfo->keylength+nod_flag); + DBUG_RETURN(keypos+keyinfo->keylength+nod_flag); + } + else + { + page+=2+nod_flag; + key[0]=0; /* safety */ + while (page <= keypos) + { + *return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,key); + if (*return_key_length == 0) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(0); + } + } + } + DBUG_PRINT("exit",("page: 0x%lx length: %u", (long) page, + *return_key_length)); + DBUG_RETURN(page); +} /* _mi_get_key */ + + + /* Get key at position without knowledge of previous key */ + /* Returns 0 if ok */ + +static my_bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uchar *keypos, + uint *return_key_length) +{ + uint nod_flag; + DBUG_ENTER("_mi_get_prev_key"); + + nod_flag=mi_test_if_nod(page); + if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) + { + *return_key_length=keyinfo->keylength; + bmove((uchar*) key,(uchar*) keypos- *return_key_length-nod_flag, + *return_key_length); + DBUG_RETURN(0); + } + else + { + page+=2+nod_flag; + key[0]=0; /* safety */ + while (page < keypos) + { + *return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,key); + if (*return_key_length == 0) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(1); + } + } + } + DBUG_RETURN(0); +} /* _mi_get_key */ + + + + /* Get last key from key-page */ + /* Return pointer to where key starts */ + +uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, + uchar *lastkey, uchar *endpos, uint *return_key_length) +{ + uint nod_flag; + uchar *lastpos; + DBUG_ENTER("_mi_get_last_key"); + DBUG_PRINT("enter",("page: 0x%lx endpos: 0x%lx", (long) page, + (long) endpos)); + + nod_flag=mi_test_if_nod(page); + if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) + { + lastpos=endpos-keyinfo->keylength-nod_flag; + *return_key_length=keyinfo->keylength; + if (lastpos > page) + bmove((uchar*) lastkey,(uchar*) lastpos,keyinfo->keylength+nod_flag); + } + else + { + lastpos=(page+=2+nod_flag); + lastkey[0]=0; + while (page < endpos) + { + lastpos=page; + *return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,lastkey); + if (*return_key_length == 0) + { + DBUG_PRINT("error",("Couldn't find last key: page: 0x%lx", + (long) page)); + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(0); + } + } + } + DBUG_PRINT("exit",("lastpos: 0x%lx length: %u", (long) lastpos, + *return_key_length)); + DBUG_RETURN(lastpos); +} /* _mi_get_last_key */ + + + /* Calculate length of key */ + +uint _mi_keylength(MI_KEYDEF *keyinfo, register uchar *key) +{ + reg1 HA_KEYSEG *keyseg; + uchar *start; + + if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) + return (keyinfo->keylength); + + start=key; + for (keyseg=keyinfo->seg ; keyseg->type ; keyseg++) + { + if (keyseg->flag & HA_NULL_PART) + if (!*key++) + continue; + if (keyseg->flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH_PART)) + { + uint length; + get_key_length(length,key); + key+=length; + } + else + key+= keyseg->length; + } + return((uint) (key-start)+keyseg->length); +} /* _mi_keylength */ + + +/* + Calculate length of part key. + + Used in mi_rkey() to find the key found for the key-part that was used. + This is needed in case of multi-byte character sets where we may search + after '0xDF' but find 'ss' +*/ + +uint _mi_keylength_part(MI_KEYDEF *keyinfo, register uchar *key, + HA_KEYSEG *end) +{ + reg1 HA_KEYSEG *keyseg; + uchar *start= key; + + for (keyseg=keyinfo->seg ; keyseg != end ; keyseg++) + { + if (keyseg->flag & HA_NULL_PART) + if (!*key++) + continue; + if (keyseg->flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH_PART)) + { + uint length; + get_key_length(length,key); + key+=length; + } + else + key+= keyseg->length; + } + return (uint) (key-start); +} + + /* Move a key */ + +uchar *_mi_move_key(MI_KEYDEF *keyinfo, uchar *to, uchar *from) +{ + reg1 uint length; + memcpy((uchar*) to, (uchar*) from, + (size_t) (length=_mi_keylength(keyinfo,from))); + return to+length; +} + + /* Find next/previous record with same key */ + /* This can't be used when database is touched after last read */ + +int _mi_search_next(register MI_INFO *info, register MI_KEYDEF *keyinfo, + uchar *key, uint key_length, uint nextflag, my_off_t pos) +{ + int error; + uint nod_flag; + uchar lastkey[MI_MAX_KEY_BUFF]; + DBUG_ENTER("_mi_search_next"); + DBUG_PRINT("enter",("nextflag: %u lastpos: %lu int_keypos: %lu", + nextflag, (ulong) info->lastpos, + (ulong) info->int_keypos)); + DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,key_length);); + + /* Force full read if we are at last key or if we are not on a leaf + and the key tree has changed since we used it last time + Note that even if the key tree has changed since last read, we can use + the last read data from the leaf if we haven't used the buffer for + something else. + */ + + if (((nextflag & SEARCH_BIGGER) && info->int_keypos >= info->int_maxpos) || + info->page_changed || + (info->int_keytree_version != keyinfo->version && + (info->int_nod_flag || info->buff_used))) + DBUG_RETURN(_mi_search(info,keyinfo,key, USE_WHOLE_KEY, + nextflag | SEARCH_SAVE_BUFF, pos)); + + if (info->buff_used) + { + if (!_mi_fetch_keypage(info,keyinfo,info->last_search_keypage, + DFLT_INIT_HITS,info->buff,0)) + DBUG_RETURN(-1); + info->buff_used=0; + } + + /* Last used buffer is in info->buff */ + nod_flag=mi_test_if_nod(info->buff); + + if (nextflag & SEARCH_BIGGER) /* Next key */ + { + my_off_t tmp_pos=_mi_kpos(nod_flag,info->int_keypos); + if (tmp_pos != HA_OFFSET_ERROR) + { + if ((error=_mi_search(info,keyinfo,key, USE_WHOLE_KEY, + nextflag | SEARCH_SAVE_BUFF, tmp_pos)) <=0) + DBUG_RETURN(error); + } + memcpy(lastkey,key,key_length); + if (!(info->lastkey_length=(*keyinfo->get_key)(keyinfo,nod_flag, + &info->int_keypos,lastkey))) + DBUG_RETURN(-1); + } + else /* Previous key */ + { + uint length; + /* Find start of previous key */ + info->int_keypos=_mi_get_last_key(info,keyinfo,info->buff,lastkey, + info->int_keypos, &length); + if (!info->int_keypos) + DBUG_RETURN(-1); + if (info->int_keypos == info->buff+2) + DBUG_RETURN(_mi_search(info,keyinfo,key, USE_WHOLE_KEY, + nextflag | SEARCH_SAVE_BUFF, pos)); + if ((error=_mi_search(info,keyinfo,key, USE_WHOLE_KEY, + nextflag | SEARCH_SAVE_BUFF, + _mi_kpos(nod_flag,info->int_keypos))) <= 0) + DBUG_RETURN(error); + + /* QQ: We should be able to optimize away the following call */ + if (! _mi_get_last_key(info,keyinfo,info->buff,lastkey, + info->int_keypos,&info->lastkey_length)) + DBUG_RETURN(-1); + } + memcpy(info->lastkey,lastkey,info->lastkey_length); + info->lastpos=_mi_dpos(info,0,info->lastkey+info->lastkey_length); + DBUG_PRINT("exit",("found key at %lu",(ulong) info->lastpos)); + DBUG_RETURN(0); +} /* _mi_search_next */ + + + /* Search after position for the first row in an index */ + /* This is stored in info->lastpos */ + +int _mi_search_first(register MI_INFO *info, register MI_KEYDEF *keyinfo, + register my_off_t pos) +{ + uint nod_flag; + uchar *page; + DBUG_ENTER("_mi_search_first"); + + if (pos == HA_OFFSET_ERROR) + { + my_errno=HA_ERR_KEY_NOT_FOUND; + info->lastpos= HA_OFFSET_ERROR; + DBUG_RETURN(-1); + } + + do + { + if (!_mi_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,info->buff,0)) + { + info->lastpos= HA_OFFSET_ERROR; + DBUG_RETURN(-1); + } + nod_flag=mi_test_if_nod(info->buff); + page=info->buff+2+nod_flag; + } while ((pos=_mi_kpos(nod_flag,page)) != HA_OFFSET_ERROR); + + if (!(info->lastkey_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page, + info->lastkey))) + DBUG_RETURN(-1); /* Crashed */ + + info->int_keypos=page; info->int_maxpos=info->buff+mi_getint(info->buff)-1; + info->int_nod_flag=nod_flag; + info->int_keytree_version=keyinfo->version; + info->last_search_keypage=info->last_keypage; + info->page_changed=info->buff_used=0; + info->lastpos=_mi_dpos(info,0,info->lastkey+info->lastkey_length); + + DBUG_PRINT("exit",("found key at %lu", (ulong) info->lastpos)); + DBUG_RETURN(0); +} /* _mi_search_first */ + + + /* Search after position for the last row in an index */ + /* This is stored in info->lastpos */ + +int _mi_search_last(register MI_INFO *info, register MI_KEYDEF *keyinfo, + register my_off_t pos) +{ + uint nod_flag; + uchar *buff,*page; + DBUG_ENTER("_mi_search_last"); + + if (pos == HA_OFFSET_ERROR) + { + my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */ + info->lastpos= HA_OFFSET_ERROR; + DBUG_RETURN(-1); + } + + buff=info->buff; + do + { + if (!_mi_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,buff,0)) + { + info->lastpos= HA_OFFSET_ERROR; + DBUG_RETURN(-1); + } + page= buff+mi_getint(buff); + nod_flag=mi_test_if_nod(buff); + } while ((pos=_mi_kpos(nod_flag,page)) != HA_OFFSET_ERROR); + + if (!_mi_get_last_key(info,keyinfo,buff,info->lastkey,page, + &info->lastkey_length)) + DBUG_RETURN(-1); + info->lastpos=_mi_dpos(info,0,info->lastkey+info->lastkey_length); + info->int_keypos=info->int_maxpos=page; + info->int_nod_flag=nod_flag; + info->int_keytree_version=keyinfo->version; + info->last_search_keypage=info->last_keypage; + info->page_changed=info->buff_used=0; + + DBUG_PRINT("exit",("found key at %lu",(ulong) info->lastpos)); + DBUG_RETURN(0); +} /* _mi_search_last */ + + + +/**************************************************************************** +** +** Functions to store and pack a key in a page +** +** mi_calc_xx_key_length takes the following arguments: +** nod_flag If nod: Length of nod-pointer +** next_key Position to pos after the new key in buffer +** org_key Key that was before the next key in buffer +** prev_key Last key before current key +** key Key that will be stored +** s_temp Information how next key will be packed +****************************************************************************/ + +/* Static length key */ + +int +_mi_calc_static_key_length(MI_KEYDEF *keyinfo,uint nod_flag, + uchar *next_pos __attribute__((unused)), + uchar *org_key __attribute__((unused)), + uchar *prev_key __attribute__((unused)), + uchar *key, MI_KEY_PARAM *s_temp) +{ + s_temp->key=key; + return (int) (s_temp->totlength=keyinfo->keylength+nod_flag); +} + +/* Variable length key */ + +int +_mi_calc_var_key_length(MI_KEYDEF *keyinfo,uint nod_flag, + uchar *next_pos __attribute__((unused)), + uchar *org_key __attribute__((unused)), + uchar *prev_key __attribute__((unused)), + uchar *key, MI_KEY_PARAM *s_temp) +{ + s_temp->key=key; + return (int) (s_temp->totlength=_mi_keylength(keyinfo,key)+nod_flag); +} + +/* + length of key with a variable length first segment which is prefix + compressed (myisamchk reports 'packed + stripped') + + Keys are compressed the following way: + + If the max length of first key segment <= 127 bytes the prefix is + 1 byte else it's 2 byte + + prefix byte(s) The high bit is set if this is a prefix for the prev key + length Packed length if the previous was a prefix byte + [length] data bytes ('length' bytes) + next-key-seg Next key segments + + If the first segment can have NULL: + The length is 0 for NULLS and 1+length for not null columns. + +*/ + +int +_mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, + uchar *org_key, uchar *prev_key, uchar *key, + MI_KEY_PARAM *s_temp) +{ + reg1 HA_KEYSEG *keyseg; + int length; + uint key_length,ref_length,org_key_length=0, + length_pack,new_key_length,diff_flag,pack_marker; + uchar *start,*end,*key_end,*sort_order; + bool same_length; + + length_pack=s_temp->ref_length=s_temp->n_ref_length=s_temp->n_length=0; + same_length=0; keyseg=keyinfo->seg; + key_length=_mi_keylength(keyinfo,key)+nod_flag; + + sort_order=0; + if ((keyinfo->flag & HA_FULLTEXT) && + ((keyseg->type == HA_KEYTYPE_TEXT) || + (keyseg->type == HA_KEYTYPE_VARTEXT1) || + (keyseg->type == HA_KEYTYPE_VARTEXT2)) && + !use_strnxfrm(keyseg->charset)) + sort_order=keyseg->charset->sort_order; + + /* diff flag contains how many bytes is needed to pack key */ + if (keyseg->length >= 127) + { + diff_flag=2; + pack_marker=32768; + } + else + { + diff_flag= 1; + pack_marker=128; + } + s_temp->pack_marker=pack_marker; + + /* Handle the case that the first part have NULL values */ + if (keyseg->flag & HA_NULL_PART) + { + if (!*key++) + { + s_temp->key=key; + s_temp->key_length= 0; + s_temp->totlength=key_length-1+diff_flag; + s_temp->next_key_pos=0; /* No next key */ + return (s_temp->totlength); + } + s_temp->store_not_null=1; + key_length--; /* We don't store NULL */ + if (prev_key && !*prev_key++) + org_key=prev_key=0; /* Can't pack against prev */ + else if (org_key) + org_key++; /* Skip NULL */ + } + else + s_temp->store_not_null=0; + s_temp->prev_key=org_key; + + /* The key part will start with a packed length */ + + get_key_pack_length(new_key_length,length_pack,key); + end=key_end= key+ new_key_length; + start=key; + + /* Calc how many characters are identical between this and the prev. key */ + if (prev_key) + { + get_key_length(org_key_length,prev_key); + s_temp->prev_key=prev_key; /* Pointer at data */ + /* Don't use key-pack if length == 0 */ + if (new_key_length && new_key_length == org_key_length) + same_length=1; + else if (new_key_length > org_key_length) + end=key + org_key_length; + + if (sort_order) /* SerG */ + { + while (key < end && sort_order[*key] == sort_order[*prev_key]) + { + key++; prev_key++; + } + } + else + { + while (key < end && *key == *prev_key) + { + key++; prev_key++; + } + } + } + + s_temp->key=key; + s_temp->key_length= (uint) (key_end-key); + + if (same_length && key == key_end) + { + /* identical variable length key */ + s_temp->ref_length= pack_marker; + length=(int) key_length-(int) (key_end-start)-length_pack; + length+= diff_flag; + if (next_key) + { /* Can't combine with next */ + s_temp->n_length= *next_key; /* Needed by _mi_store_key */ + next_key=0; + } + } + else + { + if (start != key) + { /* Starts as prev key */ + ref_length= (uint) (key-start); + s_temp->ref_length= ref_length + pack_marker; + length= (int) (key_length - ref_length); + + length-= length_pack; + length+= diff_flag; + length+= ((new_key_length-ref_length) >= 255) ? 3 : 1;/* Rest_of_key */ + } + else + { + s_temp->key_length+=s_temp->store_not_null; /* If null */ + length= key_length - length_pack+ diff_flag; + } + } + s_temp->totlength=(uint) length; + s_temp->prev_length=0; + DBUG_PRINT("test",("tot_length: %u length: %d uniq_key_length: %u", + key_length, length, s_temp->key_length)); + + /* If something after that hasn't length=0, test if we can combine */ + if ((s_temp->next_key_pos=next_key)) + { + uint packed,n_length; + + packed = *next_key & 128; + if (diff_flag == 2) + { + n_length= mi_uint2korr(next_key) & 32767; /* Length of next key */ + next_key+=2; + } + else + n_length= *next_key++ & 127; + if (!packed) + n_length-= s_temp->store_not_null; + + if (n_length || packed) /* Don't pack 0 length keys */ + { + uint next_length_pack, new_ref_length=s_temp->ref_length; + + if (packed) + { + /* If first key and next key is packed (only on delete) */ + if (!prev_key && org_key) + { + get_key_length(org_key_length,org_key); + key=start; + if (sort_order) /* SerG */ + { + while (key < end && sort_order[*key] == sort_order[*org_key]) + { + key++; org_key++; + } + } + else + { + while (key < end && *key == *org_key) + { + key++; org_key++; + } + } + if ((new_ref_length= (uint) (key - start))) + new_ref_length+=pack_marker; + } + + if (!n_length) + { + /* + We put a different key between two identical variable length keys + Extend next key to have same prefix as this key + */ + if (new_ref_length) /* prefix of previus key */ + { /* make next key longer */ + s_temp->part_of_prev_key= new_ref_length; + s_temp->prev_length= org_key_length - + (new_ref_length-pack_marker); + s_temp->n_ref_length= s_temp->part_of_prev_key; + s_temp->n_length= s_temp->prev_length; + n_length= get_pack_length(s_temp->prev_length); + s_temp->prev_key+= (new_ref_length - pack_marker); + length+= s_temp->prev_length + n_length; + } + else + { /* Can't use prev key */ + s_temp->part_of_prev_key=0; + s_temp->prev_length= org_key_length; + s_temp->n_ref_length=s_temp->n_length= org_key_length; + length+= org_key_length; + } + return (int) length; + } + + ref_length=n_length; + /* Get information about not packed key suffix */ + get_key_pack_length(n_length,next_length_pack,next_key); + + /* Test if new keys has fewer characters that match the previous key */ + if (!new_ref_length) + { /* Can't use prev key */ + s_temp->part_of_prev_key= 0; + s_temp->prev_length= ref_length; + s_temp->n_ref_length= s_temp->n_length= n_length+ref_length; + return (int) length+ref_length-next_length_pack; + } + if (ref_length+pack_marker > new_ref_length) + { + uint new_pack_length=new_ref_length-pack_marker; + /* We must copy characters from the original key to the next key */ + s_temp->part_of_prev_key= new_ref_length; + s_temp->prev_length= ref_length - new_pack_length; + s_temp->n_ref_length=s_temp->n_length=n_length + s_temp->prev_length; + s_temp->prev_key+= new_pack_length; + length-= (next_length_pack - get_pack_length(s_temp->n_length)); + return (int) length + s_temp->prev_length; + } + } + else + { + /* Next key wasn't a prefix of previous key */ + ref_length=0; + next_length_pack=0; + } + DBUG_PRINT("test",("length: %d next_key: 0x%lx", length, + (long) next_key)); + + { + uint tmp_length; + key=(start+=ref_length); + if (key+n_length < key_end) /* Normalize length based */ + key_end=key+n_length; + if (sort_order) /* SerG */ + { + while (key < key_end && sort_order[*key] == + sort_order[*next_key]) + { + key++; next_key++; + } + } + else + { + while (key < key_end && *key == *next_key) + { + key++; next_key++; + } + } + if (!(tmp_length=(uint) (key-start))) + { /* Key can't be re-packed */ + s_temp->next_key_pos=0; + return length; + } + ref_length+=tmp_length; + n_length-=tmp_length; + length-=tmp_length+next_length_pack; /* We gained these chars */ + } + if (n_length == 0 && ref_length == new_key_length) + { + s_temp->n_ref_length=pack_marker; /* Same as prev key */ + } + else + { + s_temp->n_ref_length=ref_length | pack_marker; + length+= get_pack_length(n_length); + s_temp->n_length=n_length; + } + } + } + return length; +} + + +/* Length of key which is prefix compressed */ + +int +_mi_calc_bin_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, + uchar *org_key, uchar *prev_key, uchar *key, + MI_KEY_PARAM *s_temp) +{ + uint length,key_length,ref_length; + + s_temp->totlength=key_length=_mi_keylength(keyinfo,key)+nod_flag; +#ifdef HAVE_purify + s_temp->n_length= s_temp->n_ref_length=0; /* For valgrind */ +#endif + s_temp->key=key; + s_temp->prev_key=org_key; + if (prev_key) /* If not first key in block */ + { + /* pack key against previous key */ + /* + As keys may be identical when running a sort in myisamchk, we + have to guard against the case where keys may be identical + */ + uchar *end; + end=key+key_length; + for ( ; *key == *prev_key && key < end; key++,prev_key++) ; + s_temp->ref_length= ref_length=(uint) (key-s_temp->key); + length=key_length - ref_length + get_pack_length(ref_length); + } + else + { + /* No previous key */ + s_temp->ref_length=ref_length=0; + length=key_length+1; + } + if ((s_temp->next_key_pos=next_key)) /* If another key after */ + { + /* pack key against next key */ + uint next_length,next_length_pack; + get_key_pack_length(next_length,next_length_pack,next_key); + + /* If first key and next key is packed (only on delete) */ + if (!prev_key && org_key && next_length) + { + uchar *end; + for (key= s_temp->key, end=key+next_length ; + *key == *org_key && key < end; + key++,org_key++) ; + ref_length= (uint) (key - s_temp->key); + } + + if (next_length > ref_length) + { + /* We put a key with different case between two keys with the same prefix + Extend next key to have same prefix as + this key */ + s_temp->n_ref_length= ref_length; + s_temp->prev_length= next_length-ref_length; + s_temp->prev_key+= ref_length; + return (int) (length+ s_temp->prev_length - next_length_pack + + get_pack_length(ref_length)); + } + /* Check how many characters are identical to next key */ + key= s_temp->key+next_length; + while (*key++ == *next_key++) ; + if ((ref_length= (uint) (key - s_temp->key)-1) == next_length) + { + s_temp->next_key_pos=0; + return length; /* can't pack next key */ + } + s_temp->prev_length=0; + s_temp->n_ref_length=ref_length; + return (int) (length-(ref_length - next_length) - next_length_pack + + get_pack_length(ref_length)); + } + return (int) length; +} + + +/* +** store a key packed with _mi_calc_xxx_key_length in page-buffert +*/ + +/* store key without compression */ + +void _mi_store_static_key(MI_KEYDEF *keyinfo __attribute__((unused)), + register uchar *key_pos, + register MI_KEY_PARAM *s_temp) +{ + memcpy((uchar*) key_pos,(uchar*) s_temp->key,(size_t) s_temp->totlength); +} + + +/* store variable length key with prefix compression */ + +#define store_pack_length(test,pos,length) { \ + if (test) { *((pos)++) = (uchar) (length); } else \ + { *((pos)++) = (uchar) ((length) >> 8); *((pos)++) = (uchar) (length); } } + + +void _mi_store_var_pack_key(MI_KEYDEF *keyinfo __attribute__((unused)), + register uchar *key_pos, + register MI_KEY_PARAM *s_temp) +{ + uint length; + uchar *start; + + start=key_pos; + + if (s_temp->ref_length) + { + /* Packed against previous key */ + store_pack_length(s_temp->pack_marker == 128,key_pos,s_temp->ref_length); + /* If not same key after */ + if (s_temp->ref_length != s_temp->pack_marker) + store_key_length_inc(key_pos,s_temp->key_length); + } + else + { + /* Not packed against previous key */ + store_pack_length(s_temp->pack_marker == 128,key_pos,s_temp->key_length); + } + bmove((uchar*) key_pos,(uchar*) s_temp->key, + (length=s_temp->totlength-(uint) (key_pos-start))); + + if (!s_temp->next_key_pos) /* No following key */ + return; + key_pos+=length; + + if (s_temp->prev_length) + { + /* Extend next key because new key didn't have same prefix as prev key */ + if (s_temp->part_of_prev_key) + { + store_pack_length(s_temp->pack_marker == 128,key_pos, + s_temp->part_of_prev_key); + store_key_length_inc(key_pos,s_temp->n_length); + } + else + { + s_temp->n_length+= s_temp->store_not_null; + store_pack_length(s_temp->pack_marker == 128,key_pos, + s_temp->n_length); + } + memcpy(key_pos, s_temp->prev_key, s_temp->prev_length); + } + else if (s_temp->n_ref_length) + { + store_pack_length(s_temp->pack_marker == 128,key_pos,s_temp->n_ref_length); + if (s_temp->n_ref_length == s_temp->pack_marker) + return; /* Identical key */ + store_key_length(key_pos,s_temp->n_length); + } + else + { + s_temp->n_length+= s_temp->store_not_null; + store_pack_length(s_temp->pack_marker == 128,key_pos,s_temp->n_length); + } +} + + +/* variable length key with prefix compression */ + +void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo __attribute__((unused)), + register uchar *key_pos, + register MI_KEY_PARAM *s_temp) +{ + store_key_length_inc(key_pos,s_temp->ref_length); + memcpy((char*) key_pos,(char*) s_temp->key+s_temp->ref_length, + (size_t) s_temp->totlength-s_temp->ref_length); + + if (s_temp->next_key_pos) + { + key_pos+=(uint) (s_temp->totlength-s_temp->ref_length); + store_key_length_inc(key_pos,s_temp->n_ref_length); + if (s_temp->prev_length) /* If we must extend key */ + { + memcpy(key_pos,s_temp->prev_key,s_temp->prev_length); + } + } +} Added: trunk/src/mi_static.c =================================================================== --- trunk/src/mi_static.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_static.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,61 @@ +/* Copyright (C) 2000-2002, 2004-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Static variables for MyISAM library. All definied here for easy making of + a shared library +*/ + +#ifndef _global_h +#include "myisamdef.h" +#endif + +LIST *myisam_open_list=0; +uchar NEAR myisam_file_magic[]= +{ (uchar) 254, (uchar) 254,'\007', '\001', }; +uchar NEAR myisam_pack_file_magic[]= +{ (uchar) 254, (uchar) 254,'\010', '\002', }; +char * myisam_log_filename=(char*) "myisam.log"; +File myisam_log_file= -1; +uint myisam_quick_table_bits=9; +ulong myisam_block_size= MI_KEY_BLOCK_LENGTH; /* Best by test */ +my_bool myisam_flush=0, myisam_delay_key_write=0, myisam_single_user=0; +#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS) +ulong myisam_concurrent_insert= 2; +#else +ulong myisam_concurrent_insert= 0; +#endif +my_off_t myisam_max_temp_length= MAX_FILE_SIZE; +ulong myisam_bulk_insert_tree_size=8192*1024; +ulong myisam_data_pointer_size=4; + +/* + read_vec[] is used for converting between P_READ_KEY.. and SEARCH_ + Position is , == , >= , <= , > , < +*/ + +uint NEAR myisam_read_vec[]= +{ + SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER, + SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER, + SEARCH_FIND | SEARCH_PREFIX, SEARCH_LAST, SEARCH_LAST | SEARCH_SMALLER, + MBR_CONTAIN, MBR_INTERSECT, MBR_WITHIN, MBR_DISJOINT, MBR_EQUAL +}; + +uint NEAR myisam_readnext_vec[]= +{ + SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER, + SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_SMALLER +}; Added: trunk/src/mi_statrec.c =================================================================== --- trunk/src/mi_statrec.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_statrec.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,300 @@ +/* Copyright (C) 2000-2002, 2004-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + /* Functions to handle fixed-length-records */ + +#include "myisamdef.h" + + +int _mi_write_static_record(MI_INFO *info, const uchar *record) +{ + uchar temp[8]; /* max pointer length */ + if (info->s->state.dellink != HA_OFFSET_ERROR && + !info->append_insert_at_end) + { + my_off_t filepos=info->s->state.dellink; + info->rec_cache.seek_not_done=1; /* We have done a seek */ + if (info->s->file_read(info, &temp[0],info->s->base.rec_reflength, + info->s->state.dellink+1, + MYF(MY_NABP))) + goto err; + info->s->state.dellink= _mi_rec_pos(info->s,temp); + info->state->del--; + info->state->empty-=info->s->base.pack_reclength; + if (info->s->file_write(info, record, info->s->base.reclength, + filepos, + MYF(MY_NABP))) + goto err; + } + else + { + if (info->state->data_file_length > info->s->base.max_data_file_length- + info->s->base.pack_reclength) + { + my_errno=HA_ERR_RECORD_FILE_FULL; + return(2); + } + if (info->opt_flag & WRITE_CACHE_USED) + { /* Cash in use */ + if (my_b_write(&info->rec_cache, record, + info->s->base.reclength)) + goto err; + if (info->s->base.pack_reclength != info->s->base.reclength) + { + uint length=info->s->base.pack_reclength - info->s->base.reclength; + bzero(temp,length); + if (my_b_write(&info->rec_cache, temp,length)) + goto err; + } + } + else + { + info->rec_cache.seek_not_done=1; /* We have done a seek */ + if (info->s->file_write(info, record, info->s->base.reclength, + info->state->data_file_length, + info->s->write_flag)) + goto err; + if (info->s->base.pack_reclength != info->s->base.reclength) + { + uint length=info->s->base.pack_reclength - info->s->base.reclength; + bzero(temp,length); + if (info->s->file_write(info, temp,length, + info->state->data_file_length+ + info->s->base.reclength, + info->s->write_flag)) + goto err; + } + } + info->state->data_file_length+=info->s->base.pack_reclength; + info->s->state.split++; + } + return 0; + err: + return 1; +} + +int _mi_update_static_record(MI_INFO *info, my_off_t pos, const uchar *record) +{ + info->rec_cache.seek_not_done=1; /* We have done a seek */ + return (info->s->file_write(info, + record, info->s->base.reclength, + pos, + MYF(MY_NABP)) != 0); +} + + +int _mi_delete_static_record(MI_INFO *info) +{ + uchar temp[9]; /* 1+sizeof(uint32) */ + + info->state->del++; + info->state->empty+=info->s->base.pack_reclength; + temp[0]= '\0'; /* Mark that record is deleted */ + _mi_dpointer(info,temp+1,info->s->state.dellink); + info->s->state.dellink = info->lastpos; + info->rec_cache.seek_not_done=1; + return (info->s->file_write(info,(uchar*) temp, 1+info->s->rec_reflength, + info->lastpos, MYF(MY_NABP)) != 0); +} + + +int _mi_cmp_static_record(register MI_INFO *info, register const uchar *old) +{ + DBUG_ENTER("_mi_cmp_static_record"); + + /* We are going to do changes; dont let anybody disturb */ + dont_break(); /* Dont allow SIGHUP or SIGINT */ + + if (info->opt_flag & WRITE_CACHE_USED) + { + if (flush_io_cache(&info->rec_cache)) + { + DBUG_RETURN(-1); + } + info->rec_cache.seek_not_done=1; /* We have done a seek */ + } + + if ((info->opt_flag & READ_CHECK_USED)) + { /* If check isn't disabled */ + info->rec_cache.seek_not_done=1; /* We have done a seek */ + if (info->s->file_read(info, info->rec_buff, info->s->base.reclength, + info->lastpos, + MYF(MY_NABP))) + DBUG_RETURN(-1); + if (memcmp(info->rec_buff, old, + (uint) info->s->base.reclength)) + { + DBUG_DUMP("read",old,info->s->base.reclength); + DBUG_DUMP("disk",info->rec_buff,info->s->base.reclength); + my_errno=HA_ERR_RECORD_CHANGED; /* Record have changed */ + DBUG_RETURN(1); + } + } + DBUG_RETURN(0); +} + + +int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def, + const uchar *record, my_off_t pos) +{ + DBUG_ENTER("_mi_cmp_static_unique"); + + info->rec_cache.seek_not_done=1; /* We have done a seek */ + if (info->s->file_read(info, info->rec_buff, info->s->base.reclength, + pos, MYF(MY_NABP))) + DBUG_RETURN(-1); + DBUG_RETURN(mi_unique_comp(def, record, info->rec_buff, + def->null_are_equal)); +} + + + /* Read a fixed-length-record */ + /* Returns 0 if Ok. */ + /* 1 if record is deleted */ + /* MY_FILE_ERROR on read-error or locking-error */ + +int _mi_read_static_record(register MI_INFO *info, register my_off_t pos, + register uchar *record) +{ + int error; + + if (pos != HA_OFFSET_ERROR) + { + if (info->opt_flag & WRITE_CACHE_USED && + info->rec_cache.pos_in_file <= pos && + flush_io_cache(&info->rec_cache)) + return(-1); + info->rec_cache.seek_not_done=1; /* We have done a seek */ + + error=info->s->file_read(info, record, info->s->base.reclength, + pos,MYF(MY_NABP)) != 0; + fast_mi_writeinfo(info); + if (! error) + { + if (!*record) + { + my_errno=HA_ERR_RECORD_DELETED; + return(1); /* Record is deleted */ + } + info->update|= HA_STATE_AKTIV; /* Record is read */ + return(0); + } + return(-1); /* Error on read */ + } + fast_mi_writeinfo(info); /* No such record */ + return(-1); +} + + + +int _mi_read_rnd_static_record(MI_INFO *info, uchar *buf, + register my_off_t filepos, + my_bool skip_deleted_blocks) +{ + int locked,error,cache_read; + uint cache_length; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("_mi_read_rnd_static_record"); + + cache_read=0; + cache_length=0; + if (info->opt_flag & WRITE_CACHE_USED && + (info->rec_cache.pos_in_file <= filepos || skip_deleted_blocks) && + flush_io_cache(&info->rec_cache)) + DBUG_RETURN(my_errno); + if (info->opt_flag & READ_CACHE_USED) + { /* Cache in use */ + if (filepos == my_b_tell(&info->rec_cache) && + (skip_deleted_blocks || !filepos)) + { + cache_read=1; /* Read record using cache */ + cache_length=(uint) (info->rec_cache.read_end - info->rec_cache.read_pos); + } + else + info->rec_cache.seek_not_done=1; /* Filepos is changed */ + } + locked=0; + if (info->lock_type == F_UNLCK) + { + if (filepos >= info->state->data_file_length) + { /* Test if new records */ + if (_mi_readinfo(info,F_RDLCK,0)) + DBUG_RETURN(my_errno); + locked=1; + } + else + { /* We don't nead new info */ +#ifndef UNSAFE_LOCKING + if ((! cache_read || share->base.reclength > cache_length) && + share->tot_locks == 0) + { /* record not in cache */ + if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, + MYF(MY_SEEK_NOT_DONE) | info->lock_wait)) + DBUG_RETURN(my_errno); + locked=1; + } +#else + info->tmp_lock_type=F_RDLCK; +#endif + } + } + if (filepos >= info->state->data_file_length) + { + DBUG_PRINT("test",("filepos: %ld (%ld) records: %ld del: %ld", + (long) filepos/share->base.reclength, (long) filepos, + (long) info->state->records, (long) info->state->del)); + fast_mi_writeinfo(info); + DBUG_RETURN(my_errno=HA_ERR_END_OF_FILE); + } + info->lastpos= filepos; + info->nextpos= filepos+share->base.pack_reclength; + + if (! cache_read) /* No cacheing */ + { + if ((error=_mi_read_static_record(info,filepos,buf))) + { + if (error > 0) + error=my_errno=HA_ERR_RECORD_DELETED; + else + error=my_errno; + } + DBUG_RETURN(error); + } + + /* Read record with cacheing */ + error=my_b_read(&info->rec_cache,(uchar*) buf,share->base.reclength); + if (info->s->base.pack_reclength != info->s->base.reclength && !error) + { + char tmp[8]; /* Skill fill bytes */ + error=my_b_read(&info->rec_cache,(uchar*) tmp, + info->s->base.pack_reclength - info->s->base.reclength); + } + if (locked) + VOID(_mi_writeinfo(info,0)); /* Unlock keyfile */ + if (!error) + { + if (!buf[0]) + { /* Record is removed */ + DBUG_RETURN(my_errno=HA_ERR_RECORD_DELETED); + } + /* Found and may be updated */ + info->update|= HA_STATE_AKTIV | HA_STATE_KEY_CHANGED; + DBUG_RETURN(0); + } + /* my_errno should be set if rec_cache.error == -1 */ + if (info->rec_cache.error != -1 || my_errno == 0) + my_errno=HA_ERR_WRONG_IN_RECORD; + DBUG_RETURN(my_errno); /* Something wrong (EOF?) */ +} Added: trunk/src/mi_test1.c =================================================================== --- trunk/src/mi_test1.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_test1.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,681 @@ +/* Copyright (C) 2000-2005 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Testing of the basic functions of a MyISAM table */ + +#include "myisam.h" +#include +#include + +#define MAX_REC_LENGTH 1024 + +static void usage(); + +static int rec_pointer_size=0, flags[50]; +static int key_field=FIELD_SKIP_PRESPACE,extra_field=FIELD_SKIP_ENDSPACE; +static int key_type=HA_KEYTYPE_NUM; +static int create_flag=0; + +static uint insert_count, update_count, remove_count; +static uint pack_keys=0, pack_seg=0, key_length; +static uint unique_key=HA_NOSAME; +static my_bool key_cacheing, null_fields, silent, skip_update, opt_unique, + verbose; +static MI_COLUMNDEF recinfo[4]; +static MI_KEYDEF keyinfo[10]; +static HA_KEYSEG keyseg[10]; +static HA_KEYSEG uniqueseg[10]; + +static int run_test(const char *filename); +static void get_options(int argc, char *argv[]); +static void create_key(uchar *key,uint rownr); +static void create_record(uchar *record,uint rownr); +static void update_record(uchar *record); + +int main(int argc,char *argv[]) +{ + MY_INIT(argv[0]); + my_init(); + if (key_cacheing) + init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,IO_SIZE*16,0,0); + get_options(argc,argv); + + exit(run_test("test1")); +} + + +static int run_test(const char *filename) +{ + MI_INFO *file; + int i,j,error,deleted,rec_length,uniques=0; + ha_rows found,row_count; + my_off_t pos; + uchar record[MAX_REC_LENGTH],key[MAX_REC_LENGTH],read_record[MAX_REC_LENGTH]; + MI_UNIQUEDEF uniquedef; + MI_CREATE_INFO create_info; + + bzero((char*) recinfo,sizeof(recinfo)); + + /* First define 2 columns */ + recinfo[0].type=FIELD_NORMAL; recinfo[0].length=1; /* For NULL bits */ + recinfo[1].type=key_field; + recinfo[1].length= (key_field == FIELD_BLOB ? 4+mi_portable_sizeof_char_ptr : + key_length); + if (key_field == FIELD_VARCHAR) + recinfo[1].length+= HA_VARCHAR_PACKLENGTH(key_length);; + recinfo[2].type=extra_field; + recinfo[2].length= (extra_field == FIELD_BLOB ? 4 + mi_portable_sizeof_char_ptr : 24); + if (extra_field == FIELD_VARCHAR) + recinfo[2].length+= HA_VARCHAR_PACKLENGTH(recinfo[2].length); + if (opt_unique) + { + recinfo[3].type=FIELD_CHECK; + recinfo[3].length=MI_UNIQUE_HASH_LENGTH; + } + rec_length=recinfo[0].length+recinfo[1].length+recinfo[2].length+ + recinfo[3].length; + + if (key_type == HA_KEYTYPE_VARTEXT1 && + key_length > 255) + key_type= HA_KEYTYPE_VARTEXT2; + + /* Define a key over the first column */ + keyinfo[0].seg=keyseg; + keyinfo[0].keysegs=1; + keyinfo[0].block_length= 0; /* Default block length */ + keyinfo[0].key_alg=HA_KEY_ALG_BTREE; + keyinfo[0].seg[0].type= key_type; + keyinfo[0].seg[0].flag= pack_seg; + keyinfo[0].seg[0].start=1; + keyinfo[0].seg[0].length=key_length; + keyinfo[0].seg[0].null_bit= null_fields ? 2 : 0; + keyinfo[0].seg[0].null_pos=0; + keyinfo[0].seg[0].language= default_charset_info->number; + if (pack_seg & HA_BLOB_PART) + { + keyinfo[0].seg[0].bit_start=4; /* Length of blob length */ + } + keyinfo[0].flag = (uint8) (pack_keys | unique_key); + + bzero((uchar*) flags,sizeof(flags)); + if (opt_unique) + { + uint start; + uniques=1; + bzero((char*) &uniquedef,sizeof(uniquedef)); + bzero((char*) uniqueseg,sizeof(uniqueseg)); + uniquedef.seg=uniqueseg; + uniquedef.keysegs=2; + + /* Make a unique over all columns (except first NULL fields) */ + for (i=0, start=1 ; i < 2 ; i++) + { + uniqueseg[i].start=start; + start+=recinfo[i+1].length; + uniqueseg[i].length=recinfo[i+1].length; + uniqueseg[i].language= default_charset_info->number; + } + uniqueseg[0].type= key_type; + uniqueseg[0].null_bit= null_fields ? 2 : 0; + uniqueseg[1].type= HA_KEYTYPE_TEXT; + if (extra_field == FIELD_BLOB) + { + uniqueseg[1].length=0; /* The whole blob */ + uniqueseg[1].bit_start=4; /* long blob */ + uniqueseg[1].flag|= HA_BLOB_PART; + } + else if (extra_field == FIELD_VARCHAR) + uniqueseg[1].flag|= HA_VAR_LENGTH_PART; + } + else + uniques=0; + + if (!silent) + printf("- Creating isam-file\n"); + bzero((char*) &create_info,sizeof(create_info)); + create_info.max_rows=(ulong) (rec_pointer_size ? + (1L << (rec_pointer_size*8))/40 : + 0); + if (mi_create(filename,1,keyinfo,3+opt_unique,recinfo, + uniques, &uniquedef, &create_info, + create_flag)) + goto err; + if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED))) + goto err; + if (!silent) + printf("- Writing key:s\n"); + + my_errno=0; + row_count=deleted=0; + for (i=49 ; i>=1 ; i-=2 ) + { + if (insert_count-- == 0) { VOID(mi_close(file)) ; exit(0) ; } + j=i%25 +1; + create_record(record,j); + error=mi_write(file,record); + if (!error) + row_count++; + flags[j]=1; + if (verbose || error) + printf("J= %2d mi_write: %d errno: %d\n", j,error,my_errno); + } + + /* Insert 2 rows with null values */ + if (null_fields) + { + create_record(record,0); + error=mi_write(file,record); + if (!error) + row_count++; + if (verbose || error) + printf("J= NULL mi_write: %d errno: %d\n", error,my_errno); + error=mi_write(file,record); + if (!error) + row_count++; + if (verbose || error) + printf("J= NULL mi_write: %d errno: %d\n", error,my_errno); + flags[0]=2; + } + + if (!skip_update) + { + if (opt_unique) + { + if (!silent) + printf("- Checking unique constraint\n"); + create_record(record,j); + if (!mi_write(file,record) || my_errno != HA_ERR_FOUND_DUPP_UNIQUE) + { + printf("unique check failed\n"); + } + } + if (!silent) + printf("- Updating rows\n"); + + /* Update first last row to force extend of file */ + if (mi_rsame(file,read_record,-1)) + { + printf("Can't find last row with mi_rsame\n"); + } + else + { + memcpy(record,read_record,rec_length); + update_record(record); + if (mi_update(file,read_record,record)) + { + printf("Can't update last row: %.*s\n", + keyinfo[0].seg[0].length,read_record+1); + } + } + + /* Read through all rows and update them */ + pos=(my_off_t) 0; + found=0; + while ((error=mi_rrnd(file,read_record,pos)) == 0) + { + if (update_count-- == 0) { VOID(mi_close(file)) ; exit(0) ; } + memcpy(record,read_record,rec_length); + update_record(record); + if (mi_update(file,read_record,record)) + { + printf("Can't update row: %.*s, error: %d\n", + keyinfo[0].seg[0].length,record+1,my_errno); + } + found++; + pos=HA_OFFSET_ERROR; + } + if (found != row_count) + printf("Found %ld of %ld rows\n", (ulong) found, (ulong) row_count); + } + + if (!silent) + printf("- Reopening file\n"); + if (mi_close(file)) goto err; + if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED))) goto err; + if (!skip_update) + { + if (!silent) + printf("- Removing keys\n"); + + for (i=0 ; i <= 10 ; i++) + { + /* testing */ + if (remove_count-- == 0) { VOID(mi_close(file)) ; exit(0) ; } + j=i*2; + if (!flags[j]) + continue; + create_key(key,j); + my_errno=0; + if ((error = mi_rkey(file,read_record,0,key,HA_WHOLE_KEY, + HA_READ_KEY_EXACT))) + { + if (verbose || (flags[j] >= 1 || + (error && my_errno != HA_ERR_KEY_NOT_FOUND))) + printf("key: '%.*s' mi_rkey: %3d errno: %3d\n", + (int) key_length,key+test(null_fields),error,my_errno); + } + else + { + error=mi_delete(file,read_record); + if (verbose || error) + printf("key: '%.*s' mi_delete: %3d errno: %3d\n", + (int) key_length, key+test(null_fields), error, my_errno); + if (! error) + { + deleted++; + flags[j]--; + } + } + } + } + if (!silent) + printf("- Reading rows with key\n"); + for (i=0 ; i <= 25 ; i++) + { + create_key(key,i); + my_errno=0; + error=mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT); + if (verbose || + (error == 0 && flags[i] == 0 && unique_key) || + (error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND))) + { + printf("key: '%.*s' mi_rkey: %3d errno: %3d record: %s\n", + (int) key_length,key+test(null_fields),error,my_errno,record+1); + } + } + + if (!silent) + printf("- Reading rows with position\n"); + for (i=1,found=0 ; i <= 30 ; i++) + { + my_errno=0; + if ((error=mi_rrnd(file,read_record,i == 1 ? 0L : HA_OFFSET_ERROR)) == -1) + { + if (found != row_count-deleted) + printf("Found only %ld of %ld rows\n", (ulong) found, + (ulong) (row_count - deleted)); + break; + } + if (!error) + found++; + if (verbose || (error != 0 && error != HA_ERR_RECORD_DELETED && + error != HA_ERR_END_OF_FILE)) + { + printf("pos: %2d mi_rrnd: %3d errno: %3d record: %s\n", + i-1,error,my_errno,read_record+1); + } + } + if (mi_close(file)) goto err; + my_end(MY_CHECK_ERROR); + + return (0); +err: + printf("got error: %3d when using myisam-database\n",my_errno); + return 1; /* skip warning */ +} + + +static void create_key_part(uchar *key,uint rownr) +{ + if (!unique_key) + rownr&=7; /* Some identical keys */ + if (keyinfo[0].seg[0].type == HA_KEYTYPE_NUM) + { + sprintf((char*) key,"%*d",keyinfo[0].seg[0].length,rownr); + } + else if (keyinfo[0].seg[0].type == HA_KEYTYPE_VARTEXT1 || + keyinfo[0].seg[0].type == HA_KEYTYPE_VARTEXT2) + { /* Alpha record */ + /* Create a key that may be easily packed */ + bfill(key,keyinfo[0].seg[0].length,rownr < 10 ? 'A' : 'B'); + sprintf((char*) key+keyinfo[0].seg[0].length-2,"%-2d",rownr); + if ((rownr & 7) == 0) + { + /* Change the key to force a unpack of the next key */ + bfill(key+3,keyinfo[0].seg[0].length-4,rownr < 10 ? 'a' : 'b'); + } + } + else + { /* Alpha record */ + if (keyinfo[0].seg[0].flag & HA_SPACE_PACK) + sprintf((char*) key,"%-*d",keyinfo[0].seg[0].length,rownr); + else + { + /* Create a key that may be easily packed */ + bfill(key,keyinfo[0].seg[0].length,rownr < 10 ? 'A' : 'B'); + sprintf((char*) key+keyinfo[0].seg[0].length-2,"%-2d",rownr); + if ((rownr & 7) == 0) + { + /* Change the key to force a unpack of the next key */ + key[1]= (rownr < 10 ? 'a' : 'b'); + } + } + } +} + + +static void create_key(uchar *key,uint rownr) +{ + if (keyinfo[0].seg[0].null_bit) + { + if (rownr == 0) + { + key[0]=1; /* null key */ + key[1]=0; /* Fore easy print of key */ + return; + } + *key++=0; + } + if (keyinfo[0].seg[0].flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART)) + { + uint tmp; + create_key_part(key+2,rownr); + tmp=strlen((char*) key+2); + int2store(key,tmp); + } + else + create_key_part(key,rownr); +} + + +static uchar blob_key[MAX_REC_LENGTH]; +static uchar blob_record[MAX_REC_LENGTH+20*20]; + + +static void create_record(uchar *record,uint rownr) +{ + uchar *pos; + bzero((char*) record,MAX_REC_LENGTH); + record[0]=1; /* delete marker */ + if (rownr == 0 && keyinfo[0].seg[0].null_bit) + record[0]|=keyinfo[0].seg[0].null_bit; /* Null key */ + + pos=record+1; + if (recinfo[1].type == FIELD_BLOB) + { + uint tmp; + uchar *ptr; + create_key_part(blob_key,rownr); + tmp=strlen((char*) blob_key); + int4store(pos,tmp); + ptr=blob_key; + memcpy_fixed(pos+4,&ptr,sizeof(char*)); + pos+=recinfo[1].length; + } + else if (recinfo[1].type == FIELD_VARCHAR) + { + uint tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); + create_key_part(pos+pack_length,rownr); + tmp= strlen((char*) pos+pack_length); + if (pack_length == 1) + *(uchar*) pos= (uchar) tmp; + else + int2store(pos,tmp); + pos+= recinfo[1].length; + } + else + { + create_key_part(pos,rownr); + pos+=recinfo[1].length; + } + if (recinfo[2].type == FIELD_BLOB) + { + uint tmp; + uchar *ptr;; + sprintf((char*) blob_record,"... row: %d", rownr); + strappend((char*) blob_record,max(MAX_REC_LENGTH-rownr,10),' '); + tmp=strlen((char*) blob_record); + int4store(pos,tmp); + ptr=blob_record; + memcpy_fixed(pos+4,&ptr,sizeof(char*)); + } + else if (recinfo[2].type == FIELD_VARCHAR) + { + uint tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); + sprintf((char*) pos+pack_length, "... row: %d", rownr); + tmp= strlen((char*) pos+pack_length); + if (pack_length == 1) + *pos= (uchar) tmp; + else + int2store(pos,tmp); + } + else + { + sprintf((char*) pos,"... row: %d", rownr); + strappend((char*) pos,recinfo[2].length,' '); + } +} + +/* change row to test re-packing of rows and reallocation of keys */ + +static void update_record(uchar *record) +{ + uchar *pos=record+1; + if (recinfo[1].type == FIELD_BLOB) + { + uchar *column,*ptr; + int length; + length=uint4korr(pos); /* Long blob */ + memcpy_fixed(&column,pos+4,sizeof(char*)); + memcpy(blob_key,column,length); /* Move old key */ + ptr=blob_key; + memcpy_fixed(pos+4,&ptr,sizeof(char*)); /* Store pointer to new key */ + if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM) + default_charset_info->cset->casedn(default_charset_info, + (char*) blob_key, length, + (char*) blob_key, length); + pos+=recinfo[1].length; + } + else if (recinfo[1].type == FIELD_VARCHAR) + { + uint pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); + uint length= pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos); + default_charset_info->cset->casedn(default_charset_info, + (char*) pos + pack_length, length, + (char*) pos + pack_length, length); + pos+=recinfo[1].length; + } + else + { + if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM) + default_charset_info->cset->casedn(default_charset_info, + (char*) pos, keyinfo[0].seg[0].length, + (char*) pos, keyinfo[0].seg[0].length); + pos+=recinfo[1].length; + } + + if (recinfo[2].type == FIELD_BLOB) + { + uchar *column; + int length; + length=uint4korr(pos); + memcpy_fixed(&column,pos+4,sizeof(char*)); + memcpy(blob_record,column,length); + bfill(blob_record+length,20,'.'); /* Make it larger */ + length+=20; + int4store(pos,length); + column= blob_record; + memcpy_fixed(pos+4,&column,sizeof(char*)); + } + else if (recinfo[2].type == FIELD_VARCHAR) + { + /* Second field is longer than 10 characters */ + uint pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); + uint length= pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos); + bfill(pos+pack_length+length,recinfo[2].length-length-pack_length,'.'); + length=recinfo[2].length-pack_length; + if (pack_length == 1) + *(uchar*) pos= (uchar) length; + else + int2store(pos,length); + } + else + { + bfill(pos+recinfo[2].length-10,10,'.'); + } +} + + +static struct my_option my_long_options[] = +{ + {"checksum", 'c', "Undocumented", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifndef DBUG_OFF + {"debug", '#', "Undocumented", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif + {"delete_rows", 'd', "Undocumented", (uchar**) &remove_count, + (uchar**) &remove_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, + {"help", '?', "Display help and exit", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"insert_rows", 'i', "Undocumented", (uchar**) &insert_count, + (uchar**) &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, + {"key_alpha", 'a', "Use a key of type HA_KEYTYPE_TEXT", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"key_binary_pack", 'B', "Undocumented", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"key_blob", 'b', "Undocumented", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"key_cache", 'K', "Undocumented", (uchar**) &key_cacheing, + (uchar**) &key_cacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"key_length", 'k', "Undocumented", (uchar**) &key_length, (uchar**) &key_length, + 0, GET_UINT, REQUIRED_ARG, 6, 0, 0, 0, 0, 0}, + {"key_multiple", 'm', "Undocumented", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"key_prefix_pack", 'P', "Undocumented", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"key_space_pack", 'p', "Undocumented", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"key_varchar", 'w', "Test VARCHAR keys", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"null_fields", 'N', "Define fields with NULL", + (uchar**) &null_fields, (uchar**) &null_fields, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, + {"row_fixed_size", 'S', "Undocumented", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"row_pointer_size", 'R', "Undocumented", (uchar**) &rec_pointer_size, + (uchar**) &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"silent", 's', "Undocumented", + (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"skip_update", 'U', "Undocumented", (uchar**) &skip_update, + (uchar**) &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"unique", 'C', "Undocumented", (uchar**) &opt_unique, (uchar**) &opt_unique, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"update_rows", 'u', "Undocumented", (uchar**) &update_count, + (uchar**) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Be more verbose", (uchar**) &verbose, (uchar**) &verbose, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"version", 'V', "Print version number and exit", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + + +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument __attribute__((unused))) +{ + switch(optid) { + case 'a': + key_type= HA_KEYTYPE_TEXT; + break; + case 'c': + create_flag|= HA_CREATE_CHECKSUM; + break; + case 'R': /* Length of record pointer */ + if (rec_pointer_size > 3) + rec_pointer_size=0; + break; + case 'P': + pack_keys= HA_PACK_KEY; /* Use prefix compression */ + break; + case 'B': + pack_keys= HA_BINARY_PACK_KEY; /* Use binary compression */ + break; + case 'S': + if (key_field == FIELD_VARCHAR) + { + create_flag=0; /* Static sized varchar */ + } + else if (key_field != FIELD_BLOB) + { + key_field=FIELD_NORMAL; /* static-size record */ + extra_field=FIELD_NORMAL; + } + break; + case 'p': + pack_keys=HA_PACK_KEY; /* Use prefix + space packing */ + pack_seg=HA_SPACE_PACK; + key_type=HA_KEYTYPE_TEXT; + break; + case 'm': + unique_key=0; + break; + case 'b': + key_field=FIELD_BLOB; /* blob key */ + extra_field= FIELD_BLOB; + pack_seg|= HA_BLOB_PART; + key_type= HA_KEYTYPE_VARTEXT1; + break; + case 'k': + if (key_length < 4 || key_length > MI_MAX_KEY_LENGTH) + { + fprintf(stderr,"Wrong key length\n"); + exit(1); + } + break; + case 'w': + key_field=FIELD_VARCHAR; /* varchar keys */ + extra_field= FIELD_VARCHAR; + key_type= HA_KEYTYPE_VARTEXT1; + pack_seg|= HA_VAR_LENGTH_PART; + create_flag|= HA_PACK_RECORD; + break; + case 'K': /* Use key cacheing */ + key_cacheing=1; + break; + case 'V': + printf("test1 Ver 1.2 \n"); + exit(0); + case '#': + DBUG_PUSH (argument); + break; + case '?': + usage(); + exit(1); + } + return 0; +} + + +/* Read options */ + +static void get_options(int argc, char *argv[]) +{ + int ho_error; + + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + exit(ho_error); + + return; +} /* get options */ + + +static void usage() +{ + printf("Usage: %s [options]\n\n", my_progname); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} Added: trunk/src/mi_test2.c =================================================================== --- trunk/src/mi_test2.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_test2.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1056 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Test av isam-databas: stor test */ + +#ifndef USE_MY_FUNC /* We want to be able to dbug this !! */ +#define USE_MY_FUNC +#endif +#ifdef DBUG_OFF +#undef DBUG_OFF +#endif +#ifndef SAFEMALLOC +#define SAFEMALLOC +#endif +#include "myisamdef.h" +#include + +#define STANDARD_LENGTH 37 +#define MYISAM_KEYS 6 +#define MAX_PARTS 4 +#if !defined(MSDOS) && !defined(labs) +#define labs(a) abs(a) +#endif + +static void get_options(int argc, char *argv[]); +static uint rnd(uint max_value); +static void fix_length(uchar *record,uint length); +static void put_blob_in_record(uchar *blob_pos,char **blob_buffer); +static void copy_key(struct st_myisam_info *info,uint inx, + uchar *record,uchar *key); + +static int verbose=0,testflag=0, + first_key=0,async_io=0,key_cacheing=0,write_cacheing=0,locking=0, + rec_pointer_size=0,pack_fields=1,use_log=0,silent=0, + opt_quick_mode=0; +static int pack_seg=HA_SPACE_PACK,pack_type=HA_PACK_KEY,remove_count=-1, + create_flag=0; +static ulong key_cache_size=IO_SIZE*16; +static uint key_cache_block_size= KEY_CACHE_BLOCK_SIZE; + +static uint keys=MYISAM_KEYS,recant=1000; +static uint use_blob=0; +static uint16 key1[1001],key3[5000]; +static uchar record[300],record2[300],key[100],key2[100]; +static uchar read_record[300],read_record2[300],read_record3[300]; +static HA_KEYSEG glob_keyseg[MYISAM_KEYS][MAX_PARTS]; + + /* Test program */ + +int main(int argc, char *argv[]) +{ + uint i; + int j,n1,n2,n3,error,k; + uint write_count,update,dupp_keys,opt_delete,start,length,blob_pos, + reclength,ant,found_parts; + my_off_t lastpos; + ha_rows range_records,records; + MI_INFO *file; + MI_KEYDEF keyinfo[10]; + MI_COLUMNDEF recinfo[10]; + MI_ISAMINFO info; + const char *filename; + char *blob_buffer; + MI_CREATE_INFO create_info; + MY_INIT(argv[0]); + + filename= "test2"; + get_options(argc,argv); + if (! async_io) + my_disable_async_io=1; + + reclength=STANDARD_LENGTH+60+(use_blob ? 8 : 0); + blob_pos=STANDARD_LENGTH+60; + keyinfo[0].seg= &glob_keyseg[0][0]; + keyinfo[0].seg[0].start=0; + keyinfo[0].seg[0].length=6; + keyinfo[0].seg[0].type=HA_KEYTYPE_TEXT; + keyinfo[0].seg[0].language= default_charset_info->number; + keyinfo[0].seg[0].flag=(uint8) pack_seg; + keyinfo[0].seg[0].null_bit=0; + keyinfo[0].seg[0].null_pos=0; + keyinfo[0].key_alg=HA_KEY_ALG_BTREE; + keyinfo[0].keysegs=1; + keyinfo[0].flag = pack_type; + keyinfo[0].block_length= 0; /* Default block length */ + keyinfo[1].seg= &glob_keyseg[1][0]; + keyinfo[1].seg[0].start=7; + keyinfo[1].seg[0].length=6; + keyinfo[1].seg[0].type=HA_KEYTYPE_BINARY; + keyinfo[1].seg[0].flag=0; + keyinfo[1].seg[0].null_bit=0; + keyinfo[1].seg[0].null_pos=0; + keyinfo[1].seg[1].start=0; /* two part key */ + keyinfo[1].seg[1].length=6; + keyinfo[1].seg[1].type=HA_KEYTYPE_NUM; + keyinfo[1].seg[1].flag=HA_REVERSE_SORT; + keyinfo[1].seg[1].null_bit=0; + keyinfo[1].seg[1].null_pos=0; + keyinfo[1].key_alg=HA_KEY_ALG_BTREE; + keyinfo[1].keysegs=2; + keyinfo[1].flag =0; + keyinfo[1].block_length= MI_MIN_KEY_BLOCK_LENGTH; /* Diff blocklength */ + keyinfo[2].seg= &glob_keyseg[2][0]; + keyinfo[2].seg[0].start=12; + keyinfo[2].seg[0].length=8; + keyinfo[2].seg[0].type=HA_KEYTYPE_BINARY; + keyinfo[2].seg[0].flag=HA_REVERSE_SORT; + keyinfo[2].seg[0].null_bit=0; + keyinfo[2].seg[0].null_pos=0; + keyinfo[2].key_alg=HA_KEY_ALG_BTREE; + keyinfo[2].keysegs=1; + keyinfo[2].flag =HA_NOSAME; + keyinfo[2].block_length= 0; /* Default block length */ + keyinfo[3].seg= &glob_keyseg[3][0]; + keyinfo[3].seg[0].start=0; + keyinfo[3].seg[0].length=reclength-(use_blob ? 8 : 0); + keyinfo[3].seg[0].type=HA_KEYTYPE_TEXT; + keyinfo[3].seg[0].language=default_charset_info->number; + keyinfo[3].seg[0].flag=(uint8) pack_seg; + keyinfo[3].seg[0].null_bit=0; + keyinfo[3].seg[0].null_pos=0; + keyinfo[3].key_alg=HA_KEY_ALG_BTREE; + keyinfo[3].keysegs=1; + keyinfo[3].flag = pack_type; + keyinfo[3].block_length= 0; /* Default block length */ + keyinfo[4].seg= &glob_keyseg[4][0]; + keyinfo[4].seg[0].start=0; + keyinfo[4].seg[0].length=5; + keyinfo[4].seg[0].type=HA_KEYTYPE_TEXT; + keyinfo[4].seg[0].language=default_charset_info->number; + keyinfo[4].seg[0].flag=0; + keyinfo[4].seg[0].null_bit=0; + keyinfo[4].seg[0].null_pos=0; + keyinfo[4].key_alg=HA_KEY_ALG_BTREE; + keyinfo[4].keysegs=1; + keyinfo[4].flag = pack_type; + keyinfo[4].block_length= 0; /* Default block length */ + keyinfo[5].seg= &glob_keyseg[5][0]; + keyinfo[5].seg[0].start=0; + keyinfo[5].seg[0].length=4; + keyinfo[5].seg[0].type=HA_KEYTYPE_TEXT; + keyinfo[5].seg[0].language=default_charset_info->number; + keyinfo[5].seg[0].flag=pack_seg; + keyinfo[5].seg[0].null_bit=0; + keyinfo[5].seg[0].null_pos=0; + keyinfo[5].key_alg=HA_KEY_ALG_BTREE; + keyinfo[5].keysegs=1; + keyinfo[5].flag = pack_type; + keyinfo[5].block_length= 0; /* Default block length */ + + recinfo[0].type=pack_fields ? FIELD_SKIP_PRESPACE : 0; + recinfo[0].length=7; + recinfo[0].null_bit=0; + recinfo[0].null_pos=0; + recinfo[1].type=pack_fields ? FIELD_SKIP_PRESPACE : 0; + recinfo[1].length=5; + recinfo[1].null_bit=0; + recinfo[1].null_pos=0; + recinfo[2].type=pack_fields ? FIELD_SKIP_PRESPACE : 0; + recinfo[2].length=9; + recinfo[2].null_bit=0; + recinfo[2].null_pos=0; + recinfo[3].type=FIELD_NORMAL; + recinfo[3].length=STANDARD_LENGTH-7-5-9-4; + recinfo[3].null_bit=0; + recinfo[3].null_pos=0; + recinfo[4].type=pack_fields ? FIELD_SKIP_ZERO : 0; + recinfo[4].length=4; + recinfo[4].null_bit=0; + recinfo[4].null_pos=0; + recinfo[5].type=pack_fields ? FIELD_SKIP_ENDSPACE : 0; + recinfo[5].length=60; + recinfo[5].null_bit=0; + recinfo[5].null_pos=0; + if (use_blob) + { + recinfo[6].type=FIELD_BLOB; + recinfo[6].length=4+mi_portable_sizeof_char_ptr; + recinfo[6].null_bit=0; + recinfo[6].null_pos=0; + } + + write_count=update=dupp_keys=opt_delete=0; + blob_buffer=0; + + for (i=1000 ; i>0 ; i--) key1[i]=0; + for (i=4999 ; i>0 ; i--) key3[i]=0; + + if (!silent) + printf("- Creating isam-file\n"); + /* DBUG_PUSH(""); */ + /* my_delete(filename,MYF(0)); */ /* Remove old locks under gdb */ + file= 0; + bzero((char*) &create_info,sizeof(create_info)); + create_info.max_rows=(ha_rows) (rec_pointer_size ? + (1L << (rec_pointer_size*8))/ + reclength : 0); + create_info.reloc_rows=(ha_rows) 100; + if (mi_create(filename,keys,&keyinfo[first_key], + use_blob ? 7 : 6, &recinfo[0], + 0,(MI_UNIQUEDEF*) 0, + &create_info,create_flag)) + goto err; + if (use_log) + mi_log(1); + if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED))) + goto err; + if (!silent) + printf("- Writing key:s\n"); + if (key_cacheing) + init_key_cache(dflt_key_cache,key_cache_block_size,key_cache_size,0,0); + if (locking) + mi_lock_database(file,F_WRLCK); + if (write_cacheing) + mi_extra(file,HA_EXTRA_WRITE_CACHE,0); + if (opt_quick_mode) + mi_extra(file,HA_EXTRA_QUICK,0); + + for (i=0 ; i < recant ; i++) + { + n1=rnd(1000); n2=rnd(100); n3=rnd(5000); + sprintf((char*) record,"%6d:%4d:%8d:Pos: %4d ",n1,n2,n3,write_count); + int4store(record+STANDARD_LENGTH-4,(long) i); + fix_length(record,(uint) STANDARD_LENGTH+rnd(60)); + put_blob_in_record(record+blob_pos,&blob_buffer); + DBUG_PRINT("test",("record: %d",i)); + + if (mi_write(file,record)) + { + if (my_errno != HA_ERR_FOUND_DUPP_KEY || key3[n3] == 0) + { + printf("Error: %d in write at record: %d\n",my_errno,i); + goto err; + } + if (verbose) printf(" Double key: %d\n",n3); + } + else + { + if (key3[n3] == 1 && first_key <3 && first_key+keys >= 3) + { + printf("Error: Didn't get error when writing second key: '%8d'\n",n3); + goto err; + } + write_count++; key1[n1]++; key3[n3]=1; + } + + /* Check if we can find key without flushing database */ + if (i == recant/2) + { + for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ; + if (!j) + for (j=999 ; j>0 && key1[j] == 0 ; j--) ; + sprintf((char*) key,"%6d",j); + if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) + { + printf("Test in loop: Can't find key: \"%s\"\n",key); + goto err; + } + } + } + if (testflag==1) goto end; + + if (write_cacheing) + { + if (mi_extra(file,HA_EXTRA_NO_CACHE,0)) + { + puts("got error from mi_extra(HA_EXTRA_NO_CACHE)"); + goto end; + } + } + if (key_cacheing) + resize_key_cache(dflt_key_cache,key_cache_block_size,key_cache_size*2,0,0); + + if (!silent) + printf("- Delete\n"); + for (i=0 ; i0 && key1[j] == 0 ; j--) ; + if (j != 0) + { + sprintf((char*) key,"%6d",j); + if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) + { + printf("can't find key1: \"%s\"\n",key); + goto err; + } + if (opt_delete == (uint) remove_count) /* While testing */ + goto end; + if (mi_delete(file,read_record)) + { + printf("error: %d; can't delete record: \"%s\"\n", my_errno,read_record); + goto err; + } + opt_delete++; + key1[atoi((char*) read_record+keyinfo[0].seg[0].start)]--; + key3[atoi((char*) read_record+keyinfo[2].seg[0].start)]=0; + } + else + puts("Warning: Skipping delete test because no dupplicate keys"); + } + if (testflag==2) goto end; + + if (!silent) + printf("- Update\n"); + for (i=0 ; i0 && key1[j] == 0 ; j--) ; + if (j != 0) + { + sprintf((char*) key,"%6d",j); + if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) + { + printf("can't find key1: \"%s\"\n",(char*) key); + goto err; + } + if (use_blob) + { + if (i & 1) + put_blob_in_record(record+blob_pos,&blob_buffer); + else + bmove(record+blob_pos,read_record+blob_pos,8); + } + if (mi_update(file,read_record,record2)) + { + if (my_errno != HA_ERR_FOUND_DUPP_KEY || key3[n3] == 0) + { + printf("error: %d; can't update:\nFrom: \"%s\"\nTo: \"%s\"\n", + my_errno,read_record,record2); + goto err; + } + if (verbose) + printf("Double key when tried to update:\nFrom: \"%s\"\nTo: \"%s\"\n",record,record2); + } + else + { + key1[atoi((char*) read_record+keyinfo[0].seg[0].start)]--; + key3[atoi((char*) read_record+keyinfo[2].seg[0].start)]=0; + key1[n1]++; key3[n3]=1; + update++; + } + } + } + if (testflag == 3) + goto end; + + for (i=999, dupp_keys=j=0 ; i>0 ; i--) + { + if (key1[i] > dupp_keys) + { + dupp_keys=key1[i]; j=i; + } + } + sprintf((char*) key,"%6d",j); + start=keyinfo[0].seg[0].start; + length=keyinfo[0].seg[0].length; + if (dupp_keys) + { + if (!silent) + printf("- Same key: first - next -> last - prev -> first\n"); + DBUG_PRINT("progpos",("first - next -> last - prev -> first")); + if (verbose) printf(" Using key: \"%s\" Keys: %d\n",key,dupp_keys); + + if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) + goto err; + if (mi_rsame(file,read_record2,-1)) + goto err; + if (memcmp(read_record,read_record2,reclength) != 0) + { + printf("mi_rsame didn't find same record\n"); + goto end; + } + info.recpos=mi_position(file); + if (mi_rfirst(file,read_record2,0) || + mi_rsame_with_pos(file,read_record2,0,info.recpos) || + memcmp(read_record,read_record2,reclength) != 0) + { + printf("mi_rsame_with_pos didn't find same record\n"); + goto end; + } + { + int skr=mi_rnext(file,read_record2,0); + if ((skr && my_errno != HA_ERR_END_OF_FILE) || + mi_rprev(file,read_record2,-1) || + memcmp(read_record,read_record2,reclength) != 0) + { + printf("mi_rsame_with_pos lost position\n"); + goto end; + } + } + ant=1; + while (mi_rnext(file,read_record2,0) == 0 && + memcmp(read_record2+start,key,length) == 0) ant++; + if (ant != dupp_keys) + { + printf("next: Found: %d keys of %d\n",ant,dupp_keys); + goto end; + } + ant=0; + while (mi_rprev(file,read_record3,0) == 0 && + bcmp(read_record3+start,key,length) == 0) ant++; + if (ant != dupp_keys) + { + printf("prev: Found: %d records of %d\n",ant,dupp_keys); + goto end; + } + + /* Check of mi_rnext_same */ + if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) + goto err; + ant=1; + while (!mi_rnext_same(file,read_record3) && ant < dupp_keys+10) + ant++; + if (ant != dupp_keys || my_errno != HA_ERR_END_OF_FILE) + { + printf("mi_rnext_same: Found: %d records of %d\n",ant,dupp_keys); + goto end; + } + } + + if (!silent) + printf("- All keys: first - next -> last - prev -> first\n"); + DBUG_PRINT("progpos",("All keys: first - next -> last - prev -> first")); + ant=1; + if (mi_rfirst(file,read_record,0)) + { + printf("Can't find first record\n"); + goto end; + } + while ((error=mi_rnext(file,read_record3,0)) == 0 && ant < write_count+10) + ant++; + if (ant != write_count - opt_delete || error != HA_ERR_END_OF_FILE) + { + printf("next: I found: %d records of %d (error: %d)\n", + ant, write_count - opt_delete, error); + goto end; + } + if (mi_rlast(file,read_record2,0) || + bcmp(read_record2,read_record3,reclength)) + { + printf("Can't find last record\n"); + DBUG_DUMP("record2",(uchar*) read_record2,reclength); + DBUG_DUMP("record3",(uchar*) read_record3,reclength); + goto end; + } + ant=1; + while (mi_rprev(file,read_record3,0) == 0 && ant < write_count+10) + ant++; + if (ant != write_count - opt_delete) + { + printf("prev: I found: %d records of %d\n",ant,write_count); + goto end; + } + if (bcmp(read_record,read_record3,reclength)) + { + printf("Can't find first record\n"); + goto end; + } + + if (!silent) + printf("- Test if: Read first - next - prev - prev - next == first\n"); + DBUG_PRINT("progpos",("- Read first - next - prev - prev - next == first")); + if (mi_rfirst(file,read_record,0) || + mi_rnext(file,read_record3,0) || + mi_rprev(file,read_record3,0) || + mi_rprev(file,read_record3,0) == 0 || + mi_rnext(file,read_record3,0)) + goto err; + if (bcmp(read_record,read_record3,reclength) != 0) + printf("Can't find first record\n"); + + if (!silent) + printf("- Test if: Read last - prev - next - next - prev == last\n"); + DBUG_PRINT("progpos",("Read last - prev - next - next - prev == last")); + if (mi_rlast(file,read_record2,0) || + mi_rprev(file,read_record3,0) || + mi_rnext(file,read_record3,0) || + mi_rnext(file,read_record3,0) == 0 || + mi_rprev(file,read_record3,0)) + goto err; + if (bcmp(read_record2,read_record3,reclength)) + printf("Can't find last record\n"); +#ifdef NOT_ANYMORE + if (!silent) + puts("- Test read key-part"); + strmov(key2,key); + for(i=strlen(key2) ; i-- > 1 ;) + { + key2[i]=0; + + /* The following row is just to catch some bugs in the key code */ + bzero((char*) file->lastkey,file->s->base.max_key_length*2); + if (mi_rkey(file,read_record,0,key2,(uint) i,HA_READ_PREFIX)) + goto err; + if (bcmp(read_record+start,key,(uint) i)) + { + puts("Didn't find right record"); + goto end; + } + } +#endif + if (dupp_keys > 2) + { + if (!silent) + printf("- Read key (first) - next - delete - next -> last\n"); + DBUG_PRINT("progpos",("first - next - delete - next -> last")); + if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) + goto err; + if (mi_rnext(file,read_record3,0)) goto err; + if (mi_delete(file,read_record3)) goto err; + opt_delete++; + ant=1; + while (mi_rnext(file,read_record3,0) == 0 && + bcmp(read_record3+start,key,length) == 0) ant++; + if (ant != dupp_keys-1) + { + printf("next: I can only find: %d keys of %d\n",ant,dupp_keys-1); + goto end; + } + } + if (dupp_keys>4) + { + if (!silent) + printf("- Read last of key - prev - delete - prev -> first\n"); + DBUG_PRINT("progpos",("last - prev - delete - prev -> first")); + if (mi_rprev(file,read_record3,0)) goto err; + if (mi_rprev(file,read_record3,0)) goto err; + if (mi_delete(file,read_record3)) goto err; + opt_delete++; + ant=1; + while (mi_rprev(file,read_record3,0) == 0 && + bcmp(read_record3+start,key,length) == 0) ant++; + if (ant != dupp_keys-2) + { + printf("next: I can only find: %d keys of %d\n",ant,dupp_keys-2); + goto end; + } + } + if (dupp_keys > 6) + { + if (!silent) + printf("- Read first - delete - next -> last\n"); + DBUG_PRINT("progpos",("first - delete - next -> last")); + if (mi_rkey(file,read_record3,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) + goto err; + if (mi_delete(file,read_record3)) goto err; + opt_delete++; + ant=1; + if (mi_rnext(file,read_record,0)) + goto err; /* Skall finnas poster */ + while (mi_rnext(file,read_record3,0) == 0 && + bcmp(read_record3+start,key,length) == 0) ant++; + if (ant != dupp_keys-3) + { + printf("next: I can only find: %d keys of %d\n",ant,dupp_keys-3); + goto end; + } + + if (!silent) + printf("- Read last - delete - prev -> first\n"); + DBUG_PRINT("progpos",("last - delete - prev -> first")); + if (mi_rprev(file,read_record3,0)) goto err; + if (mi_delete(file,read_record3)) goto err; + opt_delete++; + ant=0; + while (mi_rprev(file,read_record3,0) == 0 && + bcmp(read_record3+start,key,length) == 0) ant++; + if (ant != dupp_keys-4) + { + printf("next: I can only find: %d keys of %d\n",ant,dupp_keys-4); + goto end; + } + } + + if (!silent) + puts("- Test if: Read rrnd - same"); + DBUG_PRINT("progpos",("Read rrnd - same")); + for (i=0 ; i < write_count ; i++) + { + if (mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR) == 0) + break; + } + if (i == write_count) + goto err; + + bmove(read_record2,read_record,reclength); + for (i=min(2,keys) ; i-- > 0 ;) + { + if (mi_rsame(file,read_record2,(int) i)) goto err; + if (bcmp(read_record,read_record2,reclength) != 0) + { + printf("is_rsame didn't find same record\n"); + goto end; + } + } + if (!silent) + puts("- Test mi_records_in_range"); + mi_status(file,&info,HA_STATUS_VARIABLE); + for (i=0 ; i < info.keys ; i++) + { + key_range min_key, max_key; + if (mi_rfirst(file,read_record,(int) i) || + mi_rlast(file,read_record2,(int) i)) + goto err; + copy_key(file,(uint) i,(uchar*) read_record,(uchar*) key); + copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2); + min_key.key= key; + min_key.keypart_map= HA_WHOLE_KEY; + min_key.flag= HA_READ_KEY_EXACT; + max_key.key= key2; + max_key.keypart_map= HA_WHOLE_KEY; + max_key.flag= HA_READ_AFTER_KEY; + + range_records= mi_records_in_range(file,(int) i, &min_key, &max_key); + if (range_records < info.records*8/10 || + range_records > info.records*12/10) + { + printf("mi_records_range returned %ld; Should be about %ld\n", + (long) range_records,(long) info.records); + goto end; + } + if (verbose) + { + printf("mi_records_range returned %ld; Exact is %ld (diff: %4.2g %%)\n", + (long) range_records, (long) info.records, + labs((long) range_records - (long) info.records)*100.0/ + info.records); + } + } + for (i=0 ; i < 5 ; i++) + { + for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ; + for (k=rnd(1000)+1 ; k>0 && key1[k] == 0 ; k--) ; + if (j != 0 && k != 0) + { + key_range min_key, max_key; + if (j > k) + swap_variables(int, j, k); + sprintf((char*) key,"%6d",j); + sprintf((char*) key2,"%6d",k); + + min_key.key= key; + min_key.length= USE_WHOLE_KEY; + min_key.flag= HA_READ_AFTER_KEY; + max_key.key= key2; + max_key.length= USE_WHOLE_KEY; + max_key.flag= HA_READ_BEFORE_KEY; + range_records= mi_records_in_range(file, 0, &min_key, &max_key); + records=0; + for (j++ ; j < k ; j++) + records+=key1[j]; + if ((long) range_records < (long) records*7/10-2 || + (long) range_records > (long) records*14/10+2) + { + printf("mi_records_range for key: %d returned %lu; Should be about %lu\n", + i, (ulong) range_records, (ulong) records); + goto end; + } + if (verbose && records) + { + printf("mi_records_range returned %lu; Exact is %lu (diff: %4.2g %%)\n", + (ulong) range_records, (ulong) records, + labs((long) range_records-(long) records)*100.0/records); + + } + } + } + + if (!silent) + printf("- mi_info\n"); + mi_status(file,&info,HA_STATUS_VARIABLE | HA_STATUS_CONST); + if (info.records != write_count-opt_delete || info.deleted > opt_delete + update + || info.keys != keys) + { + puts("Wrong info from mi_info"); + printf("Got: records: %lu delete: %lu i_keys: %d\n", + (ulong) info.records, (ulong) info.deleted, info.keys); + } + if (verbose) + { + char buff[80]; + get_date(buff,3,info.create_time); + printf("info: Created %s\n",buff); + get_date(buff,3,info.check_time); + printf("info: checked %s\n",buff); + get_date(buff,3,info.update_time); + printf("info: Modified %s\n",buff); + } + + mi_panic(HA_PANIC_WRITE); + mi_panic(HA_PANIC_READ); + if (mi_is_changed(file)) + puts("Warning: mi_is_changed reported that datafile was changed"); + + if (!silent) + printf("- mi_extra(CACHE) + mi_rrnd.... + mi_extra(NO_CACHE)\n"); + if (mi_reset(file) || mi_extra(file,HA_EXTRA_CACHE,0)) + { + if (locking || (!use_blob && !pack_fields)) + { + puts("got error from mi_extra(HA_EXTRA_CACHE)"); + goto end; + } + } + ant=0; + while ((error=mi_rrnd(file,record,HA_OFFSET_ERROR)) != HA_ERR_END_OF_FILE && + ant < write_count + 10) + ant+= error ? 0 : 1; + if (ant != write_count-opt_delete) + { + printf("rrnd with cache: I can only find: %d records of %d\n", + ant,write_count-opt_delete); + goto end; + } + if (mi_extra(file,HA_EXTRA_NO_CACHE,0)) + { + puts("got error from mi_extra(HA_EXTRA_NO_CACHE)"); + goto end; + } + + ant=0; + mi_scan_init(file); + while ((error=mi_scan(file,record)) != HA_ERR_END_OF_FILE && + ant < write_count + 10) + ant+= error ? 0 : 1; + if (ant != write_count-opt_delete) + { + printf("scan with cache: I can only find: %d records of %d\n", + ant,write_count-opt_delete); + goto end; + } + + if (testflag == 4) goto end; + + if (!silent) + printf("- Removing keys\n"); + DBUG_PRINT("progpos",("Removing keys")); + lastpos = HA_OFFSET_ERROR; + /* DBUG_POP(); */ + mi_reset(file); + found_parts=0; + while ((error=mi_rrnd(file,read_record,HA_OFFSET_ERROR)) != + HA_ERR_END_OF_FILE) + { + info.recpos=mi_position(file); + if (lastpos >= info.recpos && lastpos != HA_OFFSET_ERROR) + { + printf("mi_rrnd didn't advance filepointer; old: %ld, new: %ld\n", + (long) lastpos, (long) info.recpos); + goto err; + } + lastpos=info.recpos; + if (error == 0) + { + if (opt_delete == (uint) remove_count) /* While testing */ + goto end; + if (mi_rsame(file,read_record,-1)) + { + printf("can't find record %lx\n",(long) info.recpos); + goto err; + } + if (use_blob) + { + ulong blob_length,pos; + uchar *ptr; + longget(blob_length,read_record+blob_pos+4); + ptr=(uchar*) blob_length; + longget(blob_length,read_record+blob_pos); + for (pos=0 ; pos < blob_length ; pos++) + { + if (ptr[pos] != (uchar) (blob_length+pos)) + { + printf("found blob with wrong info at %ld\n",(long) lastpos); + use_blob=0; + break; + } + } + } + if (mi_delete(file,read_record)) + { + printf("can't delete record: %6.6s, delete_count: %d\n", + read_record, opt_delete); + goto err; + } + opt_delete++; + } + else + found_parts++; + } + if (my_errno != HA_ERR_END_OF_FILE && my_errno != HA_ERR_RECORD_DELETED) + printf("error: %d from mi_rrnd\n",my_errno); + if (write_count != opt_delete) + { + printf("Deleted only %d of %d records (%d parts)\n",opt_delete,write_count, + found_parts); + goto err; + } +end: + if (mi_close(file)) + goto err; + mi_panic(HA_PANIC_CLOSE); /* Should close log */ + if (!silent) + { + printf("\nFollowing test have been made:\n"); + printf("Write records: %d\nUpdate records: %d\nSame-key-read: %d\nDelete records: %d\n", write_count,update,dupp_keys,opt_delete); + if (rec_pointer_size) + printf("Record pointer size: %d\n",rec_pointer_size); + printf("myisam_block_size: %lu\n", myisam_block_size); + if (key_cacheing) + { + puts("Key cache used"); + printf("key_cache_block_size: %u\n", key_cache_block_size); + if (write_cacheing) + puts("Key cache resized"); + } + if (write_cacheing) + puts("Write cacheing used"); + if (write_cacheing) + puts("quick mode"); + if (async_io && locking) + puts("Asyncron io with locking used"); + else if (locking) + puts("Locking used"); + if (use_blob) + puts("blobs used"); + printf("key cache status: \n\ +blocks used:%10lu\n\ +not flushed:%10lu\n\ +w_requests: %10lu\n\ +writes: %10lu\n\ +r_requests: %10lu\n\ +reads: %10lu\n", + dflt_key_cache->blocks_used, + dflt_key_cache->global_blocks_changed, + (ulong) dflt_key_cache->global_cache_w_requests, + (ulong) dflt_key_cache->global_cache_write, + (ulong) dflt_key_cache->global_cache_r_requests, + (ulong) dflt_key_cache->global_cache_read); + } + end_key_cache(dflt_key_cache,1); + if (blob_buffer) + my_free(blob_buffer,MYF(0)); + my_end(silent ? MY_CHECK_ERROR : MY_CHECK_ERROR | MY_GIVE_INFO); + return(0); +err: + printf("got error: %d when using MyISAM-database\n",my_errno); + if (file) + VOID(mi_close(file)); + return(1); +} /* main */ + + + /* l{ser optioner */ + /* OBS! intierar endast DEBUG - ingen debuggning h{r ! */ + +static void get_options(int argc, char **argv) +{ + char *pos,*progname; + + progname= argv[0]; + + while (--argc >0 && *(pos = *(++argv)) == '-' ) { + switch(*++pos) { + case 'B': + pack_type= HA_BINARY_PACK_KEY; + break; + case 'b': + use_blob=1; + break; + case 'K': /* Use key cacheing */ + key_cacheing=1; + if (*++pos) + key_cache_size=atol(pos); + break; + case 'W': /* Use write cacheing */ + write_cacheing=1; + if (*++pos) + my_default_record_cache_size=atoi(pos); + break; + case 'd': + remove_count= atoi(++pos); + break; + case 'i': + if (*++pos) + srand(atoi(pos)); + break; + case 'l': + use_log=1; + break; + case 'L': + locking=1; + break; + case 'A': /* use asyncron io */ + async_io=1; + if (*++pos) + my_default_record_cache_size=atoi(pos); + break; + case 'v': /* verbose */ + verbose=1; + break; + case 'm': /* records */ + if ((recant=atoi(++pos)) < 10) + { + fprintf(stderr,"record count must be >= 10\n"); + exit(1); + } + break; + case 'e': /* myisam_block_length */ + if ((myisam_block_size= atoi(++pos)) < MI_MIN_KEY_BLOCK_LENGTH || + myisam_block_size > MI_MAX_KEY_BLOCK_LENGTH) + { + fprintf(stderr,"Wrong myisam_block_length\n"); + exit(1); + } + myisam_block_size= my_round_up_to_next_power(myisam_block_size); + break; + case 'E': /* myisam_block_length */ + if ((key_cache_block_size=atoi(++pos)) < MI_MIN_KEY_BLOCK_LENGTH || + key_cache_block_size > MI_MAX_KEY_BLOCK_LENGTH) + { + fprintf(stderr,"Wrong key_cache_block_size\n"); + exit(1); + } + key_cache_block_size= my_round_up_to_next_power(key_cache_block_size); + break; + case 'f': + if ((first_key=atoi(++pos)) < 0 || first_key >= MYISAM_KEYS) + first_key=0; + break; + case 'k': + if ((keys=(uint) atoi(++pos)) < 1 || + keys > (uint) (MYISAM_KEYS-first_key)) + keys=MYISAM_KEYS-first_key; + break; + case 'P': + pack_type=0; /* Don't use DIFF_LENGTH */ + pack_seg=0; + break; + case 'R': /* Length of record pointer */ + rec_pointer_size=atoi(++pos); + if (rec_pointer_size > 7) + rec_pointer_size=0; + break; + case 'S': + pack_fields=0; /* Static-length-records */ + break; + case 's': + silent=1; + break; + case 't': + testflag=atoi(++pos); /* testmod */ + break; + case 'q': + opt_quick_mode=1; + break; + case 'c': + create_flag|= HA_CREATE_CHECKSUM; + break; + case 'D': + create_flag|=HA_CREATE_DELAY_KEY_WRITE; + break; + case '?': + case 'I': + case 'V': + printf("%s Ver 1.2 for %s at %s\n",progname,SYSTEM_TYPE,MACHINE_TYPE); + puts("By Monty, for your professional use\n"); + printf("Usage: %s [-?AbBcDIKLPRqSsVWltv] [-k#] [-f#] [-m#] [-e#] [-E#] [-t#]\n", + progname); + exit(0); + case '#': + DBUG_PUSH (++pos); + break; + default: + printf("Illegal option: '%c'\n",*pos); + break; + } + } + return; +} /* get options */ + + /* Get a random value 0 <= x <= n */ + +static uint rnd(uint max_value) +{ + return (uint) ((rand() & 32767)/32767.0*max_value); +} /* rnd */ + + + /* Create a variable length record */ + +static void fix_length(uchar *rec, uint length) +{ + bmove(rec+STANDARD_LENGTH, + "0123456789012345678901234567890123456789012345678901234567890", + length-STANDARD_LENGTH); + strfill((char*) rec+length,STANDARD_LENGTH+60-length,' '); +} /* fix_length */ + + + /* Put maybe a blob in record */ + +static void put_blob_in_record(uchar *blob_pos, char **blob_buffer) +{ + ulong i,length; + if (use_blob) + { + if (rnd(10) == 0) + { + if (! *blob_buffer && + !(*blob_buffer=my_malloc((uint) use_blob,MYF(MY_WME)))) + { + use_blob=0; + return; + } + length=rnd(use_blob); + for (i=0 ; i < length ; i++) + (*blob_buffer)[i]=(char) (length+i); + int4store(blob_pos,length); + memcpy_fixed(blob_pos+4,(char*) blob_buffer,sizeof(char*)); + } + else + { + int4store(blob_pos,0); + } + } + return; +} + + +static void copy_key(MI_INFO *info,uint inx,uchar *rec,uchar *key_buff) +{ + HA_KEYSEG *keyseg; + + for (keyseg=info->s->keyinfo[inx].seg ; keyseg->type ; keyseg++) + { + memcpy(key_buff,rec+keyseg->start,(size_t) keyseg->length); + key_buff+=keyseg->length; + } + return; +} Added: trunk/src/mi_test3.c =================================================================== --- trunk/src/mi_test3.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_test3.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,501 @@ +/* Copyright (C) 2000-2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Test av locking */ + +#ifndef __NETWARE__ + +#include "myisam.h" +#include +#ifdef HAVE_SYS_WAIT_H +# include +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + + +#if defined(HAVE_LRAND48) +#define rnd(X) (lrand48() % X) +#define rnd_init(X) srand48(X) +#else +#define rnd(X) (random() % X) +#define rnd_init(X) srandom(X) +#endif + + +const char *filename= "test3"; +uint tests=10,forks=10,key_cacheing=0,use_log=0; + +static void get_options(int argc, char *argv[]); +void start_test(int id); +int test_read(MI_INFO *,int),test_write(MI_INFO *,int,int), + test_update(MI_INFO *,int,int),test_rrnd(MI_INFO *,int); + +struct record { + uchar id[8]; + uchar nr[4]; + uchar text[10]; +} record; + + +int main(int argc,char **argv) +{ + int status,wait_ret; + uint i=0; + MI_KEYDEF keyinfo[10]; + MI_COLUMNDEF recinfo[10]; + HA_KEYSEG keyseg[10][2]; + MY_INIT(argv[0]); + get_options(argc,argv); + + bzero((char*) keyinfo,sizeof(keyinfo)); + bzero((char*) recinfo,sizeof(recinfo)); + bzero((char*) keyseg,sizeof(keyseg)); + keyinfo[0].seg= &keyseg[0][0]; + keyinfo[0].seg[0].start=0; + keyinfo[0].seg[0].length=8; + keyinfo[0].seg[0].type=HA_KEYTYPE_TEXT; + keyinfo[0].seg[0].flag=HA_SPACE_PACK; + keyinfo[0].key_alg=HA_KEY_ALG_BTREE; + keyinfo[0].keysegs=1; + keyinfo[0].flag = (uint8) HA_PACK_KEY; + keyinfo[0].block_length= 0; /* Default block length */ + keyinfo[1].seg= &keyseg[1][0]; + keyinfo[1].seg[0].start=8; + keyinfo[1].seg[0].length=4; /* Long is always 4 in myisam */ + keyinfo[1].seg[0].type=HA_KEYTYPE_LONG_INT; + keyinfo[1].seg[0].flag=0; + keyinfo[1].key_alg=HA_KEY_ALG_BTREE; + keyinfo[1].keysegs=1; + keyinfo[1].flag =HA_NOSAME; + keyinfo[1].block_length= 0; /* Default block length */ + + recinfo[0].type=0; + recinfo[0].length=sizeof(record.id); + recinfo[1].type=0; + recinfo[1].length=sizeof(record.nr); + recinfo[2].type=0; + recinfo[2].length=sizeof(record.text); + + puts("- Creating myisam-file"); + my_delete(filename,MYF(0)); /* Remove old locks under gdb */ + if (mi_create(filename,2,&keyinfo[0],2,&recinfo[0],0,(MI_UNIQUEDEF*) 0, + (MI_CREATE_INFO*) 0,0)) + exit(1); + + rnd_init(0); + printf("- Starting %d processes\n",forks); fflush(stdout); + for (i=0 ; i < forks; i++) + { + if (!fork()) + { + start_test(i+1); + sleep(1); + return 0; + } + VOID(rnd(1)); + } + + for (i=0 ; i < forks ; i++) + while ((wait_ret=wait(&status)) && wait_ret == -1); + return 0; +} + + +static void get_options(int argc, char **argv) +{ + char *pos,*progname; + + progname= argv[0]; + + while (--argc >0 && *(pos = *(++argv)) == '-' ) { + switch(*++pos) { + case 'l': + use_log=1; + break; + case 'f': + forks=atoi(++pos); + break; + case 't': + tests=atoi(++pos); + break; + case 'K': /* Use key cacheing */ + key_cacheing=1; + break; + case 'A': /* All flags */ + use_log=key_cacheing=1; + break; + case '?': + case 'I': + case 'V': + printf("%s Ver 1.0 for %s at %s\n",progname,SYSTEM_TYPE,MACHINE_TYPE); + puts("By Monty, for your professional use\n"); + puts("Test av locking with threads\n"); + printf("Usage: %s [-?lKA] [-f#] [-t#]\n",progname); + exit(0); + case '#': + DBUG_PUSH (++pos); + break; + default: + printf("Illegal option: '%c'\n",*pos); + break; + } + } + return; +} + + +void start_test(int id) +{ + uint i; + int error,lock_type; + MI_ISAMINFO isam_info; + MI_INFO *file,*file1,*file2=0,*lock; + + if (use_log) + mi_log(1); + if (!(file1=mi_open(filename,O_RDWR,HA_OPEN_WAIT_IF_LOCKED)) || + !(file2=mi_open(filename,O_RDWR,HA_OPEN_WAIT_IF_LOCKED))) + { + fprintf(stderr,"Can't open isam-file: %s\n",filename); + exit(1); + } + if (key_cacheing && rnd(2) == 0) + init_key_cache(dflt_key_cache, KEY_CACHE_BLOCK_SIZE, 65536L, 0, 0); + printf("Process %d, pid: %d\n",id,getpid()); fflush(stdout); + + for (error=i=0 ; i < tests && !error; i++) + { + file= (rnd(2) == 1) ? file1 : file2; + lock=0 ; lock_type=0; + if (rnd(10) == 0) + { + if (mi_lock_database(lock=(rnd(2) ? file1 : file2), + lock_type=(rnd(2) == 0 ? F_RDLCK : F_WRLCK))) + { + fprintf(stderr,"%2d: start: Can't lock table %d\n",id,my_errno); + error=1; + break; + } + } + switch (rnd(4)) { + case 0: error=test_read(file,id); break; + case 1: error=test_rrnd(file,id); break; + case 2: error=test_write(file,id,lock_type); break; + case 3: error=test_update(file,id,lock_type); break; + } + if (lock) + mi_lock_database(lock,F_UNLCK); + } + if (!error) + { + mi_status(file1,&isam_info,HA_STATUS_VARIABLE); + printf("%2d: End of test. Records: %ld Deleted: %ld\n", + id,(long) isam_info.records, (long) isam_info.deleted); + fflush(stdout); + } + + mi_close(file1); + mi_close(file2); + if (use_log) + mi_log(0); + if (error) + { + printf("%2d: Aborted\n",id); fflush(stdout); + exit(1); + } +} + + +int test_read(MI_INFO *file,int id) +{ + uint i,lock,found,next,prev; + ulong find; + + lock=0; + if (rnd(2) == 0) + { + lock=1; + if (mi_lock_database(file,F_RDLCK)) + { + fprintf(stderr,"%2d: Can't lock table %d\n",id,my_errno); + return 1; + } + } + + found=next=prev=0; + for (i=0 ; i < 100 ; i++) + { + find=rnd(100000); + if (!mi_rkey(file,record.id,1,(uchar*) &find, HA_WHOLE_KEY, + HA_READ_KEY_EXACT)) + found++; + else + { + if (my_errno != HA_ERR_KEY_NOT_FOUND) + { + fprintf(stderr,"%2d: Got error %d from read in read\n",id,my_errno); + return 1; + } + else if (!mi_rnext(file,record.id,1)) + next++; + else + { + if (my_errno != HA_ERR_END_OF_FILE) + { + fprintf(stderr,"%2d: Got error %d from rnext in read\n",id,my_errno); + return 1; + } + else if (!mi_rprev(file,record.id,1)) + prev++; + else + { + if (my_errno != HA_ERR_END_OF_FILE) + { + fprintf(stderr,"%2d: Got error %d from rnext in read\n", + id,my_errno); + return 1; + } + } + } + } + } + if (lock) + { + if (mi_lock_database(file,F_UNLCK)) + { + fprintf(stderr,"%2d: Can't unlock table\n",id); + return 1; + } + } + printf("%2d: read: found: %5d next: %5d prev: %5d\n", + id,found,next,prev); + fflush(stdout); + return 0; +} + + +int test_rrnd(MI_INFO *file,int id) +{ + uint count,lock; + + lock=0; + if (rnd(2) == 0) + { + lock=1; + if (mi_lock_database(file,F_RDLCK)) + { + fprintf(stderr,"%2d: Can't lock table (%d)\n",id,my_errno); + mi_close(file); + return 1; + } + if (rnd(2) == 0) + mi_extra(file,HA_EXTRA_CACHE,0); + } + + count=0; + if (mi_rrnd(file,record.id,0L)) + { + if (my_errno == HA_ERR_END_OF_FILE) + goto end; + fprintf(stderr,"%2d: Can't read first record (%d)\n",id,my_errno); + return 1; + } + for (count=1 ; !mi_rrnd(file,record.id,HA_OFFSET_ERROR) ;count++) ; + if (my_errno != HA_ERR_END_OF_FILE) + { + fprintf(stderr,"%2d: Got error %d from rrnd\n",id,my_errno); + return 1; + } + +end: + if (lock) + { + mi_extra(file,HA_EXTRA_NO_CACHE,0); + if (mi_lock_database(file,F_UNLCK)) + { + fprintf(stderr,"%2d: Can't unlock table\n",id); + exit(0); + } + } + printf("%2d: rrnd: %5d\n",id,count); fflush(stdout); + return 0; +} + + +int test_write(MI_INFO *file,int id,int lock_type) +{ + uint i,tries,count,lock; + + lock=0; + if (rnd(2) == 0 || lock_type == F_RDLCK) + { + lock=1; + if (mi_lock_database(file,F_WRLCK)) + { + if (lock_type == F_RDLCK && my_errno == EDEADLK) + { + printf("%2d: write: deadlock\n",id); fflush(stdout); + return 0; + } + fprintf(stderr,"%2d: Can't lock table (%d)\n",id,my_errno); + mi_close(file); + return 1; + } + if (rnd(2) == 0) + mi_extra(file,HA_EXTRA_WRITE_CACHE,0); + } + + sprintf((char*) record.id,"%7d",getpid()); + strnmov((char*) record.text,"Testing...", sizeof(record.text)); + + tries=(uint) rnd(100)+10; + for (i=count=0 ; i < tries ; i++) + { + uint32 tmp=rnd(80000)+20000; + int4store(record.nr,tmp); + if (!mi_write(file,record.id)) + count++; + else + { + if (my_errno != HA_ERR_FOUND_DUPP_KEY) + { + fprintf(stderr,"%2d: Got error %d (errno %d) from write\n",id,my_errno, + errno); + return 1; + } + } + } + if (lock) + { + mi_extra(file,HA_EXTRA_NO_CACHE,0); + if (mi_lock_database(file,F_UNLCK)) + { + fprintf(stderr,"%2d: Can't unlock table\n",id); + exit(0); + } + } + printf("%2d: write: %5d\n",id,count); fflush(stdout); + return 0; +} + + +int test_update(MI_INFO *file,int id,int lock_type) +{ + uint i,lock,found,next,prev,update; + uint32 tmp; + char find[4]; + struct record new_record; + + lock=0; + if (rnd(2) == 0 || lock_type == F_RDLCK) + { + lock=1; + if (mi_lock_database(file,F_WRLCK)) + { + if (lock_type == F_RDLCK && my_errno == EDEADLK) + { + printf("%2d: write: deadlock\n",id); fflush(stdout); + return 0; + } + fprintf(stderr,"%2d: Can't lock table (%d)\n",id,my_errno); + return 1; + } + } + bzero((char*) &new_record,sizeof(new_record)); + strmov((char*) new_record.text,"Updated"); + + found=next=prev=update=0; + for (i=0 ; i < 100 ; i++) + { + tmp=rnd(100000); + int4store(find,tmp); + if (!mi_rkey(file,record.id,1,(uchar*) find, HA_WHOLE_KEY, + HA_READ_KEY_EXACT)) + found++; + else + { + if (my_errno != HA_ERR_KEY_NOT_FOUND) + { + fprintf(stderr,"%2d: Got error %d from read in update\n",id,my_errno); + return 1; + } + else if (!mi_rnext(file,record.id,1)) + next++; + else + { + if (my_errno != HA_ERR_END_OF_FILE) + { + fprintf(stderr,"%2d: Got error %d from rnext in update\n", + id,my_errno); + return 1; + } + else if (!mi_rprev(file,record.id,1)) + prev++; + else + { + if (my_errno != HA_ERR_END_OF_FILE) + { + fprintf(stderr,"%2d: Got error %d from rnext in update\n", + id,my_errno); + return 1; + } + continue; + } + } + } + memcpy_fixed(new_record.id,record.id,sizeof(record.id)); + tmp=rnd(20000)+40000; + int4store(new_record.nr,tmp); + if (!mi_update(file,record.id,new_record.id)) + update++; + else + { + if (my_errno != HA_ERR_RECORD_CHANGED && + my_errno != HA_ERR_RECORD_DELETED && + my_errno != HA_ERR_FOUND_DUPP_KEY) + { + fprintf(stderr,"%2d: Got error %d from update\n",id,my_errno); + return 1; + } + } + } + if (lock) + { + if (mi_lock_database(file,F_UNLCK)) + { + fprintf(stderr,"Can't unlock table,id, error%d\n",my_errno); + return 1; + } + } + printf("%2d: update: %5d\n",id,update); fflush(stdout); + return 0; +} + +#else /* __NETWARE__ */ + +#include + +main() +{ + fprintf(stderr,"this test has not been ported to NetWare\n"); + return 0; +} + +#endif /* __NETWARE__ */ Added: trunk/src/mi_test_all.res =================================================================== --- trunk/src/mi_test_all.res 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_test_all.res 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,53 @@ +myisamchk: MyISAM file test1 +myisamchk: warning: Size of indexfile is: 1024 Should be: 2048 +MyISAM-table 'test1' is usable but should be fixed +mi_test2 -s -L -K -R1 -m2000 ; Should give error 135 +Error: 135 in write at record: 1105 +got error: 135 when using MyISAM-database +myisamchk: MyISAM file test2 +myisamchk: warning: Datafile is almost full, 65532 of 65534 used +MyISAM-table 'test2' is usable but should be fixed +Commands Used count Errors Recover errors +open 7 0 0 +write 350 0 0 +update 35 0 0 +delete 350 0 0 +close 7 0 0 +extra 42 0 0 +Total 791 0 0 +Commands Used count Errors Recover errors +open 8 0 0 +write 400 0 0 +update 40 0 0 +delete 400 0 0 +close 8 0 0 +extra 48 0 0 +Total 904 0 0 + +real 0m0.221s +user 0m0.120s +sys 0m0.100s + +real 0m0.222s +user 0m0.140s +sys 0m0.084s + +real 0m0.232s +user 0m0.112s +sys 0m0.120s + +real 0m0.163s +user 0m0.116s +sys 0m0.036s + +real 0m0.159s +user 0m0.136s +sys 0m0.020s + +real 0m0.147s +user 0m0.132s +sys 0m0.016s + +real 0m0.211s +user 0m0.124s +sys 0m0.088s Added: trunk/src/mi_test_all.sh =================================================================== --- trunk/src/mi_test_all.sh 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_test_all.sh 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,148 @@ +#!/bin/sh +# +# Execute some simple basic test on MyISAM libary to check if things +# works at all. + +valgrind="valgrind --alignment=8 --leak-check=yes" +silent="-s" + +if test -f mi_test1$MACH ; then suffix=$MACH ; else suffix=""; fi +./mi_test1$suffix $silent +./myisamchk$suffix -se test1 +./mi_test1$suffix $silent -N -S +./myisamchk$suffix -se test1 +./mi_test1$suffix $silent -P --checksum +./myisamchk$suffix -se test1 +./mi_test1$suffix $silent -P -N -S +./myisamchk$suffix -se test1 +./mi_test1$suffix $silent -B -N -R2 +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -k 480 --unique +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -N -S -R1 +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -p -S +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -p -S -N --unique +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -p -S -N --key_length=127 --checksum +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -p -S -N --key_length=128 +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -p -S --key_length=480 +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -B +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -B --key_length=64 --unique +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -B -k 480 --checksum +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -B -k 480 -N --unique --checksum +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -m +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -m -P --unique --checksum +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -m -P --key_length=480 --key_cache +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -m -p +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -w -S --unique +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -w --key_length=64 --checksum +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -w -N --key_length=480 +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -w -S --key_length=480 --checksum +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -b -N +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -a -b --key_length=480 +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent -p -B --key_length=480 +./myisamchk$suffix -sm test1 + +./mi_test1$suffix $silent --checksum +./myisamchk$suffix -se test1 +./myisamchk$suffix -rs test1 +./myisamchk$suffix -se test1 +./myisamchk$suffix -rqs test1 +./myisamchk$suffix -se test1 +./myisamchk$suffix -rs --correct-checksum test1 +./myisamchk$suffix -se test1 +./myisamchk$suffix -rqs --correct-checksum test1 +./myisamchk$suffix -se test1 +./myisamchk$suffix -ros --correct-checksum test1 +./myisamchk$suffix -se test1 +./myisamchk$suffix -rqos --correct-checksum test1 +./myisamchk$suffix -se test1 + +# check of myisampack / myisamchk +./myisampack$suffix --force -s test1 +# Ignore error for index file +./myisamchk$suffix -es test1 2>&1 >& /dev/null +./myisamchk$suffix -rqs test1 +./myisamchk$suffix -es test1 +./myisamchk$suffix -rs test1 +./myisamchk$suffix -es test1 +./myisamchk$suffix -rus test1 +./myisamchk$suffix -es test1 + +./mi_test1$suffix $silent --checksum -S +./myisamchk$suffix -se test1 +./myisamchk$suffix -ros test1 +./myisamchk$suffix -rqs test1 +./myisamchk$suffix -se test1 + +./myisampack$suffix --force -s test1 +./myisamchk$suffix -rqs test1 +./myisamchk$suffix -es test1 +./myisamchk$suffix -rus test1 +./myisamchk$suffix -es test1 + +./mi_test1$suffix $silent --checksum --unique +./myisamchk$suffix -se test1 +./mi_test1$suffix $silent --unique -S +./myisamchk$suffix -se test1 + + +./mi_test1$suffix $silent --key_multiple -N -S +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent --key_multiple -a -p --key_length=480 +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent --key_multiple -a -B --key_length=480 +./myisamchk$suffix -sm test1 +./mi_test1$suffix $silent --key_multiple -P -S +./myisamchk$suffix -sm test1 + +./mi_test2$suffix $silent -L -K -W -P +./myisamchk$suffix -sm test2 +./mi_test2$suffix $silent -L -K -W -P -A +./myisamchk$suffix -sm test2 +./mi_test2$suffix $silent -L -K -W -P -S -R1 -m500 +echo "mi_test2$suffix $silent -L -K -R1 -m2000 ; Should give error 135" +./myisamchk$suffix -sm test2 +./mi_test2$suffix $silent -L -K -R1 -m2000 +./myisamchk$suffix -sm test2 +./mi_test2$suffix $silent -L -K -P -S -R3 -m50 -b1000000 +./myisamchk$suffix -sm test2 +./mi_test2$suffix $silent -L -B +./myisamchk$suffix -sm test2 +./mi_test2$suffix $silent -D -B -c +./myisamchk$suffix -sm test2 +./mi_test2$suffix $silent -m10000 -e8192 -K +./myisamchk$suffix -sm test2 +./mi_test2$suffix $silent -m10000 -e16384 -E16384 -K -L +./myisamchk$suffix -sm test2 + +./mi_test2$suffix $silent -L -K -W -P -m50 -l +./myisamlog$suffix +./mi_test2$suffix $silent -L -K -W -P -m50 -l -b100 +./myisamlog$suffix +time ./mi_test2$suffix $silent +time ./mi_test2$suffix $silent -K -B +time ./mi_test2$suffix $silent -L -B +time ./mi_test2$suffix $silent -L -K -B +time ./mi_test2$suffix $silent -L -K -W -B +time ./mi_test2$suffix $silent -L -K -W -S -B +time ./mi_test2$suffix $silent -D -K -W -S -B Property changes on: trunk/src/mi_test_all.sh ___________________________________________________________________ Name: svn:executable + Added: trunk/src/mi_unique.c =================================================================== --- trunk/src/mi_unique.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_unique.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,232 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Functions to check if a row is unique */ + +#include "myisamdef.h" +#include + +my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record, + ha_checksum unique_hash, my_off_t disk_pos) +{ + my_off_t lastpos=info->lastpos; + MI_KEYDEF *key= &info->s->keyinfo[def->key]; + uchar *key_buff=info->lastkey2; + DBUG_ENTER("mi_check_unique"); + + mi_unique_store(record+key->seg->start, unique_hash); + _mi_make_key(info,def->key,key_buff,record,0); + + /* The above changed info->lastkey2. Inform mi_rnext_same(). */ + info->update&= ~HA_STATE_RNEXT_SAME; + + if (_mi_search(info,info->s->keyinfo+def->key,key_buff,MI_UNIQUE_HASH_LENGTH, + SEARCH_FIND,info->s->state.key_root[def->key])) + { + info->page_changed=1; /* Can't optimize read next */ + info->lastpos= lastpos; + DBUG_RETURN(0); /* No matching rows */ + } + + for (;;) + { + if (info->lastpos != disk_pos && + !(*info->s->compare_unique)(info,def,record,info->lastpos)) + { + my_errno=HA_ERR_FOUND_DUPP_UNIQUE; + info->errkey= (int) def->key; + info->dupp_key_pos= info->lastpos; + info->page_changed=1; /* Can't optimize read next */ + info->lastpos=lastpos; + DBUG_PRINT("info",("Found duplicate")); + DBUG_RETURN(1); /* Found identical */ + } + if (_mi_search_next(info,info->s->keyinfo+def->key, info->lastkey, + MI_UNIQUE_HASH_LENGTH, SEARCH_BIGGER, + info->s->state.key_root[def->key]) || + bcmp((char*) info->lastkey, (char*) key_buff, MI_UNIQUE_HASH_LENGTH)) + { + info->page_changed=1; /* Can't optimize read next */ + info->lastpos=lastpos; + DBUG_RETURN(0); /* end of tree */ + } + } +} + + +/* + Calculate a hash for a row + + TODO + Add support for bit fields +*/ + +ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record) +{ + const uchar *pos, *end; + ha_checksum crc= 0; + ulong seed1=0, seed2= 4; + HA_KEYSEG *keyseg; + + for (keyseg=def->seg ; keyseg < def->end ; keyseg++) + { + enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type; + uint length=keyseg->length; + + if (keyseg->null_bit) + { + if (record[keyseg->null_pos] & keyseg->null_bit) + { + /* + Change crc in a way different from an empty string or 0. + (This is an optimisation; The code will work even if this isn't + done) + */ + crc=((crc << 8) + 511+ + (crc >> (8*sizeof(ha_checksum)-8))); + continue; + } + } + pos= record+keyseg->start; + if (keyseg->flag & HA_VAR_LENGTH_PART) + { + uint pack_length= keyseg->bit_start; + uint tmp_length= (pack_length == 1 ? (uint) *(uchar*) pos : + uint2korr(pos)); + pos+= pack_length; /* Skip VARCHAR length */ + set_if_smaller(length,tmp_length); + } + else if (keyseg->flag & HA_BLOB_PART) + { + uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos); + memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*)); + if (!length || length > tmp_length) + length=tmp_length; /* The whole blob */ + } + end= pos+length; + if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 || + type == HA_KEYTYPE_VARTEXT2) + { + keyseg->charset->coll->hash_sort(keyseg->charset, + (const uchar*) pos, length, &seed1, + &seed2); + crc^= seed1; + } + else + while (pos != end) + crc=((crc << 8) + + (((uchar) *(uchar*) pos++))) + + (crc >> (8*sizeof(ha_checksum)-8)); + } + return crc; +} + + +/* + compare unique key for two rows + + TODO + Add support for bit fields + + RETURN + 0 if both rows have equal unique value + # Rows are different +*/ + +int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, + my_bool null_are_equal) +{ + const uchar *pos_a, *pos_b, *end; + HA_KEYSEG *keyseg; + + for (keyseg=def->seg ; keyseg < def->end ; keyseg++) + { + enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type; + uint a_length, b_length; + a_length= b_length= keyseg->length; + + /* If part is NULL it's regarded as different */ + if (keyseg->null_bit) + { + uint tmp; + if ((tmp=(a[keyseg->null_pos] & keyseg->null_bit)) != + (uint) (b[keyseg->null_pos] & keyseg->null_bit)) + return 1; + if (tmp) + { + if (!null_are_equal) + return 1; + continue; + } + } + pos_a= a+keyseg->start; + pos_b= b+keyseg->start; + if (keyseg->flag & HA_VAR_LENGTH_PART) + { + uint pack_length= keyseg->bit_start; + if (pack_length == 1) + { + a_length= (uint) *(uchar*) pos_a++; + b_length= (uint) *(uchar*) pos_b++; + } + else + { + a_length= uint2korr(pos_a); + b_length= uint2korr(pos_b); + pos_a+= 2; /* Skip VARCHAR length */ + pos_b+= 2; + } + set_if_smaller(a_length, keyseg->length); /* Safety */ + set_if_smaller(b_length, keyseg->length); /* safety */ + } + else if (keyseg->flag & HA_BLOB_PART) + { + /* Only compare 'length' characters if length != 0 */ + a_length= _mi_calc_blob_length(keyseg->bit_start,pos_a); + b_length= _mi_calc_blob_length(keyseg->bit_start,pos_b); + /* Check that a and b are of equal length */ + if (keyseg->length) + { + /* + This is used in some cases when we are not interested in comparing + the whole length of the blob. + */ + set_if_smaller(a_length, keyseg->length); + set_if_smaller(b_length, keyseg->length); + } + memcpy_fixed((uchar*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*)); + memcpy_fixed((uchar*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*)); + } + if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 || + type == HA_KEYTYPE_VARTEXT2) + { + if (mi_compare_text(keyseg->charset, (uchar *) pos_a, a_length, + (uchar *) pos_b, b_length, 0, 1)) + return 1; + } + else + { + if (a_length != b_length) + return 1; + end= pos_a+a_length; + while (pos_a != end) + { + if (*pos_a++ != *pos_b++) + return 1; + } + } + } + return 0; +} Added: trunk/src/mi_update.c =================================================================== --- trunk/src/mi_update.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_update.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,243 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Update an old row in a MyISAM table */ + +#include "fulltext.h" +#include "rt_index.h" + +int mi_update(register MI_INFO *info, const uchar *oldrec, uchar *newrec) +{ + int flag,key_changed,save_errno; + reg3 my_off_t pos; + uint i; + uchar old_key[MI_MAX_KEY_BUFF],*new_key; + bool auto_key_changed=0; + ulonglong changed; + MYISAM_SHARE *share=info->s; + ha_checksum old_checksum; + DBUG_ENTER("mi_update"); + LINT_INIT(new_key); + LINT_INIT(changed); + LINT_INIT(old_checksum); + + DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_usage", + mi_print_error(info->s, HA_ERR_CRASHED); + DBUG_RETURN(my_errno= HA_ERR_CRASHED);); + if (!(info->update & HA_STATE_AKTIV)) + { + DBUG_RETURN(my_errno=HA_ERR_KEY_NOT_FOUND); + } + if (share->options & HA_OPTION_READ_ONLY_DATA) + { + DBUG_RETURN(my_errno=EACCES); + } + if (info->state->key_file_length >= share->base.margin_key_file_length) + { + DBUG_RETURN(my_errno=HA_ERR_INDEX_FILE_FULL); + } + pos=info->lastpos; + if (_mi_readinfo(info,F_WRLCK,1)) + DBUG_RETURN(my_errno); + + if (share->calc_checksum) + old_checksum=info->checksum=(*share->calc_checksum)(info,oldrec); + if ((*share->compare_record)(info,oldrec)) + { + save_errno=my_errno; + goto err_end; /* Record has changed */ + } + + + /* Calculate and check all unique constraints */ + key_changed=0; + for (i=0 ; i < share->state.header.uniques ; i++) + { + MI_UNIQUEDEF *def=share->uniqueinfo+i; + if (mi_unique_comp(def, newrec, oldrec,1) && + mi_check_unique(info, def, newrec, mi_unique_hash(def, newrec), + info->lastpos)) + { + save_errno=my_errno; + goto err_end; + } + } + if (_mi_mark_file_changed(info)) + { + save_errno=my_errno; + goto err_end; + } + + /* Check which keys changed from the original row */ + + new_key=info->lastkey2; + changed=0; + for (i=0 ; i < share->base.keys ; i++) + { + if (mi_is_key_active(share->state.key_map, i)) + { + if (share->keyinfo[i].flag & HA_FULLTEXT ) + { + if (_mi_ft_cmp(info,i,oldrec, newrec)) + { + if ((int) i == info->lastinx) + { + /* + We are changeing the index we are reading on. Mark that + the index data has changed and we need to do a full search + when doing read-next + */ + key_changed|=HA_STATE_WRITTEN; + } + changed|=((ulonglong) 1 << i); + if (_mi_ft_update(info,i, old_key,oldrec,newrec,pos)) + goto err; + } + } + else + { + uint new_length=_mi_make_key(info,i,new_key,newrec,pos); + uint old_length=_mi_make_key(info,i,old_key,oldrec,pos); + + /* The above changed info->lastkey2. Inform mi_rnext_same(). */ + info->update&= ~HA_STATE_RNEXT_SAME; + + if (new_length != old_length || + memcmp((uchar*) old_key,(uchar*) new_key,new_length)) + { + if ((int) i == info->lastinx) + key_changed|=HA_STATE_WRITTEN; /* Mark that keyfile changed */ + changed|=((ulonglong) 1 << i); + share->keyinfo[i].version++; + if (share->keyinfo[i].ck_delete(info,i,old_key,old_length)) goto err; + if (share->keyinfo[i].ck_insert(info,i,new_key,new_length)) goto err; + if (share->base.auto_key == i+1) + auto_key_changed=1; + } + } + } + } + /* + If we are running with external locking, we must update the index file + that something has changed. + */ + if (changed || !my_disable_locking) + key_changed|= HA_STATE_CHANGED; + + if (share->calc_checksum) + { + info->checksum=(*share->calc_checksum)(info,newrec); + /* Store new checksum in index file header */ + key_changed|= HA_STATE_CHANGED; + } + { + /* + Don't update index file if data file is not extended and no status + information changed + */ + MI_STATUS_INFO state; + ha_rows org_split; + my_off_t org_delete_link; + + memcpy((char*) &state, (char*) info->state, sizeof(state)); + org_split= share->state.split; + org_delete_link= share->state.dellink; + if ((*share->update_record)(info,pos,newrec)) + goto err; + if (!key_changed && + (memcmp((char*) &state, (char*) info->state, sizeof(state)) || + org_split != share->state.split || + org_delete_link != share->state.dellink)) + key_changed|= HA_STATE_CHANGED; /* Must update index file */ + } + if (auto_key_changed) + set_if_bigger(info->s->state.auto_increment, + retrieve_auto_increment(info, newrec)); + if (share->calc_checksum) + info->state->checksum+=(info->checksum - old_checksum); + + info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | HA_STATE_AKTIV | + key_changed); + myisam_log_record(MI_LOG_UPDATE,info,newrec,info->lastpos,0); + /* + Every myisam function that updates myisam table must end with + call to _mi_writeinfo(). If operation (second param of + _mi_writeinfo()) is not 0 it sets share->changed to 1, that is + flags that data has changed. If operation is 0, this function + equals to no-op in this case. + + mi_update() must always pass !0 value as operation, since even if + there is no index change there could be data change. + */ + VOID(_mi_writeinfo(info, WRITEINFO_UPDATE_KEYFILE)); + allow_break(); /* Allow SIGHUP & SIGINT */ + if (info->invalidator != 0) + { + DBUG_PRINT("info", ("invalidator... '%s' (update)", info->filename)); + (*info->invalidator)(info->filename); + info->invalidator=0; + } + DBUG_RETURN(0); + +err: + DBUG_PRINT("error",("key: %d errno: %d",i,my_errno)); + save_errno=my_errno; + if (changed) + key_changed|= HA_STATE_CHANGED; + if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_OUT_OF_MEM || + my_errno == HA_ERR_RECORD_FILE_FULL) + { + info->errkey= (int) i; + flag=0; + do + { + if (((ulonglong) 1 << i) & changed) + { + if (share->keyinfo[i].flag & HA_FULLTEXT) + { + if ((flag++ && _mi_ft_del(info,i, new_key,newrec,pos)) || + _mi_ft_add(info,i, old_key,oldrec,pos)) + break; + } + else + { + uint new_length=_mi_make_key(info,i,new_key,newrec,pos); + uint old_length= _mi_make_key(info,i,old_key,oldrec,pos); + if ((flag++ && _mi_ck_delete(info,i,new_key,new_length)) || + _mi_ck_write(info,i,old_key,old_length)) + break; + } + } + } while (i-- != 0); + } + else + { + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); + } + info->update= (HA_STATE_CHANGED | HA_STATE_AKTIV | HA_STATE_ROW_CHANGED | + key_changed); + + err_end: + myisam_log_record(MI_LOG_UPDATE,info,newrec,info->lastpos,my_errno); + VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE)); + allow_break(); /* Allow SIGHUP & SIGINT */ + if (save_errno == HA_ERR_KEY_NOT_FOUND) + { + mi_print_error(info->s, HA_ERR_CRASHED); + save_errno=HA_ERR_CRASHED; + } + DBUG_RETURN(my_errno=save_errno); +} /* mi_update */ Added: trunk/src/mi_write.c =================================================================== --- trunk/src/mi_write.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/mi_write.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1046 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Write a row to a MyISAM table */ + +#include "fulltext.h" +#include "rt_index.h" + +#define MAX_POINTER_LENGTH 8 + + /* Functions declared in this file */ + +static int w_search(MI_INFO *info,MI_KEYDEF *keyinfo, + uint comp_flag, uchar *key, + uint key_length, my_off_t pos, uchar *father_buff, + uchar *father_keypos, my_off_t father_page, + my_bool insert_last); +static int _mi_balance_page(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, + uchar *curr_buff,uchar *father_buff, + uchar *father_keypos,my_off_t father_page); +static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uint *return_key_length, + uchar **after_key); +int _mi_ck_write_tree(register MI_INFO *info, uint keynr,uchar *key, + uint key_length); +int _mi_ck_write_btree(register MI_INFO *info, uint keynr,uchar *key, + uint key_length); + + /* Write new record to database */ + +int mi_write(MI_INFO *info, uchar *record) +{ + MYISAM_SHARE *share=info->s; + uint i; + int save_errno; + my_off_t filepos; + uchar *buff; + my_bool lock_tree= share->concurrent_insert; + DBUG_ENTER("mi_write"); + DBUG_PRINT("enter",("isam: %d data: %d",info->s->kfile,info->dfile)); + + DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_usage", + mi_print_error(info->s, HA_ERR_CRASHED); + DBUG_RETURN(my_errno= HA_ERR_CRASHED);); + if (share->options & HA_OPTION_READ_ONLY_DATA) + { + DBUG_RETURN(my_errno=EACCES); + } + if (_mi_readinfo(info,F_WRLCK,1)) + DBUG_RETURN(my_errno); + dont_break(); /* Dont allow SIGHUP or SIGINT */ +#if !defined(NO_LOCKING) && defined(USE_RECORD_LOCK) + if (!info->locked && my_lock(info->dfile,F_WRLCK,0L,F_TO_EOF, + MYF(MY_SEEK_NOT_DONE) | info->lock_wait)) + goto err; +#endif + filepos= ((share->state.dellink != HA_OFFSET_ERROR && + !info->append_insert_at_end) ? + share->state.dellink : + info->state->data_file_length); + + if (share->base.reloc == (ha_rows) 1 && + share->base.records == (ha_rows) 1 && + info->state->records == (ha_rows) 1) + { /* System file */ + my_errno=HA_ERR_RECORD_FILE_FULL; + goto err2; + } + if (info->state->key_file_length >= share->base.margin_key_file_length) + { + my_errno=HA_ERR_INDEX_FILE_FULL; + goto err2; + } + if (_mi_mark_file_changed(info)) + goto err2; + + /* Calculate and check all unique constraints */ + for (i=0 ; i < share->state.header.uniques ; i++) + { + if (mi_check_unique(info,share->uniqueinfo+i,record, + mi_unique_hash(share->uniqueinfo+i,record), + HA_OFFSET_ERROR)) + goto err2; + } + + /* Write all keys to indextree */ + + buff=info->lastkey2; + for (i=0 ; i < share->base.keys ; i++) + { + if (mi_is_key_active(share->state.key_map, i)) + { + bool local_lock_tree= (lock_tree && + !(info->bulk_insert && + is_tree_inited(&info->bulk_insert[i]))); + if (local_lock_tree) + { + rw_wrlock(&share->key_root_lock[i]); + share->keyinfo[i].version++; + } + if (share->keyinfo[i].flag & HA_FULLTEXT ) + { + if (_mi_ft_add(info,i, buff, record, filepos)) + { + if (local_lock_tree) + rw_unlock(&share->key_root_lock[i]); + DBUG_PRINT("error",("Got error: %d on write",my_errno)); + goto err; + } + } + else + { + if (share->keyinfo[i].ck_insert(info,i,buff, + _mi_make_key(info,i,buff,record,filepos))) + { + if (local_lock_tree) + rw_unlock(&share->key_root_lock[i]); + DBUG_PRINT("error",("Got error: %d on write",my_errno)); + goto err; + } + } + + /* The above changed info->lastkey2. Inform mi_rnext_same(). */ + info->update&= ~HA_STATE_RNEXT_SAME; + + if (local_lock_tree) + rw_unlock(&share->key_root_lock[i]); + } + } + if (share->calc_checksum) + info->checksum=(*share->calc_checksum)(info,record); + if (!(info->opt_flag & OPT_NO_ROWS)) + { + if ((*share->write_record)(info,record)) + goto err; + info->state->checksum+=info->checksum; + } + if (share->base.auto_key) + set_if_bigger(info->s->state.auto_increment, + retrieve_auto_increment(info, record)); + info->update= (HA_STATE_CHANGED | HA_STATE_AKTIV | HA_STATE_WRITTEN | + HA_STATE_ROW_CHANGED); + info->state->records++; + info->lastpos=filepos; + myisam_log_record(MI_LOG_WRITE,info,record,filepos,0); + VOID(_mi_writeinfo(info, WRITEINFO_UPDATE_KEYFILE)); + if (info->invalidator != 0) + { + DBUG_PRINT("info", ("invalidator... '%s' (update)", info->filename)); + (*info->invalidator)(info->filename); + info->invalidator=0; + } + + /* + Update status of the table. We need to do so after each row write + for the log tables, as we want the new row to become visible to + other threads as soon as possible. We don't lock mutex here + (as it is required by pthread memory visibility rules) as (1) it's + not critical to use outdated share->is_log_table value (2) locking + mutex here for every write is too expensive. + */ + if (share->is_log_table) + mi_update_status((void*) info); + + allow_break(); /* Allow SIGHUP & SIGINT */ + DBUG_RETURN(0); + +err: + save_errno=my_errno; + if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL || + my_errno == HA_ERR_NULL_IN_SPATIAL || my_errno == HA_ERR_OUT_OF_MEM) + { + if (info->bulk_insert) + { + uint j; + for (j=0 ; j < share->base.keys ; j++) + mi_flush_bulk_insert(info, j); + } + info->errkey= (int) i; + while ( i-- > 0) + { + if (mi_is_key_active(share->state.key_map, i)) + { + bool local_lock_tree= (lock_tree && + !(info->bulk_insert && + is_tree_inited(&info->bulk_insert[i]))); + if (local_lock_tree) + rw_wrlock(&share->key_root_lock[i]); + if (share->keyinfo[i].flag & HA_FULLTEXT) + { + if (_mi_ft_del(info,i, buff,record,filepos)) + { + if (local_lock_tree) + rw_unlock(&share->key_root_lock[i]); + break; + } + } + else + { + uint key_length=_mi_make_key(info,i,buff,record,filepos); + if (_mi_ck_delete(info,i,buff,key_length)) + { + if (local_lock_tree) + rw_unlock(&share->key_root_lock[i]); + break; + } + } + if (local_lock_tree) + rw_unlock(&share->key_root_lock[i]); + } + } + } + else + { + mi_print_error(info->s, HA_ERR_CRASHED); + mi_mark_crashed(info); + } + info->update= (HA_STATE_CHANGED | HA_STATE_WRITTEN | HA_STATE_ROW_CHANGED); + my_errno=save_errno; +err2: + save_errno=my_errno; + myisam_log_record(MI_LOG_WRITE,info,record,filepos,my_errno); + VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE)); + allow_break(); /* Allow SIGHUP & SIGINT */ + DBUG_RETURN(my_errno=save_errno); +} /* mi_write */ + + + /* Write one key to btree */ + +int _mi_ck_write(MI_INFO *info, uint keynr, uchar *key, uint key_length) +{ + DBUG_ENTER("_mi_ck_write"); + + if (info->bulk_insert && is_tree_inited(&info->bulk_insert[keynr])) + { + DBUG_RETURN(_mi_ck_write_tree(info, keynr, key, key_length)); + } + else + { + DBUG_RETURN(_mi_ck_write_btree(info, keynr, key, key_length)); + } +} /* _mi_ck_write */ + + +/********************************************************************** + * Normal insert code * + **********************************************************************/ + +int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key, + uint key_length) +{ + int error; + uint comp_flag; + MI_KEYDEF *keyinfo=info->s->keyinfo+keynr; + my_off_t *root=&info->s->state.key_root[keynr]; + DBUG_ENTER("_mi_ck_write_btree"); + + if (keyinfo->flag & HA_SORT_ALLOWS_SAME) + comp_flag=SEARCH_BIGGER; /* Put after same key */ + else if (keyinfo->flag & (HA_NOSAME|HA_FULLTEXT)) + { + comp_flag=SEARCH_FIND | SEARCH_UPDATE; /* No duplicates */ + if (keyinfo->flag & HA_NULL_ARE_EQUAL) + comp_flag|= SEARCH_NULL_ARE_EQUAL; + } + else + comp_flag=SEARCH_SAME; /* Keys in rec-pos order */ + + error=_mi_ck_real_write_btree(info, keyinfo, key, key_length, + root, comp_flag); + if (info->ft1_to_ft2) + { + if (!error) + error= _mi_ft_convert_to_ft2(info, keynr, key); + delete_dynamic(info->ft1_to_ft2); + my_free((uchar*)info->ft1_to_ft2, MYF(0)); + info->ft1_to_ft2=0; + } + DBUG_RETURN(error); +} /* _mi_ck_write_btree */ + +int _mi_ck_real_write_btree(MI_INFO *info, MI_KEYDEF *keyinfo, + uchar *key, uint key_length, my_off_t *root, uint comp_flag) +{ + int error; + DBUG_ENTER("_mi_ck_real_write_btree"); + /* key_length parameter is used only if comp_flag is SEARCH_FIND */ + if (*root == HA_OFFSET_ERROR || + (error=w_search(info, keyinfo, comp_flag, key, key_length, + *root, (uchar *) 0, (uchar*) 0, + (my_off_t) 0, 1)) > 0) + error=_mi_enlarge_root(info,keyinfo,key,root); + DBUG_RETURN(error); +} /* _mi_ck_real_write_btree */ + + + /* Make a new root with key as only pointer */ + +int _mi_enlarge_root(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + my_off_t *root) +{ + uint t_length,nod_flag; + MI_KEY_PARAM s_temp; + MYISAM_SHARE *share=info->s; + DBUG_ENTER("_mi_enlarge_root"); + + nod_flag= (*root != HA_OFFSET_ERROR) ? share->base.key_reflength : 0; + _mi_kpointer(info,info->buff+2,*root); /* if nod */ + t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,(uchar*) 0, + (uchar*) 0, (uchar*) 0, key,&s_temp); + mi_putint(info->buff,t_length+2+nod_flag,nod_flag); + (*keyinfo->store_key)(keyinfo,info->buff+2+nod_flag,&s_temp); + info->buff_used=info->page_changed=1; /* info->buff is used */ + if ((*root= _mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR || + _mi_write_keypage(info,keyinfo,*root,DFLT_INIT_HITS,info->buff)) + DBUG_RETURN(-1); + DBUG_RETURN(0); +} /* _mi_enlarge_root */ + + + /* + Search after a position for a key and store it there + Returns -1 = error + 0 = ok + 1 = key should be stored in higher tree + */ + +static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, + uint comp_flag, uchar *key, uint key_length, my_off_t page, + uchar *father_buff, uchar *father_keypos, + my_off_t father_page, my_bool insert_last) +{ + int error,flag; + uint nod_flag, search_key_length; + uchar *temp_buff,*keypos; + uchar keybuff[MI_MAX_KEY_BUFF]; + my_bool was_last_key; + my_off_t next_page, dupp_key_pos; + DBUG_ENTER("w_search"); + DBUG_PRINT("enter",("page: %ld", (long) page)); + + search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY; + if (!(temp_buff= (uchar*) my_alloca((uint) keyinfo->block_length+ + MI_MAX_KEY_BUFF*2))) + DBUG_RETURN(-1); + if (!_mi_fetch_keypage(info,keyinfo,page,DFLT_INIT_HITS,temp_buff,0)) + goto err; + + flag=(*keyinfo->bin_search)(info,keyinfo,temp_buff,key,search_key_length, + comp_flag, &keypos, keybuff, &was_last_key); + nod_flag=mi_test_if_nod(temp_buff); + if (flag == 0) + { + uint tmp_key_length; + /* get position to record with duplicated key */ + tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,keybuff); + if (tmp_key_length) + dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length); + else + dupp_key_pos= HA_OFFSET_ERROR; + + if (keyinfo->flag & HA_FULLTEXT) + { + uint off; + int subkeys; + + get_key_full_length_rdonly(off, keybuff); + subkeys=ft_sintXkorr(keybuff+off); + comp_flag=SEARCH_SAME; + if (subkeys >= 0) + { + /* normal word, one-level tree structure */ + flag=(*keyinfo->bin_search)(info, keyinfo, temp_buff, key, + USE_WHOLE_KEY, comp_flag, + &keypos, keybuff, &was_last_key); + } + else + { + /* popular word. two-level tree. going down */ + my_off_t root=dupp_key_pos; + keyinfo=&info->s->ft2_keyinfo; + get_key_full_length_rdonly(off, key); + key+=off; + keypos-=keyinfo->keylength+nod_flag; /* we'll modify key entry 'in vivo' */ + error=_mi_ck_real_write_btree(info, keyinfo, key, 0, + &root, comp_flag); + _mi_dpointer(info, keypos+HA_FT_WLEN, root); + subkeys--; /* should there be underflow protection ? */ + DBUG_ASSERT(subkeys < 0); + ft_intXstore(keypos, subkeys); + if (!error) + error=_mi_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,temp_buff); + my_afree((uchar*) temp_buff); + DBUG_RETURN(error); + } + } + else /* not HA_FULLTEXT, normal HA_NOSAME key */ + { + info->dupp_key_pos= dupp_key_pos; + my_afree((uchar*) temp_buff); + my_errno=HA_ERR_FOUND_DUPP_KEY; + DBUG_RETURN(-1); + } + } + if (flag == MI_FOUND_WRONG_KEY) + DBUG_RETURN(-1); + if (!was_last_key) + insert_last=0; + next_page=_mi_kpos(nod_flag,keypos); + if (next_page == HA_OFFSET_ERROR || + (error=w_search(info, keyinfo, comp_flag, key, key_length, next_page, + temp_buff, keypos, page, insert_last)) >0) + { + error=_mi_insert(info,keyinfo,key,temp_buff,keypos,keybuff,father_buff, + father_keypos,father_page, insert_last); + if (_mi_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,temp_buff)) + goto err; + } + my_afree((uchar*) temp_buff); + DBUG_RETURN(error); +err: + my_afree((uchar*) temp_buff); + DBUG_PRINT("exit",("Error: %d",my_errno)); + DBUG_RETURN (-1); +} /* w_search */ + + +/* + Insert new key. + + SYNOPSIS + _mi_insert() + info Open table information. + keyinfo Key definition information. + key New key. + anc_buff Key page (beginning). + key_pos Position in key page where to insert. + key_buff Copy of previous key. + father_buff parent key page for balancing. + father_key_pos position in parent key page for balancing. + father_page position of parent key page in file. + insert_last If to append at end of page. + + DESCRIPTION + Insert new key at right of key_pos. + + RETURN + 2 if key contains key to upper level. + 0 OK. + < 0 Error. +*/ + +int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo, + uchar *key, uchar *anc_buff, uchar *key_pos, uchar *key_buff, + uchar *father_buff, uchar *father_key_pos, my_off_t father_page, + my_bool insert_last) +{ + uint a_length,nod_flag; + int t_length; + uchar *endpos, *prev_key; + MI_KEY_PARAM s_temp; + DBUG_ENTER("_mi_insert"); + DBUG_PRINT("enter",("key_pos: 0x%lx", (long) key_pos)); + DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,USE_WHOLE_KEY);); + + nod_flag=mi_test_if_nod(anc_buff); + a_length=mi_getint(anc_buff); + endpos= anc_buff+ a_length; + prev_key=(key_pos == anc_buff+2+nod_flag ? (uchar*) 0 : key_buff); + t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, + (key_pos == endpos ? (uchar*) 0 : key_pos), + prev_key, prev_key, + key,&s_temp); +#ifndef DBUG_OFF + if (key_pos != anc_buff+2+nod_flag && (keyinfo->flag & + (HA_BINARY_PACK_KEY | HA_PACK_KEY))) + { + DBUG_DUMP("prev_key",(uchar*) key_buff,_mi_keylength(keyinfo,key_buff)); + } + if (keyinfo->flag & HA_PACK_KEY) + { + DBUG_PRINT("test",("t_length: %d ref_len: %d", + t_length,s_temp.ref_length)); + DBUG_PRINT("test",("n_ref_len: %d n_length: %d key_pos: 0x%lx", + s_temp.n_ref_length,s_temp.n_length, (long) s_temp.key)); + } +#endif + if (t_length > 0) + { + if (t_length >= keyinfo->maxlength*2+MAX_POINTER_LENGTH) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(-1); + } + bmove_upp((uchar*) endpos+t_length,(uchar*) endpos,(uint) (endpos-key_pos)); + } + else + { + if (-t_length >= keyinfo->maxlength*2+MAX_POINTER_LENGTH) + { + mi_print_error(info->s, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(-1); + } + bmove(key_pos,key_pos-t_length,(uint) (endpos-key_pos)+t_length); + } + (*keyinfo->store_key)(keyinfo,key_pos,&s_temp); + a_length+=t_length; + mi_putint(anc_buff,a_length,nod_flag); + if (a_length <= keyinfo->block_length) + { + if (keyinfo->block_length - a_length < 32 && + keyinfo->flag & HA_FULLTEXT && key_pos == endpos && + info->s->base.key_reflength <= info->s->base.rec_reflength && + info->s->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) + { + /* + Normal word. One-level tree. Page is almost full. + Let's consider converting. + We'll compare 'key' and the first key at anc_buff + */ + uchar *a=key, *b=anc_buff+2+nod_flag; + uint alen, blen, ft2len=info->s->ft2_keyinfo.keylength; + /* the very first key on the page is always unpacked */ + DBUG_ASSERT((*b & 128) == 0); +#if HA_FT_MAXLEN >= 127 + blen= mi_uint2korr(b); b+=2; +#else + blen= *b++; +#endif + get_key_length(alen,a); + DBUG_ASSERT(info->ft1_to_ft2==0); + if (alen == blen && + mi_compare_text(keyinfo->seg->charset, a, alen, b, blen, 0, 0)==0) + { + /* yup. converting */ + info->ft1_to_ft2=(DYNAMIC_ARRAY *) + my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME)); + my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50); + + /* + now, adding all keys from the page to dynarray + if the page is a leaf (if not keys will be deleted later) + */ + if (!nod_flag) + { + /* let's leave the first key on the page, though, because + we cannot easily dispatch an empty page here */ + b+=blen+ft2len+2; + for (a=anc_buff+a_length ; b < a ; b+=ft2len+2) + insert_dynamic(info->ft1_to_ft2, b); + + /* fixing the page's length - it contains only one key now */ + mi_putint(anc_buff,2+blen+ft2len+2,0); + } + /* the rest will be done when we're back from recursion */ + } + } + DBUG_RETURN(0); /* There is room on page */ + } + /* Page is full */ + if (nod_flag) + insert_last=0; + if (!(keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)) && + father_buff && !insert_last) + DBUG_RETURN(_mi_balance_page(info,keyinfo,key,anc_buff,father_buff, + father_key_pos,father_page)); + DBUG_RETURN(_mi_split_page(info,keyinfo,key,anc_buff,key_buff, insert_last)); +} /* _mi_insert */ + + + /* split a full page in two and assign emerging item to key */ + +int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo, + uchar *key, uchar *buff, uchar *key_buff, + my_bool insert_last_key) +{ + uint length,a_length,key_ref_length,t_length,nod_flag,key_length; + uchar *key_pos,*pos, *after_key; + my_off_t new_pos; + MI_KEY_PARAM s_temp; + DBUG_ENTER("mi_split_page"); + LINT_INIT(after_key); + DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff)); + + if (info->s->keyinfo+info->lastinx == keyinfo) + info->page_changed=1; /* Info->buff is used */ + info->buff_used=1; + nod_flag=mi_test_if_nod(buff); + key_ref_length=2+nod_flag; + if (insert_last_key) + key_pos=_mi_find_last_pos(keyinfo,buff,key_buff, &key_length, &after_key); + else + key_pos=_mi_find_half_pos(nod_flag,keyinfo,buff,key_buff, &key_length, + &after_key); + if (!key_pos) + DBUG_RETURN(-1); + + length=(uint) (key_pos-buff); + a_length=mi_getint(buff); + mi_putint(buff,length,nod_flag); + + key_pos=after_key; + if (nod_flag) + { + DBUG_PRINT("test",("Splitting nod")); + pos=key_pos-nod_flag; + memcpy((uchar*) info->buff+2,(uchar*) pos,(size_t) nod_flag); + } + + /* Move middle item to key and pointer to new page */ + if ((new_pos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR) + DBUG_RETURN(-1); + _mi_kpointer(info,_mi_move_key(keyinfo,key,key_buff),new_pos); + + /* Store new page */ + if (!(*keyinfo->get_key)(keyinfo,nod_flag,&key_pos,key_buff)) + DBUG_RETURN(-1); + + t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,(uchar *) 0, + (uchar*) 0, (uchar*) 0, + key_buff, &s_temp); + length=(uint) ((buff+a_length)-key_pos); + memcpy((uchar*) info->buff+key_ref_length+t_length,(uchar*) key_pos, + (size_t) length); + (*keyinfo->store_key)(keyinfo,info->buff+key_ref_length,&s_temp); + mi_putint(info->buff,length+t_length+key_ref_length,nod_flag); + + if (_mi_write_keypage(info,keyinfo,new_pos,DFLT_INIT_HITS,info->buff)) + DBUG_RETURN(-1); + DBUG_DUMP("key",(uchar*) key,_mi_keylength(keyinfo,key)); + DBUG_RETURN(2); /* Middle key up */ +} /* _mi_split_page */ + + + /* + Calculate how to much to move to split a page in two + Returns pointer to start of key. + key will contain the key. + return_key_length will contain the length of key + after_key will contain the position to where the next key starts + */ + +uchar *_mi_find_half_pos(uint nod_flag, MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uint *return_key_length, + uchar **after_key) +{ + uint keys,length,key_ref_length; + uchar *end,*lastpos; + DBUG_ENTER("_mi_find_half_pos"); + + key_ref_length=2+nod_flag; + length=mi_getint(page)-key_ref_length; + page+=key_ref_length; + if (!(keyinfo->flag & + (HA_PACK_KEY | HA_SPACE_PACK_USED | HA_VAR_LENGTH_KEY | + HA_BINARY_PACK_KEY))) + { + key_ref_length=keyinfo->keylength+nod_flag; + keys=length/(key_ref_length*2); + *return_key_length=keyinfo->keylength; + end=page+keys*key_ref_length; + *after_key=end+key_ref_length; + memcpy(key,end,key_ref_length); + DBUG_RETURN(end); + } + + end=page+length/2-key_ref_length; /* This is aprox. half */ + *key='\0'; + do + { + lastpos=page; + if (!(length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,key))) + DBUG_RETURN(0); + } while (page < end); + *return_key_length=length; + *after_key=page; + DBUG_PRINT("exit",("returns: 0x%lx page: 0x%lx half: 0x%lx", + (long) lastpos, (long) page, (long) end)); + DBUG_RETURN(lastpos); +} /* _mi_find_half_pos */ + + + /* + Split buffer at last key + Returns pointer to the start of the key before the last key + key will contain the last key + */ + +static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uint *return_key_length, + uchar **after_key) +{ + uint keys,length,last_length,key_ref_length; + uchar *end,*lastpos,*prevpos; + uchar key_buff[MI_MAX_KEY_BUFF]; + DBUG_ENTER("_mi_find_last_pos"); + + key_ref_length=2; + length=mi_getint(page)-key_ref_length; + page+=key_ref_length; + if (!(keyinfo->flag & + (HA_PACK_KEY | HA_SPACE_PACK_USED | HA_VAR_LENGTH_KEY | + HA_BINARY_PACK_KEY))) + { + keys=length/keyinfo->keylength-2; + *return_key_length=length=keyinfo->keylength; + end=page+keys*length; + *after_key=end+length; + memcpy(key,end,length); + DBUG_RETURN(end); + } + + LINT_INIT(prevpos); + LINT_INIT(last_length); + end=page+length-key_ref_length; + *key='\0'; + length=0; + lastpos=page; + while (page < end) + { + prevpos=lastpos; lastpos=page; + last_length=length; + memcpy(key, key_buff, length); /* previous key */ + if (!(length=(*keyinfo->get_key)(keyinfo,0,&page,key_buff))) + { + mi_print_error(keyinfo->share, HA_ERR_CRASHED); + my_errno=HA_ERR_CRASHED; + DBUG_RETURN(0); + } + } + *return_key_length=last_length; + *after_key=lastpos; + DBUG_PRINT("exit",("returns: 0x%lx page: 0x%lx end: 0x%lx", + (long) prevpos,(long) page,(long) end)); + DBUG_RETURN(prevpos); +} /* _mi_find_last_pos */ + + + /* Balance page with not packed keys with page on right/left */ + /* returns 0 if balance was done */ + +static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo, + uchar *key, uchar *curr_buff, uchar *father_buff, + uchar *father_key_pos, my_off_t father_page) +{ + my_bool right; + uint k_length,father_length,father_keylength,nod_flag,curr_keylength, + right_length,left_length,new_right_length,new_left_length,extra_length, + length,keys; + uchar *pos,*buff,*extra_buff; + my_off_t next_page,new_pos; + uchar tmp_part_key[MI_MAX_KEY_BUFF]; + DBUG_ENTER("_mi_balance_page"); + + k_length=keyinfo->keylength; + father_length=mi_getint(father_buff); + father_keylength=k_length+info->s->base.key_reflength; + nod_flag=mi_test_if_nod(curr_buff); + curr_keylength=k_length+nod_flag; + info->page_changed=1; + + if ((father_key_pos != father_buff+father_length && + (info->state->records & 1)) || + father_key_pos == father_buff+2+info->s->base.key_reflength) + { + right=1; + next_page= _mi_kpos(info->s->base.key_reflength, + father_key_pos+father_keylength); + buff=info->buff; + DBUG_PRINT("test",("use right page: %lu", (ulong) next_page)); + } + else + { + right=0; + father_key_pos-=father_keylength; + next_page= _mi_kpos(info->s->base.key_reflength,father_key_pos); + /* Fix that curr_buff is to left */ + buff=curr_buff; curr_buff=info->buff; + DBUG_PRINT("test",("use left page: %lu", (ulong) next_page)); + } /* father_key_pos ptr to parting key */ + + if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,info->buff,0)) + goto err; + DBUG_DUMP("next",(uchar*) info->buff,mi_getint(info->buff)); + + /* Test if there is room to share keys */ + + left_length=mi_getint(curr_buff); + right_length=mi_getint(buff); + keys=(left_length+right_length-4-nod_flag*2)/curr_keylength; + + if ((right ? right_length : left_length) + curr_keylength <= + keyinfo->block_length) + { /* Merge buffs */ + new_left_length=2+nod_flag+(keys/2)*curr_keylength; + new_right_length=2+nod_flag+((keys+1)/2)*curr_keylength; + mi_putint(curr_buff,new_left_length,nod_flag); + mi_putint(buff,new_right_length,nod_flag); + + if (left_length < new_left_length) + { /* Move keys buff -> leaf */ + pos=curr_buff+left_length; + memcpy((uchar*) pos,(uchar*) father_key_pos, (size_t) k_length); + memcpy((uchar*) pos+k_length, (uchar*) buff+2, + (size_t) (length=new_left_length - left_length - k_length)); + pos=buff+2+length; + memcpy((uchar*) father_key_pos,(uchar*) pos,(size_t) k_length); + bmove((uchar*) buff+2,(uchar*) pos+k_length,new_right_length); + } + else + { /* Move keys -> buff */ + + bmove_upp((uchar*) buff+new_right_length,(uchar*) buff+right_length, + right_length-2); + length=new_right_length-right_length-k_length; + memcpy((uchar*) buff+2+length,father_key_pos,(size_t) k_length); + pos=curr_buff+new_left_length; + memcpy((uchar*) father_key_pos,(uchar*) pos,(size_t) k_length); + memcpy((uchar*) buff+2,(uchar*) pos+k_length,(size_t) length); + } + + if (_mi_write_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,info->buff) || + _mi_write_keypage(info,keyinfo,father_page,DFLT_INIT_HITS,father_buff)) + goto err; + DBUG_RETURN(0); + } + + /* curr_buff[] and buff[] are full, lets split and make new nod */ + + extra_buff=info->buff+info->s->base.max_key_block_length; + new_left_length=new_right_length=2+nod_flag+(keys+1)/3*curr_keylength; + if (keys == 5) /* Too few keys to balance */ + new_left_length-=curr_keylength; + extra_length=nod_flag+left_length+right_length- + new_left_length-new_right_length-curr_keylength; + DBUG_PRINT("info",("left_length: %d right_length: %d new_left_length: %d new_right_length: %d extra_length: %d", + left_length, right_length, + new_left_length, new_right_length, + extra_length)); + mi_putint(curr_buff,new_left_length,nod_flag); + mi_putint(buff,new_right_length,nod_flag); + mi_putint(extra_buff,extra_length+2,nod_flag); + + /* move first largest keys to new page */ + pos=buff+right_length-extra_length; + memcpy((uchar*) extra_buff+2,pos,(size_t) extra_length); + /* Save new parting key */ + memcpy(tmp_part_key, pos-k_length,k_length); + /* Make place for new keys */ + bmove_upp((uchar*) buff+new_right_length,(uchar*) pos-k_length, + right_length-extra_length-k_length-2); + /* Copy keys from left page */ + pos= curr_buff+new_left_length; + memcpy((uchar*) buff+2,(uchar*) pos+k_length, + (size_t) (length=left_length-new_left_length-k_length)); + /* Copy old parting key */ + memcpy((uchar*) buff+2+length,father_key_pos,(size_t) k_length); + + /* Move new parting keys up to caller */ + memcpy((uchar*) (right ? key : father_key_pos),pos,(size_t) k_length); + memcpy((uchar*) (right ? father_key_pos : key),tmp_part_key, k_length); + + if ((new_pos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR) + goto err; + _mi_kpointer(info,key+k_length,new_pos); + if (_mi_write_keypage(info,keyinfo,(right ? new_pos : next_page), + DFLT_INIT_HITS,info->buff) || + _mi_write_keypage(info,keyinfo,(right ? next_page : new_pos), + DFLT_INIT_HITS,extra_buff)) + goto err; + + DBUG_RETURN(1); /* Middle key up */ + +err: + DBUG_RETURN(-1); +} /* _mi_balance_page */ + +/********************************************************************** + * Bulk insert code * + **********************************************************************/ + +typedef struct { + MI_INFO *info; + uint keynr; +} bulk_insert_param; + +int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key, + uint key_length) +{ + int error; + DBUG_ENTER("_mi_ck_write_tree"); + + error= tree_insert(&info->bulk_insert[keynr], key, + key_length + info->s->rec_reflength, + info->bulk_insert[keynr].custom_arg) ? 0 : HA_ERR_OUT_OF_MEM ; + + DBUG_RETURN(error); +} /* _mi_ck_write_tree */ + + +/* typeof(_mi_keys_compare)=qsort_cmp2 */ + +static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2) +{ + uint not_used[2]; + return ha_key_cmp(param->info->s->keyinfo[param->keynr].seg, + key1, key2, USE_WHOLE_KEY, SEARCH_SAME, + not_used); +} + + +static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param) +{ + /* + Probably I can use info->lastkey here, but I'm not sure, + and to be safe I'd better use local lastkey. + */ + uchar lastkey[MI_MAX_KEY_BUFF]; + uint keylen; + MI_KEYDEF *keyinfo; + + switch (mode) { + case free_init: + if (param->info->s->concurrent_insert) + { + rw_wrlock(¶m->info->s->key_root_lock[param->keynr]); + param->info->s->keyinfo[param->keynr].version++; + } + return 0; + case free_free: + keyinfo=param->info->s->keyinfo+param->keynr; + keylen=_mi_keylength(keyinfo, key); + memcpy(lastkey, key, keylen); + return _mi_ck_write_btree(param->info,param->keynr,lastkey, + keylen - param->info->s->rec_reflength); + case free_end: + if (param->info->s->concurrent_insert) + rw_unlock(¶m->info->s->key_root_lock[param->keynr]); + return 0; + } + return -1; +} + + +int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows) +{ + MYISAM_SHARE *share=info->s; + MI_KEYDEF *key=share->keyinfo; + bulk_insert_param *params; + uint i, num_keys, total_keylength; + ulonglong key_map; + DBUG_ENTER("_mi_init_bulk_insert"); + DBUG_PRINT("enter",("cache_size: %lu", cache_size)); + + DBUG_ASSERT(!info->bulk_insert && + (!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT)); + + mi_clear_all_keys_active(key_map); + for (i=total_keylength=num_keys=0 ; i < share->base.keys ; i++) + { + if (! (key[i].flag & HA_NOSAME) && (share->base.auto_key != i + 1) && + mi_is_key_active(share->state.key_map, i)) + { + num_keys++; + mi_set_key_active(key_map, i); + total_keylength+=key[i].maxlength+TREE_ELEMENT_EXTRA_SIZE; + } + } + + if (num_keys==0 || + num_keys * MI_MIN_SIZE_BULK_INSERT_TREE > cache_size) + DBUG_RETURN(0); + + if (rows && rows*total_keylength < cache_size) + cache_size=rows; + else + cache_size/=total_keylength*16; + + info->bulk_insert=(TREE *) + my_malloc((sizeof(TREE)*share->base.keys+ + sizeof(bulk_insert_param)*num_keys),MYF(0)); + + if (!info->bulk_insert) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + + params=(bulk_insert_param *)(info->bulk_insert+share->base.keys); + for (i=0 ; i < share->base.keys ; i++) + { + if (mi_is_key_active(key_map, i)) + { + params->info=info; + params->keynr=i; + /* Only allocate a 16'th of the buffer at a time */ + init_tree(&info->bulk_insert[i], + cache_size * key[i].maxlength, + cache_size * key[i].maxlength, 0, + (qsort_cmp2)keys_compare, 0, + (tree_element_free) keys_free, (void *)params++); + } + else + info->bulk_insert[i].root=0; + } + + DBUG_RETURN(0); +} + +void mi_flush_bulk_insert(MI_INFO *info, uint inx) +{ + if (info->bulk_insert) + { + if (is_tree_inited(&info->bulk_insert[inx])) + reset_tree(&info->bulk_insert[inx]); + } +} + +void mi_end_bulk_insert(MI_INFO *info) +{ + if (info->bulk_insert) + { + uint i; + for (i=0 ; i < info->s->base.keys ; i++) + { + if (is_tree_inited(& info->bulk_insert[i])) + { + delete_tree(& info->bulk_insert[i]); + } + } + my_free((void *)info->bulk_insert, MYF(0)); + info->bulk_insert=0; + } +} Added: trunk/src/myisam_ftdump.c =================================================================== --- trunk/src/myisam_ftdump.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/myisam_ftdump.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,276 @@ +/* Copyright (C) 2001-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sergei A. Golubchik, who has a shared copyright to this code + added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */ + +#include "ftdefs.h" +#include + +static void usage(); +static void complain(int val); +static my_bool get_one_option(int, const struct my_option *, char *); + +static int count=0, stats=0, dump=0, lstats=0; +static my_bool verbose; +static char *query=NULL; +static uint lengths[256]; + +#define MAX_LEN (HA_FT_MAXBYTELEN+10) +#define HOW_OFTEN_TO_WRITE 10000 + +static struct my_option my_long_options[] = +{ + {"help", 'h', "Display help and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"help", '?', "Synonym for -h.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"count", 'c', "Calculate per-word stats (counts and global weights).", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"dump", 'd', "Dump index (incl. data offsets and word weights).", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"length", 'l', "Report length distribution.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"stats", 's', "Report global stats.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Be verbose.", + (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + + +int main(int argc,char *argv[]) +{ + int error=0, subkeys; + uint keylen, keylen2=0, inx, doc_cnt=0; + float weight= 1.0; + double gws, min_gws=0, avg_gws=0; + MI_INFO *info; + char buf[MAX_LEN], buf2[MAX_LEN], buf_maxlen[MAX_LEN], buf_min_gws[MAX_LEN]; + ulong total=0, maxlen=0, uniq=0, max_doc_cnt=0; + struct { MI_INFO *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */ + + MY_INIT(argv[0]); + if ((error= handle_options(&argc, &argv, my_long_options, get_one_option))) + exit(error); + if (count || dump) + verbose=0; + if (!count && !dump && !lstats && !query) + stats=1; + + if (verbose) + setbuf(stdout,NULL); + + if (argc < 2) + usage(); + + { + char *end; + inx= (uint) strtoll(argv[1], &end, 10); + if (*end) + usage(); + } + + init_key_cache(dflt_key_cache,MI_KEY_BLOCK_LENGTH,USE_BUFFER_INIT, 0, 0); + + if (!(info=mi_open(argv[0], O_RDONLY, + HA_OPEN_ABORT_IF_LOCKED|HA_OPEN_FROM_SQL_LAYER))) + { + error=my_errno; + goto err; + } + + *buf2=0; + aio->info=info; + + if ((inx >= info->s->base.keys) || + !(info->s->keyinfo[inx].flag & HA_FULLTEXT)) + { + printf("Key %d in table %s is not a FULLTEXT key\n", inx, info->filename); + goto err; + } + + mi_lock_database(info, F_EXTRA_LCK); + + info->lastpos= HA_OFFSET_ERROR; + info->update|= HA_STATE_PREV_FOUND; + + while (!(error=mi_rnext(info,NULL,inx))) + { + keylen=*(info->lastkey); + + subkeys=ft_sintXkorr(info->lastkey+keylen+1); + if (subkeys >= 0) + weight=*(float*)&subkeys; + +#ifdef HAVE_SNPRINTF + snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1); +#else + sprintf(buf,"%.*s",(int) keylen,info->lastkey+1); +#endif + my_casedn_str(default_charset_info,buf); + total++; + lengths[keylen]++; + + if (count || stats) + { + if (strcmp(buf, buf2)) + { + if (*buf2) + { + uniq++; + avg_gws+=gws=GWS_IN_USE; + if (count) + printf("%9u %20.7f %s\n",doc_cnt,gws,buf2); + if (maxlen= 0 ? 1 : -subkeys); + } + if (dump) + { + if (subkeys>=0) + printf("%9lx %20.7f %s\n", (long) info->lastpos,weight,buf); + else + printf("%9lx => %17d %s\n",(long) info->lastpos,-subkeys,buf); + } + if (verbose && (total%HOW_OFTEN_TO_WRITE)==0) + printf("%10ld\r",total); + } + mi_lock_database(info, F_UNLCK); + + if (count || stats) + { + if (*buf2) + { + uniq++; + avg_gws+=gws=GWS_IN_USE; + if (count) + printf("%9u %20.7f %s\n",doc_cnt,gws,buf2); + if (maxlen= total/2) + break; + } + printf("Total rows: %lu\nTotal words: %lu\n" + "Unique words: %lu\nLongest word: %lu chars (%s)\n" + "Median length: %u\n" + "Average global weight: %f\n" + "Most common word: %lu times, weight: %f (%s)\n", + (long) info->state->records, total, uniq, maxlen, buf_maxlen, + inx, avg_gws/uniq, max_doc_cnt, min_gws, buf_min_gws); + } + if (lstats) + { + count=0; + for (inx=0; inx<256; inx++) + { + count+=lengths[inx]; + if (count && lengths[inx]) + printf("%3u: %10lu %5.2f%% %20lu %4.1f%%\n", inx, + (ulong) lengths[inx],100.0*lengths[inx]/total,(ulong) count, + 100.0*count/total); + } + } + +err: + if (error && error != HA_ERR_END_OF_FILE) + printf("got error %d\n",my_errno); + if (info) + mi_close(info); + return 0; +} + + +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument __attribute__((unused))) +{ + switch(optid) { + case 'd': + dump=1; + complain(count || query); + break; + case 's': + stats=1; + complain(query!=0); + break; + case 'c': + count= 1; + complain(dump || query); + break; + case 'l': + lstats=1; + complain(query!=0); + break; + case '?': + case 'h': + usage(); + } + return 0; +} + +#include + +static void usage() +{ + printf("Use: myisam_ftdump \n"); + my_print_help(my_long_options); + my_print_variables(my_long_options); + NETWARE_SET_SCREEN_MODE(1); + exit(1); +} + +#include + +static void complain(int val) /* Kinda assert :-) */ +{ + if (val) + { + printf("You cannot use these options together!\n"); + exit(1); + } +} Added: trunk/src/myisamchk.c =================================================================== --- trunk/src/myisamchk.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/myisamchk.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1814 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Describe, check and repair of MyISAM tables */ + +#include "fulltext.h" + +#include +#include +#include +#ifdef HAVE_SYS_VADVICE_H +#include +#endif +#ifdef HAVE_SYS_MMAN_H +#include +#endif +SET_STACK_SIZE(9000) /* Minimum stack size for program */ + +#ifndef USE_RAID +#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G) +#define my_raid_delete(A,B,C) my_delete(A,B) +#endif + +static uint decode_bits; +static char **default_argv; +static const char *load_default_groups[]= { "myisamchk", 0 }; +static const char *set_collation_name, *opt_tmpdir; +static CHARSET_INFO *set_collation; +static long opt_myisam_block_size; +static long opt_key_cache_block_size; +static const char *my_progname_short; +static int stopwords_inited= 0; +static MY_TMPDIR myisamchk_tmpdir; + +static const char *type_names[]= +{ "impossible","char","binary", "short", "long", "float", + "double","number","unsigned short", + "unsigned long","longlong","ulonglong","int24", + "uint24","int8","varchar", "varbin","?", + "?"}; + +static const char *prefix_packed_txt="packed ", + *bin_packed_txt="prefix ", + *diff_txt="stripped ", + *null_txt="NULL", + *blob_txt="BLOB "; + +static const char *field_pack[]= +{"","no endspace", "no prespace", + "no zeros", "blob", "constant", "table-lockup", + "always zero","varchar","unique-hash","?","?"}; + +static const char *myisam_stats_method_str="nulls_unequal"; + +static void get_options(int *argc,char * * *argv); +static void print_version(void); +static void usage(void); +static int myisamchk(MI_CHECK *param, char *filename); +static void descript(MI_CHECK *param, register MI_INFO *info, char * name); +static int mi_sort_records(MI_CHECK *param, register MI_INFO *info, + char * name, uint sort_key, + my_bool write_info, my_bool update_index); +static int sort_record_index(MI_SORT_PARAM *sort_param, MI_INFO *info, + MI_KEYDEF *keyinfo, + my_off_t page,uchar *buff,uint sortkey, + File new_file, my_bool update_index); + +MI_CHECK check_param; + + /* Main program */ + +int main(int argc, char **argv) +{ + int error; + MY_INIT(argv[0]); + my_progname_short= my_progname+dirname_length(my_progname); + + myisamchk_init(&check_param); + check_param.opt_lock_memory=1; /* Lock memory if possible */ + check_param.using_global_keycache = 0; + get_options(&argc,(char***) &argv); + myisam_quick_table_bits=decode_bits; + error=0; + while (--argc >= 0) + { + int new_error=myisamchk(&check_param, *(argv++)); + if ((check_param.testflag & T_REP_ANY) != T_REP) + check_param.testflag&= ~T_REP; + VOID(fflush(stdout)); + VOID(fflush(stderr)); + if ((check_param.error_printed | check_param.warning_printed) && + (check_param.testflag & T_FORCE_CREATE) && + (!(check_param.testflag & (T_REP | T_REP_BY_SORT | T_SORT_RECORDS | + T_SORT_INDEX)))) + { + uint old_testflag=check_param.testflag; + if (!(check_param.testflag & T_REP)) + check_param.testflag|= T_REP_BY_SORT; + check_param.testflag&= ~T_EXTEND; /* Don't needed */ + error|=myisamchk(&check_param, argv[-1]); + check_param.testflag= old_testflag; + VOID(fflush(stdout)); + VOID(fflush(stderr)); + } + else + error|=new_error; + if (argc && (!(check_param.testflag & T_SILENT) || check_param.testflag & T_INFO)) + { + puts("\n---------\n"); + VOID(fflush(stdout)); + } + } + if (check_param.total_files > 1) + { /* Only if descript */ + char buff[22],buff2[22]; + if (!(check_param.testflag & T_SILENT) || check_param.testflag & T_INFO) + puts("\n---------\n"); + printf("\nTotal of all %d MyISAM-files:\nData records: %9s Deleted blocks: %9s\n",check_param.total_files,llstr(check_param.total_records,buff), + llstr(check_param.total_deleted,buff2)); + } + free_defaults(default_argv); + free_tmpdir(&myisamchk_tmpdir); + ft_free_stopwords(); + my_end(check_param.testflag & T_INFO ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR); + exit(error); +#ifndef _lint + return 0; /* No compiler warning */ +#endif +} /* main */ + +enum options_mc { + OPT_CHARSETS_DIR=256, OPT_SET_COLLATION,OPT_START_CHECK_POS, + OPT_CORRECT_CHECKSUM, OPT_KEY_BUFFER_SIZE, + OPT_KEY_CACHE_BLOCK_SIZE, OPT_MYISAM_BLOCK_SIZE, + OPT_READ_BUFFER_SIZE, OPT_WRITE_BUFFER_SIZE, OPT_SORT_BUFFER_SIZE, + OPT_SORT_KEY_BLOCKS, OPT_DECODE_BITS, OPT_FT_MIN_WORD_LEN, + OPT_FT_MAX_WORD_LEN, OPT_FT_STOPWORD_FILE, + OPT_MAX_RECORD_LENGTH, OPT_AUTO_CLOSE, OPT_STATS_METHOD +}; + +static struct my_option my_long_options[] = +{ + {"analyze", 'a', + "Analyze distribution of keys. Will make some joins in MySQL faster. You can check the calculated distribution.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifdef __NETWARE__ + {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#endif + {"block-search", 'b', + "No help available.", + 0, 0, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"backup", 'B', + "Make a backup of the .MYD file as 'filename-time.BAK'.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"character-sets-dir", OPT_CHARSETS_DIR, + "Directory where character sets are.", + (uchar**) &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"check", 'c', + "Check table for errors.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"check-only-changed", 'C', + "Check only tables that have changed since last check. It also applies to other requested actions (e.g. --analyze will be ignored if the table is already analyzed).", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"correct-checksum", OPT_CORRECT_CHECKSUM, + "Correct checksum information for table.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifndef DBUG_OFF + {"debug", '#', + "Output debug log. Often this is 'd:t:o,filename'.", + 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#endif + {"description", 'd', + "Prints some information about table.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"data-file-length", 'D', + "Max length of data file (when recreating data-file when it's full).", + (uchar**) &check_param.max_data_file_length, + (uchar**) &check_param.max_data_file_length, + 0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"extend-check", 'e', + "If used when checking a table, ensure that the table is 100 percent consistent, which will take a long time. If used when repairing a table, try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option with repair if you are not totally desperate.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"fast", 'F', + "Check only tables that haven't been closed properly. It also applies to other requested actions (e.g. --analyze will be ignored if the table is already analyzed).", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"force", 'f', + "Restart with -r if there are any errors in the table. States will be updated as with --update-state.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"HELP", 'H', + "Display this help and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"help", '?', + "Display this help and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"information", 'i', + "Print statistics information about table that is checked.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"keys-used", 'k', + "Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts.", + (uchar**) &check_param.keys_in_use, + (uchar**) &check_param.keys_in_use, + 0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0}, + {"max-record-length", OPT_MAX_RECORD_LENGTH, + "Skip rows bigger than this if myisamchk can't allocate memory to hold it", + (uchar**) &check_param.max_record_length, + (uchar**) &check_param.max_record_length, + 0, GET_ULL, REQUIRED_ARG, LONGLONG_MAX, 0, LONGLONG_MAX, 0, 0, 0}, + {"medium-check", 'm', + "Faster than extend-check, but only finds 99.99% of all errors. Should be good enough for most cases.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"quick", 'q', "Faster repair by not modifying the data file.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"read-only", 'T', + "Don't mark table as checked.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"recover", 'r', + "Can fix almost anything except unique keys that aren't unique.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"parallel-recover", 'p', + "Same as '-r' but creates all the keys in parallel.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"safe-recover", 'o', + "Uses old recovery method; Slower than '-r' but can handle a couple of cases where '-r' reports that it can't fix the data file.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"sort-recover", 'n', + "Force recovering with sorting even if the temporary file was very big.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifdef DEBUG + {"start-check-pos", OPT_START_CHECK_POS, + "No help available.", + 0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif + {"set-auto-increment", 'A', + "Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.", + (uchar**) &check_param.auto_increment_value, + (uchar**) &check_param.auto_increment_value, + 0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"set-collation", OPT_SET_COLLATION, + "Change the collation used by the index", + (uchar**) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"set-variable", 'O', + "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"silent", 's', + "Only print errors. One can use two -s to make myisamchk very silent.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"sort-index", 'S', + "Sort index blocks. This speeds up 'read-next' in applications.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"sort-records", 'R', + "Sort records according to an index. This makes your data much more localized and may speed up things. (It may be VERY slow to do a sort the first time!)", + (uchar**) &check_param.opt_sort_key, + (uchar**) &check_param.opt_sort_key, + 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"tmpdir", 't', + "Path for temporary files.", + (uchar**) &opt_tmpdir, + 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"update-state", 'U', + "Mark tables as crashed if any errors were found.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"unpack", 'u', + "Unpack file packed with myisampack.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"verbose", 'v', + "Print more information. This can be used with --description and --check. Use many -v for more verbosity!", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"version", 'V', + "Print version and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"wait", 'w', + "Wait if table is locked.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + { "key_buffer_size", OPT_KEY_BUFFER_SIZE, "", + (uchar**) &check_param.use_buffers, (uchar**) &check_param.use_buffers, 0, + GET_ULONG, REQUIRED_ARG, (long) USE_BUFFER_INIT, (long) MALLOC_OVERHEAD, + (long) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0}, + { "key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE, "", + (uchar**) &opt_key_cache_block_size, + (uchar**) &opt_key_cache_block_size, 0, + GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, + MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0}, + { "myisam_block_size", OPT_MYISAM_BLOCK_SIZE, "", + (uchar**) &opt_myisam_block_size, (uchar**) &opt_myisam_block_size, 0, + GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, + MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0}, + { "read_buffer_size", OPT_READ_BUFFER_SIZE, "", + (uchar**) &check_param.read_buffer_length, + (uchar**) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG, + (long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD, + (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0}, + { "write_buffer_size", OPT_WRITE_BUFFER_SIZE, "", + (uchar**) &check_param.write_buffer_length, + (uchar**) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG, + (long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD, + (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0}, + { "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "", + (uchar**) &check_param.sort_buffer_length, + (uchar**) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG, + (long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD), + (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0}, + { "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "", + (uchar**) &check_param.sort_key_blocks, + (uchar**) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG, + BUFFERS_WHEN_SORTING, 4L, 100L, 0L, 1L, 0}, + { "decode_bits", OPT_DECODE_BITS, "", (uchar**) &decode_bits, + (uchar**) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0}, + { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (uchar**) &ft_min_word_len, + (uchar**) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, + 0, 1, 0}, + { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (uchar**) &ft_max_word_len, + (uchar**) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, + HA_FT_MAXCHARLEN, 0, 1, 0}, + { "ft_stopword_file", OPT_FT_STOPWORD_FILE, + "Use stopwords from this file instead of built-in list.", + (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR, + REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"stats_method", OPT_STATS_METHOD, + "Specifies how index statistics collection code should treat NULLs. " + "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), " + "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".", + (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + + +#include + +static void print_version(void) +{ + printf("%s Ver 2.7 for %s at %s\n", my_progname, SYSTEM_TYPE, + MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); +} + + +static void usage(void) +{ + print_version(); + puts("By Monty, for your professional use"); + puts("This software comes with NO WARRANTY: see the PUBLIC for details.\n"); + puts("Description, check and repair of MyISAM tables."); + puts("Used without options all tables on the command will be checked for errors"); + printf("Usage: %s [OPTIONS] tables[.MYI]\n", my_progname_short); + printf("\nGlobal options:\n"); +#ifndef DBUG_OFF + printf("\ + -#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n"); +#endif + printf("\ + -?, --help Display this help and exit.\n\ + -O, --set-variable var=option.\n\ + Change the value of a variable. Please note that\n\ + this option is deprecated; you can set variables\n\ + directly with '--variable-name=value'.\n\ + -t, --tmpdir=path Path for temporary files. Multiple paths can be\n\ + specified, separated by "); +#if defined( __WIN__) || defined(__NETWARE__) + printf("semicolon (;)"); +#else + printf("colon (:)"); +#endif + printf(", they will be used\n\ + in a round-robin fashion.\n\ + -s, --silent Only print errors. One can use two -s to make\n\ + myisamchk very silent.\n\ + -v, --verbose Print more information. This can be used with\n\ + --description and --check. Use many -v for more verbosity.\n\ + -V, --version Print version and exit.\n\ + -w, --wait Wait if table is locked.\n\n"); +#ifdef DEBUG + puts(" --start-check-pos=# Start reading file at given offset.\n"); +#endif + + puts("Check options (check is the default action for myisamchk):\n\ + -c, --check Check table for errors.\n\ + -e, --extend-check Check the table VERY throughly. Only use this in\n\ + extreme cases as myisamchk should normally be able to\n\ + find out if the table is ok even without this switch.\n\ + -F, --fast Check only tables that haven't been closed properly.\n\ + -C, --check-only-changed\n\ + Check only tables that have changed since last check.\n\ + -f, --force Restart with '-r' if there are any errors in the table.\n\ + States will be updated as with '--update-state'.\n\ + -i, --information Print statistics information about table that is checked.\n\ + -m, --medium-check Faster than extend-check, but only finds 99.99% of\n\ + all errors. Should be good enough for most cases.\n\ + -U --update-state Mark tables as crashed if you find any errors.\n\ + -T, --read-only Don't mark table as checked.\n"); + + puts("Repair options (When using '-r' or '-o'):\n\ + -B, --backup Make a backup of the .MYD file as 'filename-time.BAK'.\n\ + --correct-checksum Correct checksum information for table.\n\ + -D, --data-file-length=# Max length of data file (when recreating data\n\ + file when it's full).\n\ + -e, --extend-check Try to recover every possible row from the data file\n\ + Normally this will also find a lot of garbage rows;\n\ + Don't use this option if you are not totally desperate.\n\ + -f, --force Overwrite old temporary files.\n\ + -k, --keys-used=# Tell MyISAM to update only some specific keys. # is a\n\ + bit mask of which keys to use. This can be used to\n\ + get faster inserts.\n\ + --max-record-length=#\n\ + Skip rows bigger than this if myisamchk can't allocate\n\ + memory to hold it.\n\ + -r, --recover Can fix almost anything except unique keys that aren't\n\ + unique.\n\ + -n, --sort-recover Forces recovering with sorting even if the temporary\n\ + file would be very big.\n\ + -p, --parallel-recover\n\ + Uses the same technique as '-r' and '-n', but creates\n\ + all the keys in parallel, in different threads.\n\ + -o, --safe-recover Uses old recovery method; Slower than '-r' but can\n\ + handle a couple of cases where '-r' reports that it\n\ + can't fix the data file.\n\ + --character-sets-dir=...\n\ + Directory where character sets are.\n\ + --set-collation=name\n\ + Change the collation used by the index.\n\ + -q, --quick Faster repair by not modifying the data file.\n\ + One can give a second '-q' to force myisamchk to\n\ + modify the original datafile in case of duplicate keys.\n\ + NOTE: Tables where the data file is currupted can't be\n\ + fixed with this option.\n\ + -u, --unpack Unpack file packed with myisampack.\n\ +"); + + puts("Other actions:\n\ + -a, --analyze Analyze distribution of keys. Will make some joins in\n\ + MySQL faster. You can check the calculated distribution\n\ + by using '--description --verbose table_name'.\n\ + --stats_method=name Specifies how index statistics collection code should\n\ + treat NULLs. Possible values of name are \"nulls_unequal\"\n\ + (default for 4.1/5.0), \"nulls_equal\" (emulate 4.0), and \n\ + \"nulls_ignored\".\n\ + -d, --description Prints some information about table.\n\ + -A, --set-auto-increment[=value]\n\ + Force auto_increment to start at this or higher value\n\ + If no value is given, then sets the next auto_increment\n\ + value to the highest used value for the auto key + 1.\n\ + -S, --sort-index Sort index blocks. This speeds up 'read-next' in\n\ + applications.\n\ + -R, --sort-records=#\n\ + Sort records according to an index. This makes your\n\ + data much more localized and may speed up things\n\ + (It may be VERY slow to do a sort the first time!).\n\ + -b, --block-search=#\n\ + Find a record, a block at given offset belongs to."); + + print_defaults("my", load_default_groups); + my_print_variables(my_long_options); +} + +#include + +const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal", + "nulls_ignored", NullS}; +TYPELIB myisam_stats_method_typelib= { + array_elements(myisam_stats_method_names) - 1, "", + myisam_stats_method_names, NULL}; + + /* Read options */ + +static my_bool +get_one_option(int optid, + const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { +#ifdef __NETWARE__ + case OPT_AUTO_CLOSE: + setscreenmode(SCR_AUTOCLOSE_ON_EXIT); + break; +#endif + case 'a': + if (argument == disabled_my_option) + check_param.testflag&= ~T_STATISTICS; + else + check_param.testflag|= T_STATISTICS; + break; + case 'A': + if (argument) + check_param.auto_increment_value= strtoull(argument, NULL, 0); + else + check_param.auto_increment_value= 0; /* Set to max used value */ + check_param.testflag|= T_AUTO_INC; + break; + case 'b': + check_param.search_after_block= strtoul(argument, NULL, 10); + break; + case 'B': + if (argument == disabled_my_option) + check_param.testflag&= ~T_BACKUP_DATA; + else + check_param.testflag|= T_BACKUP_DATA; + break; + case 'c': + if (argument == disabled_my_option) + check_param.testflag&= ~T_CHECK; + else + check_param.testflag|= T_CHECK; + break; + case 'C': + if (argument == disabled_my_option) + check_param.testflag&= ~(T_CHECK | T_CHECK_ONLY_CHANGED); + else + check_param.testflag|= T_CHECK | T_CHECK_ONLY_CHANGED; + break; + case 'D': + check_param.max_data_file_length=strtoll(argument, NULL, 10); + break; + case 's': /* silent */ + if (argument == disabled_my_option) + check_param.testflag&= ~(T_SILENT | T_VERY_SILENT); + else + { + if (check_param.testflag & T_SILENT) + check_param.testflag|= T_VERY_SILENT; + check_param.testflag|= T_SILENT; + check_param.testflag&= ~T_WRITE_LOOP; + } + break; + case 'w': + if (argument == disabled_my_option) + check_param.testflag&= ~T_WAIT_FOREVER; + else + check_param.testflag|= T_WAIT_FOREVER; + break; + case 'd': /* description if isam-file */ + if (argument == disabled_my_option) + check_param.testflag&= ~T_DESCRIPT; + else + check_param.testflag|= T_DESCRIPT; + break; + case 'e': /* extend check */ + if (argument == disabled_my_option) + check_param.testflag&= ~T_EXTEND; + else + check_param.testflag|= T_EXTEND; + break; + case 'i': + if (argument == disabled_my_option) + check_param.testflag&= ~T_INFO; + else + check_param.testflag|= T_INFO; + break; + case 'f': + if (argument == disabled_my_option) + { + check_param.tmpfile_createflag= O_RDWR | O_TRUNC | O_EXCL; + check_param.testflag&= ~(T_FORCE_CREATE | T_UPDATE_STATE); + } + else + { + check_param.tmpfile_createflag= O_RDWR | O_TRUNC; + check_param.testflag|= T_FORCE_CREATE | T_UPDATE_STATE; + } + break; + case 'F': + if (argument == disabled_my_option) + check_param.testflag&= ~T_FAST; + else + check_param.testflag|= T_FAST; + break; + case 'k': + check_param.keys_in_use= (ulonglong) strtoll(argument, NULL, 10); + break; + case 'm': + if (argument == disabled_my_option) + check_param.testflag&= ~T_MEDIUM; + else + check_param.testflag|= T_MEDIUM; /* Medium check */ + break; + case 'r': /* Repair table */ + check_param.testflag&= ~T_REP_ANY; + if (argument != disabled_my_option) + check_param.testflag|= T_REP_BY_SORT; + break; + case 'p': + check_param.testflag&= ~T_REP_ANY; + if (argument != disabled_my_option) + check_param.testflag|= T_REP_PARALLEL; + break; + case 'o': + check_param.testflag&= ~T_REP_ANY; + check_param.force_sort= 0; + if (argument != disabled_my_option) + { + check_param.testflag|= T_REP; + my_disable_async_io= 1; /* More safety */ + } + break; + case 'n': + check_param.testflag&= ~T_REP_ANY; + if (argument == disabled_my_option) + check_param.force_sort= 0; + else + { + check_param.testflag|= T_REP_BY_SORT; + check_param.force_sort= 1; + } + break; + case 'q': + if (argument == disabled_my_option) + check_param.testflag&= ~(T_QUICK | T_FORCE_UNIQUENESS); + else + check_param.testflag|= + (check_param.testflag & T_QUICK) ? T_FORCE_UNIQUENESS : T_QUICK; + break; + case 'u': + if (argument == disabled_my_option) + check_param.testflag&= ~(T_UNPACK | T_REP_BY_SORT); + else + check_param.testflag|= T_UNPACK | T_REP_BY_SORT; + break; + case 'v': /* Verbose */ + if (argument == disabled_my_option) + { + check_param.testflag&= ~T_VERBOSE; + check_param.verbose=0; + } + else + { + check_param.testflag|= T_VERBOSE; + check_param.verbose++; + } + break; + case 'R': /* Sort records */ + if (argument == disabled_my_option) + check_param.testflag&= ~T_SORT_RECORDS; + else + { + check_param.testflag|= T_SORT_RECORDS; + check_param.opt_sort_key= (uint) atoi(argument) - 1; + if (check_param.opt_sort_key >= MI_MAX_KEY) + { + fprintf(stderr, + "The value of the sort key is bigger than max key: %d.\n", + MI_MAX_KEY); + exit(1); + } + } + break; + case 'S': /* Sort index */ + if (argument == disabled_my_option) + check_param.testflag&= ~T_SORT_INDEX; + else + check_param.testflag|= T_SORT_INDEX; + break; + case 'T': + if (argument == disabled_my_option) + check_param.testflag&= ~T_READONLY; + else + check_param.testflag|= T_READONLY; + break; + case 'U': + if (argument == disabled_my_option) + check_param.testflag&= ~T_UPDATE_STATE; + else + check_param.testflag|= T_UPDATE_STATE; + break; + case '#': + if (argument == disabled_my_option) + { + DBUG_POP(); + } + else + { + DBUG_PUSH(argument ? argument : "d:t:o,/tmp/myisamchk.trace"); + } + break; + case 'V': + print_version(); + exit(0); + case OPT_CORRECT_CHECKSUM: + if (argument == disabled_my_option) + check_param.testflag&= ~T_CALC_CHECKSUM; + else + check_param.testflag|= T_CALC_CHECKSUM; + break; + case OPT_STATS_METHOD: + { + int method; + enum_mi_stats_method method_conv; + LINT_INIT(method_conv); + myisam_stats_method_str= argument; + if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) + { + fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); + exit(1); + } + switch (method-1) { + case 0: + method_conv= MI_STATS_METHOD_NULLS_EQUAL; + break; + case 1: + method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL; + break; + case 2: + method_conv= MI_STATS_METHOD_IGNORE_NULLS; + break; + default: assert(0); /* Impossible */ + } + check_param.stats_method= method_conv; + break; + } +#ifdef DEBUG /* Only useful if debugging */ + case OPT_START_CHECK_POS: + check_param.start_check_pos= strtoull(argument, NULL, 0); + break; +#endif + case 'H': + my_print_help(my_long_options); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} + + +static void get_options(register int *argc,register char ***argv) +{ + int ho_error; + + load_defaults("my", load_default_groups, argc, argv); + default_argv= *argv; + if (isatty(fileno(stdout))) + check_param.testflag|=T_WRITE_LOOP; + + if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) + exit(ho_error); + + /* If using repair, then update checksum if one uses --update-state */ + if ((check_param.testflag & T_UPDATE_STATE) && + (check_param.testflag & T_REP_ANY)) + check_param.testflag|= T_CALC_CHECKSUM; + + if (*argc == 0) + { + usage(); + exit(-1); + } + + if ((check_param.testflag & T_UNPACK) && + (check_param.testflag & (T_QUICK | T_SORT_RECORDS))) + { + VOID(fprintf(stderr, + "%s: --unpack can't be used with --quick or --sort-records\n", + my_progname_short)); + exit(1); + } + if ((check_param.testflag & T_READONLY) && + (check_param.testflag & + (T_REP_ANY | T_STATISTICS | T_AUTO_INC | + T_SORT_RECORDS | T_SORT_INDEX | T_FORCE_CREATE))) + { + VOID(fprintf(stderr, + "%s: Can't use --readonly when repairing or sorting\n", + my_progname_short)); + exit(1); + } + + if (init_tmpdir(&myisamchk_tmpdir, opt_tmpdir)) + exit(1); + + check_param.tmpdir=&myisamchk_tmpdir; + check_param.key_cache_block_size= opt_key_cache_block_size; + + if (set_collation_name) + if (!(set_collation= get_charset_by_name(set_collation_name, + MYF(MY_WME)))) + exit(1); + + myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size); + return; +} /* get options */ + + + /* Check table */ + +static int myisamchk(MI_CHECK *param, char * filename) +{ + int error,lock_type,recreate; + int rep_quick= param->testflag & (T_QUICK | T_FORCE_UNIQUENESS); + uint raid_chunks; + MI_INFO *info; + File datafile; + char llbuff[22],llbuff2[22]; + my_bool state_updated=0; + MYISAM_SHARE *share; + DBUG_ENTER("myisamchk"); + + param->out_flag=error=param->warning_printed=param->error_printed= + recreate=0; + datafile=0; + param->isam_file_name=filename; /* For error messages */ + if (!(info=mi_open(filename, + (param->testflag & (T_DESCRIPT | T_READONLY)) ? + O_RDONLY : O_RDWR, + HA_OPEN_FOR_REPAIR | + ((param->testflag & T_WAIT_FOREVER) ? + HA_OPEN_WAIT_IF_LOCKED : + (param->testflag & T_DESCRIPT) ? + HA_OPEN_IGNORE_IF_LOCKED : HA_OPEN_ABORT_IF_LOCKED)))) + { + /* Avoid twice printing of isam file name */ + param->error_printed=1; + switch (my_errno) { + case HA_ERR_CRASHED: + mi_check_print_error(param,"'%s' doesn't have a correct index definition. You need to recreate it before you can do a repair",filename); + break; + case HA_ERR_NOT_A_TABLE: + mi_check_print_error(param,"'%s' is not a MyISAM-table",filename); + break; + case HA_ERR_CRASHED_ON_USAGE: + mi_check_print_error(param,"'%s' is marked as crashed",filename); + break; + case HA_ERR_CRASHED_ON_REPAIR: + mi_check_print_error(param,"'%s' is marked as crashed after last repair",filename); + break; + case HA_ERR_OLD_FILE: + mi_check_print_error(param,"'%s' is a old type of MyISAM-table", filename); + break; + case HA_ERR_END_OF_FILE: + mi_check_print_error(param,"Couldn't read complete header from '%s'", filename); + break; + case EAGAIN: + mi_check_print_error(param,"'%s' is locked. Use -w to wait until unlocked",filename); + break; + case ENOENT: + mi_check_print_error(param,"File '%s' doesn't exist",filename); + break; + case EACCES: + mi_check_print_error(param,"You don't have permission to use '%s'",filename); + break; + default: + mi_check_print_error(param,"%d when opening MyISAM-table '%s'", + my_errno,filename); + break; + } + DBUG_RETURN(1); + } + share=info->s; + share->options&= ~HA_OPTION_READ_ONLY_DATA; /* We are modifing it */ + share->tot_locks-= share->r_locks; + share->r_locks=0; + raid_chunks=share->base.raid_chunks; + + /* + Skip the checking of the file if: + We are using --fast and the table is closed properly + We are using --check-only-changed-tables and the table hasn't changed + */ + if (param->testflag & (T_FAST | T_CHECK_ONLY_CHANGED)) + { + my_bool need_to_check= mi_is_crashed(info) || share->state.open_count != 0; + + if ((param->testflag & (T_REP_ANY | T_SORT_RECORDS)) && + ((share->state.changed & (STATE_CHANGED | STATE_CRASHED | + STATE_CRASHED_ON_REPAIR) || + !(param->testflag & T_CHECK_ONLY_CHANGED)))) + need_to_check=1; + + if (info->s->base.keys && info->state->records) + { + if ((param->testflag & T_STATISTICS) && + (share->state.changed & STATE_NOT_ANALYZED)) + need_to_check=1; + if ((param->testflag & T_SORT_INDEX) && + (share->state.changed & STATE_NOT_SORTED_PAGES)) + need_to_check=1; + if ((param->testflag & T_REP_BY_SORT) && + (share->state.changed & STATE_NOT_OPTIMIZED_KEYS)) + need_to_check=1; + } + if ((param->testflag & T_CHECK_ONLY_CHANGED) && + (share->state.changed & (STATE_CHANGED | STATE_CRASHED | + STATE_CRASHED_ON_REPAIR))) + need_to_check=1; + if (!need_to_check) + { + if (!(param->testflag & T_SILENT) || param->testflag & T_INFO) + printf("MyISAM file: %s is already checked\n",filename); + if (mi_close(info)) + { + mi_check_print_error(param,"%d when closing MyISAM-table '%s'", + my_errno,filename); + DBUG_RETURN(1); + } + DBUG_RETURN(0); + } + } + if ((param->testflag & (T_REP_ANY | T_STATISTICS | + T_SORT_RECORDS | T_SORT_INDEX)) && + (((param->testflag & T_UNPACK) && + share->data_file_type == COMPRESSED_RECORD) || + mi_uint2korr(share->state.header.state_info_length) != + MI_STATE_INFO_SIZE || + mi_uint2korr(share->state.header.base_info_length) != + MI_BASE_INFO_SIZE || + mi_is_any_intersect_keys_active(param->keys_in_use, share->base.keys, + ~share->state.key_map) || + test_if_almost_full(info) || + info->s->state.header.file_version[3] != myisam_file_magic[3] || + (set_collation && + set_collation->number != share->state.header.language) || + myisam_block_size != MI_KEY_BLOCK_LENGTH)) + { + if (set_collation) + param->language= set_collation->number; + if (recreate_table(param, &info,filename)) + { + VOID(fprintf(stderr, + "MyISAM-table '%s' is not fixed because of errors\n", + filename)); + return(-1); + } + recreate=1; + if (!(param->testflag & T_REP_ANY)) + { + param->testflag|=T_REP_BY_SORT; /* if only STATISTICS */ + if (!(param->testflag & T_SILENT)) + printf("- '%s' has old table-format. Recreating index\n",filename); + rep_quick|=T_QUICK; + } + share=info->s; + share->tot_locks-= share->r_locks; + share->r_locks=0; + } + + if (param->testflag & T_DESCRIPT) + { + param->total_files++; + param->total_records+=info->state->records; + param->total_deleted+=info->state->del; + descript(param, info, filename); + } + else + { + if (!stopwords_inited++) + ft_init_stopwords(); + + if (!(param->testflag & T_READONLY)) + lock_type = F_WRLCK; /* table is changed */ + else + lock_type= F_RDLCK; + if (info->lock_type == F_RDLCK) + info->lock_type=F_UNLCK; /* Read only table */ + if (_mi_readinfo(info,lock_type,0)) + { + mi_check_print_error(param,"Can't lock indexfile of '%s', error: %d", + filename,my_errno); + param->error_printed=0; + goto end2; + } + /* + _mi_readinfo() has locked the table. + We mark the table as locked (without doing file locks) to be able to + use functions that only works on locked tables (like row caching). + */ + mi_lock_database(info, F_EXTRA_LCK); + datafile=info->dfile; + + if (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX)) + { + if (param->testflag & T_REP_ANY) + { + ulonglong tmp=share->state.key_map; + mi_copy_keys_active(share->state.key_map, share->base.keys, + param->keys_in_use); + if (tmp != share->state.key_map) + info->update|=HA_STATE_CHANGED; + } + if (rep_quick && chk_del(param, info, param->testflag & ~T_VERBOSE)) + { + if (param->testflag & T_FORCE_CREATE) + { + rep_quick=0; + mi_check_print_info(param,"Creating new data file\n"); + } + else + { + error=1; + mi_check_print_error(param, + "Quick-recover aborted; Run recovery without switch 'q'"); + } + } + if (!error) + { + if ((param->testflag & (T_REP_BY_SORT | T_REP_PARALLEL)) && + (mi_is_any_key_active(share->state.key_map) || + (rep_quick && !param->keys_in_use && !recreate)) && + mi_test_if_sort_rep(info, info->state->records, + info->s->state.key_map, + param->force_sort)) + { + if (param->testflag & T_REP_BY_SORT) + error=mi_repair_by_sort(param,info,filename,rep_quick); + else + error=mi_repair_parallel(param,info,filename,rep_quick); + state_updated=1; + } + else if (param->testflag & T_REP_ANY) + error=mi_repair(param, info,filename,rep_quick); + } + if (!error && param->testflag & T_SORT_RECORDS) + { + /* + The data file is nowadays reopened in the repair code so we should + soon remove the following reopen-code + */ +#ifndef TO_BE_REMOVED + if (param->out_flag & O_NEW_DATA) + { /* Change temp file to org file */ + VOID(my_close(info->dfile,MYF(MY_WME))); /* Close new file */ + error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT, + raid_chunks, + MYF(0)); + if (mi_open_datafile(info,info->s, -1)) + error=1; + param->out_flag&= ~O_NEW_DATA; /* We are using new datafile */ + param->read_cache.file=info->dfile; + } +#endif + if (! error) + { + uint key; + /* + We can't update the index in mi_sort_records if we have a + prefix compressed or fulltext index + */ + my_bool update_index=1; + for (key=0 ; key < share->base.keys; key++) + if (share->keyinfo[key].flag & (HA_BINARY_PACK_KEY|HA_FULLTEXT)) + update_index=0; + + error=mi_sort_records(param,info,filename,param->opt_sort_key, + /* what is the following parameter for ? */ + (my_bool) !(param->testflag & T_REP), + update_index); + datafile=info->dfile; /* This is now locked */ + if (!error && !update_index) + { + if (param->verbose) + puts("Table had a compressed index; We must now recreate the index"); + error=mi_repair_by_sort(param,info,filename,1); + } + } + } + if (!error && param->testflag & T_SORT_INDEX) + error=mi_sort_index(param,info,filename); + if (!error) + share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED | + STATE_CRASHED_ON_REPAIR); + else + mi_mark_crashed(info); + } + else if ((param->testflag & T_CHECK) || !(param->testflag & T_AUTO_INC)) + { + if (!(param->testflag & T_SILENT) || param->testflag & T_INFO) + printf("Checking MyISAM file: %s\n",filename); + if (!(param->testflag & T_SILENT)) + printf("Data records: %7s Deleted blocks: %7s\n", + llstr(info->state->records,llbuff), + llstr(info->state->del,llbuff2)); + error =chk_status(param,info); + mi_intersect_keys_active(share->state.key_map, param->keys_in_use); + error =chk_size(param,info); + if (!error || !(param->testflag & (T_FAST | T_FORCE_CREATE))) + error|=chk_del(param, info,param->testflag); + if ((!error || (!(param->testflag & (T_FAST | T_FORCE_CREATE)) && + !param->start_check_pos))) + { + error|=chk_key(param, info); + if (!error && (param->testflag & (T_STATISTICS | T_AUTO_INC))) + error=update_state_info(param, info, + ((param->testflag & T_STATISTICS) ? + UPDATE_STAT : 0) | + ((param->testflag & T_AUTO_INC) ? + UPDATE_AUTO_INC : 0)); + } + if ((!rep_quick && !error) || + !(param->testflag & (T_FAST | T_FORCE_CREATE))) + { + if (param->testflag & (T_EXTEND | T_MEDIUM)) + VOID(init_key_cache(dflt_key_cache,opt_key_cache_block_size, + param->use_buffers, 0, 0)); + VOID(init_io_cache(¶m->read_cache,datafile, + (uint) param->read_buffer_length, + READ_CACHE, + (param->start_check_pos ? + param->start_check_pos : + share->pack.header_length), + 1, + MYF(MY_WME))); + lock_memory(param); + if ((info->s->options & (HA_OPTION_PACK_RECORD | + HA_OPTION_COMPRESS_RECORD)) || + (param->testflag & (T_EXTEND | T_MEDIUM))) + error|=chk_data_link(param, info, param->testflag & T_EXTEND); + error|=flush_blocks(param, share->key_cache, share->kfile); + VOID(end_io_cache(¶m->read_cache)); + } + if (!error) + { + if ((share->state.changed & STATE_CHANGED) && + (param->testflag & T_UPDATE_STATE)) + info->update|=HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; + share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED | + STATE_CRASHED_ON_REPAIR); + } + else if (!mi_is_crashed(info) && + (param->testflag & T_UPDATE_STATE)) + { /* Mark crashed */ + mi_mark_crashed(info); + info->update|=HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; + } + } + } + if ((param->testflag & T_AUTO_INC) || + ((param->testflag & T_REP_ANY) && info->s->base.auto_key)) + update_auto_increment_key(param, info, + (my_bool) !test(param->testflag & T_AUTO_INC)); + + if (!(param->testflag & T_DESCRIPT)) + { + if (info->update & HA_STATE_CHANGED && ! (param->testflag & T_READONLY)) + error|=update_state_info(param, info, + UPDATE_OPEN_COUNT | + (((param->testflag & T_REP_ANY) ? + UPDATE_TIME : 0) | + (state_updated ? UPDATE_STAT : 0) | + ((param->testflag & T_SORT_RECORDS) ? + UPDATE_SORT : 0))); + VOID(lock_file(param, share->kfile,0L,F_UNLCK,"indexfile",filename)); + info->update&= ~HA_STATE_CHANGED; + } + mi_lock_database(info, F_UNLCK); +end2: + if (mi_close(info)) + { + mi_check_print_error(param,"%d when closing MyISAM-table '%s'",my_errno,filename); + DBUG_RETURN(1); + } + if (error == 0) + { + if (param->out_flag & O_NEW_DATA) + error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT, + raid_chunks, + ((param->testflag & T_BACKUP_DATA) ? + MYF(MY_REDEL_MAKE_BACKUP) : MYF(0))); + if (param->out_flag & O_NEW_INDEX) + error|=change_to_newfile(filename,MI_NAME_IEXT,INDEX_TMP_EXT,0, + MYF(0)); + } + VOID(fflush(stdout)); VOID(fflush(stderr)); + if (param->error_printed) + { + if (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX)) + { + VOID(fprintf(stderr, + "MyISAM-table '%s' is not fixed because of errors\n", + filename)); + if (param->testflag & T_REP_ANY) + VOID(fprintf(stderr, + "Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag\n")); + } + else if (!(param->error_printed & 2) && + !(param->testflag & T_FORCE_CREATE)) + VOID(fprintf(stderr, + "MyISAM-table '%s' is corrupted\nFix it using switch \"-r\" or \"-o\"\n", + filename)); + } + else if (param->warning_printed && + ! (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX | + T_FORCE_CREATE))) + VOID(fprintf(stderr, "MyISAM-table '%s' is usable but should be fixed\n", + filename)); + VOID(fflush(stderr)); + DBUG_RETURN(error); +} /* myisamchk */ + + + /* Write info about table */ + +static void descript(MI_CHECK *param, register MI_INFO *info, char * name) +{ + uint key,keyseg_nr,field,start; + reg3 MI_KEYDEF *keyinfo; + reg2 HA_KEYSEG *keyseg; + reg4 const char *text; + char buff[160],length[10],*pos,*end; + enum en_fieldtype type; + MYISAM_SHARE *share=info->s; + char llbuff[22],llbuff2[22]; + DBUG_ENTER("describe"); + + printf("\nMyISAM file: %s\n",name); + fputs("Record format: ",stdout); + if (share->options & HA_OPTION_COMPRESS_RECORD) + puts("Compressed"); + else if (share->options & HA_OPTION_PACK_RECORD) + puts("Packed"); + else + puts("Fixed length"); + printf("Character set: %s (%d)\n", + get_charset_name(share->state.header.language), + share->state.header.language); + + if (param->testflag & T_VERBOSE) + { + printf("File-version: %d\n", + (int) share->state.header.file_version[3]); + if (share->state.create_time) + { + get_date(buff,1,share->state.create_time); + printf("Creation time: %s\n",buff); + } + if (share->state.check_time) + { + get_date(buff,1,share->state.check_time); + printf("Recover time: %s\n",buff); + } + pos=buff; + if (share->state.changed & STATE_CRASHED) + strmov(buff,"crashed"); + else + { + if (share->state.open_count) + pos=strmov(pos,"open,"); + if (share->state.changed & STATE_CHANGED) + pos=strmov(pos,"changed,"); + else + pos=strmov(pos,"checked,"); + if (!(share->state.changed & STATE_NOT_ANALYZED)) + pos=strmov(pos,"analyzed,"); + if (!(share->state.changed & STATE_NOT_OPTIMIZED_KEYS)) + pos=strmov(pos,"optimized keys,"); + if (!(share->state.changed & STATE_NOT_SORTED_PAGES)) + pos=strmov(pos,"sorted index pages,"); + pos[-1]=0; /* Remove extra ',' */ + } + printf("Status: %s\n",buff); + if (share->base.auto_key) + { + printf("Auto increment key: %13d Last value: %13s\n", + share->base.auto_key, + llstr(share->state.auto_increment,llbuff)); + } + if (share->base.raid_type) + { + printf("RAID: Type: %u Chunks: %u Chunksize: %lu\n", + share->base.raid_type, + share->base.raid_chunks, + share->base.raid_chunksize); + } + if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)) + printf("Checksum: %23s\n",llstr(info->state->checksum,llbuff)); +; + if (share->options & HA_OPTION_DELAY_KEY_WRITE) + printf("Keys are only flushed at close\n"); + + } + printf("Data records: %13s Deleted blocks: %13s\n", + llstr(info->state->records,llbuff),llstr(info->state->del,llbuff2)); + if (param->testflag & T_SILENT) + DBUG_VOID_RETURN; /* This is enough */ + + if (param->testflag & T_VERBOSE) + { +#ifdef USE_RELOC + printf("Init-relocation: %13s\n",llstr(share->base.reloc,llbuff)); +#endif + printf("Datafile parts: %13s Deleted data: %13s\n", + llstr(share->state.split,llbuff), + llstr(info->state->empty,llbuff2)); + printf("Datafile pointer (bytes):%9d Keyfile pointer (bytes):%9d\n", + share->rec_reflength,share->base.key_reflength); + printf("Datafile length: %13s Keyfile length: %13s\n", + llstr(info->state->data_file_length,llbuff), + llstr(info->state->key_file_length,llbuff2)); + + if (info->s->base.reloc == 1L && info->s->base.records == 1L) + puts("This is a one-record table"); + else + { + if (share->base.max_data_file_length != HA_OFFSET_ERROR || + share->base.max_key_file_length != HA_OFFSET_ERROR) + printf("Max datafile length: %13s Max keyfile length: %13s\n", + llstr(share->base.max_data_file_length-1,llbuff), + llstr(share->base.max_key_file_length-1,llbuff2)); + } + } + + printf("Recordlength: %13d\n",(int) share->base.pack_reclength); + if (! mi_is_all_keys_active(share->state.key_map, share->base.keys)) + { + longlong2str(share->state.key_map,buff,2); + printf("Using only keys '%s' of %d possibly keys\n", + buff, share->base.keys); + } + puts("\ntable description:"); + printf("Key Start Len Index Type"); + if (param->testflag & T_VERBOSE) + printf(" Rec/key Root Blocksize"); + VOID(putchar('\n')); + + for (key=keyseg_nr=0, keyinfo= &share->keyinfo[0] ; + key < share->base.keys; + key++,keyinfo++) + { + keyseg=keyinfo->seg; + if (keyinfo->flag & HA_NOSAME) text="unique "; + else if (keyinfo->flag & HA_FULLTEXT) text="fulltext "; + else text="multip."; + + pos=buff; + if (keyseg->flag & HA_REVERSE_SORT) + *pos++ = '-'; + pos=strmov(pos,type_names[keyseg->type]); + *pos++ = ' '; + *pos=0; + if (keyinfo->flag & HA_PACK_KEY) + pos=strmov(pos,prefix_packed_txt); + if (keyinfo->flag & HA_BINARY_PACK_KEY) + pos=strmov(pos,bin_packed_txt); + if (keyseg->flag & HA_SPACE_PACK) + pos=strmov(pos,diff_txt); + if (keyseg->flag & HA_BLOB_PART) + pos=strmov(pos,blob_txt); + if (keyseg->flag & HA_NULL_PART) + pos=strmov(pos,null_txt); + *pos=0; + + printf("%-4d%-6ld%-3d %-8s%-21s", + key+1,(long) keyseg->start+1,keyseg->length,text,buff); + if (share->state.key_root[key] != HA_OFFSET_ERROR) + llstr(share->state.key_root[key],buff); + else + buff[0]=0; + if (param->testflag & T_VERBOSE) + printf("%11lu %12s %10d", + share->state.rec_per_key_part[keyseg_nr++], + buff,keyinfo->block_length); + VOID(putchar('\n')); + while ((++keyseg)->type != HA_KEYTYPE_END) + { + pos=buff; + if (keyseg->flag & HA_REVERSE_SORT) + *pos++ = '-'; + pos=strmov(pos,type_names[keyseg->type]); + *pos++= ' '; + if (keyseg->flag & HA_SPACE_PACK) + pos=strmov(pos,diff_txt); + if (keyseg->flag & HA_BLOB_PART) + pos=strmov(pos,blob_txt); + if (keyseg->flag & HA_NULL_PART) + pos=strmov(pos,null_txt); + *pos=0; + printf(" %-6ld%-3d %-21s", + (long) keyseg->start+1,keyseg->length,buff); + if (param->testflag & T_VERBOSE) + printf("%11lu", share->state.rec_per_key_part[keyseg_nr++]); + VOID(putchar('\n')); + } + keyseg++; + } + if (share->state.header.uniques) + { + MI_UNIQUEDEF *uniqueinfo; + puts("\nUnique Key Start Len Nullpos Nullbit Type"); + for (key=0,uniqueinfo= &share->uniqueinfo[0] ; + key < share->state.header.uniques; key++, uniqueinfo++) + { + my_bool new_row=0; + char null_bit[8],null_pos[8]; + printf("%-8d%-5d",key+1,uniqueinfo->key+1); + for (keyseg=uniqueinfo->seg ; keyseg->type != HA_KEYTYPE_END ; keyseg++) + { + if (new_row) + fputs(" ",stdout); + null_bit[0]=null_pos[0]=0; + if (keyseg->null_bit) + { + sprintf(null_bit,"%d",keyseg->null_bit); + sprintf(null_pos,"%ld",(long) keyseg->null_pos+1); + } + printf("%-7ld%-5d%-9s%-10s%-30s\n", + (long) keyseg->start+1,keyseg->length, + null_pos,null_bit, + type_names[keyseg->type]); + new_row=1; + } + } + } + if (param->verbose > 1) + { + char null_bit[8],null_pos[8]; + printf("\nField Start Length Nullpos Nullbit Type"); + if (share->options & HA_OPTION_COMPRESS_RECORD) + printf(" Huff tree Bits"); + VOID(putchar('\n')); + start=1; + for (field=0 ; field < share->base.fields ; field++) + { + if (share->options & HA_OPTION_COMPRESS_RECORD) + type=share->rec[field].base_type; + else + type=(enum en_fieldtype) share->rec[field].type; + end=strmov(buff,field_pack[type]); + if (share->options & HA_OPTION_COMPRESS_RECORD) + { + if (share->rec[field].pack_type & PACK_TYPE_SELECTED) + end=strmov(end,", not_always"); + if (share->rec[field].pack_type & PACK_TYPE_SPACE_FIELDS) + end=strmov(end,", no empty"); + if (share->rec[field].pack_type & PACK_TYPE_ZERO_FILL) + { + sprintf(end,", zerofill(%d)",share->rec[field].space_length_bits); + end=strend(end); + } + } + if (buff[0] == ',') + strmov(buff,buff+2); + int10_to_str((long) share->rec[field].length,length,10); + null_bit[0]=null_pos[0]=0; + if (share->rec[field].null_bit) + { + sprintf(null_bit,"%d",share->rec[field].null_bit); + sprintf(null_pos,"%d",share->rec[field].null_pos+1); + } + printf("%-6d%-6d%-7s%-8s%-8s%-35s",field+1,start,length, + null_pos, null_bit, buff); + if (share->options & HA_OPTION_COMPRESS_RECORD) + { + if (share->rec[field].huff_tree) + printf("%3d %2d", + (uint) (share->rec[field].huff_tree-share->decode_trees)+1, + share->rec[field].huff_tree->quick_table_bits); + } + VOID(putchar('\n')); + start+=share->rec[field].length; + } + } + DBUG_VOID_RETURN; +} /* describe */ + + + /* Sort records according to one key */ + +static int mi_sort_records(MI_CHECK *param, + register MI_INFO *info, char * name, + uint sort_key, + my_bool write_info, + my_bool update_index) +{ + int got_error; + uint key; + MI_KEYDEF *keyinfo; + File new_file; + uchar *temp_buff; + ha_rows old_record_count; + MYISAM_SHARE *share=info->s; + char llbuff[22],llbuff2[22]; + SORT_INFO sort_info; + MI_SORT_PARAM sort_param; + DBUG_ENTER("sort_records"); + + bzero((char*)&sort_info,sizeof(sort_info)); + bzero((char*)&sort_param,sizeof(sort_param)); + sort_param.sort_info=&sort_info; + sort_info.param=param; + keyinfo= &share->keyinfo[sort_key]; + got_error=1; + temp_buff=0; + new_file= -1; + + if (! mi_is_key_active(share->state.key_map, sort_key)) + { + mi_check_print_warning(param, + "Can't sort table '%s' on key %d; No such key", + name,sort_key+1); + param->error_printed=0; + DBUG_RETURN(0); /* Nothing to do */ + } + if (keyinfo->flag & HA_FULLTEXT) + { + mi_check_print_warning(param,"Can't sort table '%s' on FULLTEXT key %d", + name,sort_key+1); + param->error_printed=0; + DBUG_RETURN(0); /* Nothing to do */ + } + if (share->data_file_type == COMPRESSED_RECORD) + { + mi_check_print_warning(param,"Can't sort read-only table '%s'", name); + param->error_printed=0; + DBUG_RETURN(0); /* Nothing to do */ + } + if (!(param->testflag & T_SILENT)) + { + printf("- Sorting records for MyISAM-table '%s'\n",name); + if (write_info) + printf("Data records: %9s Deleted: %9s\n", + llstr(info->state->records,llbuff), + llstr(info->state->del,llbuff2)); + } + if (share->state.key_root[sort_key] == HA_OFFSET_ERROR) + DBUG_RETURN(0); /* Nothing to do */ + + init_key_cache(dflt_key_cache, opt_key_cache_block_size, param->use_buffers, + 0, 0); + if (init_io_cache(&info->rec_cache,-1,(uint) param->write_buffer_length, + WRITE_CACHE,share->pack.header_length,1, + MYF(MY_WME | MY_WAIT_IF_FULL))) + goto err; + info->opt_flag|=WRITE_CACHE_USED; + + if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length))) + { + mi_check_print_error(param,"Not enough memory for key block"); + goto err; + } + if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength, + MYF(0)))) + { + mi_check_print_error(param,"Not enough memory for record"); + goto err; + } + fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32); + new_file=my_raid_create(fn_format(param->temp_filename, + param->temp_filename,"", + DATA_TMP_EXT,2+4), + 0,param->tmpfile_createflag, + share->base.raid_type, + share->base.raid_chunks, + share->base.raid_chunksize, + MYF(0)); + if (new_file < 0) + { + mi_check_print_error(param,"Can't create new tempfile: '%s'", + param->temp_filename); + goto err; + } + if (share->pack.header_length) + if (filecopy(param,new_file,info->dfile,0L,share->pack.header_length, + "datafile-header")) + goto err; + info->rec_cache.file=new_file; /* Use this file for cacheing*/ + + lock_memory(param); + for (key=0 ; key < share->base.keys ; key++) + share->keyinfo[key].flag|= HA_SORT_ALLOWS_SAME; + + if (my_pread(share->kfile,(uchar*) temp_buff, + (uint) keyinfo->block_length, + share->state.key_root[sort_key], + MYF(MY_NABP+MY_WME))) + { + mi_check_print_error(param,"Can't read indexpage from filepos: %s", + (ulong) share->state.key_root[sort_key]); + goto err; + } + + /* Setup param for sort_write_record */ + sort_info.info=info; + sort_info.new_data_file_type=share->data_file_type; + sort_param.fix_datafile=1; + sort_param.master=1; + sort_param.filepos=share->pack.header_length; + old_record_count=info->state->records; + info->state->records=0; + if (sort_info.new_data_file_type != COMPRESSED_RECORD) + info->state->checksum=0; + + if (sort_record_index(&sort_param,info,keyinfo,share->state.key_root[sort_key], + temp_buff, sort_key,new_file,update_index) || + write_data_suffix(&sort_info,1) || + flush_io_cache(&info->rec_cache)) + goto err; + + if (info->state->records != old_record_count) + { + mi_check_print_error(param,"found %s of %s records", + llstr(info->state->records,llbuff), + llstr(old_record_count,llbuff2)); + goto err; + } + + VOID(my_close(info->dfile,MYF(MY_WME))); + param->out_flag|=O_NEW_DATA; /* Data in new file */ + info->dfile=new_file; /* Use new datafile */ + info->state->del=0; + info->state->empty=0; + share->state.dellink= HA_OFFSET_ERROR; + info->state->data_file_length=sort_param.filepos; + share->state.split=info->state->records; /* Only hole records */ + share->state.version=(ulong) time((time_t*) 0); + + info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); + + if (param->testflag & T_WRITE_LOOP) + { + VOID(fputs(" \r",stdout)); VOID(fflush(stdout)); + } + got_error=0; + +err: + if (got_error && new_file >= 0) + { + VOID(end_io_cache(&info->rec_cache)); + (void) my_close(new_file,MYF(MY_WME)); + (void) my_raid_delete(param->temp_filename, share->base.raid_chunks, + MYF(MY_WME)); + } + if (temp_buff) + { + my_afree((uchar*) temp_buff); + } + my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR)); + info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); + VOID(end_io_cache(&info->rec_cache)); + my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + sort_info.buff=0; + share->state.sortkey=sort_key; + DBUG_RETURN(flush_blocks(param, share->key_cache, share->kfile) | + got_error); +} /* sort_records */ + + + /* Sort records recursive using one index */ + +static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info, + MI_KEYDEF *keyinfo, + my_off_t page, uchar *buff, uint sort_key, + File new_file,my_bool update_index) +{ + uint nod_flag,used_length,key_length; + uchar *temp_buff,*keypos,*endpos; + my_off_t next_page,rec_pos; + uchar lastkey[MI_MAX_KEY_BUFF]; + char llbuff[22]; + SORT_INFO *sort_info= sort_param->sort_info; + MI_CHECK *param=sort_info->param; + DBUG_ENTER("sort_record_index"); + + nod_flag=mi_test_if_nod(buff); + temp_buff=0; + + if (nod_flag) + { + if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length))) + { + mi_check_print_error(param,"Not Enough memory"); + DBUG_RETURN(-1); + } + } + used_length=mi_getint(buff); + keypos=buff+2+nod_flag; + endpos=buff+used_length; + for ( ;; ) + { + _sanity(__FILE__,__LINE__); + if (nod_flag) + { + next_page=_mi_kpos(nod_flag,keypos); + if (my_pread(info->s->kfile,(uchar*) temp_buff, + (uint) keyinfo->block_length, next_page, + MYF(MY_NABP+MY_WME))) + { + mi_check_print_error(param,"Can't read keys from filepos: %s", + llstr(next_page,llbuff)); + goto err; + } + if (sort_record_index(sort_param, info,keyinfo,next_page,temp_buff,sort_key, + new_file, update_index)) + goto err; + } + _sanity(__FILE__,__LINE__); + if (keypos >= endpos || + (key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,lastkey)) + == 0) + break; + rec_pos= _mi_dpos(info,0,lastkey+key_length); + + if ((*info->s->read_rnd)(info,sort_param->record,rec_pos,0)) + { + mi_check_print_error(param,"%d when reading datafile",my_errno); + goto err; + } + if (rec_pos != sort_param->filepos && update_index) + { + _mi_dpointer(info,keypos-nod_flag-info->s->rec_reflength, + sort_param->filepos); + if (movepoint(info,sort_param->record,rec_pos,sort_param->filepos, + sort_key)) + { + mi_check_print_error(param,"%d when updating key-pointers",my_errno); + goto err; + } + } + if (sort_write_record(sort_param)) + goto err; + } + /* Clear end of block to get better compression if the table is backuped */ + bzero((uchar*) buff+used_length,keyinfo->block_length-used_length); + if (my_pwrite(info->s->kfile,(uchar*) buff,(uint) keyinfo->block_length, + page,param->myf_rw)) + { + mi_check_print_error(param,"%d when updating keyblock",my_errno); + goto err; + } + if (temp_buff) + my_afree((uchar*) temp_buff); + DBUG_RETURN(0); +err: + if (temp_buff) + my_afree((uchar*) temp_buff); + DBUG_RETURN(1); +} /* sort_record_index */ + + + +/* + Check if myisamchk was killed by a signal + This is overloaded by other programs that want to be able to abort + sorting +*/ + +static int not_killed= 0; + +volatile int *killed_ptr(MI_CHECK *param __attribute__((unused))) +{ + return ¬_killed; /* always NULL */ +} + + /* print warnings and errors */ + /* VARARGS */ + +void mi_check_print_info(MI_CHECK *param __attribute__((unused)), + const char *fmt,...) +{ + va_list args; + + va_start(args,fmt); + VOID(vfprintf(stdout, fmt, args)); + VOID(fputc('\n',stdout)); + va_end(args); +} + +/* VARARGS */ + +void mi_check_print_warning(MI_CHECK *param, const char *fmt,...) +{ + va_list args; + DBUG_ENTER("mi_check_print_warning"); + + fflush(stdout); + if (!param->warning_printed && !param->error_printed) + { + if (param->testflag & T_SILENT) + fprintf(stderr,"%s: MyISAM file %s\n",my_progname_short, + param->isam_file_name); + param->out_flag|= O_DATA_LOST; + } + param->warning_printed=1; + va_start(args,fmt); + fprintf(stderr,"%s: warning: ",my_progname_short); + VOID(vfprintf(stderr, fmt, args)); + VOID(fputc('\n',stderr)); + fflush(stderr); + va_end(args); + DBUG_VOID_RETURN; +} + +/* VARARGS */ + +void mi_check_print_error(MI_CHECK *param, const char *fmt,...) +{ + va_list args; + DBUG_ENTER("mi_check_print_error"); + DBUG_PRINT("enter",("format: %s",fmt)); + + fflush(stdout); + if (!param->warning_printed && !param->error_printed) + { + if (param->testflag & T_SILENT) + fprintf(stderr,"%s: MyISAM file %s\n",my_progname_short,param->isam_file_name); + param->out_flag|= O_DATA_LOST; + } + param->error_printed|=1; + va_start(args,fmt); + fprintf(stderr,"%s: error: ",my_progname_short); + VOID(vfprintf(stderr, fmt, args)); + VOID(fputc('\n',stderr)); + fflush(stderr); + va_end(args); + DBUG_VOID_RETURN; +} Added: trunk/src/myisamdef.h =================================================================== --- trunk/src/myisamdef.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/myisamdef.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,791 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This file is included by all internal myisam files */ + +#include "myisam.h" /* Structs & some defines */ +#include "myisampack.h" /* packing of keys */ +#include +#ifdef THREAD +#include +#include +#else +#include +#endif + +#if defined(my_write) && !defined(MAP_TO_USE_RAID) +#undef my_write /* undef map from my_nosys; We need test-if-disk full */ +#endif + +typedef struct st_mi_status_info +{ + ha_rows records; /* Rows in table */ + ha_rows del; /* Removed rows */ + my_off_t empty; /* lost space in datafile */ + my_off_t key_empty; /* lost space in indexfile */ + my_off_t key_file_length; + my_off_t data_file_length; + ha_checksum checksum; +} MI_STATUS_INFO; + +typedef struct st_mi_state_info +{ + struct { /* Fileheader */ + uchar file_version[4]; + uchar options[2]; + uchar header_length[2]; + uchar state_info_length[2]; + uchar base_info_length[2]; + uchar base_pos[2]; + uchar key_parts[2]; /* Key parts */ + uchar unique_key_parts[2]; /* Key parts + unique parts */ + uchar keys; /* number of keys in file */ + uchar uniques; /* number of UNIQUE definitions */ + uchar language; /* Language for indexes */ + uchar max_block_size_index; /* max keyblock size */ + uchar fulltext_keys; + uchar not_used; /* To align to 8 */ + } header; + + MI_STATUS_INFO state; + ha_rows split; /* number of split blocks */ + my_off_t dellink; /* Link to next removed block */ + ulonglong auto_increment; + ulong process; /* process that updated table last */ + ulong unique; /* Unique number for this process */ + ulong update_count; /* Updated for each write lock */ + ulong status; + ulong *rec_per_key_part; + my_off_t *key_root; /* Start of key trees */ + my_off_t *key_del; /* delete links for trees */ + my_off_t rec_per_key_rows; /* Rows when calculating rec_per_key */ + + ulong sec_index_changed; /* Updated when new sec_index */ + ulong sec_index_used; /* which extra index are in use */ + ulonglong key_map; /* Which keys are in use */ + ha_checksum checksum; /* Table checksum */ + ulong version; /* timestamp of create */ + time_t create_time; /* Time when created database */ + time_t recover_time; /* Time for last recover */ + time_t check_time; /* Time for last check */ + uint sortkey; /* sorted by this key (not used) */ + uint open_count; + uint8 changed; /* Changed since myisamchk */ + + /* the following isn't saved on disk */ + uint state_diff_length; /* Should be 0 */ + uint state_length; /* Length of state header in file */ + ulong *key_info; +} MI_STATE_INFO; + +#define MI_STATE_INFO_SIZE (24+14*8+7*4+2*2+8) +#define MI_STATE_KEY_SIZE 8 +#define MI_STATE_KEYBLOCK_SIZE 8 +#define MI_STATE_KEYSEG_SIZE 4 +#define MI_STATE_EXTRA_SIZE ((MI_MAX_KEY+MI_MAX_KEY_BLOCK_SIZE)*MI_STATE_KEY_SIZE + MI_MAX_KEY*MI_MAX_KEY_SEG*MI_STATE_KEYSEG_SIZE) +#define MI_KEYDEF_SIZE (2+ 5*2) +#define MI_UNIQUEDEF_SIZE (2+1+1) +#define HA_KEYSEG_SIZE (6+ 2*2 + 4*2) +#define MI_COLUMNDEF_SIZE (2*3+1) +#define MI_BASE_INFO_SIZE (5*8 + 8*4 + 4 + 4*2 + 16) +#define MI_INDEX_BLOCK_MARGIN 16 /* Safety margin for .MYI tables */ + +typedef struct st_mi_base_info +{ + my_off_t keystart; /* Start of keys */ + my_off_t max_data_file_length; + my_off_t max_key_file_length; + my_off_t margin_key_file_length; + ha_rows records,reloc; /* Create information */ + ulong mean_row_length; /* Create information */ + ulong reclength; /* length of unpacked record */ + ulong pack_reclength; /* Length of full packed rec. */ + ulong min_pack_length; + ulong max_pack_length; /* Max possibly length of packed rec.*/ + ulong min_block_length; + ulong fields, /* fields in table */ + pack_fields; /* packed fields in table */ + uint rec_reflength; /* = 2-8 */ + uint key_reflength; /* = 2-8 */ + uint keys; /* same as in state.header */ + uint auto_key; /* Which key-1 is a auto key */ + uint blobs; /* Number of blobs */ + uint pack_bits; /* Length of packed bits */ + uint max_key_block_length; /* Max block length */ + uint max_key_length; /* Max key length */ + /* Extra allocation when using dynamic record format */ + uint extra_alloc_bytes; + uint extra_alloc_procent; + /* Info about raid */ + uint raid_type,raid_chunks; + ulong raid_chunksize; + /* The following are from the header */ + uint key_parts,all_key_parts; +} MI_BASE_INFO; + + + /* Structs used intern in database */ + +typedef struct st_mi_blob /* Info of record */ +{ + ulong offset; /* Offset to blob in record */ + uint pack_length; /* Type of packed length */ + ulong length; /* Calc:ed for each record */ +} MI_BLOB; + + +typedef struct st_mi_isam_pack { + ulong header_length; + uint ref_length; + uchar version; +} MI_PACK; + +#define MAX_NONMAPPED_INSERTS 1000 + +typedef struct st_mi_isam_share { /* Shared between opens */ + MI_STATE_INFO state; + MI_BASE_INFO base; + MI_KEYDEF ft2_keyinfo; /* Second-level ft-key definition */ + MI_KEYDEF *keyinfo; /* Key definitions */ + MI_UNIQUEDEF *uniqueinfo; /* unique definitions */ + HA_KEYSEG *keyparts; /* key part info */ + MI_COLUMNDEF *rec; /* Pointer to field information */ + MI_PACK pack; /* Data about packed records */ + MI_BLOB *blobs; /* Pointer to blobs */ + char *unique_file_name; /* realpath() of index file */ + char *data_file_name, /* Resolved path names from symlinks */ + *index_file_name; + uchar *file_map; /* mem-map of file if possible */ + KEY_CACHE *key_cache; /* ref to the current key cache */ + MI_DECODE_TREE *decode_trees; + uint16 *decode_tables; + int (*read_record)(struct st_myisam_info*, my_off_t, uchar*); + int (*write_record)(struct st_myisam_info*, const uchar*); + int (*update_record)(struct st_myisam_info*, my_off_t, const uchar*); + int (*delete_record)(struct st_myisam_info*); + int (*read_rnd)(struct st_myisam_info*, uchar*, my_off_t, my_bool); + int (*compare_record)(struct st_myisam_info*, const uchar *); + /* Function to use for a row checksum. */ + ha_checksum (*calc_checksum)(struct st_myisam_info*, const uchar *); + int (*compare_unique)(struct st_myisam_info*, MI_UNIQUEDEF *, + const uchar *record, my_off_t pos); + size_t (*file_read)(MI_INFO *, uchar *, size_t, my_off_t, myf); + size_t (*file_write)(MI_INFO *, const uchar *, size_t, my_off_t, myf); + invalidator_by_filename invalidator; /* query cache invalidator */ + ulong this_process; /* processid */ + ulong last_process; /* For table-change-check */ + ulong last_version; /* Version on start */ + ulong options; /* Options used */ + ulong min_pack_length; /* Theese are used by packed data */ + ulong max_pack_length; + ulong state_diff_length; + uint rec_reflength; /* rec_reflength in use now */ + uint unique_name_length; + uint32 ftparsers; /* Number of distinct ftparsers + 1 */ + File kfile; /* Shared keyfile */ + File data_file; /* Shared data file */ + int mode; /* mode of file on open */ + uint reopen; /* How many times reopened */ + uint w_locks,r_locks,tot_locks; /* Number of read/write locks */ + uint blocksize; /* blocksize of keyfile */ + myf write_flag; + enum data_file_type data_file_type; + /* Below flag is needed to make log tables work with concurrent insert */ + my_bool is_log_table; + + my_bool changed, /* If changed since lock */ + global_changed, /* If changed since open */ + not_flushed, + temporary,delay_key_write, + concurrent_insert; +#ifdef THREAD + THR_LOCK lock; + pthread_mutex_t intern_lock; /* Locking for use with _locking */ + rw_lock_t *key_root_lock; +#endif + my_off_t mmaped_length; + uint nonmmaped_inserts; /* counter of writing in non-mmaped + area */ + rw_lock_t mmap_lock; +} MYISAM_SHARE; + + +typedef uint mi_bit_type; + +typedef struct st_mi_bit_buff { /* Used for packing of record */ + mi_bit_type current_byte; + uint bits; + uchar *pos,*end,*blob_pos,*blob_end; + uint error; +} MI_BIT_BUFF; + +struct st_myisam_info { + MYISAM_SHARE *s; /* Shared between open:s */ + MI_STATUS_INFO *state,save_state; + MI_BLOB *blobs; /* Pointer to blobs */ + MI_BIT_BUFF bit_buff; + /* accumulate indexfile changes between write's */ + TREE *bulk_insert; + DYNAMIC_ARRAY *ft1_to_ft2; /* used only in ft1->ft2 conversion */ + MEM_ROOT ft_memroot; /* used by the parser */ + MYSQL_FTPARSER_PARAM *ftparser_param; /* share info between init/deinit */ + char *filename; /* parameter to open filename */ + uchar *buff, /* Temp area for key */ + *lastkey,*lastkey2; /* Last used search key */ + uchar *first_mbr_key; /* Searhed spatial key */ + uchar *rec_buff; /* Tempbuff for recordpack */ + uchar *int_keypos, /* Save position for next/previous */ + *int_maxpos; /* -""- */ + uint int_nod_flag; /* -""- */ + uint32 int_keytree_version; /* -""- */ + int (*read_record)(struct st_myisam_info*, my_off_t, uchar*); + invalidator_by_filename invalidator; /* query cache invalidator */ + ulong this_unique; /* uniq filenumber or thread */ + ulong last_unique; /* last unique number */ + ulong this_loop; /* counter for this open */ + ulong last_loop; /* last used counter */ + my_off_t lastpos, /* Last record position */ + nextpos; /* Position to next record */ + my_off_t save_lastpos; + my_off_t pos; /* Intern variable */ + my_off_t last_keypage; /* Last key page read */ + my_off_t last_search_keypage; /* Last keypage when searching */ + my_off_t dupp_key_pos; + ha_checksum checksum; /* Temp storage for row checksum */ + /* QQ: the folloing two xxx_length fields should be removed, + as they are not compatible with parallel repair */ + ulong packed_length,blob_length; /* Length of found, packed record */ + int dfile; /* The datafile */ + uint opt_flag; /* Optim. for space/speed */ + uint update; /* If file changed since open */ + int lastinx; /* Last used index */ + uint lastkey_length; /* Length of key in lastkey */ + uint last_rkey_length; /* Last length in mi_rkey() */ + enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */ + uint save_lastkey_length; + uint pack_key_length; /* For MYISAMMRG */ + uint16 last_used_keyseg; /* For MyISAMMRG */ + int errkey; /* Got last error on this key */ + int lock_type; /* How database was locked */ + int tmp_lock_type; /* When locked by readinfo */ + uint data_changed; /* Somebody has changed data */ + uint save_update; /* When using KEY_READ */ + int save_lastinx; + LIST open_list; + IO_CACHE rec_cache; /* When cacheing records */ + uint preload_buff_size; /* When preloading indexes */ + myf lock_wait; /* is 0 or MY_DONT_WAIT */ + my_bool was_locked; /* Was locked in panic */ + my_bool append_insert_at_end; /* Set if concurrent insert */ + my_bool quick_mode; + my_bool page_changed; /* If info->buff can't be used for rnext */ + my_bool buff_used; /* If info->buff has to be reread for rnext */ + my_bool once_flags; /* For MYISAMMRG */ +#ifdef __WIN__ + my_bool owned_by_merge; /* This MyISAM table is part of a merge union */ +#endif +#ifdef THREAD + THR_LOCK_DATA lock; +#endif + uchar *rtree_recursion_state; /* For RTREE */ + int rtree_recursion_depth; +}; + +typedef struct st_buffpek { + my_off_t file_pos; /* Where we are in the sort file */ + uchar *base,*key; /* Key pointers */ + ha_rows count; /* Number of rows in table */ + ulong mem_count; /* numbers of keys in memory */ + ulong max_keys; /* Max keys in buffert */ +} BUFFPEK; + +typedef struct st_mi_sort_param +{ + pthread_t thr; + IO_CACHE read_cache, tempfile, tempfile_for_exceptions; + DYNAMIC_ARRAY buffpek; + MI_BIT_BUFF bit_buff; /* For parallel repair of packrec. */ + + /* + The next two are used to collect statistics, see update_key_parts for + description. + */ + ulonglong unique[MI_MAX_KEY_SEG+1]; + ulonglong notnull[MI_MAX_KEY_SEG+1]; + + my_off_t pos,max_pos,filepos,start_recpos; + uint key, key_length,real_key_length,sortbuff_size; + uint maxbuffers, keys, find_length, sort_keys_length; + my_bool fix_datafile, master; + my_bool calc_checksum; /* calculate table checksum */ + MI_KEYDEF *keyinfo; + HA_KEYSEG *seg; + SORT_INFO *sort_info; + uchar **sort_keys; + uchar *rec_buff; + void *wordlist, *wordptr; + MEM_ROOT wordroot; + uchar *record; + MY_TMPDIR *tmpdir; + int (*key_cmp)(struct st_mi_sort_param *, const void *, const void *); + int (*key_read)(struct st_mi_sort_param *,void *); + int (*key_write)(struct st_mi_sort_param *, const void *); + void (*lock_in_memory)(MI_CHECK *); + NEAR int (*write_keys)(struct st_mi_sort_param *, register uchar **, + uint , struct st_buffpek *, IO_CACHE *); + NEAR uint (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint); + NEAR int (*write_key)(struct st_mi_sort_param *, IO_CACHE *,uchar *, + uint, uint); +} MI_SORT_PARAM; + + /* Some defines used by isam-funktions */ + +#define USE_WHOLE_KEY MI_MAX_KEY_BUFF*2 /* Use whole key in _mi_search() */ +#define F_EXTRA_LCK -1 + + /* bits in opt_flag */ +#define MEMMAP_USED 32 +#define REMEMBER_OLD_POS 64 + +#define WRITEINFO_UPDATE_KEYFILE 1 +#define WRITEINFO_NO_UNLOCK 2 + + /* once_flags */ +#define USE_PACKED_KEYS 1 +#define RRND_PRESERVE_LASTINX 2 + + /* bits in state.changed */ + +#define STATE_CHANGED 1 +#define STATE_CRASHED 2 +#define STATE_CRASHED_ON_REPAIR 4 +#define STATE_NOT_ANALYZED 8 +#define STATE_NOT_OPTIMIZED_KEYS 16 +#define STATE_NOT_SORTED_PAGES 32 + + /* options to mi_read_cache */ + +#define READING_NEXT 1 +#define READING_HEADER 2 + +#define mi_getint(x) ((uint) mi_uint2korr(x) & 32767) +#define mi_putint(x,y,nod) { uint16 boh=(nod ? (uint16) 32768 : 0) + (uint16) (y);\ + mi_int2store(x,boh); } +#define mi_test_if_nod(x) (x[0] & 128 ? info->s->base.key_reflength : 0) +#define mi_mark_crashed(x) do{(x)->s->state.changed|= STATE_CRASHED; \ + DBUG_PRINT("error", ("Marked table crashed")); \ + }while(0) +#define mi_mark_crashed_on_repair(x) do{(x)->s->state.changed|= \ + STATE_CRASHED|STATE_CRASHED_ON_REPAIR; \ + (x)->update|= HA_STATE_CHANGED; \ + DBUG_PRINT("error", \ + ("Marked table crashed")); \ + }while(0) +#define mi_is_crashed(x) ((x)->s->state.changed & STATE_CRASHED) +#define mi_is_crashed_on_repair(x) ((x)->s->state.changed & STATE_CRASHED_ON_REPAIR) +#define mi_print_error(SHARE, ERRNO) \ + mi_report_error((ERRNO), (SHARE)->index_file_name) + +/* Functions to store length of space packed keys, VARCHAR or BLOB keys */ + +#define store_key_length_inc(key,length) \ +{ if ((length) < 255) \ + { *(key)++=(length); } \ + else \ + { *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \ +} + +#define store_key_length(key,length) \ +{ if ((length) < 255) \ + { *(key)=(length); } \ + else \ + { *(key)=255; mi_int2store((key)+1,(length)); } \ +} + +#define get_key_full_length(length,key) \ +{ if ((uchar) *(key) != 255) \ + length= ((uint) (uchar) *((key)++))+1; \ + else \ + { length=mi_uint2korr((key)+1)+3; (key)+=3; } \ +} + +#define get_key_full_length_rdonly(length,key) \ +{ if ((uchar) *(key) != 255) \ + length= ((uint) (uchar) *((key)))+1; \ + else \ + { length=mi_uint2korr((key)+1)+3; } \ +} + +#define get_pack_length(length) ((length) >= 255 ? 3 : 1) + +#define MI_MIN_BLOCK_LENGTH 20 /* Because of delete-link */ +#define MI_EXTEND_BLOCK_LENGTH 20 /* Don't use to small record-blocks */ +#define MI_SPLIT_LENGTH ((MI_EXTEND_BLOCK_LENGTH+4)*2) +#define MI_MAX_DYN_BLOCK_HEADER 20 /* Max prefix of record-block */ +#define MI_BLOCK_INFO_HEADER_LENGTH 20 +#define MI_DYN_DELETE_BLOCK_HEADER 20 /* length of delete-block-header */ +#define MI_DYN_MAX_BLOCK_LENGTH ((1L << 24)-4L) +#define MI_DYN_MAX_ROW_LENGTH (MI_DYN_MAX_BLOCK_LENGTH - MI_SPLIT_LENGTH) +#define MI_DYN_ALIGN_SIZE 4 /* Align blocks on this */ +#define MI_MAX_DYN_HEADER_BYTE 13 /* max header byte for dynamic rows */ +#define MI_MAX_BLOCK_LENGTH ((((ulong) 1 << 24)-1) & (~ (ulong) (MI_DYN_ALIGN_SIZE-1))) +#define MI_REC_BUFF_OFFSET ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER+sizeof(uint32)) + +#define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for file */ + +#define PACK_TYPE_SELECTED 1 /* Bits in field->pack_type */ +#define PACK_TYPE_SPACE_FIELDS 2 +#define PACK_TYPE_ZERO_FILL 4 +#define MI_FOUND_WRONG_KEY 32738 /* Impossible value from ha_key_cmp */ + +#define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_MIN_KEY_BLOCK_LENGTH) +#define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer,block_size) (((((key_length)+(data_pointer)+(key_pointer))*4+(key_pointer)+2)/(block_size)+1)*(block_size)) +#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */ +#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */ + +#define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */ +#define MI_MIN_ROWS_TO_USE_BULK_INSERT 100 +#define MI_MIN_ROWS_TO_DISABLE_INDEXES 100 +#define MI_MIN_ROWS_TO_USE_WRITE_CACHE 10 + +/* The UNIQUE check is done with a hashed long key */ + +#define MI_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT +#define mi_unique_store(A,B) mi_int4store((A),(B)) + +#ifdef THREAD +extern pthread_mutex_t THR_LOCK_myisam; +#endif +#if !defined(THREAD) || defined(DONT_USE_RW_LOCKS) +#define rw_wrlock(A) {} +#define rw_rdlock(A) {} +#define rw_unlock(A) {} +#endif + + /* Some extern variables */ + +extern LIST *myisam_open_list; +extern uchar NEAR myisam_file_magic[],NEAR myisam_pack_file_magic[]; +extern uint NEAR myisam_read_vec[],NEAR myisam_readnext_vec[]; +extern uint myisam_quick_table_bits; +extern File myisam_log_file; +extern ulong myisam_pid; + + /* This is used by _mi_calc_xxx_key_length och _mi_store_key */ + +typedef struct st_mi_s_param +{ + uint ref_length,key_length, + n_ref_length, + n_length, + totlength, + part_of_prev_key,prev_length,pack_marker; + uchar *key, *prev_key,*next_key_pos; + bool store_not_null; +} MI_KEY_PARAM; + + /* Prototypes for intern functions */ + +extern int _mi_read_dynamic_record(MI_INFO *info,my_off_t filepos,uchar *buf); +extern int _mi_write_dynamic_record(MI_INFO*, const uchar*); +extern int _mi_update_dynamic_record(MI_INFO*, my_off_t, const uchar*); +extern int _mi_delete_dynamic_record(MI_INFO *info); +extern int _mi_cmp_dynamic_record(MI_INFO *info,const uchar *record); +extern int _mi_read_rnd_dynamic_record(MI_INFO *, uchar *,my_off_t, my_bool); +extern int _mi_write_blob_record(MI_INFO*, const uchar*); +extern int _mi_update_blob_record(MI_INFO*, my_off_t, const uchar*); +extern int _mi_read_static_record(MI_INFO *info, my_off_t filepos,uchar *buf); +extern int _mi_write_static_record(MI_INFO*, const uchar*); +extern int _mi_update_static_record(MI_INFO*, my_off_t, const uchar*); +extern int _mi_delete_static_record(MI_INFO *info); +extern int _mi_cmp_static_record(MI_INFO *info,const uchar *record); +extern int _mi_read_rnd_static_record(MI_INFO*, uchar *,my_off_t, my_bool); +extern int _mi_ck_write(MI_INFO *info,uint keynr,uchar *key,uint length); +extern int _mi_ck_real_write_btree(MI_INFO *info, MI_KEYDEF *keyinfo, + uchar *key, uint key_length, + my_off_t *root, uint comp_flag); +extern int _mi_enlarge_root(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, my_off_t *root); +extern int _mi_insert(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, + uchar *anc_buff,uchar *key_pos,uchar *key_buff, + uchar *father_buff, uchar *father_keypos, + my_off_t father_page, my_bool insert_last); +extern int _mi_split_page(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, + uchar *buff,uchar *key_buff, my_bool insert_last); +extern uchar *_mi_find_half_pos(uint nod_flag,MI_KEYDEF *keyinfo,uchar *page, + uchar *key,uint *return_key_length, + uchar **after_key); +extern int _mi_calc_static_key_length(MI_KEYDEF *keyinfo,uint nod_flag, + uchar *key_pos, uchar *org_key, + uchar *key_buff, + uchar *key, MI_KEY_PARAM *s_temp); +extern int _mi_calc_var_key_length(MI_KEYDEF *keyinfo,uint nod_flag, + uchar *key_pos, uchar *org_key, + uchar *key_buff, + uchar *key, MI_KEY_PARAM *s_temp); +extern int _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag, + uchar *key_pos, uchar *org_key, + uchar *prev_key, + uchar *key, MI_KEY_PARAM *s_temp); +extern int _mi_calc_bin_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag, + uchar *key_pos,uchar *org_key, + uchar *prev_key, + uchar *key, MI_KEY_PARAM *s_temp); +void _mi_store_static_key(MI_KEYDEF *keyinfo, uchar *key_pos, + MI_KEY_PARAM *s_temp); +void _mi_store_var_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos, + MI_KEY_PARAM *s_temp); +#ifdef NOT_USED +void _mi_store_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos, + MI_KEY_PARAM *s_temp); +#endif +void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos, + MI_KEY_PARAM *s_temp); + +extern int _mi_ck_delete(MI_INFO *info,uint keynr,uchar *key,uint key_length); +extern int _mi_readinfo(MI_INFO *info,int lock_flag,int check_keybuffer); +extern int _mi_writeinfo(MI_INFO *info,uint options); +extern int _mi_test_if_changed(MI_INFO *info); +extern int _mi_mark_file_changed(MI_INFO *info); +extern int _mi_decrement_open_count(MI_INFO *info); +extern int _mi_check_index(MI_INFO *info,int inx); +extern int _mi_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,uint key_len, + uint nextflag,my_off_t pos); +extern int _mi_bin_search(struct st_myisam_info *info,MI_KEYDEF *keyinfo, + uchar *page,uchar *key,uint key_len,uint comp_flag, + uchar * *ret_pos,uchar *buff, my_bool *was_last_key); +extern int _mi_seq_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page, + uchar *key,uint key_len,uint comp_flag, + uchar **ret_pos,uchar *buff, my_bool *was_last_key); +extern int _mi_prefix_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page, + uchar *key,uint key_len,uint comp_flag, + uchar **ret_pos,uchar *buff, my_bool *was_last_key); +extern my_off_t _mi_kpos(uint nod_flag,uchar *after_key); +extern void _mi_kpointer(MI_INFO *info,uchar *buff,my_off_t pos); +extern my_off_t _mi_dpos(MI_INFO *info, uint nod_flag,uchar *after_key); +extern my_off_t _mi_rec_pos(MYISAM_SHARE *info, uchar *ptr); +extern void _mi_dpointer(MI_INFO *info, uchar *buff,my_off_t pos); +extern int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a,uchar *b, + uint key_length,uint nextflag,uint *diff_length); +extern uint _mi_get_static_key(MI_KEYDEF *keyinfo,uint nod_flag,uchar * *page, + uchar *key); +extern uint _mi_get_pack_key(MI_KEYDEF *keyinfo,uint nod_flag,uchar * *page, + uchar *key); +extern uint _mi_get_binary_pack_key(MI_KEYDEF *keyinfo, uint nod_flag, + uchar **page_pos, uchar *key); +extern uchar *_mi_get_last_key(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *keypos, + uchar *lastkey,uchar *endpos, + uint *return_key_length); +extern uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uchar *keypos, uint *return_key_length); +extern uint _mi_keylength(MI_KEYDEF *keyinfo,uchar *key); +extern uint _mi_keylength_part(MI_KEYDEF *keyinfo, register uchar *key, + HA_KEYSEG *end); +extern uchar *_mi_move_key(MI_KEYDEF *keyinfo,uchar *to,uchar *from); +extern int _mi_search_next(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, + uint key_length,uint nextflag,my_off_t pos); +extern int _mi_search_first(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t pos); +extern int _mi_search_last(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t pos); +extern uchar *_mi_fetch_keypage(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t page, + int level,uchar *buff,int return_buffer); +extern int _mi_write_keypage(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t page, + int level, uchar *buff); +extern int _mi_dispose(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t pos, + int level); +extern my_off_t _mi_new(MI_INFO *info,MI_KEYDEF *keyinfo,int level); +extern uint _mi_make_key(MI_INFO *info,uint keynr,uchar *key, + const uchar *record,my_off_t filepos); +extern uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, + uchar *old, key_part_map keypart_map, + HA_KEYSEG **last_used_keyseg); +extern int _mi_read_key_record(MI_INFO *info,my_off_t filepos,uchar *buf); +extern int _mi_read_cache(IO_CACHE *info,uchar *buff,my_off_t pos, + uint length,int re_read_if_possibly); +extern ulonglong retrieve_auto_increment(MI_INFO *info,const uchar *record); + +extern uchar *mi_alloc_rec_buff(MI_INFO *,ulong, uchar**); +#define mi_get_rec_buff_ptr(info,buf) \ + ((((info)->s->options & HA_OPTION_PACK_RECORD) && (buf)) ? \ + (buf) - MI_REC_BUFF_OFFSET : (buf)) +#define mi_get_rec_buff_len(info,buf) \ + (*((uint32 *)(mi_get_rec_buff_ptr(info,buf)))) + +extern ulong _mi_rec_unpack(MI_INFO *info,uchar *to,uchar *from, + ulong reclength); +extern my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *packpos, + ulong packed_length, my_bool with_checkum); +extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length, + my_off_t next_filepos,uchar **record, + ulong *reclength,int *flag); +extern void _mi_print_key(FILE *stream,HA_KEYSEG *keyseg,const uchar *key, + uint length); +extern my_bool _mi_read_pack_info(MI_INFO *info,pbool fix_keys); +extern int _mi_read_pack_record(MI_INFO *info,my_off_t filepos,uchar *buf); +extern int _mi_read_rnd_pack_record(MI_INFO*, uchar *,my_off_t, my_bool); +extern int _mi_pack_rec_unpack(MI_INFO *info, MI_BIT_BUFF *bit_buff, + uchar *to, uchar *from, ulong reclength); +extern ulonglong mi_safe_mul(ulonglong a,ulonglong b); +extern int _mi_ft_update(MI_INFO *info, uint keynr, uchar *keybuf, + const uchar *oldrec, const uchar *newrec, my_off_t pos); + +struct st_sort_info; + + +typedef struct st_mi_block_info { /* Parameter to _mi_get_block_info */ + uchar header[MI_BLOCK_INFO_HEADER_LENGTH]; + ulong rec_len; + ulong data_len; + ulong block_len; + ulong blob_len; + my_off_t filepos; + my_off_t next_filepos; + my_off_t prev_filepos; + uint second_read; + uint offset; +} MI_BLOCK_INFO; + + /* bits in return from _mi_get_block_info */ + +#define BLOCK_FIRST 1 +#define BLOCK_LAST 2 +#define BLOCK_DELETED 4 +#define BLOCK_ERROR 8 /* Wrong data */ +#define BLOCK_SYNC_ERROR 16 /* Right data at wrong place */ +#define BLOCK_FATAL_ERROR 32 /* hardware-error */ + +#define NEED_MEM ((uint) 10*4*(IO_SIZE+32)+32) /* Nead for recursion */ +#define MAXERR 20 +#define BUFFERS_WHEN_SORTING 16 /* Alloc for sort-key-tree */ +#define WRITE_COUNT MY_HOW_OFTEN_TO_WRITE +#define INDEX_TMP_EXT ".TMM" +#define DATA_TMP_EXT ".TMD" + +#define UPDATE_TIME 1 +#define UPDATE_STAT 2 +#define UPDATE_SORT 4 +#define UPDATE_AUTO_INC 8 +#define UPDATE_OPEN_COUNT 16 + +#define USE_BUFFER_INIT (((1024L*512L-MALLOC_OVERHEAD)/IO_SIZE)*IO_SIZE) +#define READ_BUFFER_INIT (1024L*256L-MALLOC_OVERHEAD) +#define SORT_BUFFER_INIT (2048L*1024L-MALLOC_OVERHEAD) +#define MIN_SORT_BUFFER (4096-MALLOC_OVERHEAD) + +enum myisam_log_commands { + MI_LOG_OPEN,MI_LOG_WRITE,MI_LOG_UPDATE,MI_LOG_DELETE,MI_LOG_CLOSE,MI_LOG_EXTRA,MI_LOG_LOCK,MI_LOG_DELETE_ALL +}; + +#define myisam_log(a,b,c,d) if (myisam_log_file >= 0) _myisam_log(a,b,c,d) +#define myisam_log_command(a,b,c,d,e) if (myisam_log_file >= 0) _myisam_log_command(a,b,c,d,e) +#define myisam_log_record(a,b,c,d,e) if (myisam_log_file >= 0) _myisam_log_record(a,b,c,d,e) + +#define fast_mi_writeinfo(INFO) if (!(INFO)->s->tot_locks) (void) _mi_writeinfo((INFO),0) +#define fast_mi_readinfo(INFO) ((INFO)->lock_type == F_UNLCK) && _mi_readinfo((INFO),F_RDLCK,1) + +#ifdef __cplusplus +extern "C" { +#endif + +extern uint _mi_get_block_info(MI_BLOCK_INFO *,File, my_off_t); +extern uint _mi_rec_pack(MI_INFO *info,uchar *to,const uchar *from); +extern uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff, + MI_BLOCK_INFO *info, uchar **rec_buff_p, + File file, my_off_t filepos); +extern void _my_store_blob_length(uchar *pos,uint pack_length,uint length); +extern void _myisam_log(enum myisam_log_commands command,MI_INFO *info, + const uchar *buffert,uint length); +extern void _myisam_log_command(enum myisam_log_commands command, + MI_INFO *info, const uchar *buffert, + uint length, int result); +extern void _myisam_log_record(enum myisam_log_commands command,MI_INFO *info, + const uchar *record,my_off_t filepos, + int result); +extern void mi_report_error(int errcode, const char *file_name); +extern my_bool _mi_memmap_file(MI_INFO *info); +extern void _mi_unmap_file(MI_INFO *info); +extern uint save_pack_length(uint version, uchar *block_buff, ulong length); +extern uint read_pack_length(uint version, const uchar *buf, ulong *length); +extern uint calc_pack_length(uint version, ulong length); +extern size_t mi_mmap_pread(MI_INFO *info, uchar *Buffer, + size_t Count, my_off_t offset, myf MyFlags); +extern size_t mi_mmap_pwrite(MI_INFO *info, const uchar *Buffer, + size_t Count, my_off_t offset, myf MyFlags); +extern size_t mi_nommap_pread(MI_INFO *info, uchar *Buffer, + size_t Count, my_off_t offset, myf MyFlags); +extern size_t mi_nommap_pwrite(MI_INFO *info, const uchar *Buffer, + size_t Count, my_off_t offset, myf MyFlags); + +uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite); +uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state); +uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead); +uint mi_base_info_write(File file, MI_BASE_INFO *base); +uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base); +int mi_keyseg_write(File file, const HA_KEYSEG *keyseg); +uchar *mi_keyseg_read(uchar *ptr, HA_KEYSEG *keyseg); +uint mi_keydef_write(File file, MI_KEYDEF *keydef); +uchar *mi_keydef_read(uchar *ptr, MI_KEYDEF *keydef); +uint mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef); +uchar *mi_uniquedef_read(uchar *ptr, MI_UNIQUEDEF *keydef); +uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo); +uchar *mi_recinfo_read(uchar *ptr, MI_COLUMNDEF *recinfo); +extern int mi_disable_indexes(MI_INFO *info); +extern int mi_enable_indexes(MI_INFO *info); +extern int mi_indexes_are_disabled(MI_INFO *info); +ulong _my_calc_total_blob_length(MI_INFO *info, const uchar *record); +ha_checksum mi_checksum(MI_INFO *info, const uchar *buf); +ha_checksum mi_static_checksum(MI_INFO *info, const uchar *buf); +my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record, + ha_checksum unique_hash, my_off_t pos); +ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *buf); +int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def, + const uchar *record, my_off_t pos); +int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def, + const uchar *record, my_off_t pos); +int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, + my_bool null_are_equal); +void mi_get_status(void* param, int concurrent_insert); +void mi_update_status(void* param); +void mi_restore_status(void* param); +void mi_copy_status(void* to,void *from); +my_bool mi_check_status(void* param); +void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows); + +extern MI_INFO *test_if_reopen(char *filename); +my_bool check_table_is_closed(const char *name, const char *where); +int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup); +int mi_open_keyfile(MYISAM_SHARE *share); +void mi_setup_functions(register MYISAM_SHARE *share); +my_bool mi_dynmap_file(MI_INFO *info, my_off_t size); +void mi_remap_file(MI_INFO *info, my_off_t size); + + /* Functions needed by mi_check */ +volatile int *killed_ptr(MI_CHECK *param); +void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...)); +void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...)); +void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...)); +int flush_pending_blocks(MI_SORT_PARAM *param); +int sort_ft_buf_flush(MI_SORT_PARAM *sort_param); +int thr_write_keys(MI_SORT_PARAM *sort_param); +#ifdef THREAD +pthread_handler_t thr_find_all_keys(void *arg); +#endif +int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file); + +int sort_write_record(MI_SORT_PARAM *sort_param); +int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ulong); + +#ifdef __cplusplus +} +#endif + Added: trunk/src/myisamlog.c =================================================================== --- trunk/src/myisamlog.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/myisamlog.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,847 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* write whats in isam.log */ + +#ifndef USE_MY_FUNC +#define USE_MY_FUNC +#endif + +#include "myisamdef.h" +#include +#include +#ifdef HAVE_GETRUSAGE +#include +#endif + +#define FILENAME(A) (A ? A->show_name : "Unknown") + +struct file_info { + long process; + int filenr,id; + uint rnd; + char *name, *show_name; + uchar *record; + MI_INFO *isam; + bool closed,used; + ulong accessed; +}; + +struct test_if_open_param { + char * name; + int max_id; +}; + +struct st_access_param +{ + ulong min_accessed; + struct file_info *found; +}; + +#define NO_FILEPOS (ulong) ~0L + +extern int main(int argc,char * *argv); +static void get_options(int *argc,char ***argv); +static int examine_log(char * file_name,char **table_names); +static int read_string(IO_CACHE *file,uchar* *to,uint length); +static int file_info_compare(void *cmp_arg, void *a,void *b); +static int test_if_open(struct file_info *key,element_count count, + struct test_if_open_param *param); +static void fix_blob_pointers(MI_INFO *isam,uchar *record); +static int test_when_accessed(struct file_info *key,element_count count, + struct st_access_param *access_param); +static void file_info_free(struct file_info *info); +static int close_some_file(TREE *tree); +static int reopen_closed_file(TREE *tree,struct file_info *file_info); +static int find_record_with_key(struct file_info *file_info,uchar *record); +static void printf_log(const char *str,...); +static bool cmp_filename(struct file_info *file_info,char * name); + +static uint verbose=0,update=0,test_info=0,max_files=0,re_open_count=0, + recover=0,prefix_remove=0,opt_processes=0; +static char *log_filename=0, *filepath=0, *write_filename=0; +static char *record_pos_file= 0; +static ulong com_count[10][3],number_of_commands=(ulong) ~0L, + isamlog_process; +static my_off_t isamlog_filepos,start_offset=0,record_pos= HA_OFFSET_ERROR; +static const char *command_name[]= +{"open","write","update","delete","close","extra","lock","re-open", + "delete-all", NullS}; + + +int main(int argc, char **argv) +{ + int error,i,first; + ulong total_count,total_error,total_recover; + MY_INIT(argv[0]); + + log_filename=myisam_log_filename; + get_options(&argc,&argv); + /* Number of MyISAM files we can have open at one time */ + max_files= (my_set_max_open_files(min(max_files,8))-6)/2; + if (update) + printf("Trying to %s MyISAM files according to log '%s'\n", + (recover ? "recover" : "update"),log_filename); + error= examine_log(log_filename,argv); + if (update && ! error) + puts("Tables updated successfully"); + total_count=total_error=total_recover=0; + for (i=first=0 ; command_name[i] ; i++) + { + if (com_count[i][0]) + { + if (!first++) + { + if (verbose || update) + puts(""); + puts("Commands Used count Errors Recover errors"); + } + printf("%-12s%9ld%10ld%17ld\n",command_name[i],com_count[i][0], + com_count[i][1],com_count[i][2]); + total_count+=com_count[i][0]; + total_error+=com_count[i][1]; + total_recover+=com_count[i][2]; + } + } + if (total_count) + printf("%-12s%9ld%10ld%17ld\n","Total",total_count,total_error, + total_recover); + if (re_open_count) + printf("Had to do %d re-open because of too few possibly open files\n", + re_open_count); + VOID(mi_panic(HA_PANIC_CLOSE)); + my_free_open_file_info(); + my_end(test_info ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR); + exit(error); + return 0; /* No compiler warning */ +} /* main */ + + +static void get_options(register int *argc, register char ***argv) +{ + int help,version; + const char *pos,*usage; + char option; + + help=0; + usage="Usage: %s [-?iruvDIV] [-c #] [-f #] [-F filepath/] [-o #] [-R file recordpos] [-w write_file] [log-filename [table ...]] \n"; + pos=""; + + while (--*argc > 0 && *(pos = *(++*argv)) == '-' ) { + while (*++pos) + { + version=0; + switch((option=*pos)) { + case '#': + DBUG_PUSH (++pos); + pos=" "; /* Skip rest of arg */ + break; + case 'c': + if (! *++pos) + { + if (!--*argc) + goto err; + else + pos= *(++*argv); + } + number_of_commands=(ulong) atol(pos); + pos=" "; + break; + case 'u': + update=1; + break; + case 'f': + if (! *++pos) + { + if (!--*argc) + goto err; + else + pos= *(++*argv); + } + max_files=(uint) atoi(pos); + pos=" "; + break; + case 'i': + test_info=1; + break; + case 'o': + if (! *++pos) + { + if (!--*argc) + goto err; + else + pos= *(++*argv); + } + start_offset=(my_off_t) strtoll(pos,NULL,10); + pos=" "; + break; + case 'p': + if (! *++pos) + { + if (!--*argc) + goto err; + else + pos= *(++*argv); + } + prefix_remove=atoi(pos); + break; + case 'r': + update=1; + recover++; + break; + case 'P': + opt_processes=1; + break; + case 'R': + if (! *++pos) + { + if (!--*argc) + goto err; + else + pos= *(++*argv); + } + record_pos_file=(char*) pos; + if (!--*argc) + goto err; + record_pos=(my_off_t) strtoll(*(++*argv),NULL,10); + pos=" "; + break; + case 'v': + verbose++; + break; + case 'w': + if (! *++pos) + { + if (!--*argc) + goto err; + else + pos= *(++*argv); + } + write_filename=(char*) pos; + pos=" "; + break; + case 'F': + if (! *++pos) + { + if (!--*argc) + goto err; + else + pos= *(++*argv); + } + filepath= (char*) pos; + pos=" "; + break; + case 'V': + version=1; + /* Fall through */ + case 'I': + case '?': +#include + printf("%s Ver 1.4 for %s at %s\n",my_progname,SYSTEM_TYPE, + MACHINE_TYPE); + puts("By Monty, for your professional use\n"); + if (version) + break; + puts("Write info about whats in a MyISAM log file."); + printf("If no file name is given %s is used\n",log_filename); + puts(""); + printf(usage,my_progname); + puts(""); + puts("Options: -? or -I \"Info\" -V \"version\" -c \"do only # commands\""); + puts(" -f \"max open files\" -F \"filepath\" -i \"extra info\""); + puts(" -o \"offset\" -p # \"remove # components from path\""); + puts(" -r \"recover\" -R \"file recordposition\""); + puts(" -u \"update\" -v \"verbose\" -w \"write file\""); + puts(" -D \"myisam compiled with DBUG\" -P \"processes\""); + puts("\nOne can give a second and a third '-v' for more verbose."); + puts("Normaly one does a update (-u)."); + puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted."); + puts("If one gives table names as arguments only these tables will be updated\n"); + help=1; +#include + break; + default: + printf("illegal option: \"-%c\"\n",*pos); + break; + } + } + } + if (! *argc) + { + if (help) + exit(0); + (*argv)++; + } + if (*argc >= 1) + { + log_filename=(char*) pos; + (*argc)--; + (*argv)++; + } + return; + err: + VOID(fprintf(stderr,"option \"%c\" used without or with wrong argument\n", + option)); + exit(1); +} + + +static int examine_log(char * file_name, char **table_names) +{ + uint command,result,files_open; + ulong access_time,length; + my_off_t filepos; + int lock_command,mi_result; + char isam_file_name[FN_REFLEN],llbuff[21],llbuff2[21]; + uchar head[20]; + uchar* buff; + struct test_if_open_param open_param; + IO_CACHE cache; + File file; + FILE *write_file; + enum ha_extra_function extra_command; + TREE tree; + struct file_info file_info,*curr_file_info; + DBUG_ENTER("examine_log"); + + if ((file=my_open(file_name,O_RDONLY,MYF(MY_WME))) < 0) + DBUG_RETURN(1); + write_file=0; + if (write_filename) + { + if (!(write_file=my_fopen(write_filename,O_WRONLY,MYF(MY_WME)))) + { + my_close(file,MYF(0)); + DBUG_RETURN(1); + } + } + + init_io_cache(&cache,file,0,READ_CACHE,start_offset,0,MYF(0)); + bzero((uchar*) com_count,sizeof(com_count)); + init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1, + (tree_element_free) file_info_free, NULL); + VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE, + 0, 0)); + + files_open=0; access_time=0; + while (access_time++ != number_of_commands && + !my_b_read(&cache,(uchar*) head,9)) + { + isamlog_filepos=my_b_tell(&cache)-9L; + file_info.filenr= mi_uint2korr(head+1); + isamlog_process=file_info.process=(long) mi_uint4korr(head+3); + if (!opt_processes) + file_info.process=0; + result= mi_uint2korr(head+7); + if ((curr_file_info=(struct file_info*) tree_search(&tree, &file_info, + tree.custom_arg))) + { + curr_file_info->accessed=access_time; + if (update && curr_file_info->used && curr_file_info->closed) + { + if (reopen_closed_file(&tree,curr_file_info)) + { + command=sizeof(com_count)/sizeof(com_count[0][0])/3; + result=0; + goto com_err; + } + } + } + command=(uint) head[0]; + if (command < sizeof(com_count)/sizeof(com_count[0][0])/3 && + (!table_names[0] || (curr_file_info && curr_file_info->used))) + { + com_count[command][0]++; + if (result) + com_count[command][1]++; + } + switch ((enum myisam_log_commands) command) { + case MI_LOG_OPEN: + if (!table_names[0]) + { + com_count[command][0]--; /* Must be counted explicite */ + if (result) + com_count[command][1]--; + } + + if (curr_file_info) + printf("\nWarning: %s is opened with same process and filenumber\n" + "Maybe you should use the -P option ?\n", + curr_file_info->show_name); + if (my_b_read(&cache,(uchar*) head,2)) + goto err; + file_info.name=0; + file_info.show_name=0; + file_info.record=0; + if (read_string(&cache,(uchar**) &file_info.name, + (uint) mi_uint2korr(head))) + goto err; + { + uint i; + char *pos,*to; + + /* Fix if old DOS files to new format */ + for (pos=file_info.name; (pos=strchr(pos,'\\')) ; pos++) + *pos= '/'; + + pos=file_info.name; + for (i=0 ; i < prefix_remove ; i++) + { + char *next; + if (!(next=strchr(pos,'/'))) + break; + pos=next+1; + } + to=isam_file_name; + if (filepath) + to=convert_dirname(isam_file_name,filepath,NullS); + strmov(to,pos); + fn_ext(isam_file_name)[0]=0; /* Remove extension */ + } + open_param.name=file_info.name; + open_param.max_id=0; + VOID(tree_walk(&tree,(tree_walk_action) test_if_open,(void*) &open_param, + left_root_right)); + file_info.id=open_param.max_id+1; + /* + * In the line below +10 is added to accomodate '<' and '>' chars + * plus '\0' at the end, so that there is place for 7 digits. + * It is improbable that same table can have that many entries in + * the table cache. + * The additional space is needed for the sprintf commands two lines + * below. + */ + file_info.show_name=my_memdup(isam_file_name, + (uint) strlen(isam_file_name)+10, + MYF(MY_WME)); + if (file_info.id > 1) + sprintf(strend(file_info.show_name),"<%d>",file_info.id); + file_info.closed=1; + file_info.accessed=access_time; + file_info.used=1; + if (table_names[0]) + { + char **name; + file_info.used=0; + for (name=table_names ; *name ; name++) + { + if (!strcmp(*name,isam_file_name)) + file_info.used=1; /* Update/log only this */ + } + } + if (update && file_info.used) + { + if (files_open >= max_files) + { + if (close_some_file(&tree)) + goto com_err; + files_open--; + } + if (!(file_info.isam= mi_open(isam_file_name,O_RDWR, + HA_OPEN_WAIT_IF_LOCKED))) + goto com_err; + if (!(file_info.record=my_malloc(file_info.isam->s->base.reclength, + MYF(MY_WME)))) + goto end; + files_open++; + file_info.closed=0; + } + VOID(tree_insert(&tree, (uchar*) &file_info, 0, tree.custom_arg)); + if (file_info.used) + { + if (verbose && !record_pos_file) + printf_log("%s: open -> %d",file_info.show_name, file_info.filenr); + com_count[command][0]++; + if (result) + com_count[command][1]++; + } + break; + case MI_LOG_CLOSE: + if (verbose && !record_pos_file && + (!table_names[0] || (curr_file_info && curr_file_info->used))) + printf_log("%s: %s -> %d",FILENAME(curr_file_info), + command_name[command],result); + if (curr_file_info) + { + if (!curr_file_info->closed) + files_open--; + VOID(tree_delete(&tree, (uchar*) curr_file_info, 0, tree.custom_arg)); + } + break; + case MI_LOG_EXTRA: + if (my_b_read(&cache,(uchar*) head,1)) + goto err; + extra_command=(enum ha_extra_function) head[0]; + if (verbose && !record_pos_file && + (!table_names[0] || (curr_file_info && curr_file_info->used))) + printf_log("%s: %s(%d) -> %d",FILENAME(curr_file_info), + command_name[command], (int) extra_command,result); + if (update && curr_file_info && !curr_file_info->closed) + { + if (mi_extra(curr_file_info->isam, extra_command, 0) != (int) result) + { + fflush(stdout); + VOID(fprintf(stderr, + "Warning: error %d, expected %d on command %s at %s\n", + my_errno,result,command_name[command], + llstr(isamlog_filepos,llbuff))); + fflush(stderr); + } + } + break; + case MI_LOG_DELETE: + if (my_b_read(&cache,(uchar*) head,8)) + goto err; + filepos=mi_sizekorr(head); + if (verbose && (!record_pos_file || + ((record_pos == filepos || record_pos == NO_FILEPOS) && + !cmp_filename(curr_file_info,record_pos_file))) && + (!table_names[0] || (curr_file_info && curr_file_info->used))) + printf_log("%s: %s at %ld -> %d",FILENAME(curr_file_info), + command_name[command],(long) filepos,result); + if (update && curr_file_info && !curr_file_info->closed) + { + if (mi_rrnd(curr_file_info->isam,curr_file_info->record,filepos)) + { + if (!recover) + goto com_err; + if (verbose) + printf_log("error: Didn't find row to delete with mi_rrnd"); + com_count[command][2]++; /* Mark error */ + } + mi_result=mi_delete(curr_file_info->isam,curr_file_info->record); + if ((mi_result == 0 && result) || + (mi_result && (uint) my_errno != result)) + { + if (!recover) + goto com_err; + if (mi_result) + com_count[command][2]++; /* Mark error */ + if (verbose) + printf_log("error: Got result %d from mi_delete instead of %d", + mi_result, result); + } + } + break; + case MI_LOG_WRITE: + case MI_LOG_UPDATE: + if (my_b_read(&cache,(uchar*) head,12)) + goto err; + filepos=mi_sizekorr(head); + length=mi_uint4korr(head+8); + buff=0; + if (read_string(&cache,&buff,(uint) length)) + goto err; + if ((!record_pos_file || + ((record_pos == filepos || record_pos == NO_FILEPOS) && + !cmp_filename(curr_file_info,record_pos_file))) && + (!table_names[0] || (curr_file_info && curr_file_info->used))) + { + if (write_file && + (my_fwrite(write_file,buff,length,MYF(MY_WAIT_IF_FULL | MY_NABP)))) + goto end; + if (verbose) + printf_log("%s: %s at %ld, length=%ld -> %d", + FILENAME(curr_file_info), + command_name[command], filepos,length,result); + } + if (update && curr_file_info && !curr_file_info->closed) + { + if (curr_file_info->isam->s->base.blobs) + fix_blob_pointers(curr_file_info->isam,buff); + if ((enum myisam_log_commands) command == MI_LOG_UPDATE) + { + if (mi_rrnd(curr_file_info->isam,curr_file_info->record,filepos)) + { + if (!recover) + { + result=0; + goto com_err; + } + if (verbose) + printf_log("error: Didn't find row to update with mi_rrnd"); + if (recover == 1 || result || + find_record_with_key(curr_file_info,buff)) + { + com_count[command][2]++; /* Mark error */ + break; + } + } + mi_result=mi_update(curr_file_info->isam,curr_file_info->record, + buff); + if ((mi_result == 0 && result) || + (mi_result && (uint) my_errno != result)) + { + if (!recover) + goto com_err; + if (verbose) + printf_log("error: Got result %d from mi_update instead of %d", + mi_result, result); + if (mi_result) + com_count[command][2]++; /* Mark error */ + } + } + else + { + mi_result=mi_write(curr_file_info->isam,buff); + if ((mi_result == 0 && result) || + (mi_result && (uint) my_errno != result)) + { + if (!recover) + goto com_err; + if (verbose) + printf_log("error: Got result %d from mi_write instead of %d", + mi_result, result); + if (mi_result) + com_count[command][2]++; /* Mark error */ + } + if (!recover && filepos != curr_file_info->isam->lastpos) + { + printf("error: Wrote at position: %s, should have been %s", + llstr(curr_file_info->isam->lastpos,llbuff), + llstr(filepos,llbuff2)); + goto end; + } + } + } + my_free(buff,MYF(0)); + break; + case MI_LOG_LOCK: + if (my_b_read(&cache,(uchar*) head,sizeof(lock_command))) + goto err; + memcpy_fixed(&lock_command,head,sizeof(lock_command)); + if (verbose && !record_pos_file && + (!table_names[0] || (curr_file_info && curr_file_info->used))) + printf_log("%s: %s(%d) -> %d\n",FILENAME(curr_file_info), + command_name[command],lock_command,result); + if (update && curr_file_info && !curr_file_info->closed) + { + if (mi_lock_database(curr_file_info->isam,lock_command) != + (int) result) + goto com_err; + } + break; + case MI_LOG_DELETE_ALL: + if (verbose && !record_pos_file && + (!table_names[0] || (curr_file_info && curr_file_info->used))) + printf_log("%s: %s -> %d\n",FILENAME(curr_file_info), + command_name[command],result); + break; + default: + fflush(stdout); + VOID(fprintf(stderr, + "Error: found unknown command %d in logfile, aborted\n", + command)); + fflush(stderr); + goto end; + } + } + end_key_cache(dflt_key_cache,1); + delete_tree(&tree); + VOID(end_io_cache(&cache)); + VOID(my_close(file,MYF(0))); + if (write_file && my_fclose(write_file,MYF(MY_WME))) + DBUG_RETURN(1); + DBUG_RETURN(0); + + err: + fflush(stdout); + VOID(fprintf(stderr,"Got error %d when reading from logfile\n",my_errno)); + fflush(stderr); + goto end; + com_err: + fflush(stdout); + VOID(fprintf(stderr,"Got error %d, expected %d on command %s at %s\n", + my_errno,result,command_name[command], + llstr(isamlog_filepos,llbuff))); + fflush(stderr); + end: + end_key_cache(dflt_key_cache, 1); + delete_tree(&tree); + VOID(end_io_cache(&cache)); + VOID(my_close(file,MYF(0))); + if (write_file) + VOID(my_fclose(write_file,MYF(MY_WME))); + DBUG_RETURN(1); +} + + +static int read_string(IO_CACHE *file, register uchar* *to, register uint length) +{ + DBUG_ENTER("read_string"); + + if (*to) + my_free((uchar*) *to,MYF(0)); + if (!(*to= (uchar*) my_malloc(length+1,MYF(MY_WME))) || + my_b_read(file,(uchar*) *to,length)) + { + if (*to) + my_free(*to,MYF(0)); + *to= 0; + DBUG_RETURN(1); + } + *((char*) *to+length)= '\0'; + DBUG_RETURN (0); +} /* read_string */ + + +static int file_info_compare(void* cmp_arg __attribute__((unused)), + void *a, void *b) +{ + long lint; + + if ((lint=((struct file_info*) a)->process - + ((struct file_info*) b)->process)) + return lint < 0L ? -1 : 1; + return ((struct file_info*) a)->filenr - ((struct file_info*) b)->filenr; +} + + /* ARGSUSED */ + +static int test_if_open (struct file_info *key, + element_count count __attribute__((unused)), + struct test_if_open_param *param) +{ + if (!strcmp(key->name,param->name) && key->id > param->max_id) + param->max_id=key->id; + return 0; +} + + +static void fix_blob_pointers(MI_INFO *info, uchar *record) +{ + uchar *pos; + MI_BLOB *blob,*end; + + pos=record+info->s->base.reclength; + for (end=info->blobs+info->s->base.blobs, blob= info->blobs; + blob != end ; + blob++) + { + memcpy_fixed(record+blob->offset+blob->pack_length,&pos,sizeof(char*)); + pos+=_mi_calc_blob_length(blob->pack_length,record+blob->offset); + } +} + + /* close the file with hasn't been accessed for the longest time */ + /* ARGSUSED */ + +static int test_when_accessed (struct file_info *key, + element_count count __attribute__((unused)), + struct st_access_param *access_param) +{ + if (key->accessed < access_param->min_accessed && ! key->closed) + { + access_param->min_accessed=key->accessed; + access_param->found=key; + } + return 0; +} + + +static void file_info_free(struct file_info *fileinfo) +{ + DBUG_ENTER("file_info_free"); + if (update) + { + if (!fileinfo->closed) + VOID(mi_close(fileinfo->isam)); + if (fileinfo->record) + my_free(fileinfo->record,MYF(0)); + } + my_free(fileinfo->name,MYF(0)); + my_free(fileinfo->show_name,MYF(0)); + DBUG_VOID_RETURN; +} + + + +static int close_some_file(TREE *tree) +{ + struct st_access_param access_param; + + access_param.min_accessed=LONG_MAX; + access_param.found=0; + + VOID(tree_walk(tree,(tree_walk_action) test_when_accessed, + (void*) &access_param,left_root_right)); + if (!access_param.found) + return 1; /* No open file that is possibly to close */ + if (mi_close(access_param.found->isam)) + return 1; + access_param.found->closed=1; + return 0; +} + + +static int reopen_closed_file(TREE *tree, struct file_info *fileinfo) +{ + char name[FN_REFLEN]; + if (close_some_file(tree)) + return 1; /* No file to close */ + strmov(name,fileinfo->show_name); + if (fileinfo->id > 1) + *strrchr(name,'<')='\0'; /* Remove "" */ + + if (!(fileinfo->isam= mi_open(name,O_RDWR,HA_OPEN_WAIT_IF_LOCKED))) + return 1; + fileinfo->closed=0; + re_open_count++; + return 0; +} + + /* Try to find record with uniq key */ + +static int find_record_with_key(struct file_info *file_info, uchar *record) +{ + uint key; + MI_INFO *info=file_info->isam; + uchar tmp_key[MI_MAX_KEY_BUFF]; + + for (key=0 ; key < info->s->base.keys ; key++) + { + if (mi_is_key_active(info->s->state.key_map, key) && + info->s->keyinfo[key].flag & HA_NOSAME) + { + VOID(_mi_make_key(info,key,tmp_key,record,0L)); + return mi_rkey(info,file_info->record,(int) key,tmp_key,0, + HA_READ_KEY_EXACT); + } + } + return 1; +} + + +static void printf_log(const char *format,...) +{ + char llbuff[21]; + va_list args; + va_start(args,format); + if (verbose > 2) + printf("%9s:",llstr(isamlog_filepos,llbuff)); + if (verbose > 1) + printf("%5ld ",isamlog_process); /* Write process number */ + (void) vprintf((char*) format,args); + putchar('\n'); + va_end(args); +} + + +static bool cmp_filename(struct file_info *file_info, char * name) +{ + if (!file_info) + return 1; + return strcmp(file_info->name,name) ? 1 : 0; +} Added: trunk/src/myisampack.c =================================================================== --- trunk/src/myisampack.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/myisampack.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,3204 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Pack MyISAM file */ + +#ifndef USE_MY_FUNC +#define USE_MY_FUNC /* We need at least my_malloc */ +#endif + +#include "myisamdef.h" +#include +#include +#include "mysys_err.h" +#ifdef MSDOS +#include +#endif +#ifndef __GNU_LIBRARY__ +#define __GNU_LIBRARY__ /* Skip warnings in getopt.h */ +#endif +#include +#include + +#if SIZEOF_LONG_LONG > 4 +#define BITS_SAVED 64 +#else +#define BITS_SAVED 32 +#endif + +#define IS_OFFSET ((uint) 32768) /* Bit if offset or char in tree */ +#define HEAD_LENGTH 32 +#define ALLOWED_JOIN_DIFF 256 /* Diff allowed to join trees */ + +#define DATA_TMP_EXT ".TMD" +#define OLD_EXT ".OLD" +#define WRITE_COUNT MY_HOW_OFTEN_TO_WRITE + +struct st_file_buffer { + File file; + uchar *buffer,*pos,*end; + my_off_t pos_in_file; + int bits; + ulonglong bitbucket; +}; + +struct st_huff_tree; +struct st_huff_element; + +typedef struct st_huff_counts { + uint field_length,max_zero_fill; + uint pack_type; + uint max_end_space,max_pre_space,length_bits,min_space; + ulong max_length; + enum en_fieldtype field_type; + struct st_huff_tree *tree; /* Tree for field */ + my_off_t counts[256]; + my_off_t end_space[8]; + my_off_t pre_space[8]; + my_off_t tot_end_space,tot_pre_space,zero_fields,empty_fields,bytes_packed; + TREE int_tree; /* Tree for detecting distinct column values. */ + uchar *tree_buff; /* Column values, 'field_length' each. */ + uchar *tree_pos; /* Points to end of column values in 'tree_buff'. */ +} HUFF_COUNTS; + +typedef struct st_huff_element HUFF_ELEMENT; + +/* + WARNING: It is crucial for the optimizations in calc_packed_length() + that 'count' is the first element of 'HUFF_ELEMENT'. +*/ +struct st_huff_element { + my_off_t count; + union un_element { + struct st_nod { + HUFF_ELEMENT *left,*right; + } nod; + struct st_leaf { + HUFF_ELEMENT *null; + uint element_nr; /* Number of element */ + } leaf; + } a; +}; + + +typedef struct st_huff_tree { + HUFF_ELEMENT *root,*element_buffer; + HUFF_COUNTS *counts; + uint tree_number; + uint elements; + my_off_t bytes_packed; + uint tree_pack_length; + uint min_chr,max_chr,char_bits,offset_bits,max_offset,height; + ulonglong *code; + uchar *code_len; +} HUFF_TREE; + + +typedef struct st_isam_mrg { + MI_INFO **file,**current,**end; + uint free_file; + uint count; + uint min_pack_length; /* Theese is used by packed data */ + uint max_pack_length; + uint ref_length; + uint max_blob_length; + my_off_t records; + /* true if at least one source file has at least one disabled index */ + my_bool src_file_has_indexes_disabled; +} PACK_MRG_INFO; + + +extern int main(int argc,char * *argv); +static void get_options(int *argc,char ***argv); +static MI_INFO *open_isam_file(char *name,int mode); +static bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count); +static int compress(PACK_MRG_INFO *file,char *join_name); +static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records); +static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, + uint trees, + HUFF_COUNTS *huff_counts, + uint fields); +static int compare_tree(void* cmp_arg __attribute__((unused)), + const uchar *s,const uchar *t); +static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts); +static void check_counts(HUFF_COUNTS *huff_counts,uint trees, + my_off_t records); +static int test_space_compress(HUFF_COUNTS *huff_counts,my_off_t records, + uint max_space_length,my_off_t *space_counts, + my_off_t tot_space_count, + enum en_fieldtype field_type); +static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts,uint trees); +static int make_huff_tree(HUFF_TREE *tree,HUFF_COUNTS *huff_counts); +static int compare_huff_elements(void *not_used, uchar *a,uchar *b); +static int save_counts_in_queue(uchar *key,element_count count, + HUFF_TREE *tree); +static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,uint flag); +static uint join_same_trees(HUFF_COUNTS *huff_counts,uint trees); +static int make_huff_decode_table(HUFF_TREE *huff_tree,uint trees); +static void make_traverse_code_tree(HUFF_TREE *huff_tree, + HUFF_ELEMENT *element,uint size, + ulonglong code); +static int write_header(PACK_MRG_INFO *isam_file, uint header_length,uint trees, + my_off_t tot_elements,my_off_t filelength); +static void write_field_info(HUFF_COUNTS *counts, uint fields,uint trees); +static my_off_t write_huff_tree(HUFF_TREE *huff_tree,uint trees); +static uint *make_offset_code_tree(HUFF_TREE *huff_tree, + HUFF_ELEMENT *element, + uint *offset); +static uint max_bit(uint value); +static int compress_isam_file(PACK_MRG_INFO *file,HUFF_COUNTS *huff_counts); +static char *make_new_name(char *new_name,char *old_name); +static char *make_old_name(char *new_name,char *old_name); +static void init_file_buffer(File file,pbool read_buffer); +static int flush_buffer(ulong neaded_length); +static void end_file_buffer(void); +static void write_bits(ulonglong value, uint bits); +static void flush_bits(void); +static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length, + ha_checksum crc); +static int save_state_mrg(File file,PACK_MRG_INFO *isam_file,my_off_t new_length, + ha_checksum crc); +static int mrg_close(PACK_MRG_INFO *mrg); +static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf); +static void mrg_reset(PACK_MRG_INFO *mrg); +#if !defined(DBUG_OFF) +static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count); +static int fakecmp(my_off_t **count1, my_off_t **count2); +#endif + + +static int error_on_write=0,test_only=0,verbose=0,silent=0, + write_loop=0,force_pack=0, isamchk_neaded=0; +static int tmpfile_createflag=O_RDWR | O_TRUNC | O_EXCL; +static my_bool backup, opt_wait; +/* + tree_buff_length is somewhat arbitrary. The bigger it is the better + the chance to win in terms of compression factor. On the other hand, + this table becomes part of the compressed file header. And its length + is coded with 16 bits in the header. Hence the limit is 2**16 - 1. +*/ +static uint tree_buff_length= 65536 - MALLOC_OVERHEAD; +static char tmp_dir[FN_REFLEN]={0},*join_table; +static my_off_t intervall_length; +static ha_checksum glob_crc; +static struct st_file_buffer file_buffer; +static QUEUE queue; +static HUFF_COUNTS *global_count; +static char zero_string[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +static const char *load_default_groups[]= { "myisampack",0 }; + + /* The main program */ + +int main(int argc, char **argv) +{ + int error,ok; + PACK_MRG_INFO merge; + char **default_argv; + MY_INIT(argv[0]); + + load_defaults("my",load_default_groups,&argc,&argv); + default_argv= argv; + get_options(&argc,&argv); + + error=ok=isamchk_neaded=0; + if (join_table) + { /* Join files into one */ + if (open_isam_files(&merge,argv,(uint) argc) || + compress(&merge,join_table)) + error=1; + } + else while (argc--) + { + MI_INFO *isam_file; + if (!(isam_file=open_isam_file(*argv++,O_RDWR))) + error=1; + else + { + merge.file= &isam_file; + merge.current=0; + merge.free_file=0; + merge.count=1; + if (compress(&merge,0)) + error=1; + else + ok=1; + } + } + if (ok && isamchk_neaded && !silent) + puts("Remember to run myisamchk -rq on compressed tables"); + VOID(fflush(stdout)); + VOID(fflush(stderr)); + free_defaults(default_argv); + my_end(verbose ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR); + exit(error ? 2 : 0); +#ifndef _lint + return 0; /* No compiler warning */ +#endif +} + +enum options_mp {OPT_CHARSETS_DIR_MP=256, OPT_AUTO_CLOSE}; + +static struct my_option my_long_options[] = +{ +#ifdef __NETWARE__ + {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#endif + {"backup", 'b', "Make a backup of the table as table_name.OLD.", + (uchar**) &backup, (uchar**) &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"character-sets-dir", OPT_CHARSETS_DIR_MP, + "Directory where character sets are.", (uchar**) &charsets_dir, + (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", + 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"force", 'f', + "Force packing of table even if it gets bigger or if tempfile exists.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"join", 'j', + "Join all given tables into 'new_table_name'. All tables MUST have identical layouts.", + (uchar**) &join_table, (uchar**) &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, + 0, 0, 0}, + {"help", '?', "Display this help and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"silent", 's', "Be more silent.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"tmpdir", 'T', "Use temporary directory to store temporary table.", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"test", 't', "Don't pack table, only test packing it.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Write info about progress and packing result. Use many -v for more verbosity!", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"version", 'V', "Output version information and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"wait", 'w', "Wait and retry if table is in use.", (uchar**) &opt_wait, + (uchar**) &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + +#include + +static void print_version(void) +{ + VOID(printf("%s Ver 1.23 for %s on %s\n", + my_progname, SYSTEM_TYPE, MACHINE_TYPE)); + NETWARE_SET_SCREEN_MODE(1); +} + + +static void usage(void) +{ + print_version(); + puts("Copyright (C) 2002 MySQL AB"); + puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,"); + puts("and you are welcome to modify and redistribute it under the GPL license\n"); + + puts("Pack a MyISAM-table to take much less space."); + puts("Keys are not updated, you must run myisamchk -rq on the datafile"); + puts("afterwards to update the keys."); + puts("You should give the .MYI file as the filename argument."); + + VOID(printf("\nUsage: %s [OPTIONS] filename...\n", my_progname)); + my_print_help(my_long_options); + print_defaults("my", load_default_groups); + my_print_variables(my_long_options); +} + +#include + +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + uint length; + + switch(optid) { +#ifdef __NETWARE__ + case OPT_AUTO_CLOSE: + setscreenmode(SCR_AUTOCLOSE_ON_EXIT); + break; +#endif + case 'f': + force_pack= 1; + tmpfile_createflag= O_RDWR | O_TRUNC; + break; + case 's': + write_loop= verbose= 0; + silent= 1; + break; + case 't': + test_only= 1; + /* Avoid to reset 'verbose' if it was already set > 1. */ + if (! verbose) + verbose= 1; + break; + case 'T': + length= (uint) (strmov(tmp_dir, argument) - tmp_dir); + if (length != dirname_length(tmp_dir)) + { + tmp_dir[length]=FN_LIBCHAR; + tmp_dir[length+1]=0; + } + break; + case 'v': + verbose++; /* Allow for selecting the level of verbosity. */ + silent= 0; + break; + case '#': + DBUG_PUSH(argument ? argument : "d:t:o"); + break; + case 'V': + print_version(); + exit(0); + case 'I': + case '?': + usage(); + exit(0); + } + return 0; +} + + /* reads options */ + /* Initiates DEBUG - but no debugging here ! */ + +static void get_options(int *argc,char ***argv) +{ + int ho_error; + + my_progname= argv[0][0]; + if (isatty(fileno(stdout))) + write_loop=1; + + if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) + exit(ho_error); + + if (!*argc) + { + usage(); + exit(1); + } + if (join_table) + { + backup=0; /* Not needed */ + tmp_dir[0]=0; + } + return; +} + + +static MI_INFO *open_isam_file(char *name,int mode) +{ + MI_INFO *isam_file; + MYISAM_SHARE *share; + DBUG_ENTER("open_isam_file"); + + if (!(isam_file=mi_open(name,mode, + (opt_wait ? HA_OPEN_WAIT_IF_LOCKED : + HA_OPEN_ABORT_IF_LOCKED)))) + { + VOID(fprintf(stderr, "%s gave error %d on open\n", name, my_errno)); + DBUG_RETURN(0); + } + share=isam_file->s; + if (share->options & HA_OPTION_COMPRESS_RECORD && !join_table) + { + if (!force_pack) + { + VOID(fprintf(stderr, "%s is already compressed\n", name)); + VOID(mi_close(isam_file)); + DBUG_RETURN(0); + } + if (verbose) + puts("Recompressing already compressed table"); + share->options&= ~HA_OPTION_READ_ONLY_DATA; /* We are modifing it */ + } + if (! force_pack && share->state.state.records != 0 && + (share->state.state.records <= 1 || + share->state.state.data_file_length < 1024)) + { + VOID(fprintf(stderr, "%s is too small to compress\n", name)); + VOID(mi_close(isam_file)); + DBUG_RETURN(0); + } + VOID(mi_lock_database(isam_file,F_WRLCK)); + DBUG_RETURN(isam_file); +} + + +static bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count) +{ + uint i,j; + mrg->count=0; + mrg->current=0; + mrg->file=(MI_INFO**) my_malloc(sizeof(MI_INFO*)*count,MYF(MY_FAE)); + mrg->free_file=1; + mrg->src_file_has_indexes_disabled= 0; + for (i=0; i < count ; i++) + { + if (!(mrg->file[i]=open_isam_file(names[i],O_RDONLY))) + goto error; + + mrg->src_file_has_indexes_disabled|= + ! mi_is_all_keys_active(mrg->file[i]->s->state.key_map, + mrg->file[i]->s->base.keys); + } + /* Check that files are identical */ + for (j=0 ; j < count-1 ; j++) + { + MI_COLUMNDEF *m1,*m2,*end; + if (mrg->file[j]->s->base.reclength != mrg->file[j+1]->s->base.reclength || + mrg->file[j]->s->base.fields != mrg->file[j+1]->s->base.fields) + goto diff_file; + m1=mrg->file[j]->s->rec; + end=m1+mrg->file[j]->s->base.fields; + m2=mrg->file[j+1]->s->rec; + for ( ; m1 != end ; m1++,m2++) + { + if (m1->type != m2->type || m1->length != m2->length) + goto diff_file; + } + } + mrg->count=count; + return 0; + + diff_file: + VOID(fprintf(stderr, "%s: Tables '%s' and '%s' are not identical\n", + my_progname, names[j], names[j+1])); + error: + while (i--) + mi_close(mrg->file[i]); + my_free((uchar*) mrg->file,MYF(0)); + return 1; +} + + +static int compress(PACK_MRG_INFO *mrg,char *result_table) +{ + int error; + File new_file,join_isam_file; + MI_INFO *isam_file; + MYISAM_SHARE *share; + char org_name[FN_REFLEN],new_name[FN_REFLEN],temp_name[FN_REFLEN]; + uint i,header_length,fields,trees,used_trees; + my_off_t old_length,new_length,tot_elements; + HUFF_COUNTS *huff_counts; + HUFF_TREE *huff_trees; + DBUG_ENTER("compress"); + + isam_file=mrg->file[0]; /* Take this as an example */ + share=isam_file->s; + new_file=join_isam_file= -1; + trees=fields=0; + huff_trees=0; + huff_counts=0; + + /* Create temporary or join file */ + + if (backup) + VOID(fn_format(org_name,isam_file->filename,"",MI_NAME_DEXT,2)); + else + VOID(fn_format(org_name,isam_file->filename,"",MI_NAME_DEXT,2+4+16)); + if (!test_only && result_table) + { + /* Make a new indexfile based on first file in list */ + uint length; + uchar *buff; + strmov(org_name,result_table); /* Fix error messages */ + VOID(fn_format(new_name,result_table,"",MI_NAME_IEXT,2)); + if ((join_isam_file=my_create(new_name,0,tmpfile_createflag,MYF(MY_WME))) + < 0) + goto err; + length=(uint) share->base.keystart; + if (!(buff= (uchar*) my_malloc(length,MYF(MY_WME)))) + goto err; + if (my_pread(share->kfile,buff,length,0L,MYF(MY_WME | MY_NABP)) || + my_write(join_isam_file,buff,length, + MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL))) + { + my_free(buff,MYF(0)); + goto err; + } + my_free(buff,MYF(0)); + VOID(fn_format(new_name,result_table,"",MI_NAME_DEXT,2)); + } + else if (!tmp_dir[0]) + VOID(make_new_name(new_name,org_name)); + else + VOID(fn_format(new_name,org_name,tmp_dir,DATA_TMP_EXT,1+2+4)); + if (!test_only && + (new_file=my_create(new_name,0,tmpfile_createflag,MYF(MY_WME))) < 0) + goto err; + + /* Start calculating statistics */ + + mrg->records=0; + for (i=0 ; i < mrg->count ; i++) + mrg->records+=mrg->file[i]->s->state.state.records; + + DBUG_PRINT("info", ("Compressing %s: (%lu records)", + result_table ? new_name : org_name, + (ulong) mrg->records)); + if (write_loop || verbose) + { + VOID(printf("Compressing %s: (%lu records)\n", + result_table ? new_name : org_name, (ulong) mrg->records)); + } + trees=fields=share->base.fields; + huff_counts=init_huff_count(isam_file,mrg->records); + QUICK_SAFEMALLOC; + + /* + Read the whole data file(s) for statistics. + */ + DBUG_PRINT("info", ("- Calculating statistics")); + if (write_loop || verbose) + VOID(printf("- Calculating statistics\n")); + if (get_statistic(mrg,huff_counts)) + goto err; + NORMAL_SAFEMALLOC; + old_length=0; + for (i=0; i < mrg->count ; i++) + old_length+= (mrg->file[i]->s->state.state.data_file_length - + mrg->file[i]->s->state.state.empty); + + /* + Create a global priority queue in preparation for making + temporary Huffman trees. + */ + if (init_queue(&queue,256,0,0,compare_huff_elements,0)) + goto err; + + /* + Check each column if we should use pre-space-compress, end-space- + compress, empty-field-compress or zero-field-compress. + */ + check_counts(huff_counts,fields,mrg->records); + + /* + Build a Huffman tree for each column. + */ + huff_trees=make_huff_trees(huff_counts,trees); + + /* + If the packed lengths of combined columns is less then the sum of + the non-combined columns, then create common Huffman trees for them. + We do this only for byte compressed columns, not for distinct values + compressed columns. + */ + if ((int) (used_trees=join_same_trees(huff_counts,trees)) < 0) + goto err; + + /* + Assign codes to all byte or column values. + */ + if (make_huff_decode_table(huff_trees,fields)) + goto err; + + /* Prepare a file buffer. */ + init_file_buffer(new_file,0); + + /* + Reserve space in the target file for the fixed compressed file header. + */ + file_buffer.pos_in_file=HEAD_LENGTH; + if (! test_only) + VOID(my_seek(new_file,file_buffer.pos_in_file,MY_SEEK_SET,MYF(0))); + + /* + Write field infos: field type, pack type, length bits, tree number. + */ + write_field_info(huff_counts,fields,used_trees); + + /* + Write decode trees. + */ + if (!(tot_elements=write_huff_tree(huff_trees,trees))) + goto err; + + /* + Calculate the total length of the compression info header. + This includes the fixed compressed file header, the column compression + type descriptions, and the decode trees. + */ + header_length=(uint) file_buffer.pos_in_file+ + (uint) (file_buffer.pos-file_buffer.buffer); + + /* + Compress the source file into the target file. + */ + DBUG_PRINT("info", ("- Compressing file")); + if (write_loop || verbose) + VOID(printf("- Compressing file\n")); + error=compress_isam_file(mrg,huff_counts); + new_length=file_buffer.pos_in_file; + if (!error && !test_only) + { + uchar buff[MEMMAP_EXTRA_MARGIN]; /* End marginal for memmap */ + bzero(buff,sizeof(buff)); + error=my_write(file_buffer.file,buff,sizeof(buff), + MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0; + } + + /* + Write the fixed compressed file header. + */ + if (!error) + error=write_header(mrg,header_length,used_trees,tot_elements, + new_length); + + /* Flush the file buffer. */ + end_file_buffer(); + + /* Display statistics. */ + DBUG_PRINT("info", ("Min record length: %6d Max length: %6d " + "Mean total length: %6ld\n", + mrg->min_pack_length, mrg->max_pack_length, + (ulong) (mrg->records ? (new_length/mrg->records) : 0))); + if (verbose && mrg->records) + VOID(printf("Min record length: %6d Max length: %6d " + "Mean total length: %6ld\n", mrg->min_pack_length, + mrg->max_pack_length, (ulong) (new_length/mrg->records))); + + /* Close source and target file. */ + if (!test_only) + { + error|=my_close(new_file,MYF(MY_WME)); + if (!result_table) + { + error|=my_close(isam_file->dfile,MYF(MY_WME)); + isam_file->dfile= -1; /* Tell mi_close file is closed */ + } + } + + /* Cleanup. */ + free_counts_and_tree_and_queue(huff_trees,trees,huff_counts,fields); + if (! test_only && ! error) + { + if (result_table) + { + error=save_state_mrg(join_isam_file,mrg,new_length,glob_crc); + } + else + { + if (backup) + { + if (my_rename(org_name,make_old_name(temp_name,isam_file->filename), + MYF(MY_WME))) + error=1; + else + { + if (tmp_dir[0]) + error=my_copy(new_name,org_name,MYF(MY_WME)); + else + error=my_rename(new_name,org_name,MYF(MY_WME)); + if (!error) + { + VOID(my_copystat(temp_name,org_name,MYF(MY_COPYTIME))); + if (tmp_dir[0]) + VOID(my_delete(new_name,MYF(MY_WME))); + } + } + } + else + { + if (tmp_dir[0]) + { + error=my_copy(new_name,org_name, + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_COPYTIME)); + if (!error) + VOID(my_delete(new_name,MYF(MY_WME))); + } + else + error=my_redel(org_name,new_name,MYF(MY_WME | MY_COPYTIME)); + } + if (! error) + error=save_state(isam_file,mrg,new_length,glob_crc); + } + } + error|=mrg_close(mrg); + if (join_isam_file >= 0) + error|=my_close(join_isam_file,MYF(MY_WME)); + if (error) + { + VOID(fprintf(stderr, "Aborting: %s is not compressed\n", org_name)); + VOID(my_delete(new_name,MYF(MY_WME))); + DBUG_RETURN(-1); + } + if (write_loop || verbose) + { + if (old_length) + VOID(printf("%.4g%% \n", + (((longlong) (old_length - new_length)) * 100.0 / + (longlong) old_length))); + else + puts("Empty file saved in compressed format"); + } + DBUG_RETURN(0); + + err: + free_counts_and_tree_and_queue(huff_trees,trees,huff_counts,fields); + if (new_file >= 0) + VOID(my_close(new_file,MYF(0))); + if (join_isam_file >= 0) + VOID(my_close(join_isam_file,MYF(0))); + mrg_close(mrg); + VOID(fprintf(stderr, "Aborted: %s is not compressed\n", org_name)); + DBUG_RETURN(-1); +} + + /* Init a huff_count-struct for each field and init it */ + +static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records) +{ + reg2 uint i; + reg1 HUFF_COUNTS *count; + if ((count = (HUFF_COUNTS*) my_malloc(info->s->base.fields* + sizeof(HUFF_COUNTS), + MYF(MY_ZEROFILL | MY_WME)))) + { + for (i=0 ; i < info->s->base.fields ; i++) + { + enum en_fieldtype type; + count[i].field_length=info->s->rec[i].length; + type= count[i].field_type= (enum en_fieldtype) info->s->rec[i].type; + if (type == FIELD_INTERVALL || + type == FIELD_CONSTANT || + type == FIELD_ZERO) + type = FIELD_NORMAL; + if (count[i].field_length <= 8 && + (type == FIELD_NORMAL || + type == FIELD_SKIP_ZERO)) + count[i].max_zero_fill= count[i].field_length; + /* + For every column initialize a tree, which is used to detect distinct + column values. 'int_tree' works together with 'tree_buff' and + 'tree_pos'. It's keys are implemented by pointers into 'tree_buff'. + This is accomplished by '-1' as the element size. + */ + init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0, NULL, + NULL); + if (records && type != FIELD_BLOB && type != FIELD_VARCHAR) + count[i].tree_pos=count[i].tree_buff = + my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, + MYF(MY_WME)); + } + } + return count; +} + + + /* Free memory used by counts and trees */ + +static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees, + HUFF_COUNTS *huff_counts, + uint fields) +{ + register uint i; + + if (huff_trees) + { + for (i=0 ; i < trees ; i++) + { + if (huff_trees[i].element_buffer) + my_free((uchar*) huff_trees[i].element_buffer,MYF(0)); + if (huff_trees[i].code) + my_free((uchar*) huff_trees[i].code,MYF(0)); + } + my_free((uchar*) huff_trees,MYF(0)); + } + if (huff_counts) + { + for (i=0 ; i < fields ; i++) + { + if (huff_counts[i].tree_buff) + { + my_free((uchar*) huff_counts[i].tree_buff,MYF(0)); + delete_tree(&huff_counts[i].int_tree); + } + } + my_free((uchar*) huff_counts,MYF(0)); + } + delete_queue(&queue); /* This is safe to free */ + return; +} + + /* Read through old file and gather some statistics */ + +static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts) +{ + int error; + uint length; + ulong reclength,max_blob_length; + uchar *record,*pos,*next_pos,*end_pos,*start_pos; + ha_rows record_count; + my_bool static_row_size; + HUFF_COUNTS *count,*end_count; + TREE_ELEMENT *element; + DBUG_ENTER("get_statistic"); + + reclength=mrg->file[0]->s->base.reclength; + record=(uchar*) my_alloca(reclength); + end_count=huff_counts+mrg->file[0]->s->base.fields; + record_count=0; glob_crc=0; + max_blob_length=0; + + /* Check how to calculate checksum */ + static_row_size=1; + for (count=huff_counts ; count < end_count ; count++) + { + if (count->field_type == FIELD_BLOB || + count->field_type == FIELD_VARCHAR) + { + static_row_size=0; + break; + } + } + + mrg_reset(mrg); + while ((error=mrg_rrnd(mrg,record)) != HA_ERR_END_OF_FILE) + { + ulong tot_blob_length=0; + if (! error) + { + /* glob_crc is a checksum over all bytes of all records. */ + if (static_row_size) + glob_crc+=mi_static_checksum(mrg->file[0],record); + else + glob_crc+=mi_checksum(mrg->file[0],record); + + /* Count the incidence of values separately for every column. */ + for (pos=record,count=huff_counts ; + count < end_count ; + count++, + pos=next_pos) + { + next_pos=end_pos=(start_pos=pos)+count->field_length; + + /* + Put the whole column value in a tree if there is room for it. + 'int_tree' is used to quickly check for duplicate values. + 'tree_buff' collects as many distinct column values as + possible. If the field length is > 1, it is tree_buff_length, + else 2 bytes. Each value is 'field_length' bytes big. If there + are more distinct column values than fit into the buffer, we + give up with this tree. BLOBs and VARCHARs do not have a + tree_buff as it can only be used with fixed length columns. + For the special case of field length == 1, we handle only the + case that there is only one distinct value in the table(s). + Otherwise, we can have a maximum of 256 distinct values. This + is then handled by the normal Huffman tree build. + + Another limit for collecting distinct column values is the + number of values itself. Since we would need to build a + Huffman tree for the values, we are limited by the 'IS_OFFSET' + constant. This constant expresses a bit which is used to + determine if a tree element holds a final value or an offset + to a child element. Hence, all values and offsets need to be + smaller than 'IS_OFFSET'. A tree element is implemented with + two integer values, one for the left branch and one for the + right branch. For the extreme case that the first element + points to the last element, the number of integers in the tree + must be less or equal to IS_OFFSET. So the number of elements + must be less or equal to IS_OFFSET / 2. + + WARNING: At first, we insert a pointer into the record buffer + as the key for the tree. If we got a new distinct value, which + is really inserted into the tree, instead of being counted + only, we will copy the column value from the record buffer to + 'tree_buff' and adjust the key pointer of the tree accordingly. + */ + if (count->tree_buff) + { + global_count=count; + if (!(element=tree_insert(&count->int_tree,pos, 0, + count->int_tree.custom_arg)) || + (element->count == 1 && + (count->tree_buff + tree_buff_length < + count->tree_pos + count->field_length)) || + (count->int_tree.elements_in_tree > IS_OFFSET / 2) || + (count->field_length == 1 && + count->int_tree.elements_in_tree > 1)) + { + delete_tree(&count->int_tree); + my_free(count->tree_buff,MYF(0)); + count->tree_buff=0; + } + else + { + /* + If tree_insert() succeeds, it either creates a new element + or increments the counter of an existing element. + */ + if (element->count == 1) + { + /* Copy the new column value into 'tree_buff'. */ + memcpy(count->tree_pos,pos,(size_t) count->field_length); + /* Adjust the key pointer in the tree. */ + tree_set_pointer(element,count->tree_pos); + /* Point behind the last column value so far. */ + count->tree_pos+=count->field_length; + } + } + } + + /* Save character counters and space-counts and zero-field-counts */ + if (count->field_type == FIELD_NORMAL || + count->field_type == FIELD_SKIP_ENDSPACE) + { + /* Ignore trailing space. */ + for ( ; end_pos > pos ; end_pos--) + if (end_pos[-1] != ' ') + break; + /* Empty fields are just counted. Go to the next record. */ + if (end_pos == pos) + { + count->empty_fields++; + count->max_zero_fill=0; + continue; + } + /* + Count the total of all trailing spaces and the number of + short trailing spaces. Remember the longest trailing space. + */ + length= (uint) (next_pos-end_pos); + count->tot_end_space+=length; + if (length < 8) + count->end_space[length]++; + if (count->max_end_space < length) + count->max_end_space = length; + } + + if (count->field_type == FIELD_NORMAL || + count->field_type == FIELD_SKIP_PRESPACE) + { + /* Ignore leading space. */ + for (pos=start_pos; pos < end_pos ; pos++) + if (pos[0] != ' ') + break; + /* Empty fields are just counted. Go to the next record. */ + if (end_pos == pos) + { + count->empty_fields++; + count->max_zero_fill=0; + continue; + } + /* + Count the total of all leading spaces and the number of + short leading spaces. Remember the longest leading space. + */ + length= (uint) (pos-start_pos); + count->tot_pre_space+=length; + if (length < 8) + count->pre_space[length]++; + if (count->max_pre_space < length) + count->max_pre_space = length; + } + + /* Calculate pos, end_pos, and max_length for variable length fields. */ + if (count->field_type == FIELD_BLOB) + { + uint field_length=count->field_length -mi_portable_sizeof_char_ptr; + ulong blob_length= _mi_calc_blob_length(field_length, start_pos); + memcpy_fixed((char*) &pos, start_pos+field_length,sizeof(char*)); + end_pos=pos+blob_length; + tot_blob_length+=blob_length; + set_if_bigger(count->max_length,blob_length); + } + else if (count->field_type == FIELD_VARCHAR) + { + uint pack_length= HA_VARCHAR_PACKLENGTH(count->field_length-1); + length= (pack_length == 1 ? (uint) *(uchar*) start_pos : + uint2korr(start_pos)); + pos= start_pos+pack_length; + end_pos= pos+length; + set_if_bigger(count->max_length,length); + } + + /* Evaluate 'max_zero_fill' for short fields. */ + if (count->field_length <= 8 && + (count->field_type == FIELD_NORMAL || + count->field_type == FIELD_SKIP_ZERO)) + { + uint i; + /* Zero fields are just counted. Go to the next record. */ + if (!memcmp((uchar*) start_pos,zero_string,count->field_length)) + { + count->zero_fields++; + continue; + } + /* + max_zero_fill starts with field_length. It is decreased every + time a shorter "zero trailer" is found. It is set to zero when + an empty field is found (see above). This suggests that the + variable should be called 'min_zero_fill'. + */ + for (i =0 ; i < count->max_zero_fill && ! end_pos[-1 - (int) i] ; + i++) ; + if (i < count->max_zero_fill) + count->max_zero_fill=i; + } + + /* Ignore zero fields and check fields. */ + if (count->field_type == FIELD_ZERO || + count->field_type == FIELD_CHECK) + continue; + + /* + Count the incidence of every byte value in the + significant field value. + */ + for ( ; pos < end_pos ; pos++) + count->counts[(uchar) *pos]++; + + /* Step to next field. */ + } + + if (tot_blob_length > max_blob_length) + max_blob_length=tot_blob_length; + record_count++; + if (write_loop && record_count % WRITE_COUNT == 0) + { + VOID(printf("%lu\r", (ulong) record_count)); + VOID(fflush(stdout)); + } + } + else if (error != HA_ERR_RECORD_DELETED) + { + VOID(fprintf(stderr, "Got error %d while reading rows", error)); + break; + } + + /* Step to next record. */ + } + if (write_loop) + { + VOID(printf(" \r")); + VOID(fflush(stdout)); + } + + /* + If --debug=d,fakebigcodes is set, fake the counts to get big Huffman + codes. + */ + DBUG_EXECUTE_IF("fakebigcodes", fakebigcodes(huff_counts, end_count);); + + DBUG_PRINT("info", ("Found the following number of incidents " + "of the byte codes:")); + if (verbose >= 2) + VOID(printf("Found the following number of incidents " + "of the byte codes:\n")); + for (count= huff_counts ; count < end_count; count++) + { + uint idx; + my_off_t total_count; + char llbuf[32]; + + DBUG_PRINT("info", ("column: %3u", (uint) (count - huff_counts + 1))); + if (verbose >= 2) + VOID(printf("column: %3u\n", (uint) (count - huff_counts + 1))); + if (count->tree_buff) + { + DBUG_PRINT("info", ("number of distinct values: %u", + (uint) ((count->tree_pos - count->tree_buff) / + count->field_length))); + if (verbose >= 2) + VOID(printf("number of distinct values: %u\n", + (uint) ((count->tree_pos - count->tree_buff) / + count->field_length))); + } + total_count= 0; + for (idx= 0; idx < 256; idx++) + { + if (count->counts[idx]) + { + total_count+= count->counts[idx]; + DBUG_PRINT("info", ("counts[0x%02x]: %12s", idx, + llstr((longlong) count->counts[idx], llbuf))); + if (verbose >= 2) + VOID(printf("counts[0x%02x]: %12s\n", idx, + llstr((longlong) count->counts[idx], llbuf))); + } + } + DBUG_PRINT("info", ("total: %12s", llstr((longlong) total_count, + llbuf))); + if ((verbose >= 2) && total_count) + { + VOID(printf("total: %12s\n", + llstr((longlong) total_count, llbuf))); + } + } + + mrg->records=record_count; + mrg->max_blob_length=max_blob_length; + my_afree((uchar*) record); + DBUG_RETURN(error != HA_ERR_END_OF_FILE); +} + +static int compare_huff_elements(void *not_used __attribute__((unused)), + uchar *a, uchar *b) +{ + return *((my_off_t*) a) < *((my_off_t*) b) ? -1 : + (*((my_off_t*) a) == *((my_off_t*) b) ? 0 : 1); +} + + /* Check each tree if we should use pre-space-compress, end-space- + compress, empty-field-compress or zero-field-compress */ + +static void check_counts(HUFF_COUNTS *huff_counts, uint trees, + my_off_t records) +{ + uint space_fields,fill_zero_fields,field_count[(int) FIELD_enum_val_count]; + my_off_t old_length,new_length,length; + DBUG_ENTER("check_counts"); + + bzero((uchar*) field_count,sizeof(field_count)); + space_fields=fill_zero_fields=0; + + for (; trees-- ; huff_counts++) + { + if (huff_counts->field_type == FIELD_BLOB) + { + huff_counts->length_bits=max_bit(huff_counts->max_length); + goto found_pack; + } + else if (huff_counts->field_type == FIELD_VARCHAR) + { + huff_counts->length_bits=max_bit(huff_counts->max_length); + goto found_pack; + } + else if (huff_counts->field_type == FIELD_CHECK) + { + huff_counts->bytes_packed=0; + huff_counts->counts[0]=0; + goto found_pack; + } + + huff_counts->field_type=FIELD_NORMAL; + huff_counts->pack_type=0; + + /* Check for zero-filled records (in this column), or zero records. */ + if (huff_counts->zero_fields || ! records) + { + my_off_t old_space_count; + /* + If there are only zero filled records (in this column), + or no records at all, we are done. + */ + if (huff_counts->zero_fields == records) + { + huff_counts->field_type= FIELD_ZERO; + huff_counts->bytes_packed=0; + huff_counts->counts[0]=0; + goto found_pack; + } + /* Remeber the number of significant spaces. */ + old_space_count=huff_counts->counts[' ']; + /* Add all leading and trailing spaces. */ + huff_counts->counts[' ']+= (huff_counts->tot_end_space + + huff_counts->tot_pre_space + + huff_counts->empty_fields * + huff_counts->field_length); + /* Check, what the compressed length of this would be. */ + old_length=calc_packed_length(huff_counts,0)+records/8; + /* Get the number of zero bytes. */ + length=huff_counts->zero_fields*huff_counts->field_length; + /* Add it to the counts. */ + huff_counts->counts[0]+=length; + /* Check, what the compressed length of this would be. */ + new_length=calc_packed_length(huff_counts,0); + /* If the compression without the zeroes would be shorter, we are done. */ + if (old_length < new_length && huff_counts->field_length > 1) + { + huff_counts->field_type=FIELD_SKIP_ZERO; + huff_counts->counts[0]-=length; + huff_counts->bytes_packed=old_length- records/8; + goto found_pack; + } + /* Remove the insignificant spaces, but keep the zeroes. */ + huff_counts->counts[' ']=old_space_count; + } + /* Check, what the compressed length of this column would be. */ + huff_counts->bytes_packed=calc_packed_length(huff_counts,0); + + /* + If there are enough empty records (in this column), + treating them specially may pay off. + */ + if (huff_counts->empty_fields) + { + if (huff_counts->field_length > 2 && + huff_counts->empty_fields + (records - huff_counts->empty_fields)* + (1+max_bit(max(huff_counts->max_pre_space, + huff_counts->max_end_space))) < + records * max_bit(huff_counts->field_length)) + { + huff_counts->pack_type |= PACK_TYPE_SPACE_FIELDS; + } + else + { + length=huff_counts->empty_fields*huff_counts->field_length; + if (huff_counts->tot_end_space || ! huff_counts->tot_pre_space) + { + huff_counts->tot_end_space+=length; + huff_counts->max_end_space=huff_counts->field_length; + if (huff_counts->field_length < 8) + huff_counts->end_space[huff_counts->field_length]+= + huff_counts->empty_fields; + } + if (huff_counts->tot_pre_space) + { + huff_counts->tot_pre_space+=length; + huff_counts->max_pre_space=huff_counts->field_length; + if (huff_counts->field_length < 8) + huff_counts->pre_space[huff_counts->field_length]+= + huff_counts->empty_fields; + } + } + } + + /* + If there are enough trailing spaces (in this column), + treating them specially may pay off. + */ + if (huff_counts->tot_end_space) + { + huff_counts->counts[' ']+=huff_counts->tot_pre_space; + if (test_space_compress(huff_counts,records,huff_counts->max_end_space, + huff_counts->end_space, + huff_counts->tot_end_space,FIELD_SKIP_ENDSPACE)) + goto found_pack; + huff_counts->counts[' ']-=huff_counts->tot_pre_space; + } + + /* + If there are enough leading spaces (in this column), + treating them specially may pay off. + */ + if (huff_counts->tot_pre_space) + { + if (test_space_compress(huff_counts,records,huff_counts->max_pre_space, + huff_counts->pre_space, + huff_counts->tot_pre_space,FIELD_SKIP_PRESPACE)) + goto found_pack; + } + + found_pack: /* Found field-packing */ + + /* Test if we can use zero-fill */ + + if (huff_counts->max_zero_fill && + (huff_counts->field_type == FIELD_NORMAL || + huff_counts->field_type == FIELD_SKIP_ZERO)) + { + huff_counts->counts[0]-=huff_counts->max_zero_fill* + (huff_counts->field_type == FIELD_SKIP_ZERO ? + records - huff_counts->zero_fields : records); + huff_counts->pack_type|=PACK_TYPE_ZERO_FILL; + huff_counts->bytes_packed=calc_packed_length(huff_counts,0); + } + + /* Test if intervall-field is better */ + + if (huff_counts->tree_buff) + { + HUFF_TREE tree; + + DBUG_EXECUTE_IF("forceintervall", + huff_counts->bytes_packed= ~ (my_off_t) 0;); + tree.element_buffer=0; + if (!make_huff_tree(&tree,huff_counts) && + tree.bytes_packed+tree.tree_pack_length < huff_counts->bytes_packed) + { + if (tree.elements == 1) + huff_counts->field_type=FIELD_CONSTANT; + else + huff_counts->field_type=FIELD_INTERVALL; + huff_counts->pack_type=0; + } + else + { + my_free((uchar*) huff_counts->tree_buff,MYF(0)); + delete_tree(&huff_counts->int_tree); + huff_counts->tree_buff=0; + } + if (tree.element_buffer) + my_free((uchar*) tree.element_buffer,MYF(0)); + } + if (huff_counts->pack_type & PACK_TYPE_SPACE_FIELDS) + space_fields++; + if (huff_counts->pack_type & PACK_TYPE_ZERO_FILL) + fill_zero_fields++; + field_count[huff_counts->field_type]++; + } + DBUG_PRINT("info", ("normal: %3d empty-space: %3d " + "empty-zero: %3d empty-fill: %3d", + field_count[FIELD_NORMAL],space_fields, + field_count[FIELD_SKIP_ZERO],fill_zero_fields)); + DBUG_PRINT("info", ("pre-space: %3d end-space: %3d " + "intervall-fields: %3d zero: %3d", + field_count[FIELD_SKIP_PRESPACE], + field_count[FIELD_SKIP_ENDSPACE], + field_count[FIELD_INTERVALL], + field_count[FIELD_ZERO])); + if (verbose) + VOID(printf("\nnormal: %3d empty-space: %3d " + "empty-zero: %3d empty-fill: %3d\n" + "pre-space: %3d end-space: %3d " + "intervall-fields: %3d zero: %3d\n", + field_count[FIELD_NORMAL],space_fields, + field_count[FIELD_SKIP_ZERO],fill_zero_fields, + field_count[FIELD_SKIP_PRESPACE], + field_count[FIELD_SKIP_ENDSPACE], + field_count[FIELD_INTERVALL], + field_count[FIELD_ZERO])); + DBUG_VOID_RETURN; +} + + /* Test if we can use space-compression and empty-field-compression */ + +static int +test_space_compress(HUFF_COUNTS *huff_counts, my_off_t records, + uint max_space_length, my_off_t *space_counts, + my_off_t tot_space_count, enum en_fieldtype field_type) +{ + int min_pos; + uint length_bits,i; + my_off_t space_count,min_space_count,min_pack,new_length,skip; + + length_bits=max_bit(max_space_length); + + /* Default no end_space-packing */ + space_count=huff_counts->counts[(uint) ' ']; + min_space_count= (huff_counts->counts[(uint) ' ']+= tot_space_count); + min_pack=calc_packed_length(huff_counts,0); + min_pos= -2; + huff_counts->counts[(uint) ' ']=space_count; + + /* Test with allways space-count */ + new_length=huff_counts->bytes_packed+length_bits*records/8; + if (new_length+1 < min_pack) + { + min_pos= -1; + min_pack=new_length; + min_space_count=space_count; + } + /* Test with length-flag */ + for (skip=0L, i=0 ; i < 8 ; i++) + { + if (space_counts[i]) + { + if (i) + huff_counts->counts[(uint) ' ']+=space_counts[i]; + skip+=huff_counts->pre_space[i]; + new_length=calc_packed_length(huff_counts,0)+ + (records+(records-skip)*(1+length_bits))/8; + if (new_length < min_pack) + { + min_pos=(int) i; + min_pack=new_length; + min_space_count=huff_counts->counts[(uint) ' ']; + } + } + } + + huff_counts->counts[(uint) ' ']=min_space_count; + huff_counts->bytes_packed=min_pack; + switch (min_pos) { + case -2: + return(0); /* No space-compress */ + case -1: /* Always space-count */ + huff_counts->field_type=field_type; + huff_counts->min_space=0; + huff_counts->length_bits=max_bit(max_space_length); + break; + default: + huff_counts->field_type=field_type; + huff_counts->min_space=(uint) min_pos; + huff_counts->pack_type|=PACK_TYPE_SELECTED; + huff_counts->length_bits=max_bit(max_space_length); + break; + } + return(1); /* Using space-compress */ +} + + + /* Make a huff_tree of each huff_count */ + +static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts, uint trees) +{ + uint tree; + HUFF_TREE *huff_tree; + DBUG_ENTER("make_huff_trees"); + + if (!(huff_tree=(HUFF_TREE*) my_malloc(trees*sizeof(HUFF_TREE), + MYF(MY_WME | MY_ZEROFILL)))) + DBUG_RETURN(0); + + for (tree=0 ; tree < trees ; tree++) + { + if (make_huff_tree(huff_tree+tree,huff_counts+tree)) + { + while (tree--) + my_free((uchar*) huff_tree[tree].element_buffer,MYF(0)); + my_free((uchar*) huff_tree,MYF(0)); + DBUG_RETURN(0); + } + } + DBUG_RETURN(huff_tree); +} + +/* + Build a Huffman tree. + + SYNOPSIS + make_huff_tree() + huff_tree The Huffman tree. + huff_counts The counts. + + DESCRIPTION + Build a Huffman tree according to huff_counts->counts or + huff_counts->tree_buff. tree_buff, if non-NULL contains up to + tree_buff_length of distinct column values. In that case, whole + values can be Huffman encoded instead of single bytes. + + RETURN + 0 OK + != 0 Error +*/ + +static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts) +{ + uint i,found,bits_packed,first,last; + my_off_t bytes_packed; + HUFF_ELEMENT *a,*b,*new_huff_el; + + first=last=0; + if (huff_counts->tree_buff) + { + /* Calculate the number of distinct values in tree_buff. */ + found= (uint) (huff_counts->tree_pos - huff_counts->tree_buff) / + huff_counts->field_length; + first=0; last=found-1; + } + else + { + /* Count the number of byte codes found in the column. */ + for (i=found=0 ; i < 256 ; i++) + { + if (huff_counts->counts[i]) + { + if (! found++) + first=i; + last=i; + } + } + if (found < 2) + found=2; + } + + /* When using 'tree_buff' we can have more that 256 values. */ + if (queue.max_elements < found) + { + delete_queue(&queue); + if (init_queue(&queue,found,0,0,compare_huff_elements,0)) + return -1; + } + + /* Allocate or reallocate an element buffer for the Huffman tree. */ + if (!huff_tree->element_buffer) + { + if (!(huff_tree->element_buffer= + (HUFF_ELEMENT*) my_malloc(found*2*sizeof(HUFF_ELEMENT),MYF(MY_WME)))) + return 1; + } + else + { + HUFF_ELEMENT *temp; + if (!(temp= + (HUFF_ELEMENT*) my_realloc((uchar*) huff_tree->element_buffer, + found*2*sizeof(HUFF_ELEMENT), + MYF(MY_WME)))) + return 1; + huff_tree->element_buffer=temp; + } + + huff_counts->tree=huff_tree; + huff_tree->counts=huff_counts; + huff_tree->min_chr=first; + huff_tree->max_chr=last; + huff_tree->char_bits=max_bit(last-first); + huff_tree->offset_bits=max_bit(found-1)+1; + + if (huff_counts->tree_buff) + { + huff_tree->elements=0; + huff_tree->tree_pack_length=(1+15+16+5+5+ + (huff_tree->char_bits+1)*found+ + (huff_tree->offset_bits+1)* + (found-2)+7)/8 + + (uint) (huff_tree->counts->tree_pos- + huff_tree->counts->tree_buff); + /* + Put a HUFF_ELEMENT into the queue for every distinct column value. + + tree_walk() calls save_counts_in_queue() for every element in + 'int_tree'. This takes elements from the target trees element + buffer and places references to them into the buffer of the + priority queue. We insert in column value order, but the order is + in fact irrelevant here. We will establish the correct order + later. + */ + tree_walk(&huff_counts->int_tree, + (int (*)(void*, element_count,void*)) save_counts_in_queue, + (uchar*) huff_tree, left_root_right); + } + else + { + huff_tree->elements=found; + huff_tree->tree_pack_length=(9+9+5+5+ + (huff_tree->char_bits+1)*found+ + (huff_tree->offset_bits+1)* + (found-2)+7)/8; + /* + Put a HUFF_ELEMENT into the queue for every byte code found in the column. + + The elements are taken from the target trees element buffer. + Instead of using queue_insert(), we just place references to the + elements into the buffer of the priority queue. We insert in byte + value order, but the order is in fact irrelevant here. We will + establish the correct order later. + */ + for (i=first, found=0 ; i <= last ; i++) + { + if (huff_counts->counts[i]) + { + new_huff_el=huff_tree->element_buffer+(found++); + new_huff_el->count=huff_counts->counts[i]; + new_huff_el->a.leaf.null=0; + new_huff_el->a.leaf.element_nr=i; + queue.root[found]=(uchar*) new_huff_el; + } + } + /* + If there is only a single byte value in this field in all records, + add a second element with zero incidence. This is required to enter + the loop, which builds the Huffman tree. + */ + while (found < 2) + { + new_huff_el=huff_tree->element_buffer+(found++); + new_huff_el->count=0; + new_huff_el->a.leaf.null=0; + if (last) + new_huff_el->a.leaf.element_nr=huff_tree->min_chr=last-1; + else + new_huff_el->a.leaf.element_nr=huff_tree->max_chr=last+1; + queue.root[found]=(uchar*) new_huff_el; + } + } + + /* Make a queue from the queue buffer. */ + queue.elements=found; + + /* + Make a priority queue from the queue. Construct its index so that we + have a partially ordered tree. + */ + for (i=found/2 ; i > 0 ; i--) + _downheap(&queue,i); + + /* The Huffman algorithm. */ + bytes_packed=0; bits_packed=0; + for (i=1 ; i < found ; i++) + { + /* + Pop the top element from the queue (the one with the least incidence). + Popping from a priority queue includes a re-ordering of the queue, + to get the next least incidence element to the top. + */ + a=(HUFF_ELEMENT*) queue_remove(&queue,0); + /* + Copy the next least incidence element. The queue implementation + reserves root[0] for temporary purposes. root[1] is the top. + */ + b=(HUFF_ELEMENT*) queue.root[1]; + /* Get a new element from the element buffer. */ + new_huff_el=huff_tree->element_buffer+found+i; + /* The new element gets the sum of the two least incidence elements. */ + new_huff_el->count=a->count+b->count; + /* + The Huffman algorithm assigns another bit to the code for a byte + every time that bytes incidence is combined (directly or indirectly) + to a new element as one of the two least incidence elements. + This means that one more bit per incidence of that byte is required + in the resulting file. So we add the new combined incidence as the + number of bits by which the result grows. + */ + bits_packed+=(uint) (new_huff_el->count & 7); + bytes_packed+=new_huff_el->count/8; + /* The new element points to its children, lesser in left. */ + new_huff_el->a.nod.left=a; + new_huff_el->a.nod.right=b; + /* + Replace the copied top element by the new element and re-order the + queue. + */ + queue.root[1]=(uchar*) new_huff_el; + queue_replaced(&queue); + } + huff_tree->root=(HUFF_ELEMENT*) queue.root[1]; + huff_tree->bytes_packed=bytes_packed+(bits_packed+7)/8; + return 0; +} + +static int compare_tree(void* cmp_arg __attribute__((unused)), + register const uchar *s, register const uchar *t) +{ + uint length; + for (length=global_count->field_length; length-- ;) + if (*s++ != *t++) + return (int) s[-1] - (int) t[-1]; + return 0; +} + +/* + Organize distinct column values and their incidences into a priority queue. + + SYNOPSIS + save_counts_in_queue() + key The column value. + count The incidence of this value. + tree The Huffman tree to be built later. + + DESCRIPTION + We use the element buffer of the targeted tree. The distinct column + values are organized in a priority queue first. The Huffman + algorithm will later organize the elements into a Huffman tree. For + the time being, we just place references to the elements into the + queue buffer. The buffer will later be organized into a priority + queue. + + RETURN + 0 + */ + +static int save_counts_in_queue(uchar *key, element_count count, + HUFF_TREE *tree) +{ + HUFF_ELEMENT *new_huff_el; + + new_huff_el=tree->element_buffer+(tree->elements++); + new_huff_el->count=count; + new_huff_el->a.leaf.null=0; + new_huff_el->a.leaf.element_nr= (uint) (key- tree->counts->tree_buff) / + tree->counts->field_length; + queue.root[tree->elements]=(uchar*) new_huff_el; + return 0; +} + + +/* + Calculate length of file if given counts should be used. + + SYNOPSIS + calc_packed_length() + huff_counts The counts for a column of the table(s). + add_tree_lenght If the decode tree length should be added. + + DESCRIPTION + We need to follow the Huffman algorithm until we know, how many bits + are required for each byte code. But we do not need the resulting + Huffman tree. Hence, we can leave out some steps which are essential + in make_huff_tree(). + + RETURN + Number of bytes required to compress this table column. +*/ + +static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts, + uint add_tree_lenght) +{ + uint i,found,bits_packed,first,last; + my_off_t bytes_packed; + HUFF_ELEMENT element_buffer[256]; + DBUG_ENTER("calc_packed_length"); + + /* + WARNING: We use a small hack for efficiency: Instead of placing + references to HUFF_ELEMENTs into the queue, we just insert + references to the counts of the byte codes which appeared in this + table column. During the Huffman algorithm they are successively + replaced by references to HUFF_ELEMENTs. This works, because + HUFF_ELEMENTs have the incidence count at their beginning. + Regardless, wether the queue array contains references to counts of + type my_off_t or references to HUFF_ELEMENTs which have the count of + type my_off_t at their beginning, it always points to a count of the + same type. + + Instead of using queue_insert(), we just copy the references into + the buffer of the priority queue. We insert in byte value order, but + the order is in fact irrelevant here. We will establish the correct + order later. + */ + first=last=0; + for (i=found=0 ; i < 256 ; i++) + { + if (huff_counts->counts[i]) + { + if (! found++) + first=i; + last=i; + /* We start with root[1], which is the queues top element. */ + queue.root[found]=(uchar*) &huff_counts->counts[i]; + } + } + if (!found) + DBUG_RETURN(0); /* Empty tree */ + /* + If there is only a single byte value in this field in all records, + add a second element with zero incidence. This is required to enter + the loop, which follows the Huffman algorithm. + */ + if (found < 2) + queue.root[++found]=(uchar*) &huff_counts->counts[last ? 0 : 1]; + + /* Make a queue from the queue buffer. */ + queue.elements=found; + + bytes_packed=0; bits_packed=0; + /* Add the length of the coding table, which would become part of the file. */ + if (add_tree_lenght) + bytes_packed=(8+9+5+5+(max_bit(last-first)+1)*found+ + (max_bit(found-1)+1+1)*(found-2) +7)/8; + + /* + Make a priority queue from the queue. Construct its index so that we + have a partially ordered tree. + */ + for (i=(found+1)/2 ; i > 0 ; i--) + _downheap(&queue,i); + + /* The Huffman algorithm. */ + for (i=0 ; i < found-1 ; i++) + { + my_off_t *a; + my_off_t *b; + HUFF_ELEMENT *new_huff_el; + + /* + Pop the top element from the queue (the one with the least + incidence). Popping from a priority queue includes a re-ordering + of the queue, to get the next least incidence element to the top. + */ + a= (my_off_t*) queue_remove(&queue, 0); + /* + Copy the next least incidence element. The queue implementation + reserves root[0] for temporary purposes. root[1] is the top. + */ + b= (my_off_t*) queue.root[1]; + /* Create a new element in a local (automatic) buffer. */ + new_huff_el= element_buffer + i; + /* The new element gets the sum of the two least incidence elements. */ + new_huff_el->count= *a + *b; + /* + The Huffman algorithm assigns another bit to the code for a byte + every time that bytes incidence is combined (directly or indirectly) + to a new element as one of the two least incidence elements. + This means that one more bit per incidence of that byte is required + in the resulting file. So we add the new combined incidence as the + number of bits by which the result grows. + */ + bits_packed+=(uint) (new_huff_el->count & 7); + bytes_packed+=new_huff_el->count/8; + /* + Replace the copied top element by the new element and re-order the + queue. This successively replaces the references to counts by + references to HUFF_ELEMENTs. + */ + queue.root[1]=(uchar*) new_huff_el; + queue_replaced(&queue); + } + DBUG_RETURN(bytes_packed+(bits_packed+7)/8); +} + + + /* Remove trees that don't give any compression */ + +static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees) +{ + uint k,tree_number; + HUFF_COUNTS count,*i,*j,*last_count; + + last_count=huff_counts+trees; + for (tree_number=0, i=huff_counts ; i < last_count ; i++) + { + if (!i->tree->tree_number) + { + i->tree->tree_number= ++tree_number; + if (i->tree_buff) + continue; /* Don't join intervall */ + for (j=i+1 ; j < last_count ; j++) + { + if (! j->tree->tree_number && ! j->tree_buff) + { + for (k=0 ; k < 256 ; k++) + count.counts[k]=i->counts[k]+j->counts[k]; + if (calc_packed_length(&count,1) <= + i->tree->bytes_packed + j->tree->bytes_packed+ + i->tree->tree_pack_length+j->tree->tree_pack_length+ + ALLOWED_JOIN_DIFF) + { + memcpy_fixed((uchar*) i->counts,(uchar*) count.counts, + sizeof(count.counts[0])*256); + my_free((uchar*) j->tree->element_buffer,MYF(0)); + j->tree->element_buffer=0; + j->tree=i->tree; + bmove((uchar*) i->counts,(uchar*) count.counts, + sizeof(count.counts[0])*256); + if (make_huff_tree(i->tree,i)) + return (uint) -1; + } + } + } + } + } + DBUG_PRINT("info", ("Original trees: %d After join: %d", + trees, tree_number)); + if (verbose) + VOID(printf("Original trees: %d After join: %d\n", trees, tree_number)); + return tree_number; /* Return trees left */ +} + + +/* + Fill in huff_tree encode tables. + + SYNOPSIS + make_huff_decode_table() + huff_tree An array of HUFF_TREE which are to be encoded. + trees The number of HUFF_TREE in the array. + + RETURN + 0 success + != 0 error +*/ + +static int make_huff_decode_table(HUFF_TREE *huff_tree, uint trees) +{ + uint elements; + for ( ; trees-- ; huff_tree++) + { + if (huff_tree->tree_number > 0) + { + elements=huff_tree->counts->tree_buff ? huff_tree->elements : 256; + if (!(huff_tree->code = + (ulonglong*) my_malloc(elements* + (sizeof(ulonglong) + sizeof(uchar)), + MYF(MY_WME | MY_ZEROFILL)))) + return 1; + huff_tree->code_len=(uchar*) (huff_tree->code+elements); + make_traverse_code_tree(huff_tree, huff_tree->root, + 8 * sizeof(ulonglong), LL(0)); + } + } + return 0; +} + + +static void make_traverse_code_tree(HUFF_TREE *huff_tree, + HUFF_ELEMENT *element, + uint size, ulonglong code) +{ + uint chr; + if (!element->a.leaf.null) + { + chr=element->a.leaf.element_nr; + huff_tree->code_len[chr]= (uchar) (8 * sizeof(ulonglong) - size); + huff_tree->code[chr]= (code >> size); + if (huff_tree->height < 8 * sizeof(ulonglong) - size) + huff_tree->height= 8 * sizeof(ulonglong) - size; + } + else + { + size--; + make_traverse_code_tree(huff_tree,element->a.nod.left,size,code); + make_traverse_code_tree(huff_tree, element->a.nod.right, size, + code + (((ulonglong) 1) << size)); + } + return; +} + + +/* + Convert a value into binary digits. + + SYNOPSIS + bindigits() + value The value. + length The number of low order bits to convert. + + NOTE + The result string is in static storage. It is reused on every call. + So you cannot use it twice in one expression. + + RETURN + A pointer to a static NUL-terminated string. + */ + +static char *bindigits(ulonglong value, uint bits) +{ + static char digits[72]; + char *ptr= digits; + uint idx= bits; + + DBUG_ASSERT(idx < sizeof(digits)); + while (idx) + *(ptr++)= '0' + ((char) (value >> (--idx)) & (char) 1); + *ptr= '\0'; + return digits; +} + + +/* + Convert a value into hexadecimal digits. + + SYNOPSIS + hexdigits() + value The value. + + NOTE + The result string is in static storage. It is reused on every call. + So you cannot use it twice in one expression. + + RETURN + A pointer to a static NUL-terminated string. + */ + +static char *hexdigits(ulonglong value) +{ + static char digits[20]; + char *ptr= digits; + uint idx= 2 * sizeof(value); /* Two hex digits per byte. */ + + DBUG_ASSERT(idx < sizeof(digits)); + while (idx) + { + if ((*(ptr++)= '0' + ((char) (value >> (4 * (--idx))) & (char) 0xf)) > '9') + *(ptr - 1)+= 'a' - '9' - 1; + } + *ptr= '\0'; + return digits; +} + + + /* Write header to new packed data file */ + +static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees, + my_off_t tot_elements,my_off_t filelength) +{ + uchar *buff= (uchar*) file_buffer.pos; + + bzero(buff,HEAD_LENGTH); + memcpy_fixed(buff,myisam_pack_file_magic,4); + int4store(buff+4,head_length); + int4store(buff+8, mrg->min_pack_length); + int4store(buff+12,mrg->max_pack_length); + int4store(buff+16,tot_elements); + int4store(buff+20,intervall_length); + int2store(buff+24,trees); + buff[26]=(char) mrg->ref_length; + /* Save record pointer length */ + buff[27]= (uchar) mi_get_pointer_length((ulonglong) filelength,2); + if (test_only) + return 0; + VOID(my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(0))); + return my_write(file_buffer.file,(const uchar *) file_buffer.pos,HEAD_LENGTH, + MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0; +} + + /* Write fieldinfo to new packed file */ + +static void write_field_info(HUFF_COUNTS *counts, uint fields, uint trees) +{ + reg1 uint i; + uint huff_tree_bits; + huff_tree_bits=max_bit(trees ? trees-1 : 0); + + DBUG_PRINT("info", (" ")); + DBUG_PRINT("info", ("column types:")); + DBUG_PRINT("info", ("FIELD_NORMAL 0")); + DBUG_PRINT("info", ("FIELD_SKIP_ENDSPACE 1")); + DBUG_PRINT("info", ("FIELD_SKIP_PRESPACE 2")); + DBUG_PRINT("info", ("FIELD_SKIP_ZERO 3")); + DBUG_PRINT("info", ("FIELD_BLOB 4")); + DBUG_PRINT("info", ("FIELD_CONSTANT 5")); + DBUG_PRINT("info", ("FIELD_INTERVALL 6")); + DBUG_PRINT("info", ("FIELD_ZERO 7")); + DBUG_PRINT("info", ("FIELD_VARCHAR 8")); + DBUG_PRINT("info", ("FIELD_CHECK 9")); + DBUG_PRINT("info", (" ")); + DBUG_PRINT("info", ("pack type as a set of flags:")); + DBUG_PRINT("info", ("PACK_TYPE_SELECTED 1")); + DBUG_PRINT("info", ("PACK_TYPE_SPACE_FIELDS 2")); + DBUG_PRINT("info", ("PACK_TYPE_ZERO_FILL 4")); + DBUG_PRINT("info", (" ")); + if (verbose >= 2) + { + VOID(printf("\n")); + VOID(printf("column types:\n")); + VOID(printf("FIELD_NORMAL 0\n")); + VOID(printf("FIELD_SKIP_ENDSPACE 1\n")); + VOID(printf("FIELD_SKIP_PRESPACE 2\n")); + VOID(printf("FIELD_SKIP_ZERO 3\n")); + VOID(printf("FIELD_BLOB 4\n")); + VOID(printf("FIELD_CONSTANT 5\n")); + VOID(printf("FIELD_INTERVALL 6\n")); + VOID(printf("FIELD_ZERO 7\n")); + VOID(printf("FIELD_VARCHAR 8\n")); + VOID(printf("FIELD_CHECK 9\n")); + VOID(printf("\n")); + VOID(printf("pack type as a set of flags:\n")); + VOID(printf("PACK_TYPE_SELECTED 1\n")); + VOID(printf("PACK_TYPE_SPACE_FIELDS 2\n")); + VOID(printf("PACK_TYPE_ZERO_FILL 4\n")); + VOID(printf("\n")); + } + for (i=0 ; i++ < fields ; counts++) + { + write_bits((ulonglong) (int) counts->field_type, 5); + write_bits(counts->pack_type,6); + if (counts->pack_type & PACK_TYPE_ZERO_FILL) + write_bits(counts->max_zero_fill,5); + else + write_bits(counts->length_bits,5); + write_bits((ulonglong) counts->tree->tree_number - 1, huff_tree_bits); + DBUG_PRINT("info", ("column: %3u type: %2u pack: %2u zero: %4u " + "lbits: %2u tree: %2u length: %4u", + i , counts->field_type, counts->pack_type, + counts->max_zero_fill, counts->length_bits, + counts->tree->tree_number, counts->field_length)); + if (verbose >= 2) + VOID(printf("column: %3u type: %2u pack: %2u zero: %4u lbits: %2u " + "tree: %2u length: %4u\n", i , counts->field_type, + counts->pack_type, counts->max_zero_fill, counts->length_bits, + counts->tree->tree_number, counts->field_length)); + } + flush_bits(); + return; +} + + /* Write all huff_trees to new datafile. Return tot count of + elements in all trees + Returns 0 on error */ + +static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees) +{ + uint i,int_length; + uint tree_no; + uint codes; + uint errors= 0; + uint *packed_tree,*offset,length; + my_off_t elements; + + /* Find the highest number of elements in the trees. */ + for (i=length=0 ; i < trees ; i++) + if (huff_tree[i].tree_number > 0 && huff_tree[i].elements > length) + length=huff_tree[i].elements; + /* + Allocate a buffer for packing a decode tree. Two numbers per element + (left child and right child). + */ + if (!(packed_tree=(uint*) my_alloca(sizeof(uint)*length*2))) + { + my_error(EE_OUTOFMEMORY,MYF(ME_BELL),sizeof(uint)*length*2); + return 0; + } + + DBUG_PRINT("info", (" ")); + if (verbose >= 2) + VOID(printf("\n")); + tree_no= 0; + intervall_length=0; + for (elements=0; trees-- ; huff_tree++) + { + /* Skip columns that have been joined with other columns. */ + if (huff_tree->tree_number == 0) + continue; /* Deleted tree */ + tree_no++; + DBUG_PRINT("info", (" ")); + if (verbose >= 3) + VOID(printf("\n")); + /* Count the total number of elements (byte codes or column values). */ + elements+=huff_tree->elements; + huff_tree->max_offset=2; + /* Build a tree of offsets and codes for decoding in 'packed_tree'. */ + if (huff_tree->elements <= 1) + offset=packed_tree; + else + offset=make_offset_code_tree(huff_tree,huff_tree->root,packed_tree); + + /* This should be the same as 'length' above. */ + huff_tree->offset_bits=max_bit(huff_tree->max_offset); + + /* + Since we check this during collecting the distinct column values, + this should never happen. + */ + if (huff_tree->max_offset >= IS_OFFSET) + { /* This should be impossible */ + VOID(fprintf(stderr, "Tree offset got too big: %d, aborted\n", + huff_tree->max_offset)); + my_afree((uchar*) packed_tree); + return 0; + } + + DBUG_PRINT("info", ("pos: %lu elements: %u tree-elements: %lu " + "char_bits: %u\n", + (ulong) (file_buffer.pos - file_buffer.buffer), + huff_tree->elements, (ulong) (offset - packed_tree), + huff_tree->char_bits)); + if (!huff_tree->counts->tree_buff) + { + /* We do a byte compression on this column. Mark with bit 0. */ + write_bits(0,1); + write_bits(huff_tree->min_chr,8); + write_bits(huff_tree->elements,9); + write_bits(huff_tree->char_bits,5); + write_bits(huff_tree->offset_bits,5); + int_length=0; + } + else + { + int_length=(uint) (huff_tree->counts->tree_pos - + huff_tree->counts->tree_buff); + /* We have distinct column values for this column. Mark with bit 1. */ + write_bits(1,1); + write_bits(huff_tree->elements,15); + write_bits(int_length,16); + write_bits(huff_tree->char_bits,5); + write_bits(huff_tree->offset_bits,5); + intervall_length+=int_length; + } + DBUG_PRINT("info", ("tree: %2u elements: %4u char_bits: %2u " + "offset_bits: %2u %s: %5u codelen: %2u", + tree_no, huff_tree->elements, huff_tree->char_bits, + huff_tree->offset_bits, huff_tree->counts->tree_buff ? + "bufflen" : "min_chr", huff_tree->counts->tree_buff ? + int_length : huff_tree->min_chr, huff_tree->height)); + if (verbose >= 2) + VOID(printf("tree: %2u elements: %4u char_bits: %2u offset_bits: %2u " + "%s: %5u codelen: %2u\n", tree_no, huff_tree->elements, + huff_tree->char_bits, huff_tree->offset_bits, + huff_tree->counts->tree_buff ? "bufflen" : "min_chr", + huff_tree->counts->tree_buff ? int_length : + huff_tree->min_chr, huff_tree->height)); + + /* Check that the code tree length matches the element count. */ + length=(uint) (offset-packed_tree); + if (length != huff_tree->elements*2-2) + { + VOID(fprintf(stderr, "error: Huff-tree-length: %d != calc_length: %d\n", + length, huff_tree->elements * 2 - 2)); + errors++; + break; + } + + for (i=0 ; i < length ; i++) + { + if (packed_tree[i] & IS_OFFSET) + write_bits(packed_tree[i] - IS_OFFSET+ (1 << huff_tree->offset_bits), + huff_tree->offset_bits+1); + else + write_bits(packed_tree[i]-huff_tree->min_chr,huff_tree->char_bits+1); + DBUG_PRINT("info", ("tree[0x%04x]: %s0x%04x", + i, (packed_tree[i] & IS_OFFSET) ? + " -> " : "", (packed_tree[i] & IS_OFFSET) ? + packed_tree[i] - IS_OFFSET + i : packed_tree[i])); + if (verbose >= 3) + VOID(printf("tree[0x%04x]: %s0x%04x\n", + i, (packed_tree[i] & IS_OFFSET) ? " -> " : "", + (packed_tree[i] & IS_OFFSET) ? + packed_tree[i] - IS_OFFSET + i : packed_tree[i])); + } + flush_bits(); + + /* + Display coding tables and check their correctness. + */ + codes= huff_tree->counts->tree_buff ? huff_tree->elements : 256; + for (i= 0; i < codes; i++) + { + ulonglong code; + uint bits; + uint len; + uint idx; + + if (! (len= huff_tree->code_len[i])) + continue; + DBUG_PRINT("info", ("code[0x%04x]: 0x%s bits: %2u bin: %s", i, + hexdigits(huff_tree->code[i]), huff_tree->code_len[i], + bindigits(huff_tree->code[i], + huff_tree->code_len[i]))); + if (verbose >= 3) + VOID(printf("code[0x%04x]: 0x%s bits: %2u bin: %s\n", i, + hexdigits(huff_tree->code[i]), huff_tree->code_len[i], + bindigits(huff_tree->code[i], huff_tree->code_len[i]))); + + /* Check that the encode table decodes correctly. */ + code= 0; + bits= 0; + idx= 0; + DBUG_EXECUTE_IF("forcechkerr1", len--;); + DBUG_EXECUTE_IF("forcechkerr2", bits= 8 * sizeof(code);); + DBUG_EXECUTE_IF("forcechkerr3", idx= length;); + for (;;) + { + if (! len) + { + VOID(fflush(stdout)); + VOID(fprintf(stderr, "error: code 0x%s with %u bits not found\n", + hexdigits(huff_tree->code[i]), huff_tree->code_len[i])); + errors++; + break; + } + code<<= 1; + code|= (huff_tree->code[i] >> (--len)) & 1; + bits++; + if (bits > 8 * sizeof(code)) + { + VOID(fflush(stdout)); + VOID(fprintf(stderr, "error: Huffman code too long: %u/%u\n", + bits, (uint) (8 * sizeof(code)))); + errors++; + break; + } + idx+= (uint) code & 1; + if (idx >= length) + { + VOID(fflush(stdout)); + VOID(fprintf(stderr, "error: illegal tree offset: %u/%u\n", + idx, length)); + errors++; + break; + } + if (packed_tree[idx] & IS_OFFSET) + idx+= packed_tree[idx] & ~IS_OFFSET; + else + break; /* Hit a leaf. This contains the result value. */ + } + if (errors) + break; + + DBUG_EXECUTE_IF("forcechkerr4", packed_tree[idx]++;); + if (packed_tree[idx] != i) + { + VOID(fflush(stdout)); + VOID(fprintf(stderr, "error: decoded value 0x%04x should be: 0x%04x\n", + packed_tree[idx], i)); + errors++; + break; + } + } /*end for (codes)*/ + if (errors) + break; + + /* Write column values in case of distinct column value compression. */ + if (huff_tree->counts->tree_buff) + { + for (i=0 ; i < int_length ; i++) + { + write_bits((ulonglong) (uchar) huff_tree->counts->tree_buff[i], 8); + DBUG_PRINT("info", ("column_values[0x%04x]: 0x%02x", + i, (uchar) huff_tree->counts->tree_buff[i])); + if (verbose >= 3) + VOID(printf("column_values[0x%04x]: 0x%02x\n", + i, (uchar) huff_tree->counts->tree_buff[i])); + } + } + flush_bits(); + } + DBUG_PRINT("info", (" ")); + if (verbose >= 2) + VOID(printf("\n")); + my_afree((uchar*) packed_tree); + if (errors) + { + VOID(fprintf(stderr, "Error: Generated decode trees are corrupt. Stop.\n")); + return 0; + } + return elements; +} + + +static uint *make_offset_code_tree(HUFF_TREE *huff_tree, HUFF_ELEMENT *element, + uint *offset) +{ + uint *prev_offset; + + prev_offset= offset; + /* + 'a.leaf.null' takes the same place as 'a.nod.left'. If this is null, + then there is no left child and, hence no right child either. This + is a property of a binary tree. An element is either a node with two + childs, or a leaf without childs. + + The current element is always a node with two childs. Go left first. + */ + if (!element->a.nod.left->a.leaf.null) + { + /* Store the byte code or the index of the column value. */ + prev_offset[0] =(uint) element->a.nod.left->a.leaf.element_nr; + offset+=2; + } + else + { + /* + Recursively traverse the tree to the left. Mark it as an offset to + another tree node (in contrast to a byte code or column value index). + */ + prev_offset[0]= IS_OFFSET+2; + offset=make_offset_code_tree(huff_tree,element->a.nod.left,offset+2); + } + + /* Now, check the right child. */ + if (!element->a.nod.right->a.leaf.null) + { + /* Store the byte code or the index of the column value. */ + prev_offset[1]=element->a.nod.right->a.leaf.element_nr; + return offset; + } + else + { + /* + Recursively traverse the tree to the right. Mark it as an offset to + another tree node (in contrast to a byte code or column value index). + */ + uint temp=(uint) (offset-prev_offset-1); + prev_offset[1]= IS_OFFSET+ temp; + if (huff_tree->max_offset < temp) + huff_tree->max_offset = temp; + return make_offset_code_tree(huff_tree,element->a.nod.right,offset); + } +} + + /* Get number of bits neaded to represent value */ + +static uint max_bit(register uint value) +{ + reg2 uint power=1; + + while ((value>>=1)) + power++; + return (power); +} + + +static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts) +{ + int error; + uint i,max_calc_length,pack_ref_length,min_record_length,max_record_length, + intervall,field_length,max_pack_length,pack_blob_length; + my_off_t record_count; + char llbuf[32]; + ulong length,pack_length; + uchar *record,*pos,*end_pos,*record_pos,*start_pos; + HUFF_COUNTS *count,*end_count; + HUFF_TREE *tree; + MI_INFO *isam_file=mrg->file[0]; + uint pack_version= (uint) isam_file->s->pack.version; + DBUG_ENTER("compress_isam_file"); + + /* Allocate a buffer for the records (excluding blobs). */ + if (!(record=(uchar*) my_alloca(isam_file->s->base.reclength))) + return -1; + + end_count=huff_counts+isam_file->s->base.fields; + min_record_length= (uint) ~0; + max_record_length=0; + + /* + Calculate the maximum number of bits required to pack the records. + Remember to understand 'max_zero_fill' as 'min_zero_fill'. + The tree height determines the maximum number of bits per value. + Some fields skip leading or trailing spaces or zeroes. The skipped + number of bytes is encoded by 'length_bits' bits. + Empty blobs and varchar are encoded with a single 1 bit. Other blobs + and varchar get a leading 0 bit. + */ + for (i=max_calc_length=0 ; i < isam_file->s->base.fields ; i++) + { + if (!(huff_counts[i].pack_type & PACK_TYPE_ZERO_FILL)) + huff_counts[i].max_zero_fill=0; + if (huff_counts[i].field_type == FIELD_CONSTANT || + huff_counts[i].field_type == FIELD_ZERO || + huff_counts[i].field_type == FIELD_CHECK) + continue; + if (huff_counts[i].field_type == FIELD_INTERVALL) + max_calc_length+=huff_counts[i].tree->height; + else if (huff_counts[i].field_type == FIELD_BLOB || + huff_counts[i].field_type == FIELD_VARCHAR) + max_calc_length+=huff_counts[i].tree->height*huff_counts[i].max_length + huff_counts[i].length_bits +1; + else + max_calc_length+= + (huff_counts[i].field_length - huff_counts[i].max_zero_fill)* + huff_counts[i].tree->height+huff_counts[i].length_bits; + } + max_calc_length= (max_calc_length + 7) / 8; + pack_ref_length= calc_pack_length(pack_version, max_calc_length); + record_count=0; + /* 'max_blob_length' is the max length of all blobs of a record. */ + pack_blob_length= isam_file->s->base.blobs ? + calc_pack_length(pack_version, mrg->max_blob_length) : 0; + max_pack_length=pack_ref_length+pack_blob_length; + + DBUG_PRINT("fields", ("===")); + mrg_reset(mrg); + while ((error=mrg_rrnd(mrg,record)) != HA_ERR_END_OF_FILE) + { + ulong tot_blob_length=0; + if (! error) + { + if (flush_buffer((ulong) max_calc_length + (ulong) max_pack_length)) + break; + record_pos= (uchar*) file_buffer.pos; + file_buffer.pos+=max_pack_length; + for (start_pos=record, count= huff_counts; count < end_count ; count++) + { + end_pos=start_pos+(field_length=count->field_length); + tree=count->tree; + + DBUG_PRINT("fields", ("column: %3lu type: %2u pack: %2u zero: %4u " + "lbits: %2u tree: %2u length: %4u", + (ulong) (count - huff_counts + 1), + count->field_type, + count->pack_type, count->max_zero_fill, + count->length_bits, count->tree->tree_number, + count->field_length)); + + /* Check if the column contains spaces only. */ + if (count->pack_type & PACK_TYPE_SPACE_FIELDS) + { + for (pos=start_pos ; *pos == ' ' && pos < end_pos; pos++) ; + if (pos == end_pos) + { + DBUG_PRINT("fields", + ("PACK_TYPE_SPACE_FIELDS spaces only, bits: 1")); + DBUG_PRINT("fields", ("---")); + write_bits(1,1); + start_pos=end_pos; + continue; + } + DBUG_PRINT("fields", + ("PACK_TYPE_SPACE_FIELDS not only spaces, bits: 1")); + write_bits(0,1); + } + end_pos-=count->max_zero_fill; + field_length-=count->max_zero_fill; + + switch (count->field_type) { + case FIELD_SKIP_ZERO: + if (!memcmp((uchar*) start_pos,zero_string,field_length)) + { + DBUG_PRINT("fields", ("FIELD_SKIP_ZERO zeroes only, bits: 1")); + write_bits(1,1); + start_pos=end_pos; + break; + } + DBUG_PRINT("fields", ("FIELD_SKIP_ZERO not only zeroes, bits: 1")); + write_bits(0,1); + /* Fall through */ + case FIELD_NORMAL: + DBUG_PRINT("fields", ("FIELD_NORMAL %lu bytes", + (ulong) (end_pos - start_pos))); + for ( ; start_pos < end_pos ; start_pos++) + { + DBUG_PRINT("fields", + ("value: 0x%02x code: 0x%s bits: %2u bin: %s", + (uchar) *start_pos, + hexdigits(tree->code[(uchar) *start_pos]), + (uint) tree->code_len[(uchar) *start_pos], + bindigits(tree->code[(uchar) *start_pos], + (uint) tree->code_len[(uchar) *start_pos]))); + write_bits(tree->code[(uchar) *start_pos], + (uint) tree->code_len[(uchar) *start_pos]); + } + break; + case FIELD_SKIP_ENDSPACE: + for (pos=end_pos ; pos > start_pos && pos[-1] == ' ' ; pos--) ; + length= (ulong) (end_pos - pos); + if (count->pack_type & PACK_TYPE_SELECTED) + { + if (length > count->min_space) + { + DBUG_PRINT("fields", + ("FIELD_SKIP_ENDSPACE more than min_space, bits: 1")); + DBUG_PRINT("fields", + ("FIELD_SKIP_ENDSPACE skip %lu/%u bytes, bits: %2u", + length, field_length, count->length_bits)); + write_bits(1,1); + write_bits(length,count->length_bits); + } + else + { + DBUG_PRINT("fields", + ("FIELD_SKIP_ENDSPACE not more than min_space, " + "bits: 1")); + write_bits(0,1); + pos=end_pos; + } + } + else + { + DBUG_PRINT("fields", + ("FIELD_SKIP_ENDSPACE skip %lu/%u bytes, bits: %2u", + length, field_length, count->length_bits)); + write_bits(length,count->length_bits); + } + /* Encode all significant bytes. */ + DBUG_PRINT("fields", ("FIELD_SKIP_ENDSPACE %lu bytes", + (ulong) (pos - start_pos))); + for ( ; start_pos < pos ; start_pos++) + { + DBUG_PRINT("fields", + ("value: 0x%02x code: 0x%s bits: %2u bin: %s", + (uchar) *start_pos, + hexdigits(tree->code[(uchar) *start_pos]), + (uint) tree->code_len[(uchar) *start_pos], + bindigits(tree->code[(uchar) *start_pos], + (uint) tree->code_len[(uchar) *start_pos]))); + write_bits(tree->code[(uchar) *start_pos], + (uint) tree->code_len[(uchar) *start_pos]); + } + start_pos=end_pos; + break; + case FIELD_SKIP_PRESPACE: + for (pos=start_pos ; pos < end_pos && pos[0] == ' ' ; pos++) ; + length= (ulong) (pos - start_pos); + if (count->pack_type & PACK_TYPE_SELECTED) + { + if (length > count->min_space) + { + DBUG_PRINT("fields", + ("FIELD_SKIP_PRESPACE more than min_space, bits: 1")); + DBUG_PRINT("fields", + ("FIELD_SKIP_PRESPACE skip %lu/%u bytes, bits: %2u", + length, field_length, count->length_bits)); + write_bits(1,1); + write_bits(length,count->length_bits); + } + else + { + DBUG_PRINT("fields", + ("FIELD_SKIP_PRESPACE not more than min_space, " + "bits: 1")); + pos=start_pos; + write_bits(0,1); + } + } + else + { + DBUG_PRINT("fields", + ("FIELD_SKIP_PRESPACE skip %lu/%u bytes, bits: %2u", + length, field_length, count->length_bits)); + write_bits(length,count->length_bits); + } + /* Encode all significant bytes. */ + DBUG_PRINT("fields", ("FIELD_SKIP_PRESPACE %lu bytes", + (ulong) (end_pos - start_pos))); + for (start_pos=pos ; start_pos < end_pos ; start_pos++) + { + DBUG_PRINT("fields", + ("value: 0x%02x code: 0x%s bits: %2u bin: %s", + (uchar) *start_pos, + hexdigits(tree->code[(uchar) *start_pos]), + (uint) tree->code_len[(uchar) *start_pos], + bindigits(tree->code[(uchar) *start_pos], + (uint) tree->code_len[(uchar) *start_pos]))); + write_bits(tree->code[(uchar) *start_pos], + (uint) tree->code_len[(uchar) *start_pos]); + } + break; + case FIELD_CONSTANT: + case FIELD_ZERO: + case FIELD_CHECK: + DBUG_PRINT("fields", ("FIELD_CONSTANT/ZERO/CHECK")); + start_pos=end_pos; + break; + case FIELD_INTERVALL: + global_count=count; + pos=(uchar*) tree_search(&count->int_tree, start_pos, + count->int_tree.custom_arg); + intervall=(uint) (pos - count->tree_buff)/field_length; + DBUG_PRINT("fields", ("FIELD_INTERVALL")); + DBUG_PRINT("fields", ("index: %4u code: 0x%s bits: %2u", + intervall, hexdigits(tree->code[intervall]), + (uint) tree->code_len[intervall])); + write_bits(tree->code[intervall],(uint) tree->code_len[intervall]); + start_pos=end_pos; + break; + case FIELD_BLOB: + { + ulong blob_length=_mi_calc_blob_length(field_length- + mi_portable_sizeof_char_ptr, + start_pos); + /* Empty blobs are encoded with a single 1 bit. */ + if (!blob_length) + { + DBUG_PRINT("fields", ("FIELD_BLOB empty, bits: 1")); + write_bits(1,1); + } + else + { + uchar *blob,*blob_end; + DBUG_PRINT("fields", ("FIELD_BLOB not empty, bits: 1")); + write_bits(0,1); + /* Write the blob length. */ + DBUG_PRINT("fields", ("FIELD_BLOB %lu bytes, bits: %2u", + blob_length, count->length_bits)); + write_bits(blob_length,count->length_bits); + memcpy_fixed(&blob,end_pos-mi_portable_sizeof_char_ptr, + sizeof(char*)); + blob_end=blob+blob_length; + /* Encode the blob bytes. */ + for ( ; blob < blob_end ; blob++) + { + DBUG_PRINT("fields", + ("value: 0x%02x code: 0x%s bits: %2u bin: %s", + (uchar) *blob, hexdigits(tree->code[(uchar) *blob]), + (uint) tree->code_len[(uchar) *blob], + bindigits(tree->code[(uchar) *start_pos], + (uint)tree->code_len[(uchar) *start_pos]))); + write_bits(tree->code[(uchar) *blob], + (uint) tree->code_len[(uchar) *blob]); + } + tot_blob_length+=blob_length; + } + start_pos= end_pos; + break; + } + case FIELD_VARCHAR: + { + uint var_pack_length= HA_VARCHAR_PACKLENGTH(count->field_length-1); + ulong col_length= (var_pack_length == 1 ? + (uint) *(uchar*) start_pos : + uint2korr(start_pos)); + /* Empty varchar are encoded with a single 1 bit. */ + if (!col_length) + { + DBUG_PRINT("fields", ("FIELD_VARCHAR empty, bits: 1")); + write_bits(1,1); /* Empty varchar */ + } + else + { + uchar *end= start_pos + var_pack_length + col_length; + DBUG_PRINT("fields", ("FIELD_VARCHAR not empty, bits: 1")); + write_bits(0,1); + /* Write the varchar length. */ + DBUG_PRINT("fields", ("FIELD_VARCHAR %lu bytes, bits: %2u", + col_length, count->length_bits)); + write_bits(col_length,count->length_bits); + /* Encode the varchar bytes. */ + for (start_pos+= var_pack_length ; start_pos < end ; start_pos++) + { + DBUG_PRINT("fields", + ("value: 0x%02x code: 0x%s bits: %2u bin: %s", + (uchar) *start_pos, + hexdigits(tree->code[(uchar) *start_pos]), + (uint) tree->code_len[(uchar) *start_pos], + bindigits(tree->code[(uchar) *start_pos], + (uint)tree->code_len[(uchar) *start_pos]))); + write_bits(tree->code[(uchar) *start_pos], + (uint) tree->code_len[(uchar) *start_pos]); + } + } + start_pos= end_pos; + break; + } + case FIELD_LAST: + case FIELD_enum_val_count: + abort(); /* Impossible */ + } + start_pos+=count->max_zero_fill; + DBUG_PRINT("fields", ("---")); + } + flush_bits(); + length=(ulong) ((uchar*) file_buffer.pos - record_pos) - max_pack_length; + pack_length= save_pack_length(pack_version, record_pos, length); + if (pack_blob_length) + pack_length+= save_pack_length(pack_version, record_pos + pack_length, + tot_blob_length); + DBUG_PRINT("fields", ("record: %lu length: %lu blob-length: %lu " + "length-bytes: %lu", (ulong) record_count, length, + tot_blob_length, pack_length)); + DBUG_PRINT("fields", ("===")); + + /* Correct file buffer if the header was smaller */ + if (pack_length != max_pack_length) + { + bmove(record_pos+pack_length,record_pos+max_pack_length,length); + file_buffer.pos-= (max_pack_length-pack_length); + } + if (length < (ulong) min_record_length) + min_record_length=(uint) length; + if (length > (ulong) max_record_length) + max_record_length=(uint) length; + record_count++; + if (write_loop && record_count % WRITE_COUNT == 0) + { + VOID(printf("%lu\r", (ulong) record_count)); + VOID(fflush(stdout)); + } + } + else if (error != HA_ERR_RECORD_DELETED) + break; + } + if (error == HA_ERR_END_OF_FILE) + error=0; + else + { + VOID(fprintf(stderr, "%s: Got error %d reading records\n", + my_progname, error)); + } + if (verbose >= 2) + VOID(printf("wrote %s records.\n", llstr((longlong) record_count, llbuf))); + + my_afree((uchar*) record); + mrg->ref_length=max_pack_length; + mrg->min_pack_length=max_record_length ? min_record_length : 0; + mrg->max_pack_length=max_record_length; + DBUG_RETURN(error || error_on_write || flush_buffer(~(ulong) 0)); +} + + +static char *make_new_name(char *new_name, char *old_name) +{ + return fn_format(new_name,old_name,"",DATA_TMP_EXT,2+4); +} + +static char *make_old_name(char *new_name, char *old_name) +{ + return fn_format(new_name,old_name,"",OLD_EXT,2+4); +} + + /* rutines for bit writing buffer */ + +static void init_file_buffer(File file, pbool read_buffer) +{ + file_buffer.file=file; + file_buffer.buffer= (uchar*) my_malloc(ALIGN_SIZE(RECORD_CACHE_SIZE), + MYF(MY_WME)); + file_buffer.end=file_buffer.buffer+ALIGN_SIZE(RECORD_CACHE_SIZE)-8; + file_buffer.pos_in_file=0; + error_on_write=0; + if (read_buffer) + { + + file_buffer.pos=file_buffer.end; + file_buffer.bits=0; + } + else + { + file_buffer.pos=file_buffer.buffer; + file_buffer.bits=BITS_SAVED; + } + file_buffer.bitbucket= 0; +} + + +static int flush_buffer(ulong neaded_length) +{ + ulong length; + + /* + file_buffer.end is 8 bytes lower than the real end of the buffer. + This is done so that the end-of-buffer condition does not need to be + checked for every byte (see write_bits()). Consequently, + file_buffer.pos can become greater than file_buffer.end. The + algorithms in the other functions ensure that there will never be + more than 8 bytes written to the buffer without an end-of-buffer + check. So the buffer cannot be overrun. But we need to check for the + near-to-buffer-end condition to avoid a negative result, which is + casted to unsigned and thus becomes giant. + */ + if ((file_buffer.pos < file_buffer.end) && + ((ulong) (file_buffer.end - file_buffer.pos) > neaded_length)) + return 0; + length=(ulong) (file_buffer.pos-file_buffer.buffer); + file_buffer.pos=file_buffer.buffer; + file_buffer.pos_in_file+=length; + if (test_only) + return 0; + if (error_on_write|| my_write(file_buffer.file, + (const uchar*) file_buffer.buffer, + length, + MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL))) + { + error_on_write=1; + return 1; + } + + if (neaded_length != ~(ulong) 0 && + (ulong) (file_buffer.end-file_buffer.buffer) < neaded_length) + { + char *tmp; + neaded_length+=256; /* some margin */ + tmp= my_realloc((char*) file_buffer.buffer, neaded_length,MYF(MY_WME)); + if (!tmp) + return 1; + file_buffer.pos= ((uchar*) tmp + + (ulong) (file_buffer.pos - file_buffer.buffer)); + file_buffer.buffer= (uchar*) tmp; + file_buffer.end= (uchar*) (tmp+neaded_length-8); + } + return 0; +} + + +static void end_file_buffer(void) +{ + my_free((uchar*) file_buffer.buffer,MYF(0)); +} + + /* output `bits` low bits of `value' */ + +static void write_bits(register ulonglong value, register uint bits) +{ + DBUG_ASSERT(((bits < 8 * sizeof(value)) && ! (value >> bits)) || + (bits == 8 * sizeof(value))); + + if ((file_buffer.bits-= (int) bits) >= 0) + { + file_buffer.bitbucket|= value << file_buffer.bits; + } + else + { + reg3 ulonglong bit_buffer; + bits= (uint) -file_buffer.bits; + bit_buffer= (file_buffer.bitbucket | + ((bits != 8 * sizeof(value)) ? (value >> bits) : 0)); +#if BITS_SAVED == 64 + *file_buffer.pos++= (uchar) (bit_buffer >> 56); + *file_buffer.pos++= (uchar) (bit_buffer >> 48); + *file_buffer.pos++= (uchar) (bit_buffer >> 40); + *file_buffer.pos++= (uchar) (bit_buffer >> 32); +#endif + *file_buffer.pos++= (uchar) (bit_buffer >> 24); + *file_buffer.pos++= (uchar) (bit_buffer >> 16); + *file_buffer.pos++= (uchar) (bit_buffer >> 8); + *file_buffer.pos++= (uchar) (bit_buffer); + + if (bits != 8 * sizeof(value)) + value&= (((ulonglong) 1) << bits) - 1; + if (file_buffer.pos >= file_buffer.end) + VOID(flush_buffer(~ (ulong) 0)); + file_buffer.bits=(int) (BITS_SAVED - bits); + file_buffer.bitbucket= value << (BITS_SAVED - bits); + } + return; +} + + /* Flush bits in bit_buffer to buffer */ + +static void flush_bits(void) +{ + int bits; + ulonglong bit_buffer; + + bits= file_buffer.bits & ~7; + bit_buffer= file_buffer.bitbucket >> bits; + bits= BITS_SAVED - bits; + while (bits > 0) + { + bits-= 8; + *file_buffer.pos++= (uchar) (bit_buffer >> bits); + } + if (file_buffer.pos >= file_buffer.end) + VOID(flush_buffer(~ (ulong) 0)); + file_buffer.bits= BITS_SAVED; + file_buffer.bitbucket= 0; +} + + +/**************************************************************************** +** functions to handle the joined files +****************************************************************************/ + +static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length, + ha_checksum crc) +{ + MYISAM_SHARE *share=isam_file->s; + uint options=mi_uint2korr(share->state.header.options); + uint key; + DBUG_ENTER("save_state"); + + options|= HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA; + mi_int2store(share->state.header.options,options); + + share->state.state.data_file_length=new_length; + share->state.state.del=0; + share->state.state.empty=0; + share->state.dellink= HA_OFFSET_ERROR; + share->state.split=(ha_rows) mrg->records; + share->state.version=(ulong) time((time_t*) 0); + if (! mi_is_all_keys_active(share->state.key_map, share->base.keys)) + { + /* + Some indexes are disabled, cannot use current key_file_length value + as an estimate of upper bound of index file size. Use packed data file + size instead. + */ + share->state.state.key_file_length= new_length; + } + /* + If there are no disabled indexes, keep key_file_length value from + original file so "myisamchk -rq" can use this value (this is necessary + because index size cannot be easily calculated for fulltext keys) + */ + mi_clear_all_keys_active(share->state.key_map); + for (key=0 ; key < share->base.keys ; key++) + share->state.key_root[key]= HA_OFFSET_ERROR; + for (key=0 ; key < share->state.header.max_block_size_index ; key++) + share->state.key_del[key]= HA_OFFSET_ERROR; + isam_file->state->checksum=crc; /* Save crc here */ + share->changed=1; /* Force write of header */ + share->state.open_count=0; + share->global_changed=0; + VOID(my_chsize(share->kfile, share->base.keystart, 0, MYF(0))); + if (share->base.keys) + isamchk_neaded=1; + DBUG_RETURN(mi_state_info_write(share->kfile,&share->state,1+2)); +} + + +static int save_state_mrg(File file,PACK_MRG_INFO *mrg,my_off_t new_length, + ha_checksum crc) +{ + MI_STATE_INFO state; + MI_INFO *isam_file=mrg->file[0]; + uint options; + DBUG_ENTER("save_state_mrg"); + + state= isam_file->s->state; + options= (mi_uint2korr(state.header.options) | HA_OPTION_COMPRESS_RECORD | + HA_OPTION_READ_ONLY_DATA); + mi_int2store(state.header.options,options); + state.state.data_file_length=new_length; + state.state.del=0; + state.state.empty=0; + state.state.records=state.split=(ha_rows) mrg->records; + /* See comment above in save_state about key_file_length handling. */ + if (mrg->src_file_has_indexes_disabled) + { + isam_file->s->state.state.key_file_length= + max(isam_file->s->state.state.key_file_length, new_length); + } + state.dellink= HA_OFFSET_ERROR; + state.version=(ulong) time((time_t*) 0); + mi_clear_all_keys_active(state.key_map); + state.state.checksum=crc; + if (isam_file->s->base.keys) + isamchk_neaded=1; + state.changed=STATE_CHANGED | STATE_NOT_ANALYZED; /* Force check of table */ + DBUG_RETURN (mi_state_info_write(file,&state,1+2)); +} + + +/* reset for mrg_rrnd */ + +static void mrg_reset(PACK_MRG_INFO *mrg) +{ + if (mrg->current) + { + mi_extra(*mrg->current, HA_EXTRA_NO_CACHE, 0); + mrg->current=0; + } +} + +static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf) +{ + int error; + MI_INFO *isam_info; + my_off_t filepos; + + if (!info->current) + { + isam_info= *(info->current=info->file); + info->end=info->current+info->count; + mi_reset(isam_info); + mi_extra(isam_info, HA_EXTRA_CACHE, 0); + filepos=isam_info->s->pack.header_length; + } + else + { + isam_info= *info->current; + filepos= isam_info->nextpos; + } + + for (;;) + { + isam_info->update&= HA_STATE_CHANGED; + if (!(error=(*isam_info->s->read_rnd)(isam_info,(uchar*) buf, + filepos, 1)) || + error != HA_ERR_END_OF_FILE) + return (error); + mi_extra(isam_info,HA_EXTRA_NO_CACHE, 0); + if (info->current+1 == info->end) + return(HA_ERR_END_OF_FILE); + info->current++; + isam_info= *info->current; + filepos=isam_info->s->pack.header_length; + mi_reset(isam_info); + mi_extra(isam_info,HA_EXTRA_CACHE, 0); + } +} + + +static int mrg_close(PACK_MRG_INFO *mrg) +{ + uint i; + int error=0; + for (i=0 ; i < mrg->count ; i++) + error|=mi_close(mrg->file[i]); + if (mrg->free_file) + my_free((uchar*) mrg->file,MYF(0)); + return error; +} + + +#if !defined(DBUG_OFF) +/* + Fake the counts to get big Huffman codes. + + SYNOPSIS + fakebigcodes() + huff_counts A pointer to the counts array. + end_count A pointer past the counts array. + + DESCRIPTION + + Huffman coding works by removing the two least frequent values from + the list of values and add a new value with the sum of their + incidences in a loop until only one value is left. Every time a + value is reused for a new value, it gets one more bit for its + encoding. Hence, the least frequent values get the longest codes. + + To get a maximum code length for a value, two of the values must + have an incidence of 1. As their sum is 2, the next infrequent value + must have at least an incidence of 2, then 4, 8, 16 and so on. This + means that one needs 2**n bytes (values) for a code length of n + bits. However, using more distinct values forces the use of longer + codes, or reaching the code length with less total bytes (values). + + To get 64(32)-bit codes, I sort the counts by decreasing incidence. + I assign counts of 1 to the two most frequent values, a count of 2 + for the next one, then 4, 8, and so on until 2**64-1(2**30-1). All + the remaining values get 1. That way every possible byte has an + assigned code, though not all codes are used if not all byte values + are present in the column. + + This strategy would work with distinct column values too, but + requires that at least 64(32) values are present. To make things + easier here, I cancel all distinct column values and force byte + compression for all columns. + + RETURN + void +*/ + +static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count) +{ + HUFF_COUNTS *count; + my_off_t *cur_count_p; + my_off_t *end_count_p; + my_off_t **cur_sort_p; + my_off_t **end_sort_p; + my_off_t *sort_counts[256]; + my_off_t total; + DBUG_ENTER("fakebigcodes"); + + for (count= huff_counts; count < end_count; count++) + { + /* + Remove distinct column values. + */ + if (huff_counts->tree_buff) + { + my_free((uchar*) huff_counts->tree_buff, MYF(0)); + delete_tree(&huff_counts->int_tree); + huff_counts->tree_buff= NULL; + DBUG_PRINT("fakebigcodes", ("freed distinct column values")); + } + + /* + Sort counts by decreasing incidence. + */ + cur_count_p= count->counts; + end_count_p= cur_count_p + 256; + cur_sort_p= sort_counts; + while (cur_count_p < end_count_p) + *(cur_sort_p++)= cur_count_p++; + (void) qsort(sort_counts, 256, sizeof(my_off_t*), (qsort_cmp) fakecmp); + + /* + Assign faked counts. + */ + cur_sort_p= sort_counts; +#if SIZEOF_LONG_LONG > 4 + end_sort_p= sort_counts + 8 * sizeof(ulonglong) - 1; +#else + end_sort_p= sort_counts + 8 * sizeof(ulonglong) - 2; +#endif + /* Most frequent value gets a faked count of 1. */ + **(cur_sort_p++)= 1; + total= 1; + while (cur_sort_p < end_sort_p) + { + **(cur_sort_p++)= total; + total<<= 1; + } + /* Set the last value. */ + **(cur_sort_p++)= --total; + /* + Set the remaining counts. + */ + end_sort_p= sort_counts + 256; + while (cur_sort_p < end_sort_p) + **(cur_sort_p++)= 1; + } + DBUG_VOID_RETURN; +} + + +/* + Compare two counts for reverse sorting. + + SYNOPSIS + fakecmp() + count1 One count. + count2 Another count. + + RETURN + 1 count1 < count2 + 0 count1 == count2 + -1 count1 > count2 +*/ + +static int fakecmp(my_off_t **count1, my_off_t **count2) +{ + return ((**count1 < **count2) ? 1 : + (**count1 > **count2) ? -1 : 0); +} +#endif + + Added: trunk/src/plug.in =================================================================== --- trunk/src/plug.in 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/plug.in 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,4 @@ +MYSQL_STORAGE_ENGINE(tritonn,,[Tritonn Storage Engine], + [Tritonn Engine for Fulltext search with Senna], [max,max-no-ndb]) +MYSQL_PLUGIN_STATIC(tritonn, [libtritonn.a]) +MYSQL_PLUGIN_DYNAMIC(tritonn, [ha_tritonn.la]) Added: trunk/src/rt_index.c =================================================================== --- trunk/src/rt_index.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/rt_index.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,1129 @@ +/* Copyright (C) 2002-2006 MySQL AB & Ramil Kalimullin + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + +#ifdef HAVE_RTREE_KEYS + +#include "rt_index.h" +#include "rt_key.h" +#include "rt_mbr.h" + +#define REINSERT_BUFFER_INC 10 +#define PICK_BY_AREA +/*#define PICK_BY_PERIMETER*/ + +typedef struct st_page_level +{ + uint level; + my_off_t offs; +} stPageLevel; + +typedef struct st_page_list +{ + ulong n_pages; + ulong m_pages; + stPageLevel *pages; +} stPageList; + + +/* + Find next key in r-tree according to search_flag recursively + + NOTES + Used in rtree_find_first() and rtree_find_next() + + RETURN + -1 Error + 0 Found + 1 Not found +*/ + +static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag, + uint nod_cmp_flag, my_off_t page, int level) +{ + uchar *k; + uchar *last; + uint nod_flag; + int res; + uchar *page_buf; + int k_len; + uint *saved_key = (uint*) (info->rtree_recursion_state) + level; + + if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length))) + { + my_errno = HA_ERR_OUT_OF_MEM; + return -1; + } + if (!_mi_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0)) + goto err1; + nod_flag = mi_test_if_nod(page_buf); + + k_len = keyinfo->keylength - info->s->base.rec_reflength; + + if(info->rtree_recursion_depth >= level) + { + k = page_buf + *saved_key; + } + else + { + k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); + } + last = rt_PAGE_END(page_buf); + + for (; k < last; k = rt_PAGE_NEXT_KEY(k, k_len, nod_flag)) + { + if (nod_flag) + { + /* this is an internal node in the tree */ + if (!(res = rtree_key_cmp(keyinfo->seg, info->first_mbr_key, k, + info->last_rkey_length, nod_cmp_flag))) + { + switch ((res = rtree_find_req(info, keyinfo, search_flag, nod_cmp_flag, + _mi_kpos(nod_flag, k), level + 1))) + { + case 0: /* found - exit from recursion */ + *saved_key = k - page_buf; + goto ok; + case 1: /* not found - continue searching */ + info->rtree_recursion_depth = level; + break; + default: /* error */ + case -1: + goto err1; + } + } + } + else + { + /* this is a leaf */ + if (!rtree_key_cmp(keyinfo->seg, info->first_mbr_key, k, + info->last_rkey_length, search_flag)) + { + uchar *after_key = rt_PAGE_NEXT_KEY(k, k_len, nod_flag); + info->lastpos = _mi_dpos(info, 0, after_key); + info->lastkey_length = k_len + info->s->base.rec_reflength; + memcpy(info->lastkey, k, info->lastkey_length); + info->rtree_recursion_depth = level; + *saved_key = last - page_buf; + + if (after_key < last) + { + info->int_keypos = info->buff; + info->int_maxpos = info->buff + (last - after_key); + memcpy(info->buff, after_key, last - after_key); + info->buff_used = 0; + } + else + { + info->buff_used = 1; + } + + res = 0; + goto ok; + } + } + } + info->lastpos = HA_OFFSET_ERROR; + my_errno = HA_ERR_KEY_NOT_FOUND; + res = 1; + +ok: + my_afree((uchar*)page_buf); + return res; + +err1: + my_afree((uchar*)page_buf); + info->lastpos = HA_OFFSET_ERROR; + return -1; +} + + +/* + Find first key in r-tree according to search_flag condition + + SYNOPSIS + rtree_find_first() + info Handler to MyISAM file + uint keynr Key number to use + key Key to search for + key_length Length of 'key' + search_flag Bitmap of flags how to do the search + + RETURN + -1 Error + 0 Found + 1 Not found +*/ + +int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length, + uint search_flag) +{ + my_off_t root; + uint nod_cmp_flag; + MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + + if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; + return -1; + } + + /* + Save searched key, include data pointer. + The data pointer is required if the search_flag contains MBR_DATA. + (minimum bounding rectangle) + */ + memcpy(info->first_mbr_key, key, keyinfo->keylength); + info->last_rkey_length = key_length; + + info->rtree_recursion_depth = -1; + info->buff_used = 1; + + nod_cmp_flag = ((search_flag & (MBR_EQUAL | MBR_WITHIN)) ? + MBR_WITHIN : MBR_INTERSECT); + return rtree_find_req(info, keyinfo, search_flag, nod_cmp_flag, root, 0); +} + + +/* + Find next key in r-tree according to search_flag condition + + SYNOPSIS + rtree_find_next() + info Handler to MyISAM file + uint keynr Key number to use + search_flag Bitmap of flags how to do the search + + RETURN + -1 Error + 0 Found + 1 Not found +*/ + +int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag) +{ + my_off_t root; + uint nod_cmp_flag; + MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + + if (info->update & HA_STATE_DELETED) + return rtree_find_first(info, keynr, info->lastkey, info->lastkey_length, + search_flag); + + if (!info->buff_used) + { + uchar *key= info->int_keypos; + + while (key < info->int_maxpos) + { + if (!rtree_key_cmp(keyinfo->seg, info->first_mbr_key, key, + info->last_rkey_length, search_flag)) + { + uchar *after_key = key + keyinfo->keylength; + + info->lastpos= _mi_dpos(info, 0, after_key); + memcpy(info->lastkey, key, info->lastkey_length); + + if (after_key < info->int_maxpos) + info->int_keypos= after_key; + else + info->buff_used= 1; + return 0; + } + key+= keyinfo->keylength; + } + } + if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; + return -1; + } + + nod_cmp_flag = ((search_flag & (MBR_EQUAL | MBR_WITHIN)) ? + MBR_WITHIN : MBR_INTERSECT); + return rtree_find_req(info, keyinfo, search_flag, nod_cmp_flag, root, 0); +} + + +/* + Get next key in r-tree recursively + + NOTES + Used in rtree_get_first() and rtree_get_next() + + RETURN + -1 Error + 0 Found + 1 Not found +*/ + +static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length, + my_off_t page, int level) +{ + uchar *k; + uchar *last; + uint nod_flag; + int res; + uchar *page_buf; + uint k_len; + uint *saved_key = (uint*) (info->rtree_recursion_state) + level; + + if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length))) + return -1; + if (!_mi_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0)) + goto err1; + nod_flag = mi_test_if_nod(page_buf); + + k_len = keyinfo->keylength - info->s->base.rec_reflength; + + if(info->rtree_recursion_depth >= level) + { + k = page_buf + *saved_key; + if (!nod_flag) + { + /* Only leaf pages contain data references. */ + /* Need to check next key with data reference. */ + k = rt_PAGE_NEXT_KEY(k, k_len, nod_flag); + } + } + else + { + k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); + } + last = rt_PAGE_END(page_buf); + + for (; k < last; k = rt_PAGE_NEXT_KEY(k, k_len, nod_flag)) + { + if (nod_flag) + { + /* this is an internal node in the tree */ + switch ((res = rtree_get_req(info, keyinfo, key_length, + _mi_kpos(nod_flag, k), level + 1))) + { + case 0: /* found - exit from recursion */ + *saved_key = k - page_buf; + goto ok; + case 1: /* not found - continue searching */ + info->rtree_recursion_depth = level; + break; + default: + case -1: /* error */ + goto err1; + } + } + else + { + /* this is a leaf */ + uchar *after_key = rt_PAGE_NEXT_KEY(k, k_len, nod_flag); + info->lastpos = _mi_dpos(info, 0, after_key); + info->lastkey_length = k_len + info->s->base.rec_reflength; + memcpy(info->lastkey, k, info->lastkey_length); + + info->rtree_recursion_depth = level; + *saved_key = k - page_buf; + + if (after_key < last) + { + info->int_keypos = (uchar*)saved_key; + memcpy(info->buff, page_buf, keyinfo->block_length); + info->int_maxpos = rt_PAGE_END(info->buff); + info->buff_used = 0; + } + else + { + info->buff_used = 1; + } + + res = 0; + goto ok; + } + } + info->lastpos = HA_OFFSET_ERROR; + my_errno = HA_ERR_KEY_NOT_FOUND; + res = 1; + +ok: + my_afree((uchar*)page_buf); + return res; + +err1: + my_afree((uchar*)page_buf); + info->lastpos = HA_OFFSET_ERROR; + return -1; +} + + +/* + Get first key in r-tree + + RETURN + -1 Error + 0 Found + 1 Not found +*/ + +int rtree_get_first(MI_INFO *info, uint keynr, uint key_length) +{ + my_off_t root; + MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + + if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; + return -1; + } + + info->rtree_recursion_depth = -1; + info->buff_used = 1; + + return rtree_get_req(info, &keyinfo[keynr], key_length, root, 0); +} + + +/* + Get next key in r-tree + + RETURN + -1 Error + 0 Found + 1 Not found +*/ + +int rtree_get_next(MI_INFO *info, uint keynr, uint key_length) +{ + my_off_t root; + MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + + if (!info->buff_used) + { + uint k_len = keyinfo->keylength - info->s->base.rec_reflength; + /* rt_PAGE_NEXT_KEY(info->int_keypos) */ + uchar *key = info->buff + *(int*)info->int_keypos + k_len + + info->s->base.rec_reflength; + /* rt_PAGE_NEXT_KEY(key) */ + uchar *after_key = key + k_len + info->s->base.rec_reflength; + + info->lastpos = _mi_dpos(info, 0, after_key); + info->lastkey_length = k_len + info->s->base.rec_reflength; + memcpy(info->lastkey, key, k_len + info->s->base.rec_reflength); + + *(int*)info->int_keypos = key - info->buff; + if (after_key >= info->int_maxpos) + { + info->buff_used = 1; + } + + return 0; + } + else + { + if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; + return -1; + } + + return rtree_get_req(info, &keyinfo[keynr], key_length, root, 0); + } +} + + +/* + Choose non-leaf better key for insertion +*/ + +#ifdef PICK_BY_PERIMETER +static uchar *rtree_pick_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + uint key_length, uchar *page_buf, uint nod_flag) +{ + double increase; + double best_incr = DBL_MAX; + double perimeter; + double best_perimeter; + uchar *best_key; + uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); + uchar *last = rt_PAGE_END(page_buf); + + LINT_INIT(best_perimeter); + LINT_INIT(best_key); + + for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag)) + { + if ((increase = rtree_perimeter_increase(keyinfo->seg, k, key, key_length, + &perimeter)) == -1) + return NULL; + if ((increase < best_incr)|| + (increase == best_incr && perimeter < best_perimeter)) + { + best_key = k; + best_perimeter= perimeter; + best_incr = increase; + } + } + return best_key; +} + +#endif /*PICK_BY_PERIMETER*/ + +#ifdef PICK_BY_AREA +static uchar *rtree_pick_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + uint key_length, uchar *page_buf, uint nod_flag) +{ + double increase; + double best_incr = DBL_MAX; + double area; + double best_area; + uchar *best_key; + uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); + uchar *last = rt_PAGE_END(page_buf); + + LINT_INIT(best_area); + LINT_INIT(best_key); + + for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag)) + { + /* The following is safe as -1.0 is an exact number */ + if ((increase = rtree_area_increase(keyinfo->seg, k, key, key_length, + &area)) == -1.0) + return NULL; + /* The following should be safe, even if we compare doubles */ + if (increase < best_incr) + { + best_key = k; + best_area = area; + best_incr = increase; + } + else + { + /* The following should be safe, even if we compare doubles */ + if ((increase == best_incr) && (area < best_area)) + { + best_key = k; + best_area = area; + best_incr = increase; + } + } + } + return best_key; +} + +#endif /*PICK_BY_AREA*/ + +/* + Go down and insert key into tree + + RETURN + -1 Error + 0 Child was not split + 1 Child was split +*/ + +static int rtree_insert_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + uint key_length, my_off_t page, my_off_t *new_page, + int ins_level, int level) +{ + uchar *k; + uint nod_flag; + uchar *page_buf; + int res; + DBUG_ENTER("rtree_insert_req"); + + if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length + + MI_MAX_KEY_BUFF))) + { + my_errno = HA_ERR_OUT_OF_MEM; + DBUG_RETURN(-1); /* purecov: inspected */ + } + if (!_mi_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0)) + goto err1; + nod_flag = mi_test_if_nod(page_buf); + DBUG_PRINT("rtree", ("page: %lu level: %d ins_level: %d nod_flag: %u", + (ulong) page, level, ins_level, nod_flag)); + + if ((ins_level == -1 && nod_flag) || /* key: go down to leaf */ + (ins_level > -1 && ins_level > level)) /* branch: go down to ins_level */ + { + if ((k = rtree_pick_key(info, keyinfo, key, key_length, page_buf, + nod_flag)) == NULL) + goto err1; + switch ((res = rtree_insert_req(info, keyinfo, key, key_length, + _mi_kpos(nod_flag, k), new_page, ins_level, level + 1))) + { + case 0: /* child was not split */ + { + rtree_combine_rect(keyinfo->seg, k, key, k, key_length); + if (_mi_write_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf)) + goto err1; + goto ok; + } + case 1: /* child was split */ + { + uchar *new_key = page_buf + keyinfo->block_length + nod_flag; + /* set proper MBR for key */ + if (rtree_set_key_mbr(info, keyinfo, k, key_length, + _mi_kpos(nod_flag, k))) + goto err1; + /* add new key for new page */ + _mi_kpointer(info, new_key - nod_flag, *new_page); + if (rtree_set_key_mbr(info, keyinfo, new_key, key_length, *new_page)) + goto err1; + res = rtree_add_key(info, keyinfo, new_key, key_length, + page_buf, new_page); + if (_mi_write_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf)) + goto err1; + goto ok; + } + default: + case -1: /* error */ + { + goto err1; + } + } + } + else + { + res = rtree_add_key(info, keyinfo, key, key_length, page_buf, new_page); + if (_mi_write_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf)) + goto err1; + goto ok; + } + +ok: + my_afree((uchar*)page_buf); + DBUG_RETURN(res); + +err1: + my_afree((uchar*)page_buf); + DBUG_RETURN(-1); /* purecov: inspected */ +} + + +/* + Insert key into the tree + + RETURN + -1 Error + 0 Root was not split + 1 Root was split +*/ + +static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key, + uint key_length, int ins_level) +{ + my_off_t old_root; + MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + int res; + my_off_t new_page; + DBUG_ENTER("rtree_insert_level"); + + if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + if ((old_root = _mi_new(info, keyinfo, DFLT_INIT_HITS)) == HA_OFFSET_ERROR) + DBUG_RETURN(-1); + info->buff_used = 1; + mi_putint(info->buff, 2, 0); + res = rtree_add_key(info, keyinfo, key, key_length, info->buff, NULL); + if (_mi_write_keypage(info, keyinfo, old_root, DFLT_INIT_HITS, info->buff)) + DBUG_RETURN(1); + info->s->state.key_root[keynr] = old_root; + DBUG_RETURN(res); + } + + switch ((res = rtree_insert_req(info, keyinfo, key, key_length, + old_root, &new_page, ins_level, 0))) + { + case 0: /* root was not split */ + { + break; + } + case 1: /* root was split, grow a new root */ + { + uchar *new_root_buf; + my_off_t new_root; + uchar *new_key; + uint nod_flag = info->s->base.key_reflength; + + DBUG_PRINT("rtree", ("root was split, grow a new root")); + if (!(new_root_buf = (uchar*)my_alloca((uint)keyinfo->block_length + + MI_MAX_KEY_BUFF))) + { + my_errno = HA_ERR_OUT_OF_MEM; + DBUG_RETURN(-1); /* purecov: inspected */ + } + + mi_putint(new_root_buf, 2, nod_flag); + if ((new_root = _mi_new(info, keyinfo, DFLT_INIT_HITS)) == + HA_OFFSET_ERROR) + goto err1; + + new_key = new_root_buf + keyinfo->block_length + nod_flag; + + _mi_kpointer(info, new_key - nod_flag, old_root); + if (rtree_set_key_mbr(info, keyinfo, new_key, key_length, old_root)) + goto err1; + if (rtree_add_key(info, keyinfo, new_key, key_length, new_root_buf, NULL) + == -1) + goto err1; + _mi_kpointer(info, new_key - nod_flag, new_page); + if (rtree_set_key_mbr(info, keyinfo, new_key, key_length, new_page)) + goto err1; + if (rtree_add_key(info, keyinfo, new_key, key_length, new_root_buf, NULL) + == -1) + goto err1; + if (_mi_write_keypage(info, keyinfo, new_root, + DFLT_INIT_HITS, new_root_buf)) + goto err1; + info->s->state.key_root[keynr] = new_root; + DBUG_PRINT("rtree", ("new root page: %lu level: %d nod_flag: %u", + (ulong) new_root, 0, mi_test_if_nod(new_root_buf))); + + my_afree((uchar*)new_root_buf); + break; +err1: + my_afree((uchar*)new_root_buf); + DBUG_RETURN(-1); /* purecov: inspected */ + } + default: + case -1: /* error */ + { + break; + } + } + DBUG_RETURN(res); +} + + +/* + Insert key into the tree - interface function + + RETURN + -1 Error + 0 OK +*/ + +int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length) +{ + DBUG_ENTER("rtree_insert"); + DBUG_RETURN((!key_length || + (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? + -1 : 0); +} + + +/* + Fill reinsert page buffer + + RETURN + -1 Error + 0 OK +*/ + +static int rtree_fill_reinsert_list(stPageList *ReinsertList, my_off_t page, + int level) +{ + DBUG_ENTER("rtree_fill_reinsert_list"); + DBUG_PRINT("rtree", ("page: %lu level: %d", (ulong) page, level)); + if (ReinsertList->n_pages == ReinsertList->m_pages) + { + ReinsertList->m_pages += REINSERT_BUFFER_INC; + if (!(ReinsertList->pages = (stPageLevel*)my_realloc((uchar*)ReinsertList->pages, + ReinsertList->m_pages * sizeof(stPageLevel), MYF(MY_ALLOW_ZERO_PTR)))) + goto err1; + } + /* save page to ReinsertList */ + ReinsertList->pages[ReinsertList->n_pages].offs = page; + ReinsertList->pages[ReinsertList->n_pages].level = level; + ReinsertList->n_pages++; + DBUG_RETURN(0); + +err1: + DBUG_RETURN(-1); /* purecov: inspected */ +} + + +/* + Go down and delete key from the tree + + RETURN + -1 Error + 0 Deleted + 1 Not found + 2 Empty leaf +*/ + +static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + uint key_length, my_off_t page, uint *page_size, + stPageList *ReinsertList, int level) +{ + uchar *k; + uchar *last; + ulong i; + uint nod_flag; + uchar *page_buf; + int res; + DBUG_ENTER("rtree_delete_req"); + + if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length))) + { + my_errno = HA_ERR_OUT_OF_MEM; + DBUG_RETURN(-1); /* purecov: inspected */ + } + if (!_mi_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0)) + goto err1; + nod_flag = mi_test_if_nod(page_buf); + DBUG_PRINT("rtree", ("page: %lu level: %d nod_flag: %u", + (ulong) page, level, nod_flag)); + + k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); + last = rt_PAGE_END(page_buf); + + for (i = 0; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag), ++i) + { + if (nod_flag) + { + /* not leaf */ + if (!rtree_key_cmp(keyinfo->seg, key, k, key_length, MBR_WITHIN)) + { + switch ((res = rtree_delete_req(info, keyinfo, key, key_length, + _mi_kpos(nod_flag, k), page_size, ReinsertList, level + 1))) + { + case 0: /* deleted */ + { + /* test page filling */ + if (*page_size + key_length >= rt_PAGE_MIN_SIZE(keyinfo->block_length)) + { + /* OK */ + /* Calculate a new key value (MBR) for the shrinked block. */ + if (rtree_set_key_mbr(info, keyinfo, k, key_length, + _mi_kpos(nod_flag, k))) + goto err1; + if (_mi_write_keypage(info, keyinfo, page, + DFLT_INIT_HITS, page_buf)) + goto err1; + } + else + { + /* + Too small: delete key & add it descendant to reinsert list. + Store position and level of the block so that it can be + accessed later for inserting the remaining keys. + */ + DBUG_PRINT("rtree", ("too small. move block to reinsert list")); + if (rtree_fill_reinsert_list(ReinsertList, _mi_kpos(nod_flag, k), + level + 1)) + goto err1; + /* + Delete the key that references the block. This makes the + block disappear from the index. Hence we need to insert + its remaining keys later. Note: if the block is a branch + block, we do not only remove this block, but the whole + subtree. So we need to re-insert its keys on the same + level later to reintegrate the subtrees. + */ + rtree_delete_key(info, page_buf, k, key_length, nod_flag); + if (_mi_write_keypage(info, keyinfo, page, + DFLT_INIT_HITS, page_buf)) + goto err1; + *page_size = mi_getint(page_buf); + } + + goto ok; + } + case 1: /* not found - continue searching */ + { + break; + } + case 2: /* vacuous case: last key in the leaf */ + { + rtree_delete_key(info, page_buf, k, key_length, nod_flag); + if (_mi_write_keypage(info, keyinfo, page, + DFLT_INIT_HITS, page_buf)) + goto err1; + *page_size = mi_getint(page_buf); + res = 0; + goto ok; + } + default: /* error */ + case -1: + { + goto err1; + } + } + } + } + else + { + /* leaf */ + if (!rtree_key_cmp(keyinfo->seg, key, k, key_length, MBR_EQUAL | MBR_DATA)) + { + rtree_delete_key(info, page_buf, k, key_length, nod_flag); + *page_size = mi_getint(page_buf); + if (*page_size == 2) + { + /* last key in the leaf */ + res = 2; + if (_mi_dispose(info, keyinfo, page, DFLT_INIT_HITS)) + goto err1; + } + else + { + res = 0; + if (_mi_write_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf)) + goto err1; + } + goto ok; + } + } + } + res = 1; + +ok: + my_afree((uchar*)page_buf); + DBUG_RETURN(res); + +err1: + my_afree((uchar*)page_buf); + DBUG_RETURN(-1); /* purecov: inspected */ +} + + +/* + Delete key - interface function + + RETURN + -1 Error + 0 Deleted +*/ + +int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) +{ + uint page_size; + stPageList ReinsertList; + my_off_t old_root; + MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + DBUG_ENTER("rtree_delete"); + + if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; + DBUG_RETURN(-1); /* purecov: inspected */ + } + DBUG_PRINT("rtree", ("starting deletion at root page: %lu", + (ulong) old_root)); + + ReinsertList.pages = NULL; + ReinsertList.n_pages = 0; + ReinsertList.m_pages = 0; + + switch (rtree_delete_req(info, keyinfo, key, key_length, old_root, + &page_size, &ReinsertList, 0)) + { + case 2: /* empty */ + { + info->s->state.key_root[keynr] = HA_OFFSET_ERROR; + DBUG_RETURN(0); + } + case 0: /* deleted */ + { + uint nod_flag; + ulong i; + for (i = 0; i < ReinsertList.n_pages; ++i) + { + uchar *page_buf; + uchar *k; + uchar *last; + + if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length))) + { + my_errno = HA_ERR_OUT_OF_MEM; + goto err1; + } + if (!_mi_fetch_keypage(info, keyinfo, ReinsertList.pages[i].offs, + DFLT_INIT_HITS, page_buf, 0)) + goto err1; + nod_flag = mi_test_if_nod(page_buf); + DBUG_PRINT("rtree", ("reinserting keys from " + "page: %lu level: %d nod_flag: %u", + (ulong) ReinsertList.pages[i].offs, + ReinsertList.pages[i].level, nod_flag)); + + k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); + last = rt_PAGE_END(page_buf); + for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag)) + { + int res; + if ((res= rtree_insert_level(info, keynr, k, key_length, + ReinsertList.pages[i].level)) == -1) + { + my_afree((uchar*)page_buf); + goto err1; + } + if (res) + { + ulong j; + DBUG_PRINT("rtree", ("root has been split, adjust levels")); + for (j= i; j < ReinsertList.n_pages; j++) + { + ReinsertList.pages[j].level++; + DBUG_PRINT("rtree", ("keys from page: %lu now level: %d", + (ulong) ReinsertList.pages[i].offs, + ReinsertList.pages[i].level)); + } + } + } + my_afree((uchar*)page_buf); + if (_mi_dispose(info, keyinfo, ReinsertList.pages[i].offs, + DFLT_INIT_HITS)) + goto err1; + } + if (ReinsertList.pages) + my_free((uchar*) ReinsertList.pages, MYF(0)); + + /* check for redundant root (not leaf, 1 child) and eliminate */ + if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + goto err1; + if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS, + info->buff, 0)) + goto err1; + nod_flag = mi_test_if_nod(info->buff); + page_size = mi_getint(info->buff); + if (nod_flag && (page_size == 2 + key_length + nod_flag)) + { + my_off_t new_root = _mi_kpos(nod_flag, + rt_PAGE_FIRST_KEY(info->buff, nod_flag)); + if (_mi_dispose(info, keyinfo, old_root, DFLT_INIT_HITS)) + goto err1; + info->s->state.key_root[keynr] = new_root; + } + info->update= HA_STATE_DELETED; + DBUG_RETURN(0); + +err1: + DBUG_RETURN(-1); /* purecov: inspected */ + } + case 1: /* not found */ + { + my_errno = HA_ERR_KEY_NOT_FOUND; + DBUG_RETURN(-1); /* purecov: inspected */ + } + default: + case -1: /* error */ + { + DBUG_RETURN(-1); /* purecov: inspected */ + } + } +} + + +/* + Estimate number of suitable keys in the tree + + RETURN + estimated value +*/ + +ha_rows rtree_estimate(MI_INFO *info, uint keynr, uchar *key, + uint key_length, uint flag) +{ + MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + my_off_t root; + uint i = 0; + uchar *k; + uchar *last; + uint nod_flag; + uchar *page_buf; + uint k_len; + double area = 0; + ha_rows res = 0; + + if (flag & MBR_DISJOINT) + return info->state->records; + + if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + return HA_POS_ERROR; + if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length))) + return HA_POS_ERROR; + if (!_mi_fetch_keypage(info, keyinfo, root, DFLT_INIT_HITS, page_buf, 0)) + goto err1; + nod_flag = mi_test_if_nod(page_buf); + + k_len = keyinfo->keylength - info->s->base.rec_reflength; + + k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); + last = rt_PAGE_END(page_buf); + + for (; k < last; k = rt_PAGE_NEXT_KEY(k, k_len, nod_flag), ++i) + { + if (nod_flag) + { + double k_area = rtree_rect_volume(keyinfo->seg, k, key_length); + + /* The following should be safe, even if we compare doubles */ + if (k_area == 0) + { + if (flag & (MBR_CONTAIN | MBR_INTERSECT)) + { + area += 1; + } + else if (flag & (MBR_WITHIN | MBR_EQUAL)) + { + if (!rtree_key_cmp(keyinfo->seg, key, k, key_length, MBR_WITHIN)) + area += 1; + } + else + goto err1; + } + else + { + if (flag & (MBR_CONTAIN | MBR_INTERSECT)) + { + area += rtree_overlapping_area(keyinfo->seg, key, k, key_length) / + k_area; + } + else if (flag & (MBR_WITHIN | MBR_EQUAL)) + { + if (!rtree_key_cmp(keyinfo->seg, key, k, key_length, MBR_WITHIN)) + area += rtree_rect_volume(keyinfo->seg, key, key_length) / + k_area; + } + else + goto err1; + } + } + else + { + if (!rtree_key_cmp(keyinfo->seg, key, k, key_length, flag)) + ++res; + } + } + if (nod_flag) + { + if (i) + res = (ha_rows) (area / i * info->state->records); + else + res = HA_POS_ERROR; + } + + my_afree((uchar*)page_buf); + return res; + +err1: + my_afree((uchar*)page_buf); + return HA_POS_ERROR; +} + +#endif /*HAVE_RTREE_KEYS*/ + Added: trunk/src/rt_index.h =================================================================== --- trunk/src/rt_index.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/rt_index.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,45 @@ +/* Copyright (C) 2002, 2004 MySQL AB & Ramil Kalimullin + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _rt_index_h +#define _rt_index_h + +#ifdef HAVE_RTREE_KEYS + +#define rt_PAGE_FIRST_KEY(page, nod_flag) (page + 2 + nod_flag) +#define rt_PAGE_NEXT_KEY(key, key_length, nod_flag) (key + key_length + \ + (nod_flag ? nod_flag : info->s->base.rec_reflength)) +#define rt_PAGE_END(page) (page + mi_getint(page)) + +#define rt_PAGE_MIN_SIZE(block_length) ((uint)(block_length) / 3) + +int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length); +int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length); + +int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length, + uint search_flag); +int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag); + +int rtree_get_first(MI_INFO *info, uint keynr, uint key_length); +int rtree_get_next(MI_INFO *info, uint keynr, uint key_length); + +ha_rows rtree_estimate(MI_INFO *info, uint keynr, uchar *key, + uint key_length, uint flag); + +int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, + uint key_length, my_off_t *new_page_offs); + +#endif /*HAVE_RTREE_KEYS*/ +#endif /* _rt_index_h */ Added: trunk/src/rt_key.c =================================================================== --- trunk/src/rt_key.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/rt_key.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,106 @@ +/* Copyright (C) 2000 MySQL AB & Ramil Kalimullin + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + +#ifdef HAVE_RTREE_KEYS +#include "rt_index.h" +#include "rt_key.h" +#include "rt_mbr.h" + +/* + Add key to the page + + RESULT VALUES + -1 Error + 0 Not split + 1 Split +*/ + +int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + uint key_length, uchar *page_buf, my_off_t *new_page) +{ + uint page_size = mi_getint(page_buf); + uint nod_flag = mi_test_if_nod(page_buf); + DBUG_ENTER("rtree_add_key"); + + if (page_size + key_length + info->s->base.rec_reflength <= + keyinfo->block_length) + { + /* split won't be necessary */ + if (nod_flag) + { + /* save key */ + DBUG_ASSERT(_mi_kpos(nod_flag, key) < info->state->key_file_length); + memcpy(rt_PAGE_END(page_buf), key - nod_flag, key_length + nod_flag); + page_size += key_length + nod_flag; + } + else + { + /* save key */ + DBUG_ASSERT(_mi_dpos(info, nod_flag, key + key_length + + info->s->base.rec_reflength) < + info->state->data_file_length + info->s->base.pack_reclength); + memcpy(rt_PAGE_END(page_buf), key, key_length + + info->s->base.rec_reflength); + page_size += key_length + info->s->base.rec_reflength; + } + mi_putint(page_buf, page_size, nod_flag); + DBUG_RETURN(0); + } + + DBUG_RETURN((rtree_split_page(info, keyinfo, page_buf, key, key_length, + new_page) ? -1 : 1)); +} + +/* + Delete key from the page +*/ +int rtree_delete_key(MI_INFO *info, uchar *page_buf, uchar *key, + uint key_length, uint nod_flag) +{ + uint16 page_size = mi_getint(page_buf); + uchar *key_start; + + key_start= key - nod_flag; + if (!nod_flag) + key_length += info->s->base.rec_reflength; + + memmove(key_start, key + key_length, page_size - key_length - + (key - page_buf)); + page_size-= key_length + nod_flag; + + mi_putint(page_buf, page_size, nod_flag); + return 0; +} + + +/* + Calculate and store key MBR +*/ + +int rtree_set_key_mbr(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + uint key_length, my_off_t child_page) +{ + DBUG_ENTER("rtree_set_key_mbr"); + + if (!_mi_fetch_keypage(info, keyinfo, child_page, + DFLT_INIT_HITS, info->buff, 0)) + DBUG_RETURN(-1); /* purecov: inspected */ + + DBUG_RETURN(rtree_page_mbr(info, keyinfo->seg, info->buff, key, key_length)); +} + +#endif /*HAVE_RTREE_KEYS*/ Added: trunk/src/rt_key.h =================================================================== --- trunk/src/rt_key.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/rt_key.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,31 @@ +/* Copyright (C) 2002, 2004 MySQL AB & Ramil Kalimullin + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Ramil Kalimullin, who has a shared copyright to this code */ + +#ifndef _rt_key_h +#define _rt_key_h + +#ifdef HAVE_RTREE_KEYS + +int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + uint key_length, uchar *page_buf, my_off_t *new_page); +int rtree_delete_key(MI_INFO *info, uchar *page, uchar *key, + uint key_length, uint nod_flag); +int rtree_set_key_mbr(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, + uint key_length, my_off_t child_page); + +#endif /*HAVE_RTREE_KEYS*/ +#endif /* _rt_key_h */ Added: trunk/src/rt_mbr.c =================================================================== --- trunk/src/rt_mbr.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/rt_mbr.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,803 @@ +/* Copyright (C) 2002-2004, 2006 MySQL AB & Ramil Kalimullin + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + +#ifdef HAVE_RTREE_KEYS + +#include "rt_index.h" +#include "rt_mbr.h" + +#define INTERSECT_CMP(amin, amax, bmin, bmax) ((amin > bmax) || (bmin > amax)) +#define CONTAIN_CMP(amin, amax, bmin, bmax) ((bmin > amin) || (bmax < amax)) +#define WITHIN_CMP(amin, amax, bmin, bmax) ((amin > bmin) || (amax < bmax)) +#define DISJOINT_CMP(amin, amax, bmin, bmax) ((amin <= bmax) && (bmin <= amax)) +#define EQUAL_CMP(amin, amax, bmin, bmax) ((amin != bmin) || (amax != bmax)) + +#define FCMP(A, B) ((int)(A) - (int)(B)) +#define p_inc(A, B, X) {A += X; B += X;} + +#define RT_CMP(nextflag) \ + if (nextflag & MBR_INTERSECT) \ + { \ + if (INTERSECT_CMP(amin, amax, bmin, bmax)) \ + return 1; \ + } \ + else if (nextflag & MBR_CONTAIN) \ + { \ + if (CONTAIN_CMP(amin, amax, bmin, bmax)) \ + return 1; \ + } \ + else if (nextflag & MBR_WITHIN) \ + { \ + if (WITHIN_CMP(amin, amax, bmin, bmax)) \ + return 1; \ + } \ + else if (nextflag & MBR_EQUAL) \ + { \ + if (EQUAL_CMP(amin, amax, bmin, bmax)) \ + return 1; \ + } \ + else if (nextflag & MBR_DISJOINT) \ + { \ + if (DISJOINT_CMP(amin, amax, bmin, bmax)) \ + return 1; \ + }\ + else /* if unknown comparison operator */ \ + { \ + DBUG_ASSERT(0); \ + } + +#define RT_CMP_KORR(type, korr_func, len, nextflag) \ +{ \ + type amin, amax, bmin, bmax; \ + amin = korr_func(a); \ + bmin = korr_func(b); \ + amax = korr_func(a+len); \ + bmax = korr_func(b+len); \ + RT_CMP(nextflag); \ +} + +#define RT_CMP_GET(type, get_func, len, nextflag) \ +{ \ + type amin, amax, bmin, bmax; \ + get_func(amin, a); \ + get_func(bmin, b); \ + get_func(amax, a+len); \ + get_func(bmax, b+len); \ + RT_CMP(nextflag); \ +} + +/* + Compares two keys a and b depending on nextflag + nextflag can contain these flags: + MBR_INTERSECT(a,b) a overlaps b + MBR_CONTAIN(a,b) a contains b + MBR_DISJOINT(a,b) a disjoint b + MBR_WITHIN(a,b) a within b + MBR_EQUAL(a,b) All coordinates of MBRs are equal + MBR_DATA(a,b) Data reference is the same + Returns 0 on success. +*/ +int rtree_key_cmp(HA_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length, + uint nextflag) +{ + for (; (int) key_length > 0; keyseg += 2 ) + { + uint32 keyseg_length; + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_INT8: + RT_CMP_KORR(int8, mi_sint1korr, 1, nextflag); + break; + case HA_KEYTYPE_BINARY: + RT_CMP_KORR(uint8, mi_uint1korr, 1, nextflag); + break; + case HA_KEYTYPE_SHORT_INT: + RT_CMP_KORR(int16, mi_sint2korr, 2, nextflag); + break; + case HA_KEYTYPE_USHORT_INT: + RT_CMP_KORR(uint16, mi_uint2korr, 2, nextflag); + break; + case HA_KEYTYPE_INT24: + RT_CMP_KORR(int32, mi_sint3korr, 3, nextflag); + break; + case HA_KEYTYPE_UINT24: + RT_CMP_KORR(uint32, mi_uint3korr, 3, nextflag); + break; + case HA_KEYTYPE_LONG_INT: + RT_CMP_KORR(int32, mi_sint4korr, 4, nextflag); + break; + case HA_KEYTYPE_ULONG_INT: + RT_CMP_KORR(uint32, mi_uint4korr, 4, nextflag); + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + RT_CMP_KORR(longlong, mi_sint8korr, 8, nextflag) + break; + case HA_KEYTYPE_ULONGLONG: + RT_CMP_KORR(ulonglong, mi_uint8korr, 8, nextflag) + break; +#endif + case HA_KEYTYPE_FLOAT: + /* The following should be safe, even if we compare doubles */ + RT_CMP_GET(float, mi_float4get, 4, nextflag); + break; + case HA_KEYTYPE_DOUBLE: + RT_CMP_GET(double, mi_float8get, 8, nextflag); + break; + case HA_KEYTYPE_END: + goto end; + default: + return 1; + } + keyseg_length= keyseg->length * 2; + key_length-= keyseg_length; + a+= keyseg_length; + b+= keyseg_length; + } + +end: + if (nextflag & MBR_DATA) + { + uchar *end = a + keyseg->length; + do + { + if (*a++ != *b++) + return FCMP(a[-1], b[-1]); + } while (a != end); + } + return 0; +} + +#define RT_VOL_KORR(type, korr_func, len, cast) \ +{ \ + type amin, amax; \ + amin = korr_func(a); \ + amax = korr_func(a+len); \ + res *= (cast(amax) - cast(amin)); \ +} + +#define RT_VOL_GET(type, get_func, len, cast) \ +{ \ + type amin, amax; \ + get_func(amin, a); \ + get_func(amax, a+len); \ + res *= (cast(amax) - cast(amin)); \ +} + +/* + Calculates rectangle volume +*/ +double rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length) +{ + double res = 1; + for (; (int)key_length > 0; keyseg += 2) + { + uint32 keyseg_length; + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_INT8: + RT_VOL_KORR(int8, mi_sint1korr, 1, (double)); + break; + case HA_KEYTYPE_BINARY: + RT_VOL_KORR(uint8, mi_uint1korr, 1, (double)); + break; + case HA_KEYTYPE_SHORT_INT: + RT_VOL_KORR(int16, mi_sint2korr, 2, (double)); + break; + case HA_KEYTYPE_USHORT_INT: + RT_VOL_KORR(uint16, mi_uint2korr, 2, (double)); + break; + case HA_KEYTYPE_INT24: + RT_VOL_KORR(int32, mi_sint3korr, 3, (double)); + break; + case HA_KEYTYPE_UINT24: + RT_VOL_KORR(uint32, mi_uint3korr, 3, (double)); + break; + case HA_KEYTYPE_LONG_INT: + RT_VOL_KORR(int32, mi_sint4korr, 4, (double)); + break; + case HA_KEYTYPE_ULONG_INT: + RT_VOL_KORR(uint32, mi_uint4korr, 4, (double)); + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + RT_VOL_KORR(longlong, mi_sint8korr, 8, (double)); + break; + case HA_KEYTYPE_ULONGLONG: + RT_VOL_KORR(longlong, mi_sint8korr, 8, ulonglong2double); + break; +#endif + case HA_KEYTYPE_FLOAT: + RT_VOL_GET(float, mi_float4get, 4, (double)); + break; + case HA_KEYTYPE_DOUBLE: + RT_VOL_GET(double, mi_float8get, 8, (double)); + break; + case HA_KEYTYPE_END: + key_length = 0; + break; + default: + return -1; + } + keyseg_length= keyseg->length * 2; + key_length-= keyseg_length; + a+= keyseg_length; + } + return res; +} + +#define RT_D_MBR_KORR(type, korr_func, len, cast) \ +{ \ + type amin, amax; \ + amin = korr_func(a); \ + amax = korr_func(a+len); \ + *res++ = cast(amin); \ + *res++ = cast(amax); \ +} + +#define RT_D_MBR_GET(type, get_func, len, cast) \ +{ \ + type amin, amax; \ + get_func(amin, a); \ + get_func(amax, a+len); \ + *res++ = cast(amin); \ + *res++ = cast(amax); \ +} + + +/* + Creates an MBR as an array of doubles. +*/ + +int rtree_d_mbr(HA_KEYSEG *keyseg, uchar *a, uint key_length, double *res) +{ + for (; (int)key_length > 0; keyseg += 2) + { + uint32 keyseg_length; + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_INT8: + RT_D_MBR_KORR(int8, mi_sint1korr, 1, (double)); + break; + case HA_KEYTYPE_BINARY: + RT_D_MBR_KORR(uint8, mi_uint1korr, 1, (double)); + break; + case HA_KEYTYPE_SHORT_INT: + RT_D_MBR_KORR(int16, mi_sint2korr, 2, (double)); + break; + case HA_KEYTYPE_USHORT_INT: + RT_D_MBR_KORR(uint16, mi_uint2korr, 2, (double)); + break; + case HA_KEYTYPE_INT24: + RT_D_MBR_KORR(int32, mi_sint3korr, 3, (double)); + break; + case HA_KEYTYPE_UINT24: + RT_D_MBR_KORR(uint32, mi_uint3korr, 3, (double)); + break; + case HA_KEYTYPE_LONG_INT: + RT_D_MBR_KORR(int32, mi_sint4korr, 4, (double)); + break; + case HA_KEYTYPE_ULONG_INT: + RT_D_MBR_KORR(uint32, mi_uint4korr, 4, (double)); + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + RT_D_MBR_KORR(longlong, mi_sint8korr, 8, (double)); + break; + case HA_KEYTYPE_ULONGLONG: + RT_D_MBR_KORR(longlong, mi_sint8korr, 8, ulonglong2double); + break; +#endif + case HA_KEYTYPE_FLOAT: + RT_D_MBR_GET(float, mi_float4get, 4, (double)); + break; + case HA_KEYTYPE_DOUBLE: + RT_D_MBR_GET(double, mi_float8get, 8, (double)); + break; + case HA_KEYTYPE_END: + key_length = 0; + break; + default: + return 1; + } + keyseg_length= keyseg->length * 2; + key_length-= keyseg_length; + a+= keyseg_length; + } + return 0; +} + +#define RT_COMB_KORR(type, korr_func, store_func, len) \ +{ \ + type amin, amax, bmin, bmax; \ + amin = korr_func(a); \ + bmin = korr_func(b); \ + amax = korr_func(a+len); \ + bmax = korr_func(b+len); \ + amin = min(amin, bmin); \ + amax = max(amax, bmax); \ + store_func(c, amin); \ + store_func(c+len, amax); \ +} + +#define RT_COMB_GET(type, get_func, store_func, len) \ +{ \ + type amin, amax, bmin, bmax; \ + get_func(amin, a); \ + get_func(bmin, b); \ + get_func(amax, a+len); \ + get_func(bmax, b+len); \ + amin = min(amin, bmin); \ + amax = max(amax, bmax); \ + store_func(c, amin); \ + store_func(c+len, amax); \ +} + +/* + Creates common minimal bounding rectungle + for two input rectagnles a and b + Result is written to c +*/ + +int rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c, + uint key_length) +{ + for ( ; (int) key_length > 0 ; keyseg += 2) + { + uint32 keyseg_length; + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_INT8: + RT_COMB_KORR(int8, mi_sint1korr, mi_int1store, 1); + break; + case HA_KEYTYPE_BINARY: + RT_COMB_KORR(uint8, mi_uint1korr, mi_int1store, 1); + break; + case HA_KEYTYPE_SHORT_INT: + RT_COMB_KORR(int16, mi_sint2korr, mi_int2store, 2); + break; + case HA_KEYTYPE_USHORT_INT: + RT_COMB_KORR(uint16, mi_uint2korr, mi_int2store, 2); + break; + case HA_KEYTYPE_INT24: + RT_COMB_KORR(int32, mi_sint3korr, mi_int3store, 3); + break; + case HA_KEYTYPE_UINT24: + RT_COMB_KORR(uint32, mi_uint3korr, mi_int3store, 3); + break; + case HA_KEYTYPE_LONG_INT: + RT_COMB_KORR(int32, mi_sint4korr, mi_int4store, 4); + break; + case HA_KEYTYPE_ULONG_INT: + RT_COMB_KORR(uint32, mi_uint4korr, mi_int4store, 4); + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + RT_COMB_KORR(longlong, mi_sint8korr, mi_int8store, 8); + break; + case HA_KEYTYPE_ULONGLONG: + RT_COMB_KORR(ulonglong, mi_uint8korr, mi_int8store, 8); + break; +#endif + case HA_KEYTYPE_FLOAT: + RT_COMB_GET(float, mi_float4get, mi_float4store, 4); + break; + case HA_KEYTYPE_DOUBLE: + RT_COMB_GET(double, mi_float8get, mi_float8store, 8); + break; + case HA_KEYTYPE_END: + return 0; + default: + return 1; + } + keyseg_length= keyseg->length * 2; + key_length-= keyseg_length; + a+= keyseg_length; + b+= keyseg_length; + c+= keyseg_length; + } + return 0; +} + + +#define RT_OVL_AREA_KORR(type, korr_func, len) \ +{ \ + type amin, amax, bmin, bmax; \ + amin = korr_func(a); \ + bmin = korr_func(b); \ + amax = korr_func(a+len); \ + bmax = korr_func(b+len); \ + amin = max(amin, bmin); \ + amax = min(amax, bmax); \ + if (amin >= amax) \ + return 0; \ + res *= amax - amin; \ +} + +#define RT_OVL_AREA_GET(type, get_func, len) \ +{ \ + type amin, amax, bmin, bmax; \ + get_func(amin, a); \ + get_func(bmin, b); \ + get_func(amax, a+len); \ + get_func(bmax, b+len); \ + amin = max(amin, bmin); \ + amax = min(amax, bmax); \ + if (amin >= amax) \ + return 0; \ + res *= amax - amin; \ +} + +/* +Calculates overlapping area of two MBRs a & b +*/ +double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar* a, uchar* b, + uint key_length) +{ + double res = 1; + for (; (int) key_length > 0 ; keyseg += 2) + { + uint32 keyseg_length; + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_INT8: + RT_OVL_AREA_KORR(int8, mi_sint1korr, 1); + break; + case HA_KEYTYPE_BINARY: + RT_OVL_AREA_KORR(uint8, mi_uint1korr, 1); + break; + case HA_KEYTYPE_SHORT_INT: + RT_OVL_AREA_KORR(int16, mi_sint2korr, 2); + break; + case HA_KEYTYPE_USHORT_INT: + RT_OVL_AREA_KORR(uint16, mi_uint2korr, 2); + break; + case HA_KEYTYPE_INT24: + RT_OVL_AREA_KORR(int32, mi_sint3korr, 3); + break; + case HA_KEYTYPE_UINT24: + RT_OVL_AREA_KORR(uint32, mi_uint3korr, 3); + break; + case HA_KEYTYPE_LONG_INT: + RT_OVL_AREA_KORR(int32, mi_sint4korr, 4); + break; + case HA_KEYTYPE_ULONG_INT: + RT_OVL_AREA_KORR(uint32, mi_uint4korr, 4); + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + RT_OVL_AREA_KORR(longlong, mi_sint8korr, 8); + break; + case HA_KEYTYPE_ULONGLONG: + RT_OVL_AREA_KORR(longlong, mi_sint8korr, 8); + break; +#endif + case HA_KEYTYPE_FLOAT: + RT_OVL_AREA_GET(float, mi_float4get, 4); + break; + case HA_KEYTYPE_DOUBLE: + RT_OVL_AREA_GET(double, mi_float8get, 8); + break; + case HA_KEYTYPE_END: + return res; + default: + return -1; + } + keyseg_length= keyseg->length * 2; + key_length-= keyseg_length; + a+= keyseg_length; + b+= keyseg_length; + } + return res; +} + +#define RT_AREA_INC_KORR(type, korr_func, len) \ +{ \ + type amin, amax, bmin, bmax; \ + amin = korr_func(a); \ + bmin = korr_func(b); \ + amax = korr_func(a+len); \ + bmax = korr_func(b+len); \ + a_area *= (((double)amax) - ((double)amin)); \ + loc_ab_area *= ((double)max(amax, bmax) - (double)min(amin, bmin)); \ +} + +#define RT_AREA_INC_GET(type, get_func, len)\ +{\ + type amin, amax, bmin, bmax; \ + get_func(amin, a); \ + get_func(bmin, b); \ + get_func(amax, a+len); \ + get_func(bmax, b+len); \ + a_area *= (((double)amax) - ((double)amin)); \ + loc_ab_area *= ((double)max(amax, bmax) - (double)min(amin, bmin)); \ +} + +/* +Calculates MBR_AREA(a+b) - MBR_AREA(a) +*/ +double rtree_area_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b, + uint key_length, double *ab_area) +{ + double a_area= 1.0; + double loc_ab_area= 1.0; + + *ab_area= 1.0; + for (; (int)key_length > 0; keyseg += 2) + { + uint32 keyseg_length; + + if (keyseg->null_bit) /* Handle NULL part */ + return -1; + + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_INT8: + RT_AREA_INC_KORR(int8, mi_sint1korr, 1); + break; + case HA_KEYTYPE_BINARY: + RT_AREA_INC_KORR(uint8, mi_uint1korr, 1); + break; + case HA_KEYTYPE_SHORT_INT: + RT_AREA_INC_KORR(int16, mi_sint2korr, 2); + break; + case HA_KEYTYPE_USHORT_INT: + RT_AREA_INC_KORR(uint16, mi_uint2korr, 2); + break; + case HA_KEYTYPE_INT24: + RT_AREA_INC_KORR(int32, mi_sint3korr, 3); + break; + case HA_KEYTYPE_UINT24: + RT_AREA_INC_KORR(int32, mi_uint3korr, 3); + break; + case HA_KEYTYPE_LONG_INT: + RT_AREA_INC_KORR(int32, mi_sint4korr, 4); + break; + case HA_KEYTYPE_ULONG_INT: + RT_AREA_INC_KORR(uint32, mi_uint4korr, 4); + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + RT_AREA_INC_KORR(longlong, mi_sint8korr, 8); + break; + case HA_KEYTYPE_ULONGLONG: + RT_AREA_INC_KORR(longlong, mi_sint8korr, 8); + break; +#endif + case HA_KEYTYPE_FLOAT: + RT_AREA_INC_GET(float, mi_float4get, 4); + break; + case HA_KEYTYPE_DOUBLE: + RT_AREA_INC_GET(double, mi_float8get, 8); + break; + case HA_KEYTYPE_END: + goto safe_end; + default: + return -1; + } + keyseg_length= keyseg->length * 2; + key_length-= keyseg_length; + a+= keyseg_length; + b+= keyseg_length; + } +safe_end: + *ab_area= loc_ab_area; + return loc_ab_area - a_area; +} + +#define RT_PERIM_INC_KORR(type, korr_func, len) \ +{ \ + type amin, amax, bmin, bmax; \ + amin = korr_func(a); \ + bmin = korr_func(b); \ + amax = korr_func(a+len); \ + bmax = korr_func(b+len); \ + a_perim+= (((double)amax) - ((double)amin)); \ + *ab_perim+= ((double)max(amax, bmax) - (double)min(amin, bmin)); \ +} + +#define RT_PERIM_INC_GET(type, get_func, len)\ +{\ + type amin, amax, bmin, bmax; \ + get_func(amin, a); \ + get_func(bmin, b); \ + get_func(amax, a+len); \ + get_func(bmax, b+len); \ + a_perim+= (((double)amax) - ((double)amin)); \ + *ab_perim+= ((double)max(amax, bmax) - (double)min(amin, bmin)); \ +} + +/* +Calculates MBR_PERIMETER(a+b) - MBR_PERIMETER(a) +*/ +double rtree_perimeter_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b, + uint key_length, double *ab_perim) +{ + double a_perim = 0.0; + + *ab_perim= 0.0; + for (; (int)key_length > 0; keyseg += 2) + { + uint32 keyseg_length; + + if (keyseg->null_bit) /* Handle NULL part */ + return -1; + + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_INT8: + RT_PERIM_INC_KORR(int8, mi_sint1korr, 1); + break; + case HA_KEYTYPE_BINARY: + RT_PERIM_INC_KORR(uint8, mi_uint1korr, 1); + break; + case HA_KEYTYPE_SHORT_INT: + RT_PERIM_INC_KORR(int16, mi_sint2korr, 2); + break; + case HA_KEYTYPE_USHORT_INT: + RT_PERIM_INC_KORR(uint16, mi_uint2korr, 2); + break; + case HA_KEYTYPE_INT24: + RT_PERIM_INC_KORR(int32, mi_sint3korr, 3); + break; + case HA_KEYTYPE_UINT24: + RT_PERIM_INC_KORR(int32, mi_uint3korr, 3); + break; + case HA_KEYTYPE_LONG_INT: + RT_PERIM_INC_KORR(int32, mi_sint4korr, 4); + break; + case HA_KEYTYPE_ULONG_INT: + RT_PERIM_INC_KORR(uint32, mi_uint4korr, 4); + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + RT_PERIM_INC_KORR(longlong, mi_sint8korr, 8); + break; + case HA_KEYTYPE_ULONGLONG: + RT_PERIM_INC_KORR(longlong, mi_sint8korr, 8); + break; +#endif + case HA_KEYTYPE_FLOAT: + RT_PERIM_INC_GET(float, mi_float4get, 4); + break; + case HA_KEYTYPE_DOUBLE: + RT_PERIM_INC_GET(double, mi_float8get, 8); + break; + case HA_KEYTYPE_END: + return *ab_perim - a_perim; + default: + return -1; + } + keyseg_length= keyseg->length * 2; + key_length-= keyseg_length; + a+= keyseg_length; + b+= keyseg_length; + } + return *ab_perim - a_perim; +} + + +#define RT_PAGE_MBR_KORR(type, korr_func, store_func, len) \ +{ \ + type amin, amax, bmin, bmax; \ + amin = korr_func(k + inc); \ + amax = korr_func(k + inc + len); \ + k = rt_PAGE_NEXT_KEY(k, k_len, nod_flag); \ + for (; k < last; k = rt_PAGE_NEXT_KEY(k, k_len, nod_flag)) \ +{ \ + bmin = korr_func(k + inc); \ + bmax = korr_func(k + inc + len); \ + if (amin > bmin) \ + amin = bmin; \ + if (amax < bmax) \ + amax = bmax; \ +} \ + store_func(c, amin); \ + c += len; \ + store_func(c, amax); \ + c += len; \ + inc += 2 * len; \ +} + +#define RT_PAGE_MBR_GET(type, get_func, store_func, len) \ +{ \ + type amin, amax, bmin, bmax; \ + get_func(amin, k + inc); \ + get_func(amax, k + inc + len); \ + k = rt_PAGE_NEXT_KEY(k, k_len, nod_flag); \ + for (; k < last; k = rt_PAGE_NEXT_KEY(k, k_len, nod_flag)) \ +{ \ + get_func(bmin, k + inc); \ + get_func(bmax, k + inc + len); \ + if (amin > bmin) \ + amin = bmin; \ + if (amax < bmax) \ + amax = bmax; \ +} \ + store_func(c, amin); \ + c += len; \ + store_func(c, amax); \ + c += len; \ + inc += 2 * len; \ +} + +/* +Calculates key page total MBR = MBR(key1) + MBR(key2) + ... +*/ +int rtree_page_mbr(MI_INFO *info, HA_KEYSEG *keyseg, uchar *page_buf, + uchar *c, uint key_length) +{ + uint inc = 0; + uint k_len = key_length; + uint nod_flag = mi_test_if_nod(page_buf); + uchar *k; + uchar *last = rt_PAGE_END(page_buf); + + for (; (int)key_length > 0; keyseg += 2) + { + key_length -= keyseg->length * 2; + + /* Handle NULL part */ + if (keyseg->null_bit) + { + return 1; + } + + k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); + + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_INT8: + RT_PAGE_MBR_KORR(int8, mi_sint1korr, mi_int1store, 1); + break; + case HA_KEYTYPE_BINARY: + RT_PAGE_MBR_KORR(uint8, mi_uint1korr, mi_int1store, 1); + break; + case HA_KEYTYPE_SHORT_INT: + RT_PAGE_MBR_KORR(int16, mi_sint2korr, mi_int2store, 2); + break; + case HA_KEYTYPE_USHORT_INT: + RT_PAGE_MBR_KORR(uint16, mi_uint2korr, mi_int2store, 2); + break; + case HA_KEYTYPE_INT24: + RT_PAGE_MBR_KORR(int32, mi_sint3korr, mi_int3store, 3); + break; + case HA_KEYTYPE_UINT24: + RT_PAGE_MBR_KORR(uint32, mi_uint3korr, mi_int3store, 3); + break; + case HA_KEYTYPE_LONG_INT: + RT_PAGE_MBR_KORR(int32, mi_sint4korr, mi_int4store, 4); + break; + case HA_KEYTYPE_ULONG_INT: + RT_PAGE_MBR_KORR(uint32, mi_uint4korr, mi_int4store, 4); + break; +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + RT_PAGE_MBR_KORR(longlong, mi_sint8korr, mi_int8store, 8); + break; + case HA_KEYTYPE_ULONGLONG: + RT_PAGE_MBR_KORR(ulonglong, mi_uint8korr, mi_int8store, 8); + break; +#endif + case HA_KEYTYPE_FLOAT: + RT_PAGE_MBR_GET(float, mi_float4get, mi_float4store, 4); + break; + case HA_KEYTYPE_DOUBLE: + RT_PAGE_MBR_GET(double, mi_float8get, mi_float8store, 8); + break; + case HA_KEYTYPE_END: + return 0; + default: + return 1; + } + } + return 0; +} + +#endif /*HAVE_RTREE_KEYS*/ Added: trunk/src/rt_mbr.h =================================================================== --- trunk/src/rt_mbr.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/rt_mbr.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,36 @@ +/* Copyright (C) 2002, 2004 MySQL AB & Ramil Kalimullin + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _rt_mbr_h +#define _rt_mbr_h + +#ifdef HAVE_RTREE_KEYS + +int rtree_key_cmp(HA_KEYSEG *keyseg, uchar *a, uchar *b, uint key_length, + uint nextflag); +int rtree_combine_rect(HA_KEYSEG *keyseg,uchar *, uchar *, uchar*, + uint key_length); +double rtree_rect_volume(HA_KEYSEG *keyseg, uchar*, uint key_length); +int rtree_d_mbr(HA_KEYSEG *keyseg, uchar *a, uint key_length, double *res); +double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar *a, uchar *b, + uint key_length); +double rtree_area_increase(HA_KEYSEG *keyseg, uchar *a, uchar *b, + uint key_length, double *ab_area); +double rtree_perimeter_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b, + uint key_length, double *ab_perim); +int rtree_page_mbr(MI_INFO *info, HA_KEYSEG *keyseg, uchar *page_buf, + uchar* c, uint key_length); +#endif /*HAVE_RTREE_KEYS*/ +#endif /* _rt_mbr_h */ Added: trunk/src/rt_split.c =================================================================== --- trunk/src/rt_split.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/rt_split.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,355 @@ +/* Copyright (C) 2002-2005 MySQL AB & Alexey Botchkov + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + +#ifdef HAVE_RTREE_KEYS + +#include "rt_index.h" +#include "rt_key.h" +#include "rt_mbr.h" + +typedef struct +{ + double square; + int n_node; + uchar *key; + double *coords; +} SplitStruct; + +inline static double *reserve_coords(double **d_buffer, int n_dim) +{ + double *coords = *d_buffer; + (*d_buffer) += n_dim * 2; + return coords; +} + +static void mbr_join(double *a, const double *b, int n_dim) +{ + double *end = a + n_dim * 2; + do + { + if (a[0] > b[0]) + a[0] = b[0]; + + if (a[1] < b[1]) + a[1] = b[1]; + + a += 2; + b += 2; + }while (a != end); +} + +/* +Counts the square of mbr which is a join of a and b +*/ +static double mbr_join_square(const double *a, const double *b, int n_dim) +{ + const double *end = a + n_dim * 2; + double square = 1.0; + do + { + square *= + ((a[1] < b[1]) ? b[1] : a[1]) - ((a[0] > b[0]) ? b[0] : a[0]); + + a += 2; + b += 2; + }while (a != end); + + return square; +} + +static double count_square(const double *a, int n_dim) +{ + const double *end = a + n_dim * 2; + double square = 1.0; + do + { + square *= a[1] - a[0]; + a += 2; + }while (a != end); + return square; +} + +inline static void copy_coords(double *dst, const double *src, int n_dim) +{ + memcpy(dst, src, sizeof(double) * (n_dim * 2)); +} + +/* +Select two nodes to collect group upon +*/ +static void pick_seeds(SplitStruct *node, int n_entries, + SplitStruct **seed_a, SplitStruct **seed_b, int n_dim) +{ + SplitStruct *cur1; + SplitStruct *lim1 = node + (n_entries - 1); + SplitStruct *cur2; + SplitStruct *lim2 = node + n_entries; + + double max_d = -DBL_MAX; + double d; + + for (cur1 = node; cur1 < lim1; ++cur1) + { + for (cur2=cur1 + 1; cur2 < lim2; ++cur2) + { + + d = mbr_join_square(cur1->coords, cur2->coords, n_dim) - cur1->square - + cur2->square; + if (d > max_d) + { + max_d = d; + *seed_a = cur1; + *seed_b = cur2; + } + } + } +} + +/* +Select next node and group where to add +*/ +static void pick_next(SplitStruct *node, int n_entries, double *g1, double *g2, + SplitStruct **choice, int *n_group, int n_dim) +{ + SplitStruct *cur = node; + SplitStruct *end = node + n_entries; + + double max_diff = -DBL_MAX; + + for (; curn_node) + { + continue; + } + + diff = mbr_join_square(g1, cur->coords, n_dim) - + mbr_join_square(g2, cur->coords, n_dim); + + abs_diff = fabs(diff); + if (abs_diff > max_diff) + { + max_diff = abs_diff; + *n_group = 1 + (diff > 0); + *choice = cur; + } + } +} + +/* +Mark not-in-group entries as n_group +*/ +static void mark_all_entries(SplitStruct *node, int n_entries, int n_group) +{ + SplitStruct *cur = node; + SplitStruct *end = node + n_entries; + for (; curn_node) + { + continue; + } + cur->n_node = n_group; + } +} + +static int split_rtree_node(SplitStruct *node, int n_entries, + int all_size, /* Total key's size */ + int key_size, + int min_size, /* Minimal group size */ + int size1, int size2 /* initial group sizes */, + double **d_buffer, int n_dim) +{ + SplitStruct *cur; + SplitStruct *a; + SplitStruct *b; + double *g1 = reserve_coords(d_buffer, n_dim); + double *g2 = reserve_coords(d_buffer, n_dim); + SplitStruct *next; + int next_node; + int i; + SplitStruct *end = node + n_entries; + LINT_INIT(a); + LINT_INIT(b); + LINT_INIT(next); + LINT_INIT(next_node); + + if (all_size < min_size * 2) + { + return 1; + } + + cur = node; + for (; cursquare = count_square(cur->coords, n_dim); + cur->n_node = 0; + } + + pick_seeds(node, n_entries, &a, &b, n_dim); + a->n_node = 1; + b->n_node = 2; + + + copy_coords(g1, a->coords, n_dim); + size1 += key_size; + copy_coords(g2, b->coords, n_dim); + size2 += key_size; + + + for (i=n_entries - 2; i>0; --i) + { + if (all_size - (size2 + key_size) < min_size) /* Can't write into group 2 */ + { + mark_all_entries(node, n_entries, 1); + break; + } + + if (all_size - (size1 + key_size) < min_size) /* Can't write into group 1 */ + { + mark_all_entries(node, n_entries, 2); + break; + } + + pick_next(node, n_entries, g1, g2, &next, &next_node, n_dim); + if (next_node == 1) + { + size1 += key_size; + mbr_join(g1, next->coords, n_dim); + } + else + { + size2 += key_size; + mbr_join(g2, next->coords, n_dim); + } + next->n_node = next_node; + } + + return 0; +} + +int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, + uint key_length, my_off_t *new_page_offs) +{ + int n1, n2; /* Number of items in groups */ + + SplitStruct *task; + SplitStruct *cur; + SplitStruct *stop; + double *coord_buf; + double *next_coord; + double *old_coord; + int n_dim; + uchar *source_cur, *cur1, *cur2; + uchar *new_page; + int err_code= 0; + uint nod_flag= mi_test_if_nod(page); + uint full_length= key_length + (nod_flag ? nod_flag : + info->s->base.rec_reflength); + int max_keys= (mi_getint(page)-2) / (full_length); + DBUG_ENTER("rtree_split_page"); + DBUG_PRINT("rtree", ("splitting block")); + + n_dim = keyinfo->keysegs / 2; + + if (!(coord_buf= (double*) my_alloca(n_dim * 2 * sizeof(double) * + (max_keys + 1 + 4) + + sizeof(SplitStruct) * (max_keys + 1)))) + DBUG_RETURN(-1); /* purecov: inspected */ + + task= (SplitStruct *)(coord_buf + n_dim * 2 * (max_keys + 1 + 4)); + + next_coord = coord_buf; + + stop = task + max_keys; + source_cur = rt_PAGE_FIRST_KEY(page, nod_flag); + + for (cur = task; cur < stop; ++cur, source_cur = rt_PAGE_NEXT_KEY(source_cur, + key_length, nod_flag)) + { + cur->coords = reserve_coords(&next_coord, n_dim); + cur->key = source_cur; + rtree_d_mbr(keyinfo->seg, source_cur, key_length, cur->coords); + } + + cur->coords = reserve_coords(&next_coord, n_dim); + rtree_d_mbr(keyinfo->seg, key, key_length, cur->coords); + cur->key = key; + + old_coord = next_coord; + + if (split_rtree_node(task, max_keys + 1, + mi_getint(page) + full_length + 2, full_length, + rt_PAGE_MIN_SIZE(keyinfo->block_length), + 2, 2, &next_coord, n_dim)) + { + err_code = 1; + goto split_err; + } + + if (!(new_page = (uchar*)my_alloca((uint)keyinfo->block_length))) + { + err_code= -1; + goto split_err; + } + + stop = task + (max_keys + 1); + cur1 = rt_PAGE_FIRST_KEY(page, nod_flag); + cur2 = rt_PAGE_FIRST_KEY(new_page, nod_flag); + + n1= n2 = 0; + for (cur = task; cur < stop; ++cur) + { + uchar *to; + if (cur->n_node == 1) + { + to = cur1; + cur1 = rt_PAGE_NEXT_KEY(cur1, key_length, nod_flag); + ++n1; + } + else + { + to = cur2; + cur2 = rt_PAGE_NEXT_KEY(cur2, key_length, nod_flag); + ++n2; + } + if (to != cur->key) + memcpy(to - nod_flag, cur->key - nod_flag, full_length); + } + + mi_putint(page, 2 + n1 * full_length, nod_flag); + mi_putint(new_page, 2 + n2 * full_length, nod_flag); + + if ((*new_page_offs= _mi_new(info, keyinfo, DFLT_INIT_HITS)) == + HA_OFFSET_ERROR) + err_code= -1; + else + err_code= _mi_write_keypage(info, keyinfo, *new_page_offs, + DFLT_INIT_HITS, new_page); + DBUG_PRINT("rtree", ("split new block: %lu", (ulong) *new_page_offs)); + + my_afree((uchar*)new_page); + +split_err: + my_afree((uchar*) coord_buf); + DBUG_RETURN(err_code); +} + +#endif /*HAVE_RTREE_KEYS*/ Added: trunk/src/rt_test.c =================================================================== --- trunk/src/rt_test.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/rt_test.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,470 @@ +/* Copyright (C) 2002-2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Testing of the basic functions of a MyISAM rtree table */ +/* Written by Alex Barkov who has a shared copyright to this code */ + + +#include "myisam.h" + +#ifdef HAVE_RTREE_KEYS + +#include "rt_index.h" + +#define MAX_REC_LENGTH 1024 +#define ndims 2 +#define KEYALG HA_KEY_ALG_RTREE + +static int read_with_pos(MI_INFO * file, int silent); +static void create_record(uchar *record,uint rownr); +static void create_record1(uchar *record,uint rownr); +static void print_record(uchar * record,my_off_t offs,const char * tail); +static int run_test(const char *filename); + +static double rt_data[]= +{ + /*1*/ 0,10,0,10, + /*2*/ 5,15,0,10, + /*3*/ 0,10,5,15, + /*4*/ 10,20,10,20, + /*5*/ 0,10,0,10, + /*6*/ 5,15,0,10, + /*7*/ 0,10,5,15, + /*8*/ 10,20,10,20, + /*9*/ 0,10,0,10, + /*10*/ 5,15,0,10, + /*11*/ 0,10,5,15, + /*12*/ 10,20,10,20, + /*13*/ 0,10,0,10, + /*14*/ 5,15,0,10, + /*15*/ 0,10,5,15, + /*16*/ 10,20,10,20, + /*17*/ 5,15,0,10, + /*18*/ 0,10,5,15, + /*19*/ 10,20,10,20, + /*20*/ 0,10,0,10, + + /*1*/ 100,110,0,10, + /*2*/ 105,115,0,10, + /*3*/ 100,110,5,15, + /*4*/ 110,120,10,20, + /*5*/ 100,110,0,10, + /*6*/ 105,115,0,10, + /*7*/ 100,110,5,15, + /*8*/ 110,120,10,20, + /*9*/ 100,110,0,10, + /*10*/ 105,115,0,10, + /*11*/ 100,110,5,15, + /*12*/ 110,120,10,20, + /*13*/ 100,110,0,10, + /*14*/ 105,115,0,10, + /*15*/ 100,110,5,15, + /*16*/ 110,120,10,20, + /*17*/ 105,115,0,10, + /*18*/ 100,110,5,15, + /*19*/ 110,120,10,20, + /*20*/ 100,110,0,10, + -1 +}; + +int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused))) +{ + MY_INIT(argv[0]); + exit(run_test("rt_test")); +} + + +static int run_test(const char *filename) +{ + MI_INFO *file; + MI_UNIQUEDEF uniquedef; + MI_CREATE_INFO create_info; + MI_COLUMNDEF recinfo[20]; + MI_KEYDEF keyinfo[20]; + HA_KEYSEG keyseg[20]; + key_range range; + + int silent=0; + int opt_unique=0; + int create_flag=0; + int key_type=HA_KEYTYPE_DOUBLE; + int key_length=8; + int null_fields=0; + int nrecords=sizeof(rt_data)/(sizeof(double)*4);/* 3000;*/ + int rec_length=0; + int uniques=0; + int i; + int error; + int row_count=0; + uchar record[MAX_REC_LENGTH]; + uchar read_record[MAX_REC_LENGTH]; + int upd= 10; + ha_rows hrows; + + /* Define a column for NULLs and DEL markers*/ + + recinfo[0].type=FIELD_NORMAL; + recinfo[0].length=1; /* For NULL bits */ + rec_length=1; + + /* Define 2*ndims columns for coordinates*/ + + for (i=1; i<=2*ndims ;i++){ + recinfo[i].type=FIELD_NORMAL; + recinfo[i].length=key_length; + rec_length+=key_length; + } + + /* Define a key with 2*ndims segments */ + + keyinfo[0].seg=keyseg; + keyinfo[0].keysegs=2*ndims; + keyinfo[0].flag=0; + keyinfo[0].key_alg=KEYALG; + + for (i=0; i<2*ndims; i++){ + keyinfo[0].seg[i].type= key_type; + keyinfo[0].seg[i].flag=0; /* Things like HA_REVERSE_SORT */ + keyinfo[0].seg[i].start= (key_length*i)+1; + keyinfo[0].seg[i].length=key_length; + keyinfo[0].seg[i].null_bit= null_fields ? 2 : 0; + keyinfo[0].seg[i].null_pos=0; + keyinfo[0].seg[i].language=default_charset_info->number; + } + + if (!silent) + printf("- Creating isam-file\n"); + + bzero((char*) &create_info,sizeof(create_info)); + create_info.max_rows=10000000; + + if (mi_create(filename, + 1, /* keys */ + keyinfo, + 1+2*ndims+opt_unique, /* columns */ + recinfo,uniques,&uniquedef,&create_info,create_flag)) + goto err; + + if (!silent) + printf("- Open isam-file\n"); + + if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED))) + goto err; + + if (!silent) + printf("- Writing key:s\n"); + + for (i=0; i "); + print_record(record,mi_position(file),"\n"); + error=mi_update(file,read_record,record); + if (error) + { + printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno); + goto err; + } + } + + if ((error=read_with_pos(file,silent))) + goto err; + + if (!silent) + printf("- Test mi_rkey then a sequence of mi_rnext_same\n"); + + create_record(record, nrecords*4/5); + print_record(record,0," search for\n"); + + if ((error=mi_rkey(file,read_record,0,record+1,0,HA_READ_MBR_INTERSECT))) + { + printf("mi_rkey: %3d errno: %3d\n",error,my_errno); + goto err; + } + print_record(read_record,mi_position(file)," mi_rkey\n"); + row_count=1; + + for (;;) + { + if ((error=mi_rnext_same(file,read_record))) + { + if (error==HA_ERR_END_OF_FILE) + break; + printf("mi_next: %3d errno: %3d\n",error,my_errno); + goto err; + } + print_record(read_record,mi_position(file)," mi_rnext_same\n"); + row_count++; + } + printf(" %d rows\n",row_count); + + if (!silent) + printf("- Test mi_rfirst then a sequence of mi_rnext\n"); + + error=mi_rfirst(file,read_record,0); + if (error) + { + printf("mi_rfirst: %3d errno: %3d\n",error,my_errno); + goto err; + } + row_count=1; + print_record(read_record,mi_position(file)," mi_frirst\n"); + + for (i=0;i +#else +#include +#endif +#include + +/* static variables */ + +#undef MIN_SORT_MEMORY +#undef MYF_RW +#undef DISK_BUFFER_SIZE + +#define MERGEBUFF 15 +#define MERGEBUFF2 31 +#define MIN_SORT_MEMORY (4096-MALLOC_OVERHEAD) +#define MYF_RW MYF(MY_NABP | MY_WME | MY_WAIT_IF_FULL) +#define DISK_BUFFER_SIZE (IO_SIZE*16) + + +/* + Pointers of functions for store and read keys from temp file +*/ + +extern void print_error _VARARGS((const char *fmt,...)); + +/* Functions defined in this file */ + +static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info,uint keys, + uchar **sort_keys, + DYNAMIC_ARRAY *buffpek,int *maxbuffer, + IO_CACHE *tempfile, + IO_CACHE *tempfile_for_exceptions); +static int NEAR_F write_keys(MI_SORT_PARAM *info,uchar **sort_keys, + uint count, BUFFPEK *buffpek,IO_CACHE *tempfile); +static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key, + IO_CACHE *tempfile); +static int NEAR_F write_index(MI_SORT_PARAM *info,uchar * *sort_keys, + uint count); +static int NEAR_F merge_many_buff(MI_SORT_PARAM *info,uint keys, + uchar * *sort_keys, + BUFFPEK *buffpek,int *maxbuffer, + IO_CACHE *t_file); +static uint NEAR_F read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek, + uint sort_length); +static int NEAR_F merge_buffers(MI_SORT_PARAM *info,uint keys, + IO_CACHE *from_file, IO_CACHE *to_file, + uchar * *sort_keys, BUFFPEK *lastbuff, + BUFFPEK *Fb, BUFFPEK *Tb); +static int NEAR_F merge_index(MI_SORT_PARAM *,uint,uchar **,BUFFPEK *, int, + IO_CACHE *); +static int flush_ft_buf(MI_SORT_PARAM *info); + +static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,uchar **sort_keys, + uint count, BUFFPEK *buffpek, + IO_CACHE *tempfile); +static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile,BUFFPEK *buffpek, + uint sort_length); +static int NEAR_F write_merge_key(MI_SORT_PARAM *info, IO_CACHE *to_file, + uchar *key, uint sort_length, uint count); +static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info, + IO_CACHE *to_file, + uchar* key, uint sort_length, + uint count); +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs); + +/* + Creates a index of sorted keys + + SYNOPSIS + _create_index_by_sort() + info Sort parameters + no_messages Set to 1 if no output + sortbuff_size Size if sortbuffer to allocate + + RESULT + 0 ok + <> 0 Error +*/ + +int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, + ulong sortbuff_size) +{ + int error,maxbuffer,skr; + uint memavl,old_memavl,keys,sort_length; + DYNAMIC_ARRAY buffpek; + ha_rows records; + uchar **sort_keys; + IO_CACHE tempfile, tempfile_for_exceptions; + DBUG_ENTER("_create_index_by_sort"); + DBUG_PRINT("enter",("sort_length: %d", info->key_length)); + + if (info->keyinfo->flag & HA_VAR_LENGTH_KEY) + { + info->write_keys=write_keys_varlen; + info->read_to_buffer=read_to_buffer_varlen; + info->write_key= write_merge_key_varlen; + } + else + { + info->write_keys=write_keys; + info->read_to_buffer=read_to_buffer; + info->write_key=write_merge_key; + } + + my_b_clear(&tempfile); + my_b_clear(&tempfile_for_exceptions); + bzero((char*) &buffpek,sizeof(buffpek)); + sort_keys= (uchar **) NULL; error= 1; + maxbuffer=1; + + memavl=max(sortbuff_size,MIN_SORT_MEMORY); + records= info->sort_info->max_records; + sort_length= info->key_length; + LINT_INIT(keys); + + while (memavl >= MIN_SORT_MEMORY) + { + if ((records < UINT_MAX32) && + ((my_off_t) (records + 1) * + (sort_length + sizeof(char*)) <= (my_off_t) memavl)) + keys= records+1; + else + do + { + skr=maxbuffer; + if (memavl < sizeof(BUFFPEK)*(uint) maxbuffer || + (keys=(memavl-sizeof(BUFFPEK)*(uint) maxbuffer)/ + (sort_length+sizeof(char*))) <= 1 || + keys < (uint) maxbuffer) + { + mi_check_print_error(info->sort_info->param, + "myisam_sort_buffer_size is too small"); + goto err; + } + } + while ((maxbuffer= (int) (records/(keys-1)+1)) != skr); + + if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+ + HA_FT_MAXBYTELEN, MYF(0)))) + { + if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, + maxbuffer/2)) + { + my_free((uchar*) sort_keys,MYF(0)); + sort_keys= 0; + } + else + break; + } + old_memavl=memavl; + if ((memavl=memavl/4*3) < MIN_SORT_MEMORY && old_memavl > MIN_SORT_MEMORY) + memavl=MIN_SORT_MEMORY; + } + if (memavl < MIN_SORT_MEMORY) + { + mi_check_print_error(info->sort_info->param,"MyISAM sort buffer too small"); /* purecov: tested */ + goto err; /* purecov: tested */ + } + (*info->lock_in_memory)(info->sort_info->param);/* Everything is allocated */ + + if (!no_messages) + printf(" - Searching for keys, allocating buffer for %d keys\n",keys); + + if ((records=find_all_keys(info,keys,sort_keys,&buffpek,&maxbuffer, + &tempfile,&tempfile_for_exceptions)) + == HA_POS_ERROR) + goto err; /* purecov: tested */ + if (maxbuffer == 0) + { + if (!no_messages) + printf(" - Dumping %lu keys\n", (ulong) records); + if (write_index(info,sort_keys, (uint) records)) + goto err; /* purecov: inspected */ + } + else + { + keys=(keys*(sort_length+sizeof(char*)))/sort_length; + if (maxbuffer >= MERGEBUFF2) + { + if (!no_messages) + printf(" - Merging %lu keys\n", (ulong) records); /* purecov: tested */ + if (merge_many_buff(info,keys,sort_keys, + dynamic_element(&buffpek,0,BUFFPEK *),&maxbuffer,&tempfile)) + goto err; /* purecov: inspected */ + } + if (flush_io_cache(&tempfile) || + reinit_io_cache(&tempfile,READ_CACHE,0L,0,0)) + goto err; /* purecov: inspected */ + if (!no_messages) + printf(" - Last merge and dumping keys\n"); /* purecov: tested */ + if (merge_index(info,keys,sort_keys,dynamic_element(&buffpek,0,BUFFPEK *), + maxbuffer,&tempfile)) + goto err; /* purecov: inspected */ + } + + if (flush_ft_buf(info) || flush_pending_blocks(info)) + goto err; + + if (my_b_inited(&tempfile_for_exceptions)) + { + MI_INFO *idx=info->sort_info->info; + uint keyno=info->key; + uint key_length, ref_length=idx->s->rec_reflength; + + if (!no_messages) + printf(" - Adding exceptions\n"); /* purecov: tested */ + if (flush_io_cache(&tempfile_for_exceptions) || + reinit_io_cache(&tempfile_for_exceptions,READ_CACHE,0L,0,0)) + goto err; + + while (!my_b_read(&tempfile_for_exceptions,(uchar*)&key_length, + sizeof(key_length)) + && !my_b_read(&tempfile_for_exceptions,(uchar*)sort_keys, + (uint) key_length)) + { + if (_mi_ck_write(idx,keyno,(uchar*) sort_keys,key_length-ref_length)) + goto err; + } + } + + error =0; + +err: + if (sort_keys) + my_free((uchar*) sort_keys,MYF(0)); + delete_dynamic(&buffpek); + close_cached_file(&tempfile); + close_cached_file(&tempfile_for_exceptions); + + DBUG_RETURN(error ? -1 : 0); +} /* _create_index_by_sort */ + + +/* Search after all keys and place them in a temp. file */ + +static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys, + uchar **sort_keys, DYNAMIC_ARRAY *buffpek, + int *maxbuffer, IO_CACHE *tempfile, + IO_CACHE *tempfile_for_exceptions) +{ + int error; + uint idx; + DBUG_ENTER("find_all_keys"); + + idx=error=0; + sort_keys[0]=(uchar*) (sort_keys+keys); + + while (!(error=(*info->key_read)(info,sort_keys[idx]))) + { + if (info->real_key_length > info->key_length) + { + if (write_key(info,sort_keys[idx],tempfile_for_exceptions)) + DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ + continue; + } + + if (++idx == keys) + { + if (info->write_keys(info,sort_keys,idx-1,(BUFFPEK *)alloc_dynamic(buffpek), + tempfile)) + DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ + + sort_keys[0]=(uchar*) (sort_keys+keys); + memcpy(sort_keys[0],sort_keys[idx-1],(size_t) info->key_length); + idx=1; + } + sort_keys[idx]=sort_keys[idx-1]+info->key_length; + } + if (error > 0) + DBUG_RETURN(HA_POS_ERROR); /* Aborted by get_key */ /* purecov: inspected */ + if (buffpek->elements) + { + if (info->write_keys(info,sort_keys,idx,(BUFFPEK *)alloc_dynamic(buffpek), + tempfile)) + DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ + *maxbuffer=buffpek->elements-1; + } + else + *maxbuffer=0; + + DBUG_RETURN((*maxbuffer)*(keys-1)+idx); +} /* find_all_keys */ + + +#ifdef THREAD +/* Search after all keys and place them in a temp. file */ + +pthread_handler_t thr_find_all_keys(void *arg) +{ + MI_SORT_PARAM *sort_param= (MI_SORT_PARAM*) arg; + int error; + uint memavl,old_memavl,keys,sort_length; + uint idx, maxbuffer; + uchar **sort_keys=0; + + LINT_INIT(keys); + + error=1; + + if (my_thread_init()) + goto err; + + { /* Add extra block since DBUG_ENTER declare variables */ + DBUG_ENTER("thr_find_all_keys"); + DBUG_PRINT("enter", ("master: %d", sort_param->master)); + if (sort_param->sort_info->got_error) + goto err; + + if (sort_param->keyinfo->flag & HA_VAR_LENGTH_KEY) + { + sort_param->write_keys= write_keys_varlen; + sort_param->read_to_buffer= read_to_buffer_varlen; + sort_param->write_key= write_merge_key_varlen; + } + else + { + sort_param->write_keys= write_keys; + sort_param->read_to_buffer= read_to_buffer; + sort_param->write_key= write_merge_key; + } + + my_b_clear(&sort_param->tempfile); + my_b_clear(&sort_param->tempfile_for_exceptions); + bzero((char*) &sort_param->buffpek, sizeof(sort_param->buffpek)); + bzero((char*) &sort_param->unique, sizeof(sort_param->unique)); + sort_keys= (uchar **) NULL; + + memavl= max(sort_param->sortbuff_size, MIN_SORT_MEMORY); + idx= sort_param->sort_info->max_records; + sort_length= sort_param->key_length; + maxbuffer= 1; + + while (memavl >= MIN_SORT_MEMORY) + { + if ((my_off_t) (idx+1)*(sort_length+sizeof(char*)) <= + (my_off_t) memavl) + keys= idx+1; + else + { + uint skr; + do + { + skr= maxbuffer; + if (memavl < sizeof(BUFFPEK)*maxbuffer || + (keys=(memavl-sizeof(BUFFPEK)*maxbuffer)/ + (sort_length+sizeof(char*))) <= 1 || + keys < (uint) maxbuffer) + { + mi_check_print_error(sort_param->sort_info->param, + "myisam_sort_buffer_size is too small"); + goto err; + } + } + while ((maxbuffer= (int) (idx/(keys-1)+1)) != skr); + } + if ((sort_keys= (uchar**) + my_malloc(keys*(sort_length+sizeof(char*))+ + ((sort_param->keyinfo->flag & HA_FULLTEXT) ? + HA_FT_MAXBYTELEN : 0), MYF(0)))) + { + if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), + maxbuffer, maxbuffer/2)) + { + my_free((uchar*) sort_keys,MYF(0)); + sort_keys= (uchar **) NULL; /* for err: label */ + } + else + break; + } + old_memavl= memavl; + if ((memavl= memavl/4*3) < MIN_SORT_MEMORY && + old_memavl > MIN_SORT_MEMORY) + memavl= MIN_SORT_MEMORY; + } + if (memavl < MIN_SORT_MEMORY) + { + mi_check_print_error(sort_param->sort_info->param, + "MyISAM sort buffer too small"); + goto err; /* purecov: tested */ + } + + if (sort_param->sort_info->param->testflag & T_VERBOSE) + printf("Key %d - Allocating buffer for %d keys\n", + sort_param->key + 1, keys); + sort_param->sort_keys= sort_keys; + + idx= error= 0; + sort_keys[0]= (uchar*) (sort_keys+keys); + + DBUG_PRINT("info", ("reading keys")); + while (!(error= sort_param->sort_info->got_error) && + !(error= (*sort_param->key_read)(sort_param, sort_keys[idx]))) + { + if (sort_param->real_key_length > sort_param->key_length) + { + if (write_key(sort_param, sort_keys[idx], + &sort_param->tempfile_for_exceptions)) + goto err; + continue; + } + + if (++idx == keys) + { + if (sort_param->write_keys(sort_param, sort_keys, idx - 1, + (BUFFPEK*) alloc_dynamic(&sort_param->buffpek), + &sort_param->tempfile)) + goto err; + sort_keys[0]= (uchar*) (sort_keys+keys); + memcpy(sort_keys[0], sort_keys[idx - 1], (size_t) sort_param->key_length); + idx= 1; + } + sort_keys[idx]= sort_keys[idx - 1] + sort_param->key_length; + } + if (error > 0) + goto err; + if (sort_param->buffpek.elements) + { + if (sort_param->write_keys(sort_param, sort_keys, idx, + (BUFFPEK*) alloc_dynamic(&sort_param->buffpek), + &sort_param->tempfile)) + goto err; + sort_param->keys= (sort_param->buffpek.elements - 1) * (keys - 1) + idx; + } + else + sort_param->keys= idx; + + sort_param->sort_keys_length= keys; + goto ok; + +err: + DBUG_PRINT("error", ("got some error")); + sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */ + if (sort_keys) + my_free((uchar*) sort_keys,MYF(0)); + sort_param->sort_keys= 0; + delete_dynamic(& sort_param->buffpek); + close_cached_file(&sort_param->tempfile); + close_cached_file(&sort_param->tempfile_for_exceptions); + +ok: + free_root(&sort_param->wordroot, MYF(0)); + /* + Detach from the share if the writer is involved. Avoid others to + be blocked. This includes a flush of the write buffer. This will + also indicate EOF to the readers. + */ + if (sort_param->sort_info->info->rec_cache.share) + remove_io_thread(&sort_param->sort_info->info->rec_cache); + + /* Readers detach from the share if any. Avoid others to be blocked. */ + if (sort_param->read_cache.share) + remove_io_thread(&sort_param->read_cache); + + pthread_mutex_lock(&sort_param->sort_info->mutex); + if (!--sort_param->sort_info->threads_running) + pthread_cond_signal(&sort_param->sort_info->cond); + pthread_mutex_unlock(&sort_param->sort_info->mutex); + DBUG_PRINT("exit", ("======== ending thread ========")); + } + my_thread_end(); + return NULL; +} + + +int thr_write_keys(MI_SORT_PARAM *sort_param) +{ + SORT_INFO *sort_info=sort_param->sort_info; + MI_CHECK *param=sort_info->param; + ulong length, keys; + ulong *rec_per_key_part=param->rec_per_key_part; + int got_error=sort_info->got_error; + uint i; + MI_INFO *info=sort_info->info; + MYISAM_SHARE *share=info->s; + MI_SORT_PARAM *sinfo; + uchar *mergebuf=0; + DBUG_ENTER("thr_write_keys"); + LINT_INIT(length); + + for (i= 0, sinfo= sort_param ; + i < sort_info->total_keys ; + i++, rec_per_key_part+=sinfo->keyinfo->keysegs, sinfo++) + { + if (!sinfo->sort_keys) + { + got_error=1; + my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), + MYF(MY_ALLOW_ZERO_PTR)); + continue; + } + if (!got_error) + { + mi_set_key_active(share->state.key_map, sinfo->key); + if (!sinfo->buffpek.elements) + { + if (param->testflag & T_VERBOSE) + { + printf("Key %d - Dumping %u keys\n",sinfo->key+1, sinfo->keys); + fflush(stdout); + } + if (write_index(sinfo, sinfo->sort_keys, sinfo->keys) || + flush_ft_buf(sinfo) || flush_pending_blocks(sinfo)) + got_error=1; + } + if (!got_error && param->testflag & T_STATISTICS) + update_key_parts(sinfo->keyinfo, rec_per_key_part, sinfo->unique, + param->stats_method == MI_STATS_METHOD_IGNORE_NULLS? + sinfo->notnull: NULL, + (ulonglong) info->state->records); + } + my_free((uchar*) sinfo->sort_keys,MYF(0)); + my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), + MYF(MY_ALLOW_ZERO_PTR)); + sinfo->sort_keys=0; + } + + for (i= 0, sinfo= sort_param ; + i < sort_info->total_keys ; + i++, + delete_dynamic(&sinfo->buffpek), + close_cached_file(&sinfo->tempfile), + close_cached_file(&sinfo->tempfile_for_exceptions), + sinfo++) + { + if (got_error) + continue; + if (sinfo->keyinfo->flag & HA_VAR_LENGTH_KEY) + { + sinfo->write_keys=write_keys_varlen; + sinfo->read_to_buffer=read_to_buffer_varlen; + sinfo->write_key=write_merge_key_varlen; + } + else + { + sinfo->write_keys=write_keys; + sinfo->read_to_buffer=read_to_buffer; + sinfo->write_key=write_merge_key; + } + if (sinfo->buffpek.elements) + { + uint maxbuffer=sinfo->buffpek.elements-1; + if (!mergebuf) + { + length=param->sort_buffer_length; + while (length >= MIN_SORT_MEMORY && !mergebuf) + { + mergebuf=my_malloc(length, MYF(0)); + length=length*3/4; + } + if (!mergebuf) + { + got_error=1; + continue; + } + } + keys=length/sinfo->key_length; + if (maxbuffer >= MERGEBUFF2) + { + if (param->testflag & T_VERBOSE) + printf("Key %d - Merging %u keys\n",sinfo->key+1, sinfo->keys); + if (merge_many_buff(sinfo, keys, (uchar **)mergebuf, + dynamic_element(&sinfo->buffpek, 0, BUFFPEK *), + (int*) &maxbuffer, &sinfo->tempfile)) + { + got_error=1; + continue; + } + } + if (flush_io_cache(&sinfo->tempfile) || + reinit_io_cache(&sinfo->tempfile,READ_CACHE,0L,0,0)) + { + got_error=1; + continue; + } + if (param->testflag & T_VERBOSE) + printf("Key %d - Last merge and dumping keys\n", sinfo->key+1); + if (merge_index(sinfo, keys, (uchar **)mergebuf, + dynamic_element(&sinfo->buffpek,0,BUFFPEK *), + maxbuffer,&sinfo->tempfile) || + flush_ft_buf(sinfo) || + flush_pending_blocks(sinfo)) + { + got_error=1; + continue; + } + } + if (my_b_inited(&sinfo->tempfile_for_exceptions)) + { + uint key_length; + + if (param->testflag & T_VERBOSE) + printf("Key %d - Dumping 'long' keys\n", sinfo->key+1); + + if (flush_io_cache(&sinfo->tempfile_for_exceptions) || + reinit_io_cache(&sinfo->tempfile_for_exceptions,READ_CACHE,0L,0,0)) + { + got_error=1; + continue; + } + + while (!got_error && + !my_b_read(&sinfo->tempfile_for_exceptions,(uchar*)&key_length, + sizeof(key_length))) + { + uchar ft_buf[HA_FT_MAXBYTELEN + HA_FT_WLEN + 10]; + if (key_length > sizeof(ft_buf) || + my_b_read(&sinfo->tempfile_for_exceptions, (uchar*)ft_buf, + (uint)key_length) || + _mi_ck_write(info, sinfo->key, (uchar*)ft_buf, + key_length - info->s->rec_reflength)) + got_error=1; + } + } + } + my_free((uchar*) mergebuf,MYF(MY_ALLOW_ZERO_PTR)); + DBUG_RETURN(got_error); +} +#endif /* THREAD */ + + /* Write all keys in memory to file for later merge */ + +static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, + uint count, BUFFPEK *buffpek, IO_CACHE *tempfile) +{ + uchar **end; + uint sort_length=info->key_length; + DBUG_ENTER("write_keys"); + + qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, + info); + if (!my_b_inited(tempfile) && + open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", + DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) + DBUG_RETURN(1); /* purecov: inspected */ + + buffpek->file_pos=my_b_tell(tempfile); + buffpek->count=count; + + for (end=sort_keys+count ; sort_keys != end ; sort_keys++) + { + if (my_b_write(tempfile,(uchar*) *sort_keys,(uint) sort_length)) + DBUG_RETURN(1); /* purecov: inspected */ + } + DBUG_RETURN(0); +} /* write_keys */ + + +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs) +{ + int err; + uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs); + + /* The following is safe as this is a local file */ + if ((err= my_b_write(to_file, (uchar*)&len, sizeof(len)))) + return (err); + if ((err= my_b_write(to_file,bufs, (uint) len))) + return (err); + return (0); +} + + +static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info, + register uchar **sort_keys, + uint count, BUFFPEK *buffpek, + IO_CACHE *tempfile) +{ + uchar **end; + int err; + DBUG_ENTER("write_keys_varlen"); + + qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, + info); + if (!my_b_inited(tempfile) && + open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", + DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) + DBUG_RETURN(1); /* purecov: inspected */ + + buffpek->file_pos=my_b_tell(tempfile); + buffpek->count=count; + for (end=sort_keys+count ; sort_keys != end ; sort_keys++) + { + if ((err= my_var_write(info,tempfile, (uchar*) *sort_keys))) + DBUG_RETURN(err); + } + DBUG_RETURN(0); +} /* write_keys_varlen */ + + +static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key, + IO_CACHE *tempfile) +{ + uint key_length=info->real_key_length; + DBUG_ENTER("write_key"); + + if (!my_b_inited(tempfile) && + open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", + DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) + DBUG_RETURN(1); + + if (my_b_write(tempfile,(uchar*)&key_length,sizeof(key_length)) || + my_b_write(tempfile,(uchar*)key,(uint) key_length)) + DBUG_RETURN(1); + DBUG_RETURN(0); +} /* write_key */ + + +/* Write index */ + +static int NEAR_F write_index(MI_SORT_PARAM *info, register uchar **sort_keys, + register uint count) +{ + DBUG_ENTER("write_index"); + + qsort2((uchar*) sort_keys,(size_t) count,sizeof(uchar*), + (qsort2_cmp) info->key_cmp,info); + while (count--) + { + if ((*info->key_write)(info,*sort_keys++)) + DBUG_RETURN(-1); /* purecov: inspected */ + } + DBUG_RETURN(0); +} /* write_index */ + + + /* Merge buffers to make < MERGEBUFF2 buffers */ + +static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys, + uchar **sort_keys, BUFFPEK *buffpek, + int *maxbuffer, IO_CACHE *t_file) +{ + register int i; + IO_CACHE t_file2, *from_file, *to_file, *temp; + BUFFPEK *lastbuff; + DBUG_ENTER("merge_many_buff"); + + if (*maxbuffer < MERGEBUFF2) + DBUG_RETURN(0); /* purecov: inspected */ + if (flush_io_cache(t_file) || + open_cached_file(&t_file2,my_tmpdir(info->tmpdir),"ST", + DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) + DBUG_RETURN(1); /* purecov: inspected */ + + from_file= t_file ; to_file= &t_file2; + while (*maxbuffer >= MERGEBUFF2) + { + reinit_io_cache(from_file,READ_CACHE,0L,0,0); + reinit_io_cache(to_file,WRITE_CACHE,0L,0,0); + lastbuff=buffpek; + for (i=0 ; i <= *maxbuffer-MERGEBUFF*3/2 ; i+=MERGEBUFF) + { + if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++, + buffpek+i,buffpek+i+MERGEBUFF-1)) + goto cleanup; + } + if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++, + buffpek+i,buffpek+ *maxbuffer)) + break; /* purecov: inspected */ + if (flush_io_cache(to_file)) + break; /* purecov: inspected */ + temp=from_file; from_file=to_file; to_file=temp; + *maxbuffer= (int) (lastbuff-buffpek)-1; + } +cleanup: + close_cached_file(to_file); /* This holds old result */ + if (to_file == t_file) + *t_file=t_file2; /* Copy result file */ + + DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */ +} /* merge_many_buff */ + + +/* + Read data to buffer + + SYNOPSIS + read_to_buffer() + fromfile File to read from + buffpek Where to read from + sort_length max length to read + RESULT + > 0 Ammount of bytes read + -1 Error +*/ + +static uint NEAR_F read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek, + uint sort_length) +{ + register uint count; + uint length; + + if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count))) + { + if (my_pread(fromfile->file,(uchar*) buffpek->base, + (length= sort_length*count),buffpek->file_pos,MYF_RW)) + return((uint) -1); /* purecov: inspected */ + buffpek->key=buffpek->base; + buffpek->file_pos+= length; /* New filepos */ + buffpek->count-= count; + buffpek->mem_count= count; + } + return (count*sort_length); +} /* read_to_buffer */ + +static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek, + uint sort_length) +{ + register uint count; + uint16 length_of_key = 0; + uint idx; + uchar *buffp; + + if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count))) + { + buffp = buffpek->base; + + for (idx=1;idx<=count;idx++) + { + if (my_pread(fromfile->file,(uchar*)&length_of_key,sizeof(length_of_key), + buffpek->file_pos,MYF_RW)) + return((uint) -1); + buffpek->file_pos+=sizeof(length_of_key); + if (my_pread(fromfile->file,(uchar*) buffp,length_of_key, + buffpek->file_pos,MYF_RW)) + return((uint) -1); + buffpek->file_pos+=length_of_key; + buffp = buffp + sort_length; + } + buffpek->key=buffpek->base; + buffpek->count-= count; + buffpek->mem_count= count; + } + return (count*sort_length); +} /* read_to_buffer_varlen */ + + +static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info, + IO_CACHE *to_file, uchar* key, + uint sort_length, uint count) +{ + uint idx; + uchar *bufs = key; + + for (idx=1;idx<=count;idx++) + { + int err; + if ((err= my_var_write(info, to_file, bufs))) + return (err); + bufs=bufs+sort_length; + } + return(0); +} + + +static int NEAR_F write_merge_key(MI_SORT_PARAM *info __attribute__((unused)), + IO_CACHE *to_file, uchar *key, + uint sort_length, uint count) +{ + return my_b_write(to_file, key, (size_t) sort_length*count); +} + +/* + Merge buffers to one buffer + If to_file == 0 then use info->key_write +*/ + +static int NEAR_F +merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file, + IO_CACHE *to_file, uchar **sort_keys, BUFFPEK *lastbuff, + BUFFPEK *Fb, BUFFPEK *Tb) +{ + int error; + uint sort_length,maxcount; + ha_rows count; + my_off_t to_start_filepos; + uchar *strpos; + BUFFPEK *buffpek,**refpek; + QUEUE queue; + volatile int *killed= killed_ptr(info->sort_info->param); + DBUG_ENTER("merge_buffers"); + + count=error=0; + maxcount=keys/((uint) (Tb-Fb) +1); + LINT_INIT(to_start_filepos); + if (to_file) + to_start_filepos=my_b_tell(to_file); + strpos=(uchar*) sort_keys; + sort_length=info->key_length; + + if (init_queue(&queue,(uint) (Tb-Fb)+1,offsetof(BUFFPEK,key),0, + (int (*)(void*, uchar *,uchar*)) info->key_cmp, + (void*) info)) + DBUG_RETURN(1); /* purecov: inspected */ + + for (buffpek= Fb ; buffpek <= Tb ; buffpek++) + { + count+= buffpek->count; + buffpek->base= strpos; + buffpek->max_keys=maxcount; + strpos+= (uint) (error=(int) info->read_to_buffer(from_file,buffpek, + sort_length)); + if (error == -1) + goto err; /* purecov: inspected */ + queue_insert(&queue,(uchar*) buffpek); + } + + while (queue.elements > 1) + { + for (;;) + { + if (*killed) + { + error=1; goto err; + } + buffpek=(BUFFPEK*) queue_top(&queue); + if (to_file) + { + if (info->write_key(info,to_file,(uchar*) buffpek->key, + (uint) sort_length,1)) + { + error=1; goto err; /* purecov: inspected */ + } + } + else + { + if ((*info->key_write)(info,(void*) buffpek->key)) + { + error=1; goto err; /* purecov: inspected */ + } + } + buffpek->key+=sort_length; + if (! --buffpek->mem_count) + { + if (!(error=(int) info->read_to_buffer(from_file,buffpek,sort_length))) + { + uchar *base=buffpek->base; + uint max_keys=buffpek->max_keys; + + VOID(queue_remove(&queue,0)); + + /* Put room used by buffer to use in other buffer */ + for (refpek= (BUFFPEK**) &queue_top(&queue); + refpek <= (BUFFPEK**) &queue_end(&queue); + refpek++) + { + buffpek= *refpek; + if (buffpek->base+buffpek->max_keys*sort_length == base) + { + buffpek->max_keys+=max_keys; + break; + } + else if (base+max_keys*sort_length == buffpek->base) + { + buffpek->base=base; + buffpek->max_keys+=max_keys; + break; + } + } + break; /* One buffer have been removed */ + } + } + else if (error == -1) + goto err; /* purecov: inspected */ + queue_replaced(&queue); /* Top element has been replaced */ + } + } + buffpek=(BUFFPEK*) queue_top(&queue); + buffpek->base=(uchar *) sort_keys; + buffpek->max_keys=keys; + do + { + if (to_file) + { + if (info->write_key(info,to_file,(uchar*) buffpek->key, + sort_length,buffpek->mem_count)) + { + error=1; goto err; /* purecov: inspected */ + } + } + else + { + register uchar *end; + strpos= buffpek->key; + for (end=strpos+buffpek->mem_count*sort_length; + strpos != end ; + strpos+=sort_length) + { + if ((*info->key_write)(info,(void*) strpos)) + { + error=1; goto err; /* purecov: inspected */ + } + } + } + } + while ((error=(int) info->read_to_buffer(from_file,buffpek,sort_length)) != -1 && + error != 0); + + lastbuff->count=count; + if (to_file) + lastbuff->file_pos=to_start_filepos; +err: + delete_queue(&queue); + DBUG_RETURN(error); +} /* merge_buffers */ + + + /* Do a merge to output-file (save only positions) */ + +static int NEAR_F +merge_index(MI_SORT_PARAM *info, uint keys, uchar **sort_keys, + BUFFPEK *buffpek, int maxbuffer, IO_CACHE *tempfile) +{ + DBUG_ENTER("merge_index"); + if (merge_buffers(info,keys,tempfile,(IO_CACHE*) 0,sort_keys,buffpek,buffpek, + buffpek+maxbuffer)) + DBUG_RETURN(1); /* purecov: inspected */ + DBUG_RETURN(0); +} /* merge_index */ + +static int +flush_ft_buf(MI_SORT_PARAM *info) +{ + int err=0; + if (info->sort_info->ft_buf) + { + err=sort_ft_buf_flush(info); + my_free((uchar*)info->sort_info->ft_buf, MYF(0)); + info->sort_info->ft_buf=0; + } + return err; +} + Added: trunk/src/sp_defs.h =================================================================== --- trunk/src/sp_defs.h 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/sp_defs.h 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,46 @@ +/* Copyright (C) 2002, 2004 MySQL AB & Ramil Kalimullin + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _SP_DEFS_H +#define _SP_DEFS_H + +#define SPDIMS 2 +#define SPTYPE HA_KEYTYPE_DOUBLE +#define SPLEN 8 + +#ifdef HAVE_SPATIAL + +enum wkbType +{ + wkbPoint = 1, + wkbLineString = 2, + wkbPolygon = 3, + wkbMultiPoint = 4, + wkbMultiLineString = 5, + wkbMultiPolygon = 6, + wkbGeometryCollection = 7 +}; + +enum wkbByteOrder +{ + wkbXDR = 0, /* Big Endian */ + wkbNDR = 1 /* Little Endian */ +}; + +uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, + const uchar *record, my_off_t filepos); + +#endif /*HAVE_SPATIAL*/ +#endif /* _SP_DEFS_H */ Added: trunk/src/sp_key.c =================================================================== --- trunk/src/sp_key.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/sp_key.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,286 @@ +/* Copyright (C) 2000 MySQL AB & Ramil Kalimullin + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "myisamdef.h" + +#ifdef HAVE_SPATIAL + +#include "sp_defs.h" + +static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, + uchar byte_order, double *mbr); +static int sp_get_point_mbr(uchar *(*wkb), uchar *end, uint n_dims, + uchar byte_order, double *mbr); +static int sp_get_linestring_mbr(uchar *(*wkb), uchar *end, uint n_dims, + uchar byte_order, double *mbr); +static int sp_get_polygon_mbr(uchar *(*wkb), uchar *end, uint n_dims, + uchar byte_order, double *mbr); +static int sp_get_geometry_mbr(uchar *(*wkb), uchar *end, uint n_dims, + double *mbr, int top); +static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr); + +uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, + const uchar *record, my_off_t filepos) +{ + HA_KEYSEG *keyseg; + MI_KEYDEF *keyinfo = &info->s->keyinfo[keynr]; + uint len = 0; + uchar *pos; + uint dlen; + uchar *dptr; + double mbr[SPDIMS * 2]; + uint i; + + keyseg = &keyinfo->seg[-1]; + pos = (uchar*)record + keyseg->start; + + dlen = _mi_calc_blob_length(keyseg->bit_start, pos); + memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*)); + if (!dptr) + { + my_errno= HA_ERR_NULL_IN_SPATIAL; + return 0; + } + sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */ + + for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++) + { + uint length = keyseg->length, start= keyseg->start; + double val; + + DBUG_ASSERT(length == sizeof(double)); + DBUG_ASSERT(!(start % sizeof(double))); + DBUG_ASSERT(start < sizeof(mbr)); + DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE); + + val= mbr[start / sizeof (double)]; +#ifdef HAVE_ISNAN + if (isnan(val)) + { + bzero(key, length); + key+= length; + len+= length; + continue; + } +#endif + + if (keyseg->flag & HA_SWAP_KEY) + { + uchar buf[sizeof(double)]; + + float8store(buf, val); + pos= &buf[length]; + while (pos > buf) + *key++ = *--pos; + } + else + { + float8store((uchar *)key, val); + key += length; + } + len+= length; + } + _mi_dpointer(info, key, filepos); + return len; +} + +/* +Calculate minimal bounding rectangle (mbr) of the spatial object +stored in "well-known binary representation" (wkb) format. +*/ +static int sp_mbr_from_wkb(uchar *wkb, uint size, uint n_dims, double *mbr) +{ + uint i; + + for (i=0; i < n_dims; ++i) + { + mbr[i * 2] = DBL_MAX; + mbr[i * 2 + 1] = -DBL_MAX; + } + + return sp_get_geometry_mbr(&wkb, wkb + size, n_dims, mbr, 1); +} + +/* + Add one point stored in wkb to mbr +*/ + +static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, + uchar byte_order __attribute__((unused)), + double *mbr) +{ + double ord; + double *mbr_end= mbr + n_dims * 2; + + while (mbr < mbr_end) + { + if ((*wkb) > end - 8) + return -1; + float8get(ord, (const uchar*) *wkb); + (*wkb)+= 8; + if (ord < *mbr) + *mbr= ord; + mbr++; + if (ord > *mbr) + *mbr= ord; + mbr++; + } + return 0; +} + + +static int sp_get_point_mbr(uchar *(*wkb), uchar *end, uint n_dims, + uchar byte_order, double *mbr) +{ + return sp_add_point_to_mbr(wkb, end, n_dims, byte_order, mbr); +} + + +static int sp_get_linestring_mbr(uchar *(*wkb), uchar *end, uint n_dims, + uchar byte_order, double *mbr) +{ + uint n_points; + + n_points = uint4korr(*wkb); + (*wkb) += 4; + for (; n_points > 0; --n_points) + { + /* Add next point to mbr */ + if (sp_add_point_to_mbr(wkb, end, n_dims, byte_order, mbr)) + return -1; + } + return 0; +} + + +static int sp_get_polygon_mbr(uchar *(*wkb), uchar *end, uint n_dims, + uchar byte_order, double *mbr) +{ + uint n_linear_rings; + uint n_points; + + n_linear_rings = uint4korr((*wkb)); + (*wkb) += 4; + + for (; n_linear_rings > 0; --n_linear_rings) + { + n_points = uint4korr((*wkb)); + (*wkb) += 4; + for (; n_points > 0; --n_points) + { + /* Add next point to mbr */ + if (sp_add_point_to_mbr(wkb, end, n_dims, byte_order, mbr)) + return -1; + } + } + return 0; +} + +static int sp_get_geometry_mbr(uchar *(*wkb), uchar *end, uint n_dims, + double *mbr, int top) +{ + int res; + uchar byte_order; + uint wkb_type; + + byte_order = *(*wkb); + ++(*wkb); + + wkb_type = uint4korr((*wkb)); + (*wkb) += 4; + + switch ((enum wkbType) wkb_type) + { + case wkbPoint: + res = sp_get_point_mbr(wkb, end, n_dims, byte_order, mbr); + break; + case wkbLineString: + res = sp_get_linestring_mbr(wkb, end, n_dims, byte_order, mbr); + break; + case wkbPolygon: + res = sp_get_polygon_mbr(wkb, end, n_dims, byte_order, mbr); + break; + case wkbMultiPoint: + { + uint n_items; + n_items = uint4korr((*wkb)); + (*wkb) += 4; + for (; n_items > 0; --n_items) + { + byte_order = *(*wkb); + ++(*wkb); + (*wkb) += 4; + if (sp_get_point_mbr(wkb, end, n_dims, byte_order, mbr)) + return -1; + } + res = 0; + break; + } + case wkbMultiLineString: + { + uint n_items; + n_items = uint4korr((*wkb)); + (*wkb) += 4; + for (; n_items > 0; --n_items) + { + byte_order = *(*wkb); + ++(*wkb); + (*wkb) += 4; + if (sp_get_linestring_mbr(wkb, end, n_dims, byte_order, mbr)) + return -1; + } + res = 0; + break; + } + case wkbMultiPolygon: + { + uint n_items; + n_items = uint4korr((*wkb)); + (*wkb) += 4; + for (; n_items > 0; --n_items) + { + byte_order = *(*wkb); + ++(*wkb); + (*wkb) += 4; + if (sp_get_polygon_mbr(wkb, end, n_dims, byte_order, mbr)) + return -1; + } + res = 0; + break; + } + case wkbGeometryCollection: + { + uint n_items; + + if (!top) + return -1; + + n_items = uint4korr((*wkb)); + (*wkb) += 4; + for (; n_items > 0; --n_items) + { + if (sp_get_geometry_mbr(wkb, end, n_dims, mbr, 0)) + return -1; + } + res = 0; + break; + } + default: + res = -1; + } + return res; +} + +#endif /*HAVE_SPATIAL*/ Added: trunk/src/sp_test.c =================================================================== --- trunk/src/sp_test.c 2007-11-16 08:35:04 UTC (rev 49) +++ trunk/src/sp_test.c 2007-12-06 10:31:31 UTC (rev 50) @@ -0,0 +1,564 @@ +/* Copyright (C) 2002-2004 MySQL AB + + 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; version 2 of the License. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Testing of the basic functions of a MyISAM spatial table */ +/* Written by Alex Barkov, who has a shared copyright to this code */ + +#include "myisam.h" + +#ifdef HAVE_SPATIAL +#include "sp_defs.h" + +#define MAX_REC_LENGTH 1024 +#define KEYALG HA_KEY_ALG_RTREE + +static void create_linestring(uchar *record,uint rownr); +static void print_record(uchar * record,my_off_t offs,const char * tail); + +static void create_key(uchar *key,uint rownr); +static void print_key(const uchar *key,const char * tail); + +static int run_test(const char *filename); +static int read_with_pos(MI_INFO * file, int silent); + +static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points, + uchar *wkb); +static void rtree_PrintWKB(uchar *wkb, uint n_dims); + +static char blob_key[MAX_REC_LENGTH]; + + +int main(int argc __attribute__((unused)),char *argv[]) +{ + MY_INIT(argv[0]); + exit(run_test("sp_test")); +} + + +int run_test(const char *filename) +{ + MI_INFO *file; + MI_UNIQUEDEF uniquedef; + MI_CREATE_INFO create_info; + MI_COLUMNDEF recinfo[20]; + MI_KEYDEF keyinfo[20]; + HA_KEYSEG keyseg[20]; + key_range min_range, max_range; + int silent=0; + int create_flag=0; + int null_fields=0; + int nrecords=30; + int uniques=0; + int i; + int error; + int row_count=0; + uchar record[MAX_REC_LENGTH]; + uchar key[MAX_REC_LENGTH]; + uchar read_record[MAX_REC_LENGTH]; + int upd=10; + ha_rows hrows; + + /* Define a column for NULLs and DEL markers*/ + + recinfo[0].type=FIELD_NORMAL; + recinfo[0].length=1; /* For NULL bits */ + + + /* Define spatial column */ + + recinfo[1].type=FIELD_BLOB; + recinfo[1].length=4 + mi_portable_sizeof_char_ptr; + + + + /* Define a key with 1 spatial segment */ + + keyinfo[0].seg=keyseg; + keyinfo[0].keysegs=1; + keyinfo[0].flag=HA_SPATIAL; + keyinfo[0].key_alg=KEYALG; + + keyinfo[0].seg[0].type= HA_KEYTYPE_BINARY; + keyinfo[0].seg[0].flag=0; + keyinfo[0].seg[0].start= 1; + keyinfo[0].seg[0].length=1; /* Spatial ignores it anyway */ + keyinfo[0].seg[0].null_bit= null_fields ? 2 : 0; + keyinfo[0].seg[0].null_pos=0; + keyinfo[0].seg[0].language=default_charset_info->number; + keyinfo[0].seg[0].bit_start=4; /* Long BLOB */ + + + if (!silent) + printf("- Creating isam-file\n"); + + bzero((char*) &create_info,sizeof(create_info)); + create_info.max_rows=10000000; + + if (mi_create(filename, + 1, /* keys */ + keyinfo, + 2, /* columns */ + recinfo,uniques,&uniquedef,&create_info,create_flag)) + goto err; + + if (!silent) + printf("- Open isam-file\n"); + + if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED))) + goto err; + + if (!silent) + printf("- Writing key:s\n"); + + for (i=0; i "); + print_record(record,mi_position(file),"\n"); + error=mi_update(file,read_record,record); + if (error) + { + printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno); + goto err; + } + } + + if ((error=read_with_pos(file,silent))) + goto err; + + if (!silent) + printf("- Test mi_rkey then a sequence of mi_rnext_same\n"); + + create_key(key, nrecords*4/5); + print_key(key," search for INTERSECT\n"); + + if ((error=mi_rkey(file,read_record,0,key,0,HA_READ_MBR_INTERSECT))) + { + printf("mi_rkey: %3d errno: %3d\n",error,my_errno); + goto err; + } + print_record(read_record,mi_position(file)," mi_rkey\n"); + row_count=1; + + for (;;) + { + if ((error=mi_rnext_same(file,read_record))) + { + if (error==HA_ERR_END_OF_FILE) + break; + printf("mi_next: %3d errno: %3d\n",error,my_errno); + goto err; + } + print_record(read_record,mi_position(file)," mi_rnext_same\n"); + row_count++; + } + printf(" %d rows\n",row_count); + + if (!silent) + printf("- Test mi_rfirst then a sequence of mi_rnext\n"); + + error=mi_rfirst(file,read_record,0); + if (error) + { + printf("mi_rfirst: %3d errno: %3d\n",error,my_errno); + goto err; + } + row_count=1; + print_record(read_record,mi_position(file)," mi_frirst\n"); + + for(i=0;i "); + printf(" offs=%ld ",(long int)offs); + printf("%s",tail); +} + + +#ifdef NOT_USED +static void create_point(uchar *record,uint rownr) +{ + uint tmp; + char *ptr; + char *pos=record; + double x[200]; + int i; + + for(i=0;i Revision: 52 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=52 Author: mir Date: 2007-12-10 19:56:06 +0900 (Mon, 10 Dec 2007) Log Message: ----------- fixed bug: DELEMITED flag was ignored while creating fulltext index. Modified Paths: -------------- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test mysql-5.0.51-tritonn-1.0.8/sql/lex_hash.h mysql-5.0.51-tritonn-1.0.8/sql/sql_yacc.cc mysql-5.0.51-tritonn-1.0.8/sql/sql_yacc.yy Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result 2007-12-10 07:01:42 UTC (rev 51) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result 2007-12-10 10:56:06 UTC (rev 52) @@ -208,3 +208,8 @@ Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size t1 ft c1 utf8 NGRAM OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 DROP TABLE t1; +CREATE TABLE t1 (c1 TEXT, FULLTEXT INDEX ft USING DELIMITED (c1)) DEFAULT CHARSET utf8; +SHOW SENNA STATUS; +Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size +t1 ft c1 utf8 DELIMITED OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 +DROP TABLE t1; Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test 2007-12-10 07:01:42 UTC (rev 51) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test 2007-12-10 10:56:06 UTC (rev 52) @@ -214,3 +214,7 @@ SHOW SENNA STATUS; DROP TABLE t1; +# bugfix for delimited flags was ignored +CREATE TABLE t1 (c1 TEXT, FULLTEXT INDEX ft USING DELIMITED (c1)) DEFAULT CHARSET utf8; +SHOW SENNA STATUS; +DROP TABLE t1; Modified: mysql-5.0.51-tritonn-1.0.8/sql/lex_hash.h =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/lex_hash.h 2007-12-10 07:01:42 UTC (rev 51) +++ mysql-5.0.51-tritonn-1.0.8/sql/lex_hash.h 2007-12-10 10:56:06 UTC (rev 52) @@ -24,30 +24,30 @@ #include "lex.h" -static uchar sql_functions_map[16032]= { +static uchar sql_functions_map[16088]= { '<', 'Y', 26, 0, '!', '|', 56, 0, '<', 'X', 172, 0, 'A', 'Y', 108, 1, -'A', 'W', 51, 3, -'A', 'W', 80, 5, -'A', 'W', 201, 6, -'A', 'Z', 169, 8, -'A', 'V', 181, 10, -'A', 'Y', 148, 11, -'A', 'U', 105, 12, -'C', 'V', 42, 13, -'C', 'U', 254, 13, -'A', 'U', 45, 14, -'D', 'S', 155, 14, -'C', 'S', 236, 14, -'C', 'S', 3, 15, -'G', 'S', 60, 15, -'M', 'U', 100, 15, -'M', 'M', 130, 15, +'A', 'W', 65, 3, +'A', 'W', 94, 5, +'A', 'W', 215, 6, +'A', 'Z', 183, 8, +'A', 'V', 195, 10, +'A', 'Y', 162, 11, +'A', 'U', 119, 12, +'C', 'V', 56, 13, +'C', 'U', 12, 14, +'A', 'U', 59, 14, +'D', 'S', 169, 14, +'C', 'S', 250, 14, +'C', 'S', 17, 15, +'G', 'S', 74, 15, +'M', 'U', 114, 15, +'M', 'M', 144, 15, 0, 0, 2, 2, +0, 0, 112, 255, 0, 0, 113, 255, -0, 0, 114, 255, 0, 0, 4, 1, 0, 0, 176, 255, 0, 0, 177, 255, @@ -79,8 +79,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 28, 255, 0, 0, 27, 255, +0, 0, 26, 255, 0, 0, 4, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -124,11 +124,11 @@ 'F', 'S', 153, 0, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 149, 255, +0, 0, 148, 255, 0, 0, 2, 2, 0, 0, 42, 1, 'N', 'R', 167, 0, -0, 0, 96, 255, +0, 0, 95, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -213,15 +213,15 @@ 'N', 'P', 27, 1, 0, 0, 2, 2, 0, 0, 218, 0, -0, 0, 142, 255, +0, 0, 141, 255, 'A', 'O', 30, 1, 'D', 'O', 56, 1, 'C', 'U', 72, 1, -0, 0, 87, 255, +0, 0, 86, 255, 0, 0, 2, 2, 0, 0, 120, 1, 'E', 'U', 91, 1, -0, 0, 50, 255, +0, 0, 49, 255, 0, 0, 227, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -311,10 +311,10 @@ 0, 0, 200, 0, 0, 0, 2, 2, 0, 0, 211, 0, -0, 0, 132, 255, +0, 0, 131, 255, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 124, 255, +0, 0, 123, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -326,7 +326,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 23, 1, -0, 0, 123, 255, +0, 0, 122, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -336,7 +336,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 122, 255, +0, 0, 121, 255, 0, 0, 36, 1, 0, 0, 39, 1, 0, 0, 2, 2, @@ -352,8 +352,8 @@ 0, 0, 45, 1, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 107, 255, -0, 0, 101, 255, +0, 0, 106, 255, +0, 0, 100, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -368,15 +368,15 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 100, 255, +0, 0, 99, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 61, 1, 0, 0, 138, 1, 0, 0, 2, 2, 0, 0, 2, 2, +0, 0, 70, 255, 0, 0, 71, 255, -0, 0, 72, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -387,8 +387,8 @@ 0, 0, 156, 1, 0, 0, 2, 2, 0, 0, 176, 1, -0, 0, 63, 255, -0, 0, 53, 255, +0, 0, 62, 255, +0, 0, 52, 255, 'C', 'T', 133, 1, 'L', 'Y', 151, 1, 'A', 'U', 171, 1, @@ -399,19 +399,19 @@ 'A', 'O', 43, 2, 'N', 'N', 58, 2, 0, 0, 217, 0, -'E', 'I', 91, 2, -'A', 'P', 96, 2, +'E', 'W', 91, 2, +'A', 'P', 110, 2, 0, 0, 24, 1, -'A', 'U', 161, 2, +'A', 'U', 175, 2, 0, 0, 55, 1, -'A', 'R', 182, 2, +'A', 'R', 196, 2, 0, 0, 2, 2, -'A', 'P', 200, 2, -'H', 'T', 226, 2, -'E', 'Y', 254, 2, -'N', 'U', 32, 3, +'A', 'P', 214, 2, +'H', 'T', 240, 2, +'E', 'Y', 12, 3, +'N', 'U', 46, 3, 0, 0, 247, 1, -'E', 'O', 40, 3, +'E', 'O', 54, 3, 0, 0, 251, 1, 0, 0, 254, 1, 0, 0, 254, 255, @@ -633,6 +633,20 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 220, 0, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 2, 2, +0, 0, 155, 255, 0, 0, 222, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -647,15 +661,15 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'O', 112, 2, -0, 0, 138, 255, +'A', 'O', 126, 2, +0, 0, 137, 255, 0, 0, 232, 0, 0, 0, 2, 2, 0, 0, 236, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'2', 'S', 127, 2, +'2', 'S', 141, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -664,7 +678,7 @@ 0, 0, 2, 2, 0, 0, 239, 0, 0, 0, 242, 0, -0, 0, 141, 255, +0, 0, 140, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -737,11 +751,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 73, 1, -0, 0, 83, 255, +0, 0, 82, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'A', 216, 2, +'A', 'A', 230, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -752,8 +766,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 121, 1, -0, 0, 78, 255, -'D', 'L', 217, 2, +0, 0, 77, 255, +'D', 'L', 231, 2, 0, 0, 89, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -763,8 +777,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 91, 1, -'A', 'O', 239, 2, -0, 0, 73, 255, +'A', 'O', 253, 2, +0, 0, 72, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -772,11 +786,11 @@ 0, 0, 2, 2, 0, 0, 147, 1, 0, 0, 2, 2, -0, 0, 66, 255, 0, 0, 65, 255, +0, 0, 64, 255, 0, 0, 2, 2, 0, 0, 180, 1, -0, 0, 70, 255, +0, 0, 69, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -804,7 +818,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'I', 'U', 19, 3, +'I', 'U', 33, 3, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -812,7 +826,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 212, 1, -0, 0, 44, 255, +0, 0, 43, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -832,7 +846,7 @@ 0, 0, 2, 2, 0, 0, 228, 1, 0, 0, 2, 2, -0, 0, 36, 255, +0, 0, 35, 255, 0, 0, 243, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -844,29 +858,29 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 249, 1, -'F', 'T', 74, 3, -'E', 'T', 130, 3, -'A', 'R', 146, 3, +'F', 'T', 88, 3, +'E', 'T', 144, 3, +'A', 'R', 160, 3, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'O', 182, 3, -'R', 'R', 243, 3, +'A', 'O', 196, 3, +'R', 'R', 1, 4, 0, 0, 180, 0, -'N', 'N', 3, 4, +'N', 'N', 17, 4, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'T', 20, 4, -'A', 'U', 98, 4, -'A', 'G', 135, 4, -'R', 'U', 142, 4, -'H', 'U', 146, 4, -'U', 'U', 175, 4, -'A', 'T', 187, 4, -'E', 'W', 232, 4, -'A', 'Y', 0, 5, -'C', 'S', 25, 5, +'C', 'T', 34, 4, +'A', 'U', 112, 4, +'A', 'G', 149, 4, +'R', 'U', 156, 4, +'H', 'U', 160, 4, +'U', 'U', 189, 4, +'A', 'T', 201, 4, +'E', 'W', 246, 4, +'A', 'Y', 14, 5, +'C', 'S', 39, 5, 0, 0, 235, 1, -'H', 'R', 64, 5, +'H', 'R', 78, 5, 0, 0, 13, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -880,7 +894,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'W', 89, 3, +'C', 'W', 103, 3, 0, 0, 242, 255, 0, 0, 24, 0, 0, 0, 2, 2, @@ -902,8 +916,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'K', 'K', 110, 3, -'B', 'T', 111, 3, +'K', 'K', 124, 3, +'B', 'T', 125, 3, 0, 0, 245, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -946,7 +960,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'E', 164, 3, +'A', 'E', 178, 3, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -956,7 +970,7 @@ 0, 0, 220, 255, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'O', 169, 3, +'C', 'O', 183, 3, 0, 0, 52, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -983,13 +997,13 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'E', 'X', 197, 3, +'E', 'X', 211, 3, 0, 0, 2, 2, 0, 0, 2, 2, -'O', 'U', 217, 3, +'O', 'U', 231, 3, 0, 0, 2, 2, 0, 0, 2, 2, -'R', 'U', 239, 3, +'R', 'U', 253, 3, 0, 0, 189, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1010,7 +1024,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 154, 0, -'A', 'O', 224, 3, +'A', 'O', 238, 3, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1036,7 +1050,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 162, 0, -'A', 'O', 244, 3, +'A', 'O', 2, 4, 0, 0, 172, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1052,7 +1066,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 174, 0, -'D', 'S', 4, 4, +'D', 'S', 18, 4, 0, 0, 190, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1069,25 +1083,25 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 163, 255, -0, 0, 152, 255, +0, 0, 151, 255, 0, 0, 2, 2, -'A', 'V', 38, 4, +'A', 'V', 52, 4, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'M', 'N', 64, 4, +'M', 'N', 78, 4, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'W', 66, 4, +'C', 'W', 80, 4, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 137, 255, -'S', 'V', 60, 4, +0, 0, 136, 255, +'S', 'V', 74, 4, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1109,17 +1123,17 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 227, 0, -0, 0, 151, 255, +0, 0, 150, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 224, 0, 0, 0, 229, 0, 0, 0, 230, 0, -'A', 'K', 87, 4, +'A', 'K', 101, 4, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 140, 255, +0, 0, 139, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1135,7 +1149,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 139, 255, +0, 0, 138, 255, 0, 0, 233, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1151,7 +1165,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'R', 119, 4, +'C', 'R', 133, 4, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1202,7 +1216,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'I', 'W', 160, 4, +'I', 'W', 174, 4, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1223,8 +1237,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 86, 255, -'E', 'O', 176, 4, +0, 0, 85, 255, +'E', 'O', 190, 4, 0, 0, 83, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1235,12 +1249,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 85, 255, +0, 0, 84, 255, 0, 0, 85, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'S', 207, 4, +'A', 'S', 221, 4, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1250,12 +1264,12 @@ 0, 0, 116, 1, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 80, 255, +0, 0, 79, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'R', 'R', 226, 4, +'R', 'R', 240, 4, 0, 0, 90, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1275,12 +1289,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 108, 1, -'E', 'I', 227, 4, +'E', 'I', 241, 4, 0, 0, 123, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 77, 255, +0, 0, 76, 255, 0, 0, 132, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1288,11 +1302,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'E', 251, 4, +'A', 'E', 9, 5, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 67, 255, +0, 0, 66, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1304,7 +1318,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 69, 255, +0, 0, 68, 255, 0, 0, 190, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1330,7 +1344,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 213, 1, -0, 0, 43, 255, +0, 0, 42, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1341,13 +1355,13 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'H', 'T', 42, 5, +'H', 'T', 56, 5, 0, 0, 2, 2, -0, 0, 37, 255, +0, 0, 36, 255, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'I', 55, 5, -0, 0, 40, 255, +'A', 'I', 69, 5, +0, 0, 39, 255, 0, 0, 218, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1369,7 +1383,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 231, 1, -'E', 'I', 75, 5, +'E', 'I', 89, 5, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1385,29 +1399,29 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 246, 1, -'C', 'S', 103, 5, -'A', 'I', 120, 5, -'H', 'U', 155, 5, -'E', 'O', 172, 5, -'L', 'X', 193, 5, -'A', 'O', 213, 5, -'L', 'R', 236, 5, +'C', 'S', 117, 5, +'A', 'I', 134, 5, +'H', 'U', 169, 5, +'E', 'O', 186, 5, +'L', 'X', 207, 5, +'A', 'O', 227, 5, +'L', 'R', 250, 5, 0, 0, 177, 0, -'F', 'S', 243, 5, +'F', 'S', 1, 6, 0, 0, 2, 2, 0, 0, 2, 2, -'E', 'O', 21, 6, -'A', 'O', 46, 6, -0, 0, 106, 255, -'F', 'P', 71, 6, -0, 0, 93, 255, +'E', 'O', 35, 6, +'A', 'O', 60, 6, +0, 0, 105, 255, +'F', 'P', 85, 6, +0, 0, 92, 255, 0, 0, 2, 2, -'E', 'O', 82, 6, -'C', 'U', 114, 6, +'E', 'O', 96, 6, +'C', 'U', 128, 6, 0, 0, 191, 1, -'N', 'P', 194, 6, +'N', 'P', 208, 6, 0, 0, 236, 1, -0, 0, 29, 255, +0, 0, 28, 255, 0, 0, 11, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1433,7 +1447,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'G', 'T', 129, 5, +'G', 'T', 143, 5, 0, 0, 35, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1441,7 +1455,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'L', 143, 5, +'A', 'L', 157, 5, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1467,7 +1481,7 @@ 0, 0, 61, 0, 0, 0, 2, 2, 0, 0, 2, 2, -'L', 'N', 169, 5, +'L', 'N', 183, 5, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 83, 0, @@ -1477,7 +1491,7 @@ 0, 0, 66, 0, 0, 0, 69, 0, 0, 0, 225, 255, -'C', 'L', 183, 5, +'C', 'L', 197, 5, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1500,7 +1514,7 @@ 0, 0, 109, 0, 0, 0, 130, 0, 0, 0, 2, 2, -'A', 'G', 206, 5, +'A', 'G', 220, 5, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 194, 255, @@ -1529,13 +1543,13 @@ 0, 0, 151, 0, 0, 0, 2, 2, 0, 0, 2, 2, -'O', 'O', 228, 5, +'O', 'O', 242, 5, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 186, 255, -'A', 'A', 229, 5, -'T', 'T', 230, 5, -'4', '8', 231, 5, +'A', 'A', 243, 5, +'T', 'T', 244, 5, +'4', '8', 245, 5, 0, 0, 156, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1556,12 +1570,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 188, 0, -'F', 'S', 1, 6, +'F', 'S', 15, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'N', 'S', 15, 6, +'N', 'S', 29, 6, 0, 0, 192, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1582,7 +1596,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 214, 0, -'A', 'N', 32, 6, +'A', 'N', 46, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1592,7 +1606,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 143, 255, +0, 0, 142, 255, 0, 0, 225, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1606,12 +1620,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 150, 255, +0, 0, 149, 255, 0, 0, 244, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'D', 'M', 61, 6, +'D', 'M', 75, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1643,7 +1657,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 57, 1, -'G', 'V', 93, 6, +'G', 'V', 107, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1663,7 +1677,7 @@ 0, 0, 2, 2, 0, 0, 101, 1, 0, 0, 2, 2, -'A', 'E', 109, 6, +'A', 'E', 123, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 111, 1, @@ -1677,23 +1691,23 @@ 0, 0, 106, 1, 0, 0, 125, 1, 0, 0, 2, 2, -'C', 'R', 133, 6, +'C', 'R', 147, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'G', 'M', 149, 6, +'G', 'M', 163, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'N', 'U', 156, 6, +'N', 'U', 170, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'R', 169, 6, -0, 0, 57, 255, +'A', 'R', 183, 6, +0, 0, 56, 255, 0, 0, 127, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1724,7 +1738,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'N', 'R', 164, 6, +'N', 'R', 178, 6, 0, 0, 149, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1733,7 +1747,7 @@ 0, 0, 179, 1, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 62, 255, +0, 0, 61, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1747,45 +1761,45 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'I', 187, 6, -0, 0, 58, 255, +'C', 'I', 201, 6, +0, 0, 57, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 183, 1, -'I', 'L', 197, 6, +'I', 'L', 211, 6, 0, 0, 2, 2, 0, 0, 224, 1, 0, 0, 219, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 221, 1, -'D', 'N', 224, 6, -'E', 'O', 253, 6, -'A', 'U', 34, 7, -'A', 'Y', 99, 7, -'N', 'X', 151, 7, +'D', 'N', 238, 6, +'E', 'O', 11, 7, +'A', 'U', 48, 7, +'A', 'Y', 113, 7, +'N', 'X', 165, 7, 0, 0, 161, 0, 0, 0, 171, 255, 0, 0, 175, 0, -'N', 'T', 183, 7, +'N', 'T', 197, 7, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 223, 0, 0, 0, 18, 1, -'A', 'U', 209, 7, +'A', 'U', 223, 7, 0, 0, 63, 1, -'A', 'R', 230, 7, +'A', 'R', 244, 7, 0, 0, 82, 1, -'A', 'O', 7, 8, -'C', 'Y', 42, 8, -'I', 'R', 104, 8, -'N', 'S', 125, 8, -'A', 'E', 134, 8, -0, 0, 31, 255, -'D', 'D', 235, 6, +'A', 'O', 21, 8, +'C', 'Y', 56, 8, +'I', 'R', 118, 8, +'N', 'S', 139, 8, +'A', 'E', 148, 8, +0, 0, 30, 255, +'D', 'D', 249, 6, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 14, 0, @@ -1796,7 +1810,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 19, 0, -'D', 'T', 236, 6, +'D', 'T', 250, 6, 0, 0, 253, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1818,15 +1832,15 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'T', 'T', 8, 7, +'T', 'T', 22, 7, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 42, 0, -'_', '_', 9, 7, -'A', 'X', 10, 7, +'_', '_', 23, 7, +'A', 'X', 24, 7, 0, 0, 237, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1858,29 +1872,29 @@ 0, 0, 233, 255, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'A', 55, 7, +'A', 'A', 69, 7, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'L', 'N', 61, 7, +'L', 'N', 75, 7, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 216, 255, 0, 0, 2, 2, 0, 0, 2, 2, -'R', 'R', 81, 7, -'N', 'R', 56, 7, +'R', 'R', 95, 7, +'N', 'R', 70, 7, 0, 0, 54, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 57, 0, -'L', 'U', 64, 7, -'M', 'P', 74, 7, -'T', 'V', 78, 7, +'L', 'U', 78, 7, +'M', 'P', 88, 7, +'T', 'V', 92, 7, 0, 0, 64, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1898,7 +1912,7 @@ 0, 0, 79, 0, 0, 0, 2, 2, 0, 0, 81, 0, -'D', 'T', 82, 7, +'D', 'T', 96, 7, 0, 0, 215, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1920,11 +1934,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'L', 124, 7, +'C', 'L', 138, 7, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'S', 'S', 147, 7, +'S', 'S', 161, 7, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1941,10 +1955,10 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 127, 0, -'I', 'L', 134, 7, +'I', 'L', 148, 7, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'I', 138, 7, +'A', 'I', 152, 7, 0, 0, 204, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1964,11 +1978,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 106, 0, -'A', 'C', 148, 7, +'A', 'C', 162, 7, 0, 0, 116, 0, 0, 0, 2, 2, 0, 0, 117, 0, -'C', 'G', 162, 7, +'C', 'G', 176, 7, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -1978,7 +1992,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'E', 'T', 167, 7, +'E', 'T', 181, 7, 0, 0, 197, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2000,7 +2014,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 192, 255, -'D', 'V', 190, 7, +'D', 'V', 204, 7, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2064,7 +2078,7 @@ 0, 0, 70, 1, 0, 0, 2, 2, 0, 0, 2, 2, -'E', 'O', 248, 7, +'E', 'O', 6, 8, 0, 0, 72, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2075,16 +2089,16 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'F', 3, 8, +'C', 'F', 17, 8, 0, 0, 77, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 79, 1, -0, 0, 84, 255, +0, 0, 83, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'V', 22, 8, +'C', 'V', 36, 8, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2114,7 +2128,7 @@ 0, 0, 109, 1, 0, 0, 113, 1, 0, 0, 2, 2, -0, 0, 81, 255, +0, 0, 80, 255, 0, 0, 126, 1, 0, 0, 2, 2, 0, 0, 137, 1, @@ -2127,22 +2141,22 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 68, 255, +0, 0, 67, 255, 0, 0, 151, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'O', 'R', 65, 8, -'B', 'S', 69, 8, +'O', 'R', 79, 8, +'B', 'S', 83, 8, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 52, 255, +0, 0, 51, 255, 0, 0, 181, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 184, 1, -'D', 'T', 87, 8, +'D', 'T', 101, 8, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2160,7 +2174,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 187, 1, -0, 0, 74, 255, +0, 0, 73, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2176,18 +2190,18 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 54, 255, +0, 0, 53, 255, 0, 0, 203, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'U', '_', 114, 8, +'U', '_', 128, 8, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 208, 1, -0, 0, 45, 255, +0, 0, 44, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2197,8 +2211,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 46, 255, -'I', 'K', 131, 8, +0, 0, 45, 255, +'I', 'K', 145, 8, 0, 0, 2, 2, 0, 0, 225, 1, 0, 0, 2, 2, @@ -2207,12 +2221,12 @@ 0, 0, 217, 1, 0, 0, 2, 2, 0, 0, 220, 1, -'R', 'R', 139, 8, +'R', 'R', 153, 8, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 32, 255, -'C', '_', 140, 8, +0, 0, 31, 255, +'C', '_', 154, 8, 0, 0, 238, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2241,32 +2255,32 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 34, 255, +0, 0, 33, 255, 0, 0, 247, 255, 0, 0, 2, 2, -'A', 'O', 195, 8, -'A', 'U', 234, 8, -'N', 'X', 69, 9, -'U', 'U', 100, 9, -'E', 'R', 104, 9, +'A', 'O', 209, 8, +'A', 'U', 248, 8, +'N', 'X', 83, 9, +'U', 'U', 114, 9, +'E', 'R', 118, 9, 0, 0, 2, 2, -'N', 'S', 124, 9, +'N', 'S', 138, 9, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'O', 154, 9, -'A', 'O', 196, 9, -'A', 'V', 254, 9, -'N', 'V', 20, 10, -'A', 'R', 29, 10, +'A', 'O', 168, 9, +'A', 'O', 210, 9, +'A', 'V', 12, 10, +'N', 'V', 34, 10, +'A', 'R', 43, 10, 0, 0, 2, 2, -'E', 'O', 47, 10, -'E', 'W', 58, 10, -'I', 'R', 77, 10, -'N', 'T', 130, 10, -'A', 'A', 156, 10, +'E', 'O', 61, 10, +'E', 'W', 72, 10, +'I', 'R', 91, 10, +'N', 'T', 144, 10, +'A', 'A', 170, 10, 0, 0, 242, 1, 0, 0, 2, 2, -0, 0, 26, 255, +0, 0, 25, 255, 0, 0, 0, 2, 0, 0, 50, 0, 0, 0, 2, 2, @@ -2282,7 +2296,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'N', 210, 8, +'A', 'N', 224, 8, 0, 0, 228, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2296,8 +2310,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 226, 255, -'T', 'T', 224, 8, -'A', 'I', 225, 8, +'T', 'T', 238, 8, +'A', 'I', 239, 8, 0, 0, 78, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2307,7 +2321,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 80, 0, -'T', 'Y', 255, 8, +'T', 'Y', 13, 9, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2315,7 +2329,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'S', 'S', 57, 9, +'S', 'S', 71, 9, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2328,7 +2342,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 125, 0, -'A', 'E', 5, 9, +'A', 'E', 19, 9, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2338,7 +2352,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'D', '_', 10, 9, +'D', '_', 24, 9, 0, 0, 212, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2366,7 +2380,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'S', 38, 9, +'A', 'S', 52, 9, 0, 0, 213, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2386,7 +2400,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 210, 255, -'J', 'T', 58, 9, +'J', 'T', 72, 9, 0, 0, 200, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2398,7 +2412,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 118, 0, -'C', 'V', 80, 9, +'C', 'V', 94, 9, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2429,11 +2443,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 195, 255, -'L', 'N', 101, 9, +'L', 'N', 115, 9, 0, 0, 166, 0, 0, 0, 2, 2, 0, 0, 167, 0, -'O', 'T', 118, 9, +'O', 'T', 132, 9, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2453,12 +2467,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 182, 255, -'N', 'T', 130, 9, +'N', 'T', 144, 9, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'S', 137, 9, +'C', 'S', 151, 9, 0, 0, 194, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2482,8 +2496,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 154, 255, -'N', 'S', 169, 9, +0, 0, 153, 255, +'N', 'S', 183, 9, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2497,15 +2511,15 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'N', 'N', 175, 9, +'N', 'N', 189, 9, 0, 0, 221, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 153, 255, -'G', 'G', 176, 9, -'B', 'T', 177, 9, +0, 0, 152, 255, +'G', 'G', 190, 9, +'B', 'T', 191, 9, 0, 0, 240, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2525,8 +2539,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 241, 0, -'K', 'X', 211, 9, -0, 0, 129, 255, +'K', 'X', 225, 9, +0, 0, 128, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2540,7 +2554,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 25, 1, -'E', 'E', 225, 9, +'E', 'E', 239, 9, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2554,8 +2568,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 6, 1, -'D', '_', 226, 9, -0, 0, 135, 255, +'D', '_', 240, 9, +0, 0, 134, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2571,7 +2585,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 134, 255, +0, 0, 133, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2582,7 +2596,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 136, 255, +0, 0, 135, 255, 0, 0, 34, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2613,7 +2627,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 99, 255, +0, 0, 98, 255, 0, 0, 67, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2628,7 +2642,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 88, 255, +0, 0, 87, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 80, 1, @@ -2662,7 +2676,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 189, 1, -'M', 'N', 87, 10, +'M', 'N', 101, 10, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2671,10 +2685,10 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'U', 109, 10, -0, 0, 47, 255, -'Y', 'Y', 89, 10, -'B', 'T', 90, 10, +'A', 'U', 123, 10, +0, 0, 46, 255, +'Y', 'Y', 103, 10, +'B', 'T', 104, 10, 0, 0, 202, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2721,9 +2735,9 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'C', 'C', 137, 10, -'_', '_', 138, 10, -'D', 'T', 139, 10, +'C', 'C', 151, 10, +'_', '_', 152, 10, +'D', 'T', 153, 10, 0, 0, 232, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2741,9 +2755,9 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 233, 1, -'R', 'R', 157, 10, -'I', '_', 158, 10, -0, 0, 35, 255, +'R', 'R', 171, 10, +'I', '_', 172, 10, +0, 0, 34, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2765,29 +2779,29 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 33, 255, -'G', 'L', 203, 10, -'E', 'I', 209, 10, -'H', 'O', 214, 10, -'A', 'U', 227, 10, +0, 0, 32, 255, +'G', 'L', 217, 10, +'E', 'I', 223, 10, +'H', 'O', 228, 10, +'A', 'U', 241, 10, 0, 0, 144, 0, 0, 0, 184, 255, 0, 0, 181, 255, 0, 0, 2, 2, -'N', 'S', 9, 11, +'N', 'S', 23, 11, 0, 0, 2, 2, 0, 0, 2, 2, -'O', 'O', 32, 11, -'B', 'O', 36, 11, -'O', 'U', 50, 11, +'O', 'O', 46, 11, +'B', 'O', 50, 11, +'O', 'U', 64, 11, 0, 0, 2, 2, -'A', 'R', 57, 11, +'A', 'R', 71, 11, 0, 0, 2, 2, -'A', 'O', 86, 11, -'A', 'U', 101, 11, -'E', 'I', 125, 11, +'A', 'O', 100, 11, +'A', 'U', 115, 11, +'E', 'I', 139, 11, 0, 0, 215, 1, -'A', 'A', 138, 11, +'A', 'A', 152, 11, 0, 0, 15, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2806,13 +2820,13 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'L', 'N', 222, 10, +'L', 'N', 236, 10, 0, 0, 65, 0, 0, 0, 70, 0, -'C', 'D', 225, 10, +'C', 'D', 239, 10, 0, 0, 224, 255, 0, 0, 74, 0, -'T', 'Y', 248, 10, +'T', 'Y', 6, 11, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2820,7 +2834,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'M', 'R', 3, 11, +'M', 'R', 17, 11, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2838,9 +2852,9 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'O', 'O', 254, 10, -'F', 'F', 255, 10, -'W', 'Y', 0, 11, +'O', 'O', 12, 11, +'F', 'F', 13, 11, +'W', 'Y', 14, 11, 0, 0, 207, 255, 0, 0, 2, 2, 0, 0, 206, 255, @@ -2850,15 +2864,15 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 115, 0, -'E', 'E', 15, 11, +'E', 'E', 29, 11, 0, 0, 210, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 213, 0, -'T', 'T', 16, 11, -'_', '_', 17, 11, -'A', 'N', 18, 11, +'T', 'T', 30, 11, +'_', '_', 31, 11, +'A', 'N', 32, 11, 0, 0, 165, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2873,11 +2887,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 164, 255, -'A', 'C', 33, 11, -0, 0, 144, 255, +'A', 'C', 47, 11, +0, 0, 143, 255, 0, 0, 2, 2, 0, 0, 234, 0, -0, 0, 125, 255, +0, 0, 124, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 12, 1, @@ -2890,14 +2904,14 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 115, 255, +0, 0, 114, 255, 0, 0, 44, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 103, 255, +0, 0, 102, 255, 0, 0, 65, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2915,7 +2929,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'E', 'O', 75, 11, +'E', 'O', 89, 11, 0, 0, 71, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2941,12 +2955,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 79, 255, +0, 0, 78, 255, 0, 0, 124, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'N', 'P', 122, 11, +'N', 'P', 136, 11, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2962,25 +2976,25 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 56, 255, +0, 0, 55, 255, 0, 0, 133, 1, 0, 0, 2, 2, 0, 0, 134, 1, -'M', 'M', 130, 11, +'M', 'M', 144, 11, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 199, 1, -'P', 'P', 131, 11, -'O', 'T', 132, 11, +'P', 'P', 145, 11, +'O', 'T', 146, 11, 0, 0, 193, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 194, 1, -'R', 'R', 139, 11, -'B', 'I', 140, 11, +'R', 'R', 153, 11, +'B', 'I', 154, 11, 0, 0, 237, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -2990,28 +3004,28 @@ 0, 0, 2, 2, 0, 0, 240, 1, 0, 0, 25, 0, -'E', 'I', 173, 11, -'O', 'O', 178, 11, -'A', 'E', 213, 11, +'E', 'I', 187, 11, +'O', 'O', 192, 11, +'A', 'E', 227, 11, 0, 0, 190, 255, 0, 0, 185, 255, 0, 0, 170, 0, 0, 0, 2, 2, -'D', 'N', 243, 11, +'D', 'N', 1, 12, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 231, 0, -'A', 'U', 254, 11, -'A', 'D', 42, 12, +'A', 'U', 12, 12, +'A', 'D', 56, 12, 0, 0, 58, 1, -'E', 'R', 46, 12, +'E', 'R', 60, 12, 0, 0, 2, 2, -'E', 'O', 60, 12, -'Q', 'T', 82, 12, -'A', 'E', 100, 12, -0, 0, 42, 255, +'E', 'O', 74, 12, +'Q', 'T', 96, 12, +'A', 'E', 114, 12, +0, 0, 41, 255, 0, 0, 2, 2, -0, 0, 30, 255, +0, 0, 29, 255, 0, 0, 2, 2, 0, 0, 255, 1, 0, 0, 33, 0, @@ -3019,9 +3033,9 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 232, 255, -'M', 'N', 179, 11, +'M', 'N', 193, 11, 0, 0, 72, 0, -'C', 'V', 181, 11, +'C', 'V', 195, 11, 0, 0, 73, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3038,7 +3052,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'I', 'T', 201, 11, +'I', 'T', 215, 11, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 221, 255, @@ -3054,12 +3068,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 77, 0, -'Y', 'Y', 218, 11, +'Y', 'Y', 232, 11, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 101, 0, -'O', '_', 219, 11, +'O', '_', 233, 11, 0, 0, 208, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3076,7 +3090,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'M', 'S', 236, 11, +'M', 'S', 250, 11, 0, 0, 99, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3096,10 +3110,10 @@ 0, 0, 2, 2, 0, 0, 161, 255, 0, 0, 252, 0, -0, 0, 126, 255, +0, 0, 125, 255, 0, 0, 2, 2, 0, 0, 2, 2, -'D', 'D', 19, 12, +'D', 'D', 33, 12, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3116,10 +3130,10 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 29, 1, -'I', 'I', 20, 12, -'U', 'U', 21, 12, -'M', 'M', 22, 12, -'B', 'T', 23, 12, +'I', 'I', 34, 12, +'U', 'U', 35, 12, +'M', 'M', 36, 12, +'B', 'T', 37, 12, 0, 0, 11, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3139,11 +3153,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 13, 1, -0, 0, 108, 255, +0, 0, 107, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 37, 1, -0, 0, 98, 255, +0, 0, 97, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3157,7 +3171,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 75, 1, -'F', 'P', 71, 12, +'F', 'P', 85, 12, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3179,11 +3193,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 103, 1, -'L', 'L', 86, 12, +'L', 'L', 100, 12, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'D', 96, 12, -'W', '_', 87, 12, +'A', 'D', 110, 12, +'W', '_', 101, 12, 0, 0, 159, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3193,52 +3207,52 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 166, 1, -0, 0, 64, 255, +0, 0, 63, 255, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 61, 255, +0, 0, 60, 255, 0, 0, 192, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 195, 1, -'E', 'E', 126, 12, +'E', 'E', 140, 12, 0, 0, 2, 2, 0, 0, 230, 255, -'A', 'I', 131, 12, +'A', 'I', 145, 12, 0, 0, 2, 2, -'I', 'R', 144, 12, +'I', 'R', 158, 12, 0, 0, 172, 255, -'O', 'O', 154, 12, +'O', 'O', 168, 12, 0, 0, 197, 0, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 147, 255, -'A', 'I', 165, 12, +0, 0, 146, 255, +'A', 'I', 179, 12, 0, 0, 2, 2, 0, 0, 2, 2, -'E', 'R', 207, 12, +'E', 'R', 221, 12, 0, 0, 2, 2, -'A', 'E', 221, 12, -'E', 'Y', 226, 12, -'I', 'R', 14, 13, +'A', 'E', 235, 12, +'E', 'Y', 240, 12, +'I', 'R', 28, 13, 0, 0, 214, 1, -'S', 'S', 127, 12, -'_', '_', 128, 12, -'D', 'E', 129, 12, +'S', 'S', 141, 12, +'_', '_', 142, 12, +'D', 'E', 143, 12, 0, 0, 250, 255, 0, 0, 251, 255, 0, 0, 211, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'S', 'S', 140, 12, +'S', 'S', 154, 12, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 119, 0, -'_', '_', 141, 12, -'D', 'E', 142, 12, +'_', '_', 155, 12, +'D', 'E', 156, 12, 0, 0, 202, 255, 0, 0, 203, 255, 0, 0, 188, 255, @@ -3251,10 +3265,10 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 163, 0, -'U', 'U', 155, 12, -'R', 'R', 156, 12, -'_', '_', 157, 12, -'M', 'S', 158, 12, +'U', 'U', 169, 12, +'R', 'R', 170, 12, +'_', '_', 171, 12, +'M', 'S', 172, 12, 0, 0, 183, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3262,8 +3276,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 184, 0, -'S', 'S', 174, 12, -'R', 'R', 193, 12, +'S', 'S', 188, 12, +'R', 'R', 207, 12, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3271,11 +3285,11 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 16, 1, -'T', 'T', 175, 12, -'E', 'E', 176, 12, -'R', 'R', 177, 12, -'_', '_', 178, 12, -'H', 'U', 179, 12, +'T', 'T', 189, 12, +'E', 'E', 190, 12, +'R', 'R', 191, 12, +'_', '_', 192, 12, +'H', 'U', 193, 12, 0, 0, 246, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3290,9 +3304,9 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 1, -'C', 'O', 194, 12, -0, 0, 131, 255, +'C', 'O', 208, 12, 0, 0, 130, 255, +0, 0, 129, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3303,8 +3317,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 127, 255, -0, 0, 97, 255, +0, 0, 126, 255, +0, 0, 96, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3314,7 +3328,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 91, 255, +0, 0, 90, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 78, 1, @@ -3323,7 +3337,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 105, 1, -0, 0, 76, 255, +0, 0, 75, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3334,25 +3348,25 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'L', 'L', 247, 12, +'L', 'L', 5, 13, 0, 0, 171, 1, 0, 0, 2, 2, 0, 0, 2, 2, -'D', 'R', 255, 12, +'D', 'R', 13, 13, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 51, 255, -'I', 'I', 248, 12, -'T', 'T', 249, 12, -'_', '_', 250, 12, -'A', 'D', 251, 12, +0, 0, 50, 255, +'I', 'I', 6, 13, +'T', 'T', 7, 13, +'_', '_', 8, 13, +'A', 'D', 9, 13, 0, 0, 153, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 154, 1, -0, 0, 60, 255, +0, 0, 59, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3366,8 +3380,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 59, 255, -'M', 'M', 24, 13, +0, 0, 58, 255, +'M', 'M', 38, 13, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3377,10 +3391,10 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 207, 1, -'E', 'E', 25, 13, -'_', '_', 26, 13, -'F', 'T', 27, 13, -0, 0, 49, 255, +'E', 'E', 39, 13, +'_', '_', 40, 13, +'F', 'T', 41, 13, +0, 0, 48, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3394,26 +3408,26 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 48, 255, -'O', 'U', 62, 13, +0, 0, 47, 255, +'O', 'U', 76, 13, 0, 0, 113, 0, 0, 0, 193, 255, 0, 0, 2, 2, -'E', 'R', 93, 13, +'E', 'R', 107, 13, 0, 0, 2, 2, -'S', 'S', 111, 13, +'S', 'S', 125, 13, 0, 0, 2, 2, 0, 0, 2, 2, -'I', 'O', 129, 13, -'L', 'U', 136, 13, +'I', 'O', 143, 13, +'L', 'U', 150, 13, 0, 0, 2, 2, -'C', 'L', 146, 13, -'O', 'O', 156, 13, +'C', 'L', 160, 13, +'O', 'O', 170, 13, 0, 0, 2, 2, -'E', 'E', 161, 13, -'E', 'Q', 168, 13, +'E', 'E', 175, 13, +'E', 'Q', 182, 13, 0, 0, 200, 1, -0, 0, 39, 255, +0, 0, 38, 255, 0, 0, 239, 1, 0, 0, 227, 255, 0, 0, 2, 2, @@ -3421,13 +3435,13 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'R', 'R', 69, 13, -'R', 'R', 70, 13, -'E', 'E', 71, 13, -'N', 'N', 72, 13, -'T', 'T', 73, 13, -'_', '_', 74, 13, -'D', 'U', 75, 13, +'R', 'R', 83, 13, +'R', 'R', 84, 13, +'E', 'E', 85, 13, +'N', 'N', 86, 13, +'T', 'T', 87, 13, +'_', '_', 88, 13, +'D', 'U', 89, 13, 0, 0, 86, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3446,7 +3460,7 @@ 0, 0, 2, 2, 0, 0, 87, 0, 0, 0, 89, 0, -'O', 'O', 107, 13, +'O', 'O', 121, 13, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3460,12 +3474,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 169, 255, -'M', 'M', 108, 13, -'E', 'F', 109, 13, +'M', 'M', 122, 13, +'E', 'F', 123, 13, 0, 0, 180, 255, 0, 0, 173, 255, -'_', '_', 112, 13, -'F', 'U', 113, 13, +'_', '_', 126, 13, +'F', 'U', 127, 13, 0, 0, 157, 255, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3482,24 +3496,24 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 156, 255, -0, 0, 148, 255, +0, 0, 147, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 243, 0, -0, 0, 120, 255, +0, 0, 119, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 116, 255, +0, 0, 115, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 30, 1, -0, 0, 102, 255, +0, 0, 101, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3509,19 +3523,19 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 51, 1, -'I', 'L', 157, 13, -0, 0, 94, 255, +'I', 'L', 171, 13, +0, 0, 93, 255, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 92, 255, -'L', 'L', 162, 13, -'A', 'E', 163, 13, +0, 0, 91, 255, +'L', 'L', 176, 13, +'A', 'E', 177, 13, 0, 0, 98, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 82, 255, -'C', 'S', 181, 13, +0, 0, 81, 255, +'C', 'S', 195, 13, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3533,7 +3547,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 155, 1, -'L', 'L', 198, 13, +'L', 'L', 212, 13, 0, 0, 129, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3550,8 +3564,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 136, 1, -0, 0, 75, 255, -'E', '_', 199, 13, +0, 0, 74, 255, +'E', '_', 213, 13, 0, 0, 157, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3578,17 +3592,17 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'N', 'T', 226, 13, +'N', 'T', 240, 13, 0, 0, 164, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'S', 'S', 233, 13, -'I', 'I', 234, 13, -'_', '_', 235, 13, -'H', 'Y', 236, 13, +'S', 'S', 247, 13, +'I', 'I', 248, 13, +'_', '_', 249, 13, +'H', 'Y', 250, 13, 0, 0, 170, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3613,24 +3627,24 @@ 0, 0, 183, 255, 0, 0, 2, 2, 0, 0, 179, 0, -'N', 'N', 17, 14, +'N', 'N', 31, 14, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'P', 20, 14, -0, 0, 105, 255, +'A', 'P', 34, 14, +0, 0, 104, 255, 0, 0, 2, 2, -0, 0, 95, 255, +0, 0, 94, 255, 0, 0, 2, 2, 0, 0, 97, 1, -'Q', 'T', 41, 14, +'Q', 'T', 55, 14, 0, 0, 201, 1, 0, 0, 234, 1, -'S', 'T', 18, 14, +'S', 'T', 32, 14, 0, 0, 199, 0, 0, 0, 162, 255, 0, 0, 253, 0, -0, 0, 128, 255, +0, 0, 127, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3640,21 +3654,21 @@ 0, 0, 21, 1, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 121, 255, +0, 0, 120, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'O', 'O', 36, 14, -'I', 'L', 37, 14, -0, 0, 118, 255, +'O', 'O', 50, 14, +'I', 'L', 51, 14, +0, 0, 117, 255, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 117, 255, +0, 0, 116, 255, 0, 0, 173, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 182, 1, -'U', 'V', 66, 14, +'U', 'V', 80, 14, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3665,19 +3679,19 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'O', 68, 14, -'A', 'P', 83, 14, +'A', 'O', 82, 14, +'A', 'P', 97, 14, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 89, 255, +0, 0, 88, 255, 0, 0, 2, 2, -'A', 'E', 112, 14, -'Q', 'Q', 117, 14, +'A', 'E', 126, 14, +'Q', 'Q', 131, 14, 0, 0, 2, 2, -'N', 'S', 149, 14, +'N', 'S', 163, 14, 0, 0, 26, 0, 0, 0, 28, 0, -0, 0, 155, 255, +0, 0, 154, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3692,7 +3706,7 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 235, 0, -'S', 'S', 99, 14, +'S', 'S', 113, 14, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3707,12 +3721,12 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 119, 255, -'T', 'T', 100, 14, -'E', 'E', 101, 14, -'R', 'R', 102, 14, -'_', '_', 103, 14, -'L', 'S', 104, 14, +0, 0, 118, 255, +'T', 'T', 114, 14, +'E', 'E', 115, 14, +'R', 'R', 116, 14, +'_', '_', 117, 14, +'L', 'S', 118, 14, 0, 0, 248, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3726,9 +3740,9 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 96, 1, -'L', 'L', 118, 14, -'_', '_', 119, 14, -'B', 'T', 120, 14, +'L', 'L', 132, 14, +'_', '_', 133, 14, +'B', 'T', 134, 14, 0, 0, 160, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3747,10 +3761,10 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'S', 'S', 139, 14, -'I', 'I', 140, 14, -'_', '_', 141, 14, -'M', 'S', 142, 14, +'S', 'S', 153, 14, +'I', 'I', 154, 14, +'_', '_', 155, 14, +'M', 'S', 156, 14, 0, 0, 169, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3758,40 +3772,40 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 168, 1, -0, 0, 38, 255, +0, 0, 37, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 229, 1, -'A', 'E', 171, 14, +'A', 'E', 185, 14, 0, 0, 2, 2, 0, 0, 2, 2, -'E', 'E', 176, 14, +'E', 'E', 190, 14, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'U', 182, 14, +'A', 'U', 196, 14, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 90, 255, +0, 0, 89, 255, 0, 0, 2, 2, 0, 0, 2, 2, -'Q', 'U', 231, 14, +'Q', 'U', 245, 14, 0, 0, 98, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 108, 0, -'O', 'O', 177, 14, -'M', 'M', 178, 14, -'C', 'E', 179, 14, +'O', 'O', 191, 14, +'M', 'M', 192, 14, +'C', 'E', 193, 14, 0, 0, 178, 255, 0, 0, 2, 2, 0, 0, 174, 255, -'S', 'S', 203, 14, +'S', 'S', 217, 14, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3812,16 +3826,16 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 28, 1, -'T', 'T', 204, 14, -'E', 'E', 205, 14, -'R', 'R', 206, 14, -'_', '_', 207, 14, -'L', 'S', 208, 14, +'T', 'T', 218, 14, +'E', 'E', 219, 14, +'R', 'R', 220, 14, +'_', '_', 221, 14, +'L', 'S', 222, 14, 0, 0, 247, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'A', 'O', 216, 14, +'A', 'O', 230, 14, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 255, 0, @@ -3839,32 +3853,32 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 133, 255, +0, 0, 132, 255, 0, 0, 174, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 55, 255, +0, 0, 54, 255, 0, 0, 229, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'E', 'E', 253, 14, +'E', 'E', 11, 15, 0, 0, 182, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 251, 0, -0, 0, 104, 255, +0, 0, 103, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 165, 1, -'O', 'O', 254, 14, -'M', 'M', 255, 14, -'C', 'E', 0, 15, +'O', 'O', 12, 15, +'M', 'M', 13, 15, +'C', 'E', 14, 15, 0, 0, 179, 255, 0, 0, 2, 2, 0, 0, 175, 255, @@ -3877,15 +3891,15 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 145, 255, -'A', 'U', 20, 15, +0, 0, 144, 255, +'A', 'U', 34, 15, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 161, 1, -'S', 'S', 41, 15, +'S', 'S', 55, 15, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3905,17 +3919,17 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 111, 255, -'T', 'T', 42, 15, -'E', 'E', 43, 15, -'R', 'R', 44, 15, -'_', '_', 45, 15, -'S', 'S', 46, 15, -'S', 'S', 47, 15, -'L', 'L', 48, 15, -'_', '_', 49, 15, -'C', 'C', 50, 15, -'A', 'I', 51, 15, +0, 0, 110, 255, +'T', 'T', 56, 15, +'E', 'E', 57, 15, +'R', 'R', 58, 15, +'_', '_', 59, 15, +'S', 'S', 60, 15, +'S', 'S', 61, 15, +'L', 'L', 62, 15, +'_', '_', 63, 15, +'C', 'C', 64, 15, +'A', 'I', 65, 15, 0, 0, 254, 0, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3925,13 +3939,13 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 0, 1, -'E', 'R', 73, 15, +'E', 'R', 87, 15, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 146, 255, -'I', 'U', 87, 15, +0, 0, 145, 255, +'I', 'U', 101, 15, 0, 0, 46, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3964,19 +3978,19 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 112, 255, -0, 0, 109, 255, +0, 0, 111, 255, +0, 0, 108, 255, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'Q', 'Q', 109, 15, +'Q', 'Q', 123, 15, 0, 0, 2, 2, -0, 0, 41, 255, -'L', 'L', 110, 15, -'_', '_', 111, 15, -'C', 'T', 112, 15, +0, 0, 40, 255, +'L', 'L', 124, 15, +'_', '_', 125, 15, +'C', 'T', 126, 15, 0, 0, 163, 1, 0, 0, 2, 2, 0, 0, 2, 2, @@ -3995,8 +4009,8 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 167, 1, -'A', 'U', 131, 15, -'S', 'X', 152, 15, +'A', 'U', 145, 15, +'S', 'X', 166, 15, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, @@ -4016,19 +4030,19 @@ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -0, 0, 110, 255, +0, 0, 109, 255, 0, 0, 245, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'_', '_', 158, 15, -'Q', 'U', 159, 15, +'_', '_', 172, 15, +'Q', 'U', 173, 15, 0, 0, 5, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, -'P', 'S', 164, 15, +'P', 'S', 178, 15, 0, 0, 7, 1, 0, 0, 2, 2, 0, 0, 2, 2, Modified: mysql-5.0.51-tritonn-1.0.8/sql/sql_yacc.cc =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/sql_yacc.cc 2007-12-10 07:01:42 UTC (rev 51) +++ mysql-5.0.51-tritonn-1.0.8/sql/sql_yacc.cc 2007-12-10 10:56:06 UTC (rev 52) @@ -2926,162 +2926,162 @@ 3555, 3558, 3559, 3560, 3561, 3562, 3565, 3566, 3567, 3579, 3580, 3583, 3584, 3587, 3588, 3592, 3593, 3594, 3597, 3598, 3599, 3600, 3613, 3614, 3615, 3618, 3619, 3623, 3624, 3627, - 3628, 3631, 3636, 3641, 3646, 3651, 3656, 3661, 3666, 3671, - 3676, 3681, 3686, 3697, 3698, 3701, 3702, 3713, 3714, 3717, - 3718, 3721, 3722, 3730, 3729, 3756, 3755, 3769, 3768, 3787, - 3786, 3806, 3804, 3824, 3825, 3827, 3828, 3829, 3830, 3831, - 3834, 3842, 3843, 3847, 3852, 3851, 3859, 3868, 3858, 3880, - 3887, 3891, 3898, 3905, 3911, 3917, 3923, 3930, 3948, 3969, - 3974, 3978, 3985, 3986, 3989, 3990, 3994, 3995, 3996, 4000, - 4001, 4002, 4005, 4006, 4007, 4008, 4016, 4015, 4026, 4034, - 4033, 4043, 4053, 4062, 4063, 4070, 4070, 4076, 4077, 4081, - 4082, 4083, 4087, 4088, 4105, 4106, 4111, 4110, 4121, 4120, - 4131, 4130, 4140, 4141, 4142, 4147, 4146, 4158, 4159, 4162, - 4163, 4166, 4167, 4168, 4172, 4171, 4184, 4183, 4200, 4201, - 4204, 4205, 4208, 4209, 4210, 4211, 4212, 4213, 4217, 4216, - 4228, 4229, 4230, 4235, 4234, 4240, 4247, 4252, 4260, 4261, - 4264, 4276, 4285, 4286, 4289, 4302, 4303, 4308, 4307, 4317, - 4318, 4321, 4334, 4334, 4344, 4345, 4354, 4355, 4364, 4373, - 4375, 4378, 4400, 4404, 4403, 4423, 4431, 4423, 4437, 4438, - 4439, 4440, 4441, 4444, 4451, 4458, 4460, 4471, 4472, 4475, - 4476, 4482, 4483, 4484, 4485, 4491, 4497, 4503, 4517, 4520, - 4522, 4528, 4538, 4539, 4540, 4553, 4573, 4580, 4587, 4588, - 4591, 4592, 4593, 4594, 4595, 4599, 4600, 4604, 4653, 4658, - 4699, 4701, 4703, 4705, 4707, 4709, 4711, 4713, 4717, 4719, - 4721, 4723, 4725, 4727, 4730, 4734, 4740, 4744, 4750, 4754, - 4762, 4764, 4770, 4773, 4775, 4777, 4778, 4780, 4783, 4785, - 4787, 4789, 4791, 4793, 4795, 4797, 4799, 4801, 4803, 4805, - 4807, 4809, 4811, 4814, 4814, 4815, 4815, 4816, 4816, 4817, - 4817, 4819, 4820, 4821, 4822, 4823, 4824, 4827, 4828, 4832, - 4837, 4838, 4845, 4846, 4847, 4848, 4849, 4851, 4852, 4853, - 4854, 4855, 4859, 4860, 4865, 4870, 4874, 4875, 4879, 4880, - 4884, 4891, 4893, 4899, 4901, 4912, 4914, 4925, 4936, 4947, - 4958, 4960, 4962, 4964, 4966, 4968, 4970, 4972, 4974, 4976, - 4978, 4980, 4982, 4988, 4990, 4992, 4997, 5002, 5004, 5006, - 5011, 5013, 5015, 5017, 5019, 5024, 5025, 5027, 5029, 5031, - 5033, 5035, 5037, 5039, 5041, 5043, 5045, 5047, 5051, 5053, - 5063, 5065, 5067, 5069, 5071, 5074, 5083, 5088, 5093, 5095, - 5097, 5099, 5101, 5103, 5105, 5107, 5112, 5117, 5119, 5121, - 5123, 5125, 5127, 5129, 5135, 5137, 5139, 5141, 5143, 5145, - 5147, 5149, 5151, 5152, 5158, 5163, 5165, 5167, 5169, 5171, - 5173, 5175, 5177, 5179, 5186, 5193, 5195, 5197, 5199, 5201, - 5203, 5205, 5207, 5209, 5211, 5213, 5215, 5217, 5219, 5221, - 5235, 5234, 5351, 5355, 5360, 5362, 5364, 5366, 5368, 5370, - 5375, 5377, 5379, 5381, 5383, 5388, 5392, 5394, 5396, 5398, - 5400, 5402, 5406, 5409, 5412, 5414, 5416, 5418, 5420, 5422, - 5424, 5427, 5430, 5432, 5434, 5436, 5438, 5440, 5443, 5445, - 5447, 5449, 5454, 5455, 5456, 5460, 5461, 5465, 5465, 5471, - 5475, 5482, 5513, 5515, 5517, 5519, 5521, 5523, 5525, 5528, - 5530, 5527, 5533, 5535, 5542, 5544, 5546, 5548, 5550, 5552, - 5554, 5556, 5558, 5561, 5560, 5575, 5574, 5589, 5595, 5601, - 5614, 5615, 5619, 5622, 5627, 5630, 5642, 5641, 5657, 5658, - 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 5667, 5671, - 5672, 5676, 5676, 5681, 5682, 5685, 5686, 5689, 5689, 5694, - 5695, 5698, 5699, 5702, 5703, 5706, 5712, 5722, 5723, 5732, - 5737, 5738, 5758, 5760, 5764, 5762, 5779, 5777, 5795, 5793, - 5800, 5809, 5807, 5825, 5824, 5834, 5845, 5843, 5862, 5861, - 5872, 5882, 5883, 5884, 5889, 5889, 5908, 5906, 5925, 5947, - 5995, 5994, 6017, 6035, 6017, 6042, 6046, 6072, 6073, 6075, - 6077, 6080, 6081, 6087, 6094, 6103, 6102, 6109, 6110, 6114, - 6118, 6122, 6128, 6136, 6145, 6146, 6147, 6148, 6149, 6150, - 6151, 6152, 6153, 6154, 6155, 6156, 6157, 6160, 6161, 6162, - 6163, 6164, 6165, 6166, 6167, 6168, 6172, 6173, 6174, 6175, - 6178, 6180, 6181, 6184, 6185, 6188, 6190, 6194, 6196, 6195, - 6209, 6212, 6211, 6226, 6232, 6245, 6247, 6250, 6252, 6256, - 6257, 6270, 6288, 6292, 6293, 6297, 6310, 6312, 6316, 6315, - 6347, 6349, 6353, 6354, 6355, 6360, 6366, 6370, 6371, 6375, - 6379, 6386, 6393, 6402, 6406, 6407, 6408, 6413, 6417, 6425, - 6426, 6427, 6428, 6429, 6430, 6434, 6435, 6436, 6437, 6438, - 6441, 6444, 6443, 6472, 6473, 6476, 6477, 6480, 6495, 6495, - 6505, 6506, 6510, 6522, 6555, 6554, 6567, 6566, 6575, 6587, - 6598, 6597, 6614, 6621, 6621, 6633, 6640, 6652, 6664, 6668, - 6674, 6684, 6685, 6688, 6696, 6697, 6700, 6710, 6711, 6715, - 6716, 6724, 6733, 6723, 6743, 6750, 6742, 6760, 6772, 6773, - 6774, 6778, 6779, 6782, 6783, 6786, 6795, 6796, 6797, 6799, - 6798, 6808, 6809, 6812, 6813, 6814, 6814, 6815, 6815, 6819, - 6820, 6823, 6825, 6828, 6836, 6837, 6841, 6842, 6847, 6846, - 6859, 6860, 6863, 6868, 6876, 6877, 6880, 6882, 6882, 6890, - 6899, 6889, 6921, 6922, 6925, 6932, 6933, 6936, 6945, 6946, - 6952, 6951, 6965, 6964, 6973, 6972, 6980, 6979, 6989, 6990, - 6993, 7000, 7013, 7014, 7018, 7019, 7022, 7023, 7024, 7027, - 7037, 7039, 7041, 7043, 7046, 7047, 7050, 7054, 7058, 7062, - 7066, 7070, 7074, 7078, 7082, 7090, 7093, 7102, 7101, 7115, - 7123, 7132, 7141, 7150, 7160, 7159, 7162, 7172, 7182, 7186, - 7191, 7190, 7195, 7205, 7210, 7216, 7221, 7226, 7228, 7230, - 7232, 7234, 7236, 7244, 7253, 7255, 7257, 7259, 7268, 7276, - 7284, 7286, 7288, 7298, 7305, 7311, 7319, 7327, 7331, 7335, - 7342, 7349, 7359, 7369, 7379, 7390, 7399, 7413, 7426, 7427, - 7429, 7431, 7434, 7435, 7438, 7439, 7442, 7443, 7446, 7447, - 7450, 7451, 7453, 7455, 7458, 7470, 7469, 7484, 7483, 7493, - 7494, 7497, 7498, 7502, 7503, 7504, 7512, 7511, 7523, 7524, - 7527, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, - 7536, 7537, 7540, 7541, 7545, 7544, 7553, 7554, 7557, 7558, - 7559, 7563, 7562, 7572, 7576, 7580, 7592, 7592, 7600, 7601, - 7602, 7607, 7617, 7616, 7632, 7650, 7661, 7668, 7678, 7649, - 7683, 7692, 7693, 7696, 7697, 7709, 7713, 7714, 7715, 7717, - 7719, 7722, 7723, 7726, 7731, 7738, 7743, 7749, 7751, 7754, - 7755, 7758, 7763, 7769, 7771, 7778, 7779, 7780, 7783, 7785, - 7790, 7791, 7796, 7797, 7803, 7821, 7829, 7834, 7853, 7855, - 7866, 7879, 7900, 7901, 7902, 7911, 7912, 7913, 7918, 7919, - 7920, 7921, 7922, 7938, 7952, 7953, 7954, 7957, 7958, 7959, - 7960, 7968, 7983, 7984, 7987, 7993, 8004, 8007, 8044, 8048, - 8056, 8060, 8128, 8143, 8167, 8168, 8184, 8194, 8197, 8198, - 8199, 8203, 8207, 8208, 8233, 8245, 8258, 8270, 8271, 8280, - 8281, 8290, 8291, 8292, 8295, 8308, 8321, 8335, 8336, 8337, - 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 8347, - 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 8357, - 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 8367, - 8368, 8369, 8370, 8371, 8381, 8382, 8383, 8384, 8385, 8386, - 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, - 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, - 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, - 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, - 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, - 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, - 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, - 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, - 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, - 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, - 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, - 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, - 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, - 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, - 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, - 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, - 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, - 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, - 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, - 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, - 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, - 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, - 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, - 8623, 8622, 8636, 8637, 8640, 8641, 8644, 8644, 8721, 8722, - 8723, 8724, 8728, 8729, 8733, 8734, 8735, 8736, 8740, 8741, - 8742, 8743, 8747, 8748, 8751, 8831, 8844, 8848, 8853, 8860, - 8875, 8888, 8909, 8916, 8954, 8997, 9011, 9012, 9013, 9014, - 9018, 9019, 9026, 9035, 9036, 9037, 9038, 9039, 9047, 9046, - 9062, 9063, 9066, 9067, 9070, 9078, 9079, 9080, 9081, 9086, - 9085, 9106, 9118, 9131, 9130, 9149, 9150, 9154, 9155, 9159, - 9160, 9161, 9162, 9164, 9163, 9174, 9175, 9176, 9177, 9178, - 9184, 9189, 9196, 9209, 9221, 9228, 9233, 9241, 9254, 9268, - 9270, 9273, 9274, 9281, 9283, 9287, 9288, 9291, 9291, 9292, - 9292, 9293, 9293, 9294, 9294, 9295, 9296, 9297, 9298, 9299, - 9300, 9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, - 9310, 9311, 9312, 9313, 9314, 9315, 9316, 9317, 9322, 9323, - 9327, 9328, 9332, 9342, 9352, 9365, 9379, 9392, 9405, 9418, - 9419, 9428, 9429, 9438, 9463, 9465, 9472, 9476, 9479, 9480, - 9483, 9504, 9505, 9509, 9513, 9517, 9524, 9525, 9528, 9529, - 9533, 9534, 9540, 9546, 9552, 9562, 9561, 9571, 9572, 9576, - 9577, 9578, 9582, 9583, 9584, 9588, 9589, 9593, 9603, 9610, - 9620, 9629, 9643, 9644, 9649, 9648, 9683, 9684, 9685, 9689, - 9689, 9713, 9714, 9718, 9719, 9720, 9724, 9729, 9728, 9748, - 9754, 9775, 9797, 9799, 9804, 9806, 9808, 9820, 9830, 9843, - 9845, 9847, 9852, 9857, 9859, 9861, 9867, 9868, 9874, 9875, - 9877, 9883, 9882, 9897, 9898, 9902, 9907, 9915, 9915, 9933, - 9942, 9955, 9956, 9958, 9960, 9973, 9971, 10048, 10047, 10057, - 10086, 10095, 10104, 10056, 10128, 10132, 10136, 10140, 10144, 10148, - 10154, 10161, 10168, 10177, 10178, 10182, 10183, 10184, 10188, 10189, - 10193, 10194, 10194, 10199, 10200 + 3628, 3631, 3636, 3641, 3646, 3651, 3656, 3661, 3666, 3672, + 3678, 3683, 3688, 3699, 3700, 3703, 3704, 3715, 3716, 3719, + 3720, 3723, 3724, 3732, 3731, 3758, 3757, 3771, 3770, 3789, + 3788, 3808, 3806, 3826, 3827, 3829, 3830, 3831, 3832, 3833, + 3836, 3844, 3845, 3849, 3854, 3853, 3861, 3870, 3860, 3882, + 3889, 3893, 3900, 3907, 3913, 3919, 3925, 3932, 3950, 3971, + 3976, 3980, 3987, 3988, 3991, 3992, 3996, 3997, 3998, 4002, + 4003, 4004, 4007, 4008, 4009, 4010, 4018, 4017, 4028, 4036, + 4035, 4045, 4055, 4064, 4065, 4072, 4072, 4078, 4079, 4083, + 4084, 4085, 4089, 4090, 4107, 4108, 4113, 4112, 4123, 4122, + 4133, 4132, 4142, 4143, 4144, 4149, 4148, 4160, 4161, 4164, + 4165, 4168, 4169, 4170, 4174, 4173, 4186, 4185, 4202, 4203, + 4206, 4207, 4210, 4211, 4212, 4213, 4214, 4215, 4219, 4218, + 4230, 4231, 4232, 4237, 4236, 4242, 4249, 4254, 4262, 4263, + 4266, 4278, 4287, 4288, 4291, 4304, 4305, 4310, 4309, 4319, + 4320, 4323, 4336, 4336, 4346, 4347, 4356, 4357, 4366, 4375, + 4377, 4380, 4402, 4406, 4405, 4425, 4433, 4425, 4439, 4440, + 4441, 4442, 4443, 4446, 4453, 4460, 4462, 4473, 4474, 4477, + 4478, 4484, 4485, 4486, 4487, 4493, 4499, 4505, 4519, 4522, + 4524, 4530, 4540, 4541, 4542, 4555, 4575, 4582, 4589, 4590, + 4593, 4594, 4595, 4596, 4597, 4601, 4602, 4606, 4655, 4660, + 4701, 4703, 4705, 4707, 4709, 4711, 4713, 4715, 4719, 4721, + 4723, 4725, 4727, 4729, 4732, 4736, 4742, 4746, 4752, 4756, + 4764, 4766, 4772, 4775, 4777, 4779, 4780, 4782, 4785, 4787, + 4789, 4791, 4793, 4795, 4797, 4799, 4801, 4803, 4805, 4807, + 4809, 4811, 4813, 4816, 4816, 4817, 4817, 4818, 4818, 4819, + 4819, 4821, 4822, 4823, 4824, 4825, 4826, 4829, 4830, 4834, + 4839, 4840, 4847, 4848, 4849, 4850, 4851, 4853, 4854, 4855, + 4856, 4857, 4861, 4862, 4867, 4872, 4876, 4877, 4881, 4882, + 4886, 4893, 4895, 4901, 4903, 4914, 4916, 4927, 4938, 4949, + 4960, 4962, 4964, 4966, 4968, 4970, 4972, 4974, 4976, 4978, + 4980, 4982, 4984, 4990, 4992, 4994, 4999, 5004, 5006, 5008, + 5013, 5015, 5017, 5019, 5021, 5026, 5027, 5029, 5031, 5033, + 5035, 5037, 5039, 5041, 5043, 5045, 5047, 5049, 5053, 5055, + 5065, 5067, 5069, 5071, 5073, 5076, 5085, 5090, 5095, 5097, + 5099, 5101, 5103, 5105, 5107, 5109, 5114, 5119, 5121, 5123, + 5125, 5127, 5129, 5131, 5137, 5139, 5141, 5143, 5145, 5147, + 5149, 5151, 5153, 5154, 5160, 5165, 5167, 5169, 5171, 5173, + 5175, 5177, 5179, 5181, 5188, 5195, 5197, 5199, 5201, 5203, + 5205, 5207, 5209, 5211, 5213, 5215, 5217, 5219, 5221, 5223, + 5237, 5236, 5353, 5357, 5362, 5364, 5366, 5368, 5370, 5372, + 5377, 5379, 5381, 5383, 5385, 5390, 5394, 5396, 5398, 5400, + 5402, 5404, 5408, 5411, 5414, 5416, 5418, 5420, 5422, 5424, + 5426, 5429, 5432, 5434, 5436, 5438, 5440, 5442, 5445, 5447, + 5449, 5451, 5456, 5457, 5458, 5462, 5463, 5467, 5467, 5473, + 5477, 5484, 5515, 5517, 5519, 5521, 5523, 5525, 5527, 5530, + 5532, 5529, 5535, 5537, 5544, 5546, 5548, 5550, 5552, 5554, + 5556, 5558, 5560, 5563, 5562, 5577, 5576, 5591, 5597, 5603, + 5616, 5617, 5621, 5624, 5629, 5632, 5644, 5643, 5659, 5660, + 5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5673, + 5674, 5678, 5678, 5683, 5684, 5687, 5688, 5691, 5691, 5696, + 5697, 5700, 5701, 5704, 5705, 5708, 5714, 5724, 5725, 5734, + 5739, 5740, 5760, 5762, 5766, 5764, 5781, 5779, 5797, 5795, + 5802, 5811, 5809, 5827, 5826, 5836, 5847, 5845, 5864, 5863, + 5874, 5884, 5885, 5886, 5891, 5891, 5910, 5908, 5927, 5949, + 5997, 5996, 6019, 6037, 6019, 6044, 6048, 6074, 6075, 6077, + 6079, 6082, 6083, 6089, 6096, 6105, 6104, 6111, 6112, 6116, + 6120, 6124, 6130, 6138, 6147, 6148, 6149, 6150, 6151, 6152, + 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6162, 6163, 6164, + 6165, 6166, 6167, 6168, 6169, 6170, 6174, 6175, 6176, 6177, + 6180, 6182, 6183, 6186, 6187, 6190, 6192, 6196, 6198, 6197, + 6211, 6214, 6213, 6228, 6234, 6247, 6249, 6252, 6254, 6258, + 6259, 6272, 6290, 6294, 6295, 6299, 6312, 6314, 6318, 6317, + 6349, 6351, 6355, 6356, 6357, 6362, 6368, 6372, 6373, 6377, + 6381, 6388, 6395, 6404, 6408, 6409, 6410, 6415, 6419, 6427, + 6428, 6429, 6430, 6431, 6432, 6436, 6437, 6438, 6439, 6440, + 6443, 6446, 6445, 6474, 6475, 6478, 6479, 6482, 6497, 6497, + 6507, 6508, 6512, 6524, 6557, 6556, 6569, 6568, 6577, 6589, + 6600, 6599, 6616, 6623, 6623, 6635, 6642, 6654, 6666, 6670, + 6676, 6686, 6687, 6690, 6698, 6699, 6702, 6712, 6713, 6717, + 6718, 6726, 6735, 6725, 6745, 6752, 6744, 6762, 6774, 6775, + 6776, 6780, 6781, 6784, 6785, 6788, 6797, 6798, 6799, 6801, + 6800, 6810, 6811, 6814, 6815, 6816, 6816, 6817, 6817, 6821, + 6822, 6825, 6827, 6830, 6838, 6839, 6843, 6844, 6849, 6848, + 6861, 6862, 6865, 6870, 6878, 6879, 6882, 6884, 6884, 6892, + 6901, 6891, 6923, 6924, 6927, 6934, 6935, 6938, 6947, 6948, + 6954, 6953, 6967, 6966, 6975, 6974, 6982, 6981, 6991, 6992, + 6995, 7002, 7015, 7016, 7020, 7021, 7024, 7025, 7026, 7029, + 7039, 7041, 7043, 7045, 7048, 7049, 7052, 7056, 7060, 7064, + 7068, 7072, 7076, 7080, 7084, 7092, 7095, 7104, 7103, 7117, + 7125, 7134, 7143, 7152, 7162, 7161, 7164, 7174, 7184, 7188, + 7193, 7192, 7197, 7207, 7212, 7218, 7223, 7228, 7230, 7232, + 7234, 7236, 7238, 7246, 7255, 7257, 7259, 7261, 7270, 7278, + 7286, 7288, 7290, 7300, 7307, 7313, 7321, 7329, 7333, 7337, + 7344, 7351, 7361, 7371, 7381, 7392, 7401, 7415, 7428, 7429, + 7431, 7433, 7436, 7437, 7440, 7441, 7444, 7445, 7448, 7449, + 7452, 7453, 7455, 7457, 7460, 7472, 7471, 7486, 7485, 7495, + 7496, 7499, 7500, 7504, 7505, 7506, 7514, 7513, 7525, 7526, + 7529, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 7537, + 7538, 7539, 7542, 7543, 7547, 7546, 7555, 7556, 7559, 7560, + 7561, 7565, 7564, 7574, 7578, 7582, 7594, 7594, 7602, 7603, + 7604, 7609, 7619, 7618, 7634, 7652, 7663, 7670, 7680, 7651, + 7685, 7694, 7695, 7698, 7699, 7711, 7715, 7716, 7717, 7719, + 7721, 7724, 7725, 7728, 7733, 7740, 7745, 7751, 7753, 7756, + 7757, 7760, 7765, 7771, 7773, 7780, 7781, 7782, 7785, 7787, + 7792, 7793, 7798, 7799, 7805, 7823, 7831, 7836, 7855, 7857, + 7868, 7881, 7902, 7903, 7904, 7913, 7914, 7915, 7920, 7921, + 7922, 7923, 7924, 7940, 7954, 7955, 7956, 7959, 7960, 7961, + 7962, 7970, 7985, 7986, 7989, 7995, 8006, 8009, 8046, 8050, + 8058, 8062, 8130, 8145, 8169, 8170, 8186, 8196, 8199, 8200, + 8201, 8205, 8209, 8210, 8235, 8247, 8260, 8272, 8273, 8282, + 8283, 8292, 8293, 8294, 8297, 8310, 8323, 8337, 8338, 8339, + 8340, 8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, + 8350, 8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, + 8360, 8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, + 8370, 8371, 8372, 8373, 8383, 8384, 8385, 8386, 8387, 8388, + 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, + 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, + 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, + 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, + 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, + 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, + 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, + 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, + 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, + 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, + 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, + 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, + 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, + 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, + 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, + 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, + 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, + 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, + 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, + 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, + 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, + 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, + 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, + 8625, 8624, 8638, 8639, 8642, 8643, 8646, 8646, 8723, 8724, + 8725, 8726, 8730, 8731, 8735, 8736, 8737, 8738, 8742, 8743, + 8744, 8745, 8749, 8750, 8753, 8833, 8846, 8850, 8855, 8862, + 8877, 8890, 8911, 8918, 8956, 8999, 9013, 9014, 9015, 9016, + 9020, 9021, 9028, 9037, 9038, 9039, 9040, 9041, 9049, 9048, + 9064, 9065, 9068, 9069, 9072, 9080, 9081, 9082, 9083, 9088, + 9087, 9108, 9120, 9133, 9132, 9151, 9152, 9156, 9157, 9161, + 9162, 9163, 9164, 9166, 9165, 9176, 9177, 9178, 9179, 9180, + 9186, 9191, 9198, 9211, 9223, 9230, 9235, 9243, 9256, 9270, + 9272, 9275, 9276, 9283, 9285, 9289, 9290, 9293, 9293, 9294, + 9294, 9295, 9295, 9296, 9296, 9297, 9298, 9299, 9300, 9301, + 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, + 9312, 9313, 9314, 9315, 9316, 9317, 9318, 9319, 9324, 9325, + 9329, 9330, 9334, 9344, 9354, 9367, 9381, 9394, 9407, 9420, + 9421, 9430, 9431, 9440, 9465, 9467, 9474, 9478, 9481, 9482, + 9485, 9506, 9507, 9511, 9515, 9519, 9526, 9527, 9530, 9531, + 9535, 9536, 9542, 9548, 9554, 9564, 9563, 9573, 9574, 9578, + 9579, 9580, 9584, 9585, 9586, 9590, 9591, 9595, 9605, 9612, + 9622, 9631, 9645, 9646, 9651, 9650, 9685, 9686, 9687, 9691, + 9691, 9715, 9716, 9720, 9721, 9722, 9726, 9731, 9730, 9750, + 9756, 9777, 9799, 9801, 9806, 9808, 9810, 9822, 9832, 9845, + 9847, 9849, 9854, 9859, 9861, 9863, 9869, 9870, 9876, 9877, + 9879, 9885, 9884, 9899, 9900, 9904, 9909, 9917, 9917, 9935, + 9944, 9957, 9958, 9960, 9962, 9975, 9973, 10050, 10049, 10059, + 10088, 10097, 10106, 10058, 10130, 10134, 10138, 10142, 10146, 10150, + 10156, 10163, 10170, 10179, 10180, 10184, 10185, 10186, 10190, 10191, + 10195, 10196, 10196, 10201, 10202 }; #endif @@ -18167,22 +18167,24 @@ #line 3666 "sql_yacc.yy" { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_NGRAM; Lex->senna_flags |= SEN_INDEX_DELIMITED; #endif /* ENABLE_SENNA */ } break; case 529: -#line 3671 "sql_yacc.yy" +#line 3672 "sql_yacc.yy" { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_DELIMITED; Lex->senna_flags &= ~SEN_INDEX_NGRAM; #endif /* ENABLE_SENNA */ } break; case 530: -#line 3676 "sql_yacc.yy" +#line 3678 "sql_yacc.yy" { #ifdef ENABLE_SENNA Lex->senna_flags |= SEN_INDEX_NGRAM; @@ -18191,7 +18193,7 @@ break; case 531: -#line 3681 "sql_yacc.yy" +#line 3683 "sql_yacc.yy" { #ifdef ENABLE_SENNA Lex->senna_flags |= 0x00080000; @@ -18200,7 +18202,7 @@ break; case 532: -#line 3686 "sql_yacc.yy" +#line 3688 "sql_yacc.yy" { #ifdef ENABLE_SENNA if ((yyvsp[(1) - (1)].ulong_num) < 65536) { @@ -18213,22 +18215,22 @@ break; case 533: -#line 3697 "sql_yacc.yy" +#line 3699 "sql_yacc.yy" { Lex->col_list.push_back((yyvsp[(3) - (4)].key_part)); } break; case 534: -#line 3698 "sql_yacc.yy" +#line 3700 "sql_yacc.yy" { Lex->col_list.push_back((yyvsp[(1) - (2)].key_part)); } break; case 535: -#line 3701 "sql_yacc.yy" +#line 3703 "sql_yacc.yy" { (yyval.key_part)=new key_part_spec((yyvsp[(1) - (1)].lex_str).str); } break; case 536: -#line 3703 "sql_yacc.yy" +#line 3705 "sql_yacc.yy" { int key_part_len= atoi((yyvsp[(3) - (4)].lex_str).str); if (!key_part_len) @@ -18240,37 +18242,37 @@ break; case 537: -#line 3713 "sql_yacc.yy" +#line 3715 "sql_yacc.yy" { (yyval.simple_string)=(char*) 0; } break; case 538: -#line 3714 "sql_yacc.yy" +#line 3716 "sql_yacc.yy" { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str; } break; case 539: -#line 3717 "sql_yacc.yy" +#line 3719 "sql_yacc.yy" { (yyval.lex_str)= null_lex_str; } break; case 540: -#line 3718 "sql_yacc.yy" +#line 3720 "sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(2) - (2)].lex_str); } break; case 541: -#line 3721 "sql_yacc.yy" +#line 3723 "sql_yacc.yy" { Lex->interval_list.push_back((yyvsp[(1) - (1)].string)); } break; case 542: -#line 3722 "sql_yacc.yy" +#line 3724 "sql_yacc.yy" { Lex->interval_list.push_back((yyvsp[(3) - (3)].string)); } break; case 543: -#line 3730 "sql_yacc.yy" +#line 3732 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -18297,12 +18299,12 @@ break; case 544: -#line 3754 "sql_yacc.yy" +#line 3756 "sql_yacc.yy" {} break; case 545: -#line 3756 "sql_yacc.yy" +#line 3758 "sql_yacc.yy" { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -18310,7 +18312,7 @@ break; case 546: -#line 3761 "sql_yacc.yy" +#line 3763 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_ALTER_DB; @@ -18321,7 +18323,7 @@ break; case 547: -#line 3769 "sql_yacc.yy" +#line 3771 "sql_yacc.yy" { LEX *lex= Lex; @@ -18335,7 +18337,7 @@ break; case 548: -#line 3780 "sql_yacc.yy" +#line 3782 "sql_yacc.yy" { LEX *lex=Lex; @@ -18345,7 +18347,7 @@ break; case 549: -#line 3787 "sql_yacc.yy" +#line 3789 "sql_yacc.yy" { LEX *lex= Lex; @@ -18359,7 +18361,7 @@ break; case 550: -#line 3798 "sql_yacc.yy" +#line 3800 "sql_yacc.yy" { LEX *lex=Lex; @@ -18369,7 +18371,7 @@ break; case 551: -#line 3806 "sql_yacc.yy" +#line 3808 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -18386,32 +18388,32 @@ break; case 552: -#line 3820 "sql_yacc.yy" +#line 3822 "sql_yacc.yy" {} break; case 553: -#line 3824 "sql_yacc.yy" +#line 3826 "sql_yacc.yy" { (yyval.simple_string)= 0; } break; case 554: -#line 3825 "sql_yacc.yy" +#line 3827 "sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(1) - (1)].lex_str).str; } break; case 556: -#line 3828 "sql_yacc.yy" +#line 3830 "sql_yacc.yy" { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; } break; case 557: -#line 3829 "sql_yacc.yy" +#line 3831 "sql_yacc.yy" { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; } break; case 560: -#line 3835 "sql_yacc.yy" +#line 3837 "sql_yacc.yy" { LEX *lex=Lex; lex->change=0; @@ -18420,26 +18422,26 @@ break; case 561: -#line 3842 "sql_yacc.yy" +#line 3844 "sql_yacc.yy" { } break; case 562: -#line 3844 "sql_yacc.yy" +#line 3846 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_ADD_INDEX; } break; case 563: -#line 3848 "sql_yacc.yy" +#line 3850 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_ADD_COLUMN | ALTER_ADD_INDEX; } break; case 564: -#line 3852 "sql_yacc.yy" +#line 3854 "sql_yacc.yy" { LEX *lex=Lex; lex->change= (yyvsp[(3) - (3)].lex_str).str; @@ -18448,7 +18450,7 @@ break; case 566: -#line 3859 "sql_yacc.yy" +#line 3861 "sql_yacc.yy" { LEX *lex=Lex; lex->length=lex->dec=0; lex->type=0; @@ -18460,7 +18462,7 @@ break; case 567: -#line 3868 "sql_yacc.yy" +#line 3870 "sql_yacc.yy" { LEX *lex=Lex; if (add_field_to_list(lex->thd,(yyvsp[(3) - (6)].lex_str).str, @@ -18475,7 +18477,7 @@ break; case 569: -#line 3881 "sql_yacc.yy" +#line 3883 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN, @@ -18485,14 +18487,14 @@ break; case 570: -#line 3888 "sql_yacc.yy" +#line 3890 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_DROP_INDEX; } break; case 571: -#line 3892 "sql_yacc.yy" +#line 3894 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, @@ -18502,7 +18504,7 @@ break; case 572: -#line 3899 "sql_yacc.yy" +#line 3901 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, @@ -18512,7 +18514,7 @@ break; case 573: -#line 3906 "sql_yacc.yy" +#line 3908 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= DISABLE; @@ -18521,7 +18523,7 @@ break; case 574: -#line 3912 "sql_yacc.yy" +#line 3914 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= ENABLE; @@ -18530,7 +18532,7 @@ break; case 575: -#line 3918 "sql_yacc.yy" +#line 3920 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.alter_list.push_back(new Alter_column((yyvsp[(3) - (6)].lex_str).str,(yyvsp[(6) - (6)].item))); @@ -18539,7 +18541,7 @@ break; case 576: -#line 3924 "sql_yacc.yy" +#line 3926 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.alter_list.push_back(new Alter_column((yyvsp[(3) - (5)].lex_str).str, @@ -18549,7 +18551,7 @@ break; case 577: -#line 3931 "sql_yacc.yy" +#line 3933 "sql_yacc.yy" { LEX *lex=Lex; lex->select_lex.db=(yyvsp[(3) - (3)].table)->db.str; @@ -18570,7 +18572,7 @@ break; case 578: -#line 3949 "sql_yacc.yy" +#line 3951 "sql_yacc.yy" { if (!(yyvsp[(4) - (5)].charset)) { @@ -18594,7 +18596,7 @@ break; case 579: -#line 3970 "sql_yacc.yy" +#line 3972 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= ALTER_OPTIONS; @@ -18602,14 +18604,14 @@ break; case 580: -#line 3975 "sql_yacc.yy" +#line 3977 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_FORCE; } break; case 581: -#line 3979 "sql_yacc.yy" +#line 3981 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= ALTER_ORDER; @@ -18617,77 +18619,77 @@ break; case 582: -#line 3985 "sql_yacc.yy" +#line 3987 "sql_yacc.yy" {} break; case 583: -#line 3986 "sql_yacc.yy" +#line 3988 "sql_yacc.yy" {} break; case 584: -#line 3989 "sql_yacc.yy" +#line 3991 "sql_yacc.yy" { Lex->ignore= 0;} break; case 585: -#line 3990 "sql_yacc.yy" +#line 3992 "sql_yacc.yy" { Lex->ignore= 1;} break; case 586: -#line 3994 "sql_yacc.yy" +#line 3996 "sql_yacc.yy" { Lex->drop_mode= DROP_DEFAULT; } break; case 587: -#line 3995 "sql_yacc.yy" +#line 3997 "sql_yacc.yy" { Lex->drop_mode= DROP_RESTRICT; } break; case 588: -#line 3996 "sql_yacc.yy" +#line 3998 "sql_yacc.yy" { Lex->drop_mode= DROP_CASCADE; } break; case 589: -#line 4000 "sql_yacc.yy" +#line 4002 "sql_yacc.yy" {} break; case 590: -#line 4001 "sql_yacc.yy" +#line 4003 "sql_yacc.yy" { store_position_for_column((yyvsp[(2) - (2)].lex_str).str); } break; case 591: -#line 4002 "sql_yacc.yy" +#line 4004 "sql_yacc.yy" { store_position_for_column(first_keyword); } break; case 592: -#line 4005 "sql_yacc.yy" +#line 4007 "sql_yacc.yy" {} break; case 593: -#line 4006 "sql_yacc.yy" +#line 4008 "sql_yacc.yy" {} break; case 594: -#line 4007 "sql_yacc.yy" +#line 4009 "sql_yacc.yy" {} break; case 595: -#line 4008 "sql_yacc.yy" +#line 4010 "sql_yacc.yy" {} break; case 596: -#line 4016 "sql_yacc.yy" +#line 4018 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -18699,12 +18701,12 @@ break; case 597: -#line 4025 "sql_yacc.yy" +#line 4027 "sql_yacc.yy" {} break; case 598: -#line 4027 "sql_yacc.yy" +#line 4029 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -18714,7 +18716,7 @@ break; case 599: -#line 4034 "sql_yacc.yy" +#line 4036 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -18725,12 +18727,12 @@ break; case 600: -#line 4042 "sql_yacc.yy" +#line 4044 "sql_yacc.yy" {} break; case 601: -#line 4044 "sql_yacc.yy" +#line 4046 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -18739,7 +18741,7 @@ break; case 602: -#line 4054 "sql_yacc.yy" +#line 4056 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_BEGIN; @@ -18748,49 +18750,49 @@ break; case 603: -#line 4062 "sql_yacc.yy" +#line 4064 "sql_yacc.yy" { (yyval.num) = 0; } break; case 604: -#line 4064 "sql_yacc.yy" +#line 4066 "sql_yacc.yy" { (yyval.num)= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; } break; case 605: -#line 4070 "sql_yacc.yy" +#line 4072 "sql_yacc.yy" { Lex->slave_thd_opt= 0; } break; case 606: -#line 4072 "sql_yacc.yy" +#line 4074 "sql_yacc.yy" {} break; case 609: -#line 4081 "sql_yacc.yy" +#line 4083 "sql_yacc.yy" {} break; case 610: -#line 4082 "sql_yacc.yy" +#line 4084 "sql_yacc.yy" { Lex->slave_thd_opt|=SLAVE_SQL; } break; case 611: -#line 4083 "sql_yacc.yy" +#line 4085 "sql_yacc.yy" { Lex->slave_thd_opt|=SLAVE_IO; } break; case 612: -#line 4087 "sql_yacc.yy" +#line 4089 "sql_yacc.yy" {} break; case 613: -#line 4089 "sql_yacc.yy" +#line 4091 "sql_yacc.yy" { LEX *lex=Lex; if ((lex->mi.log_file_name || lex->mi.pos) && @@ -18807,35 +18809,35 @@ break; case 616: -#line 4111 "sql_yacc.yy" +#line 4113 "sql_yacc.yy" { Lex->sql_command = SQLCOM_RESTORE_TABLE; } break; case 617: -#line 4115 "sql_yacc.yy" +#line 4117 "sql_yacc.yy" { Lex->backup_dir = (yyvsp[(6) - (6)].lex_str).str; } break; case 618: -#line 4121 "sql_yacc.yy" +#line 4123 "sql_yacc.yy" { Lex->sql_command = SQLCOM_BACKUP_TABLE; } break; case 619: -#line 4125 "sql_yacc.yy" +#line 4127 "sql_yacc.yy" { Lex->backup_dir = (yyvsp[(6) - (6)].lex_str).str; } break; case 620: -#line 4131 "sql_yacc.yy" +#line 4133 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_CHECKSUM; @@ -18843,27 +18845,27 @@ break; case 621: -#line 4136 "sql_yacc.yy" +#line 4138 "sql_yacc.yy" {} break; case 622: -#line 4140 "sql_yacc.yy" +#line 4142 "sql_yacc.yy" { Lex->check_opt.flags= 0; } break; case 623: -#line 4141 "sql_yacc.yy" +#line 4143 "sql_yacc.yy" { Lex->check_opt.flags= T_QUICK; } break; case 624: -#line 4142 "sql_yacc.yy" +#line 4144 "sql_yacc.yy" { Lex->check_opt.flags= T_EXTEND; } break; case 625: -#line 4147 "sql_yacc.yy" +#line 4149 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPAIR; @@ -18873,47 +18875,47 @@ break; case 626: -#line 4154 "sql_yacc.yy" +#line 4156 "sql_yacc.yy" {} break; case 627: -#line 4158 "sql_yacc.yy" +#line 4160 "sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 628: -#line 4159 "sql_yacc.yy" +#line 4161 "sql_yacc.yy" {} break; case 629: -#line 4162 "sql_yacc.yy" +#line 4164 "sql_yacc.yy" {} break; case 630: -#line 4163 "sql_yacc.yy" +#line 4165 "sql_yacc.yy" {} break; case 631: -#line 4166 "sql_yacc.yy" +#line 4168 "sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 632: -#line 4167 "sql_yacc.yy" +#line 4169 "sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 633: -#line 4168 "sql_yacc.yy" +#line 4170 "sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_USEFRM; } break; case 634: -#line 4172 "sql_yacc.yy" +#line 4174 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_ANALYZE; @@ -18923,12 +18925,12 @@ break; case 635: -#line 4179 "sql_yacc.yy" +#line 4181 "sql_yacc.yy" {} break; case 636: -#line 4184 "sql_yacc.yy" +#line 4186 "sql_yacc.yy" { LEX *lex=Lex; @@ -18943,62 +18945,62 @@ break; case 637: -#line 4196 "sql_yacc.yy" +#line 4198 "sql_yacc.yy" {} break; case 638: -#line 4200 "sql_yacc.yy" +#line 4202 "sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 639: -#line 4201 "sql_yacc.yy" +#line 4203 "sql_yacc.yy" {} break; case 640: -#line 4204 "sql_yacc.yy" +#line 4206 "sql_yacc.yy" {} break; case 641: -#line 4205 "sql_yacc.yy" +#line 4207 "sql_yacc.yy" {} break; case 642: -#line 4208 "sql_yacc.yy" +#line 4210 "sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 643: -#line 4209 "sql_yacc.yy" +#line 4211 "sql_yacc.yy" { Lex->check_opt.flags|= T_FAST; } break; case 644: -#line 4210 "sql_yacc.yy" +#line 4212 "sql_yacc.yy" { Lex->check_opt.flags|= T_MEDIUM; } break; case 645: -#line 4211 "sql_yacc.yy" +#line 4213 "sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 646: -#line 4212 "sql_yacc.yy" +#line 4214 "sql_yacc.yy" { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; } break; case 647: -#line 4213 "sql_yacc.yy" +#line 4215 "sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; } break; case 648: -#line 4217 "sql_yacc.yy" +#line 4219 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_OPTIMIZE; @@ -19008,46 +19010,46 @@ break; case 649: -#line 4224 "sql_yacc.yy" +#line 4226 "sql_yacc.yy" {} break; case 650: -#line 4228 "sql_yacc.yy" +#line 4230 "sql_yacc.yy" { (yyval.num)= 0; } break; case 651: -#line 4229 "sql_yacc.yy" +#line 4231 "sql_yacc.yy" { (yyval.num)= 1; } break; case 652: -#line 4230 "sql_yacc.yy" +#line 4232 "sql_yacc.yy" { (yyval.num)= 1; } break; case 653: -#line 4235 "sql_yacc.yy" +#line 4237 "sql_yacc.yy" { Lex->sql_command= SQLCOM_RENAME_TABLE; } break; case 654: -#line 4239 "sql_yacc.yy" +#line 4241 "sql_yacc.yy" {} break; case 655: -#line 4241 "sql_yacc.yy" +#line 4243 "sql_yacc.yy" { Lex->sql_command = SQLCOM_RENAME_USER; } break; case 656: -#line 4248 "sql_yacc.yy" +#line 4250 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (3)].lex_user)) || Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -19055,7 +19057,7 @@ break; case 657: -#line 4253 "sql_yacc.yy" +#line 4255 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (5)].lex_user)) || Lex->users_list.push_back((yyvsp[(5) - (5)].lex_user))) MYSQL_YYABORT; @@ -19063,7 +19065,7 @@ break; case 660: -#line 4265 "sql_yacc.yy" +#line 4267 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sl= lex->current_select; @@ -19076,7 +19078,7 @@ break; case 661: -#line 4277 "sql_yacc.yy" +#line 4279 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE; @@ -19085,7 +19087,7 @@ break; case 664: -#line 4290 "sql_yacc.yy" +#line 4292 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -19098,17 +19100,17 @@ break; case 665: -#line 4302 "sql_yacc.yy" +#line 4304 "sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 666: -#line 4303 "sql_yacc.yy" +#line 4305 "sql_yacc.yy" { (yyval.lex_str) = default_key_cache_base; } break; case 667: -#line 4308 "sql_yacc.yy" +#line 4310 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; @@ -19116,12 +19118,12 @@ break; case 668: -#line 4313 "sql_yacc.yy" +#line 4315 "sql_yacc.yy" {} break; case 671: -#line 4322 "sql_yacc.yy" +#line 4324 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -19134,12 +19136,12 @@ break; case 672: -#line 4334 "sql_yacc.yy" +#line 4336 "sql_yacc.yy" { Select->interval_list.empty(); } break; case 673: -#line 4336 "sql_yacc.yy" +#line 4338 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -19148,12 +19150,12 @@ break; case 674: -#line 4344 "sql_yacc.yy" +#line 4346 "sql_yacc.yy" { Lex->select_lex.use_index_ptr= 0; } break; case 675: -#line 4346 "sql_yacc.yy" +#line 4348 "sql_yacc.yy" { SELECT_LEX *sel= &Lex->select_lex; sel->use_index_ptr= &sel->use_index; @@ -19161,17 +19163,17 @@ break; case 676: -#line 4354 "sql_yacc.yy" +#line 4356 "sql_yacc.yy" { (yyval.num)= 0; } break; case 677: -#line 4355 "sql_yacc.yy" +#line 4357 "sql_yacc.yy" { (yyval.num)= TL_OPTION_IGNORE_LEAVES; } break; case 678: -#line 4365 "sql_yacc.yy" +#line 4367 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -19179,7 +19181,7 @@ break; case 681: -#line 4379 "sql_yacc.yy" +#line 4381 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -19204,7 +19206,7 @@ break; case 683: -#line 4404 "sql_yacc.yy" +#line 4406 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -19223,7 +19225,7 @@ break; case 685: -#line 4423 "sql_yacc.yy" +#line 4425 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -19234,19 +19236,19 @@ break; case 686: -#line 4431 "sql_yacc.yy" +#line 4433 "sql_yacc.yy" { Select->parsing_place= NO_MATTER; } break; case 688: -#line 4437 "sql_yacc.yy" +#line 4439 "sql_yacc.yy" {} break; case 693: -#line 4446 "sql_yacc.yy" +#line 4448 "sql_yacc.yy" { Select->context.table_list= Select->context.first_name_resolution_table= @@ -19255,7 +19257,7 @@ break; case 696: -#line 4461 "sql_yacc.yy" +#line 4463 "sql_yacc.yy" { if (test_all_bits(Select->options, SELECT_ALL | SELECT_DISTINCT)) { @@ -19266,12 +19268,12 @@ break; case 699: -#line 4475 "sql_yacc.yy" +#line 4477 "sql_yacc.yy" { Select->options|= SELECT_STRAIGHT_JOIN; } break; case 700: -#line 4477 "sql_yacc.yy" +#line 4479 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19280,22 +19282,22 @@ break; case 701: -#line 4482 "sql_yacc.yy" +#line 4484 "sql_yacc.yy" { Select->options|= SELECT_DISTINCT; } break; case 702: -#line 4483 "sql_yacc.yy" +#line 4485 "sql_yacc.yy" { Select->options|= SELECT_SMALL_RESULT; } break; case 703: -#line 4484 "sql_yacc.yy" +#line 4486 "sql_yacc.yy" { Select->options|= SELECT_BIG_RESULT; } break; case 704: -#line 4486 "sql_yacc.yy" +#line 4488 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19304,7 +19306,7 @@ break; case 705: -#line 4492 "sql_yacc.yy" +#line 4494 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19313,7 +19315,7 @@ break; case 706: -#line 4498 "sql_yacc.yy" +#line 4500 "sql_yacc.yy" { Lex->safe_to_cache_query=0; Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE; @@ -19322,7 +19324,7 @@ break; case 707: -#line 4504 "sql_yacc.yy" +#line 4506 "sql_yacc.yy" { /* Honor this flag only if SQL_NO_CACHE wasn't specified AND @@ -19339,12 +19341,12 @@ break; case 708: -#line 4517 "sql_yacc.yy" +#line 4519 "sql_yacc.yy" { Select->options|= SELECT_ALL; } break; case 710: -#line 4523 "sql_yacc.yy" +#line 4525 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select->set_lock_for_tables(TL_WRITE); @@ -19353,7 +19355,7 @@ break; case 711: -#line 4529 "sql_yacc.yy" +#line 4531 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select-> @@ -19363,7 +19365,7 @@ break; case 714: -#line 4541 "sql_yacc.yy" +#line 4543 "sql_yacc.yy" { THD *thd= YYTHD; if (add_item_to_list(thd, @@ -19376,7 +19378,7 @@ break; case 715: -#line 4554 "sql_yacc.yy" +#line 4556 "sql_yacc.yy" { THD *thd= YYTHD; DBUG_ASSERT((yyvsp[(1) - (4)].simple_string) < (yyvsp[(3) - (4)].simple_string)); @@ -19396,7 +19398,7 @@ break; case 716: -#line 4573 "sql_yacc.yy" +#line 4575 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; @@ -19405,7 +19407,7 @@ break; case 717: -#line 4580 "sql_yacc.yy" +#line 4582 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; @@ -19414,52 +19416,52 @@ break; case 718: -#line 4587 "sql_yacc.yy" +#line 4589 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 719: -#line 4588 "sql_yacc.yy" +#line 4590 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 720: -#line 4591 "sql_yacc.yy" +#line 4593 "sql_yacc.yy" { (yyval.lex_str)=null_lex_str;} break; case 721: -#line 4592 "sql_yacc.yy" +#line 4594 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 722: -#line 4593 "sql_yacc.yy" +#line 4595 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 723: -#line 4594 "sql_yacc.yy" +#line 4596 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 724: -#line 4595 "sql_yacc.yy" +#line 4597 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 725: -#line 4599 "sql_yacc.yy" +#line 4601 "sql_yacc.yy" {} break; case 726: -#line 4600 "sql_yacc.yy" +#line 4602 "sql_yacc.yy" {} break; case 727: -#line 4605 "sql_yacc.yy" +#line 4607 "sql_yacc.yy" { /* Design notes: @@ -19511,7 +19513,7 @@ break; case 728: -#line 4654 "sql_yacc.yy" +#line 4656 "sql_yacc.yy" { /* XOR is a proprietary extension */ (yyval.item) = new (YYTHD->mem_root) Item_cond_xor((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item)); @@ -19519,7 +19521,7 @@ break; case 729: -#line 4659 "sql_yacc.yy" +#line 4661 "sql_yacc.yy" { /* See comments in rule expr: expr or expr */ Item_cond_and *item1; @@ -19563,74 +19565,74 @@ break; case 730: -#line 4700 "sql_yacc.yy" +#line 4702 "sql_yacc.yy" { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); } break; case 731: -#line 4702 "sql_yacc.yy" +#line 4704 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_istrue((yyvsp[(1) - (3)].item)); } break; case 732: -#line 4704 "sql_yacc.yy" +#line 4706 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnottrue((yyvsp[(1) - (4)].item)); } break; case 733: -#line 4706 "sql_yacc.yy" +#line 4708 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isfalse((yyvsp[(1) - (3)].item)); } break; case 734: -#line 4708 "sql_yacc.yy" +#line 4710 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnotfalse((yyvsp[(1) - (4)].item)); } break; case 735: -#line 4710 "sql_yacc.yy" +#line 4712 "sql_yacc.yy" { (yyval.item)= new Item_func_isnull((yyvsp[(1) - (3)].item)); } break; case 736: -#line 4712 "sql_yacc.yy" +#line 4714 "sql_yacc.yy" { (yyval.item)= new Item_func_isnotnull((yyvsp[(1) - (4)].item)); } break; case 738: -#line 4718 "sql_yacc.yy" +#line 4720 "sql_yacc.yy" { (yyval.item)= new Item_func_isnull((yyvsp[(1) - (3)].item)); } break; case 739: -#line 4720 "sql_yacc.yy" +#line 4722 "sql_yacc.yy" { (yyval.item)= new Item_func_isnotnull((yyvsp[(1) - (4)].item)); } break; case 740: -#line 4722 "sql_yacc.yy" +#line 4724 "sql_yacc.yy" { (yyval.item)= new Item_func_equal((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 741: -#line 4724 "sql_yacc.yy" +#line 4726 "sql_yacc.yy" { (yyval.item)= (*(yyvsp[(2) - (3)].boolfunc2creator))(0)->create((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 742: -#line 4726 "sql_yacc.yy" +#line 4728 "sql_yacc.yy" { (yyval.item)= all_any_subquery_creator((yyvsp[(1) - (6)].item), (yyvsp[(2) - (6)].boolfunc2creator), (yyvsp[(3) - (6)].num), (yyvsp[(5) - (6)].select_lex)); } break; case 744: -#line 4731 "sql_yacc.yy" +#line 4733 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_in_subselect((yyvsp[(1) - (5)].item), (yyvsp[(4) - (5)].select_lex)); } break; case 745: -#line 4735 "sql_yacc.yy" +#line 4737 "sql_yacc.yy" { THD *thd= YYTHD; Item *item= new (thd->mem_root) Item_in_subselect((yyvsp[(1) - (6)].item), (yyvsp[(5) - (6)].select_lex)); @@ -19639,14 +19641,14 @@ break; case 746: -#line 4741 "sql_yacc.yy" +#line 4743 "sql_yacc.yy" { (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (5)].item), true, (yyvsp[(4) - (5)].item)); } break; case 747: -#line 4745 "sql_yacc.yy" +#line 4747 "sql_yacc.yy" { (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(4) - (7)].item)); (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(1) - (7)].item)); @@ -19655,14 +19657,14 @@ break; case 748: -#line 4751 "sql_yacc.yy" +#line 4753 "sql_yacc.yy" { (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (6)].item), false, (yyvsp[(5) - (6)].item)); } break; case 749: -#line 4755 "sql_yacc.yy" +#line 4757 "sql_yacc.yy" { (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(5) - (8)].item)); (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(1) - (8)].item)); @@ -19673,12 +19675,12 @@ break; case 750: -#line 4763 "sql_yacc.yy" +#line 4765 "sql_yacc.yy" { (yyval.item)= new Item_func_between((yyvsp[(1) - (5)].item),(yyvsp[(3) - (5)].item),(yyvsp[(5) - (5)].item)); } break; case 751: -#line 4765 "sql_yacc.yy" +#line 4767 "sql_yacc.yy" { Item_func_between *item= new Item_func_between((yyvsp[(1) - (6)].item),(yyvsp[(4) - (6)].item),(yyvsp[(6) - (6)].item)); item->negate(); @@ -19687,148 +19689,148 @@ break; case 752: -#line 4771 "sql_yacc.yy" +#line 4773 "sql_yacc.yy" { (yyval.item)= new Item_func_eq(new Item_func_soundex((yyvsp[(1) - (4)].item)), new Item_func_soundex((yyvsp[(4) - (4)].item))); } break; case 753: -#line 4774 "sql_yacc.yy" +#line 4776 "sql_yacc.yy" { (yyval.item)= new Item_func_like((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].item),Lex->escape_used); } break; case 754: -#line 4776 "sql_yacc.yy" +#line 4778 "sql_yacc.yy" { (yyval.item)= new Item_func_not(new Item_func_like((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].item), Lex->escape_used)); } break; case 755: -#line 4777 "sql_yacc.yy" +#line 4779 "sql_yacc.yy" { (yyval.item)= new Item_func_regex((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 756: -#line 4779 "sql_yacc.yy" +#line 4781 "sql_yacc.yy" { (yyval.item)= negate_expression(YYTHD, new Item_func_regex((yyvsp[(1) - (4)].item),(yyvsp[(4) - (4)].item))); } break; case 758: -#line 4784 "sql_yacc.yy" +#line 4786 "sql_yacc.yy" { (yyval.item)= new Item_func_bit_or((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 759: -#line 4786 "sql_yacc.yy" +#line 4788 "sql_yacc.yy" { (yyval.item)= new Item_func_bit_and((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 760: -#line 4788 "sql_yacc.yy" +#line 4790 "sql_yacc.yy" { (yyval.item)= new Item_func_shift_left((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 761: -#line 4790 "sql_yacc.yy" +#line 4792 "sql_yacc.yy" { (yyval.item)= new Item_func_shift_right((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 762: -#line 4792 "sql_yacc.yy" +#line 4794 "sql_yacc.yy" { (yyval.item)= new Item_func_plus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 763: -#line 4794 "sql_yacc.yy" +#line 4796 "sql_yacc.yy" { (yyval.item)= new Item_func_minus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 764: -#line 4796 "sql_yacc.yy" +#line 4798 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].interval),0); } break; case 765: -#line 4798 "sql_yacc.yy" +#line 4800 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].interval),1); } break; case 766: -#line 4800 "sql_yacc.yy" +#line 4802 "sql_yacc.yy" { (yyval.item)= new Item_func_mul((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 767: -#line 4802 "sql_yacc.yy" +#line 4804 "sql_yacc.yy" { (yyval.item)= new Item_func_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 768: -#line 4804 "sql_yacc.yy" +#line 4806 "sql_yacc.yy" { (yyval.item)= new Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 769: -#line 4806 "sql_yacc.yy" +#line 4808 "sql_yacc.yy" { (yyval.item)= new Item_func_int_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 770: -#line 4808 "sql_yacc.yy" +#line 4810 "sql_yacc.yy" { (yyval.item)= new Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 771: -#line 4810 "sql_yacc.yy" +#line 4812 "sql_yacc.yy" { (yyval.item)= new Item_func_bit_xor((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 781: -#line 4819 "sql_yacc.yy" +#line 4821 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_eq_creator; } break; case 782: -#line 4820 "sql_yacc.yy" +#line 4822 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_ge_creator; } break; case 783: -#line 4821 "sql_yacc.yy" +#line 4823 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_gt_creator; } break; case 784: -#line 4822 "sql_yacc.yy" +#line 4824 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_le_creator; } break; case 785: -#line 4823 "sql_yacc.yy" +#line 4825 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_lt_creator; } break; case 786: -#line 4824 "sql_yacc.yy" +#line 4826 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_ne_creator; } break; case 787: -#line 4827 "sql_yacc.yy" +#line 4829 "sql_yacc.yy" { (yyval.num) = 1; } break; case 788: -#line 4828 "sql_yacc.yy" +#line 4830 "sql_yacc.yy" { (yyval.num) = 0; } break; case 789: -#line 4833 "sql_yacc.yy" +#line 4835 "sql_yacc.yy" { (yyval.item)=(yyvsp[(2) - (2)].item); } break; case 791: -#line 4839 "sql_yacc.yy" +#line 4841 "sql_yacc.yy" { (yyval.item)= new Item_func_set_collation((yyvsp[(1) - (3)].item), new Item_string((yyvsp[(3) - (3)].lex_str).str, @@ -19838,44 +19840,44 @@ break; case 796: -#line 4850 "sql_yacc.yy" +#line 4852 "sql_yacc.yy" { (yyval.item)= new Item_func_concat((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item)); } break; case 797: -#line 4851 "sql_yacc.yy" +#line 4853 "sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 798: -#line 4852 "sql_yacc.yy" +#line 4854 "sql_yacc.yy" { (yyval.item)= new Item_func_neg((yyvsp[(2) - (2)].item)); } break; case 799: -#line 4853 "sql_yacc.yy" +#line 4855 "sql_yacc.yy" { (yyval.item)= new Item_func_bit_neg((yyvsp[(2) - (2)].item)); } break; case 800: -#line 4854 "sql_yacc.yy" +#line 4856 "sql_yacc.yy" { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); } break; case 801: -#line 4856 "sql_yacc.yy" +#line 4858 "sql_yacc.yy" { (yyval.item)= new Item_singlerow_subselect((yyvsp[(2) - (3)].select_lex)); } break; case 802: -#line 4859 "sql_yacc.yy" +#line 4861 "sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (3)].item); } break; case 803: -#line 4861 "sql_yacc.yy" +#line 4863 "sql_yacc.yy" { (yyvsp[(4) - (5)].item_list)->push_front((yyvsp[(2) - (5)].item)); (yyval.item)= new Item_row(*(yyvsp[(4) - (5)].item_list)); @@ -19883,7 +19885,7 @@ break; case 804: -#line 4866 "sql_yacc.yy" +#line 4868 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_row(*(yyvsp[(5) - (6)].item_list)); @@ -19891,38 +19893,38 @@ break; case 805: -#line 4871 "sql_yacc.yy" +#line 4873 "sql_yacc.yy" { (yyval.item)= new Item_exists_subselect((yyvsp[(3) - (4)].select_lex)); } break; case 806: -#line 4874 "sql_yacc.yy" +#line 4876 "sql_yacc.yy" { (yyval.item)= (yyvsp[(3) - (4)].item); } break; case 807: -#line 4876 "sql_yacc.yy" +#line 4878 "sql_yacc.yy" { (yyvsp[(2) - (7)].item_list)->push_front((yyvsp[(5) - (7)].item)); Select->add_ftfunc_to_list((Item_func_match*) ((yyval.item)=new Item_func_match(*(yyvsp[(2) - (7)].item_list),(yyvsp[(6) - (7)].num)))); } break; case 808: -#line 4879 "sql_yacc.yy" +#line 4881 "sql_yacc.yy" { (yyval.item)= new Item_func_ascii((yyvsp[(3) - (4)].item)); } break; case 809: -#line 4881 "sql_yacc.yy" +#line 4883 "sql_yacc.yy" { (yyval.item)= create_func_cast((yyvsp[(2) - (2)].item), ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); } break; case 810: -#line 4885 "sql_yacc.yy" +#line 4887 "sql_yacc.yy" { LEX *lex= Lex; (yyval.item)= create_func_cast((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), lex->length, lex->dec, lex->charset); @@ -19932,12 +19934,12 @@ break; case 811: -#line 4892 "sql_yacc.yy" +#line 4894 "sql_yacc.yy" { (yyval.item)= new Item_func_case(* (yyvsp[(3) - (5)].item_list), (yyvsp[(2) - (5)].item), (yyvsp[(4) - (5)].item) ); } break; case 812: -#line 4894 "sql_yacc.yy" +#line 4896 "sql_yacc.yy" { (yyval.item)= create_func_cast((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), Lex->length, Lex->dec, Lex->charset); if (!(yyval.item)) @@ -19946,12 +19948,12 @@ break; case 813: -#line 4900 "sql_yacc.yy" +#line 4902 "sql_yacc.yy" { (yyval.item)= new Item_func_conv_charset((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].charset)); } break; case 814: -#line 4902 "sql_yacc.yy" +#line 4904 "sql_yacc.yy" { if ((yyvsp[(3) - (4)].item)->is_splocal()) { @@ -19965,12 +19967,12 @@ break; case 815: -#line 4913 "sql_yacc.yy" +#line 4915 "sql_yacc.yy" { (yyval.item)= new Item_insert_value(Lex->current_context(), (yyvsp[(3) - (4)].item)); } break; case 816: -#line 4915 "sql_yacc.yy" +#line 4917 "sql_yacc.yy" { if (!(yyvsp[(1) - (3)].symbol).symbol->create_func) { @@ -19984,7 +19986,7 @@ break; case 817: -#line 4926 "sql_yacc.yy" +#line 4928 "sql_yacc.yy" { if (!(yyvsp[(1) - (4)].symbol).symbol->create_func) { @@ -19998,7 +20000,7 @@ break; case 818: -#line 4937 "sql_yacc.yy" +#line 4939 "sql_yacc.yy" { if (!(yyvsp[(1) - (6)].symbol).symbol->create_func) { @@ -20012,7 +20014,7 @@ break; case 819: -#line 4948 "sql_yacc.yy" +#line 4950 "sql_yacc.yy" { if (!(yyvsp[(1) - (8)].symbol).symbol->create_func) { @@ -20026,67 +20028,67 @@ break; case 820: -#line 4959 "sql_yacc.yy" +#line 4961 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 0);} break; case 821: -#line 4961 "sql_yacc.yy" +#line 4963 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 0); } break; case 822: -#line 4963 "sql_yacc.yy" +#line 4965 "sql_yacc.yy" { (yyval.item)= new Item_func_repeat((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 823: -#line 4965 "sql_yacc.yy" +#line 4967 "sql_yacc.yy" { (yyval.item)= new Item_func_atan((yyvsp[(3) - (4)].item)); } break; case 824: -#line 4967 "sql_yacc.yy" +#line 4969 "sql_yacc.yy" { (yyval.item)= new Item_func_atan((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 825: -#line 4969 "sql_yacc.yy" +#line 4971 "sql_yacc.yy" { (yyval.item)= new Item_func_char(*(yyvsp[(3) - (4)].item_list)); } break; case 826: -#line 4971 "sql_yacc.yy" +#line 4973 "sql_yacc.yy" { (yyval.item)= new Item_func_char(*(yyvsp[(3) - (6)].item_list), (yyvsp[(5) - (6)].charset)); } break; case 827: -#line 4973 "sql_yacc.yy" +#line 4975 "sql_yacc.yy" { (yyval.item)= new Item_func_charset((yyvsp[(3) - (4)].item)); } break; case 828: -#line 4975 "sql_yacc.yy" +#line 4977 "sql_yacc.yy" { (yyval.item)= new Item_func_coalesce(* (yyvsp[(3) - (4)].item_list)); } break; case 829: -#line 4977 "sql_yacc.yy" +#line 4979 "sql_yacc.yy" { (yyval.item)= new Item_func_collation((yyvsp[(3) - (4)].item)); } break; case 830: -#line 4979 "sql_yacc.yy" +#line 4981 "sql_yacc.yy" { (yyval.item)= new Item_func_concat(* (yyvsp[(3) - (4)].item_list)); } break; case 831: -#line 4981 "sql_yacc.yy" +#line 4983 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_concat_ws(*(yyvsp[(5) - (6)].item_list)); } break; case 832: -#line 4983 "sql_yacc.yy" +#line 4985 "sql_yacc.yy" { if (Lex->add_time_zone_tables_to_query_tables(YYTHD)) MYSQL_YYABORT; @@ -20095,17 +20097,17 @@ break; case 833: -#line 4989 "sql_yacc.yy" +#line 4991 "sql_yacc.yy" { (yyval.item)= new Item_func_curdate_local(); Lex->safe_to_cache_query=0; } break; case 834: -#line 4991 "sql_yacc.yy" +#line 4993 "sql_yacc.yy" { (yyval.item)= new Item_func_curtime_local(); Lex->safe_to_cache_query=0; } break; case 835: -#line 4993 "sql_yacc.yy" +#line 4995 "sql_yacc.yy" { (yyval.item)= new Item_func_curtime_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0; @@ -20113,7 +20115,7 @@ break; case 836: -#line 4998 "sql_yacc.yy" +#line 5000 "sql_yacc.yy" { (yyval.item)= new Item_func_current_user(Lex->current_context()); Lex->safe_to_cache_query= 0; @@ -20121,17 +20123,17 @@ break; case 837: -#line 5003 "sql_yacc.yy" +#line 5005 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (7)].item),(yyvsp[(5) - (7)].item),(yyvsp[(6) - (7)].interval),0); } break; case 838: -#line 5005 "sql_yacc.yy" +#line 5007 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (7)].item),(yyvsp[(5) - (7)].item),(yyvsp[(6) - (7)].interval),1); } break; case 839: -#line 5007 "sql_yacc.yy" +#line 5009 "sql_yacc.yy" { (yyval.item)= new Item_func_database(); Lex->safe_to_cache_query=0; @@ -20139,27 +20141,27 @@ break; case 840: -#line 5012 "sql_yacc.yy" +#line 5014 "sql_yacc.yy" { (yyval.item)= new Item_date_typecast((yyvsp[(3) - (4)].item)); } break; case 841: -#line 5014 "sql_yacc.yy" +#line 5016 "sql_yacc.yy" { (yyval.item)= new Item_func_dayofmonth((yyvsp[(3) - (4)].item)); } break; case 842: -#line 5016 "sql_yacc.yy" +#line 5018 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_elt(*(yyvsp[(5) - (6)].item_list)); } break; case 843: -#line 5018 "sql_yacc.yy" +#line 5020 "sql_yacc.yy" { (yyval.item)= new Item_func_make_set((yyvsp[(3) - (6)].item), *(yyvsp[(5) - (6)].item_list)); } break; case 844: -#line 5020 "sql_yacc.yy" +#line 5022 "sql_yacc.yy" { (yyval.item)= new Item_func_encrypt((yyvsp[(3) - (4)].item)); Lex->uncacheable(UNCACHEABLE_RAND); @@ -20167,79 +20169,79 @@ break; case 845: -#line 5024 "sql_yacc.yy" +#line 5026 "sql_yacc.yy" { (yyval.item)= new Item_func_encrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 846: -#line 5026 "sql_yacc.yy" +#line 5028 "sql_yacc.yy" { (yyval.item)= new Item_func_decode((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].lex_str).str); } break; case 847: -#line 5028 "sql_yacc.yy" +#line 5030 "sql_yacc.yy" { (yyval.item)= new Item_func_encode((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].lex_str).str); } break; case 848: -#line 5030 "sql_yacc.yy" +#line 5032 "sql_yacc.yy" { (yyval.item)= new Item_func_des_decrypt((yyvsp[(3) - (4)].item)); } break; case 849: -#line 5032 "sql_yacc.yy" +#line 5034 "sql_yacc.yy" { (yyval.item)= new Item_func_des_decrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 850: -#line 5034 "sql_yacc.yy" +#line 5036 "sql_yacc.yy" { (yyval.item)= new Item_func_des_encrypt((yyvsp[(3) - (4)].item)); } break; case 851: -#line 5036 "sql_yacc.yy" +#line 5038 "sql_yacc.yy" { (yyval.item)= new Item_func_des_encrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 852: -#line 5038 "sql_yacc.yy" +#line 5040 "sql_yacc.yy" { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); } break; case 853: -#line 5040 "sql_yacc.yy" +#line 5042 "sql_yacc.yy" { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (10)].item), (yyvsp[(5) - (10)].item), (yyvsp[(7) - (10)].item), (yyvsp[(9) - (10)].item)); } break; case 854: -#line 5042 "sql_yacc.yy" +#line 5044 "sql_yacc.yy" { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (12)].item), (yyvsp[(5) - (12)].item), (yyvsp[(7) - (12)].item), (yyvsp[(9) - (12)].item), (yyvsp[(11) - (12)].item)); } break; case 855: -#line 5044 "sql_yacc.yy" +#line 5046 "sql_yacc.yy" { (yyval.item)= new Item_func_format((yyvsp[(3) - (6)].item),atoi((yyvsp[(5) - (6)].lex_str).str)); } break; case 856: -#line 5046 "sql_yacc.yy" +#line 5048 "sql_yacc.yy" { (yyval.item)= new Item_func_from_unixtime((yyvsp[(3) - (4)].item)); } break; case 857: -#line 5048 "sql_yacc.yy" +#line 5050 "sql_yacc.yy" { (yyval.item)= new Item_func_date_format (new Item_func_from_unixtime((yyvsp[(3) - (6)].item)),(yyvsp[(5) - (6)].item),0); } break; case 858: -#line 5052 "sql_yacc.yy" +#line 5054 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_field(*(yyvsp[(5) - (6)].item_list)); } break; case 859: -#line 5054 "sql_yacc.yy" +#line 5056 "sql_yacc.yy" { #ifdef HAVE_SPATIAL (yyval.item)= (yyvsp[(1) - (1)].item); @@ -20252,32 +20254,32 @@ break; case 860: -#line 5064 "sql_yacc.yy" +#line 5066 "sql_yacc.yy" { (yyval.item)= new Item_func_get_format((yyvsp[(3) - (6)].date_time_type), (yyvsp[(5) - (6)].item)); } break; case 861: -#line 5066 "sql_yacc.yy" +#line 5068 "sql_yacc.yy" { (yyval.item)= new Item_func_hour((yyvsp[(3) - (4)].item)); } break; case 862: -#line 5068 "sql_yacc.yy" +#line 5070 "sql_yacc.yy" { (yyval.item)= new Item_func_if((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 863: -#line 5070 "sql_yacc.yy" +#line 5072 "sql_yacc.yy" { (yyval.item)= new Item_func_insert((yyvsp[(3) - (10)].item),(yyvsp[(5) - (10)].item),(yyvsp[(7) - (10)].item),(yyvsp[(9) - (10)].item)); } break; case 864: -#line 5073 "sql_yacc.yy" +#line 5075 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(4) - (4)].item),(yyvsp[(1) - (4)].item),(yyvsp[(2) - (4)].interval),0); } break; case 865: -#line 5075 "sql_yacc.yy" +#line 5077 "sql_yacc.yy" { if ((yyvsp[(1) - (1)].item)->type() != Item::ROW_ITEM) { @@ -20289,7 +20291,7 @@ break; case 866: -#line 5084 "sql_yacc.yy" +#line 5086 "sql_yacc.yy" { (yyval.item)= new Item_func_last_insert_id(); Lex->safe_to_cache_query= 0; @@ -20297,7 +20299,7 @@ break; case 867: -#line 5089 "sql_yacc.yy" +#line 5091 "sql_yacc.yy" { (yyval.item)= new Item_func_last_insert_id((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query= 0; @@ -20305,42 +20307,42 @@ break; case 868: -#line 5094 "sql_yacc.yy" +#line 5096 "sql_yacc.yy" { (yyval.item)= new Item_func_left((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 869: -#line 5096 "sql_yacc.yy" +#line 5098 "sql_yacc.yy" { (yyval.item)= new Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 870: -#line 5098 "sql_yacc.yy" +#line 5100 "sql_yacc.yy" { (yyval.item)= new Item_func_locate((yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 871: -#line 5100 "sql_yacc.yy" +#line 5102 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_max(*(yyvsp[(5) - (6)].item_list)); } break; case 872: -#line 5102 "sql_yacc.yy" +#line 5104 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_min(*(yyvsp[(5) - (6)].item_list)); } break; case 873: -#line 5104 "sql_yacc.yy" +#line 5106 "sql_yacc.yy" { (yyval.item)= new Item_func_log((yyvsp[(3) - (4)].item)); } break; case 874: -#line 5106 "sql_yacc.yy" +#line 5108 "sql_yacc.yy" { (yyval.item)= new Item_func_log((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 875: -#line 5108 "sql_yacc.yy" +#line 5110 "sql_yacc.yy" { (yyval.item)= new Item_master_pos_wait((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); Lex->safe_to_cache_query=0; @@ -20348,7 +20350,7 @@ break; case 876: -#line 5113 "sql_yacc.yy" +#line 5115 "sql_yacc.yy" { (yyval.item)= new Item_master_pos_wait((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); Lex->safe_to_cache_query=0; @@ -20356,37 +20358,37 @@ break; case 877: -#line 5118 "sql_yacc.yy" +#line 5120 "sql_yacc.yy" { (yyval.item)= new Item_func_microsecond((yyvsp[(3) - (4)].item)); } break; case 878: -#line 5120 "sql_yacc.yy" +#line 5122 "sql_yacc.yy" { (yyval.item)= new Item_func_minute((yyvsp[(3) - (4)].item)); } break; case 879: -#line 5122 "sql_yacc.yy" +#line 5124 "sql_yacc.yy" { (yyval.item) = new Item_func_mod( (yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 880: -#line 5124 "sql_yacc.yy" +#line 5126 "sql_yacc.yy" { (yyval.item)= new Item_func_month((yyvsp[(3) - (4)].item)); } break; case 881: -#line 5126 "sql_yacc.yy" +#line 5128 "sql_yacc.yy" { (yyval.item)= new Item_func_now_local(); Lex->safe_to_cache_query=0;} break; case 882: -#line 5128 "sql_yacc.yy" +#line 5130 "sql_yacc.yy" { (yyval.item)= new Item_func_now_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0;} break; case 883: -#line 5130 "sql_yacc.yy" +#line 5132 "sql_yacc.yy" { (yyval.item)= YYTHD->variables.old_passwords ? (Item *) new Item_func_old_password((yyvsp[(3) - (4)].item)) : @@ -20395,52 +20397,52 @@ break; case 884: -#line 5136 "sql_yacc.yy" +#line 5138 "sql_yacc.yy" { (yyval.item)= new Item_func_old_password((yyvsp[(3) - (4)].item)); } break; case 885: -#line 5138 "sql_yacc.yy" +#line 5140 "sql_yacc.yy" { (yyval.item) = new Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 886: -#line 5140 "sql_yacc.yy" +#line 5142 "sql_yacc.yy" { (yyval.item) = new Item_func_quarter((yyvsp[(3) - (4)].item)); } break; case 887: -#line 5142 "sql_yacc.yy" +#line 5144 "sql_yacc.yy" { (yyval.item)= new Item_func_rand((yyvsp[(3) - (4)].item)); Lex->uncacheable(UNCACHEABLE_RAND);} break; case 888: -#line 5144 "sql_yacc.yy" +#line 5146 "sql_yacc.yy" { (yyval.item)= new Item_func_rand(); Lex->uncacheable(UNCACHEABLE_RAND);} break; case 889: -#line 5146 "sql_yacc.yy" +#line 5148 "sql_yacc.yy" { (yyval.item)= new Item_func_replace((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 890: -#line 5148 "sql_yacc.yy" +#line 5150 "sql_yacc.yy" { (yyval.item)= new Item_func_right((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 891: -#line 5150 "sql_yacc.yy" +#line 5152 "sql_yacc.yy" { (yyval.item)= new Item_func_round((yyvsp[(3) - (4)].item), new Item_int((char*)"0",0,1),0); } break; case 892: -#line 5151 "sql_yacc.yy" +#line 5153 "sql_yacc.yy" { (yyval.item)= new Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),0); } break; case 893: -#line 5153 "sql_yacc.yy" +#line 5155 "sql_yacc.yy" { (yyval.item)= new Item_func_row_count(); Lex->safe_to_cache_query= 0; @@ -20449,7 +20451,7 @@ break; case 894: -#line 5159 "sql_yacc.yy" +#line 5161 "sql_yacc.yy" { (yyval.item)= new Item_func_senna_kwic(* (yyvsp[(3) - (4)].item_list)); #endif @@ -20457,47 +20459,47 @@ break; case 895: -#line 5164 "sql_yacc.yy" +#line 5166 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 1);} break; case 896: -#line 5166 "sql_yacc.yy" +#line 5168 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 1); } break; case 897: -#line 5168 "sql_yacc.yy" +#line 5170 "sql_yacc.yy" { (yyval.item)= new Item_func_second((yyvsp[(3) - (4)].item)); } break; case 898: -#line 5170 "sql_yacc.yy" +#line 5172 "sql_yacc.yy" { (yyval.item)= new Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 899: -#line 5172 "sql_yacc.yy" +#line 5174 "sql_yacc.yy" { (yyval.item)= new Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 900: -#line 5174 "sql_yacc.yy" +#line 5176 "sql_yacc.yy" { (yyval.item)= new Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 901: -#line 5176 "sql_yacc.yy" +#line 5178 "sql_yacc.yy" { (yyval.item)= new Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 902: -#line 5178 "sql_yacc.yy" +#line 5180 "sql_yacc.yy" { (yyval.item)= new Item_func_substr_index((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 903: -#line 5180 "sql_yacc.yy" +#line 5182 "sql_yacc.yy" { if (global_system_variables.sysdate_is_now == 0) (yyval.item)= new Item_func_sysdate_local(); @@ -20507,7 +20509,7 @@ break; case 904: -#line 5187 "sql_yacc.yy" +#line 5189 "sql_yacc.yy" { if (global_system_variables.sysdate_is_now == 0) (yyval.item)= new Item_func_sysdate_local((yyvsp[(3) - (4)].item)); @@ -20517,77 +20519,77 @@ break; case 905: -#line 5194 "sql_yacc.yy" +#line 5196 "sql_yacc.yy" { (yyval.item)= new Item_time_typecast((yyvsp[(3) - (4)].item)); } break; case 906: -#line 5196 "sql_yacc.yy" +#line 5198 "sql_yacc.yy" { (yyval.item)= new Item_datetime_typecast((yyvsp[(3) - (4)].item)); } break; case 907: -#line 5198 "sql_yacc.yy" +#line 5200 "sql_yacc.yy" { (yyval.item)= new Item_func_add_time((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), 1, 0); } break; case 908: -#line 5200 "sql_yacc.yy" +#line 5202 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(7) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].interval_time_st),0); } break; case 909: -#line 5202 "sql_yacc.yy" +#line 5204 "sql_yacc.yy" { (yyval.item)= new Item_func_timestamp_diff((yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item),(yyvsp[(3) - (8)].interval_time_st)); } break; case 910: -#line 5204 "sql_yacc.yy" +#line 5206 "sql_yacc.yy" { (yyval.item)= new Item_func_trim((yyvsp[(3) - (4)].item)); } break; case 911: -#line 5206 "sql_yacc.yy" +#line 5208 "sql_yacc.yy" { (yyval.item)= new Item_func_ltrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 912: -#line 5208 "sql_yacc.yy" +#line 5210 "sql_yacc.yy" { (yyval.item)= new Item_func_rtrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 913: -#line 5210 "sql_yacc.yy" +#line 5212 "sql_yacc.yy" { (yyval.item)= new Item_func_trim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 914: -#line 5212 "sql_yacc.yy" +#line 5214 "sql_yacc.yy" { (yyval.item)= new Item_func_ltrim((yyvsp[(5) - (6)].item)); } break; case 915: -#line 5214 "sql_yacc.yy" +#line 5216 "sql_yacc.yy" { (yyval.item)= new Item_func_rtrim((yyvsp[(5) - (6)].item)); } break; case 916: -#line 5216 "sql_yacc.yy" +#line 5218 "sql_yacc.yy" { (yyval.item)= new Item_func_trim((yyvsp[(5) - (6)].item)); } break; case 917: -#line 5218 "sql_yacc.yy" +#line 5220 "sql_yacc.yy" { (yyval.item)= new Item_func_trim((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 918: -#line 5220 "sql_yacc.yy" +#line 5222 "sql_yacc.yy" { (yyval.item)= new Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),1); } break; case 919: -#line 5222 "sql_yacc.yy" +#line 5224 "sql_yacc.yy" { LEX *lex= Lex; sp_name *name= new sp_name((yyvsp[(1) - (6)].lex_str), (yyvsp[(3) - (6)].lex_str), true); @@ -20603,7 +20605,7 @@ break; case 920: -#line 5235 "sql_yacc.yy" +#line 5237 "sql_yacc.yy" { #ifdef HAVE_DLOPEN udf_func *udf= 0; @@ -20624,7 +20626,7 @@ break; case 921: -#line 5253 "sql_yacc.yy" +#line 5255 "sql_yacc.yy" { LEX *lex= Lex; #ifdef HAVE_DLOPEN @@ -20726,14 +20728,14 @@ break; case 922: -#line 5352 "sql_yacc.yy" +#line 5354 "sql_yacc.yy" { (yyval.item)= new Item_func_unique_users((yyvsp[(3) - (10)].item),atoi((yyvsp[(5) - (10)].lex_str).str),atoi((yyvsp[(7) - (10)].lex_str).str), * (yyvsp[(9) - (10)].item_list)); } break; case 923: -#line 5356 "sql_yacc.yy" +#line 5358 "sql_yacc.yy" { (yyval.item)= new Item_func_unix_timestamp(); Lex->safe_to_cache_query=0; @@ -20741,32 +20743,32 @@ break; case 924: -#line 5361 "sql_yacc.yy" +#line 5363 "sql_yacc.yy" { (yyval.item)= new Item_func_unix_timestamp((yyvsp[(3) - (4)].item)); } break; case 925: -#line 5363 "sql_yacc.yy" +#line 5365 "sql_yacc.yy" { (yyval.item)= new Item_func_user(); Lex->safe_to_cache_query=0; } break; case 926: -#line 5365 "sql_yacc.yy" +#line 5367 "sql_yacc.yy" { (yyval.item)= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;} break; case 927: -#line 5367 "sql_yacc.yy" +#line 5369 "sql_yacc.yy" { (yyval.item)= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;} break; case 928: -#line 5369 "sql_yacc.yy" +#line 5371 "sql_yacc.yy" { (yyval.item)= new Item_func_now_utc(); Lex->safe_to_cache_query=0;} break; case 929: -#line 5371 "sql_yacc.yy" +#line 5373 "sql_yacc.yy" { (yyval.item)= new Item_func_week((yyvsp[(3) - (4)].item),new Item_int((char*) "0", YYTHD->variables.default_week_format,1)); @@ -20774,27 +20776,27 @@ break; case 930: -#line 5376 "sql_yacc.yy" +#line 5378 "sql_yacc.yy" { (yyval.item)= new Item_func_week((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 931: -#line 5378 "sql_yacc.yy" +#line 5380 "sql_yacc.yy" { (yyval.item)= new Item_func_year((yyvsp[(3) - (4)].item)); } break; case 932: -#line 5380 "sql_yacc.yy" +#line 5382 "sql_yacc.yy" { (yyval.item)= new Item_func_yearweek((yyvsp[(3) - (4)].item),new Item_int((char*) "0",0,1)); } break; case 933: -#line 5382 "sql_yacc.yy" +#line 5384 "sql_yacc.yy" { (yyval.item)= new Item_func_yearweek((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 934: -#line 5384 "sql_yacc.yy" +#line 5386 "sql_yacc.yy" { (yyval.item)=new Item_func_benchmark((yyvsp[(3) - (6)].ulong_num),(yyvsp[(5) - (6)].item)); Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); @@ -20802,198 +20804,198 @@ break; case 935: -#line 5389 "sql_yacc.yy" +#line 5391 "sql_yacc.yy" { (yyval.item)=new Item_extract( (yyvsp[(3) - (6)].interval), (yyvsp[(5) - (6)].item)); } break; case 936: -#line 5393 "sql_yacc.yy" +#line 5395 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_rel((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), Item_func::SP_CONTAINS_FUNC)); } break; case 937: -#line 5395 "sql_yacc.yy" +#line 5397 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 938: -#line 5397 "sql_yacc.yy" +#line 5399 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 939: -#line 5399 "sql_yacc.yy" +#line 5401 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_wkb((yyvsp[(3) - (4)].item))); } break; case 940: -#line 5401 "sql_yacc.yy" +#line 5403 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_wkb((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 941: -#line 5403 "sql_yacc.yy" +#line 5405 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_geometrycollection, Geometry::wkb_point)); } break; case 942: -#line 5407 "sql_yacc.yy" +#line 5409 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_linestring, Geometry::wkb_point)); } break; case 943: -#line 5410 "sql_yacc.yy" +#line 5412 "sql_yacc.yy" { (yyval.item)= GEOM_NEW( Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multilinestring, Geometry::wkb_linestring)); } break; case 944: -#line 5413 "sql_yacc.yy" +#line 5415 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 945: -#line 5415 "sql_yacc.yy" +#line 5417 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 946: -#line 5417 "sql_yacc.yy" +#line 5419 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 947: -#line 5419 "sql_yacc.yy" +#line 5421 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 948: -#line 5421 "sql_yacc.yy" +#line 5423 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 949: -#line 5423 "sql_yacc.yy" +#line 5425 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 950: -#line 5425 "sql_yacc.yy" +#line 5427 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multipoint, Geometry::wkb_point)); } break; case 951: -#line 5428 "sql_yacc.yy" +#line 5430 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multipolygon, Geometry::wkb_polygon)); } break; case 952: -#line 5431 "sql_yacc.yy" +#line 5433 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_point((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item))); } break; case 953: -#line 5433 "sql_yacc.yy" +#line 5435 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 954: -#line 5435 "sql_yacc.yy" +#line 5437 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 955: -#line 5437 "sql_yacc.yy" +#line 5439 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 956: -#line 5439 "sql_yacc.yy" +#line 5441 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 957: -#line 5441 "sql_yacc.yy" +#line 5443 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_polygon, Geometry::wkb_linestring)); } break; case 958: -#line 5444 "sql_yacc.yy" +#line 5446 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 959: -#line 5446 "sql_yacc.yy" +#line 5448 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 960: -#line 5448 "sql_yacc.yy" +#line 5450 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 961: -#line 5450 "sql_yacc.yy" +#line 5452 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 962: -#line 5454 "sql_yacc.yy" +#line 5456 "sql_yacc.yy" { (yyval.num)= FT_NL; } break; case 963: -#line 5455 "sql_yacc.yy" +#line 5457 "sql_yacc.yy" { (yyval.num)= FT_NL | FT_EXPAND; } break; case 964: -#line 5456 "sql_yacc.yy" +#line 5458 "sql_yacc.yy" { (yyval.num)= FT_BOOL; } break; case 965: -#line 5460 "sql_yacc.yy" +#line 5462 "sql_yacc.yy" { (yyval.item_list)= NULL; } break; case 966: -#line 5461 "sql_yacc.yy" +#line 5463 "sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 967: -#line 5465 "sql_yacc.yy" +#line 5467 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 968: -#line 5467 "sql_yacc.yy" +#line 5469 "sql_yacc.yy" { (yyval.item_list)= Select->expr_list.pop(); } break; case 969: -#line 5472 "sql_yacc.yy" +#line 5474 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 970: -#line 5476 "sql_yacc.yy" +#line 5478 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 971: -#line 5483 "sql_yacc.yy" +#line 5485 "sql_yacc.yy" { udf_func *udf= Select->udf_list.head(); /* @@ -21024,117 +21026,117 @@ break; case 972: -#line 5514 "sql_yacc.yy" +#line 5516 "sql_yacc.yy" { (yyval.item)=new Item_sum_avg((yyvsp[(3) - (4)].item)); } break; case 973: -#line 5516 "sql_yacc.yy" +#line 5518 "sql_yacc.yy" { (yyval.item)=new Item_sum_avg_distinct((yyvsp[(4) - (5)].item)); } break; case 974: -#line 5518 "sql_yacc.yy" +#line 5520 "sql_yacc.yy" { (yyval.item)=new Item_sum_and((yyvsp[(3) - (4)].item)); } break; case 975: -#line 5520 "sql_yacc.yy" +#line 5522 "sql_yacc.yy" { (yyval.item)=new Item_sum_or((yyvsp[(3) - (4)].item)); } break; case 976: -#line 5522 "sql_yacc.yy" +#line 5524 "sql_yacc.yy" { (yyval.item)=new Item_sum_xor((yyvsp[(3) - (4)].item)); } break; case 977: -#line 5524 "sql_yacc.yy" +#line 5526 "sql_yacc.yy" { (yyval.item)=new Item_sum_count(new Item_int((int32) 0L,1)); } break; case 978: -#line 5526 "sql_yacc.yy" +#line 5528 "sql_yacc.yy" { (yyval.item)=new Item_sum_count((yyvsp[(3) - (4)].item)); } break; case 979: -#line 5528 "sql_yacc.yy" +#line 5530 "sql_yacc.yy" { Select->in_sum_expr++; } break; case 980: -#line 5530 "sql_yacc.yy" +#line 5532 "sql_yacc.yy" { Select->in_sum_expr--; } break; case 981: -#line 5532 "sql_yacc.yy" +#line 5534 "sql_yacc.yy" { (yyval.item)=new Item_sum_count_distinct(* (yyvsp[(5) - (7)].item_list)); } break; case 982: -#line 5534 "sql_yacc.yy" +#line 5536 "sql_yacc.yy" { (yyval.item)= new Item_sum_unique_users((yyvsp[(3) - (10)].item),atoi((yyvsp[(5) - (10)].lex_str).str),atoi((yyvsp[(7) - (10)].lex_str).str),(yyvsp[(9) - (10)].item)); } break; case 983: -#line 5536 "sql_yacc.yy" +#line 5538 "sql_yacc.yy" { (yyval.item)=new Item_sum_min((yyvsp[(3) - (4)].item)); } break; case 984: -#line 5543 "sql_yacc.yy" +#line 5545 "sql_yacc.yy" { (yyval.item)=new Item_sum_min((yyvsp[(4) - (5)].item)); } break; case 985: -#line 5545 "sql_yacc.yy" +#line 5547 "sql_yacc.yy" { (yyval.item)=new Item_sum_max((yyvsp[(3) - (4)].item)); } break; case 986: -#line 5547 "sql_yacc.yy" +#line 5549 "sql_yacc.yy" { (yyval.item)=new Item_sum_max((yyvsp[(4) - (5)].item)); } break; case 987: -#line 5549 "sql_yacc.yy" +#line 5551 "sql_yacc.yy" { (yyval.item)=new Item_sum_std((yyvsp[(3) - (4)].item), 0); } break; case 988: -#line 5551 "sql_yacc.yy" +#line 5553 "sql_yacc.yy" { (yyval.item)=new Item_sum_variance((yyvsp[(3) - (4)].item), 0); } break; case 989: -#line 5553 "sql_yacc.yy" +#line 5555 "sql_yacc.yy" { (yyval.item)=new Item_sum_std((yyvsp[(3) - (4)].item), 1); } break; case 990: -#line 5555 "sql_yacc.yy" +#line 5557 "sql_yacc.yy" { (yyval.item)=new Item_sum_variance((yyvsp[(3) - (4)].item), 1); } break; case 991: -#line 5557 "sql_yacc.yy" +#line 5559 "sql_yacc.yy" { (yyval.item)=new Item_sum_sum((yyvsp[(3) - (4)].item)); } break; case 992: -#line 5559 "sql_yacc.yy" +#line 5561 "sql_yacc.yy" { (yyval.item)=new Item_sum_sum_distinct((yyvsp[(4) - (5)].item)); } break; case 993: -#line 5561 "sql_yacc.yy" +#line 5563 "sql_yacc.yy" { Select->in_sum_expr++; } break; case 994: -#line 5565 "sql_yacc.yy" +#line 5567 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->in_sum_expr--; @@ -21145,7 +21147,7 @@ break; case 995: -#line 5575 "sql_yacc.yy" +#line 5577 "sql_yacc.yy" { if (! Lex->parsing_options.allows_variable) { @@ -21156,14 +21158,14 @@ break; case 996: -#line 5583 "sql_yacc.yy" +#line 5585 "sql_yacc.yy" { (yyval.item)= (yyvsp[(3) - (3)].item); } break; case 997: -#line 5590 "sql_yacc.yy" +#line 5592 "sql_yacc.yy" { (yyval.item)= new Item_func_set_user_var((yyvsp[(1) - (3)].lex_str), (yyvsp[(3) - (3)].item)); LEX *lex= Lex; @@ -21172,7 +21174,7 @@ break; case 998: -#line 5596 "sql_yacc.yy" +#line 5598 "sql_yacc.yy" { (yyval.item)= new Item_func_get_user_var((yyvsp[(1) - (1)].lex_str)); LEX *lex= Lex; @@ -21181,7 +21183,7 @@ break; case 999: -#line 5602 "sql_yacc.yy" +#line 5604 "sql_yacc.yy" { if ((yyvsp[(3) - (4)].lex_str).str && (yyvsp[(4) - (4)].lex_str).str && check_reserved_words(&(yyvsp[(3) - (4)].lex_str))) { @@ -21194,36 +21196,36 @@ break; case 1000: -#line 5614 "sql_yacc.yy" +#line 5616 "sql_yacc.yy" { (yyval.num) = 0; } break; case 1001: -#line 5615 "sql_yacc.yy" +#line 5617 "sql_yacc.yy" { (yyval.num) = 1; } break; case 1002: -#line 5619 "sql_yacc.yy" +#line 5621 "sql_yacc.yy" { (yyval.string)= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1); } break; case 1003: -#line 5622 "sql_yacc.yy" +#line 5624 "sql_yacc.yy" { (yyval.string) = (yyvsp[(2) - (2)].string); } break; case 1004: -#line 5627 "sql_yacc.yy" +#line 5629 "sql_yacc.yy" { Select->gorder_list = NULL; } break; case 1005: -#line 5631 "sql_yacc.yy" +#line 5633 "sql_yacc.yy" { SELECT_LEX *select= Select; select->gorder_list= @@ -21234,7 +21236,7 @@ break; case 1006: -#line 5642 "sql_yacc.yy" +#line 5644 "sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->inc_in_sum_expr()) @@ -21246,7 +21248,7 @@ break; case 1007: -#line 5651 "sql_yacc.yy" +#line 5653 "sql_yacc.yy" { Select->in_sum_expr--; (yyval.item)= (yyvsp[(3) - (3)].item); @@ -21254,142 +21256,142 @@ break; case 1008: -#line 5657 "sql_yacc.yy" +#line 5659 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } break; case 1009: -#line 5658 "sql_yacc.yy" +#line 5660 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->dec= 0; } break; case 1010: -#line 5659 "sql_yacc.yy" +#line 5661 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; } break; case 1011: -#line 5660 "sql_yacc.yy" +#line 5662 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1012: -#line 5661 "sql_yacc.yy" +#line 5663 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1013: -#line 5662 "sql_yacc.yy" +#line 5664 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1014: -#line 5663 "sql_yacc.yy" +#line 5665 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1015: -#line 5664 "sql_yacc.yy" +#line 5666 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1016: -#line 5665 "sql_yacc.yy" +#line 5667 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1017: -#line 5666 "sql_yacc.yy" +#line 5668 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1018: -#line 5667 "sql_yacc.yy" +#line 5669 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_DECIMAL; Lex->charset= NULL; } break; case 1019: -#line 5671 "sql_yacc.yy" +#line 5673 "sql_yacc.yy" { (yyval.item_list)= NULL; } break; case 1020: -#line 5672 "sql_yacc.yy" +#line 5674 "sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 1021: -#line 5676 "sql_yacc.yy" +#line 5678 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 1022: -#line 5678 "sql_yacc.yy" +#line 5680 "sql_yacc.yy" { (yyval.item_list)= Select->expr_list.pop(); } break; case 1023: -#line 5681 "sql_yacc.yy" +#line 5683 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 1024: -#line 5682 "sql_yacc.yy" +#line 5684 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 1025: -#line 5685 "sql_yacc.yy" +#line 5687 "sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list); } break; case 1026: -#line 5686 "sql_yacc.yy" +#line 5688 "sql_yacc.yy" { (yyval.item_list)= (yyvsp[(2) - (3)].item_list); } break; case 1027: -#line 5689 "sql_yacc.yy" +#line 5691 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 1028: -#line 5691 "sql_yacc.yy" +#line 5693 "sql_yacc.yy" { (yyval.item_list)= Select->expr_list.pop(); } break; case 1029: -#line 5694 "sql_yacc.yy" +#line 5696 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 1030: -#line 5695 "sql_yacc.yy" +#line 5697 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 1031: -#line 5698 "sql_yacc.yy" +#line 5700 "sql_yacc.yy" { (yyval.item)= NULL; } break; case 1032: -#line 5699 "sql_yacc.yy" +#line 5701 "sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1033: -#line 5702 "sql_yacc.yy" +#line 5704 "sql_yacc.yy" { (yyval.item)= NULL; } break; case 1034: -#line 5703 "sql_yacc.yy" +#line 5705 "sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 1035: -#line 5707 "sql_yacc.yy" +#line 5709 "sql_yacc.yy" { (yyval.item_list)= new List; (yyval.item_list)->push_back((yyvsp[(2) - (4)].item)); @@ -21398,7 +21400,7 @@ break; case 1036: -#line 5713 "sql_yacc.yy" +#line 5715 "sql_yacc.yy" { (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(3) - (5)].item)); (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(5) - (5)].item)); @@ -21407,12 +21409,12 @@ break; case 1037: -#line 5722 "sql_yacc.yy" +#line 5724 "sql_yacc.yy" { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1038: -#line 5724 "sql_yacc.yy" +#line 5726 "sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->nest_last_join(lex->thd))) @@ -21421,34 +21423,34 @@ break; case 1039: -#line 5732 "sql_yacc.yy" +#line 5734 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyval.table_list)=(yyvsp[(1) - (1)].table_list)); } break; case 1040: -#line 5737 "sql_yacc.yy" +#line 5739 "sql_yacc.yy" { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1041: -#line 5739 "sql_yacc.yy" +#line 5741 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1042: -#line 5759 "sql_yacc.yy" +#line 5761 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1043: -#line 5761 "sql_yacc.yy" +#line 5763 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); (yyvsp[(3) - (3)].table_list)->straight=1; } break; case 1044: -#line 5764 "sql_yacc.yy" +#line 5766 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ @@ -21459,7 +21461,7 @@ break; case 1045: -#line 5772 "sql_yacc.yy" +#line 5774 "sql_yacc.yy" { add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); Lex->pop_context(); @@ -21468,7 +21470,7 @@ break; case 1046: -#line 5779 "sql_yacc.yy" +#line 5781 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ @@ -21479,7 +21481,7 @@ break; case 1047: -#line 5787 "sql_yacc.yy" +#line 5789 "sql_yacc.yy" { (yyvsp[(3) - (6)].table_list)->straight=1; add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); @@ -21489,19 +21491,19 @@ break; case 1048: -#line 5795 "sql_yacc.yy" +#line 5797 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); } break; case 1049: -#line 5799 "sql_yacc.yy" +#line 5801 "sql_yacc.yy" { add_join_natural((yyvsp[(1) - (8)].table_list),(yyvsp[(3) - (8)].table_list),(yyvsp[(7) - (8)].string_list),Select); (yyval.table_list)=(yyvsp[(3) - (8)].table_list); } break; case 1050: -#line 5801 "sql_yacc.yy" +#line 5803 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && ((yyval.table_list)=(yyvsp[(4) - (4)].table_list))); add_join_natural((yyvsp[(1) - (4)].table_list),(yyvsp[(4) - (4)].table_list),NULL,Select); @@ -21509,7 +21511,7 @@ break; case 1051: -#line 5809 "sql_yacc.yy" +#line 5811 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ @@ -21520,7 +21522,7 @@ break; case 1052: -#line 5817 "sql_yacc.yy" +#line 5819 "sql_yacc.yy" { add_join_on((yyvsp[(5) - (8)].table_list),(yyvsp[(8) - (8)].item)); Lex->pop_context(); @@ -21531,14 +21533,14 @@ break; case 1053: -#line 5825 "sql_yacc.yy" +#line 5827 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } break; case 1054: -#line 5829 "sql_yacc.yy" +#line 5831 "sql_yacc.yy" { add_join_natural((yyvsp[(1) - (10)].table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select); (yyvsp[(5) - (10)].table_list)->outer_join|=JOIN_TYPE_LEFT; @@ -21547,7 +21549,7 @@ break; case 1055: -#line 5835 "sql_yacc.yy" +#line 5837 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); add_join_natural((yyvsp[(1) - (6)].table_list),(yyvsp[(6) - (6)].table_list),NULL,Select); @@ -21557,7 +21559,7 @@ break; case 1056: -#line 5845 "sql_yacc.yy" +#line 5847 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ @@ -21568,7 +21570,7 @@ break; case 1057: -#line 5853 "sql_yacc.yy" +#line 5855 "sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->convert_right_join())) @@ -21580,14 +21582,14 @@ break; case 1058: -#line 5862 "sql_yacc.yy" +#line 5864 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } break; case 1059: -#line 5866 "sql_yacc.yy" +#line 5868 "sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->convert_right_join())) @@ -21597,7 +21599,7 @@ break; case 1060: -#line 5873 "sql_yacc.yy" +#line 5875 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); add_join_natural((yyvsp[(6) - (6)].table_list),(yyvsp[(1) - (6)].table_list),NULL,Select); @@ -21608,22 +21610,22 @@ break; case 1061: -#line 5882 "sql_yacc.yy" +#line 5884 "sql_yacc.yy" {} break; case 1062: -#line 5883 "sql_yacc.yy" +#line 5885 "sql_yacc.yy" {} break; case 1063: -#line 5884 "sql_yacc.yy" +#line 5886 "sql_yacc.yy" {} break; case 1064: -#line 5889 "sql_yacc.yy" +#line 5891 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->use_index_ptr=sel->ignore_index_ptr=0; @@ -21632,7 +21634,7 @@ break; case 1065: -#line 5895 "sql_yacc.yy" +#line 5897 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -21647,7 +21649,7 @@ break; case 1066: -#line 5908 "sql_yacc.yy" +#line 5910 "sql_yacc.yy" { /* Change the current name resolution context to a local context. */ if (push_new_name_resolution_context(YYTHD, (yyvsp[(3) - (8)].table_list), (yyvsp[(7) - (8)].table_list))) @@ -21657,7 +21659,7 @@ break; case 1067: -#line 5915 "sql_yacc.yy" +#line 5917 "sql_yacc.yy" { LEX *lex= Lex; MYSQL_YYABORT_UNLESS((yyvsp[(3) - (11)].table_list) && (yyvsp[(7) - (11)].table_list)); @@ -21671,7 +21673,7 @@ break; case 1068: -#line 5926 "sql_yacc.yy" +#line 5928 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -21696,7 +21698,7 @@ break; case 1069: -#line 5948 "sql_yacc.yy" +#line 5950 "sql_yacc.yy" { /* Use $2 instead of Lex->current_select as derived table will alter value of Lex->current_select. */ @@ -21742,7 +21744,7 @@ break; case 1070: -#line 5995 "sql_yacc.yy" +#line 5997 "sql_yacc.yy" { LEX *lex= Lex; if ((yyvsp[(1) - (1)].select_lex)->init_nested_join(lex->thd)) @@ -21751,7 +21753,7 @@ break; case 1071: -#line 6001 "sql_yacc.yy" +#line 6003 "sql_yacc.yy" { LEX *lex= Lex; /* for normal joins, $3 != NULL and end_nested_join() != NULL, @@ -21768,7 +21770,7 @@ break; case 1072: -#line 6017 "sql_yacc.yy" +#line 6019 "sql_yacc.yy" { LEX *lex= Lex; lex->derived_tables|= DERIVED_SUBQUERY; @@ -21789,19 +21791,19 @@ break; case 1073: -#line 6035 "sql_yacc.yy" +#line 6037 "sql_yacc.yy" { Select->parsing_place= NO_MATTER; } break; case 1075: -#line 6042 "sql_yacc.yy" +#line 6044 "sql_yacc.yy" { (yyval.select_lex)= Select; } break; case 1076: -#line 6047 "sql_yacc.yy" +#line 6049 "sql_yacc.yy" { LEX *lex= Lex; @@ -21827,22 +21829,22 @@ break; case 1077: -#line 6072 "sql_yacc.yy" +#line 6074 "sql_yacc.yy" {} break; case 1078: -#line 6073 "sql_yacc.yy" +#line 6075 "sql_yacc.yy" {} break; case 1081: -#line 6080 "sql_yacc.yy" +#line 6082 "sql_yacc.yy" {} break; case 1082: -#line 6082 "sql_yacc.yy" +#line 6084 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->use_index= *(yyvsp[(2) - (2)].string_list); @@ -21851,7 +21853,7 @@ break; case 1083: -#line 6088 "sql_yacc.yy" +#line 6090 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->use_index= *(yyvsp[(2) - (2)].string_list); @@ -21861,7 +21863,7 @@ break; case 1084: -#line 6095 "sql_yacc.yy" +#line 6097 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->ignore_index= *(yyvsp[(2) - (2)].string_list); @@ -21870,48 +21872,48 @@ break; case 1085: -#line 6103 "sql_yacc.yy" +#line 6105 "sql_yacc.yy" { Select->interval_list.empty(); } break; case 1086: -#line 6105 "sql_yacc.yy" +#line 6107 "sql_yacc.yy" { (yyval.string_list)= &Select->interval_list; } break; case 1087: -#line 6109 "sql_yacc.yy" +#line 6111 "sql_yacc.yy" {} break; case 1088: -#line 6110 "sql_yacc.yy" +#line 6112 "sql_yacc.yy" {} break; case 1089: -#line 6115 "sql_yacc.yy" +#line 6117 "sql_yacc.yy" { Select-> interval_list.push_back(new (YYTHD->mem_root) String((const char*) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, system_charset_info)); } break; case 1090: -#line 6119 "sql_yacc.yy" +#line 6121 "sql_yacc.yy" { Select-> interval_list.push_back(new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, system_charset_info)); } break; case 1091: -#line 6123 "sql_yacc.yy" +#line 6125 "sql_yacc.yy" { Select-> interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7, system_charset_info)); } break; case 1092: -#line 6129 "sql_yacc.yy" +#line 6131 "sql_yacc.yy" { if (!((yyval.string_list)= new List)) MYSQL_YYABORT; @@ -21922,7 +21924,7 @@ break; case 1093: -#line 6137 "sql_yacc.yy" +#line 6139 "sql_yacc.yy" { (yyvsp[(1) - (3)].string_list)->push_back(new (YYTHD->mem_root) String((const char *) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, @@ -21932,159 +21934,159 @@ break; case 1094: -#line 6145 "sql_yacc.yy" +#line 6147 "sql_yacc.yy" {} break; case 1095: -#line 6146 "sql_yacc.yy" +#line 6148 "sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_HOUR; } break; case 1096: -#line 6147 "sql_yacc.yy" +#line 6149 "sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_MICROSECOND; } break; case 1097: -#line 6148 "sql_yacc.yy" +#line 6150 "sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_MINUTE; } break; case 1098: -#line 6149 "sql_yacc.yy" +#line 6151 "sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_SECOND; } break; case 1099: -#line 6150 "sql_yacc.yy" +#line 6152 "sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_MICROSECOND; } break; case 1100: -#line 6151 "sql_yacc.yy" +#line 6153 "sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_MINUTE; } break; case 1101: -#line 6152 "sql_yacc.yy" +#line 6154 "sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_SECOND; } break; case 1102: -#line 6153 "sql_yacc.yy" +#line 6155 "sql_yacc.yy" { (yyval.interval)=INTERVAL_MICROSECOND; } break; case 1103: -#line 6154 "sql_yacc.yy" +#line 6156 "sql_yacc.yy" { (yyval.interval)=INTERVAL_MINUTE_MICROSECOND; } break; case 1104: -#line 6155 "sql_yacc.yy" +#line 6157 "sql_yacc.yy" { (yyval.interval)=INTERVAL_MINUTE_SECOND; } break; case 1105: -#line 6156 "sql_yacc.yy" +#line 6158 "sql_yacc.yy" { (yyval.interval)=INTERVAL_SECOND_MICROSECOND; } break; case 1106: -#line 6157 "sql_yacc.yy" +#line 6159 "sql_yacc.yy" { (yyval.interval)=INTERVAL_YEAR_MONTH; } break; case 1107: -#line 6160 "sql_yacc.yy" +#line 6162 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_DAY; } break; case 1108: -#line 6161 "sql_yacc.yy" +#line 6163 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_WEEK; } break; case 1109: -#line 6162 "sql_yacc.yy" +#line 6164 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_HOUR; } break; case 1110: -#line 6163 "sql_yacc.yy" +#line 6165 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MICROSECOND; } break; case 1111: -#line 6164 "sql_yacc.yy" +#line 6166 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MINUTE; } break; case 1112: -#line 6165 "sql_yacc.yy" +#line 6167 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MONTH; } break; case 1113: -#line 6166 "sql_yacc.yy" +#line 6168 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_QUARTER; } break; case 1114: -#line 6167 "sql_yacc.yy" +#line 6169 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_SECOND; } break; case 1115: -#line 6168 "sql_yacc.yy" +#line 6170 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_YEAR; } break; case 1116: -#line 6172 "sql_yacc.yy" +#line 6174 "sql_yacc.yy" {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATE;} break; case 1117: -#line 6173 "sql_yacc.yy" +#line 6175 "sql_yacc.yy" {(yyval.date_time_type)=MYSQL_TIMESTAMP_TIME;} break; case 1118: -#line 6174 "sql_yacc.yy" +#line 6176 "sql_yacc.yy" {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATETIME;} break; case 1119: -#line 6175 "sql_yacc.yy" +#line 6177 "sql_yacc.yy" {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATETIME;} break; case 1123: -#line 6184 "sql_yacc.yy" +#line 6186 "sql_yacc.yy" { (yyval.lex_str_ptr)=0; } break; case 1124: -#line 6186 "sql_yacc.yy" +#line 6188 "sql_yacc.yy" { (yyval.lex_str_ptr)= (LEX_STRING*) sql_memdup(&(yyvsp[(2) - (2)].lex_str),sizeof(LEX_STRING)); } break; case 1127: -#line 6194 "sql_yacc.yy" +#line 6196 "sql_yacc.yy" { Select->where= 0; } break; case 1128: -#line 6196 "sql_yacc.yy" +#line 6198 "sql_yacc.yy" { Select->parsing_place= IN_WHERE; } break; case 1129: -#line 6200 "sql_yacc.yy" +#line 6202 "sql_yacc.yy" { SELECT_LEX *select= Select; select->where= (yyvsp[(3) - (3)].item); @@ -22095,14 +22097,14 @@ break; case 1131: -#line 6212 "sql_yacc.yy" +#line 6214 "sql_yacc.yy" { Select->parsing_place= IN_HAVING; } break; case 1132: -#line 6216 "sql_yacc.yy" +#line 6218 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->having= (yyvsp[(3) - (3)].item); @@ -22113,7 +22115,7 @@ break; case 1133: -#line 6227 "sql_yacc.yy" +#line 6229 "sql_yacc.yy" { Lex->escape_used= TRUE; (yyval.item)= (yyvsp[(2) - (2)].item); @@ -22121,7 +22123,7 @@ break; case 1134: -#line 6232 "sql_yacc.yy" +#line 6234 "sql_yacc.yy" { Lex->escape_used= FALSE; (yyval.item)= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? @@ -22131,22 +22133,22 @@ break; case 1137: -#line 6251 "sql_yacc.yy" +#line 6253 "sql_yacc.yy" { if (add_group_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1138: -#line 6253 "sql_yacc.yy" +#line 6255 "sql_yacc.yy" { if (add_group_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1139: -#line 6256 "sql_yacc.yy" +#line 6258 "sql_yacc.yy" {} break; case 1140: -#line 6258 "sql_yacc.yy" +#line 6260 "sql_yacc.yy" { LEX *lex=Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) @@ -22162,7 +22164,7 @@ break; case 1141: -#line 6271 "sql_yacc.yy" +#line 6273 "sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) @@ -22176,7 +22178,7 @@ break; case 1145: -#line 6298 "sql_yacc.yy" +#line 6300 "sql_yacc.yy" { THD *thd= YYTHD; bool ascending= ((yyvsp[(2) - (2)].num) == 1) ? true : false; @@ -22186,7 +22188,7 @@ break; case 1148: -#line 6316 "sql_yacc.yy" +#line 6318 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= lex->current_select; @@ -22219,32 +22221,32 @@ break; case 1150: -#line 6348 "sql_yacc.yy" +#line 6350 "sql_yacc.yy" { if (add_order_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1151: -#line 6350 "sql_yacc.yy" +#line 6352 "sql_yacc.yy" { if (add_order_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1152: -#line 6353 "sql_yacc.yy" +#line 6355 "sql_yacc.yy" { (yyval.num) = 1; } break; case 1153: -#line 6354 "sql_yacc.yy" +#line 6356 "sql_yacc.yy" { (yyval.num) =1; } break; case 1154: -#line 6355 "sql_yacc.yy" +#line 6357 "sql_yacc.yy" { (yyval.num) =0; } break; case 1155: -#line 6360 "sql_yacc.yy" +#line 6362 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -22254,27 +22256,27 @@ break; case 1156: -#line 6366 "sql_yacc.yy" +#line 6368 "sql_yacc.yy" {} break; case 1157: -#line 6370 "sql_yacc.yy" +#line 6372 "sql_yacc.yy" {} break; case 1158: -#line 6371 "sql_yacc.yy" +#line 6373 "sql_yacc.yy" {} break; case 1159: -#line 6375 "sql_yacc.yy" +#line 6377 "sql_yacc.yy" {} break; case 1160: -#line 6380 "sql_yacc.yy" +#line 6382 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(1) - (1)].item); @@ -22284,7 +22286,7 @@ break; case 1161: -#line 6387 "sql_yacc.yy" +#line 6389 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(3) - (3)].item); @@ -22294,7 +22296,7 @@ break; case 1162: -#line 6394 "sql_yacc.yy" +#line 6396 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(1) - (3)].item); @@ -22304,29 +22306,29 @@ break; case 1163: -#line 6403 "sql_yacc.yy" +#line 6405 "sql_yacc.yy" { ((Item_param *) (yyvsp[(1) - (1)].item))->set_strict_type(INT_RESULT); } break; case 1164: -#line 6406 "sql_yacc.yy" +#line 6408 "sql_yacc.yy" { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1165: -#line 6407 "sql_yacc.yy" +#line 6409 "sql_yacc.yy" { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1166: -#line 6408 "sql_yacc.yy" +#line 6410 "sql_yacc.yy" { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1167: -#line 6413 "sql_yacc.yy" +#line 6415 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select->select_limit= 0; @@ -22334,7 +22336,7 @@ break; case 1168: -#line 6418 "sql_yacc.yy" +#line 6420 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(2) - (2)].item); @@ -22343,62 +22345,62 @@ break; case 1169: -#line 6425 "sql_yacc.yy" +#line 6427 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1170: -#line 6426 "sql_yacc.yy" +#line 6428 "sql_yacc.yy" { (yyval.ulong_num)= (ulong) strtol((yyvsp[(1) - (1)].lex_str).str, (char**) 0, 16); } break; case 1171: -#line 6427 "sql_yacc.yy" +#line 6429 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1172: -#line 6428 "sql_yacc.yy" +#line 6430 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1173: -#line 6429 "sql_yacc.yy" +#line 6431 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1174: -#line 6430 "sql_yacc.yy" +#line 6432 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1175: -#line 6434 "sql_yacc.yy" +#line 6436 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1176: -#line 6435 "sql_yacc.yy" +#line 6437 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1177: -#line 6436 "sql_yacc.yy" +#line 6438 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1178: -#line 6437 "sql_yacc.yy" +#line 6439 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1179: -#line 6438 "sql_yacc.yy" +#line 6440 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1181: -#line 6444 "sql_yacc.yy" +#line 6446 "sql_yacc.yy" { LEX *lex=Lex; @@ -22426,17 +22428,17 @@ break; case 1183: -#line 6472 "sql_yacc.yy" +#line 6474 "sql_yacc.yy" {} break; case 1184: -#line 6473 "sql_yacc.yy" +#line 6475 "sql_yacc.yy" {} break; case 1187: -#line 6481 "sql_yacc.yy" +#line 6483 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; @@ -22450,7 +22452,7 @@ break; case 1188: -#line 6495 "sql_yacc.yy" +#line 6497 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe && (!(lex->result= new select_dumpvar()))) @@ -22459,17 +22461,17 @@ break; case 1189: -#line 6501 "sql_yacc.yy" +#line 6503 "sql_yacc.yy" {} break; case 1191: -#line 6506 "sql_yacc.yy" +#line 6508 "sql_yacc.yy" {} break; case 1192: -#line 6511 "sql_yacc.yy" +#line 6513 "sql_yacc.yy" { LEX *lex=Lex; if (lex->result) @@ -22484,7 +22486,7 @@ break; case 1193: -#line 6523 "sql_yacc.yy" +#line 6525 "sql_yacc.yy" { LEX *lex=Lex; sp_variable_t *t; @@ -22516,7 +22518,7 @@ break; case 1194: -#line 6555 "sql_yacc.yy" +#line 6557 "sql_yacc.yy" { if (! Lex->parsing_options.allows_select_into) { @@ -22527,7 +22529,7 @@ break; case 1196: -#line 6567 "sql_yacc.yy" +#line 6569 "sql_yacc.yy" { LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_SIDEEFFECT); @@ -22538,7 +22540,7 @@ break; case 1198: -#line 6576 "sql_yacc.yy" +#line 6578 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe) @@ -22553,14 +22555,14 @@ break; case 1199: -#line 6588 "sql_yacc.yy" +#line 6590 "sql_yacc.yy" { Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } break; case 1200: -#line 6598 "sql_yacc.yy" +#line 6600 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DO; @@ -22569,14 +22571,14 @@ break; case 1201: -#line 6604 "sql_yacc.yy" +#line 6606 "sql_yacc.yy" { Lex->insert_list= (yyvsp[(3) - (3)].item_list); } break; case 1202: -#line 6615 "sql_yacc.yy" +#line 6617 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DROP_TABLE; @@ -22586,12 +22588,12 @@ break; case 1203: -#line 6621 "sql_yacc.yy" +#line 6623 "sql_yacc.yy" {} break; case 1204: -#line 6622 "sql_yacc.yy" +#line 6624 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_INDEX; @@ -22606,7 +22608,7 @@ break; case 1205: -#line 6634 "sql_yacc.yy" +#line 6636 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_DB; @@ -22616,7 +22618,7 @@ break; case 1206: -#line 6641 "sql_yacc.yy" +#line 6643 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -22631,7 +22633,7 @@ break; case 1207: -#line 6653 "sql_yacc.yy" +#line 6655 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -22646,14 +22648,14 @@ break; case 1208: -#line 6665 "sql_yacc.yy" +#line 6667 "sql_yacc.yy" { Lex->sql_command = SQLCOM_DROP_USER; } break; case 1209: -#line 6669 "sql_yacc.yy" +#line 6671 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_VIEW; @@ -22662,7 +22664,7 @@ break; case 1210: -#line 6675 "sql_yacc.yy" +#line 6677 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_TRIGGER; @@ -22672,7 +22674,7 @@ break; case 1213: -#line 6689 "sql_yacc.yy" +#line 6691 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; @@ -22680,7 +22682,7 @@ break; case 1216: -#line 6701 "sql_yacc.yy" +#line 6703 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL, TL_OPTION_UPDATING | TL_OPTION_ALIAS, @@ -22690,27 +22692,27 @@ break; case 1217: -#line 6710 "sql_yacc.yy" +#line 6712 "sql_yacc.yy" { (yyval.num)= 0; } break; case 1218: -#line 6711 "sql_yacc.yy" +#line 6713 "sql_yacc.yy" { (yyval.num)= 1; } break; case 1219: -#line 6715 "sql_yacc.yy" +#line 6717 "sql_yacc.yy" { (yyval.num)= 0; } break; case 1220: -#line 6716 "sql_yacc.yy" +#line 6718 "sql_yacc.yy" { (yyval.num)= 1; } break; case 1221: -#line 6724 "sql_yacc.yy" +#line 6726 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_INSERT; @@ -22722,7 +22724,7 @@ break; case 1222: -#line 6733 "sql_yacc.yy" +#line 6735 "sql_yacc.yy" { Select->set_lock_for_tables((yyvsp[(3) - (5)].lock_type)); Lex->current_select= &Lex->select_lex; @@ -22730,12 +22732,12 @@ break; case 1223: -#line 6738 "sql_yacc.yy" +#line 6740 "sql_yacc.yy" {} break; case 1224: -#line 6743 "sql_yacc.yy" +#line 6745 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPLACE; @@ -22745,7 +22747,7 @@ break; case 1225: -#line 6750 "sql_yacc.yy" +#line 6752 "sql_yacc.yy" { Select->set_lock_for_tables((yyvsp[(3) - (4)].lock_type)); Lex->current_select= &Lex->select_lex; @@ -22753,12 +22755,12 @@ break; case 1226: -#line 6755 "sql_yacc.yy" +#line 6757 "sql_yacc.yy" {} break; case 1227: -#line 6760 "sql_yacc.yy" +#line 6762 "sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* @@ -22774,42 +22776,42 @@ break; case 1228: -#line 6772 "sql_yacc.yy" +#line 6774 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1229: -#line 6773 "sql_yacc.yy" +#line 6775 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DELAYED; } break; case 1230: -#line 6774 "sql_yacc.yy" +#line 6776 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE; } break; case 1231: -#line 6778 "sql_yacc.yy" +#line 6780 "sql_yacc.yy" { (yyval.lock_type)= (yyvsp[(1) - (1)].lock_type); } break; case 1232: -#line 6779 "sql_yacc.yy" +#line 6781 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DELAYED; } break; case 1233: -#line 6782 "sql_yacc.yy" +#line 6784 "sql_yacc.yy" {} break; case 1234: -#line 6783 "sql_yacc.yy" +#line 6785 "sql_yacc.yy" {} break; case 1235: -#line 6787 "sql_yacc.yy" +#line 6789 "sql_yacc.yy" { LEX *lex=Lex; lex->field_list.empty(); @@ -22819,22 +22821,22 @@ break; case 1236: -#line 6795 "sql_yacc.yy" +#line 6797 "sql_yacc.yy" {} break; case 1237: -#line 6796 "sql_yacc.yy" +#line 6798 "sql_yacc.yy" {} break; case 1238: -#line 6797 "sql_yacc.yy" +#line 6799 "sql_yacc.yy" {} break; case 1239: -#line 6799 "sql_yacc.yy" +#line 6801 "sql_yacc.yy" { LEX *lex=Lex; if (!(lex->insert_list = new List_item) || @@ -22844,47 +22846,47 @@ break; case 1241: -#line 6808 "sql_yacc.yy" +#line 6810 "sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1242: -#line 6809 "sql_yacc.yy" +#line 6811 "sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1243: -#line 6812 "sql_yacc.yy" +#line 6814 "sql_yacc.yy" {} break; case 1244: -#line 6813 "sql_yacc.yy" +#line 6815 "sql_yacc.yy" {} break; case 1245: -#line 6814 "sql_yacc.yy" +#line 6816 "sql_yacc.yy" { Select->set_braces(0);} break; case 1246: -#line 6814 "sql_yacc.yy" +#line 6816 "sql_yacc.yy" {} break; case 1247: -#line 6815 "sql_yacc.yy" +#line 6817 "sql_yacc.yy" { Select->set_braces(1);} break; case 1248: -#line 6815 "sql_yacc.yy" +#line 6817 "sql_yacc.yy" {} break; case 1253: -#line 6829 "sql_yacc.yy" +#line 6831 "sql_yacc.yy" { LEX *lex=Lex; if (lex->field_list.push_back((yyvsp[(1) - (3)].item)) || @@ -22894,27 +22896,27 @@ break; case 1254: -#line 6836 "sql_yacc.yy" +#line 6838 "sql_yacc.yy" {} break; case 1255: -#line 6837 "sql_yacc.yy" +#line 6839 "sql_yacc.yy" {} break; case 1256: -#line 6841 "sql_yacc.yy" +#line 6843 "sql_yacc.yy" {} break; case 1257: -#line 6842 "sql_yacc.yy" +#line 6844 "sql_yacc.yy" {} break; case 1258: -#line 6847 "sql_yacc.yy" +#line 6849 "sql_yacc.yy" { if (!(Lex->insert_list = new List_item)) MYSQL_YYABORT; @@ -22922,7 +22924,7 @@ break; case 1259: -#line 6852 "sql_yacc.yy" +#line 6854 "sql_yacc.yy" { LEX *lex=Lex; if (lex->many_values.push_back(lex->insert_list)) @@ -22931,12 +22933,12 @@ break; case 1260: -#line 6859 "sql_yacc.yy" +#line 6861 "sql_yacc.yy" {} break; case 1262: -#line 6864 "sql_yacc.yy" +#line 6866 "sql_yacc.yy" { if (Lex->insert_list->push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; @@ -22944,7 +22946,7 @@ break; case 1263: -#line 6869 "sql_yacc.yy" +#line 6871 "sql_yacc.yy" { if (Lex->insert_list->push_back((yyvsp[(1) - (1)].item))) MYSQL_YYABORT; @@ -22952,22 +22954,22 @@ break; case 1264: -#line 6876 "sql_yacc.yy" +#line 6878 "sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1265: -#line 6877 "sql_yacc.yy" +#line 6879 "sql_yacc.yy" {(yyval.item)= new Item_default_value(Lex->current_context()); } break; case 1267: -#line 6882 "sql_yacc.yy" +#line 6884 "sql_yacc.yy" { Lex->duplicates= DUP_UPDATE; } break; case 1269: -#line 6890 "sql_yacc.yy" +#line 6892 "sql_yacc.yy" { LEX *lex= Lex; mysql_init_select(lex); @@ -22978,7 +22980,7 @@ break; case 1270: -#line 6899 "sql_yacc.yy" +#line 6901 "sql_yacc.yy" { LEX *lex= Lex; if (lex->select_lex.table_list.elements > 1) @@ -23000,12 +23002,12 @@ break; case 1271: -#line 6917 "sql_yacc.yy" +#line 6919 "sql_yacc.yy" {} break; case 1274: -#line 6926 "sql_yacc.yy" +#line 6928 "sql_yacc.yy" { if (add_item_to_list(YYTHD, (yyvsp[(1) - (3)].item)) || add_value_to_list(YYTHD, (yyvsp[(3) - (3)].item))) MYSQL_YYABORT; @@ -23013,7 +23015,7 @@ break; case 1277: -#line 6937 "sql_yacc.yy" +#line 6939 "sql_yacc.yy" { LEX *lex= Lex; if (lex->update_list.push_back((yyvsp[(1) - (3)].item)) || @@ -23023,17 +23025,17 @@ break; case 1278: -#line 6945 "sql_yacc.yy" +#line 6947 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1279: -#line 6946 "sql_yacc.yy" +#line 6948 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1280: -#line 6952 "sql_yacc.yy" +#line 6954 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; @@ -23045,12 +23047,12 @@ break; case 1281: -#line 6960 "sql_yacc.yy" +#line 6962 "sql_yacc.yy" {} break; case 1282: -#line 6965 "sql_yacc.yy" +#line 6967 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(2) - (2)].table), NULL, TL_OPTION_UPDATING, Lex->lock_option)) @@ -23059,17 +23061,17 @@ break; case 1283: -#line 6971 "sql_yacc.yy" +#line 6973 "sql_yacc.yy" {} break; case 1284: -#line 6973 "sql_yacc.yy" +#line 6975 "sql_yacc.yy" { mysql_init_multi_delete(Lex); } break; case 1285: -#line 6975 "sql_yacc.yy" +#line 6977 "sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -23077,12 +23079,12 @@ break; case 1286: -#line 6980 "sql_yacc.yy" +#line 6982 "sql_yacc.yy" { mysql_init_multi_delete(Lex); } break; case 1287: -#line 6982 "sql_yacc.yy" +#line 6984 "sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -23090,17 +23092,17 @@ break; case 1288: -#line 6989 "sql_yacc.yy" +#line 6991 "sql_yacc.yy" {} break; case 1289: -#line 6990 "sql_yacc.yy" +#line 6992 "sql_yacc.yy" {} break; case 1290: -#line 6994 "sql_yacc.yy" +#line 6996 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, new Table_ident((yyvsp[(1) - (3)].lex_str)), (yyvsp[(3) - (3)].lex_str_ptr), TL_OPTION_UPDATING | @@ -23110,7 +23112,7 @@ break; case 1291: -#line 7001 "sql_yacc.yy" +#line 7003 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, new Table_ident(YYTHD, (yyvsp[(1) - (5)].lex_str), (yyvsp[(3) - (5)].lex_str), 0), @@ -23123,42 +23125,42 @@ break; case 1292: -#line 7013 "sql_yacc.yy" +#line 7015 "sql_yacc.yy" {} break; case 1293: -#line 7014 "sql_yacc.yy" +#line 7016 "sql_yacc.yy" {} break; case 1294: -#line 7018 "sql_yacc.yy" +#line 7020 "sql_yacc.yy" {} break; case 1295: -#line 7019 "sql_yacc.yy" +#line 7021 "sql_yacc.yy" {} break; case 1296: -#line 7022 "sql_yacc.yy" +#line 7024 "sql_yacc.yy" { Select->options|= OPTION_QUICK; } break; case 1297: -#line 7023 "sql_yacc.yy" +#line 7025 "sql_yacc.yy" { Lex->lock_option= TL_WRITE_LOW_PRIORITY; } break; case 1298: -#line 7024 "sql_yacc.yy" +#line 7026 "sql_yacc.yy" { Lex->ignore= 1; } break; case 1299: -#line 7028 "sql_yacc.yy" +#line 7030 "sql_yacc.yy" { LEX* lex= Lex; lex->sql_command= SQLCOM_TRUNCATE; @@ -23169,84 +23171,84 @@ break; case 1306: -#line 7051 "sql_yacc.yy" +#line 7053 "sql_yacc.yy" { Lex->profile_options|= PROFILE_CPU; } break; case 1307: -#line 7055 "sql_yacc.yy" +#line 7057 "sql_yacc.yy" { Lex->profile_options|= PROFILE_MEMORY; } break; case 1308: -#line 7059 "sql_yacc.yy" +#line 7061 "sql_yacc.yy" { Lex->profile_options|= PROFILE_BLOCK_IO; } break; case 1309: -#line 7063 "sql_yacc.yy" +#line 7065 "sql_yacc.yy" { Lex->profile_options|= PROFILE_CONTEXT; } break; case 1310: -#line 7067 "sql_yacc.yy" +#line 7069 "sql_yacc.yy" { Lex->profile_options|= PROFILE_PAGE_FAULTS; } break; case 1311: -#line 7071 "sql_yacc.yy" +#line 7073 "sql_yacc.yy" { Lex->profile_options|= PROFILE_IPC; } break; case 1312: -#line 7075 "sql_yacc.yy" +#line 7077 "sql_yacc.yy" { Lex->profile_options|= PROFILE_SWAPS; } break; case 1313: -#line 7079 "sql_yacc.yy" +#line 7081 "sql_yacc.yy" { Lex->profile_options|= PROFILE_SOURCE; } break; case 1314: -#line 7083 "sql_yacc.yy" +#line 7085 "sql_yacc.yy" { Lex->profile_options|= PROFILE_ALL; } break; case 1315: -#line 7090 "sql_yacc.yy" +#line 7092 "sql_yacc.yy" { Lex->profile_query_id= 0; } break; case 1316: -#line 7094 "sql_yacc.yy" +#line 7096 "sql_yacc.yy" { Lex->profile_query_id= atoi((yyvsp[(3) - (3)].lex_str).str); } break; case 1317: -#line 7102 "sql_yacc.yy" +#line 7104 "sql_yacc.yy" { LEX *lex=Lex; lex->wild=0; @@ -23258,12 +23260,12 @@ break; case 1318: -#line 7111 "sql_yacc.yy" +#line 7113 "sql_yacc.yy" {} break; case 1319: -#line 7116 "sql_yacc.yy" +#line 7118 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23274,7 +23276,7 @@ break; case 1320: -#line 7124 "sql_yacc.yy" +#line 7126 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23286,7 +23288,7 @@ break; case 1321: -#line 7133 "sql_yacc.yy" +#line 7135 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23298,7 +23300,7 @@ break; case 1322: -#line 7142 "sql_yacc.yy" +#line 7144 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23310,7 +23312,7 @@ break; case 1323: -#line 7151 "sql_yacc.yy" +#line 7153 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23322,12 +23324,12 @@ break; case 1324: -#line 7160 "sql_yacc.yy" +#line 7162 "sql_yacc.yy" { Lex->create_info.db_type= (yyvsp[(2) - (2)].db_type); } break; case 1326: -#line 7163 "sql_yacc.yy" +#line 7165 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23340,7 +23342,7 @@ break; case 1327: -#line 7176 "sql_yacc.yy" +#line 7178 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_NEW_MASTER; Lex->mi.log_file_name = (yyvsp[(8) - (16)].lex_str).str; @@ -23350,21 +23352,21 @@ break; case 1328: -#line 7183 "sql_yacc.yy" +#line 7185 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_BINLOGS; } break; case 1329: -#line 7187 "sql_yacc.yy" +#line 7189 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS; } break; case 1330: -#line 7191 "sql_yacc.yy" +#line 7193 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS; @@ -23372,7 +23374,7 @@ break; case 1332: -#line 7196 "sql_yacc.yy" +#line 7198 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23385,7 +23387,7 @@ break; case 1333: -#line 7206 "sql_yacc.yy" +#line 7208 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_COLUMN_TYPES; @@ -23393,7 +23395,7 @@ break; case 1334: -#line 7211 "sql_yacc.yy" +#line 7213 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -23402,7 +23404,7 @@ break; case 1335: -#line 7217 "sql_yacc.yy" +#line 7219 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -23410,7 +23412,7 @@ break; case 1336: -#line 7222 "sql_yacc.yy" +#line 7224 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_PRIVILEGES; @@ -23418,32 +23420,32 @@ break; case 1337: -#line 7227 "sql_yacc.yy" +#line 7229 "sql_yacc.yy" { (void) create_select_for_variable("warning_count"); } break; case 1338: -#line 7229 "sql_yacc.yy" +#line 7231 "sql_yacc.yy" { (void) create_select_for_variable("error_count"); } break; case 1339: -#line 7231 "sql_yacc.yy" +#line 7233 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_WARNS;} break; case 1340: -#line 7233 "sql_yacc.yy" +#line 7235 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_ERRORS;} break; case 1341: -#line 7235 "sql_yacc.yy" +#line 7237 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_PROFILES; } break; case 1342: -#line 7237 "sql_yacc.yy" +#line 7239 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23454,7 +23456,7 @@ break; case 1343: -#line 7245 "sql_yacc.yy" +#line 7247 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23466,22 +23468,22 @@ break; case 1344: -#line 7254 "sql_yacc.yy" +#line 7256 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; WARN_DEPRECATED("SHOW INNODB STATUS", "SHOW ENGINE INNODB STATUS"); } break; case 1345: -#line 7256 "sql_yacc.yy" +#line 7258 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MUTEX_STATUS; } break; case 1346: -#line 7258 "sql_yacc.yy" +#line 7260 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;} break; case 1347: -#line 7260 "sql_yacc.yy" +#line 7262 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23493,7 +23495,7 @@ break; case 1348: -#line 7269 "sql_yacc.yy" +#line 7271 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23504,7 +23506,7 @@ break; case 1349: -#line 7277 "sql_yacc.yy" +#line 7279 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23515,17 +23517,17 @@ break; case 1350: -#line 7285 "sql_yacc.yy" +#line 7287 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW BDB LOGS", "SHOW ENGINE BDB LOGS"); } break; case 1351: -#line 7287 "sql_yacc.yy" +#line 7289 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW LOGS", "SHOW ENGINE BDB LOGS"); } break; case 1352: -#line 7289 "sql_yacc.yy" +#line 7291 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; @@ -23538,7 +23540,7 @@ break; case 1353: -#line 7299 "sql_yacc.yy" +#line 7301 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; @@ -23548,7 +23550,7 @@ break; case 1354: -#line 7306 "sql_yacc.yy" +#line 7308 "sql_yacc.yy" { Lex->sql_command=SQLCOM_SHOW_CREATE_DB; Lex->create_info.options=(yyvsp[(3) - (4)].num); @@ -23557,7 +23559,7 @@ break; case 1355: -#line 7312 "sql_yacc.yy" +#line 7314 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; @@ -23568,7 +23570,7 @@ break; case 1356: -#line 7320 "sql_yacc.yy" +#line 7322 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; @@ -23579,21 +23581,21 @@ break; case 1357: -#line 7328 "sql_yacc.yy" +#line 7330 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MASTER_STAT; } break; case 1358: -#line 7332 "sql_yacc.yy" +#line 7334 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; } break; case 1359: -#line 7336 "sql_yacc.yy" +#line 7338 "sql_yacc.yy" { LEX *lex= Lex; @@ -23603,7 +23605,7 @@ break; case 1360: -#line 7343 "sql_yacc.yy" +#line 7345 "sql_yacc.yy" { LEX *lex= Lex; @@ -23613,7 +23615,7 @@ break; case 1361: -#line 7350 "sql_yacc.yy" +#line 7352 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23626,7 +23628,7 @@ break; case 1362: -#line 7360 "sql_yacc.yy" +#line 7362 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23639,7 +23641,7 @@ break; case 1363: -#line 7370 "sql_yacc.yy" +#line 7372 "sql_yacc.yy" { #ifdef DBUG_OFF my_parse_error(ER(ER_SYNTAX_ERROR)); @@ -23652,7 +23654,7 @@ break; case 1364: -#line 7380 "sql_yacc.yy" +#line 7382 "sql_yacc.yy" { #ifdef DBUG_OFF my_parse_error(ER(ER_SYNTAX_ERROR)); @@ -23666,7 +23668,7 @@ break; case 1365: -#line 7391 "sql_yacc.yy" +#line 7393 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_SENNA_STATUS; Lex->select_lex.db = (yyvsp[(3) - (4)].simple_string); @@ -23675,7 +23677,7 @@ break; case 1366: -#line 7400 "sql_yacc.yy" +#line 7402 "sql_yacc.yy" { switch (Lex->create_info.db_type) { case DB_TYPE_NDBCLUSTER: @@ -23692,7 +23694,7 @@ break; case 1367: -#line 7414 "sql_yacc.yy" +#line 7416 "sql_yacc.yy" { switch (Lex->create_info.db_type) { case DB_TYPE_BERKELEY_DB: @@ -23706,53 +23708,53 @@ break; case 1372: -#line 7434 "sql_yacc.yy" +#line 7436 "sql_yacc.yy" { (yyval.simple_string)= 0; } break; case 1373: -#line 7435 "sql_yacc.yy" +#line 7437 "sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(2) - (2)].lex_str).str; } break; case 1374: -#line 7438 "sql_yacc.yy" +#line 7440 "sql_yacc.yy" { Lex->verbose=0; } break; case 1375: -#line 7439 "sql_yacc.yy" +#line 7441 "sql_yacc.yy" { Lex->verbose=1; } break; case 1378: -#line 7446 "sql_yacc.yy" +#line 7448 "sql_yacc.yy" { Lex->mi.log_file_name = 0; } break; case 1379: -#line 7447 "sql_yacc.yy" +#line 7449 "sql_yacc.yy" { Lex->mi.log_file_name = (yyvsp[(2) - (2)].lex_str).str; } break; case 1380: -#line 7450 "sql_yacc.yy" +#line 7452 "sql_yacc.yy" { Lex->mi.pos = 4; /* skip magic number */ } break; case 1381: -#line 7451 "sql_yacc.yy" +#line 7453 "sql_yacc.yy" { Lex->mi.pos = (yyvsp[(2) - (2)].ulonglong_number); } break; case 1383: -#line 7456 "sql_yacc.yy" +#line 7458 "sql_yacc.yy" { Lex->wild= new (YYTHD->mem_root) String((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, system_charset_info); } break; case 1384: -#line 7459 "sql_yacc.yy" +#line 7461 "sql_yacc.yy" { Select->where= (yyvsp[(2) - (2)].item); if ((yyvsp[(2) - (2)].item)) @@ -23761,7 +23763,7 @@ break; case 1385: -#line 7470 "sql_yacc.yy" +#line 7472 "sql_yacc.yy" { LEX *lex= Lex; lex->lock_option= TL_READ; @@ -23777,17 +23779,17 @@ break; case 1386: -#line 7482 "sql_yacc.yy" +#line 7484 "sql_yacc.yy" {} break; case 1387: -#line 7484 "sql_yacc.yy" +#line 7486 "sql_yacc.yy" { Lex->describe|= DESCRIBE_NORMAL; } break; case 1388: -#line 7486 "sql_yacc.yy" +#line 7488 "sql_yacc.yy" { LEX *lex=Lex; lex->select_lex.options|= SELECT_DESCRIBE; @@ -23795,32 +23797,32 @@ break; case 1391: -#line 7497 "sql_yacc.yy" +#line 7499 "sql_yacc.yy" {} break; case 1392: -#line 7498 "sql_yacc.yy" +#line 7500 "sql_yacc.yy" { Lex->describe|= DESCRIBE_EXTENDED; } break; case 1393: -#line 7502 "sql_yacc.yy" +#line 7504 "sql_yacc.yy" {} break; case 1394: -#line 7503 "sql_yacc.yy" +#line 7505 "sql_yacc.yy" { Lex->wild= (yyvsp[(1) - (1)].string); } break; case 1395: -#line 7505 "sql_yacc.yy" +#line 7507 "sql_yacc.yy" { Lex->wild= new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); } break; case 1396: -#line 7512 "sql_yacc.yy" +#line 7514 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_FLUSH; @@ -23830,82 +23832,82 @@ break; case 1397: -#line 7519 "sql_yacc.yy" +#line 7521 "sql_yacc.yy" {} break; case 1400: -#line 7527 "sql_yacc.yy" +#line 7529 "sql_yacc.yy" { Lex->type|= REFRESH_TABLES; } break; case 1401: -#line 7527 "sql_yacc.yy" +#line 7529 "sql_yacc.yy" {} break; case 1402: -#line 7528 "sql_yacc.yy" +#line 7530 "sql_yacc.yy" { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; } break; case 1403: -#line 7529 "sql_yacc.yy" +#line 7531 "sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE_FREE; } break; case 1404: -#line 7530 "sql_yacc.yy" +#line 7532 "sql_yacc.yy" { Lex->type|= REFRESH_HOSTS; } break; case 1405: -#line 7531 "sql_yacc.yy" +#line 7533 "sql_yacc.yy" { Lex->type|= REFRESH_GRANT; } break; case 1406: -#line 7532 "sql_yacc.yy" +#line 7534 "sql_yacc.yy" { Lex->type|= REFRESH_LOG; } break; case 1407: -#line 7533 "sql_yacc.yy" +#line 7535 "sql_yacc.yy" { Lex->type|= REFRESH_STATUS; } break; case 1408: -#line 7534 "sql_yacc.yy" +#line 7536 "sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1409: -#line 7535 "sql_yacc.yy" +#line 7537 "sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1410: -#line 7536 "sql_yacc.yy" +#line 7538 "sql_yacc.yy" { Lex->type|= REFRESH_DES_KEY_FILE; } break; case 1411: -#line 7537 "sql_yacc.yy" +#line 7539 "sql_yacc.yy" { Lex->type|= REFRESH_USER_RESOURCES; } break; case 1412: -#line 7540 "sql_yacc.yy" +#line 7542 "sql_yacc.yy" {;} break; case 1413: -#line 7541 "sql_yacc.yy" +#line 7543 "sql_yacc.yy" {;} break; case 1414: -#line 7545 "sql_yacc.yy" +#line 7547 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RESET; lex->type=0; @@ -23913,27 +23915,27 @@ break; case 1415: -#line 7549 "sql_yacc.yy" +#line 7551 "sql_yacc.yy" {} break; case 1418: -#line 7557 "sql_yacc.yy" +#line 7559 "sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1419: -#line 7558 "sql_yacc.yy" +#line 7560 "sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1420: -#line 7559 "sql_yacc.yy" +#line 7561 "sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE;} break; case 1421: -#line 7563 "sql_yacc.yy" +#line 7565 "sql_yacc.yy" { LEX *lex=Lex; lex->type=0; @@ -23942,19 +23944,19 @@ break; case 1422: -#line 7568 "sql_yacc.yy" +#line 7570 "sql_yacc.yy" {} break; case 1424: -#line 7577 "sql_yacc.yy" +#line 7579 "sql_yacc.yy" { Lex->to_log = (yyvsp[(2) - (2)].lex_str).str; } break; case 1425: -#line 7581 "sql_yacc.yy" +#line 7583 "sql_yacc.yy" { LEX *lex= Lex; lex->value_list.empty(); @@ -23964,12 +23966,12 @@ break; case 1426: -#line 7592 "sql_yacc.yy" +#line 7594 "sql_yacc.yy" { Lex->sql_command= SQLCOM_KILL; } break; case 1427: -#line 7593 "sql_yacc.yy" +#line 7595 "sql_yacc.yy" { LEX *lex=Lex; lex->value_list.empty(); @@ -23978,22 +23980,22 @@ break; case 1428: -#line 7600 "sql_yacc.yy" +#line 7602 "sql_yacc.yy" { Lex->type= 0; } break; case 1429: -#line 7601 "sql_yacc.yy" +#line 7603 "sql_yacc.yy" { Lex->type= 0; } break; case 1430: -#line 7602 "sql_yacc.yy" +#line 7604 "sql_yacc.yy" { Lex->type= ONLY_KILL_QUERY; } break; case 1431: -#line 7608 "sql_yacc.yy" +#line 7610 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_CHANGE_DB; @@ -24002,7 +24004,7 @@ break; case 1432: -#line 7617 "sql_yacc.yy" +#line 7619 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24018,12 +24020,12 @@ break; case 1433: -#line 7630 "sql_yacc.yy" +#line 7632 "sql_yacc.yy" {} break; case 1434: -#line 7633 "sql_yacc.yy" +#line 7635 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -24041,7 +24043,7 @@ break; case 1435: -#line 7650 "sql_yacc.yy" +#line 7652 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_LOAD; @@ -24055,7 +24057,7 @@ break; case 1436: -#line 7661 "sql_yacc.yy" +#line 7663 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24065,7 +24067,7 @@ break; case 1437: -#line 7668 "sql_yacc.yy" +#line 7670 "sql_yacc.yy" { LEX *lex=Lex; if (!Select->add_table_to_list(YYTHD, (yyvsp[(10) - (10)].table), NULL, TL_OPTION_UPDATING, @@ -24078,17 +24080,17 @@ break; case 1438: -#line 7678 "sql_yacc.yy" +#line 7680 "sql_yacc.yy" { Lex->exchange->cs= (yyvsp[(12) - (12)].charset); } break; case 1439: -#line 7681 "sql_yacc.yy" +#line 7683 "sql_yacc.yy" {} break; case 1440: -#line 7684 "sql_yacc.yy" +#line 7686 "sql_yacc.yy" { Lex->sql_command = SQLCOM_LOAD_MASTER_DATA; WARN_DEPRECATED("LOAD DATA FROM MASTER", @@ -24098,22 +24100,22 @@ break; case 1441: -#line 7692 "sql_yacc.yy" +#line 7694 "sql_yacc.yy" { (yyval.num)=0;} break; case 1442: -#line 7693 "sql_yacc.yy" +#line 7695 "sql_yacc.yy" { (yyval.num)=1;} break; case 1443: -#line 7696 "sql_yacc.yy" +#line 7698 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1444: -#line 7698 "sql_yacc.yy" +#line 7700 "sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* @@ -24128,27 +24130,27 @@ break; case 1445: -#line 7709 "sql_yacc.yy" +#line 7711 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1446: -#line 7713 "sql_yacc.yy" +#line 7715 "sql_yacc.yy" { Lex->duplicates=DUP_ERROR; } break; case 1447: -#line 7714 "sql_yacc.yy" +#line 7716 "sql_yacc.yy" { Lex->duplicates=DUP_REPLACE; } break; case 1448: -#line 7715 "sql_yacc.yy" +#line 7717 "sql_yacc.yy" { Lex->ignore= 1; } break; case 1453: -#line 7727 "sql_yacc.yy" +#line 7729 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->field_term= (yyvsp[(3) - (3)].string); @@ -24156,7 +24158,7 @@ break; case 1454: -#line 7732 "sql_yacc.yy" +#line 7734 "sql_yacc.yy" { LEX *lex= Lex; DBUG_ASSERT(lex->exchange != 0); @@ -24166,7 +24168,7 @@ break; case 1455: -#line 7739 "sql_yacc.yy" +#line 7741 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->enclosed= (yyvsp[(3) - (3)].string); @@ -24174,7 +24176,7 @@ break; case 1456: -#line 7744 "sql_yacc.yy" +#line 7746 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->escaped= (yyvsp[(3) - (3)].string); @@ -24182,7 +24184,7 @@ break; case 1461: -#line 7759 "sql_yacc.yy" +#line 7761 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->line_term= (yyvsp[(3) - (3)].string); @@ -24190,7 +24192,7 @@ break; case 1462: -#line 7764 "sql_yacc.yy" +#line 7766 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->line_start= (yyvsp[(3) - (3)].string); @@ -24198,7 +24200,7 @@ break; case 1464: -#line 7772 "sql_yacc.yy" +#line 7774 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->skip_lines= atol((yyvsp[(2) - (3)].lex_str).str); @@ -24206,52 +24208,52 @@ break; case 1465: -#line 7778 "sql_yacc.yy" +#line 7780 "sql_yacc.yy" { } break; case 1466: -#line 7779 "sql_yacc.yy" +#line 7781 "sql_yacc.yy" { } break; case 1467: -#line 7780 "sql_yacc.yy" +#line 7782 "sql_yacc.yy" { } break; case 1468: -#line 7784 "sql_yacc.yy" +#line 7786 "sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1469: -#line 7786 "sql_yacc.yy" +#line 7788 "sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1470: -#line 7790 "sql_yacc.yy" +#line 7792 "sql_yacc.yy" {(yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1471: -#line 7792 "sql_yacc.yy" +#line 7794 "sql_yacc.yy" { (yyval.item)= new Item_user_var_as_out_param((yyvsp[(2) - (2)].lex_str)); } break; case 1472: -#line 7796 "sql_yacc.yy" +#line 7798 "sql_yacc.yy" { } break; case 1473: -#line 7797 "sql_yacc.yy" +#line 7799 "sql_yacc.yy" { } break; case 1474: -#line 7804 "sql_yacc.yy" +#line 7806 "sql_yacc.yy" { LEX_STRING tmp; THD *thd= YYTHD; @@ -24272,7 +24274,7 @@ break; case 1475: -#line 7822 "sql_yacc.yy" +#line 7824 "sql_yacc.yy" { uint repertoire= Lex->text_string_is_7bit ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30; @@ -24283,7 +24285,7 @@ break; case 1476: -#line 7830 "sql_yacc.yy" +#line 7832 "sql_yacc.yy" { (yyval.item)= new Item_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, Lex->underscore_charset); ((Item_string*) (yyval.item))->set_repertoire_from_value(); @@ -24291,7 +24293,7 @@ break; case 1477: -#line 7835 "sql_yacc.yy" +#line 7837 "sql_yacc.yy" { Item_string* item= (Item_string*) (yyvsp[(1) - (2)].item); item->append((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); @@ -24310,12 +24312,12 @@ break; case 1478: -#line 7854 "sql_yacc.yy" +#line 7856 "sql_yacc.yy" { (yyval.string)= new (YYTHD->mem_root) String((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,YYTHD->variables.collation_connection); } break; case 1479: -#line 7856 "sql_yacc.yy" +#line 7858 "sql_yacc.yy" { Item *tmp= new Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); /* @@ -24329,7 +24331,7 @@ break; case 1480: -#line 7867 "sql_yacc.yy" +#line 7869 "sql_yacc.yy" { Item *tmp= new Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); /* @@ -24342,7 +24344,7 @@ break; case 1481: -#line 7880 "sql_yacc.yy" +#line 7882 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24363,17 +24365,17 @@ break; case 1482: -#line 7900 "sql_yacc.yy" +#line 7902 "sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1483: -#line 7901 "sql_yacc.yy" +#line 7903 "sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item_num); } break; case 1484: -#line 7903 "sql_yacc.yy" +#line 7905 "sql_yacc.yy" { (yyvsp[(2) - (2)].item_num)->max_length++; (yyval.item)= (yyvsp[(2) - (2)].item_num)->neg(); @@ -24381,17 +24383,17 @@ break; case 1485: -#line 7911 "sql_yacc.yy" +#line 7913 "sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1486: -#line 7912 "sql_yacc.yy" +#line 7914 "sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item_num); } break; case 1487: -#line 7914 "sql_yacc.yy" +#line 7916 "sql_yacc.yy" { (yyval.item) = new Item_null(); YYTHD->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT; @@ -24399,27 +24401,27 @@ break; case 1488: -#line 7918 "sql_yacc.yy" +#line 7920 "sql_yacc.yy" { (yyval.item)= new Item_int((char*) "FALSE",0,1); } break; case 1489: -#line 7919 "sql_yacc.yy" +#line 7921 "sql_yacc.yy" { (yyval.item)= new Item_int((char*) "TRUE",1,1); } break; case 1490: -#line 7920 "sql_yacc.yy" +#line 7922 "sql_yacc.yy" { (yyval.item) = new Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);} break; case 1491: -#line 7921 "sql_yacc.yy" +#line 7923 "sql_yacc.yy" { (yyval.item)= new Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1492: -#line 7923 "sql_yacc.yy" +#line 7925 "sql_yacc.yy" { Item *tmp= new Item_hex_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); /* @@ -24438,7 +24440,7 @@ break; case 1493: -#line 7939 "sql_yacc.yy" +#line 7941 "sql_yacc.yy" { Item *tmp= new Item_bin_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); /* @@ -24455,37 +24457,37 @@ break; case 1494: -#line 7952 "sql_yacc.yy" +#line 7954 "sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1495: -#line 7953 "sql_yacc.yy" +#line 7955 "sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1496: -#line 7954 "sql_yacc.yy" +#line 7956 "sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1497: -#line 7957 "sql_yacc.yy" +#line 7959 "sql_yacc.yy" { int error; (yyval.item_num) = new Item_int((yyvsp[(1) - (1)].lex_str).str, (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error), (yyvsp[(1) - (1)].lex_str).length); } break; case 1498: -#line 7958 "sql_yacc.yy" +#line 7960 "sql_yacc.yy" { int error; (yyval.item_num) = new Item_int((yyvsp[(1) - (1)].lex_str).str, (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error), (yyvsp[(1) - (1)].lex_str).length); } break; case 1499: -#line 7959 "sql_yacc.yy" +#line 7961 "sql_yacc.yy" { (yyval.item_num) = new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1500: -#line 7961 "sql_yacc.yy" +#line 7963 "sql_yacc.yy" { (yyval.item_num)= new Item_decimal((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, YYTHD->charset()); if (YYTHD->net.report_error) @@ -24496,7 +24498,7 @@ break; case 1501: -#line 7969 "sql_yacc.yy" +#line 7971 "sql_yacc.yy" { (yyval.item_num) = new Item_float((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (YYTHD->net.report_error) @@ -24507,17 +24509,17 @@ break; case 1502: -#line 7983 "sql_yacc.yy" +#line 7985 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1503: -#line 7984 "sql_yacc.yy" +#line 7986 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1504: -#line 7988 "sql_yacc.yy" +#line 7990 "sql_yacc.yy" { SELECT_LEX *sel= Select; (yyval.item) = new Item_field(Lex->current_context(), NullS, (yyvsp[(1) - (3)].lex_str).str, "*"); @@ -24526,7 +24528,7 @@ break; case 1505: -#line 7994 "sql_yacc.yy" +#line 7996 "sql_yacc.yy" { SELECT_LEX *sel= Select; (yyval.item) = new Item_field(Lex->current_context(), (YYTHD->client_capabilities & @@ -24537,12 +24539,12 @@ break; case 1506: -#line 8004 "sql_yacc.yy" +#line 8006 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1507: -#line 8008 "sql_yacc.yy" +#line 8010 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24582,12 +24584,12 @@ break; case 1508: -#line 8044 "sql_yacc.yy" +#line 8046 "sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1509: -#line 8049 "sql_yacc.yy" +#line 8051 "sql_yacc.yy" { SELECT_LEX *sel=Select; (yyval.item)= (sel->parsing_place != IN_HAVING || @@ -24598,12 +24600,12 @@ break; case 1510: -#line 8056 "sql_yacc.yy" +#line 8058 "sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1511: -#line 8061 "sql_yacc.yy" +#line 8063 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24674,7 +24676,7 @@ break; case 1512: -#line 8129 "sql_yacc.yy" +#line 8131 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24692,7 +24694,7 @@ break; case 1513: -#line 8144 "sql_yacc.yy" +#line 8146 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24716,12 +24718,12 @@ break; case 1514: -#line 8167 "sql_yacc.yy" +#line 8169 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1515: -#line 8169 "sql_yacc.yy" +#line 8171 "sql_yacc.yy" { TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (5)].lex_str).str, table->db)) @@ -24740,7 +24742,7 @@ break; case 1516: -#line 8185 "sql_yacc.yy" +#line 8187 "sql_yacc.yy" { TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (3)].lex_str).str, table->alias)) @@ -24753,37 +24755,37 @@ break; case 1517: -#line 8194 "sql_yacc.yy" +#line 8196 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str);} break; case 1518: -#line 8197 "sql_yacc.yy" +#line 8199 "sql_yacc.yy" { (yyval.table)=new Table_ident((yyvsp[(1) - (1)].lex_str)); } break; case 1519: -#line 8198 "sql_yacc.yy" +#line 8200 "sql_yacc.yy" { (yyval.table)=new Table_ident(YYTHD, (yyvsp[(1) - (3)].lex_str),(yyvsp[(3) - (3)].lex_str),0);} break; case 1520: -#line 8199 "sql_yacc.yy" +#line 8201 "sql_yacc.yy" { (yyval.table)=new Table_ident((yyvsp[(2) - (2)].lex_str));} break; case 1521: -#line 8203 "sql_yacc.yy" +#line 8205 "sql_yacc.yy" { LEX_STRING db={(char*) any_db,3}; (yyval.table)=new Table_ident(YYTHD, db,(yyvsp[(1) - (1)].lex_str),0); } break; case 1522: -#line 8207 "sql_yacc.yy" +#line 8209 "sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 1523: -#line 8209 "sql_yacc.yy" +#line 8211 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_system_charset) @@ -24808,7 +24810,7 @@ break; case 1524: -#line 8234 "sql_yacc.yy" +#line 8236 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_system_charset) @@ -24820,7 +24822,7 @@ break; case 1525: -#line 8246 "sql_yacc.yy" +#line 8248 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_collation_connection) @@ -24832,7 +24834,7 @@ break; case 1526: -#line 8259 "sql_yacc.yy" +#line 8261 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_character_set_filesystem) @@ -24844,12 +24846,12 @@ break; case 1527: -#line 8270 "sql_yacc.yy" +#line 8272 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1528: -#line 8272 "sql_yacc.yy" +#line 8274 "sql_yacc.yy" { THD *thd= YYTHD; (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); @@ -24858,12 +24860,12 @@ break; case 1529: -#line 8280 "sql_yacc.yy" +#line 8282 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1530: -#line 8282 "sql_yacc.yy" +#line 8284 "sql_yacc.yy" { THD *thd= YYTHD; (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); @@ -24872,22 +24874,22 @@ break; case 1531: -#line 8290 "sql_yacc.yy" +#line 8292 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1532: -#line 8291 "sql_yacc.yy" +#line 8293 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1533: -#line 8292 "sql_yacc.yy" +#line 8294 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1534: -#line 8296 "sql_yacc.yy" +#line 8298 "sql_yacc.yy" { THD *thd= YYTHD; if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) @@ -24903,7 +24905,7 @@ break; case 1535: -#line 8309 "sql_yacc.yy" +#line 8311 "sql_yacc.yy" { THD *thd= YYTHD; if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) @@ -24919,7 +24921,7 @@ break; case 1536: -#line 8322 "sql_yacc.yy" +#line 8324 "sql_yacc.yy" { if (!((yyval.lex_user)=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; @@ -24933,1372 +24935,1372 @@ break; case 1537: -#line 8335 "sql_yacc.yy" +#line 8337 "sql_yacc.yy" {} break; case 1538: -#line 8336 "sql_yacc.yy" +#line 8338 "sql_yacc.yy" {} break; case 1539: -#line 8337 "sql_yacc.yy" +#line 8339 "sql_yacc.yy" {} break; case 1540: -#line 8338 "sql_yacc.yy" +#line 8340 "sql_yacc.yy" {} break; case 1541: -#line 8339 "sql_yacc.yy" +#line 8341 "sql_yacc.yy" {} break; case 1542: -#line 8340 "sql_yacc.yy" +#line 8342 "sql_yacc.yy" {} break; case 1543: -#line 8341 "sql_yacc.yy" +#line 8343 "sql_yacc.yy" {} break; case 1544: -#line 8342 "sql_yacc.yy" +#line 8344 "sql_yacc.yy" {} break; case 1545: -#line 8343 "sql_yacc.yy" +#line 8345 "sql_yacc.yy" {} break; case 1546: -#line 8344 "sql_yacc.yy" +#line 8346 "sql_yacc.yy" {} break; case 1547: -#line 8345 "sql_yacc.yy" +#line 8347 "sql_yacc.yy" {} break; case 1548: -#line 8346 "sql_yacc.yy" +#line 8348 "sql_yacc.yy" {} break; case 1549: -#line 8347 "sql_yacc.yy" +#line 8349 "sql_yacc.yy" {} break; case 1550: -#line 8348 "sql_yacc.yy" +#line 8350 "sql_yacc.yy" {} break; case 1551: -#line 8349 "sql_yacc.yy" +#line 8351 "sql_yacc.yy" {} break; case 1552: -#line 8350 "sql_yacc.yy" +#line 8352 "sql_yacc.yy" {} break; case 1553: -#line 8351 "sql_yacc.yy" +#line 8353 "sql_yacc.yy" {} break; case 1554: -#line 8352 "sql_yacc.yy" +#line 8354 "sql_yacc.yy" {} break; case 1555: -#line 8353 "sql_yacc.yy" +#line 8355 "sql_yacc.yy" {} break; case 1556: -#line 8354 "sql_yacc.yy" +#line 8356 "sql_yacc.yy" {} break; case 1557: -#line 8355 "sql_yacc.yy" +#line 8357 "sql_yacc.yy" {} break; case 1558: -#line 8356 "sql_yacc.yy" +#line 8358 "sql_yacc.yy" {} break; case 1559: -#line 8357 "sql_yacc.yy" +#line 8359 "sql_yacc.yy" {} break; case 1560: -#line 8358 "sql_yacc.yy" +#line 8360 "sql_yacc.yy" {} break; case 1561: -#line 8359 "sql_yacc.yy" +#line 8361 "sql_yacc.yy" {} break; case 1562: -#line 8360 "sql_yacc.yy" +#line 8362 "sql_yacc.yy" {} break; case 1563: -#line 8361 "sql_yacc.yy" +#line 8363 "sql_yacc.yy" {} break; case 1564: -#line 8362 "sql_yacc.yy" +#line 8364 "sql_yacc.yy" {} break; case 1565: -#line 8363 "sql_yacc.yy" +#line 8365 "sql_yacc.yy" {} break; case 1566: -#line 8364 "sql_yacc.yy" +#line 8366 "sql_yacc.yy" {} break; case 1567: -#line 8365 "sql_yacc.yy" +#line 8367 "sql_yacc.yy" {} break; case 1568: -#line 8366 "sql_yacc.yy" +#line 8368 "sql_yacc.yy" {} break; case 1569: -#line 8367 "sql_yacc.yy" +#line 8369 "sql_yacc.yy" {} break; case 1570: -#line 8368 "sql_yacc.yy" +#line 8370 "sql_yacc.yy" {} break; case 1571: -#line 8369 "sql_yacc.yy" +#line 8371 "sql_yacc.yy" {} break; case 1572: -#line 8370 "sql_yacc.yy" +#line 8372 "sql_yacc.yy" {} break; case 1573: -#line 8371 "sql_yacc.yy" +#line 8373 "sql_yacc.yy" {} break; case 1574: -#line 8381 "sql_yacc.yy" +#line 8383 "sql_yacc.yy" {} break; case 1575: -#line 8382 "sql_yacc.yy" +#line 8384 "sql_yacc.yy" {} break; case 1576: -#line 8383 "sql_yacc.yy" +#line 8385 "sql_yacc.yy" {} break; case 1577: -#line 8384 "sql_yacc.yy" +#line 8386 "sql_yacc.yy" {} break; case 1578: -#line 8385 "sql_yacc.yy" +#line 8387 "sql_yacc.yy" {} break; case 1579: -#line 8386 "sql_yacc.yy" +#line 8388 "sql_yacc.yy" {} break; case 1580: -#line 8387 "sql_yacc.yy" +#line 8389 "sql_yacc.yy" {} break; case 1581: -#line 8388 "sql_yacc.yy" +#line 8390 "sql_yacc.yy" {} break; case 1582: -#line 8389 "sql_yacc.yy" +#line 8391 "sql_yacc.yy" {} break; case 1583: -#line 8390 "sql_yacc.yy" +#line 8392 "sql_yacc.yy" {} break; case 1584: -#line 8391 "sql_yacc.yy" +#line 8393 "sql_yacc.yy" {} break; case 1585: -#line 8392 "sql_yacc.yy" +#line 8394 "sql_yacc.yy" {} break; case 1586: -#line 8393 "sql_yacc.yy" +#line 8395 "sql_yacc.yy" {} break; case 1587: -#line 8394 "sql_yacc.yy" +#line 8396 "sql_yacc.yy" {} break; case 1588: -#line 8395 "sql_yacc.yy" +#line 8397 "sql_yacc.yy" {} break; case 1589: -#line 8396 "sql_yacc.yy" +#line 8398 "sql_yacc.yy" {} break; case 1590: -#line 8397 "sql_yacc.yy" +#line 8399 "sql_yacc.yy" {} break; case 1591: -#line 8398 "sql_yacc.yy" +#line 8400 "sql_yacc.yy" {} break; case 1592: -#line 8399 "sql_yacc.yy" +#line 8401 "sql_yacc.yy" {} break; case 1593: -#line 8400 "sql_yacc.yy" +#line 8402 "sql_yacc.yy" {} break; case 1594: -#line 8401 "sql_yacc.yy" +#line 8403 "sql_yacc.yy" {} break; case 1595: -#line 8402 "sql_yacc.yy" +#line 8404 "sql_yacc.yy" {} break; case 1596: -#line 8403 "sql_yacc.yy" +#line 8405 "sql_yacc.yy" {} break; case 1597: -#line 8404 "sql_yacc.yy" +#line 8406 "sql_yacc.yy" {} break; case 1598: -#line 8405 "sql_yacc.yy" +#line 8407 "sql_yacc.yy" {} break; case 1599: -#line 8406 "sql_yacc.yy" +#line 8408 "sql_yacc.yy" {} break; case 1600: -#line 8407 "sql_yacc.yy" +#line 8409 "sql_yacc.yy" {} break; case 1601: -#line 8408 "sql_yacc.yy" +#line 8410 "sql_yacc.yy" {} break; case 1602: -#line 8409 "sql_yacc.yy" +#line 8411 "sql_yacc.yy" {} break; case 1603: -#line 8410 "sql_yacc.yy" +#line 8412 "sql_yacc.yy" {} break; case 1604: -#line 8411 "sql_yacc.yy" +#line 8413 "sql_yacc.yy" {} break; case 1605: -#line 8412 "sql_yacc.yy" +#line 8414 "sql_yacc.yy" {} break; case 1606: -#line 8413 "sql_yacc.yy" +#line 8415 "sql_yacc.yy" {} break; case 1607: -#line 8414 "sql_yacc.yy" +#line 8416 "sql_yacc.yy" {} break; case 1608: -#line 8415 "sql_yacc.yy" +#line 8417 "sql_yacc.yy" {} break; case 1609: -#line 8416 "sql_yacc.yy" +#line 8418 "sql_yacc.yy" {} break; case 1610: -#line 8417 "sql_yacc.yy" +#line 8419 "sql_yacc.yy" {} break; case 1611: -#line 8418 "sql_yacc.yy" +#line 8420 "sql_yacc.yy" {} break; case 1612: -#line 8419 "sql_yacc.yy" +#line 8421 "sql_yacc.yy" {} break; case 1613: -#line 8420 "sql_yacc.yy" +#line 8422 "sql_yacc.yy" {} break; case 1614: -#line 8421 "sql_yacc.yy" +#line 8423 "sql_yacc.yy" {} break; case 1615: -#line 8422 "sql_yacc.yy" +#line 8424 "sql_yacc.yy" {} break; case 1616: -#line 8423 "sql_yacc.yy" +#line 8425 "sql_yacc.yy" {} break; case 1617: -#line 8424 "sql_yacc.yy" +#line 8426 "sql_yacc.yy" {} break; case 1618: -#line 8425 "sql_yacc.yy" +#line 8427 "sql_yacc.yy" {} break; case 1619: -#line 8426 "sql_yacc.yy" +#line 8428 "sql_yacc.yy" {} break; case 1620: -#line 8427 "sql_yacc.yy" +#line 8429 "sql_yacc.yy" {} break; case 1621: -#line 8428 "sql_yacc.yy" +#line 8430 "sql_yacc.yy" {} break; case 1622: -#line 8429 "sql_yacc.yy" +#line 8431 "sql_yacc.yy" {} break; case 1623: -#line 8430 "sql_yacc.yy" +#line 8432 "sql_yacc.yy" {} break; case 1624: -#line 8431 "sql_yacc.yy" +#line 8433 "sql_yacc.yy" {} break; case 1625: -#line 8432 "sql_yacc.yy" +#line 8434 "sql_yacc.yy" {} break; case 1626: -#line 8433 "sql_yacc.yy" +#line 8435 "sql_yacc.yy" {} break; case 1627: -#line 8434 "sql_yacc.yy" +#line 8436 "sql_yacc.yy" {} break; case 1628: -#line 8435 "sql_yacc.yy" +#line 8437 "sql_yacc.yy" {} break; case 1629: -#line 8436 "sql_yacc.yy" +#line 8438 "sql_yacc.yy" {} break; case 1630: -#line 8437 "sql_yacc.yy" +#line 8439 "sql_yacc.yy" {} break; case 1631: -#line 8438 "sql_yacc.yy" +#line 8440 "sql_yacc.yy" {} break; case 1632: -#line 8439 "sql_yacc.yy" +#line 8441 "sql_yacc.yy" {} break; case 1633: -#line 8440 "sql_yacc.yy" +#line 8442 "sql_yacc.yy" {} break; case 1634: -#line 8441 "sql_yacc.yy" +#line 8443 "sql_yacc.yy" {} break; case 1635: -#line 8442 "sql_yacc.yy" +#line 8444 "sql_yacc.yy" {} break; case 1636: -#line 8443 "sql_yacc.yy" +#line 8445 "sql_yacc.yy" {} break; case 1637: -#line 8444 "sql_yacc.yy" +#line 8446 "sql_yacc.yy" {} break; case 1638: -#line 8445 "sql_yacc.yy" +#line 8447 "sql_yacc.yy" {} break; case 1639: -#line 8446 "sql_yacc.yy" +#line 8448 "sql_yacc.yy" {} break; case 1640: -#line 8447 "sql_yacc.yy" +#line 8449 "sql_yacc.yy" {} break; case 1641: -#line 8448 "sql_yacc.yy" +#line 8450 "sql_yacc.yy" {} break; case 1642: -#line 8449 "sql_yacc.yy" +#line 8451 "sql_yacc.yy" {} break; case 1643: -#line 8450 "sql_yacc.yy" +#line 8452 "sql_yacc.yy" {} break; case 1644: -#line 8451 "sql_yacc.yy" +#line 8453 "sql_yacc.yy" {} break; case 1645: -#line 8452 "sql_yacc.yy" +#line 8454 "sql_yacc.yy" {} break; case 1646: -#line 8453 "sql_yacc.yy" +#line 8455 "sql_yacc.yy" {} break; case 1647: -#line 8454 "sql_yacc.yy" +#line 8456 "sql_yacc.yy" {} break; case 1648: -#line 8455 "sql_yacc.yy" +#line 8457 "sql_yacc.yy" {} break; case 1649: -#line 8456 "sql_yacc.yy" +#line 8458 "sql_yacc.yy" {} break; case 1650: -#line 8457 "sql_yacc.yy" +#line 8459 "sql_yacc.yy" {} break; case 1651: -#line 8458 "sql_yacc.yy" +#line 8460 "sql_yacc.yy" {} break; case 1652: -#line 8459 "sql_yacc.yy" +#line 8461 "sql_yacc.yy" {} break; case 1653: -#line 8460 "sql_yacc.yy" +#line 8462 "sql_yacc.yy" {} break; case 1654: -#line 8461 "sql_yacc.yy" +#line 8463 "sql_yacc.yy" {} break; case 1655: -#line 8462 "sql_yacc.yy" +#line 8464 "sql_yacc.yy" {} break; case 1656: -#line 8463 "sql_yacc.yy" +#line 8465 "sql_yacc.yy" {} break; case 1657: -#line 8464 "sql_yacc.yy" +#line 8466 "sql_yacc.yy" {} break; case 1658: -#line 8465 "sql_yacc.yy" +#line 8467 "sql_yacc.yy" {} break; case 1659: -#line 8466 "sql_yacc.yy" +#line 8468 "sql_yacc.yy" {} break; case 1660: -#line 8467 "sql_yacc.yy" +#line 8469 "sql_yacc.yy" {} break; case 1661: -#line 8468 "sql_yacc.yy" +#line 8470 "sql_yacc.yy" {} break; case 1662: -#line 8469 "sql_yacc.yy" +#line 8471 "sql_yacc.yy" {} break; case 1663: -#line 8470 "sql_yacc.yy" +#line 8472 "sql_yacc.yy" {} break; case 1664: -#line 8471 "sql_yacc.yy" +#line 8473 "sql_yacc.yy" {} break; case 1665: -#line 8472 "sql_yacc.yy" +#line 8474 "sql_yacc.yy" {} break; case 1666: -#line 8473 "sql_yacc.yy" +#line 8475 "sql_yacc.yy" {} break; case 1667: -#line 8474 "sql_yacc.yy" +#line 8476 "sql_yacc.yy" {} break; case 1668: -#line 8475 "sql_yacc.yy" +#line 8477 "sql_yacc.yy" {} break; case 1669: -#line 8476 "sql_yacc.yy" +#line 8478 "sql_yacc.yy" {} break; case 1670: -#line 8477 "sql_yacc.yy" +#line 8479 "sql_yacc.yy" {} break; case 1671: -#line 8478 "sql_yacc.yy" +#line 8480 "sql_yacc.yy" {} break; case 1672: -#line 8479 "sql_yacc.yy" +#line 8481 "sql_yacc.yy" {} break; case 1673: -#line 8480 "sql_yacc.yy" +#line 8482 "sql_yacc.yy" {} break; case 1674: -#line 8481 "sql_yacc.yy" +#line 8483 "sql_yacc.yy" {} break; case 1675: -#line 8482 "sql_yacc.yy" +#line 8484 "sql_yacc.yy" {} break; case 1676: -#line 8483 "sql_yacc.yy" +#line 8485 "sql_yacc.yy" {} break; case 1677: -#line 8484 "sql_yacc.yy" +#line 8486 "sql_yacc.yy" {} break; case 1678: -#line 8485 "sql_yacc.yy" +#line 8487 "sql_yacc.yy" {} break; case 1679: -#line 8486 "sql_yacc.yy" +#line 8488 "sql_yacc.yy" {} break; case 1680: -#line 8487 "sql_yacc.yy" +#line 8489 "sql_yacc.yy" {} break; case 1681: -#line 8488 "sql_yacc.yy" +#line 8490 "sql_yacc.yy" {} break; case 1682: -#line 8489 "sql_yacc.yy" +#line 8491 "sql_yacc.yy" {} break; case 1683: -#line 8490 "sql_yacc.yy" +#line 8492 "sql_yacc.yy" {} break; case 1684: -#line 8491 "sql_yacc.yy" +#line 8493 "sql_yacc.yy" {} break; case 1685: -#line 8492 "sql_yacc.yy" +#line 8494 "sql_yacc.yy" {} break; case 1686: -#line 8493 "sql_yacc.yy" +#line 8495 "sql_yacc.yy" {} break; case 1687: -#line 8494 "sql_yacc.yy" +#line 8496 "sql_yacc.yy" {} break; case 1688: -#line 8495 "sql_yacc.yy" +#line 8497 "sql_yacc.yy" {} break; case 1689: -#line 8496 "sql_yacc.yy" +#line 8498 "sql_yacc.yy" {} break; case 1690: -#line 8497 "sql_yacc.yy" +#line 8499 "sql_yacc.yy" {} break; case 1691: -#line 8498 "sql_yacc.yy" +#line 8500 "sql_yacc.yy" {} break; case 1692: -#line 8499 "sql_yacc.yy" +#line 8501 "sql_yacc.yy" {} break; case 1693: -#line 8500 "sql_yacc.yy" +#line 8502 "sql_yacc.yy" {} break; case 1694: -#line 8501 "sql_yacc.yy" +#line 8503 "sql_yacc.yy" {} break; case 1695: -#line 8502 "sql_yacc.yy" +#line 8504 "sql_yacc.yy" {} break; case 1696: -#line 8503 "sql_yacc.yy" +#line 8505 "sql_yacc.yy" {} break; case 1697: -#line 8504 "sql_yacc.yy" +#line 8506 "sql_yacc.yy" {} break; case 1698: -#line 8505 "sql_yacc.yy" +#line 8507 "sql_yacc.yy" {} break; case 1699: -#line 8506 "sql_yacc.yy" +#line 8508 "sql_yacc.yy" {} break; case 1700: -#line 8507 "sql_yacc.yy" +#line 8509 "sql_yacc.yy" {} break; case 1701: -#line 8508 "sql_yacc.yy" +#line 8510 "sql_yacc.yy" {} break; case 1702: -#line 8509 "sql_yacc.yy" +#line 8511 "sql_yacc.yy" {} break; case 1703: -#line 8510 "sql_yacc.yy" +#line 8512 "sql_yacc.yy" {} break; case 1704: -#line 8511 "sql_yacc.yy" +#line 8513 "sql_yacc.yy" {} break; case 1705: -#line 8512 "sql_yacc.yy" +#line 8514 "sql_yacc.yy" {} break; case 1706: -#line 8513 "sql_yacc.yy" +#line 8515 "sql_yacc.yy" {} break; case 1707: -#line 8514 "sql_yacc.yy" +#line 8516 "sql_yacc.yy" {} break; case 1708: -#line 8515 "sql_yacc.yy" +#line 8517 "sql_yacc.yy" {} break; case 1709: -#line 8516 "sql_yacc.yy" +#line 8518 "sql_yacc.yy" {} break; case 1710: -#line 8517 "sql_yacc.yy" +#line 8519 "sql_yacc.yy" {} break; case 1711: -#line 8518 "sql_yacc.yy" +#line 8520 "sql_yacc.yy" {} break; case 1712: -#line 8519 "sql_yacc.yy" +#line 8521 "sql_yacc.yy" {} break; case 1713: -#line 8520 "sql_yacc.yy" +#line 8522 "sql_yacc.yy" {} break; case 1714: -#line 8521 "sql_yacc.yy" +#line 8523 "sql_yacc.yy" {} break; case 1715: -#line 8522 "sql_yacc.yy" +#line 8524 "sql_yacc.yy" {} break; case 1716: -#line 8523 "sql_yacc.yy" +#line 8525 "sql_yacc.yy" {} break; case 1717: -#line 8524 "sql_yacc.yy" +#line 8526 "sql_yacc.yy" {} break; case 1718: -#line 8525 "sql_yacc.yy" +#line 8527 "sql_yacc.yy" {} break; case 1719: -#line 8526 "sql_yacc.yy" +#line 8528 "sql_yacc.yy" {} break; case 1720: -#line 8527 "sql_yacc.yy" +#line 8529 "sql_yacc.yy" {} break; case 1721: -#line 8528 "sql_yacc.yy" +#line 8530 "sql_yacc.yy" {} break; case 1722: -#line 8529 "sql_yacc.yy" +#line 8531 "sql_yacc.yy" {} break; case 1723: -#line 8530 "sql_yacc.yy" +#line 8532 "sql_yacc.yy" {} break; case 1724: -#line 8531 "sql_yacc.yy" +#line 8533 "sql_yacc.yy" {} break; case 1725: -#line 8532 "sql_yacc.yy" +#line 8534 "sql_yacc.yy" {} break; case 1726: -#line 8533 "sql_yacc.yy" +#line 8535 "sql_yacc.yy" {} break; case 1727: -#line 8534 "sql_yacc.yy" +#line 8536 "sql_yacc.yy" {} break; case 1728: -#line 8535 "sql_yacc.yy" +#line 8537 "sql_yacc.yy" {} break; case 1729: -#line 8536 "sql_yacc.yy" +#line 8538 "sql_yacc.yy" {} break; case 1730: -#line 8537 "sql_yacc.yy" +#line 8539 "sql_yacc.yy" {} break; case 1731: -#line 8538 "sql_yacc.yy" +#line 8540 "sql_yacc.yy" {} break; case 1732: -#line 8539 "sql_yacc.yy" +#line 8541 "sql_yacc.yy" {} break; case 1733: -#line 8540 "sql_yacc.yy" +#line 8542 "sql_yacc.yy" {} break; case 1734: -#line 8541 "sql_yacc.yy" +#line 8543 "sql_yacc.yy" {} break; case 1735: -#line 8542 "sql_yacc.yy" +#line 8544 "sql_yacc.yy" {} break; case 1736: -#line 8543 "sql_yacc.yy" +#line 8545 "sql_yacc.yy" {} break; case 1737: -#line 8544 "sql_yacc.yy" +#line 8546 "sql_yacc.yy" {} break; case 1738: -#line 8545 "sql_yacc.yy" +#line 8547 "sql_yacc.yy" {} break; case 1739: -#line 8546 "sql_yacc.yy" +#line 8548 "sql_yacc.yy" {} break; case 1740: -#line 8547 "sql_yacc.yy" +#line 8549 "sql_yacc.yy" {} break; case 1741: -#line 8548 "sql_yacc.yy" +#line 8550 "sql_yacc.yy" {} break; case 1742: -#line 8549 "sql_yacc.yy" +#line 8551 "sql_yacc.yy" {} break; case 1743: -#line 8550 "sql_yacc.yy" +#line 8552 "sql_yacc.yy" {} break; case 1744: -#line 8551 "sql_yacc.yy" +#line 8553 "sql_yacc.yy" {} break; case 1745: -#line 8552 "sql_yacc.yy" +#line 8554 "sql_yacc.yy" {} break; case 1746: -#line 8553 "sql_yacc.yy" +#line 8555 "sql_yacc.yy" {} break; case 1747: -#line 8554 "sql_yacc.yy" +#line 8556 "sql_yacc.yy" {} break; case 1748: -#line 8555 "sql_yacc.yy" +#line 8557 "sql_yacc.yy" {} break; case 1749: -#line 8556 "sql_yacc.yy" +#line 8558 "sql_yacc.yy" {} break; case 1750: -#line 8557 "sql_yacc.yy" +#line 8559 "sql_yacc.yy" {} break; case 1751: -#line 8558 "sql_yacc.yy" +#line 8560 "sql_yacc.yy" {} break; case 1752: -#line 8559 "sql_yacc.yy" +#line 8561 "sql_yacc.yy" {} break; case 1753: -#line 8560 "sql_yacc.yy" +#line 8562 "sql_yacc.yy" {} break; case 1754: -#line 8561 "sql_yacc.yy" +#line 8563 "sql_yacc.yy" {} break; case 1755: -#line 8562 "sql_yacc.yy" +#line 8564 "sql_yacc.yy" {} break; case 1756: -#line 8563 "sql_yacc.yy" +#line 8565 "sql_yacc.yy" {} break; case 1757: -#line 8564 "sql_yacc.yy" +#line 8566 "sql_yacc.yy" {} break; case 1758: -#line 8565 "sql_yacc.yy" +#line 8567 "sql_yacc.yy" {} break; case 1759: -#line 8566 "sql_yacc.yy" +#line 8568 "sql_yacc.yy" {} break; case 1760: -#line 8567 "sql_yacc.yy" +#line 8569 "sql_yacc.yy" {} break; case 1761: -#line 8568 "sql_yacc.yy" +#line 8570 "sql_yacc.yy" {} break; case 1762: -#line 8569 "sql_yacc.yy" +#line 8571 "sql_yacc.yy" {} break; case 1763: -#line 8570 "sql_yacc.yy" +#line 8572 "sql_yacc.yy" {} break; case 1764: -#line 8571 "sql_yacc.yy" +#line 8573 "sql_yacc.yy" {} break; case 1765: -#line 8572 "sql_yacc.yy" +#line 8574 "sql_yacc.yy" {} break; case 1766: -#line 8573 "sql_yacc.yy" +#line 8575 "sql_yacc.yy" {} break; case 1767: -#line 8574 "sql_yacc.yy" +#line 8576 "sql_yacc.yy" {} break; case 1768: -#line 8575 "sql_yacc.yy" +#line 8577 "sql_yacc.yy" {} break; case 1769: -#line 8576 "sql_yacc.yy" +#line 8578 "sql_yacc.yy" {} break; case 1770: -#line 8577 "sql_yacc.yy" +#line 8579 "sql_yacc.yy" {} break; case 1771: -#line 8578 "sql_yacc.yy" +#line 8580 "sql_yacc.yy" {} break; case 1772: -#line 8579 "sql_yacc.yy" +#line 8581 "sql_yacc.yy" {} break; case 1773: -#line 8580 "sql_yacc.yy" +#line 8582 "sql_yacc.yy" {} break; case 1774: -#line 8581 "sql_yacc.yy" +#line 8583 "sql_yacc.yy" {} break; case 1775: -#line 8582 "sql_yacc.yy" +#line 8584 "sql_yacc.yy" {} break; case 1776: -#line 8583 "sql_yacc.yy" +#line 8585 "sql_yacc.yy" {} break; case 1777: -#line 8584 "sql_yacc.yy" +#line 8586 "sql_yacc.yy" {} break; case 1778: -#line 8585 "sql_yacc.yy" +#line 8587 "sql_yacc.yy" {} break; case 1779: -#line 8586 "sql_yacc.yy" +#line 8588 "sql_yacc.yy" {} break; case 1780: -#line 8587 "sql_yacc.yy" +#line 8589 "sql_yacc.yy" {} break; case 1781: -#line 8588 "sql_yacc.yy" +#line 8590 "sql_yacc.yy" {} break; case 1782: -#line 8589 "sql_yacc.yy" +#line 8591 "sql_yacc.yy" {} break; case 1783: -#line 8590 "sql_yacc.yy" +#line 8592 "sql_yacc.yy" {} break; case 1784: -#line 8591 "sql_yacc.yy" +#line 8593 "sql_yacc.yy" {} break; case 1785: -#line 8592 "sql_yacc.yy" +#line 8594 "sql_yacc.yy" {} break; case 1786: -#line 8593 "sql_yacc.yy" +#line 8595 "sql_yacc.yy" {} break; case 1787: -#line 8594 "sql_yacc.yy" +#line 8596 "sql_yacc.yy" {} break; case 1788: -#line 8595 "sql_yacc.yy" +#line 8597 "sql_yacc.yy" {} break; case 1789: -#line 8596 "sql_yacc.yy" +#line 8598 "sql_yacc.yy" {} break; case 1790: -#line 8597 "sql_yacc.yy" +#line 8599 "sql_yacc.yy" {} break; case 1791: -#line 8598 "sql_yacc.yy" +#line 8600 "sql_yacc.yy" {} break; case 1792: -#line 8599 "sql_yacc.yy" +#line 8601 "sql_yacc.yy" {} break; case 1793: -#line 8600 "sql_yacc.yy" +#line 8602 "sql_yacc.yy" {} break; case 1794: -#line 8601 "sql_yacc.yy" +#line 8603 "sql_yacc.yy" {} break; case 1795: -#line 8602 "sql_yacc.yy" +#line 8604 "sql_yacc.yy" {} break; case 1796: -#line 8603 "sql_yacc.yy" +#line 8605 "sql_yacc.yy" {} break; case 1797: -#line 8604 "sql_yacc.yy" +#line 8606 "sql_yacc.yy" {} break; case 1798: -#line 8605 "sql_yacc.yy" +#line 8607 "sql_yacc.yy" {} break; case 1799: -#line 8606 "sql_yacc.yy" +#line 8608 "sql_yacc.yy" {} break; case 1800: -#line 8607 "sql_yacc.yy" +#line 8609 "sql_yacc.yy" {} break; case 1801: -#line 8608 "sql_yacc.yy" +#line 8610 "sql_yacc.yy" {} break; case 1802: -#line 8609 "sql_yacc.yy" +#line 8611 "sql_yacc.yy" {} break; case 1803: -#line 8610 "sql_yacc.yy" +#line 8612 "sql_yacc.yy" {} break; case 1804: -#line 8611 "sql_yacc.yy" +#line 8613 "sql_yacc.yy" {} break; case 1805: -#line 8612 "sql_yacc.yy" +#line 8614 "sql_yacc.yy" {} break; case 1806: -#line 8613 "sql_yacc.yy" +#line 8615 "sql_yacc.yy" {} break; case 1807: -#line 8614 "sql_yacc.yy" +#line 8616 "sql_yacc.yy" {} break; case 1808: -#line 8615 "sql_yacc.yy" +#line 8617 "sql_yacc.yy" {} break; case 1809: -#line 8616 "sql_yacc.yy" +#line 8618 "sql_yacc.yy" {} break; case 1810: -#line 8623 "sql_yacc.yy" +#line 8625 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SET_OPTION; @@ -26310,22 +26312,22 @@ break; case 1811: -#line 8632 "sql_yacc.yy" +#line 8634 "sql_yacc.yy" {} break; case 1812: -#line 8636 "sql_yacc.yy" +#line 8638 "sql_yacc.yy" {} break; case 1813: -#line 8637 "sql_yacc.yy" +#line 8639 "sql_yacc.yy" {} break; case 1816: -#line 8644 "sql_yacc.yy" +#line 8646 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26358,7 +26360,7 @@ break; case 1817: -#line 8674 "sql_yacc.yy" +#line 8676 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26407,77 +26409,77 @@ break; case 1818: -#line 8721 "sql_yacc.yy" +#line 8723 "sql_yacc.yy" {} break; case 1819: -#line 8722 "sql_yacc.yy" +#line 8724 "sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 1820: -#line 8723 "sql_yacc.yy" +#line 8725 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1821: -#line 8724 "sql_yacc.yy" +#line 8726 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1822: -#line 8728 "sql_yacc.yy" +#line 8730 "sql_yacc.yy" { (yyval.num)= OPT_DEFAULT; } break; case 1823: -#line 8729 "sql_yacc.yy" +#line 8731 "sql_yacc.yy" { Lex->one_shot_set= 1; (yyval.num)= OPT_SESSION; } break; case 1824: -#line 8733 "sql_yacc.yy" +#line 8735 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1825: -#line 8734 "sql_yacc.yy" +#line 8736 "sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 1826: -#line 8735 "sql_yacc.yy" +#line 8737 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1827: -#line 8736 "sql_yacc.yy" +#line 8738 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1828: -#line 8740 "sql_yacc.yy" +#line 8742 "sql_yacc.yy" { (yyval.var_type)=OPT_DEFAULT; } break; case 1829: -#line 8741 "sql_yacc.yy" +#line 8743 "sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 1830: -#line 8742 "sql_yacc.yy" +#line 8744 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1831: -#line 8743 "sql_yacc.yy" +#line 8745 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1834: -#line 8752 "sql_yacc.yy" +#line 8754 "sql_yacc.yy" { LEX *lex=Lex; @@ -26560,7 +26562,7 @@ break; case 1835: -#line 8832 "sql_yacc.yy" +#line 8834 "sql_yacc.yy" { LEX *lex=Lex; if ((yyvsp[(1) - (5)].var_type)) @@ -26573,14 +26575,14 @@ break; case 1836: -#line 8845 "sql_yacc.yy" +#line 8847 "sql_yacc.yy" { Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var((yyvsp[(2) - (4)].lex_str),(yyvsp[(4) - (4)].item)))); } break; case 1837: -#line 8849 "sql_yacc.yy" +#line 8851 "sql_yacc.yy" { LEX *lex=Lex; lex->var_list.push_back(new set_var((yyvsp[(3) - (6)].var_type), (yyvsp[(4) - (6)].variable).var, &(yyvsp[(4) - (6)].variable).base_name, (yyvsp[(6) - (6)].item))); @@ -26588,7 +26590,7 @@ break; case 1838: -#line 8854 "sql_yacc.yy" +#line 8856 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -26598,7 +26600,7 @@ break; case 1839: -#line 8861 "sql_yacc.yy" +#line 8863 "sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; @@ -26616,7 +26618,7 @@ break; case 1840: -#line 8876 "sql_yacc.yy" +#line 8878 "sql_yacc.yy" { LEX *lex= Lex; (yyvsp[(2) - (3)].charset)= (yyvsp[(2) - (3)].charset) ? (yyvsp[(2) - (3)].charset) : global_system_variables.character_set_client; @@ -26632,7 +26634,7 @@ break; case 1841: -#line 8889 "sql_yacc.yy" +#line 8891 "sql_yacc.yy" { THD *thd=YYTHD; LEX_USER *user; @@ -26656,14 +26658,14 @@ break; case 1842: -#line 8910 "sql_yacc.yy" +#line 8912 "sql_yacc.yy" { Lex->var_list.push_back(new set_var_password((yyvsp[(3) - (5)].lex_user),(yyvsp[(5) - (5)].simple_string))); } break; case 1843: -#line 8917 "sql_yacc.yy" +#line 8919 "sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; @@ -26704,7 +26706,7 @@ break; case 1844: -#line 8955 "sql_yacc.yy" +#line 8957 "sql_yacc.yy" { LEX *lex= Lex; if (check_reserved_words(&(yyvsp[(1) - (3)].lex_str))) @@ -26750,7 +26752,7 @@ break; case 1845: -#line 8998 "sql_yacc.yy" +#line 9000 "sql_yacc.yy" { sys_var *tmp=find_sys_var((yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length); if (!tmp) @@ -26764,32 +26766,32 @@ break; case 1846: -#line 9011 "sql_yacc.yy" +#line 9013 "sql_yacc.yy" { (yyval.tx_isolation)= ISO_READ_UNCOMMITTED; } break; case 1847: -#line 9012 "sql_yacc.yy" +#line 9014 "sql_yacc.yy" { (yyval.tx_isolation)= ISO_READ_COMMITTED; } break; case 1848: -#line 9013 "sql_yacc.yy" +#line 9015 "sql_yacc.yy" { (yyval.tx_isolation)= ISO_REPEATABLE_READ; } break; case 1849: -#line 9014 "sql_yacc.yy" +#line 9016 "sql_yacc.yy" { (yyval.tx_isolation)= ISO_SERIALIZABLE; } break; case 1850: -#line 9018 "sql_yacc.yy" +#line 9020 "sql_yacc.yy" { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str;} break; case 1851: -#line 9020 "sql_yacc.yy" +#line 9022 "sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? YYTHD->variables.old_passwords ? Item_func_old_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : @@ -26799,7 +26801,7 @@ break; case 1852: -#line 9027 "sql_yacc.yy" +#line 9029 "sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? Item_func_old_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : (yyvsp[(3) - (4)].lex_str).str; @@ -26807,32 +26809,32 @@ break; case 1853: -#line 9035 "sql_yacc.yy" +#line 9037 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1854: -#line 9036 "sql_yacc.yy" +#line 9038 "sql_yacc.yy" { (yyval.item)=0; } break; case 1855: -#line 9037 "sql_yacc.yy" +#line 9039 "sql_yacc.yy" { (yyval.item)=new Item_string("ON", 2, system_charset_info); } break; case 1856: -#line 9038 "sql_yacc.yy" +#line 9040 "sql_yacc.yy" { (yyval.item)=new Item_string("ALL", 3, system_charset_info); } break; case 1857: -#line 9039 "sql_yacc.yy" +#line 9041 "sql_yacc.yy" { (yyval.item)=new Item_string("binary", 6, system_charset_info); } break; case 1858: -#line 9047 "sql_yacc.yy" +#line 9049 "sql_yacc.yy" { LEX *lex= Lex; @@ -26846,12 +26848,12 @@ break; case 1859: -#line 9058 "sql_yacc.yy" +#line 9060 "sql_yacc.yy" {} break; case 1864: -#line 9071 "sql_yacc.yy" +#line 9073 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), (yyvsp[(2) - (3)].lex_str_ptr), 0, (thr_lock_type) (yyvsp[(3) - (3)].num))) MYSQL_YYABORT; @@ -26859,27 +26861,27 @@ break; case 1865: -#line 9078 "sql_yacc.yy" +#line 9080 "sql_yacc.yy" { (yyval.num)=TL_READ_NO_INSERT; } break; case 1866: -#line 9079 "sql_yacc.yy" +#line 9081 "sql_yacc.yy" { (yyval.num)=TL_WRITE_DEFAULT; } break; case 1867: -#line 9080 "sql_yacc.yy" +#line 9082 "sql_yacc.yy" { (yyval.num)=TL_WRITE_LOW_PRIORITY; } break; case 1868: -#line 9081 "sql_yacc.yy" +#line 9083 "sql_yacc.yy" { (yyval.num)= TL_READ; } break; case 1869: -#line 9086 "sql_yacc.yy" +#line 9088 "sql_yacc.yy" { LEX *lex= Lex; @@ -26893,12 +26895,12 @@ break; case 1870: -#line 9097 "sql_yacc.yy" +#line 9099 "sql_yacc.yy" {} break; case 1871: -#line 9107 "sql_yacc.yy" +#line 9109 "sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26913,7 +26915,7 @@ break; case 1872: -#line 9119 "sql_yacc.yy" +#line 9121 "sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26928,7 +26930,7 @@ break; case 1873: -#line 9131 "sql_yacc.yy" +#line 9133 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -26946,52 +26948,52 @@ break; case 1874: -#line 9145 "sql_yacc.yy" +#line 9147 "sql_yacc.yy" {} break; case 1875: -#line 9149 "sql_yacc.yy" +#line 9151 "sql_yacc.yy" { Lex->ident= null_lex_str; } break; case 1876: -#line 9150 "sql_yacc.yy" +#line 9152 "sql_yacc.yy" { Lex->ident= (yyvsp[(1) - (2)].lex_str); } break; case 1877: -#line 9154 "sql_yacc.yy" +#line 9156 "sql_yacc.yy" { Lex->ha_read_mode = RFIRST; } break; case 1878: -#line 9155 "sql_yacc.yy" +#line 9157 "sql_yacc.yy" { Lex->ha_read_mode = RNEXT; } break; case 1879: -#line 9159 "sql_yacc.yy" +#line 9161 "sql_yacc.yy" { Lex->ha_read_mode = RFIRST; } break; case 1880: -#line 9160 "sql_yacc.yy" +#line 9162 "sql_yacc.yy" { Lex->ha_read_mode = RNEXT; } break; case 1881: -#line 9161 "sql_yacc.yy" +#line 9163 "sql_yacc.yy" { Lex->ha_read_mode = RPREV; } break; case 1882: -#line 9162 "sql_yacc.yy" +#line 9164 "sql_yacc.yy" { Lex->ha_read_mode = RLAST; } break; case 1883: -#line 9164 "sql_yacc.yy" +#line 9166 "sql_yacc.yy" { LEX *lex=Lex; lex->ha_read_mode = RKEY; @@ -27002,42 +27004,42 @@ break; case 1884: -#line 9170 "sql_yacc.yy" +#line 9172 "sql_yacc.yy" { } break; case 1885: -#line 9174 "sql_yacc.yy" +#line 9176 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_EXACT; } break; case 1886: -#line 9175 "sql_yacc.yy" +#line 9177 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_NEXT; } break; case 1887: -#line 9176 "sql_yacc.yy" +#line 9178 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_PREV; } break; case 1888: -#line 9177 "sql_yacc.yy" +#line 9179 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_AFTER_KEY; } break; case 1889: -#line 9178 "sql_yacc.yy" +#line 9180 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_BEFORE_KEY; } break; case 1890: -#line 9185 "sql_yacc.yy" +#line 9187 "sql_yacc.yy" {} break; case 1891: -#line 9190 "sql_yacc.yy" +#line 9192 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_REVOKE; @@ -27046,7 +27048,7 @@ break; case 1892: -#line 9197 "sql_yacc.yy" +#line 9199 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -27061,7 +27063,7 @@ break; case 1893: -#line 9210 "sql_yacc.yy" +#line 9212 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -27075,19 +27077,19 @@ break; case 1894: -#line 9222 "sql_yacc.yy" +#line 9224 "sql_yacc.yy" { Lex->sql_command = SQLCOM_REVOKE_ALL; } break; case 1895: -#line 9229 "sql_yacc.yy" +#line 9231 "sql_yacc.yy" {} break; case 1896: -#line 9235 "sql_yacc.yy" +#line 9237 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_GRANT; @@ -27096,7 +27098,7 @@ break; case 1897: -#line 9243 "sql_yacc.yy" +#line 9245 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -27110,7 +27112,7 @@ break; case 1898: -#line 9256 "sql_yacc.yy" +#line 9258 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -27124,12 +27126,12 @@ break; case 1901: -#line 9273 "sql_yacc.yy" +#line 9275 "sql_yacc.yy" { } break; case 1902: -#line 9275 "sql_yacc.yy" +#line 9277 "sql_yacc.yy" { Lex->all_privileges= 1; Lex->grant= GLOBAL_ACLS; @@ -27137,172 +27139,172 @@ break; case 1907: -#line 9291 "sql_yacc.yy" +#line 9293 "sql_yacc.yy" { Lex->which_columns = SELECT_ACL;} break; case 1908: -#line 9291 "sql_yacc.yy" +#line 9293 "sql_yacc.yy" {} break; case 1909: -#line 9292 "sql_yacc.yy" +#line 9294 "sql_yacc.yy" { Lex->which_columns = INSERT_ACL;} break; case 1910: -#line 9292 "sql_yacc.yy" +#line 9294 "sql_yacc.yy" {} break; case 1911: -#line 9293 "sql_yacc.yy" +#line 9295 "sql_yacc.yy" { Lex->which_columns = UPDATE_ACL; } break; case 1912: -#line 9293 "sql_yacc.yy" +#line 9295 "sql_yacc.yy" {} break; case 1913: -#line 9294 "sql_yacc.yy" +#line 9296 "sql_yacc.yy" { Lex->which_columns = REFERENCES_ACL;} break; case 1914: -#line 9294 "sql_yacc.yy" +#line 9296 "sql_yacc.yy" {} break; case 1915: -#line 9295 "sql_yacc.yy" +#line 9297 "sql_yacc.yy" { Lex->grant |= DELETE_ACL;} break; case 1916: -#line 9296 "sql_yacc.yy" +#line 9298 "sql_yacc.yy" {} break; case 1917: -#line 9297 "sql_yacc.yy" +#line 9299 "sql_yacc.yy" { Lex->grant |= INDEX_ACL;} break; case 1918: -#line 9298 "sql_yacc.yy" +#line 9300 "sql_yacc.yy" { Lex->grant |= ALTER_ACL;} break; case 1919: -#line 9299 "sql_yacc.yy" +#line 9301 "sql_yacc.yy" { Lex->grant |= CREATE_ACL;} break; case 1920: -#line 9300 "sql_yacc.yy" +#line 9302 "sql_yacc.yy" { Lex->grant |= DROP_ACL;} break; case 1921: -#line 9301 "sql_yacc.yy" +#line 9303 "sql_yacc.yy" { Lex->grant |= EXECUTE_ACL;} break; case 1922: -#line 9302 "sql_yacc.yy" +#line 9304 "sql_yacc.yy" { Lex->grant |= RELOAD_ACL;} break; case 1923: -#line 9303 "sql_yacc.yy" +#line 9305 "sql_yacc.yy" { Lex->grant |= SHUTDOWN_ACL;} break; case 1924: -#line 9304 "sql_yacc.yy" +#line 9306 "sql_yacc.yy" { Lex->grant |= PROCESS_ACL;} break; case 1925: -#line 9305 "sql_yacc.yy" +#line 9307 "sql_yacc.yy" { Lex->grant |= FILE_ACL;} break; case 1926: -#line 9306 "sql_yacc.yy" +#line 9308 "sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 1927: -#line 9307 "sql_yacc.yy" +#line 9309 "sql_yacc.yy" { Lex->grant |= SHOW_DB_ACL;} break; case 1928: -#line 9308 "sql_yacc.yy" +#line 9310 "sql_yacc.yy" { Lex->grant |= SUPER_ACL;} break; case 1929: -#line 9309 "sql_yacc.yy" +#line 9311 "sql_yacc.yy" { Lex->grant |= CREATE_TMP_ACL;} break; case 1930: -#line 9310 "sql_yacc.yy" +#line 9312 "sql_yacc.yy" { Lex->grant |= LOCK_TABLES_ACL; } break; case 1931: -#line 9311 "sql_yacc.yy" +#line 9313 "sql_yacc.yy" { Lex->grant |= REPL_SLAVE_ACL; } break; case 1932: -#line 9312 "sql_yacc.yy" +#line 9314 "sql_yacc.yy" { Lex->grant |= REPL_CLIENT_ACL; } break; case 1933: -#line 9313 "sql_yacc.yy" +#line 9315 "sql_yacc.yy" { Lex->grant |= CREATE_VIEW_ACL; } break; case 1934: -#line 9314 "sql_yacc.yy" +#line 9316 "sql_yacc.yy" { Lex->grant |= SHOW_VIEW_ACL; } break; case 1935: -#line 9315 "sql_yacc.yy" +#line 9317 "sql_yacc.yy" { Lex->grant |= CREATE_PROC_ACL; } break; case 1936: -#line 9316 "sql_yacc.yy" +#line 9318 "sql_yacc.yy" { Lex->grant |= ALTER_PROC_ACL; } break; case 1937: -#line 9317 "sql_yacc.yy" +#line 9319 "sql_yacc.yy" { Lex->grant |= CREATE_USER_ACL; } break; case 1938: -#line 9322 "sql_yacc.yy" +#line 9324 "sql_yacc.yy" {} break; case 1939: -#line 9323 "sql_yacc.yy" +#line 9325 "sql_yacc.yy" {} break; case 1942: -#line 9333 "sql_yacc.yy" +#line 9335 "sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_subject) @@ -27315,7 +27317,7 @@ break; case 1943: -#line 9343 "sql_yacc.yy" +#line 9345 "sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_issuer) @@ -27328,7 +27330,7 @@ break; case 1944: -#line 9353 "sql_yacc.yy" +#line 9355 "sql_yacc.yy" { LEX *lex=Lex; if (lex->ssl_cipher) @@ -27341,7 +27343,7 @@ break; case 1945: -#line 9366 "sql_yacc.yy" +#line 9368 "sql_yacc.yy" { LEX *lex= Lex; if (lex->copy_db_to(&lex->current_select->db, NULL)) @@ -27358,7 +27360,7 @@ break; case 1946: -#line 9380 "sql_yacc.yy" +#line 9382 "sql_yacc.yy" { LEX *lex= Lex; lex->current_select->db = (yyvsp[(1) - (3)].lex_str).str; @@ -27374,7 +27376,7 @@ break; case 1947: -#line 9393 "sql_yacc.yy" +#line 9395 "sql_yacc.yy" { LEX *lex= Lex; lex->current_select->db = NULL; @@ -27390,7 +27392,7 @@ break; case 1948: -#line 9406 "sql_yacc.yy" +#line 9408 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(1) - (1)].table),NULL, @@ -27402,12 +27404,12 @@ break; case 1949: -#line 9418 "sql_yacc.yy" +#line 9420 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT;} break; case 1950: -#line 9420 "sql_yacc.yy" +#line 9422 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -27415,12 +27417,12 @@ break; case 1951: -#line 9428 "sql_yacc.yy" +#line 9430 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT;} break; case 1952: -#line 9430 "sql_yacc.yy" +#line 9432 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -27428,7 +27430,7 @@ break; case 1953: -#line 9439 "sql_yacc.yy" +#line 9441 "sql_yacc.yy" { (yyval.lex_user)=(yyvsp[(1) - (4)].lex_user); (yyvsp[(1) - (4)].lex_user)->password=(yyvsp[(4) - (4)].lex_str); if ((yyvsp[(4) - (4)].lex_str).length) @@ -27456,17 +27458,17 @@ break; case 1954: -#line 9464 "sql_yacc.yy" +#line 9466 "sql_yacc.yy" { (yyval.lex_user)= (yyvsp[(1) - (5)].lex_user); (yyvsp[(1) - (5)].lex_user)->password= (yyvsp[(5) - (5)].lex_str); } break; case 1955: -#line 9466 "sql_yacc.yy" +#line 9468 "sql_yacc.yy" { (yyval.lex_user)= (yyvsp[(1) - (1)].lex_user); (yyvsp[(1) - (1)].lex_user)->password= null_lex_str; } break; case 1956: -#line 9472 "sql_yacc.yy" +#line 9474 "sql_yacc.yy" { LEX *lex=Lex; lex->grant |= lex->which_columns; @@ -27474,7 +27476,7 @@ break; case 1960: -#line 9484 "sql_yacc.yy" +#line 9486 "sql_yacc.yy" { String *new_str = new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); List_iterator iter(Lex->columns); @@ -27495,55 +27497,55 @@ break; case 1962: -#line 9506 "sql_yacc.yy" +#line 9508 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_SPECIFIED; } break; case 1963: -#line 9510 "sql_yacc.yy" +#line 9512 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_ANY; } break; case 1964: -#line 9514 "sql_yacc.yy" +#line 9516 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_X509; } break; case 1965: -#line 9518 "sql_yacc.yy" +#line 9520 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_NONE; } break; case 1966: -#line 9524 "sql_yacc.yy" +#line 9526 "sql_yacc.yy" {} break; case 1968: -#line 9528 "sql_yacc.yy" +#line 9530 "sql_yacc.yy" {} break; case 1969: -#line 9529 "sql_yacc.yy" +#line 9531 "sql_yacc.yy" {} break; case 1970: -#line 9533 "sql_yacc.yy" +#line 9535 "sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 1971: -#line 9535 "sql_yacc.yy" +#line 9537 "sql_yacc.yy" { LEX *lex=Lex; lex->mqh.questions=(yyvsp[(2) - (2)].ulong_num); @@ -27552,7 +27554,7 @@ break; case 1972: -#line 9541 "sql_yacc.yy" +#line 9543 "sql_yacc.yy" { LEX *lex=Lex; lex->mqh.updates=(yyvsp[(2) - (2)].ulong_num); @@ -27561,7 +27563,7 @@ break; case 1973: -#line 9547 "sql_yacc.yy" +#line 9549 "sql_yacc.yy" { LEX *lex=Lex; lex->mqh.conn_per_hour= (yyvsp[(2) - (2)].ulong_num); @@ -27570,7 +27572,7 @@ break; case 1974: -#line 9553 "sql_yacc.yy" +#line 9555 "sql_yacc.yy" { LEX *lex=Lex; lex->mqh.user_conn= (yyvsp[(2) - (2)].ulong_num); @@ -27579,7 +27581,7 @@ break; case 1975: -#line 9562 "sql_yacc.yy" +#line 9564 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_BEGIN; @@ -27588,62 +27590,62 @@ break; case 1976: -#line 9567 "sql_yacc.yy" +#line 9569 "sql_yacc.yy" {} break; case 1977: -#line 9571 "sql_yacc.yy" +#line 9573 "sql_yacc.yy" {} break; case 1978: -#line 9572 "sql_yacc.yy" +#line 9574 "sql_yacc.yy" {} break; case 1979: -#line 9576 "sql_yacc.yy" +#line 9578 "sql_yacc.yy" { (yyval.num)= (YYTHD->variables.completion_type == 1); } break; case 1980: -#line 9577 "sql_yacc.yy" +#line 9579 "sql_yacc.yy" { (yyval.num)=0; } break; case 1981: -#line 9578 "sql_yacc.yy" +#line 9580 "sql_yacc.yy" { (yyval.num)=1; } break; case 1982: -#line 9582 "sql_yacc.yy" +#line 9584 "sql_yacc.yy" { (yyval.num)= (YYTHD->variables.completion_type == 2); } break; case 1983: -#line 9583 "sql_yacc.yy" +#line 9585 "sql_yacc.yy" { (yyval.num)=1; } break; case 1984: -#line 9584 "sql_yacc.yy" +#line 9586 "sql_yacc.yy" { (yyval.num)=0; } break; case 1985: -#line 9588 "sql_yacc.yy" +#line 9590 "sql_yacc.yy" {} break; case 1986: -#line 9589 "sql_yacc.yy" +#line 9591 "sql_yacc.yy" {} break; case 1987: -#line 9594 "sql_yacc.yy" +#line 9596 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_COMMIT; @@ -27653,7 +27655,7 @@ break; case 1988: -#line 9604 "sql_yacc.yy" +#line 9606 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK; @@ -27663,7 +27665,7 @@ break; case 1989: -#line 9612 "sql_yacc.yy" +#line 9614 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT; @@ -27672,7 +27674,7 @@ break; case 1990: -#line 9621 "sql_yacc.yy" +#line 9623 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SAVEPOINT; @@ -27681,7 +27683,7 @@ break; case 1991: -#line 9630 "sql_yacc.yy" +#line 9632 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RELEASE_SAVEPOINT; @@ -27690,12 +27692,12 @@ break; case 1992: -#line 9643 "sql_yacc.yy" +#line 9645 "sql_yacc.yy" {} break; case 1994: -#line 9649 "sql_yacc.yy" +#line 9651 "sql_yacc.yy" { LEX *lex=Lex; if (lex->result) @@ -27722,7 +27724,7 @@ break; case 1995: -#line 9673 "sql_yacc.yy" +#line 9675 "sql_yacc.yy" { /* Remove from the name resolution context stack the context of the @@ -27733,22 +27735,22 @@ break; case 1996: -#line 9683 "sql_yacc.yy" +#line 9685 "sql_yacc.yy" { (yyval.num)= 0; } break; case 1997: -#line 9684 "sql_yacc.yy" +#line 9686 "sql_yacc.yy" { (yyval.num)= 1; } break; case 1998: -#line 9685 "sql_yacc.yy" +#line 9687 "sql_yacc.yy" { (yyval.num)= 1; } break; case 1999: -#line 9689 "sql_yacc.yy" +#line 9691 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27767,7 +27769,7 @@ break; case 2000: -#line 9705 "sql_yacc.yy" +#line 9707 "sql_yacc.yy" { THD *thd= YYTHD; thd->lex->current_select->no_table_names_allowed= 0; @@ -27776,29 +27778,29 @@ break; case 2003: -#line 9718 "sql_yacc.yy" +#line 9720 "sql_yacc.yy" { (yyval.num)=1; } break; case 2004: -#line 9719 "sql_yacc.yy" +#line 9721 "sql_yacc.yy" { (yyval.num)=1; } break; case 2005: -#line 9720 "sql_yacc.yy" +#line 9722 "sql_yacc.yy" { (yyval.num)=0; } break; case 2006: -#line 9725 "sql_yacc.yy" +#line 9727 "sql_yacc.yy" { (yyval.select_lex)= (yyvsp[(3) - (4)].select_lex); } break; case 2007: -#line 9729 "sql_yacc.yy" +#line 9731 "sql_yacc.yy" { THD *thd= YYTHD; /* @@ -27818,19 +27820,19 @@ break; case 2008: -#line 9745 "sql_yacc.yy" +#line 9747 "sql_yacc.yy" { (yyval.select_lex)= (yyvsp[(3) - (7)].select_lex); } break; case 2009: -#line 9749 "sql_yacc.yy" +#line 9751 "sql_yacc.yy" { (yyval.select_lex)= Lex->current_select->master_unit()->first_select(); } break; case 2010: -#line 9754 "sql_yacc.yy" +#line 9756 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sql_command == (int)SQLCOM_HA_READ || @@ -27853,7 +27855,7 @@ break; case 2011: -#line 9775 "sql_yacc.yy" +#line 9777 "sql_yacc.yy" { LEX *lex=Lex; lex->pop_context(); @@ -27871,32 +27873,32 @@ break; case 2012: -#line 9798 "sql_yacc.yy" +#line 9800 "sql_yacc.yy" {} break; case 2013: -#line 9800 "sql_yacc.yy" +#line 9802 "sql_yacc.yy" {} break; case 2014: -#line 9805 "sql_yacc.yy" +#line 9807 "sql_yacc.yy" {} break; case 2015: -#line 9807 "sql_yacc.yy" +#line 9809 "sql_yacc.yy" {} break; case 2016: -#line 9809 "sql_yacc.yy" +#line 9811 "sql_yacc.yy" {} break; case 2017: -#line 9820 "sql_yacc.yy" +#line 9822 "sql_yacc.yy" { /* We have to distinguish missing DEFINER-clause from case when @@ -27910,74 +27912,74 @@ break; case 2018: -#line 9831 "sql_yacc.yy" +#line 9833 "sql_yacc.yy" { YYTHD->lex->definer= get_current_user(YYTHD, (yyvsp[(3) - (3)].lex_user)); } break; case 2019: -#line 9844 "sql_yacc.yy" +#line 9846 "sql_yacc.yy" {} break; case 2020: -#line 9846 "sql_yacc.yy" +#line 9848 "sql_yacc.yy" {} break; case 2021: -#line 9848 "sql_yacc.yy" +#line 9850 "sql_yacc.yy" {} break; case 2022: -#line 9853 "sql_yacc.yy" +#line 9855 "sql_yacc.yy" { Lex->create_view_mode= VIEW_CREATE_OR_REPLACE; } break; case 2023: -#line 9858 "sql_yacc.yy" +#line 9860 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2024: -#line 9860 "sql_yacc.yy" +#line 9862 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; } break; case 2025: -#line 9862 "sql_yacc.yy" +#line 9864 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; } break; case 2026: -#line 9867 "sql_yacc.yy" +#line 9869 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2027: -#line 9869 "sql_yacc.yy" +#line 9871 "sql_yacc.yy" {} break; case 2028: -#line 9874 "sql_yacc.yy" +#line 9876 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFAULT; } break; case 2029: -#line 9876 "sql_yacc.yy" +#line 9878 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFINER; } break; case 2030: -#line 9878 "sql_yacc.yy" +#line 9880 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_INVOKER; } break; case 2031: -#line 9883 "sql_yacc.yy" +#line 9885 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27989,17 +27991,17 @@ break; case 2032: -#line 9892 "sql_yacc.yy" +#line 9894 "sql_yacc.yy" {} break; case 2033: -#line 9897 "sql_yacc.yy" +#line 9899 "sql_yacc.yy" {} break; case 2035: -#line 9903 "sql_yacc.yy" +#line 9905 "sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) sql_memdup(&(yyvsp[(1) - (1)].lex_str), sizeof(LEX_STRING))); @@ -28007,7 +28009,7 @@ break; case 2036: -#line 9908 "sql_yacc.yy" +#line 9910 "sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) sql_memdup(&(yyvsp[(3) - (3)].lex_str), sizeof(LEX_STRING))); @@ -28015,7 +28017,7 @@ break; case 2037: -#line 9915 "sql_yacc.yy" +#line 9917 "sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= FALSE; @@ -28026,7 +28028,7 @@ break; case 2038: -#line 9923 "sql_yacc.yy" +#line 9925 "sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= TRUE; @@ -28037,7 +28039,7 @@ break; case 2039: -#line 9934 "sql_yacc.yy" +#line 9936 "sql_yacc.yy" { THD *thd=YYTHD; LEX *lex= thd->lex; @@ -28049,7 +28051,7 @@ break; case 2040: -#line 9943 "sql_yacc.yy" +#line 9945 "sql_yacc.yy" { THD *thd=YYTHD; LEX *lex= thd->lex; @@ -28061,27 +28063,27 @@ break; case 2041: -#line 9955 "sql_yacc.yy" +#line 9957 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_NONE; } break; case 2042: -#line 9957 "sql_yacc.yy" +#line 9959 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2043: -#line 9959 "sql_yacc.yy" +#line 9961 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2044: -#line 9961 "sql_yacc.yy" +#line 9963 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_LOCAL; } break; case 2045: -#line 9973 "sql_yacc.yy" +#line 9975 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28124,7 +28126,7 @@ break; case 2046: -#line 10013 "sql_yacc.yy" +#line 10015 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -28153,7 +28155,7 @@ break; case 2047: -#line 10048 "sql_yacc.yy" +#line 10050 "sql_yacc.yy" { LEX *lex=Lex; lex->udf.type= (yyvsp[(1) - (4)].udf_type); @@ -28163,12 +28165,12 @@ break; case 2048: -#line 10055 "sql_yacc.yy" +#line 10057 "sql_yacc.yy" {} break; case 2049: -#line 10057 "sql_yacc.yy" +#line 10059 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp; @@ -28200,7 +28202,7 @@ break; case 2050: -#line 10086 "sql_yacc.yy" +#line 10088 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28211,7 +28213,7 @@ break; case 2051: -#line 10095 "sql_yacc.yy" +#line 10097 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28223,7 +28225,7 @@ break; case 2052: -#line 10104 "sql_yacc.yy" +#line 10106 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28235,7 +28237,7 @@ break; case 2053: -#line 10113 "sql_yacc.yy" +#line 10115 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -28250,49 +28252,49 @@ break; case 2054: -#line 10129 "sql_yacc.yy" +#line 10131 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_START; } break; case 2055: -#line 10133 "sql_yacc.yy" +#line 10135 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_END; } break; case 2056: -#line 10137 "sql_yacc.yy" +#line 10139 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_PREPARE; } break; case 2057: -#line 10141 "sql_yacc.yy" +#line 10143 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_COMMIT; } break; case 2058: -#line 10145 "sql_yacc.yy" +#line 10147 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_ROLLBACK; } break; case 2059: -#line 10149 "sql_yacc.yy" +#line 10151 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_RECOVER; } break; case 2060: -#line 10155 "sql_yacc.yy" +#line 10157 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (1)].string)->length() <= MAXGTRIDSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -28302,7 +28304,7 @@ break; case 2061: -#line 10162 "sql_yacc.yy" +#line 10164 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (3)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -28312,7 +28314,7 @@ break; case 2062: -#line 10169 "sql_yacc.yy" +#line 10171 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (5)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -28322,63 +28324,63 @@ break; case 2063: -#line 10177 "sql_yacc.yy" +#line 10179 "sql_yacc.yy" {} break; case 2064: -#line 10178 "sql_yacc.yy" +#line 10180 "sql_yacc.yy" {} break; case 2065: -#line 10182 "sql_yacc.yy" +#line 10184 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2066: -#line 10183 "sql_yacc.yy" +#line 10185 "sql_yacc.yy" { Lex->xa_opt=XA_JOIN; } break; case 2067: -#line 10184 "sql_yacc.yy" +#line 10186 "sql_yacc.yy" { Lex->xa_opt=XA_RESUME; } break; case 2068: -#line 10188 "sql_yacc.yy" +#line 10190 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2069: -#line 10189 "sql_yacc.yy" +#line 10191 "sql_yacc.yy" { Lex->xa_opt=XA_ONE_PHASE; } break; case 2070: -#line 10193 "sql_yacc.yy" +#line 10195 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2071: -#line 10194 "sql_yacc.yy" +#line 10196 "sql_yacc.yy" { Lex->xa_opt=XA_SUSPEND; } break; case 2073: -#line 10199 "sql_yacc.yy" +#line 10201 "sql_yacc.yy" { } break; case 2074: -#line 10200 "sql_yacc.yy" +#line 10202 "sql_yacc.yy" { Lex->xa_opt=XA_FOR_MIGRATE; } break; /* Line 1267 of yacc.c. */ -#line 28382 "sql_yacc.cc" +#line 28384 "sql_yacc.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); Modified: mysql-5.0.51-tritonn-1.0.8/sql/sql_yacc.yy =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/sql_yacc.yy 2007-12-10 07:01:42 UTC (rev 51) +++ mysql-5.0.51-tritonn-1.0.8/sql/sql_yacc.yy 2007-12-10 10:56:06 UTC (rev 52) @@ -3665,11 +3665,13 @@ } | SENNA_DELIMITED_SYM { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_NGRAM; Lex->senna_flags |= SEN_INDEX_DELIMITED; #endif /* ENABLE_SENNA */ } | SENNA_MECAB_SYM { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_DELIMITED; Lex->senna_flags &= ~SEN_INDEX_NGRAM; #endif /* ENABLE_SENNA */ } From svnnotify ¡÷ sourceforge.jp Tue Dec 11 13:26:31 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 11 Dec 2007 13:26:31 +0900 Subject: [Tritonn-commit 43] [svn] [53] fixed bug: DELEMITED flag was ignored while creating fulltext index. Message-ID: <1197347191.202672.4314.nullmailer@users.sourceforge.jp> Revision: 53 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=53 Author: mir Date: 2007-12-11 13:26:30 +0900 (Tue, 11 Dec 2007) Log Message: ----------- fixed bug: DELEMITED flag was ignored while creating fulltext index. Modified Paths: -------------- mysql-5.0.51-tritonn-1.0.8/libmysqld/sql_yacc.cc Modified: mysql-5.0.51-tritonn-1.0.8/libmysqld/sql_yacc.cc =================================================================== --- mysql-5.0.51-tritonn-1.0.8/libmysqld/sql_yacc.cc 2007-12-10 10:56:06 UTC (rev 52) +++ mysql-5.0.51-tritonn-1.0.8/libmysqld/sql_yacc.cc 2007-12-11 04:26:30 UTC (rev 53) @@ -2926,162 +2926,162 @@ 3555, 3558, 3559, 3560, 3561, 3562, 3565, 3566, 3567, 3579, 3580, 3583, 3584, 3587, 3588, 3592, 3593, 3594, 3597, 3598, 3599, 3600, 3613, 3614, 3615, 3618, 3619, 3623, 3624, 3627, - 3628, 3631, 3636, 3641, 3646, 3651, 3656, 3661, 3666, 3671, - 3676, 3681, 3686, 3697, 3698, 3701, 3702, 3713, 3714, 3717, - 3718, 3721, 3722, 3730, 3729, 3756, 3755, 3769, 3768, 3787, - 3786, 3806, 3804, 3824, 3825, 3827, 3828, 3829, 3830, 3831, - 3834, 3842, 3843, 3847, 3852, 3851, 3859, 3868, 3858, 3880, - 3887, 3891, 3898, 3905, 3911, 3917, 3923, 3930, 3948, 3969, - 3974, 3978, 3985, 3986, 3989, 3990, 3994, 3995, 3996, 4000, - 4001, 4002, 4005, 4006, 4007, 4008, 4016, 4015, 4026, 4034, - 4033, 4043, 4053, 4062, 4063, 4070, 4070, 4076, 4077, 4081, - 4082, 4083, 4087, 4088, 4105, 4106, 4111, 4110, 4121, 4120, - 4131, 4130, 4140, 4141, 4142, 4147, 4146, 4158, 4159, 4162, - 4163, 4166, 4167, 4168, 4172, 4171, 4184, 4183, 4200, 4201, - 4204, 4205, 4208, 4209, 4210, 4211, 4212, 4213, 4217, 4216, - 4228, 4229, 4230, 4235, 4234, 4240, 4247, 4252, 4260, 4261, - 4264, 4276, 4285, 4286, 4289, 4302, 4303, 4308, 4307, 4317, - 4318, 4321, 4334, 4334, 4344, 4345, 4354, 4355, 4364, 4373, - 4375, 4378, 4400, 4404, 4403, 4423, 4431, 4423, 4437, 4438, - 4439, 4440, 4441, 4444, 4451, 4458, 4460, 4471, 4472, 4475, - 4476, 4482, 4483, 4484, 4485, 4491, 4497, 4503, 4517, 4520, - 4522, 4528, 4538, 4539, 4540, 4553, 4573, 4580, 4587, 4588, - 4591, 4592, 4593, 4594, 4595, 4599, 4600, 4604, 4653, 4658, - 4699, 4701, 4703, 4705, 4707, 4709, 4711, 4713, 4717, 4719, - 4721, 4723, 4725, 4727, 4730, 4734, 4740, 4744, 4750, 4754, - 4762, 4764, 4770, 4773, 4775, 4777, 4778, 4780, 4783, 4785, - 4787, 4789, 4791, 4793, 4795, 4797, 4799, 4801, 4803, 4805, - 4807, 4809, 4811, 4814, 4814, 4815, 4815, 4816, 4816, 4817, - 4817, 4819, 4820, 4821, 4822, 4823, 4824, 4827, 4828, 4832, - 4837, 4838, 4845, 4846, 4847, 4848, 4849, 4851, 4852, 4853, - 4854, 4855, 4859, 4860, 4865, 4870, 4874, 4875, 4879, 4880, - 4884, 4891, 4893, 4899, 4901, 4912, 4914, 4925, 4936, 4947, - 4958, 4960, 4962, 4964, 4966, 4968, 4970, 4972, 4974, 4976, - 4978, 4980, 4982, 4988, 4990, 4992, 4997, 5002, 5004, 5006, - 5011, 5013, 5015, 5017, 5019, 5024, 5025, 5027, 5029, 5031, - 5033, 5035, 5037, 5039, 5041, 5043, 5045, 5047, 5051, 5053, - 5063, 5065, 5067, 5069, 5071, 5074, 5083, 5088, 5093, 5095, - 5097, 5099, 5101, 5103, 5105, 5107, 5112, 5117, 5119, 5121, - 5123, 5125, 5127, 5129, 5135, 5137, 5139, 5141, 5143, 5145, - 5147, 5149, 5151, 5152, 5158, 5163, 5165, 5167, 5169, 5171, - 5173, 5175, 5177, 5179, 5186, 5193, 5195, 5197, 5199, 5201, - 5203, 5205, 5207, 5209, 5211, 5213, 5215, 5217, 5219, 5221, - 5235, 5234, 5351, 5355, 5360, 5362, 5364, 5366, 5368, 5370, - 5375, 5377, 5379, 5381, 5383, 5388, 5392, 5394, 5396, 5398, - 5400, 5402, 5406, 5409, 5412, 5414, 5416, 5418, 5420, 5422, - 5424, 5427, 5430, 5432, 5434, 5436, 5438, 5440, 5443, 5445, - 5447, 5449, 5454, 5455, 5456, 5460, 5461, 5465, 5465, 5471, - 5475, 5482, 5513, 5515, 5517, 5519, 5521, 5523, 5525, 5528, - 5530, 5527, 5533, 5535, 5542, 5544, 5546, 5548, 5550, 5552, - 5554, 5556, 5558, 5561, 5560, 5575, 5574, 5589, 5595, 5601, - 5614, 5615, 5619, 5622, 5627, 5630, 5642, 5641, 5657, 5658, - 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 5667, 5671, - 5672, 5676, 5676, 5681, 5682, 5685, 5686, 5689, 5689, 5694, - 5695, 5698, 5699, 5702, 5703, 5706, 5712, 5722, 5723, 5732, - 5737, 5738, 5758, 5760, 5764, 5762, 5779, 5777, 5795, 5793, - 5800, 5809, 5807, 5825, 5824, 5834, 5845, 5843, 5862, 5861, - 5872, 5882, 5883, 5884, 5889, 5889, 5908, 5906, 5925, 5947, - 5995, 5994, 6017, 6035, 6017, 6042, 6046, 6072, 6073, 6075, - 6077, 6080, 6081, 6087, 6094, 6103, 6102, 6109, 6110, 6114, - 6118, 6122, 6128, 6136, 6145, 6146, 6147, 6148, 6149, 6150, - 6151, 6152, 6153, 6154, 6155, 6156, 6157, 6160, 6161, 6162, - 6163, 6164, 6165, 6166, 6167, 6168, 6172, 6173, 6174, 6175, - 6178, 6180, 6181, 6184, 6185, 6188, 6190, 6194, 6196, 6195, - 6209, 6212, 6211, 6226, 6232, 6245, 6247, 6250, 6252, 6256, - 6257, 6270, 6288, 6292, 6293, 6297, 6310, 6312, 6316, 6315, - 6347, 6349, 6353, 6354, 6355, 6360, 6366, 6370, 6371, 6375, - 6379, 6386, 6393, 6402, 6406, 6407, 6408, 6413, 6417, 6425, - 6426, 6427, 6428, 6429, 6430, 6434, 6435, 6436, 6437, 6438, - 6441, 6444, 6443, 6472, 6473, 6476, 6477, 6480, 6495, 6495, - 6505, 6506, 6510, 6522, 6555, 6554, 6567, 6566, 6575, 6587, - 6598, 6597, 6614, 6621, 6621, 6633, 6640, 6652, 6664, 6668, - 6674, 6684, 6685, 6688, 6696, 6697, 6700, 6710, 6711, 6715, - 6716, 6724, 6733, 6723, 6743, 6750, 6742, 6760, 6772, 6773, - 6774, 6778, 6779, 6782, 6783, 6786, 6795, 6796, 6797, 6799, - 6798, 6808, 6809, 6812, 6813, 6814, 6814, 6815, 6815, 6819, - 6820, 6823, 6825, 6828, 6836, 6837, 6841, 6842, 6847, 6846, - 6859, 6860, 6863, 6868, 6876, 6877, 6880, 6882, 6882, 6890, - 6899, 6889, 6921, 6922, 6925, 6932, 6933, 6936, 6945, 6946, - 6952, 6951, 6965, 6964, 6973, 6972, 6980, 6979, 6989, 6990, - 6993, 7000, 7013, 7014, 7018, 7019, 7022, 7023, 7024, 7027, - 7037, 7039, 7041, 7043, 7046, 7047, 7050, 7054, 7058, 7062, - 7066, 7070, 7074, 7078, 7082, 7090, 7093, 7102, 7101, 7115, - 7123, 7132, 7141, 7150, 7160, 7159, 7162, 7172, 7182, 7186, - 7191, 7190, 7195, 7205, 7210, 7216, 7221, 7226, 7228, 7230, - 7232, 7234, 7236, 7244, 7253, 7255, 7257, 7259, 7268, 7276, - 7284, 7286, 7288, 7298, 7305, 7311, 7319, 7327, 7331, 7335, - 7342, 7349, 7359, 7369, 7379, 7390, 7399, 7413, 7426, 7427, - 7429, 7431, 7434, 7435, 7438, 7439, 7442, 7443, 7446, 7447, - 7450, 7451, 7453, 7455, 7458, 7470, 7469, 7484, 7483, 7493, - 7494, 7497, 7498, 7502, 7503, 7504, 7512, 7511, 7523, 7524, - 7527, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, - 7536, 7537, 7540, 7541, 7545, 7544, 7553, 7554, 7557, 7558, - 7559, 7563, 7562, 7572, 7576, 7580, 7592, 7592, 7600, 7601, - 7602, 7607, 7617, 7616, 7632, 7650, 7661, 7668, 7678, 7649, - 7683, 7692, 7693, 7696, 7697, 7709, 7713, 7714, 7715, 7717, - 7719, 7722, 7723, 7726, 7731, 7738, 7743, 7749, 7751, 7754, - 7755, 7758, 7763, 7769, 7771, 7778, 7779, 7780, 7783, 7785, - 7790, 7791, 7796, 7797, 7803, 7821, 7829, 7834, 7853, 7855, - 7866, 7879, 7900, 7901, 7902, 7911, 7912, 7913, 7918, 7919, - 7920, 7921, 7922, 7938, 7952, 7953, 7954, 7957, 7958, 7959, - 7960, 7968, 7983, 7984, 7987, 7993, 8004, 8007, 8044, 8048, - 8056, 8060, 8128, 8143, 8167, 8168, 8184, 8194, 8197, 8198, - 8199, 8203, 8207, 8208, 8233, 8245, 8258, 8270, 8271, 8280, - 8281, 8290, 8291, 8292, 8295, 8308, 8321, 8335, 8336, 8337, - 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 8347, - 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 8357, - 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 8367, - 8368, 8369, 8370, 8371, 8381, 8382, 8383, 8384, 8385, 8386, - 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, - 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, - 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, - 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, - 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, - 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, - 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, - 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, - 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, - 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, - 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, - 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, - 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, - 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, - 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, - 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, - 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, - 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, - 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, - 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, - 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, - 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, - 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, - 8623, 8622, 8636, 8637, 8640, 8641, 8644, 8644, 8721, 8722, - 8723, 8724, 8728, 8729, 8733, 8734, 8735, 8736, 8740, 8741, - 8742, 8743, 8747, 8748, 8751, 8831, 8844, 8848, 8853, 8860, - 8875, 8888, 8909, 8916, 8954, 8997, 9011, 9012, 9013, 9014, - 9018, 9019, 9026, 9035, 9036, 9037, 9038, 9039, 9047, 9046, - 9062, 9063, 9066, 9067, 9070, 9078, 9079, 9080, 9081, 9086, - 9085, 9106, 9118, 9131, 9130, 9149, 9150, 9154, 9155, 9159, - 9160, 9161, 9162, 9164, 9163, 9174, 9175, 9176, 9177, 9178, - 9184, 9189, 9196, 9209, 9221, 9228, 9233, 9241, 9254, 9268, - 9270, 9273, 9274, 9281, 9283, 9287, 9288, 9291, 9291, 9292, - 9292, 9293, 9293, 9294, 9294, 9295, 9296, 9297, 9298, 9299, - 9300, 9301, 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, - 9310, 9311, 9312, 9313, 9314, 9315, 9316, 9317, 9322, 9323, - 9327, 9328, 9332, 9342, 9352, 9365, 9379, 9392, 9405, 9418, - 9419, 9428, 9429, 9438, 9463, 9465, 9472, 9476, 9479, 9480, - 9483, 9504, 9505, 9509, 9513, 9517, 9524, 9525, 9528, 9529, - 9533, 9534, 9540, 9546, 9552, 9562, 9561, 9571, 9572, 9576, - 9577, 9578, 9582, 9583, 9584, 9588, 9589, 9593, 9603, 9610, - 9620, 9629, 9643, 9644, 9649, 9648, 9683, 9684, 9685, 9689, - 9689, 9713, 9714, 9718, 9719, 9720, 9724, 9729, 9728, 9748, - 9754, 9775, 9797, 9799, 9804, 9806, 9808, 9820, 9830, 9843, - 9845, 9847, 9852, 9857, 9859, 9861, 9867, 9868, 9874, 9875, - 9877, 9883, 9882, 9897, 9898, 9902, 9907, 9915, 9915, 9933, - 9942, 9955, 9956, 9958, 9960, 9973, 9971, 10048, 10047, 10057, - 10086, 10095, 10104, 10056, 10128, 10132, 10136, 10140, 10144, 10148, - 10154, 10161, 10168, 10177, 10178, 10182, 10183, 10184, 10188, 10189, - 10193, 10194, 10194, 10199, 10200 + 3628, 3631, 3636, 3641, 3646, 3651, 3656, 3661, 3666, 3672, + 3678, 3683, 3688, 3699, 3700, 3703, 3704, 3715, 3716, 3719, + 3720, 3723, 3724, 3732, 3731, 3758, 3757, 3771, 3770, 3789, + 3788, 3808, 3806, 3826, 3827, 3829, 3830, 3831, 3832, 3833, + 3836, 3844, 3845, 3849, 3854, 3853, 3861, 3870, 3860, 3882, + 3889, 3893, 3900, 3907, 3913, 3919, 3925, 3932, 3950, 3971, + 3976, 3980, 3987, 3988, 3991, 3992, 3996, 3997, 3998, 4002, + 4003, 4004, 4007, 4008, 4009, 4010, 4018, 4017, 4028, 4036, + 4035, 4045, 4055, 4064, 4065, 4072, 4072, 4078, 4079, 4083, + 4084, 4085, 4089, 4090, 4107, 4108, 4113, 4112, 4123, 4122, + 4133, 4132, 4142, 4143, 4144, 4149, 4148, 4160, 4161, 4164, + 4165, 4168, 4169, 4170, 4174, 4173, 4186, 4185, 4202, 4203, + 4206, 4207, 4210, 4211, 4212, 4213, 4214, 4215, 4219, 4218, + 4230, 4231, 4232, 4237, 4236, 4242, 4249, 4254, 4262, 4263, + 4266, 4278, 4287, 4288, 4291, 4304, 4305, 4310, 4309, 4319, + 4320, 4323, 4336, 4336, 4346, 4347, 4356, 4357, 4366, 4375, + 4377, 4380, 4402, 4406, 4405, 4425, 4433, 4425, 4439, 4440, + 4441, 4442, 4443, 4446, 4453, 4460, 4462, 4473, 4474, 4477, + 4478, 4484, 4485, 4486, 4487, 4493, 4499, 4505, 4519, 4522, + 4524, 4530, 4540, 4541, 4542, 4555, 4575, 4582, 4589, 4590, + 4593, 4594, 4595, 4596, 4597, 4601, 4602, 4606, 4655, 4660, + 4701, 4703, 4705, 4707, 4709, 4711, 4713, 4715, 4719, 4721, + 4723, 4725, 4727, 4729, 4732, 4736, 4742, 4746, 4752, 4756, + 4764, 4766, 4772, 4775, 4777, 4779, 4780, 4782, 4785, 4787, + 4789, 4791, 4793, 4795, 4797, 4799, 4801, 4803, 4805, 4807, + 4809, 4811, 4813, 4816, 4816, 4817, 4817, 4818, 4818, 4819, + 4819, 4821, 4822, 4823, 4824, 4825, 4826, 4829, 4830, 4834, + 4839, 4840, 4847, 4848, 4849, 4850, 4851, 4853, 4854, 4855, + 4856, 4857, 4861, 4862, 4867, 4872, 4876, 4877, 4881, 4882, + 4886, 4893, 4895, 4901, 4903, 4914, 4916, 4927, 4938, 4949, + 4960, 4962, 4964, 4966, 4968, 4970, 4972, 4974, 4976, 4978, + 4980, 4982, 4984, 4990, 4992, 4994, 4999, 5004, 5006, 5008, + 5013, 5015, 5017, 5019, 5021, 5026, 5027, 5029, 5031, 5033, + 5035, 5037, 5039, 5041, 5043, 5045, 5047, 5049, 5053, 5055, + 5065, 5067, 5069, 5071, 5073, 5076, 5085, 5090, 5095, 5097, + 5099, 5101, 5103, 5105, 5107, 5109, 5114, 5119, 5121, 5123, + 5125, 5127, 5129, 5131, 5137, 5139, 5141, 5143, 5145, 5147, + 5149, 5151, 5153, 5154, 5160, 5165, 5167, 5169, 5171, 5173, + 5175, 5177, 5179, 5181, 5188, 5195, 5197, 5199, 5201, 5203, + 5205, 5207, 5209, 5211, 5213, 5215, 5217, 5219, 5221, 5223, + 5237, 5236, 5353, 5357, 5362, 5364, 5366, 5368, 5370, 5372, + 5377, 5379, 5381, 5383, 5385, 5390, 5394, 5396, 5398, 5400, + 5402, 5404, 5408, 5411, 5414, 5416, 5418, 5420, 5422, 5424, + 5426, 5429, 5432, 5434, 5436, 5438, 5440, 5442, 5445, 5447, + 5449, 5451, 5456, 5457, 5458, 5462, 5463, 5467, 5467, 5473, + 5477, 5484, 5515, 5517, 5519, 5521, 5523, 5525, 5527, 5530, + 5532, 5529, 5535, 5537, 5544, 5546, 5548, 5550, 5552, 5554, + 5556, 5558, 5560, 5563, 5562, 5577, 5576, 5591, 5597, 5603, + 5616, 5617, 5621, 5624, 5629, 5632, 5644, 5643, 5659, 5660, + 5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5673, + 5674, 5678, 5678, 5683, 5684, 5687, 5688, 5691, 5691, 5696, + 5697, 5700, 5701, 5704, 5705, 5708, 5714, 5724, 5725, 5734, + 5739, 5740, 5760, 5762, 5766, 5764, 5781, 5779, 5797, 5795, + 5802, 5811, 5809, 5827, 5826, 5836, 5847, 5845, 5864, 5863, + 5874, 5884, 5885, 5886, 5891, 5891, 5910, 5908, 5927, 5949, + 5997, 5996, 6019, 6037, 6019, 6044, 6048, 6074, 6075, 6077, + 6079, 6082, 6083, 6089, 6096, 6105, 6104, 6111, 6112, 6116, + 6120, 6124, 6130, 6138, 6147, 6148, 6149, 6150, 6151, 6152, + 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6162, 6163, 6164, + 6165, 6166, 6167, 6168, 6169, 6170, 6174, 6175, 6176, 6177, + 6180, 6182, 6183, 6186, 6187, 6190, 6192, 6196, 6198, 6197, + 6211, 6214, 6213, 6228, 6234, 6247, 6249, 6252, 6254, 6258, + 6259, 6272, 6290, 6294, 6295, 6299, 6312, 6314, 6318, 6317, + 6349, 6351, 6355, 6356, 6357, 6362, 6368, 6372, 6373, 6377, + 6381, 6388, 6395, 6404, 6408, 6409, 6410, 6415, 6419, 6427, + 6428, 6429, 6430, 6431, 6432, 6436, 6437, 6438, 6439, 6440, + 6443, 6446, 6445, 6474, 6475, 6478, 6479, 6482, 6497, 6497, + 6507, 6508, 6512, 6524, 6557, 6556, 6569, 6568, 6577, 6589, + 6600, 6599, 6616, 6623, 6623, 6635, 6642, 6654, 6666, 6670, + 6676, 6686, 6687, 6690, 6698, 6699, 6702, 6712, 6713, 6717, + 6718, 6726, 6735, 6725, 6745, 6752, 6744, 6762, 6774, 6775, + 6776, 6780, 6781, 6784, 6785, 6788, 6797, 6798, 6799, 6801, + 6800, 6810, 6811, 6814, 6815, 6816, 6816, 6817, 6817, 6821, + 6822, 6825, 6827, 6830, 6838, 6839, 6843, 6844, 6849, 6848, + 6861, 6862, 6865, 6870, 6878, 6879, 6882, 6884, 6884, 6892, + 6901, 6891, 6923, 6924, 6927, 6934, 6935, 6938, 6947, 6948, + 6954, 6953, 6967, 6966, 6975, 6974, 6982, 6981, 6991, 6992, + 6995, 7002, 7015, 7016, 7020, 7021, 7024, 7025, 7026, 7029, + 7039, 7041, 7043, 7045, 7048, 7049, 7052, 7056, 7060, 7064, + 7068, 7072, 7076, 7080, 7084, 7092, 7095, 7104, 7103, 7117, + 7125, 7134, 7143, 7152, 7162, 7161, 7164, 7174, 7184, 7188, + 7193, 7192, 7197, 7207, 7212, 7218, 7223, 7228, 7230, 7232, + 7234, 7236, 7238, 7246, 7255, 7257, 7259, 7261, 7270, 7278, + 7286, 7288, 7290, 7300, 7307, 7313, 7321, 7329, 7333, 7337, + 7344, 7351, 7361, 7371, 7381, 7392, 7401, 7415, 7428, 7429, + 7431, 7433, 7436, 7437, 7440, 7441, 7444, 7445, 7448, 7449, + 7452, 7453, 7455, 7457, 7460, 7472, 7471, 7486, 7485, 7495, + 7496, 7499, 7500, 7504, 7505, 7506, 7514, 7513, 7525, 7526, + 7529, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 7537, + 7538, 7539, 7542, 7543, 7547, 7546, 7555, 7556, 7559, 7560, + 7561, 7565, 7564, 7574, 7578, 7582, 7594, 7594, 7602, 7603, + 7604, 7609, 7619, 7618, 7634, 7652, 7663, 7670, 7680, 7651, + 7685, 7694, 7695, 7698, 7699, 7711, 7715, 7716, 7717, 7719, + 7721, 7724, 7725, 7728, 7733, 7740, 7745, 7751, 7753, 7756, + 7757, 7760, 7765, 7771, 7773, 7780, 7781, 7782, 7785, 7787, + 7792, 7793, 7798, 7799, 7805, 7823, 7831, 7836, 7855, 7857, + 7868, 7881, 7902, 7903, 7904, 7913, 7914, 7915, 7920, 7921, + 7922, 7923, 7924, 7940, 7954, 7955, 7956, 7959, 7960, 7961, + 7962, 7970, 7985, 7986, 7989, 7995, 8006, 8009, 8046, 8050, + 8058, 8062, 8130, 8145, 8169, 8170, 8186, 8196, 8199, 8200, + 8201, 8205, 8209, 8210, 8235, 8247, 8260, 8272, 8273, 8282, + 8283, 8292, 8293, 8294, 8297, 8310, 8323, 8337, 8338, 8339, + 8340, 8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, + 8350, 8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, + 8360, 8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, + 8370, 8371, 8372, 8373, 8383, 8384, 8385, 8386, 8387, 8388, + 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, + 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, + 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, + 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, + 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, + 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, + 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, + 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, + 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, + 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, + 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, + 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, + 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, + 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, + 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, + 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, + 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, + 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, + 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, + 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, + 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, + 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, + 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, + 8625, 8624, 8638, 8639, 8642, 8643, 8646, 8646, 8723, 8724, + 8725, 8726, 8730, 8731, 8735, 8736, 8737, 8738, 8742, 8743, + 8744, 8745, 8749, 8750, 8753, 8833, 8846, 8850, 8855, 8862, + 8877, 8890, 8911, 8918, 8956, 8999, 9013, 9014, 9015, 9016, + 9020, 9021, 9028, 9037, 9038, 9039, 9040, 9041, 9049, 9048, + 9064, 9065, 9068, 9069, 9072, 9080, 9081, 9082, 9083, 9088, + 9087, 9108, 9120, 9133, 9132, 9151, 9152, 9156, 9157, 9161, + 9162, 9163, 9164, 9166, 9165, 9176, 9177, 9178, 9179, 9180, + 9186, 9191, 9198, 9211, 9223, 9230, 9235, 9243, 9256, 9270, + 9272, 9275, 9276, 9283, 9285, 9289, 9290, 9293, 9293, 9294, + 9294, 9295, 9295, 9296, 9296, 9297, 9298, 9299, 9300, 9301, + 9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309, 9310, 9311, + 9312, 9313, 9314, 9315, 9316, 9317, 9318, 9319, 9324, 9325, + 9329, 9330, 9334, 9344, 9354, 9367, 9381, 9394, 9407, 9420, + 9421, 9430, 9431, 9440, 9465, 9467, 9474, 9478, 9481, 9482, + 9485, 9506, 9507, 9511, 9515, 9519, 9526, 9527, 9530, 9531, + 9535, 9536, 9542, 9548, 9554, 9564, 9563, 9573, 9574, 9578, + 9579, 9580, 9584, 9585, 9586, 9590, 9591, 9595, 9605, 9612, + 9622, 9631, 9645, 9646, 9651, 9650, 9685, 9686, 9687, 9691, + 9691, 9715, 9716, 9720, 9721, 9722, 9726, 9731, 9730, 9750, + 9756, 9777, 9799, 9801, 9806, 9808, 9810, 9822, 9832, 9845, + 9847, 9849, 9854, 9859, 9861, 9863, 9869, 9870, 9876, 9877, + 9879, 9885, 9884, 9899, 9900, 9904, 9909, 9917, 9917, 9935, + 9944, 9957, 9958, 9960, 9962, 9975, 9973, 10050, 10049, 10059, + 10088, 10097, 10106, 10058, 10130, 10134, 10138, 10142, 10146, 10150, + 10156, 10163, 10170, 10179, 10180, 10184, 10185, 10186, 10190, 10191, + 10195, 10196, 10196, 10201, 10202 }; #endif @@ -18167,22 +18167,24 @@ #line 3666 "sql_yacc.yy" { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_NGRAM; Lex->senna_flags |= SEN_INDEX_DELIMITED; #endif /* ENABLE_SENNA */ } break; case 529: -#line 3671 "sql_yacc.yy" +#line 3672 "sql_yacc.yy" { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_DELIMITED; Lex->senna_flags &= ~SEN_INDEX_NGRAM; #endif /* ENABLE_SENNA */ } break; case 530: -#line 3676 "sql_yacc.yy" +#line 3678 "sql_yacc.yy" { #ifdef ENABLE_SENNA Lex->senna_flags |= SEN_INDEX_NGRAM; @@ -18191,7 +18193,7 @@ break; case 531: -#line 3681 "sql_yacc.yy" +#line 3683 "sql_yacc.yy" { #ifdef ENABLE_SENNA Lex->senna_flags |= 0x00080000; @@ -18200,7 +18202,7 @@ break; case 532: -#line 3686 "sql_yacc.yy" +#line 3688 "sql_yacc.yy" { #ifdef ENABLE_SENNA if ((yyvsp[(1) - (1)].ulong_num) < 65536) { @@ -18213,22 +18215,22 @@ break; case 533: -#line 3697 "sql_yacc.yy" +#line 3699 "sql_yacc.yy" { Lex->col_list.push_back((yyvsp[(3) - (4)].key_part)); } break; case 534: -#line 3698 "sql_yacc.yy" +#line 3700 "sql_yacc.yy" { Lex->col_list.push_back((yyvsp[(1) - (2)].key_part)); } break; case 535: -#line 3701 "sql_yacc.yy" +#line 3703 "sql_yacc.yy" { (yyval.key_part)=new key_part_spec((yyvsp[(1) - (1)].lex_str).str); } break; case 536: -#line 3703 "sql_yacc.yy" +#line 3705 "sql_yacc.yy" { int key_part_len= atoi((yyvsp[(3) - (4)].lex_str).str); if (!key_part_len) @@ -18240,37 +18242,37 @@ break; case 537: -#line 3713 "sql_yacc.yy" +#line 3715 "sql_yacc.yy" { (yyval.simple_string)=(char*) 0; } break; case 538: -#line 3714 "sql_yacc.yy" +#line 3716 "sql_yacc.yy" { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str; } break; case 539: -#line 3717 "sql_yacc.yy" +#line 3719 "sql_yacc.yy" { (yyval.lex_str)= null_lex_str; } break; case 540: -#line 3718 "sql_yacc.yy" +#line 3720 "sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(2) - (2)].lex_str); } break; case 541: -#line 3721 "sql_yacc.yy" +#line 3723 "sql_yacc.yy" { Lex->interval_list.push_back((yyvsp[(1) - (1)].string)); } break; case 542: -#line 3722 "sql_yacc.yy" +#line 3724 "sql_yacc.yy" { Lex->interval_list.push_back((yyvsp[(3) - (3)].string)); } break; case 543: -#line 3730 "sql_yacc.yy" +#line 3732 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -18297,12 +18299,12 @@ break; case 544: -#line 3754 "sql_yacc.yy" +#line 3756 "sql_yacc.yy" {} break; case 545: -#line 3756 "sql_yacc.yy" +#line 3758 "sql_yacc.yy" { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -18310,7 +18312,7 @@ break; case 546: -#line 3761 "sql_yacc.yy" +#line 3763 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_ALTER_DB; @@ -18321,7 +18323,7 @@ break; case 547: -#line 3769 "sql_yacc.yy" +#line 3771 "sql_yacc.yy" { LEX *lex= Lex; @@ -18335,7 +18337,7 @@ break; case 548: -#line 3780 "sql_yacc.yy" +#line 3782 "sql_yacc.yy" { LEX *lex=Lex; @@ -18345,7 +18347,7 @@ break; case 549: -#line 3787 "sql_yacc.yy" +#line 3789 "sql_yacc.yy" { LEX *lex= Lex; @@ -18359,7 +18361,7 @@ break; case 550: -#line 3798 "sql_yacc.yy" +#line 3800 "sql_yacc.yy" { LEX *lex=Lex; @@ -18369,7 +18371,7 @@ break; case 551: -#line 3806 "sql_yacc.yy" +#line 3808 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -18386,32 +18388,32 @@ break; case 552: -#line 3820 "sql_yacc.yy" +#line 3822 "sql_yacc.yy" {} break; case 553: -#line 3824 "sql_yacc.yy" +#line 3826 "sql_yacc.yy" { (yyval.simple_string)= 0; } break; case 554: -#line 3825 "sql_yacc.yy" +#line 3827 "sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(1) - (1)].lex_str).str; } break; case 556: -#line 3828 "sql_yacc.yy" +#line 3830 "sql_yacc.yy" { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; } break; case 557: -#line 3829 "sql_yacc.yy" +#line 3831 "sql_yacc.yy" { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; } break; case 560: -#line 3835 "sql_yacc.yy" +#line 3837 "sql_yacc.yy" { LEX *lex=Lex; lex->change=0; @@ -18420,26 +18422,26 @@ break; case 561: -#line 3842 "sql_yacc.yy" +#line 3844 "sql_yacc.yy" { } break; case 562: -#line 3844 "sql_yacc.yy" +#line 3846 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_ADD_INDEX; } break; case 563: -#line 3848 "sql_yacc.yy" +#line 3850 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_ADD_COLUMN | ALTER_ADD_INDEX; } break; case 564: -#line 3852 "sql_yacc.yy" +#line 3854 "sql_yacc.yy" { LEX *lex=Lex; lex->change= (yyvsp[(3) - (3)].lex_str).str; @@ -18448,7 +18450,7 @@ break; case 566: -#line 3859 "sql_yacc.yy" +#line 3861 "sql_yacc.yy" { LEX *lex=Lex; lex->length=lex->dec=0; lex->type=0; @@ -18460,7 +18462,7 @@ break; case 567: -#line 3868 "sql_yacc.yy" +#line 3870 "sql_yacc.yy" { LEX *lex=Lex; if (add_field_to_list(lex->thd,(yyvsp[(3) - (6)].lex_str).str, @@ -18475,7 +18477,7 @@ break; case 569: -#line 3881 "sql_yacc.yy" +#line 3883 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN, @@ -18485,14 +18487,14 @@ break; case 570: -#line 3888 "sql_yacc.yy" +#line 3890 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_DROP_INDEX; } break; case 571: -#line 3892 "sql_yacc.yy" +#line 3894 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, @@ -18502,7 +18504,7 @@ break; case 572: -#line 3899 "sql_yacc.yy" +#line 3901 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, @@ -18512,7 +18514,7 @@ break; case 573: -#line 3906 "sql_yacc.yy" +#line 3908 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= DISABLE; @@ -18521,7 +18523,7 @@ break; case 574: -#line 3912 "sql_yacc.yy" +#line 3914 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= ENABLE; @@ -18530,7 +18532,7 @@ break; case 575: -#line 3918 "sql_yacc.yy" +#line 3920 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.alter_list.push_back(new Alter_column((yyvsp[(3) - (6)].lex_str).str,(yyvsp[(6) - (6)].item))); @@ -18539,7 +18541,7 @@ break; case 576: -#line 3924 "sql_yacc.yy" +#line 3926 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.alter_list.push_back(new Alter_column((yyvsp[(3) - (5)].lex_str).str, @@ -18549,7 +18551,7 @@ break; case 577: -#line 3931 "sql_yacc.yy" +#line 3933 "sql_yacc.yy" { LEX *lex=Lex; lex->select_lex.db=(yyvsp[(3) - (3)].table)->db.str; @@ -18570,7 +18572,7 @@ break; case 578: -#line 3949 "sql_yacc.yy" +#line 3951 "sql_yacc.yy" { if (!(yyvsp[(4) - (5)].charset)) { @@ -18594,7 +18596,7 @@ break; case 579: -#line 3970 "sql_yacc.yy" +#line 3972 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= ALTER_OPTIONS; @@ -18602,14 +18604,14 @@ break; case 580: -#line 3975 "sql_yacc.yy" +#line 3977 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_FORCE; } break; case 581: -#line 3979 "sql_yacc.yy" +#line 3981 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= ALTER_ORDER; @@ -18617,77 +18619,77 @@ break; case 582: -#line 3985 "sql_yacc.yy" +#line 3987 "sql_yacc.yy" {} break; case 583: -#line 3986 "sql_yacc.yy" +#line 3988 "sql_yacc.yy" {} break; case 584: -#line 3989 "sql_yacc.yy" +#line 3991 "sql_yacc.yy" { Lex->ignore= 0;} break; case 585: -#line 3990 "sql_yacc.yy" +#line 3992 "sql_yacc.yy" { Lex->ignore= 1;} break; case 586: -#line 3994 "sql_yacc.yy" +#line 3996 "sql_yacc.yy" { Lex->drop_mode= DROP_DEFAULT; } break; case 587: -#line 3995 "sql_yacc.yy" +#line 3997 "sql_yacc.yy" { Lex->drop_mode= DROP_RESTRICT; } break; case 588: -#line 3996 "sql_yacc.yy" +#line 3998 "sql_yacc.yy" { Lex->drop_mode= DROP_CASCADE; } break; case 589: -#line 4000 "sql_yacc.yy" +#line 4002 "sql_yacc.yy" {} break; case 590: -#line 4001 "sql_yacc.yy" +#line 4003 "sql_yacc.yy" { store_position_for_column((yyvsp[(2) - (2)].lex_str).str); } break; case 591: -#line 4002 "sql_yacc.yy" +#line 4004 "sql_yacc.yy" { store_position_for_column(first_keyword); } break; case 592: -#line 4005 "sql_yacc.yy" +#line 4007 "sql_yacc.yy" {} break; case 593: -#line 4006 "sql_yacc.yy" +#line 4008 "sql_yacc.yy" {} break; case 594: -#line 4007 "sql_yacc.yy" +#line 4009 "sql_yacc.yy" {} break; case 595: -#line 4008 "sql_yacc.yy" +#line 4010 "sql_yacc.yy" {} break; case 596: -#line 4016 "sql_yacc.yy" +#line 4018 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -18699,12 +18701,12 @@ break; case 597: -#line 4025 "sql_yacc.yy" +#line 4027 "sql_yacc.yy" {} break; case 598: -#line 4027 "sql_yacc.yy" +#line 4029 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -18714,7 +18716,7 @@ break; case 599: -#line 4034 "sql_yacc.yy" +#line 4036 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -18725,12 +18727,12 @@ break; case 600: -#line 4042 "sql_yacc.yy" +#line 4044 "sql_yacc.yy" {} break; case 601: -#line 4044 "sql_yacc.yy" +#line 4046 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -18739,7 +18741,7 @@ break; case 602: -#line 4054 "sql_yacc.yy" +#line 4056 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_BEGIN; @@ -18748,49 +18750,49 @@ break; case 603: -#line 4062 "sql_yacc.yy" +#line 4064 "sql_yacc.yy" { (yyval.num) = 0; } break; case 604: -#line 4064 "sql_yacc.yy" +#line 4066 "sql_yacc.yy" { (yyval.num)= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; } break; case 605: -#line 4070 "sql_yacc.yy" +#line 4072 "sql_yacc.yy" { Lex->slave_thd_opt= 0; } break; case 606: -#line 4072 "sql_yacc.yy" +#line 4074 "sql_yacc.yy" {} break; case 609: -#line 4081 "sql_yacc.yy" +#line 4083 "sql_yacc.yy" {} break; case 610: -#line 4082 "sql_yacc.yy" +#line 4084 "sql_yacc.yy" { Lex->slave_thd_opt|=SLAVE_SQL; } break; case 611: -#line 4083 "sql_yacc.yy" +#line 4085 "sql_yacc.yy" { Lex->slave_thd_opt|=SLAVE_IO; } break; case 612: -#line 4087 "sql_yacc.yy" +#line 4089 "sql_yacc.yy" {} break; case 613: -#line 4089 "sql_yacc.yy" +#line 4091 "sql_yacc.yy" { LEX *lex=Lex; if ((lex->mi.log_file_name || lex->mi.pos) && @@ -18807,35 +18809,35 @@ break; case 616: -#line 4111 "sql_yacc.yy" +#line 4113 "sql_yacc.yy" { Lex->sql_command = SQLCOM_RESTORE_TABLE; } break; case 617: -#line 4115 "sql_yacc.yy" +#line 4117 "sql_yacc.yy" { Lex->backup_dir = (yyvsp[(6) - (6)].lex_str).str; } break; case 618: -#line 4121 "sql_yacc.yy" +#line 4123 "sql_yacc.yy" { Lex->sql_command = SQLCOM_BACKUP_TABLE; } break; case 619: -#line 4125 "sql_yacc.yy" +#line 4127 "sql_yacc.yy" { Lex->backup_dir = (yyvsp[(6) - (6)].lex_str).str; } break; case 620: -#line 4131 "sql_yacc.yy" +#line 4133 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_CHECKSUM; @@ -18843,27 +18845,27 @@ break; case 621: -#line 4136 "sql_yacc.yy" +#line 4138 "sql_yacc.yy" {} break; case 622: -#line 4140 "sql_yacc.yy" +#line 4142 "sql_yacc.yy" { Lex->check_opt.flags= 0; } break; case 623: -#line 4141 "sql_yacc.yy" +#line 4143 "sql_yacc.yy" { Lex->check_opt.flags= T_QUICK; } break; case 624: -#line 4142 "sql_yacc.yy" +#line 4144 "sql_yacc.yy" { Lex->check_opt.flags= T_EXTEND; } break; case 625: -#line 4147 "sql_yacc.yy" +#line 4149 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPAIR; @@ -18873,47 +18875,47 @@ break; case 626: -#line 4154 "sql_yacc.yy" +#line 4156 "sql_yacc.yy" {} break; case 627: -#line 4158 "sql_yacc.yy" +#line 4160 "sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 628: -#line 4159 "sql_yacc.yy" +#line 4161 "sql_yacc.yy" {} break; case 629: -#line 4162 "sql_yacc.yy" +#line 4164 "sql_yacc.yy" {} break; case 630: -#line 4163 "sql_yacc.yy" +#line 4165 "sql_yacc.yy" {} break; case 631: -#line 4166 "sql_yacc.yy" +#line 4168 "sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 632: -#line 4167 "sql_yacc.yy" +#line 4169 "sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 633: -#line 4168 "sql_yacc.yy" +#line 4170 "sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_USEFRM; } break; case 634: -#line 4172 "sql_yacc.yy" +#line 4174 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_ANALYZE; @@ -18923,12 +18925,12 @@ break; case 635: -#line 4179 "sql_yacc.yy" +#line 4181 "sql_yacc.yy" {} break; case 636: -#line 4184 "sql_yacc.yy" +#line 4186 "sql_yacc.yy" { LEX *lex=Lex; @@ -18943,62 +18945,62 @@ break; case 637: -#line 4196 "sql_yacc.yy" +#line 4198 "sql_yacc.yy" {} break; case 638: -#line 4200 "sql_yacc.yy" +#line 4202 "sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 639: -#line 4201 "sql_yacc.yy" +#line 4203 "sql_yacc.yy" {} break; case 640: -#line 4204 "sql_yacc.yy" +#line 4206 "sql_yacc.yy" {} break; case 641: -#line 4205 "sql_yacc.yy" +#line 4207 "sql_yacc.yy" {} break; case 642: -#line 4208 "sql_yacc.yy" +#line 4210 "sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 643: -#line 4209 "sql_yacc.yy" +#line 4211 "sql_yacc.yy" { Lex->check_opt.flags|= T_FAST; } break; case 644: -#line 4210 "sql_yacc.yy" +#line 4212 "sql_yacc.yy" { Lex->check_opt.flags|= T_MEDIUM; } break; case 645: -#line 4211 "sql_yacc.yy" +#line 4213 "sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 646: -#line 4212 "sql_yacc.yy" +#line 4214 "sql_yacc.yy" { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; } break; case 647: -#line 4213 "sql_yacc.yy" +#line 4215 "sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; } break; case 648: -#line 4217 "sql_yacc.yy" +#line 4219 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_OPTIMIZE; @@ -19008,46 +19010,46 @@ break; case 649: -#line 4224 "sql_yacc.yy" +#line 4226 "sql_yacc.yy" {} break; case 650: -#line 4228 "sql_yacc.yy" +#line 4230 "sql_yacc.yy" { (yyval.num)= 0; } break; case 651: -#line 4229 "sql_yacc.yy" +#line 4231 "sql_yacc.yy" { (yyval.num)= 1; } break; case 652: -#line 4230 "sql_yacc.yy" +#line 4232 "sql_yacc.yy" { (yyval.num)= 1; } break; case 653: -#line 4235 "sql_yacc.yy" +#line 4237 "sql_yacc.yy" { Lex->sql_command= SQLCOM_RENAME_TABLE; } break; case 654: -#line 4239 "sql_yacc.yy" +#line 4241 "sql_yacc.yy" {} break; case 655: -#line 4241 "sql_yacc.yy" +#line 4243 "sql_yacc.yy" { Lex->sql_command = SQLCOM_RENAME_USER; } break; case 656: -#line 4248 "sql_yacc.yy" +#line 4250 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (3)].lex_user)) || Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -19055,7 +19057,7 @@ break; case 657: -#line 4253 "sql_yacc.yy" +#line 4255 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (5)].lex_user)) || Lex->users_list.push_back((yyvsp[(5) - (5)].lex_user))) MYSQL_YYABORT; @@ -19063,7 +19065,7 @@ break; case 660: -#line 4265 "sql_yacc.yy" +#line 4267 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sl= lex->current_select; @@ -19076,7 +19078,7 @@ break; case 661: -#line 4277 "sql_yacc.yy" +#line 4279 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE; @@ -19085,7 +19087,7 @@ break; case 664: -#line 4290 "sql_yacc.yy" +#line 4292 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -19098,17 +19100,17 @@ break; case 665: -#line 4302 "sql_yacc.yy" +#line 4304 "sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 666: -#line 4303 "sql_yacc.yy" +#line 4305 "sql_yacc.yy" { (yyval.lex_str) = default_key_cache_base; } break; case 667: -#line 4308 "sql_yacc.yy" +#line 4310 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; @@ -19116,12 +19118,12 @@ break; case 668: -#line 4313 "sql_yacc.yy" +#line 4315 "sql_yacc.yy" {} break; case 671: -#line 4322 "sql_yacc.yy" +#line 4324 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -19134,12 +19136,12 @@ break; case 672: -#line 4334 "sql_yacc.yy" +#line 4336 "sql_yacc.yy" { Select->interval_list.empty(); } break; case 673: -#line 4336 "sql_yacc.yy" +#line 4338 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -19148,12 +19150,12 @@ break; case 674: -#line 4344 "sql_yacc.yy" +#line 4346 "sql_yacc.yy" { Lex->select_lex.use_index_ptr= 0; } break; case 675: -#line 4346 "sql_yacc.yy" +#line 4348 "sql_yacc.yy" { SELECT_LEX *sel= &Lex->select_lex; sel->use_index_ptr= &sel->use_index; @@ -19161,17 +19163,17 @@ break; case 676: -#line 4354 "sql_yacc.yy" +#line 4356 "sql_yacc.yy" { (yyval.num)= 0; } break; case 677: -#line 4355 "sql_yacc.yy" +#line 4357 "sql_yacc.yy" { (yyval.num)= TL_OPTION_IGNORE_LEAVES; } break; case 678: -#line 4365 "sql_yacc.yy" +#line 4367 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -19179,7 +19181,7 @@ break; case 681: -#line 4379 "sql_yacc.yy" +#line 4381 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -19204,7 +19206,7 @@ break; case 683: -#line 4404 "sql_yacc.yy" +#line 4406 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -19223,7 +19225,7 @@ break; case 685: -#line 4423 "sql_yacc.yy" +#line 4425 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -19234,19 +19236,19 @@ break; case 686: -#line 4431 "sql_yacc.yy" +#line 4433 "sql_yacc.yy" { Select->parsing_place= NO_MATTER; } break; case 688: -#line 4437 "sql_yacc.yy" +#line 4439 "sql_yacc.yy" {} break; case 693: -#line 4446 "sql_yacc.yy" +#line 4448 "sql_yacc.yy" { Select->context.table_list= Select->context.first_name_resolution_table= @@ -19255,7 +19257,7 @@ break; case 696: -#line 4461 "sql_yacc.yy" +#line 4463 "sql_yacc.yy" { if (test_all_bits(Select->options, SELECT_ALL | SELECT_DISTINCT)) { @@ -19266,12 +19268,12 @@ break; case 699: -#line 4475 "sql_yacc.yy" +#line 4477 "sql_yacc.yy" { Select->options|= SELECT_STRAIGHT_JOIN; } break; case 700: -#line 4477 "sql_yacc.yy" +#line 4479 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19280,22 +19282,22 @@ break; case 701: -#line 4482 "sql_yacc.yy" +#line 4484 "sql_yacc.yy" { Select->options|= SELECT_DISTINCT; } break; case 702: -#line 4483 "sql_yacc.yy" +#line 4485 "sql_yacc.yy" { Select->options|= SELECT_SMALL_RESULT; } break; case 703: -#line 4484 "sql_yacc.yy" +#line 4486 "sql_yacc.yy" { Select->options|= SELECT_BIG_RESULT; } break; case 704: -#line 4486 "sql_yacc.yy" +#line 4488 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19304,7 +19306,7 @@ break; case 705: -#line 4492 "sql_yacc.yy" +#line 4494 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19313,7 +19315,7 @@ break; case 706: -#line 4498 "sql_yacc.yy" +#line 4500 "sql_yacc.yy" { Lex->safe_to_cache_query=0; Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE; @@ -19322,7 +19324,7 @@ break; case 707: -#line 4504 "sql_yacc.yy" +#line 4506 "sql_yacc.yy" { /* Honor this flag only if SQL_NO_CACHE wasn't specified AND @@ -19339,12 +19341,12 @@ break; case 708: -#line 4517 "sql_yacc.yy" +#line 4519 "sql_yacc.yy" { Select->options|= SELECT_ALL; } break; case 710: -#line 4523 "sql_yacc.yy" +#line 4525 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select->set_lock_for_tables(TL_WRITE); @@ -19353,7 +19355,7 @@ break; case 711: -#line 4529 "sql_yacc.yy" +#line 4531 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select-> @@ -19363,7 +19365,7 @@ break; case 714: -#line 4541 "sql_yacc.yy" +#line 4543 "sql_yacc.yy" { THD *thd= YYTHD; if (add_item_to_list(thd, @@ -19376,7 +19378,7 @@ break; case 715: -#line 4554 "sql_yacc.yy" +#line 4556 "sql_yacc.yy" { THD *thd= YYTHD; DBUG_ASSERT((yyvsp[(1) - (4)].simple_string) < (yyvsp[(3) - (4)].simple_string)); @@ -19396,7 +19398,7 @@ break; case 716: -#line 4573 "sql_yacc.yy" +#line 4575 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; @@ -19405,7 +19407,7 @@ break; case 717: -#line 4580 "sql_yacc.yy" +#line 4582 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; @@ -19414,52 +19416,52 @@ break; case 718: -#line 4587 "sql_yacc.yy" +#line 4589 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 719: -#line 4588 "sql_yacc.yy" +#line 4590 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 720: -#line 4591 "sql_yacc.yy" +#line 4593 "sql_yacc.yy" { (yyval.lex_str)=null_lex_str;} break; case 721: -#line 4592 "sql_yacc.yy" +#line 4594 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 722: -#line 4593 "sql_yacc.yy" +#line 4595 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 723: -#line 4594 "sql_yacc.yy" +#line 4596 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 724: -#line 4595 "sql_yacc.yy" +#line 4597 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 725: -#line 4599 "sql_yacc.yy" +#line 4601 "sql_yacc.yy" {} break; case 726: -#line 4600 "sql_yacc.yy" +#line 4602 "sql_yacc.yy" {} break; case 727: -#line 4605 "sql_yacc.yy" +#line 4607 "sql_yacc.yy" { /* Design notes: @@ -19511,7 +19513,7 @@ break; case 728: -#line 4654 "sql_yacc.yy" +#line 4656 "sql_yacc.yy" { /* XOR is a proprietary extension */ (yyval.item) = new (YYTHD->mem_root) Item_cond_xor((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item)); @@ -19519,7 +19521,7 @@ break; case 729: -#line 4659 "sql_yacc.yy" +#line 4661 "sql_yacc.yy" { /* See comments in rule expr: expr or expr */ Item_cond_and *item1; @@ -19563,74 +19565,74 @@ break; case 730: -#line 4700 "sql_yacc.yy" +#line 4702 "sql_yacc.yy" { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); } break; case 731: -#line 4702 "sql_yacc.yy" +#line 4704 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_istrue((yyvsp[(1) - (3)].item)); } break; case 732: -#line 4704 "sql_yacc.yy" +#line 4706 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnottrue((yyvsp[(1) - (4)].item)); } break; case 733: -#line 4706 "sql_yacc.yy" +#line 4708 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isfalse((yyvsp[(1) - (3)].item)); } break; case 734: -#line 4708 "sql_yacc.yy" +#line 4710 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnotfalse((yyvsp[(1) - (4)].item)); } break; case 735: -#line 4710 "sql_yacc.yy" +#line 4712 "sql_yacc.yy" { (yyval.item)= new Item_func_isnull((yyvsp[(1) - (3)].item)); } break; case 736: -#line 4712 "sql_yacc.yy" +#line 4714 "sql_yacc.yy" { (yyval.item)= new Item_func_isnotnull((yyvsp[(1) - (4)].item)); } break; case 738: -#line 4718 "sql_yacc.yy" +#line 4720 "sql_yacc.yy" { (yyval.item)= new Item_func_isnull((yyvsp[(1) - (3)].item)); } break; case 739: -#line 4720 "sql_yacc.yy" +#line 4722 "sql_yacc.yy" { (yyval.item)= new Item_func_isnotnull((yyvsp[(1) - (4)].item)); } break; case 740: -#line 4722 "sql_yacc.yy" +#line 4724 "sql_yacc.yy" { (yyval.item)= new Item_func_equal((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 741: -#line 4724 "sql_yacc.yy" +#line 4726 "sql_yacc.yy" { (yyval.item)= (*(yyvsp[(2) - (3)].boolfunc2creator))(0)->create((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 742: -#line 4726 "sql_yacc.yy" +#line 4728 "sql_yacc.yy" { (yyval.item)= all_any_subquery_creator((yyvsp[(1) - (6)].item), (yyvsp[(2) - (6)].boolfunc2creator), (yyvsp[(3) - (6)].num), (yyvsp[(5) - (6)].select_lex)); } break; case 744: -#line 4731 "sql_yacc.yy" +#line 4733 "sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_in_subselect((yyvsp[(1) - (5)].item), (yyvsp[(4) - (5)].select_lex)); } break; case 745: -#line 4735 "sql_yacc.yy" +#line 4737 "sql_yacc.yy" { THD *thd= YYTHD; Item *item= new (thd->mem_root) Item_in_subselect((yyvsp[(1) - (6)].item), (yyvsp[(5) - (6)].select_lex)); @@ -19639,14 +19641,14 @@ break; case 746: -#line 4741 "sql_yacc.yy" +#line 4743 "sql_yacc.yy" { (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (5)].item), true, (yyvsp[(4) - (5)].item)); } break; case 747: -#line 4745 "sql_yacc.yy" +#line 4747 "sql_yacc.yy" { (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(4) - (7)].item)); (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(1) - (7)].item)); @@ -19655,14 +19657,14 @@ break; case 748: -#line 4751 "sql_yacc.yy" +#line 4753 "sql_yacc.yy" { (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (6)].item), false, (yyvsp[(5) - (6)].item)); } break; case 749: -#line 4755 "sql_yacc.yy" +#line 4757 "sql_yacc.yy" { (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(5) - (8)].item)); (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(1) - (8)].item)); @@ -19673,12 +19675,12 @@ break; case 750: -#line 4763 "sql_yacc.yy" +#line 4765 "sql_yacc.yy" { (yyval.item)= new Item_func_between((yyvsp[(1) - (5)].item),(yyvsp[(3) - (5)].item),(yyvsp[(5) - (5)].item)); } break; case 751: -#line 4765 "sql_yacc.yy" +#line 4767 "sql_yacc.yy" { Item_func_between *item= new Item_func_between((yyvsp[(1) - (6)].item),(yyvsp[(4) - (6)].item),(yyvsp[(6) - (6)].item)); item->negate(); @@ -19687,148 +19689,148 @@ break; case 752: -#line 4771 "sql_yacc.yy" +#line 4773 "sql_yacc.yy" { (yyval.item)= new Item_func_eq(new Item_func_soundex((yyvsp[(1) - (4)].item)), new Item_func_soundex((yyvsp[(4) - (4)].item))); } break; case 753: -#line 4774 "sql_yacc.yy" +#line 4776 "sql_yacc.yy" { (yyval.item)= new Item_func_like((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].item),Lex->escape_used); } break; case 754: -#line 4776 "sql_yacc.yy" +#line 4778 "sql_yacc.yy" { (yyval.item)= new Item_func_not(new Item_func_like((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].item), Lex->escape_used)); } break; case 755: -#line 4777 "sql_yacc.yy" +#line 4779 "sql_yacc.yy" { (yyval.item)= new Item_func_regex((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 756: -#line 4779 "sql_yacc.yy" +#line 4781 "sql_yacc.yy" { (yyval.item)= negate_expression(YYTHD, new Item_func_regex((yyvsp[(1) - (4)].item),(yyvsp[(4) - (4)].item))); } break; case 758: -#line 4784 "sql_yacc.yy" +#line 4786 "sql_yacc.yy" { (yyval.item)= new Item_func_bit_or((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 759: -#line 4786 "sql_yacc.yy" +#line 4788 "sql_yacc.yy" { (yyval.item)= new Item_func_bit_and((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 760: -#line 4788 "sql_yacc.yy" +#line 4790 "sql_yacc.yy" { (yyval.item)= new Item_func_shift_left((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 761: -#line 4790 "sql_yacc.yy" +#line 4792 "sql_yacc.yy" { (yyval.item)= new Item_func_shift_right((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 762: -#line 4792 "sql_yacc.yy" +#line 4794 "sql_yacc.yy" { (yyval.item)= new Item_func_plus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 763: -#line 4794 "sql_yacc.yy" +#line 4796 "sql_yacc.yy" { (yyval.item)= new Item_func_minus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 764: -#line 4796 "sql_yacc.yy" +#line 4798 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].interval),0); } break; case 765: -#line 4798 "sql_yacc.yy" +#line 4800 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].interval),1); } break; case 766: -#line 4800 "sql_yacc.yy" +#line 4802 "sql_yacc.yy" { (yyval.item)= new Item_func_mul((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 767: -#line 4802 "sql_yacc.yy" +#line 4804 "sql_yacc.yy" { (yyval.item)= new Item_func_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 768: -#line 4804 "sql_yacc.yy" +#line 4806 "sql_yacc.yy" { (yyval.item)= new Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 769: -#line 4806 "sql_yacc.yy" +#line 4808 "sql_yacc.yy" { (yyval.item)= new Item_func_int_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 770: -#line 4808 "sql_yacc.yy" +#line 4810 "sql_yacc.yy" { (yyval.item)= new Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 771: -#line 4810 "sql_yacc.yy" +#line 4812 "sql_yacc.yy" { (yyval.item)= new Item_func_bit_xor((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 781: -#line 4819 "sql_yacc.yy" +#line 4821 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_eq_creator; } break; case 782: -#line 4820 "sql_yacc.yy" +#line 4822 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_ge_creator; } break; case 783: -#line 4821 "sql_yacc.yy" +#line 4823 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_gt_creator; } break; case 784: -#line 4822 "sql_yacc.yy" +#line 4824 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_le_creator; } break; case 785: -#line 4823 "sql_yacc.yy" +#line 4825 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_lt_creator; } break; case 786: -#line 4824 "sql_yacc.yy" +#line 4826 "sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_ne_creator; } break; case 787: -#line 4827 "sql_yacc.yy" +#line 4829 "sql_yacc.yy" { (yyval.num) = 1; } break; case 788: -#line 4828 "sql_yacc.yy" +#line 4830 "sql_yacc.yy" { (yyval.num) = 0; } break; case 789: -#line 4833 "sql_yacc.yy" +#line 4835 "sql_yacc.yy" { (yyval.item)=(yyvsp[(2) - (2)].item); } break; case 791: -#line 4839 "sql_yacc.yy" +#line 4841 "sql_yacc.yy" { (yyval.item)= new Item_func_set_collation((yyvsp[(1) - (3)].item), new Item_string((yyvsp[(3) - (3)].lex_str).str, @@ -19838,44 +19840,44 @@ break; case 796: -#line 4850 "sql_yacc.yy" +#line 4852 "sql_yacc.yy" { (yyval.item)= new Item_func_concat((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item)); } break; case 797: -#line 4851 "sql_yacc.yy" +#line 4853 "sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 798: -#line 4852 "sql_yacc.yy" +#line 4854 "sql_yacc.yy" { (yyval.item)= new Item_func_neg((yyvsp[(2) - (2)].item)); } break; case 799: -#line 4853 "sql_yacc.yy" +#line 4855 "sql_yacc.yy" { (yyval.item)= new Item_func_bit_neg((yyvsp[(2) - (2)].item)); } break; case 800: -#line 4854 "sql_yacc.yy" +#line 4856 "sql_yacc.yy" { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); } break; case 801: -#line 4856 "sql_yacc.yy" +#line 4858 "sql_yacc.yy" { (yyval.item)= new Item_singlerow_subselect((yyvsp[(2) - (3)].select_lex)); } break; case 802: -#line 4859 "sql_yacc.yy" +#line 4861 "sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (3)].item); } break; case 803: -#line 4861 "sql_yacc.yy" +#line 4863 "sql_yacc.yy" { (yyvsp[(4) - (5)].item_list)->push_front((yyvsp[(2) - (5)].item)); (yyval.item)= new Item_row(*(yyvsp[(4) - (5)].item_list)); @@ -19883,7 +19885,7 @@ break; case 804: -#line 4866 "sql_yacc.yy" +#line 4868 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_row(*(yyvsp[(5) - (6)].item_list)); @@ -19891,38 +19893,38 @@ break; case 805: -#line 4871 "sql_yacc.yy" +#line 4873 "sql_yacc.yy" { (yyval.item)= new Item_exists_subselect((yyvsp[(3) - (4)].select_lex)); } break; case 806: -#line 4874 "sql_yacc.yy" +#line 4876 "sql_yacc.yy" { (yyval.item)= (yyvsp[(3) - (4)].item); } break; case 807: -#line 4876 "sql_yacc.yy" +#line 4878 "sql_yacc.yy" { (yyvsp[(2) - (7)].item_list)->push_front((yyvsp[(5) - (7)].item)); Select->add_ftfunc_to_list((Item_func_match*) ((yyval.item)=new Item_func_match(*(yyvsp[(2) - (7)].item_list),(yyvsp[(6) - (7)].num)))); } break; case 808: -#line 4879 "sql_yacc.yy" +#line 4881 "sql_yacc.yy" { (yyval.item)= new Item_func_ascii((yyvsp[(3) - (4)].item)); } break; case 809: -#line 4881 "sql_yacc.yy" +#line 4883 "sql_yacc.yy" { (yyval.item)= create_func_cast((yyvsp[(2) - (2)].item), ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); } break; case 810: -#line 4885 "sql_yacc.yy" +#line 4887 "sql_yacc.yy" { LEX *lex= Lex; (yyval.item)= create_func_cast((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), lex->length, lex->dec, lex->charset); @@ -19932,12 +19934,12 @@ break; case 811: -#line 4892 "sql_yacc.yy" +#line 4894 "sql_yacc.yy" { (yyval.item)= new Item_func_case(* (yyvsp[(3) - (5)].item_list), (yyvsp[(2) - (5)].item), (yyvsp[(4) - (5)].item) ); } break; case 812: -#line 4894 "sql_yacc.yy" +#line 4896 "sql_yacc.yy" { (yyval.item)= create_func_cast((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), Lex->length, Lex->dec, Lex->charset); if (!(yyval.item)) @@ -19946,12 +19948,12 @@ break; case 813: -#line 4900 "sql_yacc.yy" +#line 4902 "sql_yacc.yy" { (yyval.item)= new Item_func_conv_charset((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].charset)); } break; case 814: -#line 4902 "sql_yacc.yy" +#line 4904 "sql_yacc.yy" { if ((yyvsp[(3) - (4)].item)->is_splocal()) { @@ -19965,12 +19967,12 @@ break; case 815: -#line 4913 "sql_yacc.yy" +#line 4915 "sql_yacc.yy" { (yyval.item)= new Item_insert_value(Lex->current_context(), (yyvsp[(3) - (4)].item)); } break; case 816: -#line 4915 "sql_yacc.yy" +#line 4917 "sql_yacc.yy" { if (!(yyvsp[(1) - (3)].symbol).symbol->create_func) { @@ -19984,7 +19986,7 @@ break; case 817: -#line 4926 "sql_yacc.yy" +#line 4928 "sql_yacc.yy" { if (!(yyvsp[(1) - (4)].symbol).symbol->create_func) { @@ -19998,7 +20000,7 @@ break; case 818: -#line 4937 "sql_yacc.yy" +#line 4939 "sql_yacc.yy" { if (!(yyvsp[(1) - (6)].symbol).symbol->create_func) { @@ -20012,7 +20014,7 @@ break; case 819: -#line 4948 "sql_yacc.yy" +#line 4950 "sql_yacc.yy" { if (!(yyvsp[(1) - (8)].symbol).symbol->create_func) { @@ -20026,67 +20028,67 @@ break; case 820: -#line 4959 "sql_yacc.yy" +#line 4961 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 0);} break; case 821: -#line 4961 "sql_yacc.yy" +#line 4963 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 0); } break; case 822: -#line 4963 "sql_yacc.yy" +#line 4965 "sql_yacc.yy" { (yyval.item)= new Item_func_repeat((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 823: -#line 4965 "sql_yacc.yy" +#line 4967 "sql_yacc.yy" { (yyval.item)= new Item_func_atan((yyvsp[(3) - (4)].item)); } break; case 824: -#line 4967 "sql_yacc.yy" +#line 4969 "sql_yacc.yy" { (yyval.item)= new Item_func_atan((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 825: -#line 4969 "sql_yacc.yy" +#line 4971 "sql_yacc.yy" { (yyval.item)= new Item_func_char(*(yyvsp[(3) - (4)].item_list)); } break; case 826: -#line 4971 "sql_yacc.yy" +#line 4973 "sql_yacc.yy" { (yyval.item)= new Item_func_char(*(yyvsp[(3) - (6)].item_list), (yyvsp[(5) - (6)].charset)); } break; case 827: -#line 4973 "sql_yacc.yy" +#line 4975 "sql_yacc.yy" { (yyval.item)= new Item_func_charset((yyvsp[(3) - (4)].item)); } break; case 828: -#line 4975 "sql_yacc.yy" +#line 4977 "sql_yacc.yy" { (yyval.item)= new Item_func_coalesce(* (yyvsp[(3) - (4)].item_list)); } break; case 829: -#line 4977 "sql_yacc.yy" +#line 4979 "sql_yacc.yy" { (yyval.item)= new Item_func_collation((yyvsp[(3) - (4)].item)); } break; case 830: -#line 4979 "sql_yacc.yy" +#line 4981 "sql_yacc.yy" { (yyval.item)= new Item_func_concat(* (yyvsp[(3) - (4)].item_list)); } break; case 831: -#line 4981 "sql_yacc.yy" +#line 4983 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_concat_ws(*(yyvsp[(5) - (6)].item_list)); } break; case 832: -#line 4983 "sql_yacc.yy" +#line 4985 "sql_yacc.yy" { if (Lex->add_time_zone_tables_to_query_tables(YYTHD)) MYSQL_YYABORT; @@ -20095,17 +20097,17 @@ break; case 833: -#line 4989 "sql_yacc.yy" +#line 4991 "sql_yacc.yy" { (yyval.item)= new Item_func_curdate_local(); Lex->safe_to_cache_query=0; } break; case 834: -#line 4991 "sql_yacc.yy" +#line 4993 "sql_yacc.yy" { (yyval.item)= new Item_func_curtime_local(); Lex->safe_to_cache_query=0; } break; case 835: -#line 4993 "sql_yacc.yy" +#line 4995 "sql_yacc.yy" { (yyval.item)= new Item_func_curtime_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0; @@ -20113,7 +20115,7 @@ break; case 836: -#line 4998 "sql_yacc.yy" +#line 5000 "sql_yacc.yy" { (yyval.item)= new Item_func_current_user(Lex->current_context()); Lex->safe_to_cache_query= 0; @@ -20121,17 +20123,17 @@ break; case 837: -#line 5003 "sql_yacc.yy" +#line 5005 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (7)].item),(yyvsp[(5) - (7)].item),(yyvsp[(6) - (7)].interval),0); } break; case 838: -#line 5005 "sql_yacc.yy" +#line 5007 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (7)].item),(yyvsp[(5) - (7)].item),(yyvsp[(6) - (7)].interval),1); } break; case 839: -#line 5007 "sql_yacc.yy" +#line 5009 "sql_yacc.yy" { (yyval.item)= new Item_func_database(); Lex->safe_to_cache_query=0; @@ -20139,27 +20141,27 @@ break; case 840: -#line 5012 "sql_yacc.yy" +#line 5014 "sql_yacc.yy" { (yyval.item)= new Item_date_typecast((yyvsp[(3) - (4)].item)); } break; case 841: -#line 5014 "sql_yacc.yy" +#line 5016 "sql_yacc.yy" { (yyval.item)= new Item_func_dayofmonth((yyvsp[(3) - (4)].item)); } break; case 842: -#line 5016 "sql_yacc.yy" +#line 5018 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_elt(*(yyvsp[(5) - (6)].item_list)); } break; case 843: -#line 5018 "sql_yacc.yy" +#line 5020 "sql_yacc.yy" { (yyval.item)= new Item_func_make_set((yyvsp[(3) - (6)].item), *(yyvsp[(5) - (6)].item_list)); } break; case 844: -#line 5020 "sql_yacc.yy" +#line 5022 "sql_yacc.yy" { (yyval.item)= new Item_func_encrypt((yyvsp[(3) - (4)].item)); Lex->uncacheable(UNCACHEABLE_RAND); @@ -20167,79 +20169,79 @@ break; case 845: -#line 5024 "sql_yacc.yy" +#line 5026 "sql_yacc.yy" { (yyval.item)= new Item_func_encrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 846: -#line 5026 "sql_yacc.yy" +#line 5028 "sql_yacc.yy" { (yyval.item)= new Item_func_decode((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].lex_str).str); } break; case 847: -#line 5028 "sql_yacc.yy" +#line 5030 "sql_yacc.yy" { (yyval.item)= new Item_func_encode((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].lex_str).str); } break; case 848: -#line 5030 "sql_yacc.yy" +#line 5032 "sql_yacc.yy" { (yyval.item)= new Item_func_des_decrypt((yyvsp[(3) - (4)].item)); } break; case 849: -#line 5032 "sql_yacc.yy" +#line 5034 "sql_yacc.yy" { (yyval.item)= new Item_func_des_decrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 850: -#line 5034 "sql_yacc.yy" +#line 5036 "sql_yacc.yy" { (yyval.item)= new Item_func_des_encrypt((yyvsp[(3) - (4)].item)); } break; case 851: -#line 5036 "sql_yacc.yy" +#line 5038 "sql_yacc.yy" { (yyval.item)= new Item_func_des_encrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 852: -#line 5038 "sql_yacc.yy" +#line 5040 "sql_yacc.yy" { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); } break; case 853: -#line 5040 "sql_yacc.yy" +#line 5042 "sql_yacc.yy" { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (10)].item), (yyvsp[(5) - (10)].item), (yyvsp[(7) - (10)].item), (yyvsp[(9) - (10)].item)); } break; case 854: -#line 5042 "sql_yacc.yy" +#line 5044 "sql_yacc.yy" { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (12)].item), (yyvsp[(5) - (12)].item), (yyvsp[(7) - (12)].item), (yyvsp[(9) - (12)].item), (yyvsp[(11) - (12)].item)); } break; case 855: -#line 5044 "sql_yacc.yy" +#line 5046 "sql_yacc.yy" { (yyval.item)= new Item_func_format((yyvsp[(3) - (6)].item),atoi((yyvsp[(5) - (6)].lex_str).str)); } break; case 856: -#line 5046 "sql_yacc.yy" +#line 5048 "sql_yacc.yy" { (yyval.item)= new Item_func_from_unixtime((yyvsp[(3) - (4)].item)); } break; case 857: -#line 5048 "sql_yacc.yy" +#line 5050 "sql_yacc.yy" { (yyval.item)= new Item_func_date_format (new Item_func_from_unixtime((yyvsp[(3) - (6)].item)),(yyvsp[(5) - (6)].item),0); } break; case 858: -#line 5052 "sql_yacc.yy" +#line 5054 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_field(*(yyvsp[(5) - (6)].item_list)); } break; case 859: -#line 5054 "sql_yacc.yy" +#line 5056 "sql_yacc.yy" { #ifdef HAVE_SPATIAL (yyval.item)= (yyvsp[(1) - (1)].item); @@ -20252,32 +20254,32 @@ break; case 860: -#line 5064 "sql_yacc.yy" +#line 5066 "sql_yacc.yy" { (yyval.item)= new Item_func_get_format((yyvsp[(3) - (6)].date_time_type), (yyvsp[(5) - (6)].item)); } break; case 861: -#line 5066 "sql_yacc.yy" +#line 5068 "sql_yacc.yy" { (yyval.item)= new Item_func_hour((yyvsp[(3) - (4)].item)); } break; case 862: -#line 5068 "sql_yacc.yy" +#line 5070 "sql_yacc.yy" { (yyval.item)= new Item_func_if((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 863: -#line 5070 "sql_yacc.yy" +#line 5072 "sql_yacc.yy" { (yyval.item)= new Item_func_insert((yyvsp[(3) - (10)].item),(yyvsp[(5) - (10)].item),(yyvsp[(7) - (10)].item),(yyvsp[(9) - (10)].item)); } break; case 864: -#line 5073 "sql_yacc.yy" +#line 5075 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(4) - (4)].item),(yyvsp[(1) - (4)].item),(yyvsp[(2) - (4)].interval),0); } break; case 865: -#line 5075 "sql_yacc.yy" +#line 5077 "sql_yacc.yy" { if ((yyvsp[(1) - (1)].item)->type() != Item::ROW_ITEM) { @@ -20289,7 +20291,7 @@ break; case 866: -#line 5084 "sql_yacc.yy" +#line 5086 "sql_yacc.yy" { (yyval.item)= new Item_func_last_insert_id(); Lex->safe_to_cache_query= 0; @@ -20297,7 +20299,7 @@ break; case 867: -#line 5089 "sql_yacc.yy" +#line 5091 "sql_yacc.yy" { (yyval.item)= new Item_func_last_insert_id((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query= 0; @@ -20305,42 +20307,42 @@ break; case 868: -#line 5094 "sql_yacc.yy" +#line 5096 "sql_yacc.yy" { (yyval.item)= new Item_func_left((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 869: -#line 5096 "sql_yacc.yy" +#line 5098 "sql_yacc.yy" { (yyval.item)= new Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 870: -#line 5098 "sql_yacc.yy" +#line 5100 "sql_yacc.yy" { (yyval.item)= new Item_func_locate((yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 871: -#line 5100 "sql_yacc.yy" +#line 5102 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_max(*(yyvsp[(5) - (6)].item_list)); } break; case 872: -#line 5102 "sql_yacc.yy" +#line 5104 "sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_min(*(yyvsp[(5) - (6)].item_list)); } break; case 873: -#line 5104 "sql_yacc.yy" +#line 5106 "sql_yacc.yy" { (yyval.item)= new Item_func_log((yyvsp[(3) - (4)].item)); } break; case 874: -#line 5106 "sql_yacc.yy" +#line 5108 "sql_yacc.yy" { (yyval.item)= new Item_func_log((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 875: -#line 5108 "sql_yacc.yy" +#line 5110 "sql_yacc.yy" { (yyval.item)= new Item_master_pos_wait((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); Lex->safe_to_cache_query=0; @@ -20348,7 +20350,7 @@ break; case 876: -#line 5113 "sql_yacc.yy" +#line 5115 "sql_yacc.yy" { (yyval.item)= new Item_master_pos_wait((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); Lex->safe_to_cache_query=0; @@ -20356,37 +20358,37 @@ break; case 877: -#line 5118 "sql_yacc.yy" +#line 5120 "sql_yacc.yy" { (yyval.item)= new Item_func_microsecond((yyvsp[(3) - (4)].item)); } break; case 878: -#line 5120 "sql_yacc.yy" +#line 5122 "sql_yacc.yy" { (yyval.item)= new Item_func_minute((yyvsp[(3) - (4)].item)); } break; case 879: -#line 5122 "sql_yacc.yy" +#line 5124 "sql_yacc.yy" { (yyval.item) = new Item_func_mod( (yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 880: -#line 5124 "sql_yacc.yy" +#line 5126 "sql_yacc.yy" { (yyval.item)= new Item_func_month((yyvsp[(3) - (4)].item)); } break; case 881: -#line 5126 "sql_yacc.yy" +#line 5128 "sql_yacc.yy" { (yyval.item)= new Item_func_now_local(); Lex->safe_to_cache_query=0;} break; case 882: -#line 5128 "sql_yacc.yy" +#line 5130 "sql_yacc.yy" { (yyval.item)= new Item_func_now_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0;} break; case 883: -#line 5130 "sql_yacc.yy" +#line 5132 "sql_yacc.yy" { (yyval.item)= YYTHD->variables.old_passwords ? (Item *) new Item_func_old_password((yyvsp[(3) - (4)].item)) : @@ -20395,52 +20397,52 @@ break; case 884: -#line 5136 "sql_yacc.yy" +#line 5138 "sql_yacc.yy" { (yyval.item)= new Item_func_old_password((yyvsp[(3) - (4)].item)); } break; case 885: -#line 5138 "sql_yacc.yy" +#line 5140 "sql_yacc.yy" { (yyval.item) = new Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 886: -#line 5140 "sql_yacc.yy" +#line 5142 "sql_yacc.yy" { (yyval.item) = new Item_func_quarter((yyvsp[(3) - (4)].item)); } break; case 887: -#line 5142 "sql_yacc.yy" +#line 5144 "sql_yacc.yy" { (yyval.item)= new Item_func_rand((yyvsp[(3) - (4)].item)); Lex->uncacheable(UNCACHEABLE_RAND);} break; case 888: -#line 5144 "sql_yacc.yy" +#line 5146 "sql_yacc.yy" { (yyval.item)= new Item_func_rand(); Lex->uncacheable(UNCACHEABLE_RAND);} break; case 889: -#line 5146 "sql_yacc.yy" +#line 5148 "sql_yacc.yy" { (yyval.item)= new Item_func_replace((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 890: -#line 5148 "sql_yacc.yy" +#line 5150 "sql_yacc.yy" { (yyval.item)= new Item_func_right((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 891: -#line 5150 "sql_yacc.yy" +#line 5152 "sql_yacc.yy" { (yyval.item)= new Item_func_round((yyvsp[(3) - (4)].item), new Item_int((char*)"0",0,1),0); } break; case 892: -#line 5151 "sql_yacc.yy" +#line 5153 "sql_yacc.yy" { (yyval.item)= new Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),0); } break; case 893: -#line 5153 "sql_yacc.yy" +#line 5155 "sql_yacc.yy" { (yyval.item)= new Item_func_row_count(); Lex->safe_to_cache_query= 0; @@ -20449,7 +20451,7 @@ break; case 894: -#line 5159 "sql_yacc.yy" +#line 5161 "sql_yacc.yy" { (yyval.item)= new Item_func_senna_kwic(* (yyvsp[(3) - (4)].item_list)); #endif @@ -20457,47 +20459,47 @@ break; case 895: -#line 5164 "sql_yacc.yy" +#line 5166 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 1);} break; case 896: -#line 5166 "sql_yacc.yy" +#line 5168 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 1); } break; case 897: -#line 5168 "sql_yacc.yy" +#line 5170 "sql_yacc.yy" { (yyval.item)= new Item_func_second((yyvsp[(3) - (4)].item)); } break; case 898: -#line 5170 "sql_yacc.yy" +#line 5172 "sql_yacc.yy" { (yyval.item)= new Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 899: -#line 5172 "sql_yacc.yy" +#line 5174 "sql_yacc.yy" { (yyval.item)= new Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 900: -#line 5174 "sql_yacc.yy" +#line 5176 "sql_yacc.yy" { (yyval.item)= new Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 901: -#line 5176 "sql_yacc.yy" +#line 5178 "sql_yacc.yy" { (yyval.item)= new Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 902: -#line 5178 "sql_yacc.yy" +#line 5180 "sql_yacc.yy" { (yyval.item)= new Item_func_substr_index((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 903: -#line 5180 "sql_yacc.yy" +#line 5182 "sql_yacc.yy" { if (global_system_variables.sysdate_is_now == 0) (yyval.item)= new Item_func_sysdate_local(); @@ -20507,7 +20509,7 @@ break; case 904: -#line 5187 "sql_yacc.yy" +#line 5189 "sql_yacc.yy" { if (global_system_variables.sysdate_is_now == 0) (yyval.item)= new Item_func_sysdate_local((yyvsp[(3) - (4)].item)); @@ -20517,77 +20519,77 @@ break; case 905: -#line 5194 "sql_yacc.yy" +#line 5196 "sql_yacc.yy" { (yyval.item)= new Item_time_typecast((yyvsp[(3) - (4)].item)); } break; case 906: -#line 5196 "sql_yacc.yy" +#line 5198 "sql_yacc.yy" { (yyval.item)= new Item_datetime_typecast((yyvsp[(3) - (4)].item)); } break; case 907: -#line 5198 "sql_yacc.yy" +#line 5200 "sql_yacc.yy" { (yyval.item)= new Item_func_add_time((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), 1, 0); } break; case 908: -#line 5200 "sql_yacc.yy" +#line 5202 "sql_yacc.yy" { (yyval.item)= new Item_date_add_interval((yyvsp[(7) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].interval_time_st),0); } break; case 909: -#line 5202 "sql_yacc.yy" +#line 5204 "sql_yacc.yy" { (yyval.item)= new Item_func_timestamp_diff((yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item),(yyvsp[(3) - (8)].interval_time_st)); } break; case 910: -#line 5204 "sql_yacc.yy" +#line 5206 "sql_yacc.yy" { (yyval.item)= new Item_func_trim((yyvsp[(3) - (4)].item)); } break; case 911: -#line 5206 "sql_yacc.yy" +#line 5208 "sql_yacc.yy" { (yyval.item)= new Item_func_ltrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 912: -#line 5208 "sql_yacc.yy" +#line 5210 "sql_yacc.yy" { (yyval.item)= new Item_func_rtrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 913: -#line 5210 "sql_yacc.yy" +#line 5212 "sql_yacc.yy" { (yyval.item)= new Item_func_trim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 914: -#line 5212 "sql_yacc.yy" +#line 5214 "sql_yacc.yy" { (yyval.item)= new Item_func_ltrim((yyvsp[(5) - (6)].item)); } break; case 915: -#line 5214 "sql_yacc.yy" +#line 5216 "sql_yacc.yy" { (yyval.item)= new Item_func_rtrim((yyvsp[(5) - (6)].item)); } break; case 916: -#line 5216 "sql_yacc.yy" +#line 5218 "sql_yacc.yy" { (yyval.item)= new Item_func_trim((yyvsp[(5) - (6)].item)); } break; case 917: -#line 5218 "sql_yacc.yy" +#line 5220 "sql_yacc.yy" { (yyval.item)= new Item_func_trim((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 918: -#line 5220 "sql_yacc.yy" +#line 5222 "sql_yacc.yy" { (yyval.item)= new Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),1); } break; case 919: -#line 5222 "sql_yacc.yy" +#line 5224 "sql_yacc.yy" { LEX *lex= Lex; sp_name *name= new sp_name((yyvsp[(1) - (6)].lex_str), (yyvsp[(3) - (6)].lex_str), true); @@ -20603,7 +20605,7 @@ break; case 920: -#line 5235 "sql_yacc.yy" +#line 5237 "sql_yacc.yy" { #ifdef HAVE_DLOPEN udf_func *udf= 0; @@ -20624,7 +20626,7 @@ break; case 921: -#line 5253 "sql_yacc.yy" +#line 5255 "sql_yacc.yy" { LEX *lex= Lex; #ifdef HAVE_DLOPEN @@ -20726,14 +20728,14 @@ break; case 922: -#line 5352 "sql_yacc.yy" +#line 5354 "sql_yacc.yy" { (yyval.item)= new Item_func_unique_users((yyvsp[(3) - (10)].item),atoi((yyvsp[(5) - (10)].lex_str).str),atoi((yyvsp[(7) - (10)].lex_str).str), * (yyvsp[(9) - (10)].item_list)); } break; case 923: -#line 5356 "sql_yacc.yy" +#line 5358 "sql_yacc.yy" { (yyval.item)= new Item_func_unix_timestamp(); Lex->safe_to_cache_query=0; @@ -20741,32 +20743,32 @@ break; case 924: -#line 5361 "sql_yacc.yy" +#line 5363 "sql_yacc.yy" { (yyval.item)= new Item_func_unix_timestamp((yyvsp[(3) - (4)].item)); } break; case 925: -#line 5363 "sql_yacc.yy" +#line 5365 "sql_yacc.yy" { (yyval.item)= new Item_func_user(); Lex->safe_to_cache_query=0; } break; case 926: -#line 5365 "sql_yacc.yy" +#line 5367 "sql_yacc.yy" { (yyval.item)= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;} break; case 927: -#line 5367 "sql_yacc.yy" +#line 5369 "sql_yacc.yy" { (yyval.item)= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;} break; case 928: -#line 5369 "sql_yacc.yy" +#line 5371 "sql_yacc.yy" { (yyval.item)= new Item_func_now_utc(); Lex->safe_to_cache_query=0;} break; case 929: -#line 5371 "sql_yacc.yy" +#line 5373 "sql_yacc.yy" { (yyval.item)= new Item_func_week((yyvsp[(3) - (4)].item),new Item_int((char*) "0", YYTHD->variables.default_week_format,1)); @@ -20774,27 +20776,27 @@ break; case 930: -#line 5376 "sql_yacc.yy" +#line 5378 "sql_yacc.yy" { (yyval.item)= new Item_func_week((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 931: -#line 5378 "sql_yacc.yy" +#line 5380 "sql_yacc.yy" { (yyval.item)= new Item_func_year((yyvsp[(3) - (4)].item)); } break; case 932: -#line 5380 "sql_yacc.yy" +#line 5382 "sql_yacc.yy" { (yyval.item)= new Item_func_yearweek((yyvsp[(3) - (4)].item),new Item_int((char*) "0",0,1)); } break; case 933: -#line 5382 "sql_yacc.yy" +#line 5384 "sql_yacc.yy" { (yyval.item)= new Item_func_yearweek((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 934: -#line 5384 "sql_yacc.yy" +#line 5386 "sql_yacc.yy" { (yyval.item)=new Item_func_benchmark((yyvsp[(3) - (6)].ulong_num),(yyvsp[(5) - (6)].item)); Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); @@ -20802,198 +20804,198 @@ break; case 935: -#line 5389 "sql_yacc.yy" +#line 5391 "sql_yacc.yy" { (yyval.item)=new Item_extract( (yyvsp[(3) - (6)].interval), (yyvsp[(5) - (6)].item)); } break; case 936: -#line 5393 "sql_yacc.yy" +#line 5395 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_rel((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), Item_func::SP_CONTAINS_FUNC)); } break; case 937: -#line 5395 "sql_yacc.yy" +#line 5397 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 938: -#line 5397 "sql_yacc.yy" +#line 5399 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 939: -#line 5399 "sql_yacc.yy" +#line 5401 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_wkb((yyvsp[(3) - (4)].item))); } break; case 940: -#line 5401 "sql_yacc.yy" +#line 5403 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_wkb((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 941: -#line 5403 "sql_yacc.yy" +#line 5405 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_geometrycollection, Geometry::wkb_point)); } break; case 942: -#line 5407 "sql_yacc.yy" +#line 5409 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_linestring, Geometry::wkb_point)); } break; case 943: -#line 5410 "sql_yacc.yy" +#line 5412 "sql_yacc.yy" { (yyval.item)= GEOM_NEW( Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multilinestring, Geometry::wkb_linestring)); } break; case 944: -#line 5413 "sql_yacc.yy" +#line 5415 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 945: -#line 5415 "sql_yacc.yy" +#line 5417 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 946: -#line 5417 "sql_yacc.yy" +#line 5419 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 947: -#line 5419 "sql_yacc.yy" +#line 5421 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 948: -#line 5421 "sql_yacc.yy" +#line 5423 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 949: -#line 5423 "sql_yacc.yy" +#line 5425 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 950: -#line 5425 "sql_yacc.yy" +#line 5427 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multipoint, Geometry::wkb_point)); } break; case 951: -#line 5428 "sql_yacc.yy" +#line 5430 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multipolygon, Geometry::wkb_polygon)); } break; case 952: -#line 5431 "sql_yacc.yy" +#line 5433 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_point((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item))); } break; case 953: -#line 5433 "sql_yacc.yy" +#line 5435 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 954: -#line 5435 "sql_yacc.yy" +#line 5437 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 955: -#line 5437 "sql_yacc.yy" +#line 5439 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 956: -#line 5439 "sql_yacc.yy" +#line 5441 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 957: -#line 5441 "sql_yacc.yy" +#line 5443 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_polygon, Geometry::wkb_linestring)); } break; case 958: -#line 5444 "sql_yacc.yy" +#line 5446 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 959: -#line 5446 "sql_yacc.yy" +#line 5448 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 960: -#line 5448 "sql_yacc.yy" +#line 5450 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 961: -#line 5450 "sql_yacc.yy" +#line 5452 "sql_yacc.yy" { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 962: -#line 5454 "sql_yacc.yy" +#line 5456 "sql_yacc.yy" { (yyval.num)= FT_NL; } break; case 963: -#line 5455 "sql_yacc.yy" +#line 5457 "sql_yacc.yy" { (yyval.num)= FT_NL | FT_EXPAND; } break; case 964: -#line 5456 "sql_yacc.yy" +#line 5458 "sql_yacc.yy" { (yyval.num)= FT_BOOL; } break; case 965: -#line 5460 "sql_yacc.yy" +#line 5462 "sql_yacc.yy" { (yyval.item_list)= NULL; } break; case 966: -#line 5461 "sql_yacc.yy" +#line 5463 "sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 967: -#line 5465 "sql_yacc.yy" +#line 5467 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 968: -#line 5467 "sql_yacc.yy" +#line 5469 "sql_yacc.yy" { (yyval.item_list)= Select->expr_list.pop(); } break; case 969: -#line 5472 "sql_yacc.yy" +#line 5474 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 970: -#line 5476 "sql_yacc.yy" +#line 5478 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 971: -#line 5483 "sql_yacc.yy" +#line 5485 "sql_yacc.yy" { udf_func *udf= Select->udf_list.head(); /* @@ -21024,117 +21026,117 @@ break; case 972: -#line 5514 "sql_yacc.yy" +#line 5516 "sql_yacc.yy" { (yyval.item)=new Item_sum_avg((yyvsp[(3) - (4)].item)); } break; case 973: -#line 5516 "sql_yacc.yy" +#line 5518 "sql_yacc.yy" { (yyval.item)=new Item_sum_avg_distinct((yyvsp[(4) - (5)].item)); } break; case 974: -#line 5518 "sql_yacc.yy" +#line 5520 "sql_yacc.yy" { (yyval.item)=new Item_sum_and((yyvsp[(3) - (4)].item)); } break; case 975: -#line 5520 "sql_yacc.yy" +#line 5522 "sql_yacc.yy" { (yyval.item)=new Item_sum_or((yyvsp[(3) - (4)].item)); } break; case 976: -#line 5522 "sql_yacc.yy" +#line 5524 "sql_yacc.yy" { (yyval.item)=new Item_sum_xor((yyvsp[(3) - (4)].item)); } break; case 977: -#line 5524 "sql_yacc.yy" +#line 5526 "sql_yacc.yy" { (yyval.item)=new Item_sum_count(new Item_int((int32) 0L,1)); } break; case 978: -#line 5526 "sql_yacc.yy" +#line 5528 "sql_yacc.yy" { (yyval.item)=new Item_sum_count((yyvsp[(3) - (4)].item)); } break; case 979: -#line 5528 "sql_yacc.yy" +#line 5530 "sql_yacc.yy" { Select->in_sum_expr++; } break; case 980: -#line 5530 "sql_yacc.yy" +#line 5532 "sql_yacc.yy" { Select->in_sum_expr--; } break; case 981: -#line 5532 "sql_yacc.yy" +#line 5534 "sql_yacc.yy" { (yyval.item)=new Item_sum_count_distinct(* (yyvsp[(5) - (7)].item_list)); } break; case 982: -#line 5534 "sql_yacc.yy" +#line 5536 "sql_yacc.yy" { (yyval.item)= new Item_sum_unique_users((yyvsp[(3) - (10)].item),atoi((yyvsp[(5) - (10)].lex_str).str),atoi((yyvsp[(7) - (10)].lex_str).str),(yyvsp[(9) - (10)].item)); } break; case 983: -#line 5536 "sql_yacc.yy" +#line 5538 "sql_yacc.yy" { (yyval.item)=new Item_sum_min((yyvsp[(3) - (4)].item)); } break; case 984: -#line 5543 "sql_yacc.yy" +#line 5545 "sql_yacc.yy" { (yyval.item)=new Item_sum_min((yyvsp[(4) - (5)].item)); } break; case 985: -#line 5545 "sql_yacc.yy" +#line 5547 "sql_yacc.yy" { (yyval.item)=new Item_sum_max((yyvsp[(3) - (4)].item)); } break; case 986: -#line 5547 "sql_yacc.yy" +#line 5549 "sql_yacc.yy" { (yyval.item)=new Item_sum_max((yyvsp[(4) - (5)].item)); } break; case 987: -#line 5549 "sql_yacc.yy" +#line 5551 "sql_yacc.yy" { (yyval.item)=new Item_sum_std((yyvsp[(3) - (4)].item), 0); } break; case 988: -#line 5551 "sql_yacc.yy" +#line 5553 "sql_yacc.yy" { (yyval.item)=new Item_sum_variance((yyvsp[(3) - (4)].item), 0); } break; case 989: -#line 5553 "sql_yacc.yy" +#line 5555 "sql_yacc.yy" { (yyval.item)=new Item_sum_std((yyvsp[(3) - (4)].item), 1); } break; case 990: -#line 5555 "sql_yacc.yy" +#line 5557 "sql_yacc.yy" { (yyval.item)=new Item_sum_variance((yyvsp[(3) - (4)].item), 1); } break; case 991: -#line 5557 "sql_yacc.yy" +#line 5559 "sql_yacc.yy" { (yyval.item)=new Item_sum_sum((yyvsp[(3) - (4)].item)); } break; case 992: -#line 5559 "sql_yacc.yy" +#line 5561 "sql_yacc.yy" { (yyval.item)=new Item_sum_sum_distinct((yyvsp[(4) - (5)].item)); } break; case 993: -#line 5561 "sql_yacc.yy" +#line 5563 "sql_yacc.yy" { Select->in_sum_expr++; } break; case 994: -#line 5565 "sql_yacc.yy" +#line 5567 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->in_sum_expr--; @@ -21145,7 +21147,7 @@ break; case 995: -#line 5575 "sql_yacc.yy" +#line 5577 "sql_yacc.yy" { if (! Lex->parsing_options.allows_variable) { @@ -21156,14 +21158,14 @@ break; case 996: -#line 5583 "sql_yacc.yy" +#line 5585 "sql_yacc.yy" { (yyval.item)= (yyvsp[(3) - (3)].item); } break; case 997: -#line 5590 "sql_yacc.yy" +#line 5592 "sql_yacc.yy" { (yyval.item)= new Item_func_set_user_var((yyvsp[(1) - (3)].lex_str), (yyvsp[(3) - (3)].item)); LEX *lex= Lex; @@ -21172,7 +21174,7 @@ break; case 998: -#line 5596 "sql_yacc.yy" +#line 5598 "sql_yacc.yy" { (yyval.item)= new Item_func_get_user_var((yyvsp[(1) - (1)].lex_str)); LEX *lex= Lex; @@ -21181,7 +21183,7 @@ break; case 999: -#line 5602 "sql_yacc.yy" +#line 5604 "sql_yacc.yy" { if ((yyvsp[(3) - (4)].lex_str).str && (yyvsp[(4) - (4)].lex_str).str && check_reserved_words(&(yyvsp[(3) - (4)].lex_str))) { @@ -21194,36 +21196,36 @@ break; case 1000: -#line 5614 "sql_yacc.yy" +#line 5616 "sql_yacc.yy" { (yyval.num) = 0; } break; case 1001: -#line 5615 "sql_yacc.yy" +#line 5617 "sql_yacc.yy" { (yyval.num) = 1; } break; case 1002: -#line 5619 "sql_yacc.yy" +#line 5621 "sql_yacc.yy" { (yyval.string)= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1); } break; case 1003: -#line 5622 "sql_yacc.yy" +#line 5624 "sql_yacc.yy" { (yyval.string) = (yyvsp[(2) - (2)].string); } break; case 1004: -#line 5627 "sql_yacc.yy" +#line 5629 "sql_yacc.yy" { Select->gorder_list = NULL; } break; case 1005: -#line 5631 "sql_yacc.yy" +#line 5633 "sql_yacc.yy" { SELECT_LEX *select= Select; select->gorder_list= @@ -21234,7 +21236,7 @@ break; case 1006: -#line 5642 "sql_yacc.yy" +#line 5644 "sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->inc_in_sum_expr()) @@ -21246,7 +21248,7 @@ break; case 1007: -#line 5651 "sql_yacc.yy" +#line 5653 "sql_yacc.yy" { Select->in_sum_expr--; (yyval.item)= (yyvsp[(3) - (3)].item); @@ -21254,142 +21256,142 @@ break; case 1008: -#line 5657 "sql_yacc.yy" +#line 5659 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } break; case 1009: -#line 5658 "sql_yacc.yy" +#line 5660 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->dec= 0; } break; case 1010: -#line 5659 "sql_yacc.yy" +#line 5661 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; } break; case 1011: -#line 5660 "sql_yacc.yy" +#line 5662 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1012: -#line 5661 "sql_yacc.yy" +#line 5663 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1013: -#line 5662 "sql_yacc.yy" +#line 5664 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1014: -#line 5663 "sql_yacc.yy" +#line 5665 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1015: -#line 5664 "sql_yacc.yy" +#line 5666 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1016: -#line 5665 "sql_yacc.yy" +#line 5667 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1017: -#line 5666 "sql_yacc.yy" +#line 5668 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1018: -#line 5667 "sql_yacc.yy" +#line 5669 "sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_DECIMAL; Lex->charset= NULL; } break; case 1019: -#line 5671 "sql_yacc.yy" +#line 5673 "sql_yacc.yy" { (yyval.item_list)= NULL; } break; case 1020: -#line 5672 "sql_yacc.yy" +#line 5674 "sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 1021: -#line 5676 "sql_yacc.yy" +#line 5678 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 1022: -#line 5678 "sql_yacc.yy" +#line 5680 "sql_yacc.yy" { (yyval.item_list)= Select->expr_list.pop(); } break; case 1023: -#line 5681 "sql_yacc.yy" +#line 5683 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 1024: -#line 5682 "sql_yacc.yy" +#line 5684 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 1025: -#line 5685 "sql_yacc.yy" +#line 5687 "sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list); } break; case 1026: -#line 5686 "sql_yacc.yy" +#line 5688 "sql_yacc.yy" { (yyval.item_list)= (yyvsp[(2) - (3)].item_list); } break; case 1027: -#line 5689 "sql_yacc.yy" +#line 5691 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 1028: -#line 5691 "sql_yacc.yy" +#line 5693 "sql_yacc.yy" { (yyval.item_list)= Select->expr_list.pop(); } break; case 1029: -#line 5694 "sql_yacc.yy" +#line 5696 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 1030: -#line 5695 "sql_yacc.yy" +#line 5697 "sql_yacc.yy" { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 1031: -#line 5698 "sql_yacc.yy" +#line 5700 "sql_yacc.yy" { (yyval.item)= NULL; } break; case 1032: -#line 5699 "sql_yacc.yy" +#line 5701 "sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1033: -#line 5702 "sql_yacc.yy" +#line 5704 "sql_yacc.yy" { (yyval.item)= NULL; } break; case 1034: -#line 5703 "sql_yacc.yy" +#line 5705 "sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 1035: -#line 5707 "sql_yacc.yy" +#line 5709 "sql_yacc.yy" { (yyval.item_list)= new List; (yyval.item_list)->push_back((yyvsp[(2) - (4)].item)); @@ -21398,7 +21400,7 @@ break; case 1036: -#line 5713 "sql_yacc.yy" +#line 5715 "sql_yacc.yy" { (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(3) - (5)].item)); (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(5) - (5)].item)); @@ -21407,12 +21409,12 @@ break; case 1037: -#line 5722 "sql_yacc.yy" +#line 5724 "sql_yacc.yy" { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1038: -#line 5724 "sql_yacc.yy" +#line 5726 "sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->nest_last_join(lex->thd))) @@ -21421,34 +21423,34 @@ break; case 1039: -#line 5732 "sql_yacc.yy" +#line 5734 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyval.table_list)=(yyvsp[(1) - (1)].table_list)); } break; case 1040: -#line 5737 "sql_yacc.yy" +#line 5739 "sql_yacc.yy" { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1041: -#line 5739 "sql_yacc.yy" +#line 5741 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1042: -#line 5759 "sql_yacc.yy" +#line 5761 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1043: -#line 5761 "sql_yacc.yy" +#line 5763 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); (yyvsp[(3) - (3)].table_list)->straight=1; } break; case 1044: -#line 5764 "sql_yacc.yy" +#line 5766 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ @@ -21459,7 +21461,7 @@ break; case 1045: -#line 5772 "sql_yacc.yy" +#line 5774 "sql_yacc.yy" { add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); Lex->pop_context(); @@ -21468,7 +21470,7 @@ break; case 1046: -#line 5779 "sql_yacc.yy" +#line 5781 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ @@ -21479,7 +21481,7 @@ break; case 1047: -#line 5787 "sql_yacc.yy" +#line 5789 "sql_yacc.yy" { (yyvsp[(3) - (6)].table_list)->straight=1; add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); @@ -21489,19 +21491,19 @@ break; case 1048: -#line 5795 "sql_yacc.yy" +#line 5797 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); } break; case 1049: -#line 5799 "sql_yacc.yy" +#line 5801 "sql_yacc.yy" { add_join_natural((yyvsp[(1) - (8)].table_list),(yyvsp[(3) - (8)].table_list),(yyvsp[(7) - (8)].string_list),Select); (yyval.table_list)=(yyvsp[(3) - (8)].table_list); } break; case 1050: -#line 5801 "sql_yacc.yy" +#line 5803 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && ((yyval.table_list)=(yyvsp[(4) - (4)].table_list))); add_join_natural((yyvsp[(1) - (4)].table_list),(yyvsp[(4) - (4)].table_list),NULL,Select); @@ -21509,7 +21511,7 @@ break; case 1051: -#line 5809 "sql_yacc.yy" +#line 5811 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ @@ -21520,7 +21522,7 @@ break; case 1052: -#line 5817 "sql_yacc.yy" +#line 5819 "sql_yacc.yy" { add_join_on((yyvsp[(5) - (8)].table_list),(yyvsp[(8) - (8)].item)); Lex->pop_context(); @@ -21531,14 +21533,14 @@ break; case 1053: -#line 5825 "sql_yacc.yy" +#line 5827 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } break; case 1054: -#line 5829 "sql_yacc.yy" +#line 5831 "sql_yacc.yy" { add_join_natural((yyvsp[(1) - (10)].table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select); (yyvsp[(5) - (10)].table_list)->outer_join|=JOIN_TYPE_LEFT; @@ -21547,7 +21549,7 @@ break; case 1055: -#line 5835 "sql_yacc.yy" +#line 5837 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); add_join_natural((yyvsp[(1) - (6)].table_list),(yyvsp[(6) - (6)].table_list),NULL,Select); @@ -21557,7 +21559,7 @@ break; case 1056: -#line 5845 "sql_yacc.yy" +#line 5847 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ @@ -21568,7 +21570,7 @@ break; case 1057: -#line 5853 "sql_yacc.yy" +#line 5855 "sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->convert_right_join())) @@ -21580,14 +21582,14 @@ break; case 1058: -#line 5862 "sql_yacc.yy" +#line 5864 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } break; case 1059: -#line 5866 "sql_yacc.yy" +#line 5868 "sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->convert_right_join())) @@ -21597,7 +21599,7 @@ break; case 1060: -#line 5873 "sql_yacc.yy" +#line 5875 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); add_join_natural((yyvsp[(6) - (6)].table_list),(yyvsp[(1) - (6)].table_list),NULL,Select); @@ -21608,22 +21610,22 @@ break; case 1061: -#line 5882 "sql_yacc.yy" +#line 5884 "sql_yacc.yy" {} break; case 1062: -#line 5883 "sql_yacc.yy" +#line 5885 "sql_yacc.yy" {} break; case 1063: -#line 5884 "sql_yacc.yy" +#line 5886 "sql_yacc.yy" {} break; case 1064: -#line 5889 "sql_yacc.yy" +#line 5891 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->use_index_ptr=sel->ignore_index_ptr=0; @@ -21632,7 +21634,7 @@ break; case 1065: -#line 5895 "sql_yacc.yy" +#line 5897 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -21647,7 +21649,7 @@ break; case 1066: -#line 5908 "sql_yacc.yy" +#line 5910 "sql_yacc.yy" { /* Change the current name resolution context to a local context. */ if (push_new_name_resolution_context(YYTHD, (yyvsp[(3) - (8)].table_list), (yyvsp[(7) - (8)].table_list))) @@ -21657,7 +21659,7 @@ break; case 1067: -#line 5915 "sql_yacc.yy" +#line 5917 "sql_yacc.yy" { LEX *lex= Lex; MYSQL_YYABORT_UNLESS((yyvsp[(3) - (11)].table_list) && (yyvsp[(7) - (11)].table_list)); @@ -21671,7 +21673,7 @@ break; case 1068: -#line 5926 "sql_yacc.yy" +#line 5928 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -21696,7 +21698,7 @@ break; case 1069: -#line 5948 "sql_yacc.yy" +#line 5950 "sql_yacc.yy" { /* Use $2 instead of Lex->current_select as derived table will alter value of Lex->current_select. */ @@ -21742,7 +21744,7 @@ break; case 1070: -#line 5995 "sql_yacc.yy" +#line 5997 "sql_yacc.yy" { LEX *lex= Lex; if ((yyvsp[(1) - (1)].select_lex)->init_nested_join(lex->thd)) @@ -21751,7 +21753,7 @@ break; case 1071: -#line 6001 "sql_yacc.yy" +#line 6003 "sql_yacc.yy" { LEX *lex= Lex; /* for normal joins, $3 != NULL and end_nested_join() != NULL, @@ -21768,7 +21770,7 @@ break; case 1072: -#line 6017 "sql_yacc.yy" +#line 6019 "sql_yacc.yy" { LEX *lex= Lex; lex->derived_tables|= DERIVED_SUBQUERY; @@ -21789,19 +21791,19 @@ break; case 1073: -#line 6035 "sql_yacc.yy" +#line 6037 "sql_yacc.yy" { Select->parsing_place= NO_MATTER; } break; case 1075: -#line 6042 "sql_yacc.yy" +#line 6044 "sql_yacc.yy" { (yyval.select_lex)= Select; } break; case 1076: -#line 6047 "sql_yacc.yy" +#line 6049 "sql_yacc.yy" { LEX *lex= Lex; @@ -21827,22 +21829,22 @@ break; case 1077: -#line 6072 "sql_yacc.yy" +#line 6074 "sql_yacc.yy" {} break; case 1078: -#line 6073 "sql_yacc.yy" +#line 6075 "sql_yacc.yy" {} break; case 1081: -#line 6080 "sql_yacc.yy" +#line 6082 "sql_yacc.yy" {} break; case 1082: -#line 6082 "sql_yacc.yy" +#line 6084 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->use_index= *(yyvsp[(2) - (2)].string_list); @@ -21851,7 +21853,7 @@ break; case 1083: -#line 6088 "sql_yacc.yy" +#line 6090 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->use_index= *(yyvsp[(2) - (2)].string_list); @@ -21861,7 +21863,7 @@ break; case 1084: -#line 6095 "sql_yacc.yy" +#line 6097 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->ignore_index= *(yyvsp[(2) - (2)].string_list); @@ -21870,48 +21872,48 @@ break; case 1085: -#line 6103 "sql_yacc.yy" +#line 6105 "sql_yacc.yy" { Select->interval_list.empty(); } break; case 1086: -#line 6105 "sql_yacc.yy" +#line 6107 "sql_yacc.yy" { (yyval.string_list)= &Select->interval_list; } break; case 1087: -#line 6109 "sql_yacc.yy" +#line 6111 "sql_yacc.yy" {} break; case 1088: -#line 6110 "sql_yacc.yy" +#line 6112 "sql_yacc.yy" {} break; case 1089: -#line 6115 "sql_yacc.yy" +#line 6117 "sql_yacc.yy" { Select-> interval_list.push_back(new (YYTHD->mem_root) String((const char*) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, system_charset_info)); } break; case 1090: -#line 6119 "sql_yacc.yy" +#line 6121 "sql_yacc.yy" { Select-> interval_list.push_back(new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, system_charset_info)); } break; case 1091: -#line 6123 "sql_yacc.yy" +#line 6125 "sql_yacc.yy" { Select-> interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7, system_charset_info)); } break; case 1092: -#line 6129 "sql_yacc.yy" +#line 6131 "sql_yacc.yy" { if (!((yyval.string_list)= new List)) MYSQL_YYABORT; @@ -21922,7 +21924,7 @@ break; case 1093: -#line 6137 "sql_yacc.yy" +#line 6139 "sql_yacc.yy" { (yyvsp[(1) - (3)].string_list)->push_back(new (YYTHD->mem_root) String((const char *) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, @@ -21932,159 +21934,159 @@ break; case 1094: -#line 6145 "sql_yacc.yy" +#line 6147 "sql_yacc.yy" {} break; case 1095: -#line 6146 "sql_yacc.yy" +#line 6148 "sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_HOUR; } break; case 1096: -#line 6147 "sql_yacc.yy" +#line 6149 "sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_MICROSECOND; } break; case 1097: -#line 6148 "sql_yacc.yy" +#line 6150 "sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_MINUTE; } break; case 1098: -#line 6149 "sql_yacc.yy" +#line 6151 "sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_SECOND; } break; case 1099: -#line 6150 "sql_yacc.yy" +#line 6152 "sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_MICROSECOND; } break; case 1100: -#line 6151 "sql_yacc.yy" +#line 6153 "sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_MINUTE; } break; case 1101: -#line 6152 "sql_yacc.yy" +#line 6154 "sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_SECOND; } break; case 1102: -#line 6153 "sql_yacc.yy" +#line 6155 "sql_yacc.yy" { (yyval.interval)=INTERVAL_MICROSECOND; } break; case 1103: -#line 6154 "sql_yacc.yy" +#line 6156 "sql_yacc.yy" { (yyval.interval)=INTERVAL_MINUTE_MICROSECOND; } break; case 1104: -#line 6155 "sql_yacc.yy" +#line 6157 "sql_yacc.yy" { (yyval.interval)=INTERVAL_MINUTE_SECOND; } break; case 1105: -#line 6156 "sql_yacc.yy" +#line 6158 "sql_yacc.yy" { (yyval.interval)=INTERVAL_SECOND_MICROSECOND; } break; case 1106: -#line 6157 "sql_yacc.yy" +#line 6159 "sql_yacc.yy" { (yyval.interval)=INTERVAL_YEAR_MONTH; } break; case 1107: -#line 6160 "sql_yacc.yy" +#line 6162 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_DAY; } break; case 1108: -#line 6161 "sql_yacc.yy" +#line 6163 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_WEEK; } break; case 1109: -#line 6162 "sql_yacc.yy" +#line 6164 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_HOUR; } break; case 1110: -#line 6163 "sql_yacc.yy" +#line 6165 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MICROSECOND; } break; case 1111: -#line 6164 "sql_yacc.yy" +#line 6166 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MINUTE; } break; case 1112: -#line 6165 "sql_yacc.yy" +#line 6167 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MONTH; } break; case 1113: -#line 6166 "sql_yacc.yy" +#line 6168 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_QUARTER; } break; case 1114: -#line 6167 "sql_yacc.yy" +#line 6169 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_SECOND; } break; case 1115: -#line 6168 "sql_yacc.yy" +#line 6170 "sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_YEAR; } break; case 1116: -#line 6172 "sql_yacc.yy" +#line 6174 "sql_yacc.yy" {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATE;} break; case 1117: -#line 6173 "sql_yacc.yy" +#line 6175 "sql_yacc.yy" {(yyval.date_time_type)=MYSQL_TIMESTAMP_TIME;} break; case 1118: -#line 6174 "sql_yacc.yy" +#line 6176 "sql_yacc.yy" {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATETIME;} break; case 1119: -#line 6175 "sql_yacc.yy" +#line 6177 "sql_yacc.yy" {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATETIME;} break; case 1123: -#line 6184 "sql_yacc.yy" +#line 6186 "sql_yacc.yy" { (yyval.lex_str_ptr)=0; } break; case 1124: -#line 6186 "sql_yacc.yy" +#line 6188 "sql_yacc.yy" { (yyval.lex_str_ptr)= (LEX_STRING*) sql_memdup(&(yyvsp[(2) - (2)].lex_str),sizeof(LEX_STRING)); } break; case 1127: -#line 6194 "sql_yacc.yy" +#line 6196 "sql_yacc.yy" { Select->where= 0; } break; case 1128: -#line 6196 "sql_yacc.yy" +#line 6198 "sql_yacc.yy" { Select->parsing_place= IN_WHERE; } break; case 1129: -#line 6200 "sql_yacc.yy" +#line 6202 "sql_yacc.yy" { SELECT_LEX *select= Select; select->where= (yyvsp[(3) - (3)].item); @@ -22095,14 +22097,14 @@ break; case 1131: -#line 6212 "sql_yacc.yy" +#line 6214 "sql_yacc.yy" { Select->parsing_place= IN_HAVING; } break; case 1132: -#line 6216 "sql_yacc.yy" +#line 6218 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->having= (yyvsp[(3) - (3)].item); @@ -22113,7 +22115,7 @@ break; case 1133: -#line 6227 "sql_yacc.yy" +#line 6229 "sql_yacc.yy" { Lex->escape_used= TRUE; (yyval.item)= (yyvsp[(2) - (2)].item); @@ -22121,7 +22123,7 @@ break; case 1134: -#line 6232 "sql_yacc.yy" +#line 6234 "sql_yacc.yy" { Lex->escape_used= FALSE; (yyval.item)= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? @@ -22131,22 +22133,22 @@ break; case 1137: -#line 6251 "sql_yacc.yy" +#line 6253 "sql_yacc.yy" { if (add_group_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1138: -#line 6253 "sql_yacc.yy" +#line 6255 "sql_yacc.yy" { if (add_group_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1139: -#line 6256 "sql_yacc.yy" +#line 6258 "sql_yacc.yy" {} break; case 1140: -#line 6258 "sql_yacc.yy" +#line 6260 "sql_yacc.yy" { LEX *lex=Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) @@ -22162,7 +22164,7 @@ break; case 1141: -#line 6271 "sql_yacc.yy" +#line 6273 "sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) @@ -22176,7 +22178,7 @@ break; case 1145: -#line 6298 "sql_yacc.yy" +#line 6300 "sql_yacc.yy" { THD *thd= YYTHD; bool ascending= ((yyvsp[(2) - (2)].num) == 1) ? true : false; @@ -22186,7 +22188,7 @@ break; case 1148: -#line 6316 "sql_yacc.yy" +#line 6318 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= lex->current_select; @@ -22219,32 +22221,32 @@ break; case 1150: -#line 6348 "sql_yacc.yy" +#line 6350 "sql_yacc.yy" { if (add_order_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1151: -#line 6350 "sql_yacc.yy" +#line 6352 "sql_yacc.yy" { if (add_order_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1152: -#line 6353 "sql_yacc.yy" +#line 6355 "sql_yacc.yy" { (yyval.num) = 1; } break; case 1153: -#line 6354 "sql_yacc.yy" +#line 6356 "sql_yacc.yy" { (yyval.num) =1; } break; case 1154: -#line 6355 "sql_yacc.yy" +#line 6357 "sql_yacc.yy" { (yyval.num) =0; } break; case 1155: -#line 6360 "sql_yacc.yy" +#line 6362 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -22254,27 +22256,27 @@ break; case 1156: -#line 6366 "sql_yacc.yy" +#line 6368 "sql_yacc.yy" {} break; case 1157: -#line 6370 "sql_yacc.yy" +#line 6372 "sql_yacc.yy" {} break; case 1158: -#line 6371 "sql_yacc.yy" +#line 6373 "sql_yacc.yy" {} break; case 1159: -#line 6375 "sql_yacc.yy" +#line 6377 "sql_yacc.yy" {} break; case 1160: -#line 6380 "sql_yacc.yy" +#line 6382 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(1) - (1)].item); @@ -22284,7 +22286,7 @@ break; case 1161: -#line 6387 "sql_yacc.yy" +#line 6389 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(3) - (3)].item); @@ -22294,7 +22296,7 @@ break; case 1162: -#line 6394 "sql_yacc.yy" +#line 6396 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(1) - (3)].item); @@ -22304,29 +22306,29 @@ break; case 1163: -#line 6403 "sql_yacc.yy" +#line 6405 "sql_yacc.yy" { ((Item_param *) (yyvsp[(1) - (1)].item))->set_strict_type(INT_RESULT); } break; case 1164: -#line 6406 "sql_yacc.yy" +#line 6408 "sql_yacc.yy" { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1165: -#line 6407 "sql_yacc.yy" +#line 6409 "sql_yacc.yy" { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1166: -#line 6408 "sql_yacc.yy" +#line 6410 "sql_yacc.yy" { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1167: -#line 6413 "sql_yacc.yy" +#line 6415 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select->select_limit= 0; @@ -22334,7 +22336,7 @@ break; case 1168: -#line 6418 "sql_yacc.yy" +#line 6420 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(2) - (2)].item); @@ -22343,62 +22345,62 @@ break; case 1169: -#line 6425 "sql_yacc.yy" +#line 6427 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1170: -#line 6426 "sql_yacc.yy" +#line 6428 "sql_yacc.yy" { (yyval.ulong_num)= (ulong) strtol((yyvsp[(1) - (1)].lex_str).str, (char**) 0, 16); } break; case 1171: -#line 6427 "sql_yacc.yy" +#line 6429 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1172: -#line 6428 "sql_yacc.yy" +#line 6430 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1173: -#line 6429 "sql_yacc.yy" +#line 6431 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1174: -#line 6430 "sql_yacc.yy" +#line 6432 "sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1175: -#line 6434 "sql_yacc.yy" +#line 6436 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1176: -#line 6435 "sql_yacc.yy" +#line 6437 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1177: -#line 6436 "sql_yacc.yy" +#line 6438 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1178: -#line 6437 "sql_yacc.yy" +#line 6439 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1179: -#line 6438 "sql_yacc.yy" +#line 6440 "sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1181: -#line 6444 "sql_yacc.yy" +#line 6446 "sql_yacc.yy" { LEX *lex=Lex; @@ -22426,17 +22428,17 @@ break; case 1183: -#line 6472 "sql_yacc.yy" +#line 6474 "sql_yacc.yy" {} break; case 1184: -#line 6473 "sql_yacc.yy" +#line 6475 "sql_yacc.yy" {} break; case 1187: -#line 6481 "sql_yacc.yy" +#line 6483 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; @@ -22450,7 +22452,7 @@ break; case 1188: -#line 6495 "sql_yacc.yy" +#line 6497 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe && (!(lex->result= new select_dumpvar()))) @@ -22459,17 +22461,17 @@ break; case 1189: -#line 6501 "sql_yacc.yy" +#line 6503 "sql_yacc.yy" {} break; case 1191: -#line 6506 "sql_yacc.yy" +#line 6508 "sql_yacc.yy" {} break; case 1192: -#line 6511 "sql_yacc.yy" +#line 6513 "sql_yacc.yy" { LEX *lex=Lex; if (lex->result) @@ -22484,7 +22486,7 @@ break; case 1193: -#line 6523 "sql_yacc.yy" +#line 6525 "sql_yacc.yy" { LEX *lex=Lex; sp_variable_t *t; @@ -22516,7 +22518,7 @@ break; case 1194: -#line 6555 "sql_yacc.yy" +#line 6557 "sql_yacc.yy" { if (! Lex->parsing_options.allows_select_into) { @@ -22527,7 +22529,7 @@ break; case 1196: -#line 6567 "sql_yacc.yy" +#line 6569 "sql_yacc.yy" { LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_SIDEEFFECT); @@ -22538,7 +22540,7 @@ break; case 1198: -#line 6576 "sql_yacc.yy" +#line 6578 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe) @@ -22553,14 +22555,14 @@ break; case 1199: -#line 6588 "sql_yacc.yy" +#line 6590 "sql_yacc.yy" { Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } break; case 1200: -#line 6598 "sql_yacc.yy" +#line 6600 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DO; @@ -22569,14 +22571,14 @@ break; case 1201: -#line 6604 "sql_yacc.yy" +#line 6606 "sql_yacc.yy" { Lex->insert_list= (yyvsp[(3) - (3)].item_list); } break; case 1202: -#line 6615 "sql_yacc.yy" +#line 6617 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DROP_TABLE; @@ -22586,12 +22588,12 @@ break; case 1203: -#line 6621 "sql_yacc.yy" +#line 6623 "sql_yacc.yy" {} break; case 1204: -#line 6622 "sql_yacc.yy" +#line 6624 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_INDEX; @@ -22606,7 +22608,7 @@ break; case 1205: -#line 6634 "sql_yacc.yy" +#line 6636 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_DB; @@ -22616,7 +22618,7 @@ break; case 1206: -#line 6641 "sql_yacc.yy" +#line 6643 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -22631,7 +22633,7 @@ break; case 1207: -#line 6653 "sql_yacc.yy" +#line 6655 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -22646,14 +22648,14 @@ break; case 1208: -#line 6665 "sql_yacc.yy" +#line 6667 "sql_yacc.yy" { Lex->sql_command = SQLCOM_DROP_USER; } break; case 1209: -#line 6669 "sql_yacc.yy" +#line 6671 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_VIEW; @@ -22662,7 +22664,7 @@ break; case 1210: -#line 6675 "sql_yacc.yy" +#line 6677 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_TRIGGER; @@ -22672,7 +22674,7 @@ break; case 1213: -#line 6689 "sql_yacc.yy" +#line 6691 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; @@ -22680,7 +22682,7 @@ break; case 1216: -#line 6701 "sql_yacc.yy" +#line 6703 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL, TL_OPTION_UPDATING | TL_OPTION_ALIAS, @@ -22690,27 +22692,27 @@ break; case 1217: -#line 6710 "sql_yacc.yy" +#line 6712 "sql_yacc.yy" { (yyval.num)= 0; } break; case 1218: -#line 6711 "sql_yacc.yy" +#line 6713 "sql_yacc.yy" { (yyval.num)= 1; } break; case 1219: -#line 6715 "sql_yacc.yy" +#line 6717 "sql_yacc.yy" { (yyval.num)= 0; } break; case 1220: -#line 6716 "sql_yacc.yy" +#line 6718 "sql_yacc.yy" { (yyval.num)= 1; } break; case 1221: -#line 6724 "sql_yacc.yy" +#line 6726 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_INSERT; @@ -22722,7 +22724,7 @@ break; case 1222: -#line 6733 "sql_yacc.yy" +#line 6735 "sql_yacc.yy" { Select->set_lock_for_tables((yyvsp[(3) - (5)].lock_type)); Lex->current_select= &Lex->select_lex; @@ -22730,12 +22732,12 @@ break; case 1223: -#line 6738 "sql_yacc.yy" +#line 6740 "sql_yacc.yy" {} break; case 1224: -#line 6743 "sql_yacc.yy" +#line 6745 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPLACE; @@ -22745,7 +22747,7 @@ break; case 1225: -#line 6750 "sql_yacc.yy" +#line 6752 "sql_yacc.yy" { Select->set_lock_for_tables((yyvsp[(3) - (4)].lock_type)); Lex->current_select= &Lex->select_lex; @@ -22753,12 +22755,12 @@ break; case 1226: -#line 6755 "sql_yacc.yy" +#line 6757 "sql_yacc.yy" {} break; case 1227: -#line 6760 "sql_yacc.yy" +#line 6762 "sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* @@ -22774,42 +22776,42 @@ break; case 1228: -#line 6772 "sql_yacc.yy" +#line 6774 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1229: -#line 6773 "sql_yacc.yy" +#line 6775 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DELAYED; } break; case 1230: -#line 6774 "sql_yacc.yy" +#line 6776 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE; } break; case 1231: -#line 6778 "sql_yacc.yy" +#line 6780 "sql_yacc.yy" { (yyval.lock_type)= (yyvsp[(1) - (1)].lock_type); } break; case 1232: -#line 6779 "sql_yacc.yy" +#line 6781 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DELAYED; } break; case 1233: -#line 6782 "sql_yacc.yy" +#line 6784 "sql_yacc.yy" {} break; case 1234: -#line 6783 "sql_yacc.yy" +#line 6785 "sql_yacc.yy" {} break; case 1235: -#line 6787 "sql_yacc.yy" +#line 6789 "sql_yacc.yy" { LEX *lex=Lex; lex->field_list.empty(); @@ -22819,22 +22821,22 @@ break; case 1236: -#line 6795 "sql_yacc.yy" +#line 6797 "sql_yacc.yy" {} break; case 1237: -#line 6796 "sql_yacc.yy" +#line 6798 "sql_yacc.yy" {} break; case 1238: -#line 6797 "sql_yacc.yy" +#line 6799 "sql_yacc.yy" {} break; case 1239: -#line 6799 "sql_yacc.yy" +#line 6801 "sql_yacc.yy" { LEX *lex=Lex; if (!(lex->insert_list = new List_item) || @@ -22844,47 +22846,47 @@ break; case 1241: -#line 6808 "sql_yacc.yy" +#line 6810 "sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1242: -#line 6809 "sql_yacc.yy" +#line 6811 "sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1243: -#line 6812 "sql_yacc.yy" +#line 6814 "sql_yacc.yy" {} break; case 1244: -#line 6813 "sql_yacc.yy" +#line 6815 "sql_yacc.yy" {} break; case 1245: -#line 6814 "sql_yacc.yy" +#line 6816 "sql_yacc.yy" { Select->set_braces(0);} break; case 1246: -#line 6814 "sql_yacc.yy" +#line 6816 "sql_yacc.yy" {} break; case 1247: -#line 6815 "sql_yacc.yy" +#line 6817 "sql_yacc.yy" { Select->set_braces(1);} break; case 1248: -#line 6815 "sql_yacc.yy" +#line 6817 "sql_yacc.yy" {} break; case 1253: -#line 6829 "sql_yacc.yy" +#line 6831 "sql_yacc.yy" { LEX *lex=Lex; if (lex->field_list.push_back((yyvsp[(1) - (3)].item)) || @@ -22894,27 +22896,27 @@ break; case 1254: -#line 6836 "sql_yacc.yy" +#line 6838 "sql_yacc.yy" {} break; case 1255: -#line 6837 "sql_yacc.yy" +#line 6839 "sql_yacc.yy" {} break; case 1256: -#line 6841 "sql_yacc.yy" +#line 6843 "sql_yacc.yy" {} break; case 1257: -#line 6842 "sql_yacc.yy" +#line 6844 "sql_yacc.yy" {} break; case 1258: -#line 6847 "sql_yacc.yy" +#line 6849 "sql_yacc.yy" { if (!(Lex->insert_list = new List_item)) MYSQL_YYABORT; @@ -22922,7 +22924,7 @@ break; case 1259: -#line 6852 "sql_yacc.yy" +#line 6854 "sql_yacc.yy" { LEX *lex=Lex; if (lex->many_values.push_back(lex->insert_list)) @@ -22931,12 +22933,12 @@ break; case 1260: -#line 6859 "sql_yacc.yy" +#line 6861 "sql_yacc.yy" {} break; case 1262: -#line 6864 "sql_yacc.yy" +#line 6866 "sql_yacc.yy" { if (Lex->insert_list->push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; @@ -22944,7 +22946,7 @@ break; case 1263: -#line 6869 "sql_yacc.yy" +#line 6871 "sql_yacc.yy" { if (Lex->insert_list->push_back((yyvsp[(1) - (1)].item))) MYSQL_YYABORT; @@ -22952,22 +22954,22 @@ break; case 1264: -#line 6876 "sql_yacc.yy" +#line 6878 "sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1265: -#line 6877 "sql_yacc.yy" +#line 6879 "sql_yacc.yy" {(yyval.item)= new Item_default_value(Lex->current_context()); } break; case 1267: -#line 6882 "sql_yacc.yy" +#line 6884 "sql_yacc.yy" { Lex->duplicates= DUP_UPDATE; } break; case 1269: -#line 6890 "sql_yacc.yy" +#line 6892 "sql_yacc.yy" { LEX *lex= Lex; mysql_init_select(lex); @@ -22978,7 +22980,7 @@ break; case 1270: -#line 6899 "sql_yacc.yy" +#line 6901 "sql_yacc.yy" { LEX *lex= Lex; if (lex->select_lex.table_list.elements > 1) @@ -23000,12 +23002,12 @@ break; case 1271: -#line 6917 "sql_yacc.yy" +#line 6919 "sql_yacc.yy" {} break; case 1274: -#line 6926 "sql_yacc.yy" +#line 6928 "sql_yacc.yy" { if (add_item_to_list(YYTHD, (yyvsp[(1) - (3)].item)) || add_value_to_list(YYTHD, (yyvsp[(3) - (3)].item))) MYSQL_YYABORT; @@ -23013,7 +23015,7 @@ break; case 1277: -#line 6937 "sql_yacc.yy" +#line 6939 "sql_yacc.yy" { LEX *lex= Lex; if (lex->update_list.push_back((yyvsp[(1) - (3)].item)) || @@ -23023,17 +23025,17 @@ break; case 1278: -#line 6945 "sql_yacc.yy" +#line 6947 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1279: -#line 6946 "sql_yacc.yy" +#line 6948 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1280: -#line 6952 "sql_yacc.yy" +#line 6954 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; @@ -23045,12 +23047,12 @@ break; case 1281: -#line 6960 "sql_yacc.yy" +#line 6962 "sql_yacc.yy" {} break; case 1282: -#line 6965 "sql_yacc.yy" +#line 6967 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(2) - (2)].table), NULL, TL_OPTION_UPDATING, Lex->lock_option)) @@ -23059,17 +23061,17 @@ break; case 1283: -#line 6971 "sql_yacc.yy" +#line 6973 "sql_yacc.yy" {} break; case 1284: -#line 6973 "sql_yacc.yy" +#line 6975 "sql_yacc.yy" { mysql_init_multi_delete(Lex); } break; case 1285: -#line 6975 "sql_yacc.yy" +#line 6977 "sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -23077,12 +23079,12 @@ break; case 1286: -#line 6980 "sql_yacc.yy" +#line 6982 "sql_yacc.yy" { mysql_init_multi_delete(Lex); } break; case 1287: -#line 6982 "sql_yacc.yy" +#line 6984 "sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -23090,17 +23092,17 @@ break; case 1288: -#line 6989 "sql_yacc.yy" +#line 6991 "sql_yacc.yy" {} break; case 1289: -#line 6990 "sql_yacc.yy" +#line 6992 "sql_yacc.yy" {} break; case 1290: -#line 6994 "sql_yacc.yy" +#line 6996 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, new Table_ident((yyvsp[(1) - (3)].lex_str)), (yyvsp[(3) - (3)].lex_str_ptr), TL_OPTION_UPDATING | @@ -23110,7 +23112,7 @@ break; case 1291: -#line 7001 "sql_yacc.yy" +#line 7003 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, new Table_ident(YYTHD, (yyvsp[(1) - (5)].lex_str), (yyvsp[(3) - (5)].lex_str), 0), @@ -23123,42 +23125,42 @@ break; case 1292: -#line 7013 "sql_yacc.yy" +#line 7015 "sql_yacc.yy" {} break; case 1293: -#line 7014 "sql_yacc.yy" +#line 7016 "sql_yacc.yy" {} break; case 1294: -#line 7018 "sql_yacc.yy" +#line 7020 "sql_yacc.yy" {} break; case 1295: -#line 7019 "sql_yacc.yy" +#line 7021 "sql_yacc.yy" {} break; case 1296: -#line 7022 "sql_yacc.yy" +#line 7024 "sql_yacc.yy" { Select->options|= OPTION_QUICK; } break; case 1297: -#line 7023 "sql_yacc.yy" +#line 7025 "sql_yacc.yy" { Lex->lock_option= TL_WRITE_LOW_PRIORITY; } break; case 1298: -#line 7024 "sql_yacc.yy" +#line 7026 "sql_yacc.yy" { Lex->ignore= 1; } break; case 1299: -#line 7028 "sql_yacc.yy" +#line 7030 "sql_yacc.yy" { LEX* lex= Lex; lex->sql_command= SQLCOM_TRUNCATE; @@ -23169,84 +23171,84 @@ break; case 1306: -#line 7051 "sql_yacc.yy" +#line 7053 "sql_yacc.yy" { Lex->profile_options|= PROFILE_CPU; } break; case 1307: -#line 7055 "sql_yacc.yy" +#line 7057 "sql_yacc.yy" { Lex->profile_options|= PROFILE_MEMORY; } break; case 1308: -#line 7059 "sql_yacc.yy" +#line 7061 "sql_yacc.yy" { Lex->profile_options|= PROFILE_BLOCK_IO; } break; case 1309: -#line 7063 "sql_yacc.yy" +#line 7065 "sql_yacc.yy" { Lex->profile_options|= PROFILE_CONTEXT; } break; case 1310: -#line 7067 "sql_yacc.yy" +#line 7069 "sql_yacc.yy" { Lex->profile_options|= PROFILE_PAGE_FAULTS; } break; case 1311: -#line 7071 "sql_yacc.yy" +#line 7073 "sql_yacc.yy" { Lex->profile_options|= PROFILE_IPC; } break; case 1312: -#line 7075 "sql_yacc.yy" +#line 7077 "sql_yacc.yy" { Lex->profile_options|= PROFILE_SWAPS; } break; case 1313: -#line 7079 "sql_yacc.yy" +#line 7081 "sql_yacc.yy" { Lex->profile_options|= PROFILE_SOURCE; } break; case 1314: -#line 7083 "sql_yacc.yy" +#line 7085 "sql_yacc.yy" { Lex->profile_options|= PROFILE_ALL; } break; case 1315: -#line 7090 "sql_yacc.yy" +#line 7092 "sql_yacc.yy" { Lex->profile_query_id= 0; } break; case 1316: -#line 7094 "sql_yacc.yy" +#line 7096 "sql_yacc.yy" { Lex->profile_query_id= atoi((yyvsp[(3) - (3)].lex_str).str); } break; case 1317: -#line 7102 "sql_yacc.yy" +#line 7104 "sql_yacc.yy" { LEX *lex=Lex; lex->wild=0; @@ -23258,12 +23260,12 @@ break; case 1318: -#line 7111 "sql_yacc.yy" +#line 7113 "sql_yacc.yy" {} break; case 1319: -#line 7116 "sql_yacc.yy" +#line 7118 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23274,7 +23276,7 @@ break; case 1320: -#line 7124 "sql_yacc.yy" +#line 7126 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23286,7 +23288,7 @@ break; case 1321: -#line 7133 "sql_yacc.yy" +#line 7135 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23298,7 +23300,7 @@ break; case 1322: -#line 7142 "sql_yacc.yy" +#line 7144 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23310,7 +23312,7 @@ break; case 1323: -#line 7151 "sql_yacc.yy" +#line 7153 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23322,12 +23324,12 @@ break; case 1324: -#line 7160 "sql_yacc.yy" +#line 7162 "sql_yacc.yy" { Lex->create_info.db_type= (yyvsp[(2) - (2)].db_type); } break; case 1326: -#line 7163 "sql_yacc.yy" +#line 7165 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23340,7 +23342,7 @@ break; case 1327: -#line 7176 "sql_yacc.yy" +#line 7178 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_NEW_MASTER; Lex->mi.log_file_name = (yyvsp[(8) - (16)].lex_str).str; @@ -23350,21 +23352,21 @@ break; case 1328: -#line 7183 "sql_yacc.yy" +#line 7185 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_BINLOGS; } break; case 1329: -#line 7187 "sql_yacc.yy" +#line 7189 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS; } break; case 1330: -#line 7191 "sql_yacc.yy" +#line 7193 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS; @@ -23372,7 +23374,7 @@ break; case 1332: -#line 7196 "sql_yacc.yy" +#line 7198 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23385,7 +23387,7 @@ break; case 1333: -#line 7206 "sql_yacc.yy" +#line 7208 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_COLUMN_TYPES; @@ -23393,7 +23395,7 @@ break; case 1334: -#line 7211 "sql_yacc.yy" +#line 7213 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -23402,7 +23404,7 @@ break; case 1335: -#line 7217 "sql_yacc.yy" +#line 7219 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -23410,7 +23412,7 @@ break; case 1336: -#line 7222 "sql_yacc.yy" +#line 7224 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_PRIVILEGES; @@ -23418,32 +23420,32 @@ break; case 1337: -#line 7227 "sql_yacc.yy" +#line 7229 "sql_yacc.yy" { (void) create_select_for_variable("warning_count"); } break; case 1338: -#line 7229 "sql_yacc.yy" +#line 7231 "sql_yacc.yy" { (void) create_select_for_variable("error_count"); } break; case 1339: -#line 7231 "sql_yacc.yy" +#line 7233 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_WARNS;} break; case 1340: -#line 7233 "sql_yacc.yy" +#line 7235 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_ERRORS;} break; case 1341: -#line 7235 "sql_yacc.yy" +#line 7237 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_PROFILES; } break; case 1342: -#line 7237 "sql_yacc.yy" +#line 7239 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23454,7 +23456,7 @@ break; case 1343: -#line 7245 "sql_yacc.yy" +#line 7247 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23466,22 +23468,22 @@ break; case 1344: -#line 7254 "sql_yacc.yy" +#line 7256 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; WARN_DEPRECATED("SHOW INNODB STATUS", "SHOW ENGINE INNODB STATUS"); } break; case 1345: -#line 7256 "sql_yacc.yy" +#line 7258 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MUTEX_STATUS; } break; case 1346: -#line 7258 "sql_yacc.yy" +#line 7260 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;} break; case 1347: -#line 7260 "sql_yacc.yy" +#line 7262 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23493,7 +23495,7 @@ break; case 1348: -#line 7269 "sql_yacc.yy" +#line 7271 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23504,7 +23506,7 @@ break; case 1349: -#line 7277 "sql_yacc.yy" +#line 7279 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23515,17 +23517,17 @@ break; case 1350: -#line 7285 "sql_yacc.yy" +#line 7287 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW BDB LOGS", "SHOW ENGINE BDB LOGS"); } break; case 1351: -#line 7287 "sql_yacc.yy" +#line 7289 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW LOGS", "SHOW ENGINE BDB LOGS"); } break; case 1352: -#line 7289 "sql_yacc.yy" +#line 7291 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; @@ -23538,7 +23540,7 @@ break; case 1353: -#line 7299 "sql_yacc.yy" +#line 7301 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; @@ -23548,7 +23550,7 @@ break; case 1354: -#line 7306 "sql_yacc.yy" +#line 7308 "sql_yacc.yy" { Lex->sql_command=SQLCOM_SHOW_CREATE_DB; Lex->create_info.options=(yyvsp[(3) - (4)].num); @@ -23557,7 +23559,7 @@ break; case 1355: -#line 7312 "sql_yacc.yy" +#line 7314 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; @@ -23568,7 +23570,7 @@ break; case 1356: -#line 7320 "sql_yacc.yy" +#line 7322 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; @@ -23579,21 +23581,21 @@ break; case 1357: -#line 7328 "sql_yacc.yy" +#line 7330 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MASTER_STAT; } break; case 1358: -#line 7332 "sql_yacc.yy" +#line 7334 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; } break; case 1359: -#line 7336 "sql_yacc.yy" +#line 7338 "sql_yacc.yy" { LEX *lex= Lex; @@ -23603,7 +23605,7 @@ break; case 1360: -#line 7343 "sql_yacc.yy" +#line 7345 "sql_yacc.yy" { LEX *lex= Lex; @@ -23613,7 +23615,7 @@ break; case 1361: -#line 7350 "sql_yacc.yy" +#line 7352 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23626,7 +23628,7 @@ break; case 1362: -#line 7360 "sql_yacc.yy" +#line 7362 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23639,7 +23641,7 @@ break; case 1363: -#line 7370 "sql_yacc.yy" +#line 7372 "sql_yacc.yy" { #ifdef DBUG_OFF my_parse_error(ER(ER_SYNTAX_ERROR)); @@ -23652,7 +23654,7 @@ break; case 1364: -#line 7380 "sql_yacc.yy" +#line 7382 "sql_yacc.yy" { #ifdef DBUG_OFF my_parse_error(ER(ER_SYNTAX_ERROR)); @@ -23666,7 +23668,7 @@ break; case 1365: -#line 7391 "sql_yacc.yy" +#line 7393 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_SENNA_STATUS; Lex->select_lex.db = (yyvsp[(3) - (4)].simple_string); @@ -23675,7 +23677,7 @@ break; case 1366: -#line 7400 "sql_yacc.yy" +#line 7402 "sql_yacc.yy" { switch (Lex->create_info.db_type) { case DB_TYPE_NDBCLUSTER: @@ -23692,7 +23694,7 @@ break; case 1367: -#line 7414 "sql_yacc.yy" +#line 7416 "sql_yacc.yy" { switch (Lex->create_info.db_type) { case DB_TYPE_BERKELEY_DB: @@ -23706,53 +23708,53 @@ break; case 1372: -#line 7434 "sql_yacc.yy" +#line 7436 "sql_yacc.yy" { (yyval.simple_string)= 0; } break; case 1373: -#line 7435 "sql_yacc.yy" +#line 7437 "sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(2) - (2)].lex_str).str; } break; case 1374: -#line 7438 "sql_yacc.yy" +#line 7440 "sql_yacc.yy" { Lex->verbose=0; } break; case 1375: -#line 7439 "sql_yacc.yy" +#line 7441 "sql_yacc.yy" { Lex->verbose=1; } break; case 1378: -#line 7446 "sql_yacc.yy" +#line 7448 "sql_yacc.yy" { Lex->mi.log_file_name = 0; } break; case 1379: -#line 7447 "sql_yacc.yy" +#line 7449 "sql_yacc.yy" { Lex->mi.log_file_name = (yyvsp[(2) - (2)].lex_str).str; } break; case 1380: -#line 7450 "sql_yacc.yy" +#line 7452 "sql_yacc.yy" { Lex->mi.pos = 4; /* skip magic number */ } break; case 1381: -#line 7451 "sql_yacc.yy" +#line 7453 "sql_yacc.yy" { Lex->mi.pos = (yyvsp[(2) - (2)].ulonglong_number); } break; case 1383: -#line 7456 "sql_yacc.yy" +#line 7458 "sql_yacc.yy" { Lex->wild= new (YYTHD->mem_root) String((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, system_charset_info); } break; case 1384: -#line 7459 "sql_yacc.yy" +#line 7461 "sql_yacc.yy" { Select->where= (yyvsp[(2) - (2)].item); if ((yyvsp[(2) - (2)].item)) @@ -23761,7 +23763,7 @@ break; case 1385: -#line 7470 "sql_yacc.yy" +#line 7472 "sql_yacc.yy" { LEX *lex= Lex; lex->lock_option= TL_READ; @@ -23777,17 +23779,17 @@ break; case 1386: -#line 7482 "sql_yacc.yy" +#line 7484 "sql_yacc.yy" {} break; case 1387: -#line 7484 "sql_yacc.yy" +#line 7486 "sql_yacc.yy" { Lex->describe|= DESCRIBE_NORMAL; } break; case 1388: -#line 7486 "sql_yacc.yy" +#line 7488 "sql_yacc.yy" { LEX *lex=Lex; lex->select_lex.options|= SELECT_DESCRIBE; @@ -23795,32 +23797,32 @@ break; case 1391: -#line 7497 "sql_yacc.yy" +#line 7499 "sql_yacc.yy" {} break; case 1392: -#line 7498 "sql_yacc.yy" +#line 7500 "sql_yacc.yy" { Lex->describe|= DESCRIBE_EXTENDED; } break; case 1393: -#line 7502 "sql_yacc.yy" +#line 7504 "sql_yacc.yy" {} break; case 1394: -#line 7503 "sql_yacc.yy" +#line 7505 "sql_yacc.yy" { Lex->wild= (yyvsp[(1) - (1)].string); } break; case 1395: -#line 7505 "sql_yacc.yy" +#line 7507 "sql_yacc.yy" { Lex->wild= new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); } break; case 1396: -#line 7512 "sql_yacc.yy" +#line 7514 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_FLUSH; @@ -23830,82 +23832,82 @@ break; case 1397: -#line 7519 "sql_yacc.yy" +#line 7521 "sql_yacc.yy" {} break; case 1400: -#line 7527 "sql_yacc.yy" +#line 7529 "sql_yacc.yy" { Lex->type|= REFRESH_TABLES; } break; case 1401: -#line 7527 "sql_yacc.yy" +#line 7529 "sql_yacc.yy" {} break; case 1402: -#line 7528 "sql_yacc.yy" +#line 7530 "sql_yacc.yy" { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; } break; case 1403: -#line 7529 "sql_yacc.yy" +#line 7531 "sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE_FREE; } break; case 1404: -#line 7530 "sql_yacc.yy" +#line 7532 "sql_yacc.yy" { Lex->type|= REFRESH_HOSTS; } break; case 1405: -#line 7531 "sql_yacc.yy" +#line 7533 "sql_yacc.yy" { Lex->type|= REFRESH_GRANT; } break; case 1406: -#line 7532 "sql_yacc.yy" +#line 7534 "sql_yacc.yy" { Lex->type|= REFRESH_LOG; } break; case 1407: -#line 7533 "sql_yacc.yy" +#line 7535 "sql_yacc.yy" { Lex->type|= REFRESH_STATUS; } break; case 1408: -#line 7534 "sql_yacc.yy" +#line 7536 "sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1409: -#line 7535 "sql_yacc.yy" +#line 7537 "sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1410: -#line 7536 "sql_yacc.yy" +#line 7538 "sql_yacc.yy" { Lex->type|= REFRESH_DES_KEY_FILE; } break; case 1411: -#line 7537 "sql_yacc.yy" +#line 7539 "sql_yacc.yy" { Lex->type|= REFRESH_USER_RESOURCES; } break; case 1412: -#line 7540 "sql_yacc.yy" +#line 7542 "sql_yacc.yy" {;} break; case 1413: -#line 7541 "sql_yacc.yy" +#line 7543 "sql_yacc.yy" {;} break; case 1414: -#line 7545 "sql_yacc.yy" +#line 7547 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RESET; lex->type=0; @@ -23913,27 +23915,27 @@ break; case 1415: -#line 7549 "sql_yacc.yy" +#line 7551 "sql_yacc.yy" {} break; case 1418: -#line 7557 "sql_yacc.yy" +#line 7559 "sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1419: -#line 7558 "sql_yacc.yy" +#line 7560 "sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1420: -#line 7559 "sql_yacc.yy" +#line 7561 "sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE;} break; case 1421: -#line 7563 "sql_yacc.yy" +#line 7565 "sql_yacc.yy" { LEX *lex=Lex; lex->type=0; @@ -23942,19 +23944,19 @@ break; case 1422: -#line 7568 "sql_yacc.yy" +#line 7570 "sql_yacc.yy" {} break; case 1424: -#line 7577 "sql_yacc.yy" +#line 7579 "sql_yacc.yy" { Lex->to_log = (yyvsp[(2) - (2)].lex_str).str; } break; case 1425: -#line 7581 "sql_yacc.yy" +#line 7583 "sql_yacc.yy" { LEX *lex= Lex; lex->value_list.empty(); @@ -23964,12 +23966,12 @@ break; case 1426: -#line 7592 "sql_yacc.yy" +#line 7594 "sql_yacc.yy" { Lex->sql_command= SQLCOM_KILL; } break; case 1427: -#line 7593 "sql_yacc.yy" +#line 7595 "sql_yacc.yy" { LEX *lex=Lex; lex->value_list.empty(); @@ -23978,22 +23980,22 @@ break; case 1428: -#line 7600 "sql_yacc.yy" +#line 7602 "sql_yacc.yy" { Lex->type= 0; } break; case 1429: -#line 7601 "sql_yacc.yy" +#line 7603 "sql_yacc.yy" { Lex->type= 0; } break; case 1430: -#line 7602 "sql_yacc.yy" +#line 7604 "sql_yacc.yy" { Lex->type= ONLY_KILL_QUERY; } break; case 1431: -#line 7608 "sql_yacc.yy" +#line 7610 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_CHANGE_DB; @@ -24002,7 +24004,7 @@ break; case 1432: -#line 7617 "sql_yacc.yy" +#line 7619 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24018,12 +24020,12 @@ break; case 1433: -#line 7630 "sql_yacc.yy" +#line 7632 "sql_yacc.yy" {} break; case 1434: -#line 7633 "sql_yacc.yy" +#line 7635 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -24041,7 +24043,7 @@ break; case 1435: -#line 7650 "sql_yacc.yy" +#line 7652 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_LOAD; @@ -24055,7 +24057,7 @@ break; case 1436: -#line 7661 "sql_yacc.yy" +#line 7663 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24065,7 +24067,7 @@ break; case 1437: -#line 7668 "sql_yacc.yy" +#line 7670 "sql_yacc.yy" { LEX *lex=Lex; if (!Select->add_table_to_list(YYTHD, (yyvsp[(10) - (10)].table), NULL, TL_OPTION_UPDATING, @@ -24078,17 +24080,17 @@ break; case 1438: -#line 7678 "sql_yacc.yy" +#line 7680 "sql_yacc.yy" { Lex->exchange->cs= (yyvsp[(12) - (12)].charset); } break; case 1439: -#line 7681 "sql_yacc.yy" +#line 7683 "sql_yacc.yy" {} break; case 1440: -#line 7684 "sql_yacc.yy" +#line 7686 "sql_yacc.yy" { Lex->sql_command = SQLCOM_LOAD_MASTER_DATA; WARN_DEPRECATED("LOAD DATA FROM MASTER", @@ -24098,22 +24100,22 @@ break; case 1441: -#line 7692 "sql_yacc.yy" +#line 7694 "sql_yacc.yy" { (yyval.num)=0;} break; case 1442: -#line 7693 "sql_yacc.yy" +#line 7695 "sql_yacc.yy" { (yyval.num)=1;} break; case 1443: -#line 7696 "sql_yacc.yy" +#line 7698 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1444: -#line 7698 "sql_yacc.yy" +#line 7700 "sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* @@ -24128,27 +24130,27 @@ break; case 1445: -#line 7709 "sql_yacc.yy" +#line 7711 "sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1446: -#line 7713 "sql_yacc.yy" +#line 7715 "sql_yacc.yy" { Lex->duplicates=DUP_ERROR; } break; case 1447: -#line 7714 "sql_yacc.yy" +#line 7716 "sql_yacc.yy" { Lex->duplicates=DUP_REPLACE; } break; case 1448: -#line 7715 "sql_yacc.yy" +#line 7717 "sql_yacc.yy" { Lex->ignore= 1; } break; case 1453: -#line 7727 "sql_yacc.yy" +#line 7729 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->field_term= (yyvsp[(3) - (3)].string); @@ -24156,7 +24158,7 @@ break; case 1454: -#line 7732 "sql_yacc.yy" +#line 7734 "sql_yacc.yy" { LEX *lex= Lex; DBUG_ASSERT(lex->exchange != 0); @@ -24166,7 +24168,7 @@ break; case 1455: -#line 7739 "sql_yacc.yy" +#line 7741 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->enclosed= (yyvsp[(3) - (3)].string); @@ -24174,7 +24176,7 @@ break; case 1456: -#line 7744 "sql_yacc.yy" +#line 7746 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->escaped= (yyvsp[(3) - (3)].string); @@ -24182,7 +24184,7 @@ break; case 1461: -#line 7759 "sql_yacc.yy" +#line 7761 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->line_term= (yyvsp[(3) - (3)].string); @@ -24190,7 +24192,7 @@ break; case 1462: -#line 7764 "sql_yacc.yy" +#line 7766 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->line_start= (yyvsp[(3) - (3)].string); @@ -24198,7 +24200,7 @@ break; case 1464: -#line 7772 "sql_yacc.yy" +#line 7774 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->skip_lines= atol((yyvsp[(2) - (3)].lex_str).str); @@ -24206,52 +24208,52 @@ break; case 1465: -#line 7778 "sql_yacc.yy" +#line 7780 "sql_yacc.yy" { } break; case 1466: -#line 7779 "sql_yacc.yy" +#line 7781 "sql_yacc.yy" { } break; case 1467: -#line 7780 "sql_yacc.yy" +#line 7782 "sql_yacc.yy" { } break; case 1468: -#line 7784 "sql_yacc.yy" +#line 7786 "sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1469: -#line 7786 "sql_yacc.yy" +#line 7788 "sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1470: -#line 7790 "sql_yacc.yy" +#line 7792 "sql_yacc.yy" {(yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1471: -#line 7792 "sql_yacc.yy" +#line 7794 "sql_yacc.yy" { (yyval.item)= new Item_user_var_as_out_param((yyvsp[(2) - (2)].lex_str)); } break; case 1472: -#line 7796 "sql_yacc.yy" +#line 7798 "sql_yacc.yy" { } break; case 1473: -#line 7797 "sql_yacc.yy" +#line 7799 "sql_yacc.yy" { } break; case 1474: -#line 7804 "sql_yacc.yy" +#line 7806 "sql_yacc.yy" { LEX_STRING tmp; THD *thd= YYTHD; @@ -24272,7 +24274,7 @@ break; case 1475: -#line 7822 "sql_yacc.yy" +#line 7824 "sql_yacc.yy" { uint repertoire= Lex->text_string_is_7bit ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30; @@ -24283,7 +24285,7 @@ break; case 1476: -#line 7830 "sql_yacc.yy" +#line 7832 "sql_yacc.yy" { (yyval.item)= new Item_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, Lex->underscore_charset); ((Item_string*) (yyval.item))->set_repertoire_from_value(); @@ -24291,7 +24293,7 @@ break; case 1477: -#line 7835 "sql_yacc.yy" +#line 7837 "sql_yacc.yy" { Item_string* item= (Item_string*) (yyvsp[(1) - (2)].item); item->append((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); @@ -24310,12 +24312,12 @@ break; case 1478: -#line 7854 "sql_yacc.yy" +#line 7856 "sql_yacc.yy" { (yyval.string)= new (YYTHD->mem_root) String((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,YYTHD->variables.collation_connection); } break; case 1479: -#line 7856 "sql_yacc.yy" +#line 7858 "sql_yacc.yy" { Item *tmp= new Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); /* @@ -24329,7 +24331,7 @@ break; case 1480: -#line 7867 "sql_yacc.yy" +#line 7869 "sql_yacc.yy" { Item *tmp= new Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); /* @@ -24342,7 +24344,7 @@ break; case 1481: -#line 7880 "sql_yacc.yy" +#line 7882 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24363,17 +24365,17 @@ break; case 1482: -#line 7900 "sql_yacc.yy" +#line 7902 "sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1483: -#line 7901 "sql_yacc.yy" +#line 7903 "sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item_num); } break; case 1484: -#line 7903 "sql_yacc.yy" +#line 7905 "sql_yacc.yy" { (yyvsp[(2) - (2)].item_num)->max_length++; (yyval.item)= (yyvsp[(2) - (2)].item_num)->neg(); @@ -24381,17 +24383,17 @@ break; case 1485: -#line 7911 "sql_yacc.yy" +#line 7913 "sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1486: -#line 7912 "sql_yacc.yy" +#line 7914 "sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item_num); } break; case 1487: -#line 7914 "sql_yacc.yy" +#line 7916 "sql_yacc.yy" { (yyval.item) = new Item_null(); YYTHD->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT; @@ -24399,27 +24401,27 @@ break; case 1488: -#line 7918 "sql_yacc.yy" +#line 7920 "sql_yacc.yy" { (yyval.item)= new Item_int((char*) "FALSE",0,1); } break; case 1489: -#line 7919 "sql_yacc.yy" +#line 7921 "sql_yacc.yy" { (yyval.item)= new Item_int((char*) "TRUE",1,1); } break; case 1490: -#line 7920 "sql_yacc.yy" +#line 7922 "sql_yacc.yy" { (yyval.item) = new Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);} break; case 1491: -#line 7921 "sql_yacc.yy" +#line 7923 "sql_yacc.yy" { (yyval.item)= new Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1492: -#line 7923 "sql_yacc.yy" +#line 7925 "sql_yacc.yy" { Item *tmp= new Item_hex_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); /* @@ -24438,7 +24440,7 @@ break; case 1493: -#line 7939 "sql_yacc.yy" +#line 7941 "sql_yacc.yy" { Item *tmp= new Item_bin_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); /* @@ -24455,37 +24457,37 @@ break; case 1494: -#line 7952 "sql_yacc.yy" +#line 7954 "sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1495: -#line 7953 "sql_yacc.yy" +#line 7955 "sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1496: -#line 7954 "sql_yacc.yy" +#line 7956 "sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1497: -#line 7957 "sql_yacc.yy" +#line 7959 "sql_yacc.yy" { int error; (yyval.item_num) = new Item_int((yyvsp[(1) - (1)].lex_str).str, (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error), (yyvsp[(1) - (1)].lex_str).length); } break; case 1498: -#line 7958 "sql_yacc.yy" +#line 7960 "sql_yacc.yy" { int error; (yyval.item_num) = new Item_int((yyvsp[(1) - (1)].lex_str).str, (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error), (yyvsp[(1) - (1)].lex_str).length); } break; case 1499: -#line 7959 "sql_yacc.yy" +#line 7961 "sql_yacc.yy" { (yyval.item_num) = new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1500: -#line 7961 "sql_yacc.yy" +#line 7963 "sql_yacc.yy" { (yyval.item_num)= new Item_decimal((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, YYTHD->charset()); if (YYTHD->net.report_error) @@ -24496,7 +24498,7 @@ break; case 1501: -#line 7969 "sql_yacc.yy" +#line 7971 "sql_yacc.yy" { (yyval.item_num) = new Item_float((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (YYTHD->net.report_error) @@ -24507,17 +24509,17 @@ break; case 1502: -#line 7983 "sql_yacc.yy" +#line 7985 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1503: -#line 7984 "sql_yacc.yy" +#line 7986 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1504: -#line 7988 "sql_yacc.yy" +#line 7990 "sql_yacc.yy" { SELECT_LEX *sel= Select; (yyval.item) = new Item_field(Lex->current_context(), NullS, (yyvsp[(1) - (3)].lex_str).str, "*"); @@ -24526,7 +24528,7 @@ break; case 1505: -#line 7994 "sql_yacc.yy" +#line 7996 "sql_yacc.yy" { SELECT_LEX *sel= Select; (yyval.item) = new Item_field(Lex->current_context(), (YYTHD->client_capabilities & @@ -24537,12 +24539,12 @@ break; case 1506: -#line 8004 "sql_yacc.yy" +#line 8006 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1507: -#line 8008 "sql_yacc.yy" +#line 8010 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24582,12 +24584,12 @@ break; case 1508: -#line 8044 "sql_yacc.yy" +#line 8046 "sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1509: -#line 8049 "sql_yacc.yy" +#line 8051 "sql_yacc.yy" { SELECT_LEX *sel=Select; (yyval.item)= (sel->parsing_place != IN_HAVING || @@ -24598,12 +24600,12 @@ break; case 1510: -#line 8056 "sql_yacc.yy" +#line 8058 "sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1511: -#line 8061 "sql_yacc.yy" +#line 8063 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24674,7 +24676,7 @@ break; case 1512: -#line 8129 "sql_yacc.yy" +#line 8131 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24692,7 +24694,7 @@ break; case 1513: -#line 8144 "sql_yacc.yy" +#line 8146 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24716,12 +24718,12 @@ break; case 1514: -#line 8167 "sql_yacc.yy" +#line 8169 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1515: -#line 8169 "sql_yacc.yy" +#line 8171 "sql_yacc.yy" { TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (5)].lex_str).str, table->db)) @@ -24740,7 +24742,7 @@ break; case 1516: -#line 8185 "sql_yacc.yy" +#line 8187 "sql_yacc.yy" { TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (3)].lex_str).str, table->alias)) @@ -24753,37 +24755,37 @@ break; case 1517: -#line 8194 "sql_yacc.yy" +#line 8196 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str);} break; case 1518: -#line 8197 "sql_yacc.yy" +#line 8199 "sql_yacc.yy" { (yyval.table)=new Table_ident((yyvsp[(1) - (1)].lex_str)); } break; case 1519: -#line 8198 "sql_yacc.yy" +#line 8200 "sql_yacc.yy" { (yyval.table)=new Table_ident(YYTHD, (yyvsp[(1) - (3)].lex_str),(yyvsp[(3) - (3)].lex_str),0);} break; case 1520: -#line 8199 "sql_yacc.yy" +#line 8201 "sql_yacc.yy" { (yyval.table)=new Table_ident((yyvsp[(2) - (2)].lex_str));} break; case 1521: -#line 8203 "sql_yacc.yy" +#line 8205 "sql_yacc.yy" { LEX_STRING db={(char*) any_db,3}; (yyval.table)=new Table_ident(YYTHD, db,(yyvsp[(1) - (1)].lex_str),0); } break; case 1522: -#line 8207 "sql_yacc.yy" +#line 8209 "sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 1523: -#line 8209 "sql_yacc.yy" +#line 8211 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_system_charset) @@ -24808,7 +24810,7 @@ break; case 1524: -#line 8234 "sql_yacc.yy" +#line 8236 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_system_charset) @@ -24820,7 +24822,7 @@ break; case 1525: -#line 8246 "sql_yacc.yy" +#line 8248 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_collation_connection) @@ -24832,7 +24834,7 @@ break; case 1526: -#line 8259 "sql_yacc.yy" +#line 8261 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_character_set_filesystem) @@ -24844,12 +24846,12 @@ break; case 1527: -#line 8270 "sql_yacc.yy" +#line 8272 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1528: -#line 8272 "sql_yacc.yy" +#line 8274 "sql_yacc.yy" { THD *thd= YYTHD; (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); @@ -24858,12 +24860,12 @@ break; case 1529: -#line 8280 "sql_yacc.yy" +#line 8282 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1530: -#line 8282 "sql_yacc.yy" +#line 8284 "sql_yacc.yy" { THD *thd= YYTHD; (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); @@ -24872,22 +24874,22 @@ break; case 1531: -#line 8290 "sql_yacc.yy" +#line 8292 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1532: -#line 8291 "sql_yacc.yy" +#line 8293 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1533: -#line 8292 "sql_yacc.yy" +#line 8294 "sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1534: -#line 8296 "sql_yacc.yy" +#line 8298 "sql_yacc.yy" { THD *thd= YYTHD; if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) @@ -24903,7 +24905,7 @@ break; case 1535: -#line 8309 "sql_yacc.yy" +#line 8311 "sql_yacc.yy" { THD *thd= YYTHD; if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) @@ -24919,7 +24921,7 @@ break; case 1536: -#line 8322 "sql_yacc.yy" +#line 8324 "sql_yacc.yy" { if (!((yyval.lex_user)=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; @@ -24933,1372 +24935,1372 @@ break; case 1537: -#line 8335 "sql_yacc.yy" +#line 8337 "sql_yacc.yy" {} break; case 1538: -#line 8336 "sql_yacc.yy" +#line 8338 "sql_yacc.yy" {} break; case 1539: -#line 8337 "sql_yacc.yy" +#line 8339 "sql_yacc.yy" {} break; case 1540: -#line 8338 "sql_yacc.yy" +#line 8340 "sql_yacc.yy" {} break; case 1541: -#line 8339 "sql_yacc.yy" +#line 8341 "sql_yacc.yy" {} break; case 1542: -#line 8340 "sql_yacc.yy" +#line 8342 "sql_yacc.yy" {} break; case 1543: -#line 8341 "sql_yacc.yy" +#line 8343 "sql_yacc.yy" {} break; case 1544: -#line 8342 "sql_yacc.yy" +#line 8344 "sql_yacc.yy" {} break; case 1545: -#line 8343 "sql_yacc.yy" +#line 8345 "sql_yacc.yy" {} break; case 1546: -#line 8344 "sql_yacc.yy" +#line 8346 "sql_yacc.yy" {} break; case 1547: -#line 8345 "sql_yacc.yy" +#line 8347 "sql_yacc.yy" {} break; case 1548: -#line 8346 "sql_yacc.yy" +#line 8348 "sql_yacc.yy" {} break; case 1549: -#line 8347 "sql_yacc.yy" +#line 8349 "sql_yacc.yy" {} break; case 1550: -#line 8348 "sql_yacc.yy" +#line 8350 "sql_yacc.yy" {} break; case 1551: -#line 8349 "sql_yacc.yy" +#line 8351 "sql_yacc.yy" {} break; case 1552: -#line 8350 "sql_yacc.yy" +#line 8352 "sql_yacc.yy" {} break; case 1553: -#line 8351 "sql_yacc.yy" +#line 8353 "sql_yacc.yy" {} break; case 1554: -#line 8352 "sql_yacc.yy" +#line 8354 "sql_yacc.yy" {} break; case 1555: -#line 8353 "sql_yacc.yy" +#line 8355 "sql_yacc.yy" {} break; case 1556: -#line 8354 "sql_yacc.yy" +#line 8356 "sql_yacc.yy" {} break; case 1557: -#line 8355 "sql_yacc.yy" +#line 8357 "sql_yacc.yy" {} break; case 1558: -#line 8356 "sql_yacc.yy" +#line 8358 "sql_yacc.yy" {} break; case 1559: -#line 8357 "sql_yacc.yy" +#line 8359 "sql_yacc.yy" {} break; case 1560: -#line 8358 "sql_yacc.yy" +#line 8360 "sql_yacc.yy" {} break; case 1561: -#line 8359 "sql_yacc.yy" +#line 8361 "sql_yacc.yy" {} break; case 1562: -#line 8360 "sql_yacc.yy" +#line 8362 "sql_yacc.yy" {} break; case 1563: -#line 8361 "sql_yacc.yy" +#line 8363 "sql_yacc.yy" {} break; case 1564: -#line 8362 "sql_yacc.yy" +#line 8364 "sql_yacc.yy" {} break; case 1565: -#line 8363 "sql_yacc.yy" +#line 8365 "sql_yacc.yy" {} break; case 1566: -#line 8364 "sql_yacc.yy" +#line 8366 "sql_yacc.yy" {} break; case 1567: -#line 8365 "sql_yacc.yy" +#line 8367 "sql_yacc.yy" {} break; case 1568: -#line 8366 "sql_yacc.yy" +#line 8368 "sql_yacc.yy" {} break; case 1569: -#line 8367 "sql_yacc.yy" +#line 8369 "sql_yacc.yy" {} break; case 1570: -#line 8368 "sql_yacc.yy" +#line 8370 "sql_yacc.yy" {} break; case 1571: -#line 8369 "sql_yacc.yy" +#line 8371 "sql_yacc.yy" {} break; case 1572: -#line 8370 "sql_yacc.yy" +#line 8372 "sql_yacc.yy" {} break; case 1573: -#line 8371 "sql_yacc.yy" +#line 8373 "sql_yacc.yy" {} break; case 1574: -#line 8381 "sql_yacc.yy" +#line 8383 "sql_yacc.yy" {} break; case 1575: -#line 8382 "sql_yacc.yy" +#line 8384 "sql_yacc.yy" {} break; case 1576: -#line 8383 "sql_yacc.yy" +#line 8385 "sql_yacc.yy" {} break; case 1577: -#line 8384 "sql_yacc.yy" +#line 8386 "sql_yacc.yy" {} break; case 1578: -#line 8385 "sql_yacc.yy" +#line 8387 "sql_yacc.yy" {} break; case 1579: -#line 8386 "sql_yacc.yy" +#line 8388 "sql_yacc.yy" {} break; case 1580: -#line 8387 "sql_yacc.yy" +#line 8389 "sql_yacc.yy" {} break; case 1581: -#line 8388 "sql_yacc.yy" +#line 8390 "sql_yacc.yy" {} break; case 1582: -#line 8389 "sql_yacc.yy" +#line 8391 "sql_yacc.yy" {} break; case 1583: -#line 8390 "sql_yacc.yy" +#line 8392 "sql_yacc.yy" {} break; case 1584: -#line 8391 "sql_yacc.yy" +#line 8393 "sql_yacc.yy" {} break; case 1585: -#line 8392 "sql_yacc.yy" +#line 8394 "sql_yacc.yy" {} break; case 1586: -#line 8393 "sql_yacc.yy" +#line 8395 "sql_yacc.yy" {} break; case 1587: -#line 8394 "sql_yacc.yy" +#line 8396 "sql_yacc.yy" {} break; case 1588: -#line 8395 "sql_yacc.yy" +#line 8397 "sql_yacc.yy" {} break; case 1589: -#line 8396 "sql_yacc.yy" +#line 8398 "sql_yacc.yy" {} break; case 1590: -#line 8397 "sql_yacc.yy" +#line 8399 "sql_yacc.yy" {} break; case 1591: -#line 8398 "sql_yacc.yy" +#line 8400 "sql_yacc.yy" {} break; case 1592: -#line 8399 "sql_yacc.yy" +#line 8401 "sql_yacc.yy" {} break; case 1593: -#line 8400 "sql_yacc.yy" +#line 8402 "sql_yacc.yy" {} break; case 1594: -#line 8401 "sql_yacc.yy" +#line 8403 "sql_yacc.yy" {} break; case 1595: -#line 8402 "sql_yacc.yy" +#line 8404 "sql_yacc.yy" {} break; case 1596: -#line 8403 "sql_yacc.yy" +#line 8405 "sql_yacc.yy" {} break; case 1597: -#line 8404 "sql_yacc.yy" +#line 8406 "sql_yacc.yy" {} break; case 1598: -#line 8405 "sql_yacc.yy" +#line 8407 "sql_yacc.yy" {} break; case 1599: -#line 8406 "sql_yacc.yy" +#line 8408 "sql_yacc.yy" {} break; case 1600: -#line 8407 "sql_yacc.yy" +#line 8409 "sql_yacc.yy" {} break; case 1601: -#line 8408 "sql_yacc.yy" +#line 8410 "sql_yacc.yy" {} break; case 1602: -#line 8409 "sql_yacc.yy" +#line 8411 "sql_yacc.yy" {} break; case 1603: -#line 8410 "sql_yacc.yy" +#line 8412 "sql_yacc.yy" {} break; case 1604: -#line 8411 "sql_yacc.yy" +#line 8413 "sql_yacc.yy" {} break; case 1605: -#line 8412 "sql_yacc.yy" +#line 8414 "sql_yacc.yy" {} break; case 1606: -#line 8413 "sql_yacc.yy" +#line 8415 "sql_yacc.yy" {} break; case 1607: -#line 8414 "sql_yacc.yy" +#line 8416 "sql_yacc.yy" {} break; case 1608: -#line 8415 "sql_yacc.yy" +#line 8417 "sql_yacc.yy" {} break; case 1609: -#line 8416 "sql_yacc.yy" +#line 8418 "sql_yacc.yy" {} break; case 1610: -#line 8417 "sql_yacc.yy" +#line 8419 "sql_yacc.yy" {} break; case 1611: -#line 8418 "sql_yacc.yy" +#line 8420 "sql_yacc.yy" {} break; case 1612: -#line 8419 "sql_yacc.yy" +#line 8421 "sql_yacc.yy" {} break; case 1613: -#line 8420 "sql_yacc.yy" +#line 8422 "sql_yacc.yy" {} break; case 1614: -#line 8421 "sql_yacc.yy" +#line 8423 "sql_yacc.yy" {} break; case 1615: -#line 8422 "sql_yacc.yy" +#line 8424 "sql_yacc.yy" {} break; case 1616: -#line 8423 "sql_yacc.yy" +#line 8425 "sql_yacc.yy" {} break; case 1617: -#line 8424 "sql_yacc.yy" +#line 8426 "sql_yacc.yy" {} break; case 1618: -#line 8425 "sql_yacc.yy" +#line 8427 "sql_yacc.yy" {} break; case 1619: -#line 8426 "sql_yacc.yy" +#line 8428 "sql_yacc.yy" {} break; case 1620: -#line 8427 "sql_yacc.yy" +#line 8429 "sql_yacc.yy" {} break; case 1621: -#line 8428 "sql_yacc.yy" +#line 8430 "sql_yacc.yy" {} break; case 1622: -#line 8429 "sql_yacc.yy" +#line 8431 "sql_yacc.yy" {} break; case 1623: -#line 8430 "sql_yacc.yy" +#line 8432 "sql_yacc.yy" {} break; case 1624: -#line 8431 "sql_yacc.yy" +#line 8433 "sql_yacc.yy" {} break; case 1625: -#line 8432 "sql_yacc.yy" +#line 8434 "sql_yacc.yy" {} break; case 1626: -#line 8433 "sql_yacc.yy" +#line 8435 "sql_yacc.yy" {} break; case 1627: -#line 8434 "sql_yacc.yy" +#line 8436 "sql_yacc.yy" {} break; case 1628: -#line 8435 "sql_yacc.yy" +#line 8437 "sql_yacc.yy" {} break; case 1629: -#line 8436 "sql_yacc.yy" +#line 8438 "sql_yacc.yy" {} break; case 1630: -#line 8437 "sql_yacc.yy" +#line 8439 "sql_yacc.yy" {} break; case 1631: -#line 8438 "sql_yacc.yy" +#line 8440 "sql_yacc.yy" {} break; case 1632: -#line 8439 "sql_yacc.yy" +#line 8441 "sql_yacc.yy" {} break; case 1633: -#line 8440 "sql_yacc.yy" +#line 8442 "sql_yacc.yy" {} break; case 1634: -#line 8441 "sql_yacc.yy" +#line 8443 "sql_yacc.yy" {} break; case 1635: -#line 8442 "sql_yacc.yy" +#line 8444 "sql_yacc.yy" {} break; case 1636: -#line 8443 "sql_yacc.yy" +#line 8445 "sql_yacc.yy" {} break; case 1637: -#line 8444 "sql_yacc.yy" +#line 8446 "sql_yacc.yy" {} break; case 1638: -#line 8445 "sql_yacc.yy" +#line 8447 "sql_yacc.yy" {} break; case 1639: -#line 8446 "sql_yacc.yy" +#line 8448 "sql_yacc.yy" {} break; case 1640: -#line 8447 "sql_yacc.yy" +#line 8449 "sql_yacc.yy" {} break; case 1641: -#line 8448 "sql_yacc.yy" +#line 8450 "sql_yacc.yy" {} break; case 1642: -#line 8449 "sql_yacc.yy" +#line 8451 "sql_yacc.yy" {} break; case 1643: -#line 8450 "sql_yacc.yy" +#line 8452 "sql_yacc.yy" {} break; case 1644: -#line 8451 "sql_yacc.yy" +#line 8453 "sql_yacc.yy" {} break; case 1645: -#line 8452 "sql_yacc.yy" +#line 8454 "sql_yacc.yy" {} break; case 1646: -#line 8453 "sql_yacc.yy" +#line 8455 "sql_yacc.yy" {} break; case 1647: -#line 8454 "sql_yacc.yy" +#line 8456 "sql_yacc.yy" {} break; case 1648: -#line 8455 "sql_yacc.yy" +#line 8457 "sql_yacc.yy" {} break; case 1649: -#line 8456 "sql_yacc.yy" +#line 8458 "sql_yacc.yy" {} break; case 1650: -#line 8457 "sql_yacc.yy" +#line 8459 "sql_yacc.yy" {} break; case 1651: -#line 8458 "sql_yacc.yy" +#line 8460 "sql_yacc.yy" {} break; case 1652: -#line 8459 "sql_yacc.yy" +#line 8461 "sql_yacc.yy" {} break; case 1653: -#line 8460 "sql_yacc.yy" +#line 8462 "sql_yacc.yy" {} break; case 1654: -#line 8461 "sql_yacc.yy" +#line 8463 "sql_yacc.yy" {} break; case 1655: -#line 8462 "sql_yacc.yy" +#line 8464 "sql_yacc.yy" {} break; case 1656: -#line 8463 "sql_yacc.yy" +#line 8465 "sql_yacc.yy" {} break; case 1657: -#line 8464 "sql_yacc.yy" +#line 8466 "sql_yacc.yy" {} break; case 1658: -#line 8465 "sql_yacc.yy" +#line 8467 "sql_yacc.yy" {} break; case 1659: -#line 8466 "sql_yacc.yy" +#line 8468 "sql_yacc.yy" {} break; case 1660: -#line 8467 "sql_yacc.yy" +#line 8469 "sql_yacc.yy" {} break; case 1661: -#line 8468 "sql_yacc.yy" +#line 8470 "sql_yacc.yy" {} break; case 1662: -#line 8469 "sql_yacc.yy" +#line 8471 "sql_yacc.yy" {} break; case 1663: -#line 8470 "sql_yacc.yy" +#line 8472 "sql_yacc.yy" {} break; case 1664: -#line 8471 "sql_yacc.yy" +#line 8473 "sql_yacc.yy" {} break; case 1665: -#line 8472 "sql_yacc.yy" +#line 8474 "sql_yacc.yy" {} break; case 1666: -#line 8473 "sql_yacc.yy" +#line 8475 "sql_yacc.yy" {} break; case 1667: -#line 8474 "sql_yacc.yy" +#line 8476 "sql_yacc.yy" {} break; case 1668: -#line 8475 "sql_yacc.yy" +#line 8477 "sql_yacc.yy" {} break; case 1669: -#line 8476 "sql_yacc.yy" +#line 8478 "sql_yacc.yy" {} break; case 1670: -#line 8477 "sql_yacc.yy" +#line 8479 "sql_yacc.yy" {} break; case 1671: -#line 8478 "sql_yacc.yy" +#line 8480 "sql_yacc.yy" {} break; case 1672: -#line 8479 "sql_yacc.yy" +#line 8481 "sql_yacc.yy" {} break; case 1673: -#line 8480 "sql_yacc.yy" +#line 8482 "sql_yacc.yy" {} break; case 1674: -#line 8481 "sql_yacc.yy" +#line 8483 "sql_yacc.yy" {} break; case 1675: -#line 8482 "sql_yacc.yy" +#line 8484 "sql_yacc.yy" {} break; case 1676: -#line 8483 "sql_yacc.yy" +#line 8485 "sql_yacc.yy" {} break; case 1677: -#line 8484 "sql_yacc.yy" +#line 8486 "sql_yacc.yy" {} break; case 1678: -#line 8485 "sql_yacc.yy" +#line 8487 "sql_yacc.yy" {} break; case 1679: -#line 8486 "sql_yacc.yy" +#line 8488 "sql_yacc.yy" {} break; case 1680: -#line 8487 "sql_yacc.yy" +#line 8489 "sql_yacc.yy" {} break; case 1681: -#line 8488 "sql_yacc.yy" +#line 8490 "sql_yacc.yy" {} break; case 1682: -#line 8489 "sql_yacc.yy" +#line 8491 "sql_yacc.yy" {} break; case 1683: -#line 8490 "sql_yacc.yy" +#line 8492 "sql_yacc.yy" {} break; case 1684: -#line 8491 "sql_yacc.yy" +#line 8493 "sql_yacc.yy" {} break; case 1685: -#line 8492 "sql_yacc.yy" +#line 8494 "sql_yacc.yy" {} break; case 1686: -#line 8493 "sql_yacc.yy" +#line 8495 "sql_yacc.yy" {} break; case 1687: -#line 8494 "sql_yacc.yy" +#line 8496 "sql_yacc.yy" {} break; case 1688: -#line 8495 "sql_yacc.yy" +#line 8497 "sql_yacc.yy" {} break; case 1689: -#line 8496 "sql_yacc.yy" +#line 8498 "sql_yacc.yy" {} break; case 1690: -#line 8497 "sql_yacc.yy" +#line 8499 "sql_yacc.yy" {} break; case 1691: -#line 8498 "sql_yacc.yy" +#line 8500 "sql_yacc.yy" {} break; case 1692: -#line 8499 "sql_yacc.yy" +#line 8501 "sql_yacc.yy" {} break; case 1693: -#line 8500 "sql_yacc.yy" +#line 8502 "sql_yacc.yy" {} break; case 1694: -#line 8501 "sql_yacc.yy" +#line 8503 "sql_yacc.yy" {} break; case 1695: -#line 8502 "sql_yacc.yy" +#line 8504 "sql_yacc.yy" {} break; case 1696: -#line 8503 "sql_yacc.yy" +#line 8505 "sql_yacc.yy" {} break; case 1697: -#line 8504 "sql_yacc.yy" +#line 8506 "sql_yacc.yy" {} break; case 1698: -#line 8505 "sql_yacc.yy" +#line 8507 "sql_yacc.yy" {} break; case 1699: -#line 8506 "sql_yacc.yy" +#line 8508 "sql_yacc.yy" {} break; case 1700: -#line 8507 "sql_yacc.yy" +#line 8509 "sql_yacc.yy" {} break; case 1701: -#line 8508 "sql_yacc.yy" +#line 8510 "sql_yacc.yy" {} break; case 1702: -#line 8509 "sql_yacc.yy" +#line 8511 "sql_yacc.yy" {} break; case 1703: -#line 8510 "sql_yacc.yy" +#line 8512 "sql_yacc.yy" {} break; case 1704: -#line 8511 "sql_yacc.yy" +#line 8513 "sql_yacc.yy" {} break; case 1705: -#line 8512 "sql_yacc.yy" +#line 8514 "sql_yacc.yy" {} break; case 1706: -#line 8513 "sql_yacc.yy" +#line 8515 "sql_yacc.yy" {} break; case 1707: -#line 8514 "sql_yacc.yy" +#line 8516 "sql_yacc.yy" {} break; case 1708: -#line 8515 "sql_yacc.yy" +#line 8517 "sql_yacc.yy" {} break; case 1709: -#line 8516 "sql_yacc.yy" +#line 8518 "sql_yacc.yy" {} break; case 1710: -#line 8517 "sql_yacc.yy" +#line 8519 "sql_yacc.yy" {} break; case 1711: -#line 8518 "sql_yacc.yy" +#line 8520 "sql_yacc.yy" {} break; case 1712: -#line 8519 "sql_yacc.yy" +#line 8521 "sql_yacc.yy" {} break; case 1713: -#line 8520 "sql_yacc.yy" +#line 8522 "sql_yacc.yy" {} break; case 1714: -#line 8521 "sql_yacc.yy" +#line 8523 "sql_yacc.yy" {} break; case 1715: -#line 8522 "sql_yacc.yy" +#line 8524 "sql_yacc.yy" {} break; case 1716: -#line 8523 "sql_yacc.yy" +#line 8525 "sql_yacc.yy" {} break; case 1717: -#line 8524 "sql_yacc.yy" +#line 8526 "sql_yacc.yy" {} break; case 1718: -#line 8525 "sql_yacc.yy" +#line 8527 "sql_yacc.yy" {} break; case 1719: -#line 8526 "sql_yacc.yy" +#line 8528 "sql_yacc.yy" {} break; case 1720: -#line 8527 "sql_yacc.yy" +#line 8529 "sql_yacc.yy" {} break; case 1721: -#line 8528 "sql_yacc.yy" +#line 8530 "sql_yacc.yy" {} break; case 1722: -#line 8529 "sql_yacc.yy" +#line 8531 "sql_yacc.yy" {} break; case 1723: -#line 8530 "sql_yacc.yy" +#line 8532 "sql_yacc.yy" {} break; case 1724: -#line 8531 "sql_yacc.yy" +#line 8533 "sql_yacc.yy" {} break; case 1725: -#line 8532 "sql_yacc.yy" +#line 8534 "sql_yacc.yy" {} break; case 1726: -#line 8533 "sql_yacc.yy" +#line 8535 "sql_yacc.yy" {} break; case 1727: -#line 8534 "sql_yacc.yy" +#line 8536 "sql_yacc.yy" {} break; case 1728: -#line 8535 "sql_yacc.yy" +#line 8537 "sql_yacc.yy" {} break; case 1729: -#line 8536 "sql_yacc.yy" +#line 8538 "sql_yacc.yy" {} break; case 1730: -#line 8537 "sql_yacc.yy" +#line 8539 "sql_yacc.yy" {} break; case 1731: -#line 8538 "sql_yacc.yy" +#line 8540 "sql_yacc.yy" {} break; case 1732: -#line 8539 "sql_yacc.yy" +#line 8541 "sql_yacc.yy" {} break; case 1733: -#line 8540 "sql_yacc.yy" +#line 8542 "sql_yacc.yy" {} break; case 1734: -#line 8541 "sql_yacc.yy" +#line 8543 "sql_yacc.yy" {} break; case 1735: -#line 8542 "sql_yacc.yy" +#line 8544 "sql_yacc.yy" {} break; case 1736: -#line 8543 "sql_yacc.yy" +#line 8545 "sql_yacc.yy" {} break; case 1737: -#line 8544 "sql_yacc.yy" +#line 8546 "sql_yacc.yy" {} break; case 1738: -#line 8545 "sql_yacc.yy" +#line 8547 "sql_yacc.yy" {} break; case 1739: -#line 8546 "sql_yacc.yy" +#line 8548 "sql_yacc.yy" {} break; case 1740: -#line 8547 "sql_yacc.yy" +#line 8549 "sql_yacc.yy" {} break; case 1741: -#line 8548 "sql_yacc.yy" +#line 8550 "sql_yacc.yy" {} break; case 1742: -#line 8549 "sql_yacc.yy" +#line 8551 "sql_yacc.yy" {} break; case 1743: -#line 8550 "sql_yacc.yy" +#line 8552 "sql_yacc.yy" {} break; case 1744: -#line 8551 "sql_yacc.yy" +#line 8553 "sql_yacc.yy" {} break; case 1745: -#line 8552 "sql_yacc.yy" +#line 8554 "sql_yacc.yy" {} break; case 1746: -#line 8553 "sql_yacc.yy" +#line 8555 "sql_yacc.yy" {} break; case 1747: -#line 8554 "sql_yacc.yy" +#line 8556 "sql_yacc.yy" {} break; case 1748: -#line 8555 "sql_yacc.yy" +#line 8557 "sql_yacc.yy" {} break; case 1749: -#line 8556 "sql_yacc.yy" +#line 8558 "sql_yacc.yy" {} break; case 1750: -#line 8557 "sql_yacc.yy" +#line 8559 "sql_yacc.yy" {} break; case 1751: -#line 8558 "sql_yacc.yy" +#line 8560 "sql_yacc.yy" {} break; case 1752: -#line 8559 "sql_yacc.yy" +#line 8561 "sql_yacc.yy" {} break; case 1753: -#line 8560 "sql_yacc.yy" +#line 8562 "sql_yacc.yy" {} break; case 1754: -#line 8561 "sql_yacc.yy" +#line 8563 "sql_yacc.yy" {} break; case 1755: -#line 8562 "sql_yacc.yy" +#line 8564 "sql_yacc.yy" {} break; case 1756: -#line 8563 "sql_yacc.yy" +#line 8565 "sql_yacc.yy" {} break; case 1757: -#line 8564 "sql_yacc.yy" +#line 8566 "sql_yacc.yy" {} break; case 1758: -#line 8565 "sql_yacc.yy" +#line 8567 "sql_yacc.yy" {} break; case 1759: -#line 8566 "sql_yacc.yy" +#line 8568 "sql_yacc.yy" {} break; case 1760: -#line 8567 "sql_yacc.yy" +#line 8569 "sql_yacc.yy" {} break; case 1761: -#line 8568 "sql_yacc.yy" +#line 8570 "sql_yacc.yy" {} break; case 1762: -#line 8569 "sql_yacc.yy" +#line 8571 "sql_yacc.yy" {} break; case 1763: -#line 8570 "sql_yacc.yy" +#line 8572 "sql_yacc.yy" {} break; case 1764: -#line 8571 "sql_yacc.yy" +#line 8573 "sql_yacc.yy" {} break; case 1765: -#line 8572 "sql_yacc.yy" +#line 8574 "sql_yacc.yy" {} break; case 1766: -#line 8573 "sql_yacc.yy" +#line 8575 "sql_yacc.yy" {} break; case 1767: -#line 8574 "sql_yacc.yy" +#line 8576 "sql_yacc.yy" {} break; case 1768: -#line 8575 "sql_yacc.yy" +#line 8577 "sql_yacc.yy" {} break; case 1769: -#line 8576 "sql_yacc.yy" +#line 8578 "sql_yacc.yy" {} break; case 1770: -#line 8577 "sql_yacc.yy" +#line 8579 "sql_yacc.yy" {} break; case 1771: -#line 8578 "sql_yacc.yy" +#line 8580 "sql_yacc.yy" {} break; case 1772: -#line 8579 "sql_yacc.yy" +#line 8581 "sql_yacc.yy" {} break; case 1773: -#line 8580 "sql_yacc.yy" +#line 8582 "sql_yacc.yy" {} break; case 1774: -#line 8581 "sql_yacc.yy" +#line 8583 "sql_yacc.yy" {} break; case 1775: -#line 8582 "sql_yacc.yy" +#line 8584 "sql_yacc.yy" {} break; case 1776: -#line 8583 "sql_yacc.yy" +#line 8585 "sql_yacc.yy" {} break; case 1777: -#line 8584 "sql_yacc.yy" +#line 8586 "sql_yacc.yy" {} break; case 1778: -#line 8585 "sql_yacc.yy" +#line 8587 "sql_yacc.yy" {} break; case 1779: -#line 8586 "sql_yacc.yy" +#line 8588 "sql_yacc.yy" {} break; case 1780: -#line 8587 "sql_yacc.yy" +#line 8589 "sql_yacc.yy" {} break; case 1781: -#line 8588 "sql_yacc.yy" +#line 8590 "sql_yacc.yy" {} break; case 1782: -#line 8589 "sql_yacc.yy" +#line 8591 "sql_yacc.yy" {} break; case 1783: -#line 8590 "sql_yacc.yy" +#line 8592 "sql_yacc.yy" {} break; case 1784: -#line 8591 "sql_yacc.yy" +#line 8593 "sql_yacc.yy" {} break; case 1785: -#line 8592 "sql_yacc.yy" +#line 8594 "sql_yacc.yy" {} break; case 1786: -#line 8593 "sql_yacc.yy" +#line 8595 "sql_yacc.yy" {} break; case 1787: -#line 8594 "sql_yacc.yy" +#line 8596 "sql_yacc.yy" {} break; case 1788: -#line 8595 "sql_yacc.yy" +#line 8597 "sql_yacc.yy" {} break; case 1789: -#line 8596 "sql_yacc.yy" +#line 8598 "sql_yacc.yy" {} break; case 1790: -#line 8597 "sql_yacc.yy" +#line 8599 "sql_yacc.yy" {} break; case 1791: -#line 8598 "sql_yacc.yy" +#line 8600 "sql_yacc.yy" {} break; case 1792: -#line 8599 "sql_yacc.yy" +#line 8601 "sql_yacc.yy" {} break; case 1793: -#line 8600 "sql_yacc.yy" +#line 8602 "sql_yacc.yy" {} break; case 1794: -#line 8601 "sql_yacc.yy" +#line 8603 "sql_yacc.yy" {} break; case 1795: -#line 8602 "sql_yacc.yy" +#line 8604 "sql_yacc.yy" {} break; case 1796: -#line 8603 "sql_yacc.yy" +#line 8605 "sql_yacc.yy" {} break; case 1797: -#line 8604 "sql_yacc.yy" +#line 8606 "sql_yacc.yy" {} break; case 1798: -#line 8605 "sql_yacc.yy" +#line 8607 "sql_yacc.yy" {} break; case 1799: -#line 8606 "sql_yacc.yy" +#line 8608 "sql_yacc.yy" {} break; case 1800: -#line 8607 "sql_yacc.yy" +#line 8609 "sql_yacc.yy" {} break; case 1801: -#line 8608 "sql_yacc.yy" +#line 8610 "sql_yacc.yy" {} break; case 1802: -#line 8609 "sql_yacc.yy" +#line 8611 "sql_yacc.yy" {} break; case 1803: -#line 8610 "sql_yacc.yy" +#line 8612 "sql_yacc.yy" {} break; case 1804: -#line 8611 "sql_yacc.yy" +#line 8613 "sql_yacc.yy" {} break; case 1805: -#line 8612 "sql_yacc.yy" +#line 8614 "sql_yacc.yy" {} break; case 1806: -#line 8613 "sql_yacc.yy" +#line 8615 "sql_yacc.yy" {} break; case 1807: -#line 8614 "sql_yacc.yy" +#line 8616 "sql_yacc.yy" {} break; case 1808: -#line 8615 "sql_yacc.yy" +#line 8617 "sql_yacc.yy" {} break; case 1809: -#line 8616 "sql_yacc.yy" +#line 8618 "sql_yacc.yy" {} break; case 1810: -#line 8623 "sql_yacc.yy" +#line 8625 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SET_OPTION; @@ -26310,22 +26312,22 @@ break; case 1811: -#line 8632 "sql_yacc.yy" +#line 8634 "sql_yacc.yy" {} break; case 1812: -#line 8636 "sql_yacc.yy" +#line 8638 "sql_yacc.yy" {} break; case 1813: -#line 8637 "sql_yacc.yy" +#line 8639 "sql_yacc.yy" {} break; case 1816: -#line 8644 "sql_yacc.yy" +#line 8646 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26358,7 +26360,7 @@ break; case 1817: -#line 8674 "sql_yacc.yy" +#line 8676 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26407,77 +26409,77 @@ break; case 1818: -#line 8721 "sql_yacc.yy" +#line 8723 "sql_yacc.yy" {} break; case 1819: -#line 8722 "sql_yacc.yy" +#line 8724 "sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 1820: -#line 8723 "sql_yacc.yy" +#line 8725 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1821: -#line 8724 "sql_yacc.yy" +#line 8726 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1822: -#line 8728 "sql_yacc.yy" +#line 8730 "sql_yacc.yy" { (yyval.num)= OPT_DEFAULT; } break; case 1823: -#line 8729 "sql_yacc.yy" +#line 8731 "sql_yacc.yy" { Lex->one_shot_set= 1; (yyval.num)= OPT_SESSION; } break; case 1824: -#line 8733 "sql_yacc.yy" +#line 8735 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1825: -#line 8734 "sql_yacc.yy" +#line 8736 "sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 1826: -#line 8735 "sql_yacc.yy" +#line 8737 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1827: -#line 8736 "sql_yacc.yy" +#line 8738 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1828: -#line 8740 "sql_yacc.yy" +#line 8742 "sql_yacc.yy" { (yyval.var_type)=OPT_DEFAULT; } break; case 1829: -#line 8741 "sql_yacc.yy" +#line 8743 "sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 1830: -#line 8742 "sql_yacc.yy" +#line 8744 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1831: -#line 8743 "sql_yacc.yy" +#line 8745 "sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 1834: -#line 8752 "sql_yacc.yy" +#line 8754 "sql_yacc.yy" { LEX *lex=Lex; @@ -26560,7 +26562,7 @@ break; case 1835: -#line 8832 "sql_yacc.yy" +#line 8834 "sql_yacc.yy" { LEX *lex=Lex; if ((yyvsp[(1) - (5)].var_type)) @@ -26573,14 +26575,14 @@ break; case 1836: -#line 8845 "sql_yacc.yy" +#line 8847 "sql_yacc.yy" { Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var((yyvsp[(2) - (4)].lex_str),(yyvsp[(4) - (4)].item)))); } break; case 1837: -#line 8849 "sql_yacc.yy" +#line 8851 "sql_yacc.yy" { LEX *lex=Lex; lex->var_list.push_back(new set_var((yyvsp[(3) - (6)].var_type), (yyvsp[(4) - (6)].variable).var, &(yyvsp[(4) - (6)].variable).base_name, (yyvsp[(6) - (6)].item))); @@ -26588,7 +26590,7 @@ break; case 1838: -#line 8854 "sql_yacc.yy" +#line 8856 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -26598,7 +26600,7 @@ break; case 1839: -#line 8861 "sql_yacc.yy" +#line 8863 "sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; @@ -26616,7 +26618,7 @@ break; case 1840: -#line 8876 "sql_yacc.yy" +#line 8878 "sql_yacc.yy" { LEX *lex= Lex; (yyvsp[(2) - (3)].charset)= (yyvsp[(2) - (3)].charset) ? (yyvsp[(2) - (3)].charset) : global_system_variables.character_set_client; @@ -26632,7 +26634,7 @@ break; case 1841: -#line 8889 "sql_yacc.yy" +#line 8891 "sql_yacc.yy" { THD *thd=YYTHD; LEX_USER *user; @@ -26656,14 +26658,14 @@ break; case 1842: -#line 8910 "sql_yacc.yy" +#line 8912 "sql_yacc.yy" { Lex->var_list.push_back(new set_var_password((yyvsp[(3) - (5)].lex_user),(yyvsp[(5) - (5)].simple_string))); } break; case 1843: -#line 8917 "sql_yacc.yy" +#line 8919 "sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; @@ -26704,7 +26706,7 @@ break; case 1844: -#line 8955 "sql_yacc.yy" +#line 8957 "sql_yacc.yy" { LEX *lex= Lex; if (check_reserved_words(&(yyvsp[(1) - (3)].lex_str))) @@ -26750,7 +26752,7 @@ break; case 1845: -#line 8998 "sql_yacc.yy" +#line 9000 "sql_yacc.yy" { sys_var *tmp=find_sys_var((yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length); if (!tmp) @@ -26764,32 +26766,32 @@ break; case 1846: -#line 9011 "sql_yacc.yy" +#line 9013 "sql_yacc.yy" { (yyval.tx_isolation)= ISO_READ_UNCOMMITTED; } break; case 1847: -#line 9012 "sql_yacc.yy" +#line 9014 "sql_yacc.yy" { (yyval.tx_isolation)= ISO_READ_COMMITTED; } break; case 1848: -#line 9013 "sql_yacc.yy" +#line 9015 "sql_yacc.yy" { (yyval.tx_isolation)= ISO_REPEATABLE_READ; } break; case 1849: -#line 9014 "sql_yacc.yy" +#line 9016 "sql_yacc.yy" { (yyval.tx_isolation)= ISO_SERIALIZABLE; } break; case 1850: -#line 9018 "sql_yacc.yy" +#line 9020 "sql_yacc.yy" { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str;} break; case 1851: -#line 9020 "sql_yacc.yy" +#line 9022 "sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? YYTHD->variables.old_passwords ? Item_func_old_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : @@ -26799,7 +26801,7 @@ break; case 1852: -#line 9027 "sql_yacc.yy" +#line 9029 "sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? Item_func_old_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : (yyvsp[(3) - (4)].lex_str).str; @@ -26807,32 +26809,32 @@ break; case 1853: -#line 9035 "sql_yacc.yy" +#line 9037 "sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1854: -#line 9036 "sql_yacc.yy" +#line 9038 "sql_yacc.yy" { (yyval.item)=0; } break; case 1855: -#line 9037 "sql_yacc.yy" +#line 9039 "sql_yacc.yy" { (yyval.item)=new Item_string("ON", 2, system_charset_info); } break; case 1856: -#line 9038 "sql_yacc.yy" +#line 9040 "sql_yacc.yy" { (yyval.item)=new Item_string("ALL", 3, system_charset_info); } break; case 1857: -#line 9039 "sql_yacc.yy" +#line 9041 "sql_yacc.yy" { (yyval.item)=new Item_string("binary", 6, system_charset_info); } break; case 1858: -#line 9047 "sql_yacc.yy" +#line 9049 "sql_yacc.yy" { LEX *lex= Lex; @@ -26846,12 +26848,12 @@ break; case 1859: -#line 9058 "sql_yacc.yy" +#line 9060 "sql_yacc.yy" {} break; case 1864: -#line 9071 "sql_yacc.yy" +#line 9073 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), (yyvsp[(2) - (3)].lex_str_ptr), 0, (thr_lock_type) (yyvsp[(3) - (3)].num))) MYSQL_YYABORT; @@ -26859,27 +26861,27 @@ break; case 1865: -#line 9078 "sql_yacc.yy" +#line 9080 "sql_yacc.yy" { (yyval.num)=TL_READ_NO_INSERT; } break; case 1866: -#line 9079 "sql_yacc.yy" +#line 9081 "sql_yacc.yy" { (yyval.num)=TL_WRITE_DEFAULT; } break; case 1867: -#line 9080 "sql_yacc.yy" +#line 9082 "sql_yacc.yy" { (yyval.num)=TL_WRITE_LOW_PRIORITY; } break; case 1868: -#line 9081 "sql_yacc.yy" +#line 9083 "sql_yacc.yy" { (yyval.num)= TL_READ; } break; case 1869: -#line 9086 "sql_yacc.yy" +#line 9088 "sql_yacc.yy" { LEX *lex= Lex; @@ -26893,12 +26895,12 @@ break; case 1870: -#line 9097 "sql_yacc.yy" +#line 9099 "sql_yacc.yy" {} break; case 1871: -#line 9107 "sql_yacc.yy" +#line 9109 "sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26913,7 +26915,7 @@ break; case 1872: -#line 9119 "sql_yacc.yy" +#line 9121 "sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26928,7 +26930,7 @@ break; case 1873: -#line 9131 "sql_yacc.yy" +#line 9133 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -26946,52 +26948,52 @@ break; case 1874: -#line 9145 "sql_yacc.yy" +#line 9147 "sql_yacc.yy" {} break; case 1875: -#line 9149 "sql_yacc.yy" +#line 9151 "sql_yacc.yy" { Lex->ident= null_lex_str; } break; case 1876: -#line 9150 "sql_yacc.yy" +#line 9152 "sql_yacc.yy" { Lex->ident= (yyvsp[(1) - (2)].lex_str); } break; case 1877: -#line 9154 "sql_yacc.yy" +#line 9156 "sql_yacc.yy" { Lex->ha_read_mode = RFIRST; } break; case 1878: -#line 9155 "sql_yacc.yy" +#line 9157 "sql_yacc.yy" { Lex->ha_read_mode = RNEXT; } break; case 1879: -#line 9159 "sql_yacc.yy" +#line 9161 "sql_yacc.yy" { Lex->ha_read_mode = RFIRST; } break; case 1880: -#line 9160 "sql_yacc.yy" +#line 9162 "sql_yacc.yy" { Lex->ha_read_mode = RNEXT; } break; case 1881: -#line 9161 "sql_yacc.yy" +#line 9163 "sql_yacc.yy" { Lex->ha_read_mode = RPREV; } break; case 1882: -#line 9162 "sql_yacc.yy" +#line 9164 "sql_yacc.yy" { Lex->ha_read_mode = RLAST; } break; case 1883: -#line 9164 "sql_yacc.yy" +#line 9166 "sql_yacc.yy" { LEX *lex=Lex; lex->ha_read_mode = RKEY; @@ -27002,42 +27004,42 @@ break; case 1884: -#line 9170 "sql_yacc.yy" +#line 9172 "sql_yacc.yy" { } break; case 1885: -#line 9174 "sql_yacc.yy" +#line 9176 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_EXACT; } break; case 1886: -#line 9175 "sql_yacc.yy" +#line 9177 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_NEXT; } break; case 1887: -#line 9176 "sql_yacc.yy" +#line 9178 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_PREV; } break; case 1888: -#line 9177 "sql_yacc.yy" +#line 9179 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_AFTER_KEY; } break; case 1889: -#line 9178 "sql_yacc.yy" +#line 9180 "sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_BEFORE_KEY; } break; case 1890: -#line 9185 "sql_yacc.yy" +#line 9187 "sql_yacc.yy" {} break; case 1891: -#line 9190 "sql_yacc.yy" +#line 9192 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_REVOKE; @@ -27046,7 +27048,7 @@ break; case 1892: -#line 9197 "sql_yacc.yy" +#line 9199 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -27061,7 +27063,7 @@ break; case 1893: -#line 9210 "sql_yacc.yy" +#line 9212 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -27075,19 +27077,19 @@ break; case 1894: -#line 9222 "sql_yacc.yy" +#line 9224 "sql_yacc.yy" { Lex->sql_command = SQLCOM_REVOKE_ALL; } break; case 1895: -#line 9229 "sql_yacc.yy" +#line 9231 "sql_yacc.yy" {} break; case 1896: -#line 9235 "sql_yacc.yy" +#line 9237 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_GRANT; @@ -27096,7 +27098,7 @@ break; case 1897: -#line 9243 "sql_yacc.yy" +#line 9245 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -27110,7 +27112,7 @@ break; case 1898: -#line 9256 "sql_yacc.yy" +#line 9258 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -27124,12 +27126,12 @@ break; case 1901: -#line 9273 "sql_yacc.yy" +#line 9275 "sql_yacc.yy" { } break; case 1902: -#line 9275 "sql_yacc.yy" +#line 9277 "sql_yacc.yy" { Lex->all_privileges= 1; Lex->grant= GLOBAL_ACLS; @@ -27137,172 +27139,172 @@ break; case 1907: -#line 9291 "sql_yacc.yy" +#line 9293 "sql_yacc.yy" { Lex->which_columns = SELECT_ACL;} break; case 1908: -#line 9291 "sql_yacc.yy" +#line 9293 "sql_yacc.yy" {} break; case 1909: -#line 9292 "sql_yacc.yy" +#line 9294 "sql_yacc.yy" { Lex->which_columns = INSERT_ACL;} break; case 1910: -#line 9292 "sql_yacc.yy" +#line 9294 "sql_yacc.yy" {} break; case 1911: -#line 9293 "sql_yacc.yy" +#line 9295 "sql_yacc.yy" { Lex->which_columns = UPDATE_ACL; } break; case 1912: -#line 9293 "sql_yacc.yy" +#line 9295 "sql_yacc.yy" {} break; case 1913: -#line 9294 "sql_yacc.yy" +#line 9296 "sql_yacc.yy" { Lex->which_columns = REFERENCES_ACL;} break; case 1914: -#line 9294 "sql_yacc.yy" +#line 9296 "sql_yacc.yy" {} break; case 1915: -#line 9295 "sql_yacc.yy" +#line 9297 "sql_yacc.yy" { Lex->grant |= DELETE_ACL;} break; case 1916: -#line 9296 "sql_yacc.yy" +#line 9298 "sql_yacc.yy" {} break; case 1917: -#line 9297 "sql_yacc.yy" +#line 9299 "sql_yacc.yy" { Lex->grant |= INDEX_ACL;} break; case 1918: -#line 9298 "sql_yacc.yy" +#line 9300 "sql_yacc.yy" { Lex->grant |= ALTER_ACL;} break; case 1919: -#line 9299 "sql_yacc.yy" +#line 9301 "sql_yacc.yy" { Lex->grant |= CREATE_ACL;} break; case 1920: -#line 9300 "sql_yacc.yy" +#line 9302 "sql_yacc.yy" { Lex->grant |= DROP_ACL;} break; case 1921: -#line 9301 "sql_yacc.yy" +#line 9303 "sql_yacc.yy" { Lex->grant |= EXECUTE_ACL;} break; case 1922: -#line 9302 "sql_yacc.yy" +#line 9304 "sql_yacc.yy" { Lex->grant |= RELOAD_ACL;} break; case 1923: -#line 9303 "sql_yacc.yy" +#line 9305 "sql_yacc.yy" { Lex->grant |= SHUTDOWN_ACL;} break; case 1924: -#line 9304 "sql_yacc.yy" +#line 9306 "sql_yacc.yy" { Lex->grant |= PROCESS_ACL;} break; case 1925: -#line 9305 "sql_yacc.yy" +#line 9307 "sql_yacc.yy" { Lex->grant |= FILE_ACL;} break; case 1926: -#line 9306 "sql_yacc.yy" +#line 9308 "sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 1927: -#line 9307 "sql_yacc.yy" +#line 9309 "sql_yacc.yy" { Lex->grant |= SHOW_DB_ACL;} break; case 1928: -#line 9308 "sql_yacc.yy" +#line 9310 "sql_yacc.yy" { Lex->grant |= SUPER_ACL;} break; case 1929: -#line 9309 "sql_yacc.yy" +#line 9311 "sql_yacc.yy" { Lex->grant |= CREATE_TMP_ACL;} break; case 1930: -#line 9310 "sql_yacc.yy" +#line 9312 "sql_yacc.yy" { Lex->grant |= LOCK_TABLES_ACL; } break; case 1931: -#line 9311 "sql_yacc.yy" +#line 9313 "sql_yacc.yy" { Lex->grant |= REPL_SLAVE_ACL; } break; case 1932: -#line 9312 "sql_yacc.yy" +#line 9314 "sql_yacc.yy" { Lex->grant |= REPL_CLIENT_ACL; } break; case 1933: -#line 9313 "sql_yacc.yy" +#line 9315 "sql_yacc.yy" { Lex->grant |= CREATE_VIEW_ACL; } break; case 1934: -#line 9314 "sql_yacc.yy" +#line 9316 "sql_yacc.yy" { Lex->grant |= SHOW_VIEW_ACL; } break; case 1935: -#line 9315 "sql_yacc.yy" +#line 9317 "sql_yacc.yy" { Lex->grant |= CREATE_PROC_ACL; } break; case 1936: -#line 9316 "sql_yacc.yy" +#line 9318 "sql_yacc.yy" { Lex->grant |= ALTER_PROC_ACL; } break; case 1937: -#line 9317 "sql_yacc.yy" +#line 9319 "sql_yacc.yy" { Lex->grant |= CREATE_USER_ACL; } break; case 1938: -#line 9322 "sql_yacc.yy" +#line 9324 "sql_yacc.yy" {} break; case 1939: -#line 9323 "sql_yacc.yy" +#line 9325 "sql_yacc.yy" {} break; case 1942: -#line 9333 "sql_yacc.yy" +#line 9335 "sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_subject) @@ -27315,7 +27317,7 @@ break; case 1943: -#line 9343 "sql_yacc.yy" +#line 9345 "sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_issuer) @@ -27328,7 +27330,7 @@ break; case 1944: -#line 9353 "sql_yacc.yy" +#line 9355 "sql_yacc.yy" { LEX *lex=Lex; if (lex->ssl_cipher) @@ -27341,7 +27343,7 @@ break; case 1945: -#line 9366 "sql_yacc.yy" +#line 9368 "sql_yacc.yy" { LEX *lex= Lex; if (lex->copy_db_to(&lex->current_select->db, NULL)) @@ -27358,7 +27360,7 @@ break; case 1946: -#line 9380 "sql_yacc.yy" +#line 9382 "sql_yacc.yy" { LEX *lex= Lex; lex->current_select->db = (yyvsp[(1) - (3)].lex_str).str; @@ -27374,7 +27376,7 @@ break; case 1947: -#line 9393 "sql_yacc.yy" +#line 9395 "sql_yacc.yy" { LEX *lex= Lex; lex->current_select->db = NULL; @@ -27390,7 +27392,7 @@ break; case 1948: -#line 9406 "sql_yacc.yy" +#line 9408 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(1) - (1)].table),NULL, @@ -27402,12 +27404,12 @@ break; case 1949: -#line 9418 "sql_yacc.yy" +#line 9420 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT;} break; case 1950: -#line 9420 "sql_yacc.yy" +#line 9422 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -27415,12 +27417,12 @@ break; case 1951: -#line 9428 "sql_yacc.yy" +#line 9430 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT;} break; case 1952: -#line 9430 "sql_yacc.yy" +#line 9432 "sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -27428,7 +27430,7 @@ break; case 1953: -#line 9439 "sql_yacc.yy" +#line 9441 "sql_yacc.yy" { (yyval.lex_user)=(yyvsp[(1) - (4)].lex_user); (yyvsp[(1) - (4)].lex_user)->password=(yyvsp[(4) - (4)].lex_str); if ((yyvsp[(4) - (4)].lex_str).length) @@ -27456,17 +27458,17 @@ break; case 1954: -#line 9464 "sql_yacc.yy" +#line 9466 "sql_yacc.yy" { (yyval.lex_user)= (yyvsp[(1) - (5)].lex_user); (yyvsp[(1) - (5)].lex_user)->password= (yyvsp[(5) - (5)].lex_str); } break; case 1955: -#line 9466 "sql_yacc.yy" +#line 9468 "sql_yacc.yy" { (yyval.lex_user)= (yyvsp[(1) - (1)].lex_user); (yyvsp[(1) - (1)].lex_user)->password= null_lex_str; } break; case 1956: -#line 9472 "sql_yacc.yy" +#line 9474 "sql_yacc.yy" { LEX *lex=Lex; lex->grant |= lex->which_columns; @@ -27474,7 +27476,7 @@ break; case 1960: -#line 9484 "sql_yacc.yy" +#line 9486 "sql_yacc.yy" { String *new_str = new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); List_iterator iter(Lex->columns); @@ -27495,55 +27497,55 @@ break; case 1962: -#line 9506 "sql_yacc.yy" +#line 9508 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_SPECIFIED; } break; case 1963: -#line 9510 "sql_yacc.yy" +#line 9512 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_ANY; } break; case 1964: -#line 9514 "sql_yacc.yy" +#line 9516 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_X509; } break; case 1965: -#line 9518 "sql_yacc.yy" +#line 9520 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_NONE; } break; case 1966: -#line 9524 "sql_yacc.yy" +#line 9526 "sql_yacc.yy" {} break; case 1968: -#line 9528 "sql_yacc.yy" +#line 9530 "sql_yacc.yy" {} break; case 1969: -#line 9529 "sql_yacc.yy" +#line 9531 "sql_yacc.yy" {} break; case 1970: -#line 9533 "sql_yacc.yy" +#line 9535 "sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 1971: -#line 9535 "sql_yacc.yy" +#line 9537 "sql_yacc.yy" { LEX *lex=Lex; lex->mqh.questions=(yyvsp[(2) - (2)].ulong_num); @@ -27552,7 +27554,7 @@ break; case 1972: -#line 9541 "sql_yacc.yy" +#line 9543 "sql_yacc.yy" { LEX *lex=Lex; lex->mqh.updates=(yyvsp[(2) - (2)].ulong_num); @@ -27561,7 +27563,7 @@ break; case 1973: -#line 9547 "sql_yacc.yy" +#line 9549 "sql_yacc.yy" { LEX *lex=Lex; lex->mqh.conn_per_hour= (yyvsp[(2) - (2)].ulong_num); @@ -27570,7 +27572,7 @@ break; case 1974: -#line 9553 "sql_yacc.yy" +#line 9555 "sql_yacc.yy" { LEX *lex=Lex; lex->mqh.user_conn= (yyvsp[(2) - (2)].ulong_num); @@ -27579,7 +27581,7 @@ break; case 1975: -#line 9562 "sql_yacc.yy" +#line 9564 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_BEGIN; @@ -27588,62 +27590,62 @@ break; case 1976: -#line 9567 "sql_yacc.yy" +#line 9569 "sql_yacc.yy" {} break; case 1977: -#line 9571 "sql_yacc.yy" +#line 9573 "sql_yacc.yy" {} break; case 1978: -#line 9572 "sql_yacc.yy" +#line 9574 "sql_yacc.yy" {} break; case 1979: -#line 9576 "sql_yacc.yy" +#line 9578 "sql_yacc.yy" { (yyval.num)= (YYTHD->variables.completion_type == 1); } break; case 1980: -#line 9577 "sql_yacc.yy" +#line 9579 "sql_yacc.yy" { (yyval.num)=0; } break; case 1981: -#line 9578 "sql_yacc.yy" +#line 9580 "sql_yacc.yy" { (yyval.num)=1; } break; case 1982: -#line 9582 "sql_yacc.yy" +#line 9584 "sql_yacc.yy" { (yyval.num)= (YYTHD->variables.completion_type == 2); } break; case 1983: -#line 9583 "sql_yacc.yy" +#line 9585 "sql_yacc.yy" { (yyval.num)=1; } break; case 1984: -#line 9584 "sql_yacc.yy" +#line 9586 "sql_yacc.yy" { (yyval.num)=0; } break; case 1985: -#line 9588 "sql_yacc.yy" +#line 9590 "sql_yacc.yy" {} break; case 1986: -#line 9589 "sql_yacc.yy" +#line 9591 "sql_yacc.yy" {} break; case 1987: -#line 9594 "sql_yacc.yy" +#line 9596 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_COMMIT; @@ -27653,7 +27655,7 @@ break; case 1988: -#line 9604 "sql_yacc.yy" +#line 9606 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK; @@ -27663,7 +27665,7 @@ break; case 1989: -#line 9612 "sql_yacc.yy" +#line 9614 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT; @@ -27672,7 +27674,7 @@ break; case 1990: -#line 9621 "sql_yacc.yy" +#line 9623 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SAVEPOINT; @@ -27681,7 +27683,7 @@ break; case 1991: -#line 9630 "sql_yacc.yy" +#line 9632 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RELEASE_SAVEPOINT; @@ -27690,12 +27692,12 @@ break; case 1992: -#line 9643 "sql_yacc.yy" +#line 9645 "sql_yacc.yy" {} break; case 1994: -#line 9649 "sql_yacc.yy" +#line 9651 "sql_yacc.yy" { LEX *lex=Lex; if (lex->result) @@ -27722,7 +27724,7 @@ break; case 1995: -#line 9673 "sql_yacc.yy" +#line 9675 "sql_yacc.yy" { /* Remove from the name resolution context stack the context of the @@ -27733,22 +27735,22 @@ break; case 1996: -#line 9683 "sql_yacc.yy" +#line 9685 "sql_yacc.yy" { (yyval.num)= 0; } break; case 1997: -#line 9684 "sql_yacc.yy" +#line 9686 "sql_yacc.yy" { (yyval.num)= 1; } break; case 1998: -#line 9685 "sql_yacc.yy" +#line 9687 "sql_yacc.yy" { (yyval.num)= 1; } break; case 1999: -#line 9689 "sql_yacc.yy" +#line 9691 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27767,7 +27769,7 @@ break; case 2000: -#line 9705 "sql_yacc.yy" +#line 9707 "sql_yacc.yy" { THD *thd= YYTHD; thd->lex->current_select->no_table_names_allowed= 0; @@ -27776,29 +27778,29 @@ break; case 2003: -#line 9718 "sql_yacc.yy" +#line 9720 "sql_yacc.yy" { (yyval.num)=1; } break; case 2004: -#line 9719 "sql_yacc.yy" +#line 9721 "sql_yacc.yy" { (yyval.num)=1; } break; case 2005: -#line 9720 "sql_yacc.yy" +#line 9722 "sql_yacc.yy" { (yyval.num)=0; } break; case 2006: -#line 9725 "sql_yacc.yy" +#line 9727 "sql_yacc.yy" { (yyval.select_lex)= (yyvsp[(3) - (4)].select_lex); } break; case 2007: -#line 9729 "sql_yacc.yy" +#line 9731 "sql_yacc.yy" { THD *thd= YYTHD; /* @@ -27818,19 +27820,19 @@ break; case 2008: -#line 9745 "sql_yacc.yy" +#line 9747 "sql_yacc.yy" { (yyval.select_lex)= (yyvsp[(3) - (7)].select_lex); } break; case 2009: -#line 9749 "sql_yacc.yy" +#line 9751 "sql_yacc.yy" { (yyval.select_lex)= Lex->current_select->master_unit()->first_select(); } break; case 2010: -#line 9754 "sql_yacc.yy" +#line 9756 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sql_command == (int)SQLCOM_HA_READ || @@ -27853,7 +27855,7 @@ break; case 2011: -#line 9775 "sql_yacc.yy" +#line 9777 "sql_yacc.yy" { LEX *lex=Lex; lex->pop_context(); @@ -27871,32 +27873,32 @@ break; case 2012: -#line 9798 "sql_yacc.yy" +#line 9800 "sql_yacc.yy" {} break; case 2013: -#line 9800 "sql_yacc.yy" +#line 9802 "sql_yacc.yy" {} break; case 2014: -#line 9805 "sql_yacc.yy" +#line 9807 "sql_yacc.yy" {} break; case 2015: -#line 9807 "sql_yacc.yy" +#line 9809 "sql_yacc.yy" {} break; case 2016: -#line 9809 "sql_yacc.yy" +#line 9811 "sql_yacc.yy" {} break; case 2017: -#line 9820 "sql_yacc.yy" +#line 9822 "sql_yacc.yy" { /* We have to distinguish missing DEFINER-clause from case when @@ -27910,74 +27912,74 @@ break; case 2018: -#line 9831 "sql_yacc.yy" +#line 9833 "sql_yacc.yy" { YYTHD->lex->definer= get_current_user(YYTHD, (yyvsp[(3) - (3)].lex_user)); } break; case 2019: -#line 9844 "sql_yacc.yy" +#line 9846 "sql_yacc.yy" {} break; case 2020: -#line 9846 "sql_yacc.yy" +#line 9848 "sql_yacc.yy" {} break; case 2021: -#line 9848 "sql_yacc.yy" +#line 9850 "sql_yacc.yy" {} break; case 2022: -#line 9853 "sql_yacc.yy" +#line 9855 "sql_yacc.yy" { Lex->create_view_mode= VIEW_CREATE_OR_REPLACE; } break; case 2023: -#line 9858 "sql_yacc.yy" +#line 9860 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2024: -#line 9860 "sql_yacc.yy" +#line 9862 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; } break; case 2025: -#line 9862 "sql_yacc.yy" +#line 9864 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; } break; case 2026: -#line 9867 "sql_yacc.yy" +#line 9869 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2027: -#line 9869 "sql_yacc.yy" +#line 9871 "sql_yacc.yy" {} break; case 2028: -#line 9874 "sql_yacc.yy" +#line 9876 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFAULT; } break; case 2029: -#line 9876 "sql_yacc.yy" +#line 9878 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFINER; } break; case 2030: -#line 9878 "sql_yacc.yy" +#line 9880 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_INVOKER; } break; case 2031: -#line 9883 "sql_yacc.yy" +#line 9885 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27989,17 +27991,17 @@ break; case 2032: -#line 9892 "sql_yacc.yy" +#line 9894 "sql_yacc.yy" {} break; case 2033: -#line 9897 "sql_yacc.yy" +#line 9899 "sql_yacc.yy" {} break; case 2035: -#line 9903 "sql_yacc.yy" +#line 9905 "sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) sql_memdup(&(yyvsp[(1) - (1)].lex_str), sizeof(LEX_STRING))); @@ -28007,7 +28009,7 @@ break; case 2036: -#line 9908 "sql_yacc.yy" +#line 9910 "sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) sql_memdup(&(yyvsp[(3) - (3)].lex_str), sizeof(LEX_STRING))); @@ -28015,7 +28017,7 @@ break; case 2037: -#line 9915 "sql_yacc.yy" +#line 9917 "sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= FALSE; @@ -28026,7 +28028,7 @@ break; case 2038: -#line 9923 "sql_yacc.yy" +#line 9925 "sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= TRUE; @@ -28037,7 +28039,7 @@ break; case 2039: -#line 9934 "sql_yacc.yy" +#line 9936 "sql_yacc.yy" { THD *thd=YYTHD; LEX *lex= thd->lex; @@ -28049,7 +28051,7 @@ break; case 2040: -#line 9943 "sql_yacc.yy" +#line 9945 "sql_yacc.yy" { THD *thd=YYTHD; LEX *lex= thd->lex; @@ -28061,27 +28063,27 @@ break; case 2041: -#line 9955 "sql_yacc.yy" +#line 9957 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_NONE; } break; case 2042: -#line 9957 "sql_yacc.yy" +#line 9959 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2043: -#line 9959 "sql_yacc.yy" +#line 9961 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2044: -#line 9961 "sql_yacc.yy" +#line 9963 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_LOCAL; } break; case 2045: -#line 9973 "sql_yacc.yy" +#line 9975 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28124,7 +28126,7 @@ break; case 2046: -#line 10013 "sql_yacc.yy" +#line 10015 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -28153,7 +28155,7 @@ break; case 2047: -#line 10048 "sql_yacc.yy" +#line 10050 "sql_yacc.yy" { LEX *lex=Lex; lex->udf.type= (yyvsp[(1) - (4)].udf_type); @@ -28163,12 +28165,12 @@ break; case 2048: -#line 10055 "sql_yacc.yy" +#line 10057 "sql_yacc.yy" {} break; case 2049: -#line 10057 "sql_yacc.yy" +#line 10059 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp; @@ -28200,7 +28202,7 @@ break; case 2050: -#line 10086 "sql_yacc.yy" +#line 10088 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28211,7 +28213,7 @@ break; case 2051: -#line 10095 "sql_yacc.yy" +#line 10097 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28223,7 +28225,7 @@ break; case 2052: -#line 10104 "sql_yacc.yy" +#line 10106 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28235,7 +28237,7 @@ break; case 2053: -#line 10113 "sql_yacc.yy" +#line 10115 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -28250,49 +28252,49 @@ break; case 2054: -#line 10129 "sql_yacc.yy" +#line 10131 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_START; } break; case 2055: -#line 10133 "sql_yacc.yy" +#line 10135 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_END; } break; case 2056: -#line 10137 "sql_yacc.yy" +#line 10139 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_PREPARE; } break; case 2057: -#line 10141 "sql_yacc.yy" +#line 10143 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_COMMIT; } break; case 2058: -#line 10145 "sql_yacc.yy" +#line 10147 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_ROLLBACK; } break; case 2059: -#line 10149 "sql_yacc.yy" +#line 10151 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_RECOVER; } break; case 2060: -#line 10155 "sql_yacc.yy" +#line 10157 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (1)].string)->length() <= MAXGTRIDSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -28302,7 +28304,7 @@ break; case 2061: -#line 10162 "sql_yacc.yy" +#line 10164 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (3)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -28312,7 +28314,7 @@ break; case 2062: -#line 10169 "sql_yacc.yy" +#line 10171 "sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (5)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -28322,63 +28324,63 @@ break; case 2063: -#line 10177 "sql_yacc.yy" +#line 10179 "sql_yacc.yy" {} break; case 2064: -#line 10178 "sql_yacc.yy" +#line 10180 "sql_yacc.yy" {} break; case 2065: -#line 10182 "sql_yacc.yy" +#line 10184 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2066: -#line 10183 "sql_yacc.yy" +#line 10185 "sql_yacc.yy" { Lex->xa_opt=XA_JOIN; } break; case 2067: -#line 10184 "sql_yacc.yy" +#line 10186 "sql_yacc.yy" { Lex->xa_opt=XA_RESUME; } break; case 2068: -#line 10188 "sql_yacc.yy" +#line 10190 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2069: -#line 10189 "sql_yacc.yy" +#line 10191 "sql_yacc.yy" { Lex->xa_opt=XA_ONE_PHASE; } break; case 2070: -#line 10193 "sql_yacc.yy" +#line 10195 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2071: -#line 10194 "sql_yacc.yy" +#line 10196 "sql_yacc.yy" { Lex->xa_opt=XA_SUSPEND; } break; case 2073: -#line 10199 "sql_yacc.yy" +#line 10201 "sql_yacc.yy" { } break; case 2074: -#line 10200 "sql_yacc.yy" +#line 10202 "sql_yacc.yy" { Lex->xa_opt=XA_FOR_MIGRATE; } break; /* Line 1267 of yacc.c. */ -#line 28382 "sql_yacc.cc" +#line 28384 "sql_yacc.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); From svnnotify ¡÷ sourceforge.jp Tue Dec 11 13:47:27 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 11 Dec 2007 13:47:27 +0900 Subject: [Tritonn-commit 44] [svn] [54] fixed bug: DELEMITED flag was ignored while creating fulltext index. Message-ID: <1197348447.371489.16262.nullmailer@users.sourceforge.jp> Revision: 54 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=54 Author: mir Date: 2007-12-11 13:47:24 +0900 (Tue, 11 Dec 2007) Log Message: ----------- fixed bug: DELEMITED flag was ignored while creating fulltext index. Modified Paths: -------------- mysql-5.0.45-tritonn-1.1.0/libmysqld/sql_yacc.cc mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/r/senna_create.result mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/t/senna_create.test mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.cc mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.h mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.yy Modified: mysql-5.0.45-tritonn-1.1.0/libmysqld/sql_yacc.cc =================================================================== --- mysql-5.0.45-tritonn-1.1.0/libmysqld/sql_yacc.cc 2007-12-11 04:26:30 UTC (rev 53) +++ mysql-5.0.45-tritonn-1.1.0/libmysqld/sql_yacc.cc 2007-12-11 04:47:24 UTC (rev 54) @@ -1,8 +1,10 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Skeleton implementation for Bison's Yacc-like parsers in C + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -15,17 +17,25 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ +/* 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. -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -36,6 +46,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.3" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -45,8 +58,7 @@ /* Using locations. */ #define YYLSP_NEEDED 0 -/* If NAME_PREFIX is specified substitute the variables and functions - names. */ +/* Substitute the variable and function names. */ #define yyparse MYSQLparse #define yylex MYSQLlex #define yyerror MYSQLerror @@ -635,6 +647,7 @@ NEG = 828 }; #endif +/* Tokens. */ #define END_OF_INPUT 258 #define ABORT_SYM 259 #define ACTION 260 @@ -1623,9 +1636,15 @@ # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE #line 415 "sql_yacc.yy" -typedef union YYSTYPE { +{ int num; ulong ulong_num; ulonglong ulonglong_number; @@ -1663,9 +1682,10 @@ struct { int vars, conds, hndlrs, curs; } spblock; sp_name *spname; struct st_lex *lex; -} YYSTYPE; -/* Line 191 of yacc.c. */ -#line 1669 "sql_yacc.cc" +} +/* Line 193 of yacc.c. */ +#line 1688 "sql_yacc.cc" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1679,56 +1699,171 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); -/* Line 214 of yacc.c. */ -#line 1684 "sql_yacc.cc" +/* Line 216 of yacc.c. */ +#line 1704 "sql_yacc.cc" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -# ifndef YYFREE -# define YYFREE free +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int # endif -# ifndef YYMALLOC -# define YYMALLOC malloc +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if 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 +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# endif -# else -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else # 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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (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 -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif # endif -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -1738,24 +1873,24 @@ /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -1773,39 +1908,33 @@ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 482 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 45159 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 593 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 680 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 2083 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 3744 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 828 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned short yytranslate[] = +static const yytype_uint16 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1895,7 +2024,7 @@ #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short yyprhs[] = +static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, @@ -2108,8 +2237,8 @@ 6301, 6302, 6306, 6307 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = { 594, 0, -1, 3, -1, 595, 3, -1, 596, -1, 1218, -1, 796, -1, 837, -1, 827, -1, 631, -1, @@ -2745,7 +2874,7 @@ }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const yytype_uint16 yyrline[] = { 0, 1226, 1226, 1240, 1243, 1244, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, @@ -2799,169 +2928,169 @@ 3551, 3554, 3555, 3556, 3557, 3558, 3561, 3562, 3563, 3575, 3576, 3579, 3580, 3583, 3584, 3588, 3589, 3590, 3593, 3594, 3595, 3596, 3609, 3610, 3611, 3614, 3615, 3619, 3620, 3623, - 3624, 3627, 3632, 3637, 3642, 3647, 3652, 3657, 3662, 3667, - 3672, 3677, 3682, 3693, 3694, 3697, 3698, 3709, 3710, 3713, - 3714, 3717, 3718, 3726, 3725, 3752, 3751, 3766, 3765, 3784, - 3783, 3803, 3801, 3816, 3817, 3819, 3820, 3821, 3822, 3823, - 3826, 3834, 3835, 3839, 3844, 3843, 3851, 3860, 3850, 3872, - 3879, 3883, 3890, 3897, 3903, 3909, 3915, 3922, 3941, 3962, - 3967, 3971, 3978, 3979, 3982, 3983, 3987, 3988, 3989, 3993, - 3994, 3995, 3998, 3999, 4000, 4001, 4009, 4008, 4019, 4027, - 4026, 4036, 4046, 4055, 4056, 4063, 4063, 4069, 4070, 4074, - 4075, 4076, 4080, 4081, 4098, 4099, 4104, 4103, 4114, 4113, - 4124, 4123, 4133, 4134, 4135, 4140, 4139, 4151, 4152, 4155, - 4156, 4159, 4160, 4161, 4165, 4164, 4177, 4176, 4193, 4194, - 4197, 4198, 4201, 4202, 4203, 4204, 4205, 4206, 4210, 4209, - 4221, 4222, 4223, 4228, 4227, 4233, 4240, 4245, 4253, 4254, - 4257, 4269, 4278, 4279, 4282, 4295, 4296, 4301, 4300, 4310, - 4311, 4314, 4327, 4327, 4337, 4338, 4347, 4348, 4357, 4366, - 4368, 4371, 4393, 4397, 4396, 4416, 4424, 4416, 4430, 4431, - 4432, 4433, 4434, 4437, 4444, 4451, 4453, 4464, 4465, 4468, - 4469, 4475, 4476, 4477, 4478, 4484, 4490, 4496, 4506, 4509, - 4511, 4517, 4527, 4528, 4529, 4542, 4562, 4569, 4576, 4577, - 4580, 4581, 4582, 4583, 4584, 4588, 4589, 4593, 4593, 4610, - 4612, 4617, 4618, 4618, 4635, 4637, 4642, 4643, 4646, 4648, - 4650, 4652, 4654, 4655, 4656, 4660, 4661, 4662, 4663, 4665, - 4667, 4670, 4674, 4680, 4684, 4690, 4694, 4702, 4704, 4710, - 4713, 4715, 4717, 4718, 4720, 4723, 4724, 4727, 4728, 4731, - 4733, 4735, 4738, 4739, 4740, 4742, 4744, 4747, 4748, 4749, - 4750, 4751, 4752, 4755, 4756, 4758, 4758, 4759, 4759, 4760, - 4760, 4761, 4761, 4763, 4764, 4765, 4766, 4767, 4768, 4771, - 4772, 4776, 4780, 4781, 4788, 4789, 4790, 4791, 4792, 4794, - 4795, 4796, 4797, 4798, 4802, 4803, 4808, 4813, 4817, 4818, - 4822, 4823, 4827, 4834, 4836, 4842, 4844, 4855, 4857, 4868, - 4879, 4890, 4901, 4903, 4905, 4907, 4909, 4911, 4913, 4915, - 4917, 4919, 4921, 4923, 4925, 4931, 4933, 4935, 4940, 4945, - 4947, 4949, 4954, 4956, 4958, 4960, 4962, 4967, 4968, 4970, - 4972, 4974, 4976, 4978, 4980, 4982, 4984, 4986, 4988, 4990, - 4994, 4996, 5006, 5008, 5010, 5012, 5014, 5017, 5026, 5031, - 5036, 5038, 5040, 5042, 5044, 5046, 5048, 5050, 5055, 5060, - 5062, 5064, 5066, 5068, 5070, 5072, 5078, 5080, 5082, 5084, - 5086, 5088, 5090, 5092, 5094, 5095, 5101, 5106, 5108, 5110, - 5112, 5114, 5116, 5118, 5120, 5122, 5129, 5136, 5138, 5140, - 5142, 5144, 5146, 5148, 5150, 5152, 5154, 5156, 5158, 5160, - 5162, 5164, 5178, 5177, 5294, 5298, 5303, 5305, 5307, 5309, - 5311, 5313, 5318, 5320, 5322, 5324, 5326, 5331, 5335, 5337, - 5339, 5341, 5343, 5345, 5349, 5352, 5355, 5357, 5359, 5361, - 5363, 5365, 5367, 5370, 5373, 5375, 5377, 5379, 5381, 5383, - 5386, 5388, 5390, 5392, 5397, 5398, 5399, 5403, 5404, 5408, - 5408, 5414, 5418, 5425, 5456, 5458, 5460, 5462, 5464, 5466, - 5468, 5471, 5473, 5470, 5476, 5478, 5485, 5487, 5489, 5491, - 5493, 5495, 5497, 5499, 5501, 5504, 5503, 5518, 5517, 5532, - 5538, 5544, 5557, 5558, 5561, 5562, 5567, 5570, 5582, 5581, - 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, - 5607, 5611, 5612, 5616, 5616, 5621, 5622, 5625, 5626, 5629, - 5629, 5634, 5635, 5638, 5639, 5642, 5643, 5646, 5652, 5662, - 5663, 5672, 5677, 5678, 5698, 5700, 5704, 5702, 5719, 5717, - 5735, 5733, 5740, 5749, 5747, 5765, 5764, 5774, 5785, 5783, - 5802, 5801, 5812, 5822, 5823, 5824, 5829, 5829, 5848, 5846, - 5865, 5887, 5935, 5934, 5957, 5975, 5957, 5982, 5986, 6012, - 6013, 6015, 6017, 6020, 6021, 6027, 6034, 6043, 6042, 6049, - 6050, 6054, 6058, 6062, 6068, 6076, 6085, 6086, 6087, 6088, - 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 6097, 6100, - 6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6112, 6113, - 6114, 6115, 6118, 6120, 6121, 6124, 6125, 6128, 6130, 6134, - 6136, 6135, 6149, 6152, 6151, 6166, 6172, 6185, 6187, 6190, - 6192, 6196, 6197, 6210, 6228, 6232, 6233, 6237, 6250, 6252, - 6256, 6255, 6287, 6289, 6293, 6294, 6295, 6300, 6306, 6310, - 6311, 6315, 6319, 6326, 6333, 6342, 6346, 6347, 6348, 6353, - 6357, 6365, 6366, 6367, 6368, 6369, 6370, 6374, 6375, 6376, - 6377, 6378, 6381, 6384, 6383, 6412, 6413, 6416, 6417, 6420, - 6435, 6435, 6445, 6446, 6450, 6462, 6495, 6494, 6507, 6506, - 6515, 6527, 6538, 6537, 6554, 6561, 6561, 6573, 6580, 6592, - 6604, 6608, 6614, 6624, 6625, 6628, 6636, 6637, 6641, 6642, - 6650, 6659, 6649, 6669, 6676, 6668, 6686, 6698, 6699, 6700, - 6704, 6705, 6708, 6709, 6712, 6721, 6722, 6723, 6725, 6724, - 6734, 6735, 6738, 6739, 6740, 6740, 6741, 6741, 6745, 6746, - 6749, 6751, 6754, 6762, 6763, 6767, 6768, 6773, 6772, 6785, - 6786, 6789, 6794, 6802, 6803, 6806, 6808, 6808, 6816, 6825, - 6815, 6847, 6848, 6851, 6858, 6859, 6862, 6871, 6872, 6878, - 6877, 6891, 6890, 6899, 6898, 6906, 6905, 6915, 6916, 6919, - 6926, 6939, 6940, 6944, 6945, 6948, 6949, 6950, 6953, 6963, - 6965, 6967, 6969, 6972, 6973, 6976, 6980, 6984, 6988, 6992, - 6996, 7000, 7004, 7008, 7016, 7019, 7028, 7027, 7041, 7049, - 7058, 7067, 7076, 7086, 7085, 7088, 7098, 7108, 7112, 7117, - 7116, 7121, 7131, 7136, 7142, 7147, 7152, 7154, 7156, 7158, - 7160, 7162, 7170, 7179, 7181, 7183, 7185, 7194, 7202, 7210, - 7212, 7214, 7224, 7231, 7237, 7245, 7253, 7257, 7261, 7268, - 7275, 7285, 7295, 7305, 7316, 7325, 7339, 7352, 7353, 7355, - 7357, 7360, 7361, 7364, 7365, 7368, 7369, 7372, 7373, 7376, - 7377, 7379, 7381, 7384, 7396, 7395, 7410, 7409, 7419, 7420, - 7423, 7424, 7428, 7429, 7430, 7438, 7437, 7449, 7450, 7453, - 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, - 7463, 7466, 7467, 7471, 7470, 7479, 7480, 7483, 7484, 7485, - 7489, 7488, 7498, 7502, 7506, 7518, 7518, 7526, 7527, 7528, - 7533, 7543, 7542, 7558, 7576, 7587, 7594, 7604, 7575, 7609, - 7618, 7619, 7622, 7623, 7635, 7639, 7640, 7641, 7643, 7645, - 7648, 7649, 7652, 7657, 7664, 7669, 7675, 7677, 7680, 7681, - 7684, 7689, 7695, 7697, 7704, 7705, 7706, 7709, 7711, 7716, - 7717, 7722, 7723, 7729, 7734, 7736, 7738, 7743, 7745, 7756, - 7769, 7790, 7791, 7792, 7801, 7802, 7803, 7808, 7809, 7810, - 7811, 7812, 7826, 7840, 7841, 7842, 7845, 7846, 7847, 7848, - 7856, 7871, 7872, 7875, 7881, 7892, 7895, 7931, 7935, 7943, - 7947, 8015, 8030, 8054, 8055, 8071, 8081, 8084, 8085, 8086, - 8090, 8094, 8095, 8120, 8132, 8145, 8157, 8158, 8167, 8168, - 8177, 8178, 8179, 8182, 8195, 8208, 8222, 8223, 8224, 8225, - 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, - 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, - 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, - 8256, 8257, 8258, 8268, 8269, 8270, 8271, 8272, 8273, 8274, - 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, - 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, - 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, - 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, - 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, - 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, - 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, - 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, - 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, - 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, - 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, - 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, - 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, - 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, - 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, - 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, - 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, - 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, - 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, - 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, - 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, - 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, - 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8510, - 8509, 8523, 8524, 8527, 8528, 8531, 8531, 8608, 8609, 8610, - 8611, 8615, 8616, 8620, 8621, 8622, 8623, 8627, 8628, 8629, - 8630, 8634, 8635, 8638, 8718, 8731, 8735, 8740, 8747, 8762, - 8775, 8796, 8803, 8841, 8884, 8898, 8899, 8900, 8901, 8905, - 8906, 8913, 8922, 8923, 8924, 8925, 8926, 8934, 8933, 8949, - 8950, 8953, 8954, 8957, 8965, 8966, 8967, 8968, 8973, 8972, - 8993, 9005, 9018, 9017, 9036, 9037, 9041, 9042, 9046, 9047, - 9048, 9049, 9051, 9050, 9061, 9062, 9063, 9064, 9065, 9071, - 9076, 9083, 9096, 9108, 9115, 9120, 9128, 9141, 9155, 9157, - 9160, 9161, 9168, 9170, 9174, 9175, 9178, 9178, 9179, 9179, - 9180, 9180, 9181, 9181, 9182, 9183, 9184, 9185, 9186, 9187, - 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 9197, - 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9209, 9210, 9214, - 9215, 9219, 9229, 9239, 9252, 9267, 9280, 9293, 9306, 9307, - 9316, 9317, 9326, 9351, 9353, 9360, 9364, 9367, 9368, 9371, - 9392, 9393, 9397, 9401, 9405, 9412, 9413, 9416, 9417, 9421, - 9422, 9428, 9434, 9440, 9450, 9449, 9459, 9460, 9464, 9465, - 9466, 9470, 9471, 9472, 9476, 9477, 9481, 9491, 9498, 9508, - 9517, 9531, 9532, 9537, 9536, 9571, 9572, 9573, 9577, 9577, - 9601, 9602, 9606, 9607, 9608, 9612, 9617, 9616, 9636, 9642, - 9663, 9685, 9687, 9692, 9694, 9696, 9708, 9718, 9731, 9733, - 9735, 9740, 9745, 9747, 9749, 9755, 9756, 9762, 9763, 9765, - 9771, 9770, 9785, 9786, 9790, 9795, 9803, 9803, 9821, 9830, - 9843, 9844, 9846, 9848, 9861, 9859, 9936, 9935, 9945, 9974, - 9983, 9992, 9944, 10016, 10020, 10024, 10028, 10032, 10036, 10042, - 10049, 10056, 10065, 10066, 10070, 10071, 10072, 10076, 10077, 10081, - 10082, 10082, 10087, 10088 + 3624, 3627, 3632, 3637, 3642, 3647, 3652, 3657, 3662, 3668, + 3674, 3679, 3684, 3695, 3696, 3699, 3700, 3711, 3712, 3715, + 3716, 3719, 3720, 3728, 3727, 3754, 3753, 3768, 3767, 3786, + 3785, 3805, 3803, 3818, 3819, 3821, 3822, 3823, 3824, 3825, + 3828, 3836, 3837, 3841, 3846, 3845, 3853, 3862, 3852, 3874, + 3881, 3885, 3892, 3899, 3905, 3911, 3917, 3924, 3943, 3964, + 3969, 3973, 3980, 3981, 3984, 3985, 3989, 3990, 3991, 3995, + 3996, 3997, 4000, 4001, 4002, 4003, 4011, 4010, 4021, 4029, + 4028, 4038, 4048, 4057, 4058, 4065, 4065, 4071, 4072, 4076, + 4077, 4078, 4082, 4083, 4100, 4101, 4106, 4105, 4116, 4115, + 4126, 4125, 4135, 4136, 4137, 4142, 4141, 4153, 4154, 4157, + 4158, 4161, 4162, 4163, 4167, 4166, 4179, 4178, 4195, 4196, + 4199, 4200, 4203, 4204, 4205, 4206, 4207, 4208, 4212, 4211, + 4223, 4224, 4225, 4230, 4229, 4235, 4242, 4247, 4255, 4256, + 4259, 4271, 4280, 4281, 4284, 4297, 4298, 4303, 4302, 4312, + 4313, 4316, 4329, 4329, 4339, 4340, 4349, 4350, 4359, 4368, + 4370, 4373, 4395, 4399, 4398, 4418, 4426, 4418, 4432, 4433, + 4434, 4435, 4436, 4439, 4446, 4453, 4455, 4466, 4467, 4470, + 4471, 4477, 4478, 4479, 4480, 4486, 4492, 4498, 4508, 4511, + 4513, 4519, 4529, 4530, 4531, 4544, 4564, 4571, 4578, 4579, + 4582, 4583, 4584, 4585, 4586, 4590, 4591, 4595, 4595, 4612, + 4614, 4619, 4620, 4620, 4637, 4639, 4644, 4645, 4648, 4650, + 4652, 4654, 4656, 4657, 4658, 4662, 4663, 4664, 4665, 4667, + 4669, 4672, 4676, 4682, 4686, 4692, 4696, 4704, 4706, 4712, + 4715, 4717, 4719, 4720, 4722, 4725, 4726, 4729, 4730, 4733, + 4735, 4737, 4740, 4741, 4742, 4744, 4746, 4749, 4750, 4751, + 4752, 4753, 4754, 4757, 4758, 4760, 4760, 4761, 4761, 4762, + 4762, 4763, 4763, 4765, 4766, 4767, 4768, 4769, 4770, 4773, + 4774, 4778, 4782, 4783, 4790, 4791, 4792, 4793, 4794, 4796, + 4797, 4798, 4799, 4800, 4804, 4805, 4810, 4815, 4819, 4820, + 4824, 4825, 4829, 4836, 4838, 4844, 4846, 4857, 4859, 4870, + 4881, 4892, 4903, 4905, 4907, 4909, 4911, 4913, 4915, 4917, + 4919, 4921, 4923, 4925, 4927, 4933, 4935, 4937, 4942, 4947, + 4949, 4951, 4956, 4958, 4960, 4962, 4964, 4969, 4970, 4972, + 4974, 4976, 4978, 4980, 4982, 4984, 4986, 4988, 4990, 4992, + 4996, 4998, 5008, 5010, 5012, 5014, 5016, 5019, 5028, 5033, + 5038, 5040, 5042, 5044, 5046, 5048, 5050, 5052, 5057, 5062, + 5064, 5066, 5068, 5070, 5072, 5074, 5080, 5082, 5084, 5086, + 5088, 5090, 5092, 5094, 5096, 5097, 5103, 5108, 5110, 5112, + 5114, 5116, 5118, 5120, 5122, 5124, 5131, 5138, 5140, 5142, + 5144, 5146, 5148, 5150, 5152, 5154, 5156, 5158, 5160, 5162, + 5164, 5166, 5180, 5179, 5296, 5300, 5305, 5307, 5309, 5311, + 5313, 5315, 5320, 5322, 5324, 5326, 5328, 5333, 5337, 5339, + 5341, 5343, 5345, 5347, 5351, 5354, 5357, 5359, 5361, 5363, + 5365, 5367, 5369, 5372, 5375, 5377, 5379, 5381, 5383, 5385, + 5388, 5390, 5392, 5394, 5399, 5400, 5401, 5405, 5406, 5410, + 5410, 5416, 5420, 5427, 5458, 5460, 5462, 5464, 5466, 5468, + 5470, 5473, 5475, 5472, 5478, 5480, 5487, 5489, 5491, 5493, + 5495, 5497, 5499, 5501, 5503, 5506, 5505, 5520, 5519, 5534, + 5540, 5546, 5559, 5560, 5563, 5564, 5569, 5572, 5584, 5583, + 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, + 5609, 5613, 5614, 5618, 5618, 5623, 5624, 5627, 5628, 5631, + 5631, 5636, 5637, 5640, 5641, 5644, 5645, 5648, 5654, 5664, + 5665, 5674, 5679, 5680, 5700, 5702, 5706, 5704, 5721, 5719, + 5737, 5735, 5742, 5751, 5749, 5767, 5766, 5776, 5787, 5785, + 5804, 5803, 5814, 5824, 5825, 5826, 5831, 5831, 5850, 5848, + 5867, 5889, 5937, 5936, 5959, 5977, 5959, 5984, 5988, 6014, + 6015, 6017, 6019, 6022, 6023, 6029, 6036, 6045, 6044, 6051, + 6052, 6056, 6060, 6064, 6070, 6078, 6087, 6088, 6089, 6090, + 6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6102, + 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6114, 6115, + 6116, 6117, 6120, 6122, 6123, 6126, 6127, 6130, 6132, 6136, + 6138, 6137, 6151, 6154, 6153, 6168, 6174, 6187, 6189, 6192, + 6194, 6198, 6199, 6212, 6230, 6234, 6235, 6239, 6252, 6254, + 6258, 6257, 6289, 6291, 6295, 6296, 6297, 6302, 6308, 6312, + 6313, 6317, 6321, 6328, 6335, 6344, 6348, 6349, 6350, 6355, + 6359, 6367, 6368, 6369, 6370, 6371, 6372, 6376, 6377, 6378, + 6379, 6380, 6383, 6386, 6385, 6414, 6415, 6418, 6419, 6422, + 6437, 6437, 6447, 6448, 6452, 6464, 6497, 6496, 6509, 6508, + 6517, 6529, 6540, 6539, 6556, 6563, 6563, 6575, 6582, 6594, + 6606, 6610, 6616, 6626, 6627, 6630, 6638, 6639, 6643, 6644, + 6652, 6661, 6651, 6671, 6678, 6670, 6688, 6700, 6701, 6702, + 6706, 6707, 6710, 6711, 6714, 6723, 6724, 6725, 6727, 6726, + 6736, 6737, 6740, 6741, 6742, 6742, 6743, 6743, 6747, 6748, + 6751, 6753, 6756, 6764, 6765, 6769, 6770, 6775, 6774, 6787, + 6788, 6791, 6796, 6804, 6805, 6808, 6810, 6810, 6818, 6827, + 6817, 6849, 6850, 6853, 6860, 6861, 6864, 6873, 6874, 6880, + 6879, 6893, 6892, 6901, 6900, 6908, 6907, 6917, 6918, 6921, + 6928, 6941, 6942, 6946, 6947, 6950, 6951, 6952, 6955, 6965, + 6967, 6969, 6971, 6974, 6975, 6978, 6982, 6986, 6990, 6994, + 6998, 7002, 7006, 7010, 7018, 7021, 7030, 7029, 7043, 7051, + 7060, 7069, 7078, 7088, 7087, 7090, 7100, 7110, 7114, 7119, + 7118, 7123, 7133, 7138, 7144, 7149, 7154, 7156, 7158, 7160, + 7162, 7164, 7172, 7181, 7183, 7185, 7187, 7196, 7204, 7212, + 7214, 7216, 7226, 7233, 7239, 7247, 7255, 7259, 7263, 7270, + 7277, 7287, 7297, 7307, 7318, 7327, 7341, 7354, 7355, 7357, + 7359, 7362, 7363, 7366, 7367, 7370, 7371, 7374, 7375, 7378, + 7379, 7381, 7383, 7386, 7398, 7397, 7412, 7411, 7421, 7422, + 7425, 7426, 7430, 7431, 7432, 7440, 7439, 7451, 7452, 7455, + 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, + 7465, 7468, 7469, 7473, 7472, 7481, 7482, 7485, 7486, 7487, + 7491, 7490, 7500, 7504, 7508, 7520, 7520, 7528, 7529, 7530, + 7535, 7545, 7544, 7560, 7578, 7589, 7596, 7606, 7577, 7611, + 7620, 7621, 7624, 7625, 7637, 7641, 7642, 7643, 7645, 7647, + 7650, 7651, 7654, 7659, 7666, 7671, 7677, 7679, 7682, 7683, + 7686, 7691, 7697, 7699, 7706, 7707, 7708, 7711, 7713, 7718, + 7719, 7724, 7725, 7731, 7736, 7738, 7740, 7745, 7747, 7758, + 7771, 7792, 7793, 7794, 7803, 7804, 7805, 7810, 7811, 7812, + 7813, 7814, 7828, 7842, 7843, 7844, 7847, 7848, 7849, 7850, + 7858, 7873, 7874, 7877, 7883, 7894, 7897, 7933, 7937, 7945, + 7949, 8017, 8032, 8056, 8057, 8073, 8083, 8086, 8087, 8088, + 8092, 8096, 8097, 8122, 8134, 8147, 8159, 8160, 8169, 8170, + 8179, 8180, 8181, 8184, 8197, 8210, 8224, 8225, 8226, 8227, + 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 8237, + 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 8247, + 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 8257, + 8258, 8259, 8260, 8270, 8271, 8272, 8273, 8274, 8275, 8276, + 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, + 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, + 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, + 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, + 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, + 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, + 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, + 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, + 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, + 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, + 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, + 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, + 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, + 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, + 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, + 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, + 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, + 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, + 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, + 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, + 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, + 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, + 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8512, + 8511, 8525, 8526, 8529, 8530, 8533, 8533, 8610, 8611, 8612, + 8613, 8617, 8618, 8622, 8623, 8624, 8625, 8629, 8630, 8631, + 8632, 8636, 8637, 8640, 8720, 8733, 8737, 8742, 8749, 8764, + 8777, 8798, 8805, 8843, 8886, 8900, 8901, 8902, 8903, 8907, + 8908, 8915, 8924, 8925, 8926, 8927, 8928, 8936, 8935, 8951, + 8952, 8955, 8956, 8959, 8967, 8968, 8969, 8970, 8975, 8974, + 8995, 9007, 9020, 9019, 9038, 9039, 9043, 9044, 9048, 9049, + 9050, 9051, 9053, 9052, 9063, 9064, 9065, 9066, 9067, 9073, + 9078, 9085, 9098, 9110, 9117, 9122, 9130, 9143, 9157, 9159, + 9162, 9163, 9170, 9172, 9176, 9177, 9180, 9180, 9181, 9181, + 9182, 9182, 9183, 9183, 9184, 9185, 9186, 9187, 9188, 9189, + 9190, 9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, + 9200, 9201, 9202, 9203, 9204, 9205, 9206, 9211, 9212, 9216, + 9217, 9221, 9231, 9241, 9254, 9269, 9282, 9295, 9308, 9309, + 9318, 9319, 9328, 9353, 9355, 9362, 9366, 9369, 9370, 9373, + 9394, 9395, 9399, 9403, 9407, 9414, 9415, 9418, 9419, 9423, + 9424, 9430, 9436, 9442, 9452, 9451, 9461, 9462, 9466, 9467, + 9468, 9472, 9473, 9474, 9478, 9479, 9483, 9493, 9500, 9510, + 9519, 9533, 9534, 9539, 9538, 9573, 9574, 9575, 9579, 9579, + 9603, 9604, 9608, 9609, 9610, 9614, 9619, 9618, 9638, 9644, + 9665, 9687, 9689, 9694, 9696, 9698, 9710, 9720, 9733, 9735, + 9737, 9742, 9747, 9749, 9751, 9757, 9758, 9764, 9765, 9767, + 9773, 9772, 9787, 9788, 9792, 9797, 9805, 9805, 9823, 9832, + 9845, 9846, 9848, 9850, 9863, 9861, 9938, 9937, 9947, 9976, + 9985, 9994, 9946, 10018, 10022, 10026, 10030, 10034, 10038, 10044, + 10051, 10058, 10067, 10068, 10072, 10073, 10074, 10078, 10079, 10083, + 10084, 10084, 10089, 10090 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "END_OF_INPUT", "ABORT_SYM", "ACTION", @@ -3240,7 +3369,7 @@ # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -3306,7 +3435,7 @@ # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned short yyr1[] = +static const yytype_uint16 yyr1[] = { 0, 593, 594, 594, 595, 595, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, @@ -3520,7 +3649,7 @@ }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -3736,7 +3865,7 @@ /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned short yydefact[] = +static const yytype_uint16 yydefact[] = { 0, 2, 2035, 650, 0, 1984, 0, 0, 0, 0, 0, 1986, 94, 54, 1289, 1398, 1399, 1212, 1228, 0, @@ -4115,8 +4244,8 @@ 156, 172, 166, 163 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { -1, 52, 53, 54, 55, 56, 57, 990, 58, 538, 937, 1404, 1405, 59, 435, 60, 715, 1149, 1150, 1151, @@ -4571,7 +4700,7 @@ }; /* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = +static const yytype_int16 yypgoto[] = { -3252, -3252, -3252, -3251, -3252, -3252, -3252, -3252, -3252, -3252, -3252, -3252, 996, -3252, -3252, -3252, -3252, -3252, 1240, -1426, @@ -4648,7 +4777,7 @@ number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -2038 -static const short yytable[] = +static const yytype_int16 yytable[] = { 397, 725, 661, 690, 1104, 574, 1013, 1218, 1173, 1174, 1175, 1791, 397, 1433, 932, 397, 1040, 683, 683, 683, @@ -9168,7 +9297,7 @@ 0, 0, 392, 0, 393, 0, 0, 0, 0, 395 }; -static const short yycheck[] = +static const yytype_int16 yycheck[] = { 7, 510, 460, 480, 694, 435, 611, 779, 734, 735, 736, 1320, 19, 985, 535, 22, 636, 472, 473, 474, @@ -13690,7 +13819,7 @@ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned short yystos[] = +static const yytype_uint16 yystos[] = { 0, 3, 13, 14, 26, 28, 47, 48, 53, 57, 58, 70, 87, 106, 115, 116, 117, 128, 129, 151, @@ -14069,22 +14198,6 @@ 660, 173, 1151, 654 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -14110,30 +14223,63 @@ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* 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). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - ((Current).first_line = (Rhs)[1].first_line, \ - (Current).first_column = (Rhs)[1].first_column, \ - (Current).last_line = (Rhs)[N].last_line, \ - (Current).last_column = (Rhs)[N].last_column) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (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 (YYID (0)) #endif + +/* 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 YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -14154,42 +14300,96 @@ do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -14198,45 +14398,52 @@ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -14251,13 +14458,9 @@ if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -14267,45 +14470,47 @@ #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -14315,70 +14520,192 @@ # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; - + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif - } - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; - switch (yytype) - { - default: - break; + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + switch (yytype) { default: - break; + break; } } @@ -14386,13 +14713,13 @@ /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -14409,14 +14736,18 @@ `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -14426,22 +14757,28 @@ #endif #endif { - /* The lookahead symbol. */ + /* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif /* Three stacks and their tools: `yyss': related to states, @@ -14452,18 +14789,18 @@ to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -14472,9 +14809,9 @@ YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* 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")); @@ -14498,8 +14835,7 @@ `------------------------------------------------------------*/ 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. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -14512,18 +14848,18 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* 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 ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -14534,21 +14870,21 @@ } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -14579,19 +14915,17 @@ `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ - + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -14606,7 +14940,7 @@ else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -14626,22 +14960,21 @@ if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; - /* Discard the token being shifted unless it is eof. */ + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; + yystate = yyn; *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; goto yynewstate; @@ -14704,7 +15037,7 @@ THD *thd=YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_DEALLOCATE_PREPARE; - lex->prepared_stmt_name= yyvsp[0].lex_str; + lex->prepared_stmt_name= (yyvsp[(3) - (3)].lex_str); } break; @@ -14714,7 +15047,7 @@ THD *thd=YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_PREPARE; - lex->prepared_stmt_name= yyvsp[-2].lex_str; + lex->prepared_stmt_name= (yyvsp[(2) - (4)].lex_str); } break; @@ -14723,7 +15056,7 @@ { THD *thd=YYTHD; LEX *lex= thd->lex; - lex->prepared_stmt_code= yyvsp[0].lex_str; + lex->prepared_stmt_code= (yyvsp[(1) - (1)].lex_str); lex->prepared_stmt_code_is_varref= FALSE; } break; @@ -14733,7 +15066,7 @@ { THD *thd=YYTHD; LEX *lex= thd->lex; - lex->prepared_stmt_code= yyvsp[0].lex_str; + lex->prepared_stmt_code= (yyvsp[(2) - (2)].lex_str); lex->prepared_stmt_code_is_varref= TRUE; } break; @@ -14744,7 +15077,7 @@ THD *thd=YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_EXECUTE; - lex->prepared_stmt_name= yyvsp[0].lex_str; + lex->prepared_stmt_name= (yyvsp[(2) - (2)].lex_str); } break; @@ -14757,7 +15090,7 @@ #line 1361 "sql_yacc.yy" { LEX *lex=Lex; - LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&yyvsp[0].lex_str, sizeof(LEX_STRING)); + LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&(yyvsp[(2) - (2)].lex_str), sizeof(LEX_STRING)); if (!lexstr || lex->prepared_stmt_params.push_back(lexstr)) MYSQL_YYABORT; } @@ -14779,7 +15112,7 @@ { LEX *lex= Lex; lex->sql_command= SQLCOM_HELP; - lex->help_arg= yyvsp[0].lex_str.str; + lex->help_arg= (yyvsp[(3) - (3)].lex_str).str; } break; @@ -14800,42 +15133,42 @@ case 72: #line 1406 "sql_yacc.yy" { - Lex->mi.host = yyvsp[0].lex_str.str; + Lex->mi.host = (yyvsp[(3) - (3)].lex_str).str; } break; case 73: #line 1411 "sql_yacc.yy" { - Lex->mi.user = yyvsp[0].lex_str.str; + Lex->mi.user = (yyvsp[(3) - (3)].lex_str).str; } break; case 74: #line 1416 "sql_yacc.yy" { - Lex->mi.password = yyvsp[0].lex_str.str; + Lex->mi.password = (yyvsp[(3) - (3)].lex_str).str; } break; case 75: #line 1421 "sql_yacc.yy" { - Lex->mi.port = yyvsp[0].ulong_num; + Lex->mi.port = (yyvsp[(3) - (3)].ulong_num); } break; case 76: #line 1426 "sql_yacc.yy" { - Lex->mi.connect_retry = yyvsp[0].ulong_num; + Lex->mi.connect_retry = (yyvsp[(3) - (3)].ulong_num); } break; case 77: #line 1430 "sql_yacc.yy" { - Lex->mi.ssl= yyvsp[0].ulong_num ? + Lex->mi.ssl= (yyvsp[(3) - (3)].ulong_num) ? LEX_MASTER_INFO::SSL_ENABLE : LEX_MASTER_INFO::SSL_DISABLE; } break; @@ -14843,49 +15176,49 @@ case 78: #line 1435 "sql_yacc.yy" { - Lex->mi.ssl_ca= yyvsp[0].lex_str.str; + Lex->mi.ssl_ca= (yyvsp[(3) - (3)].lex_str).str; } break; case 79: #line 1439 "sql_yacc.yy" { - Lex->mi.ssl_capath= yyvsp[0].lex_str.str; + Lex->mi.ssl_capath= (yyvsp[(3) - (3)].lex_str).str; } break; case 80: #line 1443 "sql_yacc.yy" { - Lex->mi.ssl_cert= yyvsp[0].lex_str.str; + Lex->mi.ssl_cert= (yyvsp[(3) - (3)].lex_str).str; } break; case 81: #line 1447 "sql_yacc.yy" { - Lex->mi.ssl_cipher= yyvsp[0].lex_str.str; + Lex->mi.ssl_cipher= (yyvsp[(3) - (3)].lex_str).str; } break; case 82: #line 1451 "sql_yacc.yy" { - Lex->mi.ssl_key= yyvsp[0].lex_str.str; + Lex->mi.ssl_key= (yyvsp[(3) - (3)].lex_str).str; } break; case 84: #line 1460 "sql_yacc.yy" { - Lex->mi.log_file_name = yyvsp[0].lex_str.str; + Lex->mi.log_file_name = (yyvsp[(3) - (3)].lex_str).str; } break; case 85: #line 1464 "sql_yacc.yy" { - Lex->mi.pos = yyvsp[0].ulonglong_number; + Lex->mi.pos = (yyvsp[(3) - (3)].ulonglong_number); /* If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it instead of causing subsequent errors. @@ -14904,14 +15237,14 @@ case 86: #line 1480 "sql_yacc.yy" { - Lex->mi.relay_log_name = yyvsp[0].lex_str.str; + Lex->mi.relay_log_name = (yyvsp[(3) - (3)].lex_str).str; } break; case 87: #line 1484 "sql_yacc.yy" { - Lex->mi.relay_log_pos = yyvsp[0].ulong_num; + Lex->mi.relay_log_pos = (yyvsp[(3) - (3)].ulong_num); /* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */ Lex->mi.relay_log_pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.relay_log_pos); } @@ -14923,7 +15256,7 @@ THD *thd= YYTHD; LEX *lex=Lex; lex->sql_command= SQLCOM_CREATE_TABLE; - if (!lex->select_lex.add_table_to_list(thd, yyvsp[0].table, NULL, + if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(5) - (5)].table), NULL, TL_OPTION_UPDATING, TL_WRITE)) MYSQL_YYABORT; @@ -14934,7 +15267,7 @@ lex->col_list.empty(); lex->change=NullS; bzero((char*) &lex->create_info,sizeof(lex->create_info)); - lex->create_info.options=yyvsp[-3].num | yyvsp[-1].num; + lex->create_info.options=(yyvsp[(2) - (5)].num) | (yyvsp[(4) - (5)].num); lex->create_info.db_type= (enum db_type) lex->thd->variables.table_type; lex->create_info.default_table_charset= NULL; } @@ -14950,7 +15283,7 @@ { LEX *lex=Lex; lex->sql_command= SQLCOM_CREATE_INDEX; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[0].table, NULL, + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(7) - (7)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; lex->alter_info.reset(); @@ -14965,12 +15298,12 @@ { LEX *lex=Lex; #ifdef ENABLE_SENNA - Key *key= new Key(yyvsp[-9].key_type,yyvsp[-7].lex_str.str, yyvsp[-6].key_alg, 0, lex->col_list, + Key *key= new Key((yyvsp[(2) - (11)].key_type),(yyvsp[(4) - (11)].lex_str).str, (yyvsp[(5) - (11)].key_alg), 0, lex->col_list, lex->senna_flags, lex->senna_initial_n_segments); lex->alter_info.key_list.push_back(key); lex->senna_clear(); #else /* ENABLE_SENNA */ - Key *key= new Key(yyvsp[-9].key_type, yyvsp[-7].lex_str.str, yyvsp[-6].key_alg, 0, lex->col_list); + Key *key= new Key((yyvsp[(2) - (11)].key_type), (yyvsp[(4) - (11)].lex_str).str, (yyvsp[(5) - (11)].key_alg), 0, lex->col_list); lex->alter_info.key_list.push_back(key); #endif /* ENABLE_SENNA */ lex->col_list.empty(); @@ -14990,8 +15323,8 @@ { LEX *lex=Lex; lex->sql_command=SQLCOM_CREATE_DB; - lex->name=yyvsp[-2].lex_str.str; - lex->create_info.options=yyvsp[-3].num; + lex->name=(yyvsp[(4) - (6)].lex_str).str; + lex->create_info.options=(yyvsp[(3) - (6)].num); } break; @@ -15034,18 +15367,18 @@ case 98: #line 1585 "sql_yacc.yy" { - if (!yyvsp[-2].lex_str.str || check_db_name(yyvsp[-2].lex_str.str)) + if (!(yyvsp[(1) - (3)].lex_str).str || check_db_name((yyvsp[(1) - (3)].lex_str).str)) { - my_error(ER_WRONG_DB_NAME, MYF(0), yyvsp[-2].lex_str.str); + my_error(ER_WRONG_DB_NAME, MYF(0), (yyvsp[(1) - (3)].lex_str).str); MYSQL_YYABORT; } - if (check_routine_name(yyvsp[0].lex_str)) + if (check_routine_name((yyvsp[(3) - (3)].lex_str))) { - my_error(ER_SP_WRONG_NAME, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_WRONG_NAME, MYF(0), (yyvsp[(3) - (3)].lex_str).str); MYSQL_YYABORT; } - yyval.spname= new sp_name(yyvsp[-2].lex_str, yyvsp[0].lex_str, true); - yyval.spname->init_qname(YYTHD); + (yyval.spname)= new sp_name((yyvsp[(1) - (3)].lex_str), (yyvsp[(3) - (3)].lex_str), true); + (yyval.spname)->init_qname(YYTHD); } break; @@ -15054,16 +15387,16 @@ { THD *thd= YYTHD; LEX_STRING db; - if (check_routine_name(yyvsp[0].lex_str)) + if (check_routine_name((yyvsp[(1) - (1)].lex_str))) { - my_error(ER_SP_WRONG_NAME, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_WRONG_NAME, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } if (thd->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; - yyval.spname= new sp_name(db, yyvsp[0].lex_str, false); - if (yyval.spname) - yyval.spname->init_qname(YYTHD); + (yyval.spname)= new sp_name(db, (yyvsp[(1) - (1)].lex_str), false); + if ((yyval.spname)) + (yyval.spname)->init_qname(YYTHD); } break; @@ -15084,8 +15417,8 @@ } lex->sql_command = SQLCOM_CREATE_FUNCTION; lex->udf.name = lex->spname->m_name; - lex->udf.returns=(Item_result) yyvsp[-2].num; - lex->udf.dl=yyvsp[0].lex_str.str; + lex->udf.returns=(Item_result) (yyvsp[(2) - (4)].num); + lex->udf.dl=(yyvsp[(4) - (4)].lex_str).str; } break; @@ -15160,7 +15493,7 @@ sp_head *sp= lex->sphead; if (sp->fill_field_definition(YYTHD, lex, - (enum enum_field_types) yyvsp[0].num, + (enum enum_field_types) (yyvsp[(8) - (8)].num), &sp->m_return_field_def)) MYSQL_YYABORT; @@ -15225,7 +15558,7 @@ case 111: #line 1747 "sql_yacc.yy" - { Lex->sp_chistics.comment= yyvsp[0].lex_str; } + { Lex->sp_chistics.comment= (yyvsp[(2) - (2)].lex_str); } break; case 112: @@ -15293,9 +15626,9 @@ LEX *lex = Lex; lex->sql_command= SQLCOM_CALL; - lex->spname= yyvsp[0].spname; + lex->spname= (yyvsp[(2) - (2)].spname); lex->value_list.empty(); - sp_add_used_routine(lex, YYTHD, yyvsp[0].spname, TYPE_ENUM_PROCEDURE); + sp_add_used_routine(lex, YYTHD, (yyvsp[(2) - (2)].spname), TYPE_ENUM_PROCEDURE); } break; @@ -15307,14 +15640,14 @@ case 129: #line 1806 "sql_yacc.yy" { - Lex->value_list.push_back(yyvsp[0].item); + Lex->value_list.push_back((yyvsp[(3) - (3)].item)); } break; case 130: #line 1810 "sql_yacc.yy" { - Lex->value_list.push_back(yyvsp[0].item); + Lex->value_list.push_back((yyvsp[(1) - (1)].item)); } break; @@ -15344,17 +15677,17 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_variable(&yyvsp[-2].lex_str, TRUE)) + if (spc->find_variable(&(yyvsp[(1) - (3)].lex_str), TRUE)) { - my_error(ER_SP_DUP_PARAM, MYF(0), yyvsp[-2].lex_str.str); + my_error(ER_SP_DUP_PARAM, MYF(0), (yyvsp[(1) - (3)].lex_str).str); MYSQL_YYABORT; } - sp_variable_t *spvar= spc->push_variable(&yyvsp[-2].lex_str, - (enum enum_field_types)yyvsp[0].num, + sp_variable_t *spvar= spc->push_variable(&(yyvsp[(1) - (3)].lex_str), + (enum enum_field_types)(yyvsp[(3) - (3)].num), sp_param_in); if (lex->sphead->fill_field_definition(YYTHD, lex, - (enum enum_field_types) yyvsp[0].num, + (enum enum_field_types) (yyvsp[(3) - (3)].num), &spvar->field_def)) { MYSQL_YYABORT; @@ -15370,17 +15703,17 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_variable(&yyvsp[-1].lex_str, TRUE)) + if (spc->find_variable(&(yyvsp[(3) - (4)].lex_str), TRUE)) { - my_error(ER_SP_DUP_PARAM, MYF(0), yyvsp[-1].lex_str.str); + my_error(ER_SP_DUP_PARAM, MYF(0), (yyvsp[(3) - (4)].lex_str).str); MYSQL_YYABORT; } - sp_variable_t *spvar= spc->push_variable(&yyvsp[-1].lex_str, - (enum enum_field_types)yyvsp[0].num, - (sp_param_mode_t)yyvsp[-3].num); + sp_variable_t *spvar= spc->push_variable(&(yyvsp[(3) - (4)].lex_str), + (enum enum_field_types)(yyvsp[(4) - (4)].num), + (sp_param_mode_t)(yyvsp[(1) - (4)].num)); if (lex->sphead->fill_field_definition(YYTHD, lex, - (enum enum_field_types) yyvsp[0].num, + (enum enum_field_types) (yyvsp[(4) - (4)].num), &spvar->field_def)) { MYSQL_YYABORT; @@ -15392,22 +15725,22 @@ case 142: #line 1910 "sql_yacc.yy" - { yyval.num= sp_param_in; } + { (yyval.num)= sp_param_in; } break; case 143: #line 1911 "sql_yacc.yy" - { yyval.num= sp_param_in; } + { (yyval.num)= sp_param_in; } break; case 144: #line 1912 "sql_yacc.yy" - { yyval.num= sp_param_out; } + { (yyval.num)= sp_param_out; } break; case 145: #line 1913 "sql_yacc.yy" - { yyval.num= sp_param_inout; } + { (yyval.num)= sp_param_inout; } break; case 146: @@ -15423,7 +15756,7 @@ case 150: #line 1928 "sql_yacc.yy" { - yyval.spblock.vars= yyval.spblock.conds= yyval.spblock.hndlrs= yyval.spblock.curs= 0; + (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0; } break; @@ -15434,22 +15767,22 @@ because letting the grammar rules reflect it caused tricky shift/reduce conflicts with the wrong result. (And we get better error handling this way.) */ - if ((yyvsp[-1].spblock.vars || yyvsp[-1].spblock.conds) && (yyvsp[-2].spblock.curs || yyvsp[-2].spblock.hndlrs)) + if (((yyvsp[(2) - (3)].spblock).vars || (yyvsp[(2) - (3)].spblock).conds) && ((yyvsp[(1) - (3)].spblock).curs || (yyvsp[(1) - (3)].spblock).hndlrs)) { /* Variable or condition following cursor or handler */ my_message(ER_SP_VARCOND_AFTER_CURSHNDLR, ER(ER_SP_VARCOND_AFTER_CURSHNDLR), MYF(0)); MYSQL_YYABORT; } - if (yyvsp[-1].spblock.curs && yyvsp[-2].spblock.hndlrs) + if ((yyvsp[(2) - (3)].spblock).curs && (yyvsp[(1) - (3)].spblock).hndlrs) { /* Cursor following handler */ my_message(ER_SP_CURSOR_AFTER_HANDLER, ER(ER_SP_CURSOR_AFTER_HANDLER), MYF(0)); MYSQL_YYABORT; } - yyval.spblock.vars= yyvsp[-2].spblock.vars + yyvsp[-1].spblock.vars; - yyval.spblock.conds= yyvsp[-2].spblock.conds + yyvsp[-1].spblock.conds; - yyval.spblock.hndlrs= yyvsp[-2].spblock.hndlrs + yyvsp[-1].spblock.hndlrs; - yyval.spblock.curs= yyvsp[-2].spblock.curs + yyvsp[-1].spblock.curs; + (yyval.spblock).vars= (yyvsp[(1) - (3)].spblock).vars + (yyvsp[(2) - (3)].spblock).vars; + (yyval.spblock).conds= (yyvsp[(1) - (3)].spblock).conds + (yyvsp[(2) - (3)].spblock).conds; + (yyval.spblock).hndlrs= (yyvsp[(1) - (3)].spblock).hndlrs + (yyvsp[(2) - (3)].spblock).hndlrs; + (yyval.spblock).curs= (yyvsp[(1) - (3)].spblock).curs + (yyvsp[(2) - (3)].spblock).curs; } break; @@ -15459,7 +15792,7 @@ LEX *lex= Lex; lex->sphead->reset_lex(YYTHD); - lex->spcont->declare_var_boundary(yyvsp[0].num); + lex->spcont->declare_var_boundary((yyvsp[(2) - (2)].num)); } break; @@ -15469,8 +15802,8 @@ LEX *lex= Lex; sp_pcontext *pctx= lex->spcont; uint num_vars= pctx->context_var_count(); - enum enum_field_types var_type= (enum enum_field_types) yyvsp[-1].num; - Item *dflt_value_item= yyvsp[0].item; + enum enum_field_types var_type= (enum enum_field_types) (yyvsp[(4) - (5)].num); + Item *dflt_value_item= (yyvsp[(5) - (5)].item); if (!dflt_value_item) { @@ -15478,7 +15811,7 @@ /* QQ Set to the var_type with null_value? */ } - for (uint i = num_vars-yyvsp[-3].num ; i < num_vars ; i++) + for (uint i = num_vars-(yyvsp[(2) - (5)].num) ; i < num_vars ; i++) { uint var_idx= pctx->var_context2runtime(i); sp_variable_t *spvar= pctx->find_variable(var_idx); @@ -15509,8 +15842,8 @@ pctx->declare_var_boundary(0); lex->sphead->restore_lex(YYTHD); - yyval.spblock.vars= yyvsp[-3].num; - yyval.spblock.conds= yyval.spblock.hndlrs= yyval.spblock.curs= 0; + (yyval.spblock).vars= (yyvsp[(2) - (5)].num); + (yyval.spblock).conds= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0; } break; @@ -15520,14 +15853,14 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_cond(&yyvsp[-3].lex_str, TRUE)) + if (spc->find_cond(&(yyvsp[(2) - (5)].lex_str), TRUE)) { - my_error(ER_SP_DUP_COND, MYF(0), yyvsp[-3].lex_str.str); + my_error(ER_SP_DUP_COND, MYF(0), (yyvsp[(2) - (5)].lex_str).str); MYSQL_YYABORT; } - YYTHD->lex->spcont->push_cond(&yyvsp[-3].lex_str, yyvsp[0].spcondtype); - yyval.spblock.vars= yyval.spblock.hndlrs= yyval.spblock.curs= 0; - yyval.spblock.conds= 1; + YYTHD->lex->spcont->push_cond(&(yyvsp[(2) - (5)].lex_str), (yyvsp[(5) - (5)].spcondtype)); + (yyval.spblock).vars= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0; + (yyval.spblock).conds= 1; } break; @@ -15541,7 +15874,7 @@ sp_pcontext *ctx= lex->spcont; sp_instr_hpush_jump *i= - new sp_instr_hpush_jump(sp->instructions(), ctx, yyvsp[-2].num, + new sp_instr_hpush_jump(sp->instructions(), ctx, (yyvsp[(2) - (4)].num), ctx->current_var_count()); sp->add_instr(i); @@ -15558,7 +15891,7 @@ sp_label_t *hlab= lex->spcont->pop_label(); /* After this hdlr */ sp_instr_hreturn *i; - if (yyvsp[-5].num == SP_HANDLER_CONTINUE) + if ((yyvsp[(2) - (7)].num) == SP_HANDLER_CONTINUE) { i= new sp_instr_hreturn(sp->instructions(), ctx, ctx->current_var_count()); @@ -15575,9 +15908,9 @@ lex->spcont= ctx->pop_context(); - yyval.spblock.vars= yyval.spblock.conds= yyval.spblock.curs= 0; - yyval.spblock.hndlrs= yyvsp[-1].num; - lex->spcont->add_handlers(yyvsp[-1].num); + (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).curs= 0; + (yyval.spblock).hndlrs= (yyvsp[(6) - (7)].num); + lex->spcont->add_handlers((yyvsp[(6) - (7)].num)); } break; @@ -15590,18 +15923,18 @@ uint offp; sp_instr_cpush *i; - if (ctx->find_cursor(&yyvsp[-3].lex_str, &offp, TRUE)) + if (ctx->find_cursor(&(yyvsp[(2) - (5)].lex_str), &offp, TRUE)) { - my_error(ER_SP_DUP_CURS, MYF(0), yyvsp[-3].lex_str.str); - delete yyvsp[0].lex; + my_error(ER_SP_DUP_CURS, MYF(0), (yyvsp[(2) - (5)].lex_str).str); + delete (yyvsp[(5) - (5)].lex); MYSQL_YYABORT; } - i= new sp_instr_cpush(sp->instructions(), ctx, yyvsp[0].lex, + i= new sp_instr_cpush(sp->instructions(), ctx, (yyvsp[(5) - (5)].lex), ctx->current_cursor_count()); sp->add_instr(i); - ctx->push_cursor(&yyvsp[-3].lex_str); - yyval.spblock.vars= yyval.spblock.conds= yyval.spblock.hndlrs= 0; - yyval.spblock.curs= 1; + ctx->push_cursor(&(yyvsp[(2) - (5)].lex_str)); + (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).hndlrs= 0; + (yyval.spblock).curs= 1; } break; @@ -15635,29 +15968,29 @@ MYSQL_YYABORT; } lex->sp_lex_in_use= TRUE; - yyval.lex= lex; + (yyval.lex)= lex; lex->sphead->restore_lex(YYTHD); } break; case 160: #line 2126 "sql_yacc.yy" - { yyval.num= SP_HANDLER_EXIT; } + { (yyval.num)= SP_HANDLER_EXIT; } break; case 161: #line 2127 "sql_yacc.yy" - { yyval.num= SP_HANDLER_CONTINUE; } + { (yyval.num)= SP_HANDLER_CONTINUE; } break; case 162: #line 2133 "sql_yacc.yy" - { yyval.num= 1; } + { (yyval.num)= 1; } break; case 163: #line 2135 "sql_yacc.yy" - { yyval.num+= 1; } + { (yyval.num)+= 1; } break; case 164: @@ -15667,7 +16000,7 @@ sp_head *sp= lex->sphead; sp_pcontext *ctx= lex->spcont->parent_context(); - if (ctx->find_handler(yyvsp[0].spcondtype)) + if (ctx->find_handler((yyvsp[(1) - (1)].spcondtype))) { my_message(ER_SP_DUP_HANDLER, ER(ER_SP_DUP_HANDLER), MYF(0)); MYSQL_YYABORT; @@ -15677,8 +16010,8 @@ sp_instr_hpush_jump *i= (sp_instr_hpush_jump *)sp->last_instruction(); - i->add_condition(yyvsp[0].spcondtype); - ctx->push_handler(yyvsp[0].spcondtype); + i->add_condition((yyvsp[(1) - (1)].spcondtype)); + ctx->push_handler((yyvsp[(1) - (1)].spcondtype)); } } break; @@ -15686,24 +16019,24 @@ case 165: #line 2163 "sql_yacc.yy" { /* mysql errno */ - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::number; - yyval.spcondtype->mysqlerr= yyvsp[0].ulong_num; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::number; + (yyval.spcondtype)->mysqlerr= (yyvsp[(1) - (1)].ulong_num); } break; case 166: #line 2169 "sql_yacc.yy" { /* SQLSTATE */ - if (!sp_cond_check(&yyvsp[0].lex_str)) + if (!sp_cond_check(&(yyvsp[(3) - (3)].lex_str))) { - my_error(ER_SP_BAD_SQLSTATE, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_BAD_SQLSTATE, MYF(0), (yyvsp[(3) - (3)].lex_str).str); MYSQL_YYABORT; } - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::state; - memcpy(yyval.spcondtype->sqlstate, yyvsp[0].lex_str.str, 5); - yyval.spcondtype->sqlstate[5]= '\0'; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::state; + memcpy((yyval.spcondtype)->sqlstate, (yyvsp[(3) - (3)].lex_str).str, 5); + (yyval.spcondtype)->sqlstate[5]= '\0'; } break; @@ -15720,17 +16053,17 @@ case 169: #line 2189 "sql_yacc.yy" { - yyval.spcondtype= yyvsp[0].spcondtype; + (yyval.spcondtype)= (yyvsp[(1) - (1)].spcondtype); } break; case 170: #line 2193 "sql_yacc.yy" { - yyval.spcondtype= Lex->spcont->find_cond(&yyvsp[0].lex_str); - if (yyval.spcondtype == NULL) + (yyval.spcondtype)= Lex->spcont->find_cond(&(yyvsp[(1) - (1)].lex_str)); + if ((yyval.spcondtype) == NULL) { - my_error(ER_SP_COND_MISMATCH, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_COND_MISMATCH, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -15739,24 +16072,24 @@ case 171: #line 2202 "sql_yacc.yy" { - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::warning; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::warning; } break; case 172: #line 2207 "sql_yacc.yy" { - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::notfound; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::notfound; } break; case 173: #line 2212 "sql_yacc.yy" { - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::exception; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::exception; } break; @@ -15768,13 +16101,13 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_variable(&yyvsp[0].lex_str, TRUE)) + if (spc->find_variable(&(yyvsp[(1) - (1)].lex_str), TRUE)) { - my_error(ER_SP_DUP_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_DUP_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } - spc->push_variable(&yyvsp[0].lex_str, (enum_field_types)0, sp_param_in); - yyval.num= 1; + spc->push_variable(&(yyvsp[(1) - (1)].lex_str), (enum_field_types)0, sp_param_in); + (yyval.num)= 1; } break; @@ -15786,24 +16119,24 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_variable(&yyvsp[0].lex_str, TRUE)) + if (spc->find_variable(&(yyvsp[(3) - (3)].lex_str), TRUE)) { - my_error(ER_SP_DUP_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_DUP_VAR, MYF(0), (yyvsp[(3) - (3)].lex_str).str); MYSQL_YYABORT; } - spc->push_variable(&yyvsp[0].lex_str, (enum_field_types)0, sp_param_in); - yyval.num= yyvsp[-2].num + 1; + spc->push_variable(&(yyvsp[(3) - (3)].lex_str), (enum_field_types)0, sp_param_in); + (yyval.num)= (yyvsp[(1) - (3)].num) + 1; } break; case 176: #line 2252 "sql_yacc.yy" - { yyval.item = NULL; } + { (yyval.item) = NULL; } break; case 177: #line 2253 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } + { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 178: @@ -15882,7 +16215,7 @@ { sp_instr_freturn *i; - i= new sp_instr_freturn(sp->instructions(), lex->spcont, yyvsp[0].item, + i= new sp_instr_freturn(sp->instructions(), lex->spcont, (yyvsp[(3) - (3)].item), sp->m_return_field_def.sql_type, lex); sp->add_instr(i); sp->m_flags|= sp_head::HAS_RETURN; @@ -15930,11 +16263,11 @@ LEX *lex= Lex; sp_head *sp = lex->sphead; sp_pcontext *ctx= lex->spcont; - sp_label_t *lab= ctx->find_label(yyvsp[0].lex_str.str); + sp_label_t *lab= ctx->find_label((yyvsp[(2) - (2)].lex_str).str); if (! lab) { - my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", yyvsp[0].lex_str.str); + my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", (yyvsp[(2) - (2)].lex_str).str); MYSQL_YYABORT; } else @@ -15962,11 +16295,11 @@ LEX *lex= Lex; sp_head *sp= lex->sphead; sp_pcontext *ctx= lex->spcont; - sp_label_t *lab= ctx->find_label(yyvsp[0].lex_str.str); + sp_label_t *lab= ctx->find_label((yyvsp[(2) - (2)].lex_str).str); if (! lab || lab->type != SP_LAB_ITER) { - my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", yyvsp[0].lex_str.str); + my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", (yyvsp[(2) - (2)].lex_str).str); MYSQL_YYABORT; } else @@ -15995,9 +16328,9 @@ uint offset; sp_instr_copen *i; - if (! lex->spcont->find_cursor(&yyvsp[0].lex_str, &offset)) + if (! lex->spcont->find_cursor(&(yyvsp[(2) - (2)].lex_str), &offset)) { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(2) - (2)].lex_str).str); MYSQL_YYABORT; } i= new sp_instr_copen(sp->instructions(), lex->spcont, offset); @@ -16013,9 +16346,9 @@ uint offset; sp_instr_cfetch *i; - if (! lex->spcont->find_cursor(&yyvsp[-1].lex_str, &offset)) + if (! lex->spcont->find_cursor(&(yyvsp[(3) - (4)].lex_str), &offset)) { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), yyvsp[-1].lex_str.str); + my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(3) - (4)].lex_str).str); MYSQL_YYABORT; } i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset); @@ -16036,9 +16369,9 @@ uint offset; sp_instr_cclose *i; - if (! lex->spcont->find_cursor(&yyvsp[0].lex_str, &offset)) + if (! lex->spcont->find_cursor(&(yyvsp[(2) - (2)].lex_str), &offset)) { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(2) - (2)].lex_str).str); MYSQL_YYABORT; } i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset); @@ -16054,9 +16387,9 @@ sp_pcontext *spc= lex->spcont; sp_variable_t *spv; - if (!spc || !(spv = spc->find_variable(&yyvsp[0].lex_str))) + if (!spc || !(spv = spc->find_variable(&(yyvsp[(1) - (1)].lex_str)))) { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } else @@ -16077,9 +16410,9 @@ sp_pcontext *spc= lex->spcont; sp_variable_t *spv; - if (!spc || !(spv = spc->find_variable(&yyvsp[0].lex_str))) + if (!spc || !(spv = spc->find_variable(&(yyvsp[(3) - (3)].lex_str)))) { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(3) - (3)].lex_str).str); MYSQL_YYABORT; } else @@ -16105,7 +16438,7 @@ sp_pcontext *ctx= lex->spcont; uint ip= sp->instructions(); sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx, - yyvsp[-1].item, lex); + (yyvsp[(2) - (3)].item), lex); sp->push_backpatch(i, ctx->push_label((char *)"", 0)); sp->add_cont_backpatch(i); @@ -16150,7 +16483,7 @@ #line 2557 "sql_yacc.yy" { LEX *lex= Lex; - if (case_stmt_action_expr(lex, yyvsp[0].item)) + if (case_stmt_action_expr(lex, (yyvsp[(3) - (3)].item))) MYSQL_YYABORT; lex->sphead->restore_lex(YYTHD); /* For expr $3 */ @@ -16194,7 +16527,7 @@ /* Simple case: = */ LEX *lex= Lex; - case_stmt_action_when(lex, yyvsp[0].item, true); + case_stmt_action_when(lex, (yyvsp[(3) - (3)].item), true); lex->sphead->restore_lex(YYTHD); /* For expr $3 */ } break; @@ -16218,7 +16551,7 @@ #line 2627 "sql_yacc.yy" { LEX *lex= Lex; - case_stmt_action_when(lex, yyvsp[0].item, false); + case_stmt_action_when(lex, (yyvsp[(3) - (3)].item), false); lex->sphead->restore_lex(YYTHD); /* For expr $3 */ } break; @@ -16248,16 +16581,16 @@ { LEX *lex= Lex; sp_pcontext *ctx= lex->spcont; - sp_label_t *lab= ctx->find_label(yyvsp[-1].lex_str.str); + sp_label_t *lab= ctx->find_label((yyvsp[(1) - (2)].lex_str).str); if (lab) { - my_error(ER_SP_LABEL_REDEFINE, MYF(0), yyvsp[-1].lex_str.str); + my_error(ER_SP_LABEL_REDEFINE, MYF(0), (yyvsp[(1) - (2)].lex_str).str); MYSQL_YYABORT; } else { - lab= lex->spcont->push_label(yyvsp[-1].lex_str.str, + lab= lex->spcont->push_label((yyvsp[(1) - (2)].lex_str).str, lex->sphead->instructions()); lab->type= SP_LAB_ITER; } @@ -16269,14 +16602,14 @@ { LEX *lex= Lex; - if (yyvsp[0].lex_str.str) + if ((yyvsp[(5) - (5)].lex_str).str) { - sp_label_t *lab= lex->spcont->find_label(yyvsp[0].lex_str.str); + sp_label_t *lab= lex->spcont->find_label((yyvsp[(5) - (5)].lex_str).str); if (!lab || - my_strcasecmp(system_charset_info, yyvsp[0].lex_str.str, lab->name) != 0) + my_strcasecmp(system_charset_info, (yyvsp[(5) - (5)].lex_str).str, lab->name) != 0) { - my_error(ER_SP_LABEL_MISMATCH, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_LABEL_MISMATCH, MYF(0), (yyvsp[(5) - (5)].lex_str).str); MYSQL_YYABORT; } } @@ -16286,12 +16619,12 @@ case 227: #line 2692 "sql_yacc.yy" - { yyval.lex_str= null_lex_str; } + { (yyval.lex_str)= null_lex_str; } break; case 228: #line 2693 "sql_yacc.yy" - { yyval.lex_str= yyvsp[0].lex_str; } + { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 229: @@ -16315,12 +16648,12 @@ sp_pcontext *ctx= lex->spcont; sp->backpatch(ctx->last_label()); /* We always have a label */ - if (yyvsp[-2].spblock.hndlrs) + if ((yyvsp[(3) - (5)].spblock).hndlrs) sp->add_instr(new sp_instr_hpop(sp->instructions(), ctx, - yyvsp[-2].spblock.hndlrs)); - if (yyvsp[-2].spblock.curs) + (yyvsp[(3) - (5)].spblock).hndlrs)); + if ((yyvsp[(3) - (5)].spblock).curs) sp->add_instr(new sp_instr_cpop(sp->instructions(), ctx, - yyvsp[-2].spblock.curs)); + (yyvsp[(3) - (5)].spblock).curs)); lex->spcont= ctx->pop_context(); } break; @@ -16349,7 +16682,7 @@ sp_head *sp= lex->sphead; uint ip= sp->instructions(); sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont, - yyvsp[-1].item, lex); + (yyvsp[(3) - (4)].item), lex); /* Jumping forward */ sp->push_backpatch(i, lex->spcont->last_label()); @@ -16384,7 +16717,7 @@ uint ip= lex->sphead->instructions(); sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */ sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont, - yyvsp[-2].item, lab->ip, + (yyvsp[(5) - (7)].item), lab->ip, lex); lex->sphead->add_instr(i); lex->sphead->restore_lex(YYTHD); @@ -16432,7 +16765,7 @@ #line 2797 "sql_yacc.yy" { Lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE; - if (!Lex->select_lex.add_table_to_list(YYTHD, yyvsp[0].table, NULL, 0, TL_READ)) + if (!Lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(2) - (2)].table), NULL, 0, TL_READ)) MYSQL_YYABORT; } break; @@ -16441,7 +16774,7 @@ #line 2803 "sql_yacc.yy" { Lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE; - if (!Lex->select_lex.add_table_to_list(YYTHD, yyvsp[-1].table, NULL, 0, TL_READ)) + if (!Lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(3) - (4)].table), NULL, 0, TL_READ)) MYSQL_YYABORT; } break; @@ -16565,83 +16898,83 @@ case 265: #line 2871 "sql_yacc.yy" - { yyval.num= 0; } + { (yyval.num)= 0; } break; case 266: #line 2872 "sql_yacc.yy" - { yyval.num= yyvsp[0].num;} + { (yyval.num)= (yyvsp[(1) - (1)].num);} break; case 267: #line 2875 "sql_yacc.yy" - { yyval.num=yyvsp[0].num; } + { (yyval.num)=(yyvsp[(1) - (1)].num); } break; case 268: #line 2876 "sql_yacc.yy" - { yyval.num= yyvsp[-1].num | yyvsp[0].num; } + { (yyval.num)= (yyvsp[(1) - (2)].num) | (yyvsp[(2) - (2)].num); } break; case 269: #line 2879 "sql_yacc.yy" - { yyval.num=HA_LEX_CREATE_TMP_TABLE; } + { (yyval.num)=HA_LEX_CREATE_TMP_TABLE; } break; case 270: #line 2882 "sql_yacc.yy" - { yyval.num= 0; } + { (yyval.num)= 0; } break; case 271: #line 2883 "sql_yacc.yy" - { yyval.num=HA_LEX_CREATE_IF_NOT_EXISTS; } + { (yyval.num)=HA_LEX_CREATE_IF_NOT_EXISTS; } break; case 279: #line 2899 "sql_yacc.yy" - { Lex->create_info.db_type= yyvsp[0].db_type; Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; } + { Lex->create_info.db_type= (yyvsp[(3) - (3)].db_type); Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; } break; case 280: #line 2900 "sql_yacc.yy" - { Lex->create_info.db_type= yyvsp[0].db_type; WARN_DEPRECATED("TYPE=storage_engine","ENGINE=storage_engine"); Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; } + { Lex->create_info.db_type= (yyvsp[(3) - (3)].db_type); WARN_DEPRECATED("TYPE=storage_engine","ENGINE=storage_engine"); Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; } break; case 281: #line 2901 "sql_yacc.yy" - { Lex->create_info.max_rows= yyvsp[0].ulonglong_number; Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;} + { Lex->create_info.max_rows= (yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;} break; case 282: #line 2902 "sql_yacc.yy" - { Lex->create_info.min_rows= yyvsp[0].ulonglong_number; Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;} + { Lex->create_info.min_rows= (yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;} break; case 283: #line 2903 "sql_yacc.yy" - { Lex->create_info.avg_row_length=yyvsp[0].ulong_num; Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;} + { Lex->create_info.avg_row_length=(yyvsp[(3) - (3)].ulong_num); Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;} break; case 284: #line 2904 "sql_yacc.yy" - { Lex->create_info.password=yyvsp[0].lex_str.str; Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD; } + { Lex->create_info.password=(yyvsp[(3) - (3)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD; } break; case 285: #line 2905 "sql_yacc.yy" - { Lex->create_info.comment=yyvsp[0].lex_str; Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; } + { Lex->create_info.comment=(yyvsp[(3) - (3)].lex_str); Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; } break; case 286: #line 2906 "sql_yacc.yy" - { Lex->create_info.auto_increment_value=yyvsp[0].ulonglong_number; Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;} + { Lex->create_info.auto_increment_value=(yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;} break; case 287: #line 2908 "sql_yacc.yy" { - switch(yyvsp[0].ulong_num) { + switch((yyvsp[(3) - (3)].ulong_num)) { case 0: Lex->create_info.table_options|= HA_OPTION_NO_PACK_KEYS; break; @@ -16667,17 +17000,17 @@ case 289: #line 2928 "sql_yacc.yy" - { Lex->create_info.table_options|= yyvsp[0].ulong_num ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; } + { Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; } break; case 290: #line 2929 "sql_yacc.yy" - { Lex->create_info.table_options|= yyvsp[0].ulong_num ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE; } + { Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE; } break; case 291: #line 2930 "sql_yacc.yy" - { Lex->create_info.row_type= yyvsp[0].row_type; Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT; } + { Lex->create_info.row_type= (yyvsp[(3) - (3)].row_type); Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT; } break; case 292: @@ -16724,22 +17057,22 @@ case 298: #line 2963 "sql_yacc.yy" - { Lex->create_info.merge_insert_method= yyvsp[0].ulong_num; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;} + { Lex->create_info.merge_insert_method= (yyvsp[(3) - (3)].ulong_num); Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;} break; case 299: #line 2964 "sql_yacc.yy" - { Lex->create_info.data_file_name= yyvsp[0].lex_str.str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; } + { Lex->create_info.data_file_name= (yyvsp[(4) - (4)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; } break; case 300: #line 2965 "sql_yacc.yy" - { Lex->create_info.index_file_name= yyvsp[0].lex_str.str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; } + { Lex->create_info.index_file_name= (yyvsp[(4) - (4)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; } break; case 301: #line 2966 "sql_yacc.yy" - { Lex->create_info.connect_string.str= yyvsp[0].lex_str.str; Lex->create_info.connect_string.length= yyvsp[0].lex_str.length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; } + { Lex->create_info.connect_string.str= (yyvsp[(3) - (3)].lex_str).str; Lex->create_info.connect_string.length= (yyvsp[(3) - (3)].lex_str).length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; } break; case 302: @@ -16747,15 +17080,15 @@ { HA_CREATE_INFO *cinfo= &Lex->create_info; if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) && - cinfo->default_table_charset && yyvsp[0].charset && - !my_charset_same(cinfo->default_table_charset,yyvsp[0].charset)) + cinfo->default_table_charset && (yyvsp[(4) - (4)].charset) && + !my_charset_same(cinfo->default_table_charset,(yyvsp[(4) - (4)].charset))) { my_error(ER_CONFLICTING_DECLARATIONS, MYF(0), "CHARACTER SET ", cinfo->default_table_charset->csname, - "CHARACTER SET ", yyvsp[0].charset->csname); + "CHARACTER SET ", (yyvsp[(4) - (4)].charset)->csname); MYSQL_YYABORT; } - Lex->create_info.default_table_charset= yyvsp[0].charset; + Lex->create_info.default_table_charset= (yyvsp[(4) - (4)].charset); Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET; } break; @@ -16765,14 +17098,14 @@ { HA_CREATE_INFO *cinfo= &Lex->create_info; if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) && - cinfo->default_table_charset && yyvsp[0].charset && - !my_charset_same(cinfo->default_table_charset,yyvsp[0].charset)) + cinfo->default_table_charset && (yyvsp[(4) - (4)].charset) && + !my_charset_same(cinfo->default_table_charset,(yyvsp[(4) - (4)].charset))) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - yyvsp[0].charset->name, cinfo->default_table_charset->csname); + (yyvsp[(4) - (4)].charset)->name, cinfo->default_table_charset->csname); MYSQL_YYABORT; } - Lex->create_info.default_table_charset= yyvsp[0].charset; + Lex->create_info.default_table_charset= (yyvsp[(4) - (4)].charset); Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET; } break; @@ -16780,9 +17113,9 @@ case 304: #line 3004 "sql_yacc.yy" { - yyval.db_type = ha_resolve_by_name(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); - if (yyval.db_type == DB_TYPE_UNKNOWN) { - my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), yyvsp[0].lex_str.str); + (yyval.db_type) = ha_resolve_by_name((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length); + if ((yyval.db_type) == DB_TYPE_UNKNOWN) { + my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -16790,62 +17123,62 @@ case 305: #line 3013 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_DEFAULT; } + { (yyval.row_type)= ROW_TYPE_DEFAULT; } break; case 306: #line 3014 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_FIXED; } + { (yyval.row_type)= ROW_TYPE_FIXED; } break; case 307: #line 3015 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_DYNAMIC; } + { (yyval.row_type)= ROW_TYPE_DYNAMIC; } break; case 308: #line 3016 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_COMPRESSED; } + { (yyval.row_type)= ROW_TYPE_COMPRESSED; } break; case 309: #line 3017 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_REDUNDANT; } + { (yyval.row_type)= ROW_TYPE_REDUNDANT; } break; case 310: #line 3018 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_COMPACT; } + { (yyval.row_type)= ROW_TYPE_COMPACT; } break; case 311: #line 3021 "sql_yacc.yy" - { yyval.ulong_num= RAID_TYPE_0; } + { (yyval.ulong_num)= RAID_TYPE_0; } break; case 312: #line 3022 "sql_yacc.yy" - { yyval.ulong_num= RAID_TYPE_0; } + { (yyval.ulong_num)= RAID_TYPE_0; } break; case 313: #line 3023 "sql_yacc.yy" - { yyval.ulong_num=yyvsp[0].ulong_num;} + { (yyval.ulong_num)=(yyvsp[(1) - (1)].ulong_num);} break; case 314: #line 3026 "sql_yacc.yy" - { yyval.ulong_num= MERGE_INSERT_DISABLED; } + { (yyval.ulong_num)= MERGE_INSERT_DISABLED; } break; case 315: #line 3027 "sql_yacc.yy" - { yyval.ulong_num= MERGE_INSERT_TO_FIRST; } + { (yyval.ulong_num)= MERGE_INSERT_TO_FIRST; } break; case 316: #line 3028 "sql_yacc.yy" - { yyval.ulong_num= MERGE_INSERT_TO_LAST; } + { (yyval.ulong_num)= MERGE_INSERT_TO_LAST; } break; case 317: @@ -16855,32 +17188,32 @@ case 319: #line 3035 "sql_yacc.yy" - { yyval.udf_type = UDFTYPE_FUNCTION; } + { (yyval.udf_type) = UDFTYPE_FUNCTION; } break; case 320: #line 3036 "sql_yacc.yy" - { yyval.udf_type = UDFTYPE_AGGREGATE; } + { (yyval.udf_type) = UDFTYPE_AGGREGATE; } break; case 321: #line 3039 "sql_yacc.yy" - {yyval.num = (int) STRING_RESULT; } + {(yyval.num) = (int) STRING_RESULT; } break; case 322: #line 3040 "sql_yacc.yy" - {yyval.num = (int) REAL_RESULT; } + {(yyval.num) = (int) REAL_RESULT; } break; case 323: #line 3041 "sql_yacc.yy" - {yyval.num = (int) DECIMAL_RESULT; } + {(yyval.num) = (int) DECIMAL_RESULT; } break; case 324: #line 3042 "sql_yacc.yy" - {yyval.num = (int) INT_RESULT; } + {(yyval.num) = (int) INT_RESULT; } break; case 330: @@ -16898,12 +17231,12 @@ { LEX *lex=Lex; #ifdef ENABLE_SENNA - Key *key= new Key(yyvsp[-5].key_type,yyvsp[-4].simple_string, yyvsp[-3].key_alg, 0, lex->col_list, + Key *key= new Key((yyvsp[(1) - (6)].key_type),(yyvsp[(2) - (6)].simple_string), (yyvsp[(3) - (6)].key_alg), 0, lex->col_list, lex->senna_flags, lex->senna_initial_n_segments); lex->alter_info.key_list.push_back(key); lex->senna_clear(); #else /* ENABLE_SENNA */ - Key *key= new Key(yyvsp[-5].key_type, yyvsp[-4].simple_string, yyvsp[-3].key_alg, 0, lex->col_list); + Key *key= new Key((yyvsp[(1) - (6)].key_type), (yyvsp[(2) - (6)].simple_string), (yyvsp[(3) - (6)].key_alg), 0, lex->col_list); lex->alter_info.key_list.push_back(key); #endif /* ENABLE_SENNA */ lex->col_list.empty(); /* Alloced by sql_alloc */ @@ -16914,14 +17247,14 @@ #line 3081 "sql_yacc.yy" { LEX *lex=Lex; - const char *key_name= yyvsp[-4].simple_string ? yyvsp[-4].simple_string:yyvsp[-6].simple_string; + const char *key_name= (yyvsp[(3) - (7)].simple_string) ? (yyvsp[(3) - (7)].simple_string):(yyvsp[(1) - (7)].simple_string); #ifdef ENABLE_SENNA - Key *key= new Key(yyvsp[-5].key_type, key_name, yyvsp[-3].key_alg, 0, lex->col_list, + Key *key= new Key((yyvsp[(2) - (7)].key_type), key_name, (yyvsp[(4) - (7)].key_alg), 0, lex->col_list, lex->senna_flags, lex->senna_initial_n_segments); lex->alter_info.key_list.push_back(key); lex->senna_clear(); #else /* ENABLE_SENNA */ - Key *key= new Key(yyvsp[-5].key_type, key_name, yyvsp[-3].key_alg, 0, lex->col_list); + Key *key= new Key((yyvsp[(2) - (7)].key_type), key_name, (yyvsp[(4) - (7)].key_alg), 0, lex->col_list); lex->alter_info.key_list.push_back(key); #endif /* ENABLE_SENNA */ lex->col_list.empty(); /* Alloced by sql_alloc */ @@ -16932,9 +17265,9 @@ #line 3096 "sql_yacc.yy" { LEX *lex=Lex; - const char *key_name= yyvsp[-4].simple_string ? yyvsp[-4].simple_string : yyvsp[-7].simple_string; + const char *key_name= (yyvsp[(4) - (8)].simple_string) ? (yyvsp[(4) - (8)].simple_string) : (yyvsp[(1) - (8)].simple_string); Key *key= new foreign_key(key_name, lex->col_list, - yyvsp[0].table, + (yyvsp[(8) - (8)].table), lex->ref_list, lex->fk_delete_opt, lex->fk_update_opt, @@ -16973,17 +17306,17 @@ case 339: #line 3141 "sql_yacc.yy" - { yyval.simple_string=(char*) 0; } + { (yyval.simple_string)=(char*) 0; } break; case 340: #line 3142 "sql_yacc.yy" - { yyval.simple_string= yyvsp[0].simple_string; } + { (yyval.simple_string)= (yyvsp[(1) - (1)].simple_string); } break; case 341: #line 3146 "sql_yacc.yy" - { yyval.simple_string=yyvsp[0].simple_string; } + { (yyval.simple_string)=(yyvsp[(2) - (2)].simple_string); } break; case 342: @@ -17001,8 +17334,8 @@ #line 3159 "sql_yacc.yy" { LEX *lex=Lex; - if (add_field_to_list(lex->thd, yyvsp[-3].lex_str.str, - (enum enum_field_types) yyvsp[-1].num, + if (add_field_to_list(lex->thd, (yyvsp[(1) - (4)].lex_str).str, + (enum enum_field_types) (yyvsp[(3) - (4)].num), lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, &lex->comment, @@ -17014,149 +17347,149 @@ case 344: #line 3172 "sql_yacc.yy" - { yyval.num=yyvsp[-2].num; } + { (yyval.num)=(yyvsp[(1) - (3)].num); } break; case 345: #line 3173 "sql_yacc.yy" - { yyval.num=yyvsp[-2].num; } + { (yyval.num)=(yyvsp[(1) - (3)].num); } break; case 346: #line 3174 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_FLOAT; } + { (yyval.num)=FIELD_TYPE_FLOAT; } break; case 347: #line 3175 "sql_yacc.yy" { Lex->length= (char*) "1"; - yyval.num=FIELD_TYPE_BIT; } + (yyval.num)=FIELD_TYPE_BIT; } break; case 348: #line 3177 "sql_yacc.yy" - { Lex->length= yyvsp[-1].lex_str.str; - yyval.num=FIELD_TYPE_BIT; } + { Lex->length= (yyvsp[(3) - (4)].lex_str).str; + (yyval.num)=FIELD_TYPE_BIT; } break; case 349: #line 3179 "sql_yacc.yy" { Lex->length=(char*) "1"; - yyval.num=FIELD_TYPE_TINY; } + (yyval.num)=FIELD_TYPE_TINY; } break; case 350: #line 3181 "sql_yacc.yy" { Lex->length=(char*) "1"; - yyval.num=FIELD_TYPE_TINY; } + (yyval.num)=FIELD_TYPE_TINY; } break; case 351: #line 3183 "sql_yacc.yy" - { Lex->length=yyvsp[-2].lex_str.str; - yyval.num=FIELD_TYPE_STRING; } + { Lex->length=(yyvsp[(3) - (5)].lex_str).str; + (yyval.num)=FIELD_TYPE_STRING; } break; case 352: #line 3185 "sql_yacc.yy" { Lex->length=(char*) "1"; - yyval.num=FIELD_TYPE_STRING; } + (yyval.num)=FIELD_TYPE_STRING; } break; case 353: #line 3187 "sql_yacc.yy" - { Lex->length=yyvsp[-2].lex_str.str; - yyval.num=FIELD_TYPE_STRING; + { Lex->length=(yyvsp[(3) - (5)].lex_str).str; + (yyval.num)=FIELD_TYPE_STRING; Lex->charset=national_charset_info; } break; case 354: #line 3190 "sql_yacc.yy" { Lex->length=(char*) "1"; - yyval.num=FIELD_TYPE_STRING; + (yyval.num)=FIELD_TYPE_STRING; Lex->charset=national_charset_info; } break; case 355: #line 3193 "sql_yacc.yy" - { Lex->length=yyvsp[-1].lex_str.str; + { Lex->length=(yyvsp[(3) - (4)].lex_str).str; Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_STRING; } + (yyval.num)=FIELD_TYPE_STRING; } break; case 356: #line 3196 "sql_yacc.yy" { Lex->length= (char*) "1"; Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_STRING; } + (yyval.num)=FIELD_TYPE_STRING; } break; case 357: #line 3199 "sql_yacc.yy" - { Lex->length=yyvsp[-2].lex_str.str; - yyval.num= MYSQL_TYPE_VARCHAR; } + { Lex->length=(yyvsp[(3) - (5)].lex_str).str; + (yyval.num)= MYSQL_TYPE_VARCHAR; } break; case 358: #line 3201 "sql_yacc.yy" - { Lex->length=yyvsp[-2].lex_str.str; - yyval.num= MYSQL_TYPE_VARCHAR; + { Lex->length=(yyvsp[(3) - (5)].lex_str).str; + (yyval.num)= MYSQL_TYPE_VARCHAR; Lex->charset=national_charset_info; } break; case 359: #line 3204 "sql_yacc.yy" - { Lex->length=yyvsp[-1].lex_str.str; + { Lex->length=(yyvsp[(3) - (4)].lex_str).str; Lex->charset=&my_charset_bin; - yyval.num= MYSQL_TYPE_VARCHAR; } + (yyval.num)= MYSQL_TYPE_VARCHAR; } break; case 360: #line 3207 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_YEAR; } + { (yyval.num)=FIELD_TYPE_YEAR; } break; case 361: #line 3208 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_DATE; } + { (yyval.num)=FIELD_TYPE_DATE; } break; case 362: #line 3209 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_TIME; } + { (yyval.num)=FIELD_TYPE_TIME; } break; case 363: #line 3211 "sql_yacc.yy" { if (YYTHD->variables.sql_mode & MODE_MAXDB) - yyval.num=FIELD_TYPE_DATETIME; + (yyval.num)=FIELD_TYPE_DATETIME; else { /* Unlike other types TIMESTAMP fields are NOT NULL by default. */ Lex->type|= NOT_NULL_FLAG; - yyval.num=FIELD_TYPE_TIMESTAMP; + (yyval.num)=FIELD_TYPE_TIMESTAMP; } } break; case 364: #line 3223 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_DATETIME; } + { (yyval.num)=FIELD_TYPE_DATETIME; } break; case 365: #line 3224 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_TINY_BLOB; } + (yyval.num)=FIELD_TYPE_TINY_BLOB; } break; case 366: #line 3226 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_BLOB; } + (yyval.num)=FIELD_TYPE_BLOB; } break; case 367: @@ -17164,8 +17497,8 @@ { #ifdef HAVE_SPATIAL Lex->charset=&my_charset_bin; - Lex->uint_geom_type= (uint)yyvsp[0].num; - yyval.num=FIELD_TYPE_GEOMETRY; + Lex->uint_geom_type= (uint)(yyvsp[(1) - (1)].num); + (yyval.num)=FIELD_TYPE_GEOMETRY; #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -17177,59 +17510,59 @@ case 368: #line 3240 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 369: #line 3242 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_LONG_BLOB; } + (yyval.num)=FIELD_TYPE_LONG_BLOB; } break; case 370: #line 3244 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 371: #line 3246 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + { (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 372: #line 3247 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_TINY_BLOB; } + { (yyval.num)=FIELD_TYPE_TINY_BLOB; } break; case 373: #line 3248 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_BLOB; } + { (yyval.num)=FIELD_TYPE_BLOB; } break; case 374: #line 3249 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + { (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 375: #line 3250 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_LONG_BLOB; } + { (yyval.num)=FIELD_TYPE_LONG_BLOB; } break; case 376: #line 3252 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_NEWDECIMAL;} + { (yyval.num)=FIELD_TYPE_NEWDECIMAL;} break; case 377: #line 3254 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_NEWDECIMAL;} + { (yyval.num)=FIELD_TYPE_NEWDECIMAL;} break; case 378: #line 3256 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_NEWDECIMAL;} + { (yyval.num)=FIELD_TYPE_NEWDECIMAL;} break; case 379: @@ -17239,7 +17572,7 @@ case 380: #line 3258 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_ENUM; } + { (yyval.num)=FIELD_TYPE_ENUM; } break; case 381: @@ -17249,18 +17582,18 @@ case 382: #line 3260 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_SET; } + { (yyval.num)=FIELD_TYPE_SET; } break; case 383: #line 3261 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + { (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 384: #line 3263 "sql_yacc.yy" { - yyval.num=FIELD_TYPE_LONGLONG; + (yyval.num)=FIELD_TYPE_LONGLONG; Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG | UNIQUE_FLAG); } @@ -17268,44 +17601,44 @@ case 385: #line 3271 "sql_yacc.yy" - { yyval.num= Field::GEOM_GEOMETRY; } + { (yyval.num)= Field::GEOM_GEOMETRY; } break; case 386: #line 3272 "sql_yacc.yy" - { yyval.num= Field::GEOM_GEOMETRYCOLLECTION; } + { (yyval.num)= Field::GEOM_GEOMETRYCOLLECTION; } break; case 387: #line 3273 "sql_yacc.yy" { Lex->length= (char*)"21"; - yyval.num= Field::GEOM_POINT; + (yyval.num)= Field::GEOM_POINT; } break; case 388: #line 3276 "sql_yacc.yy" - { yyval.num= Field::GEOM_MULTIPOINT; } + { (yyval.num)= Field::GEOM_MULTIPOINT; } break; case 389: #line 3277 "sql_yacc.yy" - { yyval.num= Field::GEOM_LINESTRING; } + { (yyval.num)= Field::GEOM_LINESTRING; } break; case 390: #line 3278 "sql_yacc.yy" - { yyval.num= Field::GEOM_MULTILINESTRING; } + { (yyval.num)= Field::GEOM_MULTILINESTRING; } break; case 391: #line 3279 "sql_yacc.yy" - { yyval.num= Field::GEOM_POLYGON; } + { (yyval.num)= Field::GEOM_POLYGON; } break; case 392: #line 3280 "sql_yacc.yy" - { yyval.num= Field::GEOM_MULTIPOLYGON; } + { (yyval.num)= Field::GEOM_MULTIPOLYGON; } break; case 393: @@ -17360,43 +17693,43 @@ case 403: #line 3306 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_LONG; } + { (yyval.num)=FIELD_TYPE_LONG; } break; case 404: #line 3307 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_TINY; } + { (yyval.num)=FIELD_TYPE_TINY; } break; case 405: #line 3308 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_SHORT; } + { (yyval.num)=FIELD_TYPE_SHORT; } break; case 406: #line 3309 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_INT24; } + { (yyval.num)=FIELD_TYPE_INT24; } break; case 407: #line 3310 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_LONGLONG; } + { (yyval.num)=FIELD_TYPE_LONGLONG; } break; case 408: #line 3313 "sql_yacc.yy" - { yyval.num= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ? + { (yyval.num)= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ? FIELD_TYPE_FLOAT : FIELD_TYPE_DOUBLE; } break; case 409: #line 3315 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_DOUBLE; } + { (yyval.num)=FIELD_TYPE_DOUBLE; } break; case 410: #line 3316 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_DOUBLE; } + { (yyval.num)=FIELD_TYPE_DOUBLE; } break; case 411: @@ -17406,7 +17739,7 @@ case 412: #line 3321 "sql_yacc.yy" - { Lex->length=yyvsp[-1].lex_str.str; Lex->dec= (char*)0; } + { Lex->length=(yyvsp[(2) - (3)].lex_str).str; Lex->dec= (char*)0; } break; case 413: @@ -17418,7 +17751,7 @@ #line 3326 "sql_yacc.yy" { LEX *lex=Lex; - lex->length=yyvsp[-3].lex_str.str; lex->dec=yyvsp[-1].lex_str.str; + lex->length=(yyvsp[(2) - (5)].lex_str).str; lex->dec=(yyvsp[(4) - (5)].lex_str).str; } break; @@ -17464,7 +17797,7 @@ case 423: #line 3346 "sql_yacc.yy" - { Lex->length= yyvsp[-1].lex_str.str; } + { Lex->length= (yyvsp[(2) - (3)].lex_str).str; } break; case 424: @@ -17504,7 +17837,7 @@ case 432: #line 3363 "sql_yacc.yy" - { Lex->default_value=yyvsp[0].item; } + { Lex->default_value=(yyvsp[(2) - (2)].item); } break; case 433: @@ -17555,33 +17888,33 @@ case 439: #line 3391 "sql_yacc.yy" - { Lex->comment= yyvsp[0].lex_str; } + { Lex->comment= (yyvsp[(2) - (2)].lex_str); } break; case 440: #line 3393 "sql_yacc.yy" { - if (Lex->charset && !my_charset_same(Lex->charset,yyvsp[0].charset)) + if (Lex->charset && !my_charset_same(Lex->charset,(yyvsp[(2) - (2)].charset))) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - yyvsp[0].charset->name,Lex->charset->csname); + (yyvsp[(2) - (2)].charset)->name,Lex->charset->csname); MYSQL_YYABORT; } else { - Lex->charset=yyvsp[0].charset; + Lex->charset=(yyvsp[(2) - (2)].charset); } } break; case 441: #line 3408 "sql_yacc.yy" - { yyval.item= new Item_func_now_local(); } + { (yyval.item)= new Item_func_now_local(); } break; case 442: #line 3409 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 443: @@ -17597,9 +17930,9 @@ case 445: #line 3419 "sql_yacc.yy" { - if (!(yyval.charset=get_charset_by_csname(yyvsp[0].lex_str.str,MY_CS_PRIMARY,MYF(0)))) + if (!((yyval.charset)=get_charset_by_csname((yyvsp[(1) - (1)].lex_str).str,MY_CS_PRIMARY,MYF(0)))) { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -17607,36 +17940,36 @@ case 446: #line 3426 "sql_yacc.yy" - { yyval.charset= &my_charset_bin; } + { (yyval.charset)= &my_charset_bin; } break; case 447: #line 3430 "sql_yacc.yy" - { yyval.charset=yyvsp[0].charset; } + { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 448: #line 3431 "sql_yacc.yy" - { yyval.charset=NULL; } + { (yyval.charset)=NULL; } break; case 449: #line 3434 "sql_yacc.yy" - { yyval.charset= NULL; } + { (yyval.charset)= NULL; } break; case 450: #line 3435 "sql_yacc.yy" - { yyval.charset= yyvsp[0].charset; } + { (yyval.charset)= (yyvsp[(2) - (2)].charset); } break; case 451: #line 3440 "sql_yacc.yy" { - if (!(yyval.charset=get_charset_by_csname(yyvsp[0].lex_str.str,MY_CS_PRIMARY,MYF(0))) && - !(yyval.charset=get_old_charset_by_name(yyvsp[0].lex_str.str))) + if (!((yyval.charset)=get_charset_by_csname((yyvsp[(1) - (1)].lex_str).str,MY_CS_PRIMARY,MYF(0))) && + !((yyval.charset)=get_old_charset_by_name((yyvsp[(1) - (1)].lex_str).str))) { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -17644,25 +17977,25 @@ case 452: #line 3448 "sql_yacc.yy" - { yyval.charset= &my_charset_bin; } + { (yyval.charset)= &my_charset_bin; } break; case 453: #line 3452 "sql_yacc.yy" - { yyval.charset=yyvsp[0].charset; } + { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 454: #line 3453 "sql_yacc.yy" - { yyval.charset=NULL; } + { (yyval.charset)=NULL; } break; case 455: #line 3457 "sql_yacc.yy" { - if (!(yyval.charset=get_charset_by_name(yyvsp[0].lex_str.str,MYF(0)))) + if (!((yyval.charset)=get_charset_by_name((yyvsp[(1) - (1)].lex_str).str,MYF(0)))) { - my_error(ER_UNKNOWN_COLLATION, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_UNKNOWN_COLLATION, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -17670,22 +18003,22 @@ case 456: #line 3466 "sql_yacc.yy" - { yyval.charset=NULL; } + { (yyval.charset)=NULL; } break; case 457: #line 3467 "sql_yacc.yy" - { yyval.charset=yyvsp[0].charset; } + { (yyval.charset)=(yyvsp[(2) - (2)].charset); } break; case 458: #line 3471 "sql_yacc.yy" - { yyval.charset=yyvsp[0].charset; } + { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 459: #line 3472 "sql_yacc.yy" - { yyval.charset=NULL; } + { (yyval.charset)=NULL; } break; case 460: @@ -17727,7 +18060,7 @@ case 466: #line 3491 "sql_yacc.yy" - { Lex->charset=yyvsp[-1].charset; } + { Lex->charset=(yyvsp[(2) - (3)].charset); } break; case 467: @@ -17769,7 +18102,7 @@ case 473: #line 3510 "sql_yacc.yy" - { Lex->charset=yyvsp[0].charset; } + { Lex->charset=(yyvsp[(2) - (2)].charset); } break; case 476: @@ -17784,7 +18117,7 @@ case 477: #line 3525 "sql_yacc.yy" { - yyval.table=yyvsp[-2].table; + (yyval.table)=(yyvsp[(2) - (4)].table); } break; @@ -17800,12 +18133,12 @@ case 480: #line 3534 "sql_yacc.yy" - { Lex->ref_list.push_back(new key_part_spec(yyvsp[0].lex_str.str)); } + { Lex->ref_list.push_back(new key_part_spec((yyvsp[(3) - (3)].lex_str).str)); } break; case 481: #line 3535 "sql_yacc.yy" - { Lex->ref_list.push_back(new key_part_spec(yyvsp[0].lex_str.str)); } + { Lex->ref_list.push_back(new key_part_spec((yyvsp[(1) - (1)].lex_str).str)); } break; case 482: @@ -17830,12 +18163,12 @@ case 486: #line 3547 "sql_yacc.yy" - { Lex->fk_delete_opt= yyvsp[0].num; } + { Lex->fk_delete_opt= (yyvsp[(3) - (3)].num); } break; case 487: #line 3548 "sql_yacc.yy" - { Lex->fk_update_opt= yyvsp[0].num; } + { Lex->fk_update_opt= (yyvsp[(3) - (3)].num); } break; case 488: @@ -17855,44 +18188,44 @@ case 491: #line 3554 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_RESTRICT; } + { (yyval.num)= (int) foreign_key::FK_OPTION_RESTRICT; } break; case 492: #line 3555 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_CASCADE; } + { (yyval.num)= (int) foreign_key::FK_OPTION_CASCADE; } break; case 493: #line 3556 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_SET_NULL; } + { (yyval.num)= (int) foreign_key::FK_OPTION_SET_NULL; } break; case 494: #line 3557 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_NO_ACTION; } + { (yyval.num)= (int) foreign_key::FK_OPTION_NO_ACTION; } break; case 495: #line 3558 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_DEFAULT; } + { (yyval.num)= (int) foreign_key::FK_OPTION_DEFAULT; } break; case 496: #line 3561 "sql_yacc.yy" - { yyval.key_type= Key::MULTIPLE; } + { (yyval.key_type)= Key::MULTIPLE; } break; case 497: #line 3562 "sql_yacc.yy" - { yyval.key_type= Key::FULLTEXT; } + { (yyval.key_type)= Key::FULLTEXT; } break; case 498: #line 3564 "sql_yacc.yy" { #ifdef HAVE_SPATIAL - yyval.key_type= Key::SPATIAL; + (yyval.key_type)= Key::SPATIAL; #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -17903,12 +18236,12 @@ case 499: #line 3575 "sql_yacc.yy" - { yyval.key_type= Key::PRIMARY; } + { (yyval.key_type)= Key::PRIMARY; } break; case 500: #line 3576 "sql_yacc.yy" - { yyval.key_type= Key::UNIQUE; } + { (yyval.key_type)= Key::UNIQUE; } break; case 501: @@ -17943,24 +18276,24 @@ case 508: #line 3593 "sql_yacc.yy" - { yyval.key_type= Key::MULTIPLE; } + { (yyval.key_type)= Key::MULTIPLE; } break; case 509: #line 3594 "sql_yacc.yy" - { yyval.key_type= Key::UNIQUE; } + { (yyval.key_type)= Key::UNIQUE; } break; case 510: #line 3595 "sql_yacc.yy" - { yyval.key_type= Key::FULLTEXT;} + { (yyval.key_type)= Key::FULLTEXT;} break; case 511: #line 3597 "sql_yacc.yy" { #ifdef HAVE_SPATIAL - yyval.key_type= Key::SPATIAL; + (yyval.key_type)= Key::SPATIAL; #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -17971,39 +18304,39 @@ case 512: #line 3609 "sql_yacc.yy" - { yyval.key_alg= HA_KEY_ALG_UNDEF; } + { (yyval.key_alg)= HA_KEY_ALG_UNDEF; } break; case 513: #line 3610 "sql_yacc.yy" - { yyval.key_alg= yyvsp[0].key_alg; } + { (yyval.key_alg)= (yyvsp[(2) - (2)].key_alg); } break; case 514: #line 3611 "sql_yacc.yy" - { yyval.key_alg= yyvsp[0].key_alg; } + { (yyval.key_alg)= (yyvsp[(2) - (2)].key_alg); } break; case 515: #line 3614 "sql_yacc.yy" - { yyval.key_alg= HA_KEY_ALG_BTREE; } + { (yyval.key_alg)= HA_KEY_ALG_BTREE; } break; case 516: #line 3616 "sql_yacc.yy" { - yyval.key_alg= HA_KEY_ALG_RTREE; + (yyval.key_alg)= HA_KEY_ALG_RTREE; } break; case 517: #line 3619 "sql_yacc.yy" - { yyval.key_alg= HA_KEY_ALG_HASH; } + { (yyval.key_alg)= HA_KEY_ALG_HASH; } break; case 518: #line 3620 "sql_yacc.yy" - { yyval.key_alg= HA_KEY_ALG_UNDEF; } + { (yyval.key_alg)= HA_KEY_ALG_UNDEF; } break; case 521: @@ -18073,22 +18406,24 @@ #line 3662 "sql_yacc.yy" { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_NGRAM; Lex->senna_flags |= SEN_INDEX_DELIMITED; #endif /* ENABLE_SENNA */ } break; case 529: -#line 3667 "sql_yacc.yy" +#line 3668 "sql_yacc.yy" { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_DELIMITED; Lex->senna_flags &= ~SEN_INDEX_NGRAM; #endif /* ENABLE_SENNA */ } break; case 530: -#line 3672 "sql_yacc.yy" +#line 3674 "sql_yacc.yy" { #ifdef ENABLE_SENNA Lex->senna_flags |= SEN_INDEX_NGRAM; @@ -18097,7 +18432,7 @@ break; case 531: -#line 3677 "sql_yacc.yy" +#line 3679 "sql_yacc.yy" { #ifdef ENABLE_SENNA Lex->senna_flags |= 0x00080000; @@ -18106,84 +18441,84 @@ break; case 532: -#line 3682 "sql_yacc.yy" +#line 3684 "sql_yacc.yy" { #ifdef ENABLE_SENNA - if (yyvsp[0].ulong_num < 65536) { - Lex->senna_initial_n_segments=yyvsp[0].ulong_num; + if ((yyvsp[(1) - (1)].ulong_num) < 65536) { + Lex->senna_initial_n_segments=(yyvsp[(1) - (1)].ulong_num); } else { - Lex->senna_flags |= yyvsp[0].ulong_num; + Lex->senna_flags |= (yyvsp[(1) - (1)].ulong_num); } #endif /* ENABLE_SENNA */ } break; case 533: -#line 3693 "sql_yacc.yy" - { Lex->col_list.push_back(yyvsp[-1].key_part); } +#line 3695 "sql_yacc.yy" + { Lex->col_list.push_back((yyvsp[(3) - (4)].key_part)); } break; case 534: -#line 3694 "sql_yacc.yy" - { Lex->col_list.push_back(yyvsp[-1].key_part); } +#line 3696 "sql_yacc.yy" + { Lex->col_list.push_back((yyvsp[(1) - (2)].key_part)); } break; case 535: -#line 3697 "sql_yacc.yy" - { yyval.key_part=new key_part_spec(yyvsp[0].lex_str.str); } +#line 3699 "sql_yacc.yy" + { (yyval.key_part)=new key_part_spec((yyvsp[(1) - (1)].lex_str).str); } break; case 536: -#line 3699 "sql_yacc.yy" +#line 3701 "sql_yacc.yy" { - int key_part_len= atoi(yyvsp[-1].lex_str.str); + int key_part_len= atoi((yyvsp[(3) - (4)].lex_str).str); if (!key_part_len) { - my_error(ER_KEY_PART_0, MYF(0), yyvsp[-3].lex_str.str); + my_error(ER_KEY_PART_0, MYF(0), (yyvsp[(1) - (4)].lex_str).str); } - yyval.key_part=new key_part_spec(yyvsp[-3].lex_str.str,(uint) key_part_len); + (yyval.key_part)=new key_part_spec((yyvsp[(1) - (4)].lex_str).str,(uint) key_part_len); } break; case 537: -#line 3709 "sql_yacc.yy" - { yyval.simple_string=(char*) 0; } +#line 3711 "sql_yacc.yy" + { (yyval.simple_string)=(char*) 0; } break; case 538: -#line 3710 "sql_yacc.yy" - { yyval.simple_string=yyvsp[0].lex_str.str; } +#line 3712 "sql_yacc.yy" + { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str; } break; case 539: -#line 3713 "sql_yacc.yy" - { yyval.lex_str= null_lex_str; } +#line 3715 "sql_yacc.yy" + { (yyval.lex_str)= null_lex_str; } break; case 540: -#line 3714 "sql_yacc.yy" - { yyval.lex_str= yyvsp[0].lex_str; } +#line 3716 "sql_yacc.yy" + { (yyval.lex_str)= (yyvsp[(2) - (2)].lex_str); } break; case 541: -#line 3717 "sql_yacc.yy" - { Lex->interval_list.push_back(yyvsp[0].string); } +#line 3719 "sql_yacc.yy" + { Lex->interval_list.push_back((yyvsp[(1) - (1)].string)); } break; case 542: -#line 3718 "sql_yacc.yy" - { Lex->interval_list.push_back(yyvsp[0].string); } +#line 3720 "sql_yacc.yy" + { Lex->interval_list.push_back((yyvsp[(3) - (3)].string)); } break; case 543: -#line 3726 "sql_yacc.yy" +#line 3728 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_ALTER_TABLE; lex->name= 0; lex->duplicates= DUP_ERROR; - if (!lex->select_lex.add_table_to_list(thd, yyvsp[0].table, NULL, + if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(4) - (4)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; #ifdef ENABLE_SENNA @@ -18203,12 +18538,12 @@ break; case 544: -#line 3750 "sql_yacc.yy" +#line 3752 "sql_yacc.yy" {} break; case 545: -#line 3752 "sql_yacc.yy" +#line 3754 "sql_yacc.yy" { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -18216,19 +18551,19 @@ break; case 546: -#line 3757 "sql_yacc.yy" +#line 3759 "sql_yacc.yy" { LEX *lex=Lex; THD *thd= Lex->thd; lex->sql_command=SQLCOM_ALTER_DB; - lex->name= yyvsp[-2].simple_string; + lex->name= (yyvsp[(3) - (5)].simple_string); if (lex->name == NULL && thd->copy_db_to(&lex->name, NULL)) MYSQL_YYABORT; } break; case 547: -#line 3766 "sql_yacc.yy" +#line 3768 "sql_yacc.yy" { LEX *lex= Lex; @@ -18242,17 +18577,17 @@ break; case 548: -#line 3777 "sql_yacc.yy" +#line 3779 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ALTER_PROCEDURE; - lex->spname= yyvsp[-2].spname; + lex->spname= (yyvsp[(3) - (5)].spname); } break; case 549: -#line 3784 "sql_yacc.yy" +#line 3786 "sql_yacc.yy" { LEX *lex= Lex; @@ -18266,54 +18601,54 @@ break; case 550: -#line 3795 "sql_yacc.yy" +#line 3797 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ALTER_FUNCTION; - lex->spname= yyvsp[-2].spname; + lex->spname= (yyvsp[(3) - (5)].spname); } break; case 551: -#line 3803 "sql_yacc.yy" +#line 3805 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_CREATE_VIEW; lex->create_view_mode= VIEW_ALTER; /* first table in list is target VIEW name */ - lex->select_lex.add_table_to_list(thd, yyvsp[0].table, NULL, TL_OPTION_UPDATING); + lex->select_lex.add_table_to_list(thd, (yyvsp[(6) - (6)].table), NULL, TL_OPTION_UPDATING); } break; case 552: -#line 3812 "sql_yacc.yy" +#line 3814 "sql_yacc.yy" {} break; case 553: -#line 3816 "sql_yacc.yy" - { yyval.simple_string= 0; } +#line 3818 "sql_yacc.yy" + { (yyval.simple_string)= 0; } break; case 554: -#line 3817 "sql_yacc.yy" - { yyval.simple_string= yyvsp[0].lex_str.str; } +#line 3819 "sql_yacc.yy" + { (yyval.simple_string)= (yyvsp[(1) - (1)].lex_str).str; } break; case 556: -#line 3820 "sql_yacc.yy" +#line 3822 "sql_yacc.yy" { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; } break; case 557: -#line 3821 "sql_yacc.yy" +#line 3823 "sql_yacc.yy" { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; } break; case 560: -#line 3827 "sql_yacc.yy" +#line 3829 "sql_yacc.yy" { LEX *lex=Lex; lex->change=0; @@ -18322,35 +18657,35 @@ break; case 561: -#line 3834 "sql_yacc.yy" +#line 3836 "sql_yacc.yy" { } break; case 562: -#line 3836 "sql_yacc.yy" +#line 3838 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_ADD_INDEX; } break; case 563: -#line 3840 "sql_yacc.yy" +#line 3842 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_ADD_COLUMN | ALTER_ADD_INDEX; } break; case 564: -#line 3844 "sql_yacc.yy" +#line 3846 "sql_yacc.yy" { LEX *lex=Lex; - lex->change= yyvsp[0].lex_str.str; + lex->change= (yyvsp[(3) - (3)].lex_str).str; lex->alter_info.flags|= ALTER_CHANGE_COLUMN; } break; case 566: -#line 3851 "sql_yacc.yy" +#line 3853 "sql_yacc.yy" { LEX *lex=Lex; lex->length=lex->dec=0; lex->type=0; @@ -18362,39 +18697,39 @@ break; case 567: -#line 3860 "sql_yacc.yy" +#line 3862 "sql_yacc.yy" { LEX *lex=Lex; - if (add_field_to_list(lex->thd,yyvsp[-3].lex_str.str, - (enum enum_field_types) yyvsp[-1].num, + if (add_field_to_list(lex->thd,(yyvsp[(3) - (6)].lex_str).str, + (enum enum_field_types) (yyvsp[(5) - (6)].num), lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, &lex->comment, - yyvsp[-3].lex_str.str, &lex->interval_list, lex->charset, + (yyvsp[(3) - (6)].lex_str).str, &lex->interval_list, lex->charset, lex->uint_geom_type)) MYSQL_YYABORT; } break; case 569: -#line 3873 "sql_yacc.yy" +#line 3875 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN, - yyvsp[-1].lex_str.str)); + (yyvsp[(3) - (4)].lex_str).str)); lex->alter_info.flags|= ALTER_DROP_COLUMN; } break; case 570: -#line 3880 "sql_yacc.yy" +#line 3882 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_DROP_INDEX; } break; case 571: -#line 3884 "sql_yacc.yy" +#line 3886 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, @@ -18404,17 +18739,17 @@ break; case 572: -#line 3891 "sql_yacc.yy" +#line 3893 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - yyvsp[0].lex_str.str)); + (yyvsp[(3) - (3)].lex_str).str)); lex->alter_info.flags|= ALTER_DROP_INDEX; } break; case 573: -#line 3898 "sql_yacc.yy" +#line 3900 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= DISABLE; @@ -18423,7 +18758,7 @@ break; case 574: -#line 3904 "sql_yacc.yy" +#line 3906 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= ENABLE; @@ -18432,64 +18767,64 @@ break; case 575: -#line 3910 "sql_yacc.yy" +#line 3912 "sql_yacc.yy" { LEX *lex=Lex; - lex->alter_info.alter_list.push_back(new Alter_column(yyvsp[-3].lex_str.str,yyvsp[0].item)); + lex->alter_info.alter_list.push_back(new Alter_column((yyvsp[(3) - (6)].lex_str).str,(yyvsp[(6) - (6)].item))); lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT; } break; case 576: -#line 3916 "sql_yacc.yy" +#line 3918 "sql_yacc.yy" { LEX *lex=Lex; - lex->alter_info.alter_list.push_back(new Alter_column(yyvsp[-2].lex_str.str, + lex->alter_info.alter_list.push_back(new Alter_column((yyvsp[(3) - (5)].lex_str).str, (Item*) 0)); lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT; } break; case 577: -#line 3923 "sql_yacc.yy" +#line 3925 "sql_yacc.yy" { LEX *lex=Lex; THD *thd= lex->thd; - lex->select_lex.db=yyvsp[0].table->db.str; + lex->select_lex.db=(yyvsp[(3) - (3)].table)->db.str; if (lex->select_lex.db == NULL && thd->copy_db_to(&lex->select_lex.db, NULL)) { MYSQL_YYABORT; } - if (check_table_name(yyvsp[0].table->table.str,yyvsp[0].table->table.length) || - yyvsp[0].table->db.str && check_db_name(yyvsp[0].table->db.str)) + if (check_table_name((yyvsp[(3) - (3)].table)->table.str,(yyvsp[(3) - (3)].table)->table.length) || + (yyvsp[(3) - (3)].table)->db.str && check_db_name((yyvsp[(3) - (3)].table)->db.str)) { - my_error(ER_WRONG_TABLE_NAME, MYF(0), yyvsp[0].table->table.str); + my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(3) - (3)].table)->table.str); MYSQL_YYABORT; } - lex->name= yyvsp[0].table->table.str; + lex->name= (yyvsp[(3) - (3)].table)->table.str; lex->alter_info.flags|= ALTER_RENAME; } break; case 578: -#line 3942 "sql_yacc.yy" +#line 3944 "sql_yacc.yy" { - if (!yyvsp[-1].charset) + if (!(yyvsp[(4) - (5)].charset)) { THD *thd= YYTHD; - yyvsp[-1].charset= thd->variables.collation_database; + (yyvsp[(4) - (5)].charset)= thd->variables.collation_database; } - yyvsp[0].charset= yyvsp[0].charset ? yyvsp[0].charset : yyvsp[-1].charset; - if (!my_charset_same(yyvsp[-1].charset,yyvsp[0].charset)) + (yyvsp[(5) - (5)].charset)= (yyvsp[(5) - (5)].charset) ? (yyvsp[(5) - (5)].charset) : (yyvsp[(4) - (5)].charset); + if (!my_charset_same((yyvsp[(4) - (5)].charset),(yyvsp[(5) - (5)].charset))) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - yyvsp[0].charset->name, yyvsp[-1].charset->csname); + (yyvsp[(5) - (5)].charset)->name, (yyvsp[(4) - (5)].charset)->csname); MYSQL_YYABORT; } LEX *lex= Lex; lex->create_info.table_charset= - lex->create_info.default_table_charset= yyvsp[0].charset; + lex->create_info.default_table_charset= (yyvsp[(5) - (5)].charset); lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET | HA_CREATE_USED_DEFAULT_CHARSET); lex->alter_info.flags|= ALTER_CONVERT; @@ -18497,7 +18832,7 @@ break; case 579: -#line 3963 "sql_yacc.yy" +#line 3965 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= ALTER_OPTIONS; @@ -18505,14 +18840,14 @@ break; case 580: -#line 3968 "sql_yacc.yy" +#line 3970 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_FORCE; } break; case 581: -#line 3972 "sql_yacc.yy" +#line 3974 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= ALTER_ORDER; @@ -18520,77 +18855,77 @@ break; case 582: -#line 3978 "sql_yacc.yy" +#line 3980 "sql_yacc.yy" {} break; case 583: -#line 3979 "sql_yacc.yy" +#line 3981 "sql_yacc.yy" {} break; case 584: -#line 3982 "sql_yacc.yy" +#line 3984 "sql_yacc.yy" { Lex->ignore= 0;} break; case 585: -#line 3983 "sql_yacc.yy" +#line 3985 "sql_yacc.yy" { Lex->ignore= 1;} break; case 586: -#line 3987 "sql_yacc.yy" +#line 3989 "sql_yacc.yy" { Lex->drop_mode= DROP_DEFAULT; } break; case 587: -#line 3988 "sql_yacc.yy" +#line 3990 "sql_yacc.yy" { Lex->drop_mode= DROP_RESTRICT; } break; case 588: -#line 3989 "sql_yacc.yy" +#line 3991 "sql_yacc.yy" { Lex->drop_mode= DROP_CASCADE; } break; case 589: -#line 3993 "sql_yacc.yy" +#line 3995 "sql_yacc.yy" {} break; case 590: -#line 3994 "sql_yacc.yy" - { store_position_for_column(yyvsp[0].lex_str.str); } +#line 3996 "sql_yacc.yy" + { store_position_for_column((yyvsp[(2) - (2)].lex_str).str); } break; case 591: -#line 3995 "sql_yacc.yy" +#line 3997 "sql_yacc.yy" { store_position_for_column(first_keyword); } break; case 592: -#line 3998 "sql_yacc.yy" +#line 4000 "sql_yacc.yy" {} break; case 593: -#line 3999 "sql_yacc.yy" +#line 4001 "sql_yacc.yy" {} break; case 594: -#line 4000 "sql_yacc.yy" +#line 4002 "sql_yacc.yy" {} break; case 595: -#line 4001 "sql_yacc.yy" +#line 4003 "sql_yacc.yy" {} break; case 596: -#line 4009 "sql_yacc.yy" +#line 4011 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -18602,12 +18937,12 @@ break; case 597: -#line 4018 "sql_yacc.yy" +#line 4020 "sql_yacc.yy" {} break; case 598: -#line 4020 "sql_yacc.yy" +#line 4022 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -18617,7 +18952,7 @@ break; case 599: -#line 4027 "sql_yacc.yy" +#line 4029 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -18628,12 +18963,12 @@ break; case 600: -#line 4035 "sql_yacc.yy" +#line 4037 "sql_yacc.yy" {} break; case 601: -#line 4037 "sql_yacc.yy" +#line 4039 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -18642,58 +18977,58 @@ break; case 602: -#line 4047 "sql_yacc.yy" +#line 4049 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_BEGIN; - lex->start_transaction_opt= yyvsp[0].num; + lex->start_transaction_opt= (yyvsp[(3) - (3)].num); } break; case 603: -#line 4055 "sql_yacc.yy" - { yyval.num = 0; } +#line 4057 "sql_yacc.yy" + { (yyval.num) = 0; } break; case 604: -#line 4057 "sql_yacc.yy" +#line 4059 "sql_yacc.yy" { - yyval.num= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; + (yyval.num)= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; } break; case 605: -#line 4063 "sql_yacc.yy" +#line 4065 "sql_yacc.yy" { Lex->slave_thd_opt= 0; } break; case 606: -#line 4065 "sql_yacc.yy" +#line 4067 "sql_yacc.yy" {} break; case 609: -#line 4074 "sql_yacc.yy" +#line 4076 "sql_yacc.yy" {} break; case 610: -#line 4075 "sql_yacc.yy" +#line 4077 "sql_yacc.yy" { Lex->slave_thd_opt|=SLAVE_SQL; } break; case 611: -#line 4076 "sql_yacc.yy" +#line 4078 "sql_yacc.yy" { Lex->slave_thd_opt|=SLAVE_IO; } break; case 612: -#line 4080 "sql_yacc.yy" +#line 4082 "sql_yacc.yy" {} break; case 613: -#line 4082 "sql_yacc.yy" +#line 4084 "sql_yacc.yy" { LEX *lex=Lex; if ((lex->mi.log_file_name || lex->mi.pos) && @@ -18710,35 +19045,35 @@ break; case 616: -#line 4104 "sql_yacc.yy" +#line 4106 "sql_yacc.yy" { Lex->sql_command = SQLCOM_RESTORE_TABLE; } break; case 617: -#line 4108 "sql_yacc.yy" +#line 4110 "sql_yacc.yy" { - Lex->backup_dir = yyvsp[0].lex_str.str; + Lex->backup_dir = (yyvsp[(6) - (6)].lex_str).str; } break; case 618: -#line 4114 "sql_yacc.yy" +#line 4116 "sql_yacc.yy" { Lex->sql_command = SQLCOM_BACKUP_TABLE; } break; case 619: -#line 4118 "sql_yacc.yy" +#line 4120 "sql_yacc.yy" { - Lex->backup_dir = yyvsp[0].lex_str.str; + Lex->backup_dir = (yyvsp[(6) - (6)].lex_str).str; } break; case 620: -#line 4124 "sql_yacc.yy" +#line 4126 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_CHECKSUM; @@ -18746,92 +19081,92 @@ break; case 621: -#line 4129 "sql_yacc.yy" +#line 4131 "sql_yacc.yy" {} break; case 622: -#line 4133 "sql_yacc.yy" +#line 4135 "sql_yacc.yy" { Lex->check_opt.flags= 0; } break; case 623: -#line 4134 "sql_yacc.yy" +#line 4136 "sql_yacc.yy" { Lex->check_opt.flags= T_QUICK; } break; case 624: -#line 4135 "sql_yacc.yy" +#line 4137 "sql_yacc.yy" { Lex->check_opt.flags= T_EXTEND; } break; case 625: -#line 4140 "sql_yacc.yy" +#line 4142 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPAIR; - lex->no_write_to_binlog= yyvsp[-1].num; + lex->no_write_to_binlog= (yyvsp[(2) - (3)].num); lex->check_opt.init(); } break; case 626: -#line 4147 "sql_yacc.yy" +#line 4149 "sql_yacc.yy" {} break; case 627: -#line 4151 "sql_yacc.yy" +#line 4153 "sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 628: -#line 4152 "sql_yacc.yy" +#line 4154 "sql_yacc.yy" {} break; case 629: -#line 4155 "sql_yacc.yy" +#line 4157 "sql_yacc.yy" {} break; case 630: -#line 4156 "sql_yacc.yy" +#line 4158 "sql_yacc.yy" {} break; case 631: -#line 4159 "sql_yacc.yy" +#line 4161 "sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 632: -#line 4160 "sql_yacc.yy" +#line 4162 "sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 633: -#line 4161 "sql_yacc.yy" +#line 4163 "sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_USEFRM; } break; case 634: -#line 4165 "sql_yacc.yy" +#line 4167 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_ANALYZE; - lex->no_write_to_binlog= yyvsp[-1].num; + lex->no_write_to_binlog= (yyvsp[(2) - (3)].num); lex->check_opt.init(); } break; case 635: -#line 4172 "sql_yacc.yy" +#line 4174 "sql_yacc.yy" {} break; case 636: -#line 4177 "sql_yacc.yy" +#line 4179 "sql_yacc.yy" { LEX *lex=Lex; @@ -18846,153 +19181,153 @@ break; case 637: -#line 4189 "sql_yacc.yy" +#line 4191 "sql_yacc.yy" {} break; case 638: -#line 4193 "sql_yacc.yy" +#line 4195 "sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 639: -#line 4194 "sql_yacc.yy" +#line 4196 "sql_yacc.yy" {} break; case 640: -#line 4197 "sql_yacc.yy" +#line 4199 "sql_yacc.yy" {} break; case 641: -#line 4198 "sql_yacc.yy" +#line 4200 "sql_yacc.yy" {} break; case 642: -#line 4201 "sql_yacc.yy" +#line 4203 "sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 643: -#line 4202 "sql_yacc.yy" +#line 4204 "sql_yacc.yy" { Lex->check_opt.flags|= T_FAST; } break; case 644: -#line 4203 "sql_yacc.yy" +#line 4205 "sql_yacc.yy" { Lex->check_opt.flags|= T_MEDIUM; } break; case 645: -#line 4204 "sql_yacc.yy" +#line 4206 "sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 646: -#line 4205 "sql_yacc.yy" +#line 4207 "sql_yacc.yy" { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; } break; case 647: -#line 4206 "sql_yacc.yy" +#line 4208 "sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; } break; case 648: -#line 4210 "sql_yacc.yy" +#line 4212 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_OPTIMIZE; - lex->no_write_to_binlog= yyvsp[-1].num; + lex->no_write_to_binlog= (yyvsp[(2) - (3)].num); lex->check_opt.init(); } break; case 649: -#line 4217 "sql_yacc.yy" +#line 4219 "sql_yacc.yy" {} break; case 650: -#line 4221 "sql_yacc.yy" - { yyval.num= 0; } +#line 4223 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 651: -#line 4222 "sql_yacc.yy" - { yyval.num= 1; } +#line 4224 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 652: -#line 4223 "sql_yacc.yy" - { yyval.num= 1; } +#line 4225 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 653: -#line 4228 "sql_yacc.yy" +#line 4230 "sql_yacc.yy" { Lex->sql_command= SQLCOM_RENAME_TABLE; } break; case 654: -#line 4232 "sql_yacc.yy" +#line 4234 "sql_yacc.yy" {} break; case 655: -#line 4234 "sql_yacc.yy" +#line 4236 "sql_yacc.yy" { Lex->sql_command = SQLCOM_RENAME_USER; } break; case 656: -#line 4241 "sql_yacc.yy" +#line 4243 "sql_yacc.yy" { - if (Lex->users_list.push_back(yyvsp[-2].lex_user) || Lex->users_list.push_back(yyvsp[0].lex_user)) + if (Lex->users_list.push_back((yyvsp[(1) - (3)].lex_user)) || Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; } break; case 657: -#line 4246 "sql_yacc.yy" +#line 4248 "sql_yacc.yy" { - if (Lex->users_list.push_back(yyvsp[-2].lex_user) || Lex->users_list.push_back(yyvsp[0].lex_user)) + if (Lex->users_list.push_back((yyvsp[(3) - (5)].lex_user)) || Lex->users_list.push_back((yyvsp[(5) - (5)].lex_user))) MYSQL_YYABORT; } break; case 660: -#line 4258 "sql_yacc.yy" +#line 4260 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sl= lex->current_select; - if (!sl->add_table_to_list(lex->thd, yyvsp[-2].table,NULL,TL_OPTION_UPDATING, + if (!sl->add_table_to_list(lex->thd, (yyvsp[(1) - (3)].table),NULL,TL_OPTION_UPDATING, TL_IGNORE) || - !sl->add_table_to_list(lex->thd, yyvsp[0].table,NULL,TL_OPTION_UPDATING, + !sl->add_table_to_list(lex->thd, (yyvsp[(3) - (3)].table),NULL,TL_OPTION_UPDATING, TL_IGNORE)) MYSQL_YYABORT; } break; case 661: -#line 4270 "sql_yacc.yy" +#line 4272 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE; - lex->ident= yyvsp[0].lex_str; + lex->ident= (yyvsp[(5) - (5)].lex_str); } break; case 664: -#line 4283 "sql_yacc.yy" +#line 4285 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; - if (!sel->add_table_to_list(lex->thd, yyvsp[-1].table, NULL, 0, + if (!sel->add_table_to_list(lex->thd, (yyvsp[(1) - (2)].table), NULL, 0, TL_READ, sel->get_use_index(), (List *)0)) @@ -19001,17 +19336,17 @@ break; case 665: -#line 4295 "sql_yacc.yy" - { yyval.lex_str= yyvsp[0].lex_str; } +#line 4297 "sql_yacc.yy" + { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 666: -#line 4296 "sql_yacc.yy" - { yyval.lex_str = default_key_cache_base; } +#line 4298 "sql_yacc.yy" + { (yyval.lex_str) = default_key_cache_base; } break; case 667: -#line 4301 "sql_yacc.yy" +#line 4303 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; @@ -19019,16 +19354,16 @@ break; case 668: -#line 4306 "sql_yacc.yy" +#line 4308 "sql_yacc.yy" {} break; case 671: -#line 4315 "sql_yacc.yy" +#line 4317 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; - if (!sel->add_table_to_list(lex->thd, yyvsp[-2].table, NULL, yyvsp[0].num, + if (!sel->add_table_to_list(lex->thd, (yyvsp[(1) - (3)].table), NULL, (yyvsp[(3) - (3)].num), TL_READ, sel->get_use_index(), (List *)0)) @@ -19037,12 +19372,12 @@ break; case 672: -#line 4327 "sql_yacc.yy" +#line 4329 "sql_yacc.yy" { Select->interval_list.empty(); } break; case 673: -#line 4329 "sql_yacc.yy" +#line 4331 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -19051,12 +19386,12 @@ break; case 674: -#line 4337 "sql_yacc.yy" +#line 4339 "sql_yacc.yy" { Lex->select_lex.use_index_ptr= 0; } break; case 675: -#line 4339 "sql_yacc.yy" +#line 4341 "sql_yacc.yy" { SELECT_LEX *sel= &Lex->select_lex; sel->use_index_ptr= &sel->use_index; @@ -19064,17 +19399,17 @@ break; case 676: -#line 4347 "sql_yacc.yy" - { yyval.num= 0; } +#line 4349 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 677: -#line 4348 "sql_yacc.yy" - { yyval.num= TL_OPTION_IGNORE_LEAVES; } +#line 4350 "sql_yacc.yy" + { (yyval.num)= TL_OPTION_IGNORE_LEAVES; } break; case 678: -#line 4358 "sql_yacc.yy" +#line 4360 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -19082,7 +19417,7 @@ break; case 681: -#line 4372 "sql_yacc.yy" +#line 4374 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -19107,7 +19442,7 @@ break; case 683: -#line 4397 "sql_yacc.yy" +#line 4399 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -19126,7 +19461,7 @@ break; case 685: -#line 4416 "sql_yacc.yy" +#line 4418 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -19137,19 +19472,19 @@ break; case 686: -#line 4424 "sql_yacc.yy" +#line 4426 "sql_yacc.yy" { Select->parsing_place= NO_MATTER; } break; case 688: -#line 4430 "sql_yacc.yy" +#line 4432 "sql_yacc.yy" {} break; case 693: -#line 4439 "sql_yacc.yy" +#line 4441 "sql_yacc.yy" { Select->context.table_list= Select->context.first_name_resolution_table= @@ -19158,7 +19493,7 @@ break; case 696: -#line 4454 "sql_yacc.yy" +#line 4456 "sql_yacc.yy" { if (test_all_bits(Select->options, SELECT_ALL | SELECT_DISTINCT)) { @@ -19169,12 +19504,12 @@ break; case 699: -#line 4468 "sql_yacc.yy" +#line 4470 "sql_yacc.yy" { Select->options|= SELECT_STRAIGHT_JOIN; } break; case 700: -#line 4470 "sql_yacc.yy" +#line 4472 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19183,22 +19518,22 @@ break; case 701: -#line 4475 "sql_yacc.yy" +#line 4477 "sql_yacc.yy" { Select->options|= SELECT_DISTINCT; } break; case 702: -#line 4476 "sql_yacc.yy" +#line 4478 "sql_yacc.yy" { Select->options|= SELECT_SMALL_RESULT; } break; case 703: -#line 4477 "sql_yacc.yy" +#line 4479 "sql_yacc.yy" { Select->options|= SELECT_BIG_RESULT; } break; case 704: -#line 4479 "sql_yacc.yy" +#line 4481 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19207,7 +19542,7 @@ break; case 705: -#line 4485 "sql_yacc.yy" +#line 4487 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19216,7 +19551,7 @@ break; case 706: -#line 4491 "sql_yacc.yy" +#line 4493 "sql_yacc.yy" { Lex->safe_to_cache_query=0; Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE; @@ -19225,7 +19560,7 @@ break; case 707: -#line 4497 "sql_yacc.yy" +#line 4499 "sql_yacc.yy" { /* Honor this flag only if SQL_NO_CACHE wasn't specified. */ if (Lex->select_lex.sql_cache != SELECT_LEX::SQL_NO_CACHE) @@ -19238,12 +19573,12 @@ break; case 708: -#line 4506 "sql_yacc.yy" +#line 4508 "sql_yacc.yy" { Select->options|= SELECT_ALL; } break; case 710: -#line 4512 "sql_yacc.yy" +#line 4514 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select->set_lock_for_tables(TL_WRITE); @@ -19252,7 +19587,7 @@ break; case 711: -#line 4518 "sql_yacc.yy" +#line 4520 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select-> @@ -19262,7 +19597,7 @@ break; case 714: -#line 4530 "sql_yacc.yy" +#line 4532 "sql_yacc.yy" { THD *thd= YYTHD; if (add_item_to_list(thd, @@ -19275,828 +19610,828 @@ break; case 715: -#line 4543 "sql_yacc.yy" +#line 4545 "sql_yacc.yy" { THD *thd= YYTHD; - DBUG_ASSERT(yyvsp[-3].simple_string < yyvsp[-1].simple_string); + DBUG_ASSERT((yyvsp[(1) - (4)].simple_string) < (yyvsp[(3) - (4)].simple_string)); - if (add_item_to_list(thd, yyvsp[-2].item)) + if (add_item_to_list(thd, (yyvsp[(2) - (4)].item))) MYSQL_YYABORT; - if (yyvsp[0].lex_str.str) + if ((yyvsp[(4) - (4)].lex_str).str) { - yyvsp[-2].item->is_autogenerated_name= FALSE; - yyvsp[-2].item->set_name(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, system_charset_info); + (yyvsp[(2) - (4)].item)->is_autogenerated_name= FALSE; + (yyvsp[(2) - (4)].item)->set_name((yyvsp[(4) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).length, system_charset_info); } - else if (!yyvsp[-2].item->name) + else if (!(yyvsp[(2) - (4)].item)->name) { - yyvsp[-2].item->set_name(yyvsp[-3].simple_string, (uint) (yyvsp[-1].simple_string - yyvsp[-3].simple_string), thd->charset()); + (yyvsp[(2) - (4)].item)->set_name((yyvsp[(1) - (4)].simple_string), (uint) ((yyvsp[(3) - (4)].simple_string) - (yyvsp[(1) - (4)].simple_string)), thd->charset()); } } break; case 716: -#line 4562 "sql_yacc.yy" +#line 4564 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; - yyval.simple_string= (char*) lip->tok_start; + (yyval.simple_string)= (char*) lip->tok_start; } break; case 717: -#line 4569 "sql_yacc.yy" +#line 4571 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; - yyval.simple_string=(char*) lip->tok_end; + (yyval.simple_string)=(char*) lip->tok_end; } break; case 718: -#line 4576 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 4578 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 719: -#line 4577 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 4579 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 720: -#line 4580 "sql_yacc.yy" - { yyval.lex_str=null_lex_str;} +#line 4582 "sql_yacc.yy" + { (yyval.lex_str)=null_lex_str;} break; case 721: -#line 4581 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 4583 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 722: -#line 4582 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 4584 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 723: -#line 4583 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 4585 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 724: -#line 4584 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 4586 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 725: -#line 4588 "sql_yacc.yy" +#line 4590 "sql_yacc.yy" {} break; case 726: -#line 4589 "sql_yacc.yy" +#line 4591 "sql_yacc.yy" {} break; case 727: -#line 4593 "sql_yacc.yy" +#line 4595 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 728: -#line 4595 "sql_yacc.yy" +#line 4597 "sql_yacc.yy" { List *list= Select->expr_list.pop(); if (list->elements) { - list->push_front(yyvsp[-2].item); - yyval.item= new Item_cond_or(*list); + list->push_front((yyvsp[(1) - (3)].item)); + (yyval.item)= new Item_cond_or(*list); /* optimize construction of logical OR to reduce amount of objects for complex expressions */ } else - yyval.item= yyvsp[-2].item; + (yyval.item)= (yyvsp[(1) - (3)].item); delete list; } break; case 730: -#line 4613 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 4615 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 731: -#line 4617 "sql_yacc.yy" - { yyval.item= new Item_cond_xor(yyvsp[-2].item,yyvsp[0].item); } +#line 4619 "sql_yacc.yy" + { (yyval.item)= new Item_cond_xor((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 732: -#line 4618 "sql_yacc.yy" +#line 4620 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 733: -#line 4620 "sql_yacc.yy" +#line 4622 "sql_yacc.yy" { List *list= Select->expr_list.pop(); if (list->elements) { - list->push_front(yyvsp[-2].item); - yyval.item= new Item_cond_and(*list); + list->push_front((yyvsp[(1) - (3)].item)); + (yyval.item)= new Item_cond_and(*list); /* optimize construction of logical AND to reduce amount of objects for complex expressions */ } else - yyval.item= yyvsp[-2].item; + (yyval.item)= (yyvsp[(1) - (3)].item); delete list; } break; case 735: -#line 4638 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 4640 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 736: -#line 4642 "sql_yacc.yy" - { yyval.item= negate_expression(YYTHD, yyvsp[0].item); } +#line 4644 "sql_yacc.yy" + { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); } break; case 738: -#line 4647 "sql_yacc.yy" - { yyval.item= new (YYTHD->mem_root) Item_func_istrue(yyvsp[-2].item); } +#line 4649 "sql_yacc.yy" + { (yyval.item)= new (YYTHD->mem_root) Item_func_istrue((yyvsp[(1) - (3)].item)); } break; case 739: -#line 4649 "sql_yacc.yy" - { yyval.item= new (YYTHD->mem_root) Item_func_isnottrue(yyvsp[-3].item); } +#line 4651 "sql_yacc.yy" + { (yyval.item)= new (YYTHD->mem_root) Item_func_isnottrue((yyvsp[(1) - (4)].item)); } break; case 740: -#line 4651 "sql_yacc.yy" - { yyval.item= new (YYTHD->mem_root) Item_func_isfalse(yyvsp[-2].item); } +#line 4653 "sql_yacc.yy" + { (yyval.item)= new (YYTHD->mem_root) Item_func_isfalse((yyvsp[(1) - (3)].item)); } break; case 741: -#line 4653 "sql_yacc.yy" - { yyval.item= new (YYTHD->mem_root) Item_func_isnotfalse(yyvsp[-3].item); } +#line 4655 "sql_yacc.yy" + { (yyval.item)= new (YYTHD->mem_root) Item_func_isnotfalse((yyvsp[(1) - (4)].item)); } break; case 742: -#line 4654 "sql_yacc.yy" - { yyval.item= new Item_func_isnull(yyvsp[-2].item); } +#line 4656 "sql_yacc.yy" + { (yyval.item)= new Item_func_isnull((yyvsp[(1) - (3)].item)); } break; case 743: -#line 4655 "sql_yacc.yy" - { yyval.item= new Item_func_isnotnull(yyvsp[-3].item); } +#line 4657 "sql_yacc.yy" + { (yyval.item)= new Item_func_isnotnull((yyvsp[(1) - (4)].item)); } break; case 745: -#line 4660 "sql_yacc.yy" - { yyval.item= new Item_func_isnull(yyvsp[-2].item); } +#line 4662 "sql_yacc.yy" + { (yyval.item)= new Item_func_isnull((yyvsp[(1) - (3)].item)); } break; case 746: -#line 4661 "sql_yacc.yy" - { yyval.item= new Item_func_isnotnull(yyvsp[-3].item); } +#line 4663 "sql_yacc.yy" + { (yyval.item)= new Item_func_isnotnull((yyvsp[(1) - (4)].item)); } break; case 747: -#line 4662 "sql_yacc.yy" - { yyval.item= new Item_func_equal(yyvsp[-2].item,yyvsp[0].item); } +#line 4664 "sql_yacc.yy" + { (yyval.item)= new Item_func_equal((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 748: -#line 4664 "sql_yacc.yy" - { yyval.item= (*yyvsp[-1].boolfunc2creator)(0)->create(yyvsp[-2].item,yyvsp[0].item); } +#line 4666 "sql_yacc.yy" + { (yyval.item)= (*(yyvsp[(2) - (3)].boolfunc2creator))(0)->create((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 749: -#line 4666 "sql_yacc.yy" - { yyval.item= all_any_subquery_creator(yyvsp[-5].item, yyvsp[-4].boolfunc2creator, yyvsp[-3].num, yyvsp[-1].select_lex); } +#line 4668 "sql_yacc.yy" + { (yyval.item)= all_any_subquery_creator((yyvsp[(1) - (6)].item), (yyvsp[(2) - (6)].boolfunc2creator), (yyvsp[(3) - (6)].num), (yyvsp[(5) - (6)].select_lex)); } break; case 751: -#line 4671 "sql_yacc.yy" +#line 4673 "sql_yacc.yy" { - yyval.item= new (YYTHD->mem_root) Item_in_subselect(yyvsp[-4].item, yyvsp[-1].select_lex); + (yyval.item)= new (YYTHD->mem_root) Item_in_subselect((yyvsp[(1) - (5)].item), (yyvsp[(4) - (5)].select_lex)); } break; case 752: -#line 4675 "sql_yacc.yy" +#line 4677 "sql_yacc.yy" { THD *thd= YYTHD; - Item *item= new (thd->mem_root) Item_in_subselect(yyvsp[-5].item, yyvsp[-1].select_lex); - yyval.item= negate_expression(thd, item); + Item *item= new (thd->mem_root) Item_in_subselect((yyvsp[(1) - (6)].item), (yyvsp[(5) - (6)].select_lex)); + (yyval.item)= negate_expression(thd, item); } break; case 753: -#line 4681 "sql_yacc.yy" +#line 4683 "sql_yacc.yy" { - yyval.item= handle_sql2003_note184_exception(YYTHD, yyvsp[-4].item, true, yyvsp[-1].item); + (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (5)].item), true, (yyvsp[(4) - (5)].item)); } break; case 754: -#line 4685 "sql_yacc.yy" +#line 4687 "sql_yacc.yy" { - yyvsp[-1].item_list->push_front(yyvsp[-3].item); - yyvsp[-1].item_list->push_front(yyvsp[-6].item); - yyval.item= new (YYTHD->mem_root) Item_func_in(*yyvsp[-1].item_list); + (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(4) - (7)].item)); + (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(1) - (7)].item)); + (yyval.item)= new (YYTHD->mem_root) Item_func_in(*(yyvsp[(6) - (7)].item_list)); } break; case 755: -#line 4691 "sql_yacc.yy" +#line 4693 "sql_yacc.yy" { - yyval.item= handle_sql2003_note184_exception(YYTHD, yyvsp[-5].item, false, yyvsp[-1].item); + (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (6)].item), false, (yyvsp[(5) - (6)].item)); } break; case 756: -#line 4695 "sql_yacc.yy" +#line 4697 "sql_yacc.yy" { - yyvsp[-1].item_list->push_front(yyvsp[-3].item); - yyvsp[-1].item_list->push_front(yyvsp[-7].item); - Item_func_in *item = new (YYTHD->mem_root) Item_func_in(*yyvsp[-1].item_list); + (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(5) - (8)].item)); + (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(1) - (8)].item)); + Item_func_in *item = new (YYTHD->mem_root) Item_func_in(*(yyvsp[(7) - (8)].item_list)); item->negate(); - yyval.item= item; + (yyval.item)= item; } break; case 757: -#line 4703 "sql_yacc.yy" - { yyval.item= new Item_func_between(yyvsp[-4].item,yyvsp[-2].item,yyvsp[0].item); } +#line 4705 "sql_yacc.yy" + { (yyval.item)= new Item_func_between((yyvsp[(1) - (5)].item),(yyvsp[(3) - (5)].item),(yyvsp[(5) - (5)].item)); } break; case 758: -#line 4705 "sql_yacc.yy" +#line 4707 "sql_yacc.yy" { - Item_func_between *item= new Item_func_between(yyvsp[-5].item,yyvsp[-2].item,yyvsp[0].item); + Item_func_between *item= new Item_func_between((yyvsp[(1) - (6)].item),(yyvsp[(4) - (6)].item),(yyvsp[(6) - (6)].item)); item->negate(); - yyval.item= item; + (yyval.item)= item; } break; case 759: -#line 4711 "sql_yacc.yy" - { yyval.item= new Item_func_eq(new Item_func_soundex(yyvsp[-3].item), - new Item_func_soundex(yyvsp[0].item)); } +#line 4713 "sql_yacc.yy" + { (yyval.item)= new Item_func_eq(new Item_func_soundex((yyvsp[(1) - (4)].item)), + new Item_func_soundex((yyvsp[(4) - (4)].item))); } break; case 760: -#line 4714 "sql_yacc.yy" - { yyval.item= new Item_func_like(yyvsp[-3].item,yyvsp[-1].item,yyvsp[0].item,Lex->escape_used); } +#line 4716 "sql_yacc.yy" + { (yyval.item)= new Item_func_like((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].item),Lex->escape_used); } break; case 761: -#line 4716 "sql_yacc.yy" - { yyval.item= new Item_func_not(new Item_func_like(yyvsp[-4].item,yyvsp[-1].item,yyvsp[0].item, Lex->escape_used)); } +#line 4718 "sql_yacc.yy" + { (yyval.item)= new Item_func_not(new Item_func_like((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].item), Lex->escape_used)); } break; case 762: -#line 4717 "sql_yacc.yy" - { yyval.item= new Item_func_regex(yyvsp[-2].item,yyvsp[0].item); } +#line 4719 "sql_yacc.yy" + { (yyval.item)= new Item_func_regex((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 763: -#line 4719 "sql_yacc.yy" - { yyval.item= negate_expression(YYTHD, new Item_func_regex(yyvsp[-3].item,yyvsp[0].item)); } +#line 4721 "sql_yacc.yy" + { (yyval.item)= negate_expression(YYTHD, new Item_func_regex((yyvsp[(1) - (4)].item),(yyvsp[(4) - (4)].item))); } break; case 765: -#line 4723 "sql_yacc.yy" - { yyval.item= new Item_func_bit_or(yyvsp[-2].item,yyvsp[0].item); } +#line 4725 "sql_yacc.yy" + { (yyval.item)= new Item_func_bit_or((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 767: -#line 4727 "sql_yacc.yy" - { yyval.item= new Item_func_bit_and(yyvsp[-2].item,yyvsp[0].item); } +#line 4729 "sql_yacc.yy" + { (yyval.item)= new Item_func_bit_and((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 769: -#line 4732 "sql_yacc.yy" - { yyval.item= new Item_func_shift_left(yyvsp[-2].item,yyvsp[0].item); } +#line 4734 "sql_yacc.yy" + { (yyval.item)= new Item_func_shift_left((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 770: -#line 4734 "sql_yacc.yy" - { yyval.item= new Item_func_shift_right(yyvsp[-2].item,yyvsp[0].item); } +#line 4736 "sql_yacc.yy" + { (yyval.item)= new Item_func_shift_right((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 772: -#line 4738 "sql_yacc.yy" - { yyval.item= new Item_func_plus(yyvsp[-2].item,yyvsp[0].item); } +#line 4740 "sql_yacc.yy" + { (yyval.item)= new Item_func_plus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 773: -#line 4739 "sql_yacc.yy" - { yyval.item= new Item_func_minus(yyvsp[-2].item,yyvsp[0].item); } +#line 4741 "sql_yacc.yy" + { (yyval.item)= new Item_func_minus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 774: -#line 4741 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-3].item,yyvsp[-1].item,yyvsp[0].interval,0); } +#line 4743 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].interval),0); } break; case 775: -#line 4743 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-3].item,yyvsp[-1].item,yyvsp[0].interval,1); } +#line 4745 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].interval),1); } break; case 777: -#line 4747 "sql_yacc.yy" - { yyval.item= new Item_func_mul(yyvsp[-2].item,yyvsp[0].item); } +#line 4749 "sql_yacc.yy" + { (yyval.item)= new Item_func_mul((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 778: -#line 4748 "sql_yacc.yy" - { yyval.item= new Item_func_div(yyvsp[-2].item,yyvsp[0].item); } +#line 4750 "sql_yacc.yy" + { (yyval.item)= new Item_func_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 779: -#line 4749 "sql_yacc.yy" - { yyval.item= new Item_func_mod(yyvsp[-2].item,yyvsp[0].item); } +#line 4751 "sql_yacc.yy" + { (yyval.item)= new Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 780: -#line 4750 "sql_yacc.yy" - { yyval.item= new Item_func_int_div(yyvsp[-2].item,yyvsp[0].item); } +#line 4752 "sql_yacc.yy" + { (yyval.item)= new Item_func_int_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 781: -#line 4751 "sql_yacc.yy" - { yyval.item= new Item_func_mod(yyvsp[-2].item,yyvsp[0].item); } +#line 4753 "sql_yacc.yy" + { (yyval.item)= new Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 783: -#line 4755 "sql_yacc.yy" - { yyval.item= new Item_func_bit_xor(yyvsp[-2].item,yyvsp[0].item); } +#line 4757 "sql_yacc.yy" + { (yyval.item)= new Item_func_bit_xor((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 793: -#line 4763 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_eq_creator; } +#line 4765 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_eq_creator; } break; case 794: -#line 4764 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_ge_creator; } +#line 4766 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_ge_creator; } break; case 795: -#line 4765 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_gt_creator; } +#line 4767 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_gt_creator; } break; case 796: -#line 4766 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_le_creator; } +#line 4768 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_le_creator; } break; case 797: -#line 4767 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_lt_creator; } +#line 4769 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_lt_creator; } break; case 798: -#line 4768 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_ne_creator; } +#line 4770 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_ne_creator; } break; case 799: -#line 4771 "sql_yacc.yy" - { yyval.num = 1; } +#line 4773 "sql_yacc.yy" + { (yyval.num) = 1; } break; case 800: -#line 4772 "sql_yacc.yy" - { yyval.num = 0; } +#line 4774 "sql_yacc.yy" + { (yyval.num) = 0; } break; case 801: -#line 4776 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 4778 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(2) - (2)].item); } break; case 803: -#line 4782 "sql_yacc.yy" +#line 4784 "sql_yacc.yy" { - yyval.item= new Item_func_set_collation(yyvsp[-2].item, - new Item_string(yyvsp[0].lex_str.str, - yyvsp[0].lex_str.length, + (yyval.item)= new Item_func_set_collation((yyvsp[(1) - (3)].item), + new Item_string((yyvsp[(3) - (3)].lex_str).str, + (yyvsp[(3) - (3)].lex_str).length, YYTHD->charset())); } break; case 808: -#line 4793 "sql_yacc.yy" - { yyval.item= new Item_func_concat(yyvsp[-2].item, yyvsp[0].item); } +#line 4795 "sql_yacc.yy" + { (yyval.item)= new Item_func_concat((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item)); } break; case 809: -#line 4794 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 4796 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 810: -#line 4795 "sql_yacc.yy" - { yyval.item= new Item_func_neg(yyvsp[0].item); } +#line 4797 "sql_yacc.yy" + { (yyval.item)= new Item_func_neg((yyvsp[(2) - (2)].item)); } break; case 811: -#line 4796 "sql_yacc.yy" - { yyval.item= new Item_func_bit_neg(yyvsp[0].item); } +#line 4798 "sql_yacc.yy" + { (yyval.item)= new Item_func_bit_neg((yyvsp[(2) - (2)].item)); } break; case 812: -#line 4797 "sql_yacc.yy" - { yyval.item= negate_expression(YYTHD, yyvsp[0].item); } +#line 4799 "sql_yacc.yy" + { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); } break; case 813: -#line 4799 "sql_yacc.yy" +#line 4801 "sql_yacc.yy" { - yyval.item= new Item_singlerow_subselect(yyvsp[-1].select_lex); + (yyval.item)= new Item_singlerow_subselect((yyvsp[(2) - (3)].select_lex)); } break; case 814: -#line 4802 "sql_yacc.yy" - { yyval.item= yyvsp[-1].item; } +#line 4804 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(2) - (3)].item); } break; case 815: -#line 4804 "sql_yacc.yy" +#line 4806 "sql_yacc.yy" { - yyvsp[-1].item_list->push_front(yyvsp[-3].item); - yyval.item= new Item_row(*yyvsp[-1].item_list); + (yyvsp[(4) - (5)].item_list)->push_front((yyvsp[(2) - (5)].item)); + (yyval.item)= new Item_row(*(yyvsp[(4) - (5)].item_list)); } break; case 816: -#line 4809 "sql_yacc.yy" +#line 4811 "sql_yacc.yy" { - yyvsp[-1].item_list->push_front(yyvsp[-3].item); - yyval.item= new Item_row(*yyvsp[-1].item_list); + (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); + (yyval.item)= new Item_row(*(yyvsp[(5) - (6)].item_list)); } break; case 817: -#line 4814 "sql_yacc.yy" +#line 4816 "sql_yacc.yy" { - yyval.item= new Item_exists_subselect(yyvsp[-1].select_lex); + (yyval.item)= new Item_exists_subselect((yyvsp[(3) - (4)].select_lex)); } break; case 818: -#line 4817 "sql_yacc.yy" - { yyval.item= yyvsp[-1].item; } +#line 4819 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(3) - (4)].item); } break; case 819: -#line 4819 "sql_yacc.yy" - { yyvsp[-5].item_list->push_front(yyvsp[-2].item); +#line 4821 "sql_yacc.yy" + { (yyvsp[(2) - (7)].item_list)->push_front((yyvsp[(5) - (7)].item)); Select->add_ftfunc_to_list((Item_func_match*) - (yyval.item=new Item_func_match(*yyvsp[-5].item_list,yyvsp[-1].num))); } + ((yyval.item)=new Item_func_match(*(yyvsp[(2) - (7)].item_list),(yyvsp[(6) - (7)].num)))); } break; case 820: -#line 4822 "sql_yacc.yy" - { yyval.item= new Item_func_ascii(yyvsp[-1].item); } +#line 4824 "sql_yacc.yy" + { (yyval.item)= new Item_func_ascii((yyvsp[(3) - (4)].item)); } break; case 821: -#line 4824 "sql_yacc.yy" +#line 4826 "sql_yacc.yy" { - yyval.item= create_func_cast(yyvsp[0].item, ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); + (yyval.item)= create_func_cast((yyvsp[(2) - (2)].item), ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); } break; case 822: -#line 4828 "sql_yacc.yy" +#line 4830 "sql_yacc.yy" { LEX *lex= Lex; - yyval.item= create_func_cast(yyvsp[-3].item, yyvsp[-1].cast_type, lex->length, lex->dec, lex->charset); - if (!yyval.item) + (yyval.item)= create_func_cast((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), lex->length, lex->dec, lex->charset); + if (!(yyval.item)) MYSQL_YYABORT; } break; case 823: -#line 4835 "sql_yacc.yy" - { yyval.item= new Item_func_case(* yyvsp[-2].item_list, yyvsp[-3].item, yyvsp[-1].item ); } +#line 4837 "sql_yacc.yy" + { (yyval.item)= new Item_func_case(* (yyvsp[(3) - (5)].item_list), (yyvsp[(2) - (5)].item), (yyvsp[(4) - (5)].item) ); } break; case 824: -#line 4837 "sql_yacc.yy" +#line 4839 "sql_yacc.yy" { - yyval.item= create_func_cast(yyvsp[-3].item, yyvsp[-1].cast_type, Lex->length, Lex->dec, Lex->charset); - if (!yyval.item) + (yyval.item)= create_func_cast((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), Lex->length, Lex->dec, Lex->charset); + if (!(yyval.item)) MYSQL_YYABORT; } break; case 825: -#line 4843 "sql_yacc.yy" - { yyval.item= new Item_func_conv_charset(yyvsp[-3].item,yyvsp[-1].charset); } +#line 4845 "sql_yacc.yy" + { (yyval.item)= new Item_func_conv_charset((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].charset)); } break; case 826: -#line 4845 "sql_yacc.yy" +#line 4847 "sql_yacc.yy" { - if (yyvsp[-1].item->is_splocal()) + if ((yyvsp[(3) - (4)].item)->is_splocal()) { - Item_splocal *il= static_cast(yyvsp[-1].item); + Item_splocal *il= static_cast((yyvsp[(3) - (4)].item)); my_error(ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str); MYSQL_YYABORT; } - yyval.item= new Item_default_value(Lex->current_context(), yyvsp[-1].item); + (yyval.item)= new Item_default_value(Lex->current_context(), (yyvsp[(3) - (4)].item)); } break; case 827: -#line 4856 "sql_yacc.yy" - { yyval.item= new Item_insert_value(Lex->current_context(), yyvsp[-1].item); } +#line 4858 "sql_yacc.yy" + { (yyval.item)= new Item_insert_value(Lex->current_context(), (yyvsp[(3) - (4)].item)); } break; case 828: -#line 4858 "sql_yacc.yy" +#line 4860 "sql_yacc.yy" { - if (!yyvsp[-2].symbol.symbol->create_func) + if (!(yyvsp[(1) - (3)].symbol).symbol->create_func) { my_error(ER_FEATURE_DISABLED, MYF(0), - yyvsp[-2].symbol.symbol->group->name, - yyvsp[-2].symbol.symbol->group->needed_define); + (yyvsp[(1) - (3)].symbol).symbol->group->name, + (yyvsp[(1) - (3)].symbol).symbol->group->needed_define); MYSQL_YYABORT; } - yyval.item= ((Item*(*)(void))(yyvsp[-2].symbol.symbol->create_func))(); + (yyval.item)= ((Item*(*)(void))((yyvsp[(1) - (3)].symbol).symbol->create_func))(); } break; case 829: -#line 4869 "sql_yacc.yy" +#line 4871 "sql_yacc.yy" { - if (!yyvsp[-3].symbol.symbol->create_func) + if (!(yyvsp[(1) - (4)].symbol).symbol->create_func) { my_error(ER_FEATURE_DISABLED, MYF(0), - yyvsp[-3].symbol.symbol->group->name, - yyvsp[-3].symbol.symbol->group->needed_define); + (yyvsp[(1) - (4)].symbol).symbol->group->name, + (yyvsp[(1) - (4)].symbol).symbol->group->needed_define); MYSQL_YYABORT; } - yyval.item= ((Item*(*)(Item*))(yyvsp[-3].symbol.symbol->create_func))(yyvsp[-1].item); + (yyval.item)= ((Item*(*)(Item*))((yyvsp[(1) - (4)].symbol).symbol->create_func))((yyvsp[(3) - (4)].item)); } break; case 830: -#line 4880 "sql_yacc.yy" +#line 4882 "sql_yacc.yy" { - if (!yyvsp[-5].symbol.symbol->create_func) + if (!(yyvsp[(1) - (6)].symbol).symbol->create_func) { my_error(ER_FEATURE_DISABLED, MYF(0), - yyvsp[-5].symbol.symbol->group->name, - yyvsp[-5].symbol.symbol->group->needed_define); + (yyvsp[(1) - (6)].symbol).symbol->group->name, + (yyvsp[(1) - (6)].symbol).symbol->group->needed_define); MYSQL_YYABORT; } - yyval.item= ((Item*(*)(Item*,Item*))(yyvsp[-5].symbol.symbol->create_func))(yyvsp[-3].item,yyvsp[-1].item); + (yyval.item)= ((Item*(*)(Item*,Item*))((yyvsp[(1) - (6)].symbol).symbol->create_func))((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 831: -#line 4891 "sql_yacc.yy" +#line 4893 "sql_yacc.yy" { - if (!yyvsp[-7].symbol.symbol->create_func) + if (!(yyvsp[(1) - (8)].symbol).symbol->create_func) { my_error(ER_FEATURE_DISABLED, MYF(0), - yyvsp[-7].symbol.symbol->group->name, - yyvsp[-7].symbol.symbol->group->needed_define); + (yyvsp[(1) - (8)].symbol).symbol->group->name, + (yyvsp[(1) - (8)].symbol).symbol->group->needed_define); MYSQL_YYABORT; } - yyval.item= ((Item*(*)(Item*,Item*,Item*))(yyvsp[-7].symbol.symbol->create_func))(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); + (yyval.item)= ((Item*(*)(Item*,Item*,Item*))((yyvsp[(1) - (8)].symbol).symbol->create_func))((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 832: -#line 4902 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-3].item, yyvsp[-1].item, INTERVAL_DAY, 0);} +#line 4904 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 0);} break; case 833: -#line 4904 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-5].item, yyvsp[-2].item, yyvsp[-1].interval, 0); } +#line 4906 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 0); } break; case 834: -#line 4906 "sql_yacc.yy" - { yyval.item= new Item_func_repeat(yyvsp[-3].item,yyvsp[-1].item); } +#line 4908 "sql_yacc.yy" + { (yyval.item)= new Item_func_repeat((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 835: -#line 4908 "sql_yacc.yy" - { yyval.item= new Item_func_atan(yyvsp[-1].item); } +#line 4910 "sql_yacc.yy" + { (yyval.item)= new Item_func_atan((yyvsp[(3) - (4)].item)); } break; case 836: -#line 4910 "sql_yacc.yy" - { yyval.item= new Item_func_atan(yyvsp[-3].item,yyvsp[-1].item); } +#line 4912 "sql_yacc.yy" + { (yyval.item)= new Item_func_atan((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 837: -#line 4912 "sql_yacc.yy" - { yyval.item= new Item_func_char(*yyvsp[-1].item_list); } +#line 4914 "sql_yacc.yy" + { (yyval.item)= new Item_func_char(*(yyvsp[(3) - (4)].item_list)); } break; case 838: -#line 4914 "sql_yacc.yy" - { yyval.item= new Item_func_char(*yyvsp[-3].item_list, yyvsp[-1].charset); } +#line 4916 "sql_yacc.yy" + { (yyval.item)= new Item_func_char(*(yyvsp[(3) - (6)].item_list), (yyvsp[(5) - (6)].charset)); } break; case 839: -#line 4916 "sql_yacc.yy" - { yyval.item= new Item_func_charset(yyvsp[-1].item); } +#line 4918 "sql_yacc.yy" + { (yyval.item)= new Item_func_charset((yyvsp[(3) - (4)].item)); } break; case 840: -#line 4918 "sql_yacc.yy" - { yyval.item= new Item_func_coalesce(* yyvsp[-1].item_list); } +#line 4920 "sql_yacc.yy" + { (yyval.item)= new Item_func_coalesce(* (yyvsp[(3) - (4)].item_list)); } break; case 841: -#line 4920 "sql_yacc.yy" - { yyval.item= new Item_func_collation(yyvsp[-1].item); } +#line 4922 "sql_yacc.yy" + { (yyval.item)= new Item_func_collation((yyvsp[(3) - (4)].item)); } break; case 842: -#line 4922 "sql_yacc.yy" - { yyval.item= new Item_func_concat(* yyvsp[-1].item_list); } +#line 4924 "sql_yacc.yy" + { (yyval.item)= new Item_func_concat(* (yyvsp[(3) - (4)].item_list)); } break; case 843: -#line 4924 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_concat_ws(*yyvsp[-1].item_list); } +#line 4926 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_concat_ws(*(yyvsp[(5) - (6)].item_list)); } break; case 844: -#line 4926 "sql_yacc.yy" +#line 4928 "sql_yacc.yy" { if (Lex->add_time_zone_tables_to_query_tables(YYTHD)) MYSQL_YYABORT; - yyval.item= new Item_func_convert_tz(yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); + (yyval.item)= new Item_func_convert_tz((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); } break; case 845: -#line 4932 "sql_yacc.yy" - { yyval.item= new Item_func_curdate_local(); Lex->safe_to_cache_query=0; } +#line 4934 "sql_yacc.yy" + { (yyval.item)= new Item_func_curdate_local(); Lex->safe_to_cache_query=0; } break; case 846: -#line 4934 "sql_yacc.yy" - { yyval.item= new Item_func_curtime_local(); Lex->safe_to_cache_query=0; } +#line 4936 "sql_yacc.yy" + { (yyval.item)= new Item_func_curtime_local(); Lex->safe_to_cache_query=0; } break; case 847: -#line 4936 "sql_yacc.yy" +#line 4938 "sql_yacc.yy" { - yyval.item= new Item_func_curtime_local(yyvsp[-1].item); + (yyval.item)= new Item_func_curtime_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0; } break; case 848: -#line 4941 "sql_yacc.yy" +#line 4943 "sql_yacc.yy" { - yyval.item= new Item_func_current_user(Lex->current_context()); + (yyval.item)= new Item_func_current_user(Lex->current_context()); Lex->safe_to_cache_query= 0; } break; case 849: -#line 4946 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-4].item,yyvsp[-2].item,yyvsp[-1].interval,0); } +#line 4948 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (7)].item),(yyvsp[(5) - (7)].item),(yyvsp[(6) - (7)].interval),0); } break; case 850: -#line 4948 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-4].item,yyvsp[-2].item,yyvsp[-1].interval,1); } +#line 4950 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (7)].item),(yyvsp[(5) - (7)].item),(yyvsp[(6) - (7)].interval),1); } break; case 851: -#line 4950 "sql_yacc.yy" +#line 4952 "sql_yacc.yy" { - yyval.item= new Item_func_database(); + (yyval.item)= new Item_func_database(); Lex->safe_to_cache_query=0; } break; case 852: -#line 4955 "sql_yacc.yy" - { yyval.item= new Item_date_typecast(yyvsp[-1].item); } +#line 4957 "sql_yacc.yy" + { (yyval.item)= new Item_date_typecast((yyvsp[(3) - (4)].item)); } break; case 853: -#line 4957 "sql_yacc.yy" - { yyval.item= new Item_func_dayofmonth(yyvsp[-1].item); } +#line 4959 "sql_yacc.yy" + { (yyval.item)= new Item_func_dayofmonth((yyvsp[(3) - (4)].item)); } break; case 854: -#line 4959 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_elt(*yyvsp[-1].item_list); } +#line 4961 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_elt(*(yyvsp[(5) - (6)].item_list)); } break; case 855: -#line 4961 "sql_yacc.yy" - { yyval.item= new Item_func_make_set(yyvsp[-3].item, *yyvsp[-1].item_list); } +#line 4963 "sql_yacc.yy" + { (yyval.item)= new Item_func_make_set((yyvsp[(3) - (6)].item), *(yyvsp[(5) - (6)].item_list)); } break; case 856: -#line 4963 "sql_yacc.yy" +#line 4965 "sql_yacc.yy" { - yyval.item= new Item_func_encrypt(yyvsp[-1].item); + (yyval.item)= new Item_func_encrypt((yyvsp[(3) - (4)].item)); Lex->uncacheable(UNCACHEABLE_RAND); } break; case 857: -#line 4967 "sql_yacc.yy" - { yyval.item= new Item_func_encrypt(yyvsp[-3].item,yyvsp[-1].item); } +#line 4969 "sql_yacc.yy" + { (yyval.item)= new Item_func_encrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 858: -#line 4969 "sql_yacc.yy" - { yyval.item= new Item_func_decode(yyvsp[-3].item,yyvsp[-1].lex_str.str); } +#line 4971 "sql_yacc.yy" + { (yyval.item)= new Item_func_decode((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].lex_str).str); } break; case 859: -#line 4971 "sql_yacc.yy" - { yyval.item= new Item_func_encode(yyvsp[-3].item,yyvsp[-1].lex_str.str); } +#line 4973 "sql_yacc.yy" + { (yyval.item)= new Item_func_encode((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].lex_str).str); } break; case 860: -#line 4973 "sql_yacc.yy" - { yyval.item= new Item_func_des_decrypt(yyvsp[-1].item); } +#line 4975 "sql_yacc.yy" + { (yyval.item)= new Item_func_des_decrypt((yyvsp[(3) - (4)].item)); } break; case 861: -#line 4975 "sql_yacc.yy" - { yyval.item= new Item_func_des_decrypt(yyvsp[-3].item,yyvsp[-1].item); } +#line 4977 "sql_yacc.yy" + { (yyval.item)= new Item_func_des_decrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 862: -#line 4977 "sql_yacc.yy" - { yyval.item= new Item_func_des_encrypt(yyvsp[-1].item); } +#line 4979 "sql_yacc.yy" + { (yyval.item)= new Item_func_des_encrypt((yyvsp[(3) - (4)].item)); } break; case 863: -#line 4979 "sql_yacc.yy" - { yyval.item= new Item_func_des_encrypt(yyvsp[-3].item,yyvsp[-1].item); } +#line 4981 "sql_yacc.yy" + { (yyval.item)= new Item_func_des_encrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 864: -#line 4981 "sql_yacc.yy" - { yyval.item= new Item_func_export_set(yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); } +#line 4983 "sql_yacc.yy" + { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); } break; case 865: -#line 4983 "sql_yacc.yy" - { yyval.item= new Item_func_export_set(yyvsp[-7].item, yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); } +#line 4985 "sql_yacc.yy" + { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (10)].item), (yyvsp[(5) - (10)].item), (yyvsp[(7) - (10)].item), (yyvsp[(9) - (10)].item)); } break; case 866: -#line 4985 "sql_yacc.yy" - { yyval.item= new Item_func_export_set(yyvsp[-9].item, yyvsp[-7].item, yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); } +#line 4987 "sql_yacc.yy" + { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (12)].item), (yyvsp[(5) - (12)].item), (yyvsp[(7) - (12)].item), (yyvsp[(9) - (12)].item), (yyvsp[(11) - (12)].item)); } break; case 867: -#line 4987 "sql_yacc.yy" - { yyval.item= new Item_func_format(yyvsp[-3].item,atoi(yyvsp[-1].lex_str.str)); } +#line 4989 "sql_yacc.yy" + { (yyval.item)= new Item_func_format((yyvsp[(3) - (6)].item),atoi((yyvsp[(5) - (6)].lex_str).str)); } break; case 868: -#line 4989 "sql_yacc.yy" - { yyval.item= new Item_func_from_unixtime(yyvsp[-1].item); } +#line 4991 "sql_yacc.yy" + { (yyval.item)= new Item_func_from_unixtime((yyvsp[(3) - (4)].item)); } break; case 869: -#line 4991 "sql_yacc.yy" +#line 4993 "sql_yacc.yy" { - yyval.item= new Item_func_date_format (new Item_func_from_unixtime(yyvsp[-3].item),yyvsp[-1].item,0); + (yyval.item)= new Item_func_date_format (new Item_func_from_unixtime((yyvsp[(3) - (6)].item)),(yyvsp[(5) - (6)].item),0); } break; case 870: -#line 4995 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_field(*yyvsp[-1].item_list); } +#line 4997 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_field(*(yyvsp[(5) - (6)].item_list)); } break; case 871: -#line 4997 "sql_yacc.yy" +#line 4999 "sql_yacc.yy" { #ifdef HAVE_SPATIAL - yyval.item= yyvsp[0].item; + (yyval.item)= (yyvsp[(1) - (1)].item); #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -20106,364 +20441,364 @@ break; case 872: -#line 5007 "sql_yacc.yy" - { yyval.item= new Item_func_get_format(yyvsp[-3].date_time_type, yyvsp[-1].item); } +#line 5009 "sql_yacc.yy" + { (yyval.item)= new Item_func_get_format((yyvsp[(3) - (6)].date_time_type), (yyvsp[(5) - (6)].item)); } break; case 873: -#line 5009 "sql_yacc.yy" - { yyval.item= new Item_func_hour(yyvsp[-1].item); } +#line 5011 "sql_yacc.yy" + { (yyval.item)= new Item_func_hour((yyvsp[(3) - (4)].item)); } break; case 874: -#line 5011 "sql_yacc.yy" - { yyval.item= new Item_func_if(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5013 "sql_yacc.yy" + { (yyval.item)= new Item_func_if((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 875: -#line 5013 "sql_yacc.yy" - { yyval.item= new Item_func_insert(yyvsp[-7].item,yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5015 "sql_yacc.yy" + { (yyval.item)= new Item_func_insert((yyvsp[(3) - (10)].item),(yyvsp[(5) - (10)].item),(yyvsp[(7) - (10)].item),(yyvsp[(9) - (10)].item)); } break; case 876: -#line 5016 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[0].item,yyvsp[-3].item,yyvsp[-2].interval,0); } +#line 5018 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(4) - (4)].item),(yyvsp[(1) - (4)].item),(yyvsp[(2) - (4)].interval),0); } break; case 877: -#line 5018 "sql_yacc.yy" +#line 5020 "sql_yacc.yy" { - if (yyvsp[0].item->type() != Item::ROW_ITEM) + if ((yyvsp[(1) - (1)].item)->type() != Item::ROW_ITEM) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } - yyval.item= new Item_func_interval((Item_row *)yyvsp[0].item); + (yyval.item)= new Item_func_interval((Item_row *)(yyvsp[(1) - (1)].item)); } break; case 878: -#line 5027 "sql_yacc.yy" +#line 5029 "sql_yacc.yy" { - yyval.item= new Item_func_last_insert_id(); + (yyval.item)= new Item_func_last_insert_id(); Lex->safe_to_cache_query= 0; } break; case 879: -#line 5032 "sql_yacc.yy" +#line 5034 "sql_yacc.yy" { - yyval.item= new Item_func_last_insert_id(yyvsp[-1].item); + (yyval.item)= new Item_func_last_insert_id((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query= 0; } break; case 880: -#line 5037 "sql_yacc.yy" - { yyval.item= new Item_func_left(yyvsp[-3].item,yyvsp[-1].item); } +#line 5039 "sql_yacc.yy" + { (yyval.item)= new Item_func_left((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 881: -#line 5039 "sql_yacc.yy" - { yyval.item= new Item_func_locate(yyvsp[-1].item,yyvsp[-3].item); } +#line 5041 "sql_yacc.yy" + { (yyval.item)= new Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 882: -#line 5041 "sql_yacc.yy" - { yyval.item= new Item_func_locate(yyvsp[-3].item,yyvsp[-5].item,yyvsp[-1].item); } +#line 5043 "sql_yacc.yy" + { (yyval.item)= new Item_func_locate((yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 883: -#line 5043 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_max(*yyvsp[-1].item_list); } +#line 5045 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_max(*(yyvsp[(5) - (6)].item_list)); } break; case 884: -#line 5045 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_min(*yyvsp[-1].item_list); } +#line 5047 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_min(*(yyvsp[(5) - (6)].item_list)); } break; case 885: -#line 5047 "sql_yacc.yy" - { yyval.item= new Item_func_log(yyvsp[-1].item); } +#line 5049 "sql_yacc.yy" + { (yyval.item)= new Item_func_log((yyvsp[(3) - (4)].item)); } break; case 886: -#line 5049 "sql_yacc.yy" - { yyval.item= new Item_func_log(yyvsp[-3].item, yyvsp[-1].item); } +#line 5051 "sql_yacc.yy" + { (yyval.item)= new Item_func_log((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 887: -#line 5051 "sql_yacc.yy" +#line 5053 "sql_yacc.yy" { - yyval.item= new Item_master_pos_wait(yyvsp[-3].item, yyvsp[-1].item); + (yyval.item)= new Item_master_pos_wait((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); Lex->safe_to_cache_query=0; } break; case 888: -#line 5056 "sql_yacc.yy" +#line 5058 "sql_yacc.yy" { - yyval.item= new Item_master_pos_wait(yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); + (yyval.item)= new Item_master_pos_wait((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); Lex->safe_to_cache_query=0; } break; case 889: -#line 5061 "sql_yacc.yy" - { yyval.item= new Item_func_microsecond(yyvsp[-1].item); } +#line 5063 "sql_yacc.yy" + { (yyval.item)= new Item_func_microsecond((yyvsp[(3) - (4)].item)); } break; case 890: -#line 5063 "sql_yacc.yy" - { yyval.item= new Item_func_minute(yyvsp[-1].item); } +#line 5065 "sql_yacc.yy" + { (yyval.item)= new Item_func_minute((yyvsp[(3) - (4)].item)); } break; case 891: -#line 5065 "sql_yacc.yy" - { yyval.item = new Item_func_mod( yyvsp[-3].item, yyvsp[-1].item); } +#line 5067 "sql_yacc.yy" + { (yyval.item) = new Item_func_mod( (yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 892: -#line 5067 "sql_yacc.yy" - { yyval.item= new Item_func_month(yyvsp[-1].item); } +#line 5069 "sql_yacc.yy" + { (yyval.item)= new Item_func_month((yyvsp[(3) - (4)].item)); } break; case 893: -#line 5069 "sql_yacc.yy" - { yyval.item= new Item_func_now_local(); Lex->safe_to_cache_query=0;} +#line 5071 "sql_yacc.yy" + { (yyval.item)= new Item_func_now_local(); Lex->safe_to_cache_query=0;} break; case 894: -#line 5071 "sql_yacc.yy" - { yyval.item= new Item_func_now_local(yyvsp[-1].item); Lex->safe_to_cache_query=0;} +#line 5073 "sql_yacc.yy" + { (yyval.item)= new Item_func_now_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0;} break; case 895: -#line 5073 "sql_yacc.yy" +#line 5075 "sql_yacc.yy" { - yyval.item= YYTHD->variables.old_passwords ? - (Item *) new Item_func_old_password(yyvsp[-1].item) : - (Item *) new Item_func_password(yyvsp[-1].item); + (yyval.item)= YYTHD->variables.old_passwords ? + (Item *) new Item_func_old_password((yyvsp[(3) - (4)].item)) : + (Item *) new Item_func_password((yyvsp[(3) - (4)].item)); } break; case 896: -#line 5079 "sql_yacc.yy" - { yyval.item= new Item_func_old_password(yyvsp[-1].item); } +#line 5081 "sql_yacc.yy" + { (yyval.item)= new Item_func_old_password((yyvsp[(3) - (4)].item)); } break; case 897: -#line 5081 "sql_yacc.yy" - { yyval.item = new Item_func_locate(yyvsp[-1].item,yyvsp[-3].item); } +#line 5083 "sql_yacc.yy" + { (yyval.item) = new Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 898: -#line 5083 "sql_yacc.yy" - { yyval.item = new Item_func_quarter(yyvsp[-1].item); } +#line 5085 "sql_yacc.yy" + { (yyval.item) = new Item_func_quarter((yyvsp[(3) - (4)].item)); } break; case 899: -#line 5085 "sql_yacc.yy" - { yyval.item= new Item_func_rand(yyvsp[-1].item); Lex->uncacheable(UNCACHEABLE_RAND);} +#line 5087 "sql_yacc.yy" + { (yyval.item)= new Item_func_rand((yyvsp[(3) - (4)].item)); Lex->uncacheable(UNCACHEABLE_RAND);} break; case 900: -#line 5087 "sql_yacc.yy" - { yyval.item= new Item_func_rand(); Lex->uncacheable(UNCACHEABLE_RAND);} +#line 5089 "sql_yacc.yy" + { (yyval.item)= new Item_func_rand(); Lex->uncacheable(UNCACHEABLE_RAND);} break; case 901: -#line 5089 "sql_yacc.yy" - { yyval.item= new Item_func_replace(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5091 "sql_yacc.yy" + { (yyval.item)= new Item_func_replace((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 902: -#line 5091 "sql_yacc.yy" - { yyval.item= new Item_func_right(yyvsp[-3].item,yyvsp[-1].item); } +#line 5093 "sql_yacc.yy" + { (yyval.item)= new Item_func_right((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 903: -#line 5093 "sql_yacc.yy" - { yyval.item= new Item_func_round(yyvsp[-1].item, new Item_int((char*)"0",0,1),0); } +#line 5095 "sql_yacc.yy" + { (yyval.item)= new Item_func_round((yyvsp[(3) - (4)].item), new Item_int((char*)"0",0,1),0); } break; case 904: -#line 5094 "sql_yacc.yy" - { yyval.item= new Item_func_round(yyvsp[-3].item,yyvsp[-1].item,0); } +#line 5096 "sql_yacc.yy" + { (yyval.item)= new Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),0); } break; case 905: -#line 5096 "sql_yacc.yy" +#line 5098 "sql_yacc.yy" { - yyval.item= new Item_func_row_count(); + (yyval.item)= new Item_func_row_count(); Lex->safe_to_cache_query= 0; #ifdef ENABLE_SENNA } break; case 906: -#line 5102 "sql_yacc.yy" +#line 5104 "sql_yacc.yy" { - yyval.item= new Item_func_senna_kwic(* yyvsp[-1].item_list); + (yyval.item)= new Item_func_senna_kwic(* (yyvsp[(3) - (4)].item_list)); #endif } break; case 907: -#line 5107 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-3].item, yyvsp[-1].item, INTERVAL_DAY, 1);} +#line 5109 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 1);} break; case 908: -#line 5109 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-5].item, yyvsp[-2].item, yyvsp[-1].interval, 1); } +#line 5111 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 1); } break; case 909: -#line 5111 "sql_yacc.yy" - { yyval.item= new Item_func_second(yyvsp[-1].item); } +#line 5113 "sql_yacc.yy" + { (yyval.item)= new Item_func_second((yyvsp[(3) - (4)].item)); } break; case 910: -#line 5113 "sql_yacc.yy" - { yyval.item= new Item_func_substr(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5115 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 911: -#line 5115 "sql_yacc.yy" - { yyval.item= new Item_func_substr(yyvsp[-3].item,yyvsp[-1].item); } +#line 5117 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 912: -#line 5117 "sql_yacc.yy" - { yyval.item= new Item_func_substr(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5119 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 913: -#line 5119 "sql_yacc.yy" - { yyval.item= new Item_func_substr(yyvsp[-3].item,yyvsp[-1].item); } +#line 5121 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 914: -#line 5121 "sql_yacc.yy" - { yyval.item= new Item_func_substr_index(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5123 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr_index((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 915: -#line 5123 "sql_yacc.yy" +#line 5125 "sql_yacc.yy" { if (global_system_variables.sysdate_is_now == 0) - yyval.item= new Item_func_sysdate_local(); - else yyval.item= new Item_func_now_local(); + (yyval.item)= new Item_func_sysdate_local(); + else (yyval.item)= new Item_func_now_local(); Lex->safe_to_cache_query=0; } break; case 916: -#line 5130 "sql_yacc.yy" +#line 5132 "sql_yacc.yy" { if (global_system_variables.sysdate_is_now == 0) - yyval.item= new Item_func_sysdate_local(yyvsp[-1].item); - else yyval.item= new Item_func_now_local(yyvsp[-1].item); + (yyval.item)= new Item_func_sysdate_local((yyvsp[(3) - (4)].item)); + else (yyval.item)= new Item_func_now_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0; } break; case 917: -#line 5137 "sql_yacc.yy" - { yyval.item= new Item_time_typecast(yyvsp[-1].item); } +#line 5139 "sql_yacc.yy" + { (yyval.item)= new Item_time_typecast((yyvsp[(3) - (4)].item)); } break; case 918: -#line 5139 "sql_yacc.yy" - { yyval.item= new Item_datetime_typecast(yyvsp[-1].item); } +#line 5141 "sql_yacc.yy" + { (yyval.item)= new Item_datetime_typecast((yyvsp[(3) - (4)].item)); } break; case 919: -#line 5141 "sql_yacc.yy" - { yyval.item= new Item_func_add_time(yyvsp[-3].item, yyvsp[-1].item, 1, 0); } +#line 5143 "sql_yacc.yy" + { (yyval.item)= new Item_func_add_time((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), 1, 0); } break; case 920: -#line 5143 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-1].item,yyvsp[-3].item,yyvsp[-5].interval_time_st,0); } +#line 5145 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(7) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].interval_time_st),0); } break; case 921: -#line 5145 "sql_yacc.yy" - { yyval.item= new Item_func_timestamp_diff(yyvsp[-3].item,yyvsp[-1].item,yyvsp[-5].interval_time_st); } +#line 5147 "sql_yacc.yy" + { (yyval.item)= new Item_func_timestamp_diff((yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item),(yyvsp[(3) - (8)].interval_time_st)); } break; case 922: -#line 5147 "sql_yacc.yy" - { yyval.item= new Item_func_trim(yyvsp[-1].item); } +#line 5149 "sql_yacc.yy" + { (yyval.item)= new Item_func_trim((yyvsp[(3) - (4)].item)); } break; case 923: -#line 5149 "sql_yacc.yy" - { yyval.item= new Item_func_ltrim(yyvsp[-1].item,yyvsp[-3].item); } +#line 5151 "sql_yacc.yy" + { (yyval.item)= new Item_func_ltrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 924: -#line 5151 "sql_yacc.yy" - { yyval.item= new Item_func_rtrim(yyvsp[-1].item,yyvsp[-3].item); } +#line 5153 "sql_yacc.yy" + { (yyval.item)= new Item_func_rtrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 925: -#line 5153 "sql_yacc.yy" - { yyval.item= new Item_func_trim(yyvsp[-1].item,yyvsp[-3].item); } +#line 5155 "sql_yacc.yy" + { (yyval.item)= new Item_func_trim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 926: -#line 5155 "sql_yacc.yy" - { yyval.item= new Item_func_ltrim(yyvsp[-1].item); } +#line 5157 "sql_yacc.yy" + { (yyval.item)= new Item_func_ltrim((yyvsp[(5) - (6)].item)); } break; case 927: -#line 5157 "sql_yacc.yy" - { yyval.item= new Item_func_rtrim(yyvsp[-1].item); } +#line 5159 "sql_yacc.yy" + { (yyval.item)= new Item_func_rtrim((yyvsp[(5) - (6)].item)); } break; case 928: -#line 5159 "sql_yacc.yy" - { yyval.item= new Item_func_trim(yyvsp[-1].item); } +#line 5161 "sql_yacc.yy" + { (yyval.item)= new Item_func_trim((yyvsp[(5) - (6)].item)); } break; case 929: -#line 5161 "sql_yacc.yy" - { yyval.item= new Item_func_trim(yyvsp[-1].item,yyvsp[-3].item); } +#line 5163 "sql_yacc.yy" + { (yyval.item)= new Item_func_trim((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 930: -#line 5163 "sql_yacc.yy" - { yyval.item= new Item_func_round(yyvsp[-3].item,yyvsp[-1].item,1); } +#line 5165 "sql_yacc.yy" + { (yyval.item)= new Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),1); } break; case 931: -#line 5165 "sql_yacc.yy" +#line 5167 "sql_yacc.yy" { LEX *lex= Lex; - sp_name *name= new sp_name(yyvsp[-5].lex_str, yyvsp[-3].lex_str, true); + sp_name *name= new sp_name((yyvsp[(1) - (6)].lex_str), (yyvsp[(3) - (6)].lex_str), true); name->init_qname(YYTHD); sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION); - if (yyvsp[-1].item_list) - yyval.item= new Item_func_sp(Lex->current_context(), name, *yyvsp[-1].item_list); + if ((yyvsp[(5) - (6)].item_list)) + (yyval.item)= new Item_func_sp(Lex->current_context(), name, *(yyvsp[(5) - (6)].item_list)); else - yyval.item= new Item_func_sp(Lex->current_context(), name); + (yyval.item)= new Item_func_sp(Lex->current_context(), name); lex->safe_to_cache_query=0; } break; case 932: -#line 5178 "sql_yacc.yy" +#line 5180 "sql_yacc.yy" { #ifdef HAVE_DLOPEN udf_func *udf= 0; LEX *lex= Lex; if (using_udf_functions && - (udf= find_udf(yyvsp[-1].lex_str.str, yyvsp[-1].lex_str.length)) && + (udf= find_udf((yyvsp[(1) - (2)].lex_str).str, (yyvsp[(1) - (2)].lex_str).length)) && udf->type == UDFTYPE_AGGREGATE) { if (lex->current_select->inc_in_sum_expr()) @@ -20478,7 +20813,7 @@ break; case 933: -#line 5196 "sql_yacc.yy" +#line 5198 "sql_yacc.yy" { LEX *lex= Lex; #ifdef HAVE_DLOPEN @@ -20493,65 +20828,65 @@ case STRING_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_func_udf_str(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_func_udf_str(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_func_udf_str(udf); + (yyval.item) = new Item_func_udf_str(udf); } else { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_sum_udf_str(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_sum_udf_str(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_sum_udf_str(udf); + (yyval.item) = new Item_sum_udf_str(udf); } break; case REAL_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_func_udf_float(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_func_udf_float(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_func_udf_float(udf); + (yyval.item) = new Item_func_udf_float(udf); } else { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_sum_udf_float(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_sum_udf_float(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_sum_udf_float(udf); + (yyval.item) = new Item_sum_udf_float(udf); } break; case INT_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_func_udf_int(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_func_udf_int(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_func_udf_int(udf); + (yyval.item) = new Item_func_udf_int(udf); } else { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_sum_udf_int(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_sum_udf_int(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_sum_udf_int(udf); + (yyval.item) = new Item_sum_udf_int(udf); } break; case DECIMAL_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_func_udf_decimal(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_func_udf_decimal(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_func_udf_decimal(udf); + (yyval.item) = new Item_func_udf_decimal(udf); } else { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_sum_udf_decimal(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_sum_udf_decimal(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_sum_udf_decimal(udf); + (yyval.item) = new Item_sum_udf_decimal(udf); } break; default: @@ -20565,289 +20900,289 @@ LEX_STRING db; if (thd->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; - sp_name *name= new sp_name(db, yyvsp[-4].lex_str, false); + sp_name *name= new sp_name(db, (yyvsp[(1) - (5)].lex_str), false); if (name) name->init_qname(thd); sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION); - if (yyvsp[-1].item_list) - yyval.item= new Item_func_sp(Lex->current_context(), name, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list)) + (yyval.item)= new Item_func_sp(Lex->current_context(), name, *(yyvsp[(4) - (5)].item_list)); else - yyval.item= new Item_func_sp(Lex->current_context(), name); + (yyval.item)= new Item_func_sp(Lex->current_context(), name); lex->safe_to_cache_query=0; } } break; case 934: -#line 5295 "sql_yacc.yy" +#line 5297 "sql_yacc.yy" { - yyval.item= new Item_func_unique_users(yyvsp[-7].item,atoi(yyvsp[-5].lex_str.str),atoi(yyvsp[-3].lex_str.str), * yyvsp[-1].item_list); + (yyval.item)= new Item_func_unique_users((yyvsp[(3) - (10)].item),atoi((yyvsp[(5) - (10)].lex_str).str),atoi((yyvsp[(7) - (10)].lex_str).str), * (yyvsp[(9) - (10)].item_list)); } break; case 935: -#line 5299 "sql_yacc.yy" +#line 5301 "sql_yacc.yy" { - yyval.item= new Item_func_unix_timestamp(); + (yyval.item)= new Item_func_unix_timestamp(); Lex->safe_to_cache_query=0; } break; case 936: -#line 5304 "sql_yacc.yy" - { yyval.item= new Item_func_unix_timestamp(yyvsp[-1].item); } +#line 5306 "sql_yacc.yy" + { (yyval.item)= new Item_func_unix_timestamp((yyvsp[(3) - (4)].item)); } break; case 937: -#line 5306 "sql_yacc.yy" - { yyval.item= new Item_func_user(); Lex->safe_to_cache_query=0; } +#line 5308 "sql_yacc.yy" + { (yyval.item)= new Item_func_user(); Lex->safe_to_cache_query=0; } break; case 938: -#line 5308 "sql_yacc.yy" - { yyval.item= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;} +#line 5310 "sql_yacc.yy" + { (yyval.item)= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;} break; case 939: -#line 5310 "sql_yacc.yy" - { yyval.item= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;} +#line 5312 "sql_yacc.yy" + { (yyval.item)= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;} break; case 940: -#line 5312 "sql_yacc.yy" - { yyval.item= new Item_func_now_utc(); Lex->safe_to_cache_query=0;} +#line 5314 "sql_yacc.yy" + { (yyval.item)= new Item_func_now_utc(); Lex->safe_to_cache_query=0;} break; case 941: -#line 5314 "sql_yacc.yy" +#line 5316 "sql_yacc.yy" { - yyval.item= new Item_func_week(yyvsp[-1].item,new Item_int((char*) "0", + (yyval.item)= new Item_func_week((yyvsp[(3) - (4)].item),new Item_int((char*) "0", YYTHD->variables.default_week_format,1)); } break; case 942: -#line 5319 "sql_yacc.yy" - { yyval.item= new Item_func_week(yyvsp[-3].item,yyvsp[-1].item); } +#line 5321 "sql_yacc.yy" + { (yyval.item)= new Item_func_week((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 943: -#line 5321 "sql_yacc.yy" - { yyval.item= new Item_func_year(yyvsp[-1].item); } +#line 5323 "sql_yacc.yy" + { (yyval.item)= new Item_func_year((yyvsp[(3) - (4)].item)); } break; case 944: -#line 5323 "sql_yacc.yy" - { yyval.item= new Item_func_yearweek(yyvsp[-1].item,new Item_int((char*) "0",0,1)); } +#line 5325 "sql_yacc.yy" + { (yyval.item)= new Item_func_yearweek((yyvsp[(3) - (4)].item),new Item_int((char*) "0",0,1)); } break; case 945: -#line 5325 "sql_yacc.yy" - { yyval.item= new Item_func_yearweek(yyvsp[-3].item, yyvsp[-1].item); } +#line 5327 "sql_yacc.yy" + { (yyval.item)= new Item_func_yearweek((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 946: -#line 5327 "sql_yacc.yy" +#line 5329 "sql_yacc.yy" { - yyval.item=new Item_func_benchmark(yyvsp[-3].ulong_num,yyvsp[-1].item); + (yyval.item)=new Item_func_benchmark((yyvsp[(3) - (6)].ulong_num),(yyvsp[(5) - (6)].item)); Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } break; case 947: -#line 5332 "sql_yacc.yy" - { yyval.item=new Item_extract( yyvsp[-3].interval, yyvsp[-1].item); } +#line 5334 "sql_yacc.yy" + { (yyval.item)=new Item_extract( (yyvsp[(3) - (6)].interval), (yyvsp[(5) - (6)].item)); } break; case 948: -#line 5336 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_rel(yyvsp[-3].item, yyvsp[-1].item, Item_func::SP_CONTAINS_FUNC)); } +#line 5338 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_rel((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), Item_func::SP_CONTAINS_FUNC)); } break; case 949: -#line 5338 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5340 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 950: -#line 5340 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5342 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 951: -#line 5342 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_wkb(yyvsp[-1].item)); } +#line 5344 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_wkb((yyvsp[(3) - (4)].item))); } break; case 952: -#line 5344 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_wkb(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5346 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_wkb((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 953: -#line 5346 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5348 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_geometrycollection, Geometry::wkb_point)); } break; case 954: -#line 5350 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5352 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_linestring, Geometry::wkb_point)); } break; case 955: -#line 5353 "sql_yacc.yy" - { yyval.item= GEOM_NEW( Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5355 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW( Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multilinestring, Geometry::wkb_linestring)); } break; case 956: -#line 5356 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5358 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 957: -#line 5358 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5360 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 958: -#line 5360 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5362 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 959: -#line 5362 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5364 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 960: -#line 5364 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5366 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 961: -#line 5366 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5368 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 962: -#line 5368 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5370 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multipoint, Geometry::wkb_point)); } break; case 963: -#line 5371 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5373 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multipolygon, Geometry::wkb_polygon)); } break; case 964: -#line 5374 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_point(yyvsp[-3].item,yyvsp[-1].item)); } +#line 5376 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_point((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item))); } break; case 965: -#line 5376 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5378 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 966: -#line 5378 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5380 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 967: -#line 5380 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5382 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 968: -#line 5382 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5384 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 969: -#line 5384 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5386 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_polygon, Geometry::wkb_linestring)); } break; case 970: -#line 5387 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5389 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 971: -#line 5389 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5391 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 972: -#line 5391 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5393 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 973: -#line 5393 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5395 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 974: -#line 5397 "sql_yacc.yy" - { yyval.num= FT_NL; } +#line 5399 "sql_yacc.yy" + { (yyval.num)= FT_NL; } break; case 975: -#line 5398 "sql_yacc.yy" - { yyval.num= FT_NL | FT_EXPAND; } +#line 5400 "sql_yacc.yy" + { (yyval.num)= FT_NL | FT_EXPAND; } break; case 976: -#line 5399 "sql_yacc.yy" - { yyval.num= FT_BOOL; } +#line 5401 "sql_yacc.yy" + { (yyval.num)= FT_BOOL; } break; case 977: -#line 5403 "sql_yacc.yy" - { yyval.item_list= NULL; } +#line 5405 "sql_yacc.yy" + { (yyval.item_list)= NULL; } break; case 978: -#line 5404 "sql_yacc.yy" - { yyval.item_list= yyvsp[0].item_list;} +#line 5406 "sql_yacc.yy" + { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 979: -#line 5408 "sql_yacc.yy" +#line 5410 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 980: -#line 5410 "sql_yacc.yy" - { yyval.item_list= Select->expr_list.pop(); } +#line 5412 "sql_yacc.yy" + { (yyval.item_list)= Select->expr_list.pop(); } break; case 981: -#line 5415 "sql_yacc.yy" +#line 5417 "sql_yacc.yy" { - Select->expr_list.head()->push_back(yyvsp[0].item); + Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 982: -#line 5419 "sql_yacc.yy" +#line 5421 "sql_yacc.yy" { - Select->expr_list.head()->push_back(yyvsp[0].item); + Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 983: -#line 5426 "sql_yacc.yy" +#line 5428 "sql_yacc.yy" { udf_func *udf= Select->udf_list.head(); /* @@ -20856,7 +21191,7 @@ because the syntax will not allow having an explicit name here. See WL#1017 re. udf attributes. */ - if (yyvsp[0].lex_str.str) + if ((yyvsp[(4) - (4)].lex_str).str) { if (!udf) { @@ -20868,138 +21203,138 @@ MYSQL_YYABORT; } - yyvsp[-2].item->is_autogenerated_name= FALSE; - yyvsp[-2].item->set_name(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, system_charset_info); + (yyvsp[(2) - (4)].item)->is_autogenerated_name= FALSE; + (yyvsp[(2) - (4)].item)->set_name((yyvsp[(4) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).length, system_charset_info); } else if (udf) - yyvsp[-2].item->set_name(yyvsp[-3].simple_string, (uint) (yyvsp[-1].simple_string - yyvsp[-3].simple_string), YYTHD->charset()); - yyval.item= yyvsp[-2].item; + (yyvsp[(2) - (4)].item)->set_name((yyvsp[(1) - (4)].simple_string), (uint) ((yyvsp[(3) - (4)].simple_string) - (yyvsp[(1) - (4)].simple_string)), YYTHD->charset()); + (yyval.item)= (yyvsp[(2) - (4)].item); } break; case 984: -#line 5457 "sql_yacc.yy" - { yyval.item=new Item_sum_avg(yyvsp[-1].item); } +#line 5459 "sql_yacc.yy" + { (yyval.item)=new Item_sum_avg((yyvsp[(3) - (4)].item)); } break; case 985: -#line 5459 "sql_yacc.yy" - { yyval.item=new Item_sum_avg_distinct(yyvsp[-1].item); } +#line 5461 "sql_yacc.yy" + { (yyval.item)=new Item_sum_avg_distinct((yyvsp[(4) - (5)].item)); } break; case 986: -#line 5461 "sql_yacc.yy" - { yyval.item=new Item_sum_and(yyvsp[-1].item); } +#line 5463 "sql_yacc.yy" + { (yyval.item)=new Item_sum_and((yyvsp[(3) - (4)].item)); } break; case 987: -#line 5463 "sql_yacc.yy" - { yyval.item=new Item_sum_or(yyvsp[-1].item); } +#line 5465 "sql_yacc.yy" + { (yyval.item)=new Item_sum_or((yyvsp[(3) - (4)].item)); } break; case 988: -#line 5465 "sql_yacc.yy" - { yyval.item=new Item_sum_xor(yyvsp[-1].item); } +#line 5467 "sql_yacc.yy" + { (yyval.item)=new Item_sum_xor((yyvsp[(3) - (4)].item)); } break; case 989: -#line 5467 "sql_yacc.yy" - { yyval.item=new Item_sum_count(new Item_int((int32) 0L,1)); } +#line 5469 "sql_yacc.yy" + { (yyval.item)=new Item_sum_count(new Item_int((int32) 0L,1)); } break; case 990: -#line 5469 "sql_yacc.yy" - { yyval.item=new Item_sum_count(yyvsp[-1].item); } +#line 5471 "sql_yacc.yy" + { (yyval.item)=new Item_sum_count((yyvsp[(3) - (4)].item)); } break; case 991: -#line 5471 "sql_yacc.yy" +#line 5473 "sql_yacc.yy" { Select->in_sum_expr++; } break; case 992: -#line 5473 "sql_yacc.yy" +#line 5475 "sql_yacc.yy" { Select->in_sum_expr--; } break; case 993: -#line 5475 "sql_yacc.yy" - { yyval.item=new Item_sum_count_distinct(* yyvsp[-2].item_list); } +#line 5477 "sql_yacc.yy" + { (yyval.item)=new Item_sum_count_distinct(* (yyvsp[(5) - (7)].item_list)); } break; case 994: -#line 5477 "sql_yacc.yy" - { yyval.item= new Item_sum_unique_users(yyvsp[-7].item,atoi(yyvsp[-5].lex_str.str),atoi(yyvsp[-3].lex_str.str),yyvsp[-1].item); } +#line 5479 "sql_yacc.yy" + { (yyval.item)= new Item_sum_unique_users((yyvsp[(3) - (10)].item),atoi((yyvsp[(5) - (10)].lex_str).str),atoi((yyvsp[(7) - (10)].lex_str).str),(yyvsp[(9) - (10)].item)); } break; case 995: -#line 5479 "sql_yacc.yy" - { yyval.item=new Item_sum_min(yyvsp[-1].item); } +#line 5481 "sql_yacc.yy" + { (yyval.item)=new Item_sum_min((yyvsp[(3) - (4)].item)); } break; case 996: -#line 5486 "sql_yacc.yy" - { yyval.item=new Item_sum_min(yyvsp[-1].item); } +#line 5488 "sql_yacc.yy" + { (yyval.item)=new Item_sum_min((yyvsp[(4) - (5)].item)); } break; case 997: -#line 5488 "sql_yacc.yy" - { yyval.item=new Item_sum_max(yyvsp[-1].item); } +#line 5490 "sql_yacc.yy" + { (yyval.item)=new Item_sum_max((yyvsp[(3) - (4)].item)); } break; case 998: -#line 5490 "sql_yacc.yy" - { yyval.item=new Item_sum_max(yyvsp[-1].item); } +#line 5492 "sql_yacc.yy" + { (yyval.item)=new Item_sum_max((yyvsp[(4) - (5)].item)); } break; case 999: -#line 5492 "sql_yacc.yy" - { yyval.item=new Item_sum_std(yyvsp[-1].item, 0); } +#line 5494 "sql_yacc.yy" + { (yyval.item)=new Item_sum_std((yyvsp[(3) - (4)].item), 0); } break; case 1000: -#line 5494 "sql_yacc.yy" - { yyval.item=new Item_sum_variance(yyvsp[-1].item, 0); } +#line 5496 "sql_yacc.yy" + { (yyval.item)=new Item_sum_variance((yyvsp[(3) - (4)].item), 0); } break; case 1001: -#line 5496 "sql_yacc.yy" - { yyval.item=new Item_sum_std(yyvsp[-1].item, 1); } +#line 5498 "sql_yacc.yy" + { (yyval.item)=new Item_sum_std((yyvsp[(3) - (4)].item), 1); } break; case 1002: -#line 5498 "sql_yacc.yy" - { yyval.item=new Item_sum_variance(yyvsp[-1].item, 1); } +#line 5500 "sql_yacc.yy" + { (yyval.item)=new Item_sum_variance((yyvsp[(3) - (4)].item), 1); } break; case 1003: -#line 5500 "sql_yacc.yy" - { yyval.item=new Item_sum_sum(yyvsp[-1].item); } +#line 5502 "sql_yacc.yy" + { (yyval.item)=new Item_sum_sum((yyvsp[(3) - (4)].item)); } break; case 1004: -#line 5502 "sql_yacc.yy" - { yyval.item=new Item_sum_sum_distinct(yyvsp[-1].item); } +#line 5504 "sql_yacc.yy" + { (yyval.item)=new Item_sum_sum_distinct((yyvsp[(4) - (5)].item)); } break; case 1005: -#line 5504 "sql_yacc.yy" +#line 5506 "sql_yacc.yy" { Select->in_sum_expr++; } break; case 1006: -#line 5508 "sql_yacc.yy" +#line 5510 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->in_sum_expr--; - yyval.item=new Item_func_group_concat(Lex->current_context(), yyvsp[-5].num, yyvsp[-3].item_list, - sel->gorder_list, yyvsp[-1].string); - yyvsp[-3].item_list->empty(); + (yyval.item)=new Item_func_group_concat(Lex->current_context(), (yyvsp[(3) - (8)].num), (yyvsp[(5) - (8)].item_list), + sel->gorder_list, (yyvsp[(7) - (8)].string)); + (yyvsp[(5) - (8)].item_list)->empty(); } break; case 1007: -#line 5518 "sql_yacc.yy" +#line 5520 "sql_yacc.yy" { if (! Lex->parsing_options.allows_variable) { @@ -21010,72 +21345,72 @@ break; case 1008: -#line 5526 "sql_yacc.yy" +#line 5528 "sql_yacc.yy" { - yyval.item= yyvsp[0].item; + (yyval.item)= (yyvsp[(3) - (3)].item); } break; case 1009: -#line 5533 "sql_yacc.yy" +#line 5535 "sql_yacc.yy" { - yyval.item= new Item_func_set_user_var(yyvsp[-2].lex_str, yyvsp[0].item); + (yyval.item)= new Item_func_set_user_var((yyvsp[(1) - (3)].lex_str), (yyvsp[(3) - (3)].item)); LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_RAND); } break; case 1010: -#line 5539 "sql_yacc.yy" +#line 5541 "sql_yacc.yy" { - yyval.item= new Item_func_get_user_var(yyvsp[0].lex_str); + (yyval.item)= new Item_func_get_user_var((yyvsp[(1) - (1)].lex_str)); LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_RAND); } break; case 1011: -#line 5545 "sql_yacc.yy" +#line 5547 "sql_yacc.yy" { - if (yyvsp[-1].lex_str.str && yyvsp[0].lex_str.str && check_reserved_words(&yyvsp[-1].lex_str)) + if ((yyvsp[(3) - (4)].lex_str).str && (yyvsp[(4) - (4)].lex_str).str && check_reserved_words(&(yyvsp[(3) - (4)].lex_str))) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } - if (!(yyval.item= get_system_var(YYTHD, yyvsp[-2].var_type, yyvsp[-1].lex_str, yyvsp[0].lex_str))) + if (!((yyval.item)= get_system_var(YYTHD, (yyvsp[(2) - (4)].var_type), (yyvsp[(3) - (4)].lex_str), (yyvsp[(4) - (4)].lex_str)))) MYSQL_YYABORT; } break; case 1012: -#line 5557 "sql_yacc.yy" - { yyval.num = 0; } +#line 5559 "sql_yacc.yy" + { (yyval.num) = 0; } break; case 1013: -#line 5558 "sql_yacc.yy" - { yyval.num = 1; } +#line 5560 "sql_yacc.yy" + { (yyval.num) = 1; } break; case 1014: -#line 5561 "sql_yacc.yy" - { yyval.string = new (YYTHD->mem_root) String(",",1,default_charset_info); } +#line 5563 "sql_yacc.yy" + { (yyval.string) = new (YYTHD->mem_root) String(",",1,default_charset_info); } break; case 1015: -#line 5562 "sql_yacc.yy" - { yyval.string = yyvsp[0].string; } +#line 5564 "sql_yacc.yy" + { (yyval.string) = (yyvsp[(2) - (2)].string); } break; case 1016: -#line 5567 "sql_yacc.yy" +#line 5569 "sql_yacc.yy" { Select->gorder_list = NULL; } break; case 1017: -#line 5571 "sql_yacc.yy" +#line 5573 "sql_yacc.yy" { SELECT_LEX *select= Select; select->gorder_list= @@ -21086,7 +21421,7 @@ break; case 1018: -#line 5582 "sql_yacc.yy" +#line 5584 "sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->inc_in_sum_expr()) @@ -21098,384 +21433,384 @@ break; case 1019: -#line 5591 "sql_yacc.yy" +#line 5593 "sql_yacc.yy" { Select->in_sum_expr--; - yyval.item= yyvsp[0].item; + (yyval.item)= (yyvsp[(3) - (3)].item); } break; case 1020: -#line 5597 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } +#line 5599 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } break; case 1021: -#line 5598 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_CHAR; Lex->dec= 0; } +#line 5600 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->dec= 0; } break; case 1022: -#line 5599 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; } +#line 5601 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; } break; case 1023: -#line 5600 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5602 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1024: -#line 5601 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5603 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1025: -#line 5602 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5604 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1026: -#line 5603 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5605 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1027: -#line 5604 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5606 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1028: -#line 5605 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5607 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1029: -#line 5606 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5608 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1030: -#line 5607 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_DECIMAL; Lex->charset= NULL; } +#line 5609 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_DECIMAL; Lex->charset= NULL; } break; case 1031: -#line 5611 "sql_yacc.yy" - { yyval.item_list= NULL; } +#line 5613 "sql_yacc.yy" + { (yyval.item_list)= NULL; } break; case 1032: -#line 5612 "sql_yacc.yy" - { yyval.item_list= yyvsp[0].item_list;} +#line 5614 "sql_yacc.yy" + { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 1033: -#line 5616 "sql_yacc.yy" +#line 5618 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 1034: -#line 5618 "sql_yacc.yy" - { yyval.item_list= Select->expr_list.pop(); } +#line 5620 "sql_yacc.yy" + { (yyval.item_list)= Select->expr_list.pop(); } break; case 1035: -#line 5621 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 5623 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 1036: -#line 5622 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 5624 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 1037: -#line 5625 "sql_yacc.yy" - { yyval.item_list= yyvsp[0].item_list; } +#line 5627 "sql_yacc.yy" + { (yyval.item_list)= (yyvsp[(1) - (1)].item_list); } break; case 1038: -#line 5626 "sql_yacc.yy" - { yyval.item_list= yyvsp[-1].item_list; } +#line 5628 "sql_yacc.yy" + { (yyval.item_list)= (yyvsp[(2) - (3)].item_list); } break; case 1039: -#line 5629 "sql_yacc.yy" +#line 5631 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 1040: -#line 5631 "sql_yacc.yy" - { yyval.item_list= Select->expr_list.pop(); } +#line 5633 "sql_yacc.yy" + { (yyval.item_list)= Select->expr_list.pop(); } break; case 1041: -#line 5634 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 5636 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 1042: -#line 5635 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 5637 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 1043: -#line 5638 "sql_yacc.yy" - { yyval.item= NULL; } +#line 5640 "sql_yacc.yy" + { (yyval.item)= NULL; } break; case 1044: -#line 5639 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 5641 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1045: -#line 5642 "sql_yacc.yy" - { yyval.item= NULL; } +#line 5644 "sql_yacc.yy" + { (yyval.item)= NULL; } break; case 1046: -#line 5643 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 5645 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 1047: -#line 5647 "sql_yacc.yy" +#line 5649 "sql_yacc.yy" { - yyval.item_list= new List; - yyval.item_list->push_back(yyvsp[-2].item); - yyval.item_list->push_back(yyvsp[0].item); + (yyval.item_list)= new List; + (yyval.item_list)->push_back((yyvsp[(2) - (4)].item)); + (yyval.item_list)->push_back((yyvsp[(4) - (4)].item)); } break; case 1048: -#line 5653 "sql_yacc.yy" +#line 5655 "sql_yacc.yy" { - yyvsp[-4].item_list->push_back(yyvsp[-2].item); - yyvsp[-4].item_list->push_back(yyvsp[0].item); - yyval.item_list= yyvsp[-4].item_list; + (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(3) - (5)].item)); + (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(5) - (5)].item)); + (yyval.item_list)= (yyvsp[(1) - (5)].item_list); } break; case 1049: -#line 5662 "sql_yacc.yy" - { yyval.table_list=yyvsp[0].table_list; } +#line 5664 "sql_yacc.yy" + { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1050: -#line 5664 "sql_yacc.yy" +#line 5666 "sql_yacc.yy" { LEX *lex= Lex; - if (!(yyval.table_list= lex->current_select->nest_last_join(lex->thd))) + if (!((yyval.table_list)= lex->current_select->nest_last_join(lex->thd))) MYSQL_YYABORT; } break; case 1051: -#line 5672 "sql_yacc.yy" - { MYSQL_YYABORT_UNLESS(yyval.table_list=yyvsp[0].table_list); } +#line 5674 "sql_yacc.yy" + { MYSQL_YYABORT_UNLESS((yyval.table_list)=(yyvsp[(1) - (1)].table_list)); } break; case 1052: -#line 5677 "sql_yacc.yy" - { yyval.table_list=yyvsp[0].table_list; } +#line 5679 "sql_yacc.yy" + { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1053: -#line 5679 "sql_yacc.yy" +#line 5681 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-2].table_list && (yyval.table_list=yyvsp[0].table_list)); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1054: -#line 5699 "sql_yacc.yy" - { MYSQL_YYABORT_UNLESS(yyvsp[-2].table_list && (yyval.table_list=yyvsp[0].table_list)); } +#line 5701 "sql_yacc.yy" + { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1055: -#line 5701 "sql_yacc.yy" - { MYSQL_YYABORT_UNLESS(yyvsp[-2].table_list && (yyval.table_list=yyvsp[0].table_list)); yyvsp[0].table_list->straight=1; } +#line 5703 "sql_yacc.yy" + { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); (yyvsp[(3) - (3)].table_list)->straight=1; } break; case 1056: -#line 5704 "sql_yacc.yy" +#line 5706 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-3].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-3].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (4)].table_list), (yyvsp[(3) - (4)].table_list))) MYSQL_YYABORT; Select->parsing_place= IN_ON; } break; case 1057: -#line 5712 "sql_yacc.yy" +#line 5714 "sql_yacc.yy" { - add_join_on(yyvsp[-3].table_list,yyvsp[0].item); + add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); Lex->pop_context(); Select->parsing_place= NO_MATTER; } break; case 1058: -#line 5719 "sql_yacc.yy" +#line 5721 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-3].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-3].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (4)].table_list), (yyvsp[(3) - (4)].table_list))) MYSQL_YYABORT; Select->parsing_place= IN_ON; } break; case 1059: -#line 5727 "sql_yacc.yy" +#line 5729 "sql_yacc.yy" { - yyvsp[-3].table_list->straight=1; - add_join_on(yyvsp[-3].table_list,yyvsp[0].item); + (yyvsp[(3) - (6)].table_list)->straight=1; + add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); Lex->pop_context(); Select->parsing_place= NO_MATTER; } break; case 1060: -#line 5735 "sql_yacc.yy" +#line 5737 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-3].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); } break; case 1061: -#line 5739 "sql_yacc.yy" - { add_join_natural(yyvsp[-7].table_list,yyvsp[-5].table_list,yyvsp[-1].string_list,Select); yyval.table_list=yyvsp[-5].table_list; } +#line 5741 "sql_yacc.yy" + { add_join_natural((yyvsp[(1) - (8)].table_list),(yyvsp[(3) - (8)].table_list),(yyvsp[(7) - (8)].string_list),Select); (yyval.table_list)=(yyvsp[(3) - (8)].table_list); } break; case 1062: -#line 5741 "sql_yacc.yy" +#line 5743 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-3].table_list && (yyval.table_list=yyvsp[0].table_list)); - add_join_natural(yyvsp[-3].table_list,yyvsp[0].table_list,NULL,Select); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && ((yyval.table_list)=(yyvsp[(4) - (4)].table_list))); + add_join_natural((yyvsp[(1) - (4)].table_list),(yyvsp[(4) - (4)].table_list),NULL,Select); } break; case 1063: -#line 5749 "sql_yacc.yy" +#line 5751 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-5].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-5].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (6)].table_list), (yyvsp[(5) - (6)].table_list))) MYSQL_YYABORT; Select->parsing_place= IN_ON; } break; case 1064: -#line 5757 "sql_yacc.yy" +#line 5759 "sql_yacc.yy" { - add_join_on(yyvsp[-3].table_list,yyvsp[0].item); + add_join_on((yyvsp[(5) - (8)].table_list),(yyvsp[(8) - (8)].item)); Lex->pop_context(); - yyvsp[-3].table_list->outer_join|=JOIN_TYPE_LEFT; - yyval.table_list=yyvsp[-3].table_list; + (yyvsp[(5) - (8)].table_list)->outer_join|=JOIN_TYPE_LEFT; + (yyval.table_list)=(yyvsp[(5) - (8)].table_list); Select->parsing_place= NO_MATTER; } break; case 1065: -#line 5765 "sql_yacc.yy" +#line 5767 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-4].table_list && yyvsp[0].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } break; case 1066: -#line 5769 "sql_yacc.yy" +#line 5771 "sql_yacc.yy" { - add_join_natural(yyvsp[-9].table_list,yyvsp[-5].table_list,yyvsp[-1].string_list,Select); - yyvsp[-5].table_list->outer_join|=JOIN_TYPE_LEFT; - yyval.table_list=yyvsp[-5].table_list; + add_join_natural((yyvsp[(1) - (10)].table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select); + (yyvsp[(5) - (10)].table_list)->outer_join|=JOIN_TYPE_LEFT; + (yyval.table_list)=(yyvsp[(5) - (10)].table_list); } break; case 1067: -#line 5775 "sql_yacc.yy" +#line 5777 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-5].table_list && yyvsp[0].table_list); - add_join_natural(yyvsp[-5].table_list,yyvsp[0].table_list,NULL,Select); - yyvsp[0].table_list->outer_join|=JOIN_TYPE_LEFT; - yyval.table_list=yyvsp[0].table_list; + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); + add_join_natural((yyvsp[(1) - (6)].table_list),(yyvsp[(6) - (6)].table_list),NULL,Select); + (yyvsp[(6) - (6)].table_list)->outer_join|=JOIN_TYPE_LEFT; + (yyval.table_list)=(yyvsp[(6) - (6)].table_list); } break; case 1068: -#line 5785 "sql_yacc.yy" +#line 5787 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-5].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-5].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (6)].table_list), (yyvsp[(5) - (6)].table_list))) MYSQL_YYABORT; Select->parsing_place= IN_ON; } break; case 1069: -#line 5793 "sql_yacc.yy" +#line 5795 "sql_yacc.yy" { LEX *lex= Lex; - if (!(yyval.table_list= lex->current_select->convert_right_join())) + if (!((yyval.table_list)= lex->current_select->convert_right_join())) MYSQL_YYABORT; - add_join_on(yyval.table_list, yyvsp[0].item); + add_join_on((yyval.table_list), (yyvsp[(8) - (8)].item)); Lex->pop_context(); Select->parsing_place= NO_MATTER; } break; case 1070: -#line 5802 "sql_yacc.yy" +#line 5804 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-4].table_list && yyvsp[0].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } break; case 1071: -#line 5806 "sql_yacc.yy" +#line 5808 "sql_yacc.yy" { LEX *lex= Lex; - if (!(yyval.table_list= lex->current_select->convert_right_join())) + if (!((yyval.table_list)= lex->current_select->convert_right_join())) MYSQL_YYABORT; - add_join_natural(yyval.table_list,yyvsp[-5].table_list,yyvsp[-1].string_list,Select); + add_join_natural((yyval.table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select); } break; case 1072: -#line 5813 "sql_yacc.yy" +#line 5815 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-5].table_list && yyvsp[0].table_list); - add_join_natural(yyvsp[0].table_list,yyvsp[-5].table_list,NULL,Select); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); + add_join_natural((yyvsp[(6) - (6)].table_list),(yyvsp[(1) - (6)].table_list),NULL,Select); LEX *lex= Lex; - if (!(yyval.table_list= lex->current_select->convert_right_join())) + if (!((yyval.table_list)= lex->current_select->convert_right_join())) MYSQL_YYABORT; } break; case 1073: -#line 5822 "sql_yacc.yy" +#line 5824 "sql_yacc.yy" {} break; case 1074: -#line 5823 "sql_yacc.yy" +#line 5825 "sql_yacc.yy" {} break; case 1075: -#line 5824 "sql_yacc.yy" +#line 5826 "sql_yacc.yy" {} break; case 1076: -#line 5829 "sql_yacc.yy" +#line 5831 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->use_index_ptr=sel->ignore_index_ptr=0; @@ -21484,50 +21819,50 @@ break; case 1077: -#line 5835 "sql_yacc.yy" +#line 5837 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; - if (!(yyval.table_list= sel->add_table_to_list(lex->thd, yyvsp[-2].table, yyvsp[-1].lex_str_ptr, + if (!((yyval.table_list)= sel->add_table_to_list(lex->thd, (yyvsp[(2) - (4)].table), (yyvsp[(3) - (4)].lex_str_ptr), sel->get_table_join_options(), lex->lock_option, sel->get_use_index(), sel->get_ignore_index()))) MYSQL_YYABORT; - sel->add_joined_table(yyval.table_list); + sel->add_joined_table((yyval.table_list)); } break; case 1078: -#line 5848 "sql_yacc.yy" +#line 5850 "sql_yacc.yy" { /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-5].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(3) - (8)].table_list), (yyvsp[(7) - (8)].table_list))) MYSQL_YYABORT; } break; case 1079: -#line 5855 "sql_yacc.yy" +#line 5857 "sql_yacc.yy" { LEX *lex= Lex; - MYSQL_YYABORT_UNLESS(yyvsp[-8].table_list && yyvsp[-4].table_list); - add_join_on(yyvsp[-4].table_list,yyvsp[-1].item); + MYSQL_YYABORT_UNLESS((yyvsp[(3) - (11)].table_list) && (yyvsp[(7) - (11)].table_list)); + add_join_on((yyvsp[(7) - (11)].table_list),(yyvsp[(10) - (11)].item)); Lex->pop_context(); - yyvsp[-4].table_list->outer_join|=JOIN_TYPE_LEFT; - yyval.table_list=yyvsp[-4].table_list; - if (!(yyval.table_list= lex->current_select->nest_last_join(lex->thd))) + (yyvsp[(7) - (11)].table_list)->outer_join|=JOIN_TYPE_LEFT; + (yyval.table_list)=(yyvsp[(7) - (11)].table_list); + if (!((yyval.table_list)= lex->current_select->nest_last_join(lex->thd))) MYSQL_YYABORT; } break; case 1080: -#line 5866 "sql_yacc.yy" +#line 5868 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; - if (yyvsp[-2].num) + if ((yyvsp[(1) - (3)].num)) { if (sel->set_braces(1)) { @@ -21539,31 +21874,31 @@ sel->master_unit()->global_parameters= sel->master_unit()->fake_select_lex; } - if (yyvsp[-1].select_lex->init_nested_join(lex->thd)) + if ((yyvsp[(2) - (3)].select_lex)->init_nested_join(lex->thd)) MYSQL_YYABORT; - yyval.table_list= 0; + (yyval.table_list)= 0; /* incomplete derived tables return NULL, we must be nested in select_derived rule to be here. */ } break; case 1081: -#line 5888 "sql_yacc.yy" +#line 5890 "sql_yacc.yy" { /* Use $2 instead of Lex->current_select as derived table will alter value of Lex->current_select. */ - if (!(yyvsp[-3].table_list || yyvsp[0].lex_str_ptr) && yyvsp[-4].select_lex->embedding && - !yyvsp[-4].select_lex->embedding->nested_join->join_list.elements) + if (!((yyvsp[(3) - (6)].table_list) || (yyvsp[(6) - (6)].lex_str_ptr)) && (yyvsp[(2) - (6)].select_lex)->embedding && + !(yyvsp[(2) - (6)].select_lex)->embedding->nested_join->join_list.elements) { /* we have a derived table ($3 == NULL) but no alias, Since we are nested in further parentheses so we can pass NULL to the outer level parentheses Permits parsing of "((((select ...))) as xyz)" */ - yyval.table_list= 0; + (yyval.table_list)= 0; } else - if (!yyvsp[-3].table_list) + if (!(yyvsp[(3) - (6)].table_list)) { /* Handle case of derived table, alias may be NULL if there are no outer parentheses, add_table_to_list() will throw @@ -21572,46 +21907,46 @@ SELECT_LEX *sel= lex->current_select; SELECT_LEX_UNIT *unit= sel->master_unit(); lex->current_select= sel= unit->outer_select(); - if (!(yyval.table_list= sel-> - add_table_to_list(lex->thd, new Table_ident(unit), yyvsp[0].lex_str_ptr, 0, + if (!((yyval.table_list)= sel-> + add_table_to_list(lex->thd, new Table_ident(unit), (yyvsp[(6) - (6)].lex_str_ptr), 0, TL_READ,(List *)0, (List *)0))) MYSQL_YYABORT; - sel->add_joined_table(yyval.table_list); + sel->add_joined_table((yyval.table_list)); lex->pop_context(); } else - if (yyvsp[-2].num || yyvsp[0].lex_str_ptr) + if ((yyvsp[(4) - (6)].num) || (yyvsp[(6) - (6)].lex_str_ptr)) { /* simple nested joins cannot have aliases or unions */ my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } else - yyval.table_list= yyvsp[-3].table_list; + (yyval.table_list)= (yyvsp[(3) - (6)].table_list); } break; case 1082: -#line 5935 "sql_yacc.yy" +#line 5937 "sql_yacc.yy" { LEX *lex= Lex; - if (yyvsp[0].select_lex->init_nested_join(lex->thd)) + if ((yyvsp[(1) - (1)].select_lex)->init_nested_join(lex->thd)) MYSQL_YYABORT; } break; case 1083: -#line 5941 "sql_yacc.yy" +#line 5943 "sql_yacc.yy" { LEX *lex= Lex; /* for normal joins, $3 != NULL and end_nested_join() != NULL, for derived tables, both must equal NULL */ - if (!(yyval.table_list= yyvsp[-2].select_lex->end_nested_join(lex->thd)) && yyvsp[0].table_list) + if (!((yyval.table_list)= (yyvsp[(1) - (3)].select_lex)->end_nested_join(lex->thd)) && (yyvsp[(3) - (3)].table_list)) MYSQL_YYABORT; - if (!yyvsp[0].table_list && yyval.table_list) + if (!(yyvsp[(3) - (3)].table_list) && (yyval.table_list)) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; @@ -21620,7 +21955,7 @@ break; case 1084: -#line 5957 "sql_yacc.yy" +#line 5959 "sql_yacc.yy" { LEX *lex= Lex; lex->derived_tables|= DERIVED_SUBQUERY; @@ -21641,19 +21976,19 @@ break; case 1085: -#line 5975 "sql_yacc.yy" +#line 5977 "sql_yacc.yy" { Select->parsing_place= NO_MATTER; } break; case 1087: -#line 5982 "sql_yacc.yy" - { yyval.select_lex= Select; } +#line 5984 "sql_yacc.yy" + { (yyval.select_lex)= Select; } break; case 1088: -#line 5987 "sql_yacc.yy" +#line 5989 "sql_yacc.yy" { LEX *lex= Lex; @@ -21672,333 +22007,333 @@ MYSQL_YYABORT; } embedding= Select->embedding; - yyval.num= embedding && + (yyval.num)= embedding && !embedding->nested_join->join_list.elements; /* return true if we are deeply nested */ } break; case 1089: -#line 6012 "sql_yacc.yy" +#line 6014 "sql_yacc.yy" {} break; case 1090: -#line 6013 "sql_yacc.yy" +#line 6015 "sql_yacc.yy" {} break; case 1093: -#line 6020 "sql_yacc.yy" +#line 6022 "sql_yacc.yy" {} break; case 1094: -#line 6022 "sql_yacc.yy" +#line 6024 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->use_index= *yyvsp[0].string_list; + sel->use_index= *(yyvsp[(2) - (2)].string_list); sel->use_index_ptr= &sel->use_index; } break; case 1095: -#line 6028 "sql_yacc.yy" +#line 6030 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->use_index= *yyvsp[0].string_list; + sel->use_index= *(yyvsp[(2) - (2)].string_list); sel->use_index_ptr= &sel->use_index; sel->table_join_options|= TL_OPTION_FORCE_INDEX; } break; case 1096: -#line 6035 "sql_yacc.yy" +#line 6037 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->ignore_index= *yyvsp[0].string_list; + sel->ignore_index= *(yyvsp[(2) - (2)].string_list); sel->ignore_index_ptr= &sel->ignore_index; } break; case 1097: -#line 6043 "sql_yacc.yy" +#line 6045 "sql_yacc.yy" { Select->interval_list.empty(); } break; case 1098: -#line 6045 "sql_yacc.yy" - { yyval.string_list= &Select->interval_list; } +#line 6047 "sql_yacc.yy" + { (yyval.string_list)= &Select->interval_list; } break; case 1099: -#line 6049 "sql_yacc.yy" +#line 6051 "sql_yacc.yy" {} break; case 1100: -#line 6050 "sql_yacc.yy" +#line 6052 "sql_yacc.yy" {} break; case 1101: -#line 6055 "sql_yacc.yy" +#line 6057 "sql_yacc.yy" { Select-> - interval_list.push_back(new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, + interval_list.push_back(new (YYTHD->mem_root) String((const char*) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, system_charset_info)); } break; case 1102: -#line 6059 "sql_yacc.yy" +#line 6061 "sql_yacc.yy" { Select-> - interval_list.push_back(new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, + interval_list.push_back(new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, system_charset_info)); } break; case 1103: -#line 6063 "sql_yacc.yy" +#line 6065 "sql_yacc.yy" { Select-> interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7, system_charset_info)); } break; case 1104: -#line 6069 "sql_yacc.yy" +#line 6071 "sql_yacc.yy" { - if (!(yyval.string_list= new List)) + if (!((yyval.string_list)= new List)) MYSQL_YYABORT; - yyval.string_list->push_back(new (YYTHD->mem_root) - String((const char *) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, + (yyval.string_list)->push_back(new (YYTHD->mem_root) + String((const char *) (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, system_charset_info)); } break; case 1105: -#line 6077 "sql_yacc.yy" +#line 6079 "sql_yacc.yy" { - yyvsp[-2].string_list->push_back(new (YYTHD->mem_root) - String((const char *) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, + (yyvsp[(1) - (3)].string_list)->push_back(new (YYTHD->mem_root) + String((const char *) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, system_charset_info)); - yyval.string_list= yyvsp[-2].string_list; + (yyval.string_list)= (yyvsp[(1) - (3)].string_list); } break; case 1106: -#line 6085 "sql_yacc.yy" +#line 6087 "sql_yacc.yy" {} break; case 1107: -#line 6086 "sql_yacc.yy" - { yyval.interval=INTERVAL_DAY_HOUR; } +#line 6088 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_DAY_HOUR; } break; case 1108: -#line 6087 "sql_yacc.yy" - { yyval.interval=INTERVAL_DAY_MICROSECOND; } +#line 6089 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_DAY_MICROSECOND; } break; case 1109: -#line 6088 "sql_yacc.yy" - { yyval.interval=INTERVAL_DAY_MINUTE; } +#line 6090 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_DAY_MINUTE; } break; case 1110: -#line 6089 "sql_yacc.yy" - { yyval.interval=INTERVAL_DAY_SECOND; } +#line 6091 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_DAY_SECOND; } break; case 1111: -#line 6090 "sql_yacc.yy" - { yyval.interval=INTERVAL_HOUR_MICROSECOND; } +#line 6092 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_HOUR_MICROSECOND; } break; case 1112: -#line 6091 "sql_yacc.yy" - { yyval.interval=INTERVAL_HOUR_MINUTE; } +#line 6093 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_HOUR_MINUTE; } break; case 1113: -#line 6092 "sql_yacc.yy" - { yyval.interval=INTERVAL_HOUR_SECOND; } +#line 6094 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_HOUR_SECOND; } break; case 1114: -#line 6093 "sql_yacc.yy" - { yyval.interval=INTERVAL_MICROSECOND; } +#line 6095 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_MICROSECOND; } break; case 1115: -#line 6094 "sql_yacc.yy" - { yyval.interval=INTERVAL_MINUTE_MICROSECOND; } +#line 6096 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_MINUTE_MICROSECOND; } break; case 1116: -#line 6095 "sql_yacc.yy" - { yyval.interval=INTERVAL_MINUTE_SECOND; } +#line 6097 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_MINUTE_SECOND; } break; case 1117: -#line 6096 "sql_yacc.yy" - { yyval.interval=INTERVAL_SECOND_MICROSECOND; } +#line 6098 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_SECOND_MICROSECOND; } break; case 1118: -#line 6097 "sql_yacc.yy" - { yyval.interval=INTERVAL_YEAR_MONTH; } +#line 6099 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_YEAR_MONTH; } break; case 1119: -#line 6100 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_DAY; } +#line 6102 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_DAY; } break; case 1120: -#line 6101 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_WEEK; } +#line 6103 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_WEEK; } break; case 1121: -#line 6102 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_HOUR; } +#line 6104 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_HOUR; } break; case 1122: -#line 6103 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_MICROSECOND; } +#line 6105 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_MICROSECOND; } break; case 1123: -#line 6104 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_MINUTE; } +#line 6106 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_MINUTE; } break; case 1124: -#line 6105 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_MONTH; } +#line 6107 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_MONTH; } break; case 1125: -#line 6106 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_QUARTER; } +#line 6108 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_QUARTER; } break; case 1126: -#line 6107 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_SECOND; } +#line 6109 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_SECOND; } break; case 1127: -#line 6108 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_YEAR; } +#line 6110 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_YEAR; } break; case 1128: -#line 6112 "sql_yacc.yy" - {yyval.date_time_type=MYSQL_TIMESTAMP_DATE;} +#line 6114 "sql_yacc.yy" + {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATE;} break; case 1129: -#line 6113 "sql_yacc.yy" - {yyval.date_time_type=MYSQL_TIMESTAMP_TIME;} +#line 6115 "sql_yacc.yy" + {(yyval.date_time_type)=MYSQL_TIMESTAMP_TIME;} break; case 1130: -#line 6114 "sql_yacc.yy" - {yyval.date_time_type=MYSQL_TIMESTAMP_DATETIME;} +#line 6116 "sql_yacc.yy" + {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATETIME;} break; case 1131: -#line 6115 "sql_yacc.yy" - {yyval.date_time_type=MYSQL_TIMESTAMP_DATETIME;} +#line 6117 "sql_yacc.yy" + {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATETIME;} break; case 1135: -#line 6124 "sql_yacc.yy" - { yyval.lex_str_ptr=0; } +#line 6126 "sql_yacc.yy" + { (yyval.lex_str_ptr)=0; } break; case 1136: -#line 6126 "sql_yacc.yy" - { yyval.lex_str_ptr= (LEX_STRING*) sql_memdup(&yyvsp[0].lex_str,sizeof(LEX_STRING)); } +#line 6128 "sql_yacc.yy" + { (yyval.lex_str_ptr)= (LEX_STRING*) sql_memdup(&(yyvsp[(2) - (2)].lex_str),sizeof(LEX_STRING)); } break; case 1139: -#line 6134 "sql_yacc.yy" +#line 6136 "sql_yacc.yy" { Select->where= 0; } break; case 1140: -#line 6136 "sql_yacc.yy" +#line 6138 "sql_yacc.yy" { Select->parsing_place= IN_WHERE; } break; case 1141: -#line 6140 "sql_yacc.yy" +#line 6142 "sql_yacc.yy" { SELECT_LEX *select= Select; - select->where= yyvsp[0].item; + select->where= (yyvsp[(3) - (3)].item); select->parsing_place= NO_MATTER; - if (yyvsp[0].item) - yyvsp[0].item->top_level_item(); + if ((yyvsp[(3) - (3)].item)) + (yyvsp[(3) - (3)].item)->top_level_item(); } break; case 1143: -#line 6152 "sql_yacc.yy" +#line 6154 "sql_yacc.yy" { Select->parsing_place= IN_HAVING; } break; case 1144: -#line 6156 "sql_yacc.yy" +#line 6158 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->having= yyvsp[0].item; + sel->having= (yyvsp[(3) - (3)].item); sel->parsing_place= NO_MATTER; - if (yyvsp[0].item) - yyvsp[0].item->top_level_item(); + if ((yyvsp[(3) - (3)].item)) + (yyvsp[(3) - (3)].item)->top_level_item(); } break; case 1145: -#line 6167 "sql_yacc.yy" +#line 6169 "sql_yacc.yy" { Lex->escape_used= TRUE; - yyval.item= yyvsp[0].item; + (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 1146: -#line 6172 "sql_yacc.yy" +#line 6174 "sql_yacc.yy" { Lex->escape_used= FALSE; - yyval.item= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? + (yyval.item)= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? new Item_string("", 0, &my_charset_latin1) : new Item_string("\\", 1, &my_charset_latin1)); } break; case 1149: -#line 6191 "sql_yacc.yy" - { if (add_group_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) MYSQL_YYABORT; } +#line 6193 "sql_yacc.yy" + { if (add_group_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1150: -#line 6193 "sql_yacc.yy" - { if (add_group_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) MYSQL_YYABORT; } +#line 6195 "sql_yacc.yy" + { if (add_group_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1151: -#line 6196 "sql_yacc.yy" +#line 6198 "sql_yacc.yy" {} break; case 1152: -#line 6198 "sql_yacc.yy" +#line 6200 "sql_yacc.yy" { LEX *lex=Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) @@ -22014,7 +22349,7 @@ break; case 1153: -#line 6211 "sql_yacc.yy" +#line 6213 "sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) @@ -22028,17 +22363,17 @@ break; case 1157: -#line 6238 "sql_yacc.yy" +#line 6240 "sql_yacc.yy" { THD *thd= YYTHD; - bool ascending= (yyvsp[0].num == 1) ? true : false; - if (add_order_to_list(thd, yyvsp[-1].item, ascending)) + bool ascending= ((yyvsp[(2) - (2)].num) == 1) ? true : false; + if (add_order_to_list(thd, (yyvsp[(1) - (2)].item), ascending)) MYSQL_YYABORT; } break; case 1160: -#line 6256 "sql_yacc.yy" +#line 6258 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= lex->current_select; @@ -22071,32 +22406,32 @@ break; case 1162: -#line 6288 "sql_yacc.yy" - { if (add_order_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) MYSQL_YYABORT; } +#line 6290 "sql_yacc.yy" + { if (add_order_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1163: -#line 6290 "sql_yacc.yy" - { if (add_order_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) MYSQL_YYABORT; } +#line 6292 "sql_yacc.yy" + { if (add_order_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1164: -#line 6293 "sql_yacc.yy" - { yyval.num = 1; } +#line 6295 "sql_yacc.yy" + { (yyval.num) = 1; } break; case 1165: -#line 6294 "sql_yacc.yy" - { yyval.num =1; } +#line 6296 "sql_yacc.yy" + { (yyval.num) =1; } break; case 1166: -#line 6295 "sql_yacc.yy" - { yyval.num =0; } +#line 6297 "sql_yacc.yy" + { (yyval.num) =0; } break; case 1167: -#line 6300 "sql_yacc.yy" +#line 6302 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -22106,79 +22441,79 @@ break; case 1168: -#line 6306 "sql_yacc.yy" +#line 6308 "sql_yacc.yy" {} break; case 1169: -#line 6310 "sql_yacc.yy" +#line 6312 "sql_yacc.yy" {} break; case 1170: -#line 6311 "sql_yacc.yy" +#line 6313 "sql_yacc.yy" {} break; case 1171: -#line 6315 "sql_yacc.yy" +#line 6317 "sql_yacc.yy" {} break; case 1172: -#line 6320 "sql_yacc.yy" +#line 6322 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->select_limit= yyvsp[0].item; + sel->select_limit= (yyvsp[(1) - (1)].item); sel->offset_limit= 0; sel->explicit_limit= 1; } break; case 1173: -#line 6327 "sql_yacc.yy" +#line 6329 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->select_limit= yyvsp[0].item; - sel->offset_limit= yyvsp[-2].item; + sel->select_limit= (yyvsp[(3) - (3)].item); + sel->offset_limit= (yyvsp[(1) - (3)].item); sel->explicit_limit= 1; } break; case 1174: -#line 6334 "sql_yacc.yy" +#line 6336 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->select_limit= yyvsp[-2].item; - sel->offset_limit= yyvsp[0].item; + sel->select_limit= (yyvsp[(1) - (3)].item); + sel->offset_limit= (yyvsp[(3) - (3)].item); sel->explicit_limit= 1; } break; case 1175: -#line 6343 "sql_yacc.yy" +#line 6345 "sql_yacc.yy" { - ((Item_param *) yyvsp[0].item)->set_strict_type(INT_RESULT); + ((Item_param *) (yyvsp[(1) - (1)].item))->set_strict_type(INT_RESULT); } break; case 1176: -#line 6346 "sql_yacc.yy" - { yyval.item= new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 6348 "sql_yacc.yy" + { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1177: -#line 6347 "sql_yacc.yy" - { yyval.item= new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 6349 "sql_yacc.yy" + { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1178: -#line 6348 "sql_yacc.yy" - { yyval.item= new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 6350 "sql_yacc.yy" + { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1179: -#line 6353 "sql_yacc.yy" +#line 6355 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select->select_limit= 0; @@ -22186,71 +22521,71 @@ break; case 1180: -#line 6358 "sql_yacc.yy" +#line 6360 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->select_limit= yyvsp[0].item; + sel->select_limit= (yyvsp[(2) - (2)].item); sel->explicit_limit= 1; } break; case 1181: -#line 6365 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6367 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1182: -#line 6366 "sql_yacc.yy" - { yyval.ulong_num= (ulong) strtol(yyvsp[0].lex_str.str, (char**) 0, 16); } +#line 6368 "sql_yacc.yy" + { (yyval.ulong_num)= (ulong) strtol((yyvsp[(1) - (1)].lex_str).str, (char**) 0, 16); } break; case 1183: -#line 6367 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6369 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1184: -#line 6368 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6370 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1185: -#line 6369 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6371 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1186: -#line 6370 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6372 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1187: -#line 6374 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6376 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1188: -#line 6375 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6377 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1189: -#line 6376 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6378 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1190: -#line 6377 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6379 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1191: -#line 6378 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6380 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1193: -#line 6384 "sql_yacc.yy" +#line 6386 "sql_yacc.yy" { LEX *lex=Lex; @@ -22271,38 +22606,38 @@ if (add_proc_to_list(lex->thd, new Item_field(&lex-> current_select-> context, - NULL,NULL,yyvsp[0].lex_str.str))) + NULL,NULL,(yyvsp[(2) - (2)].lex_str).str))) MYSQL_YYABORT; Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } break; case 1195: -#line 6412 "sql_yacc.yy" +#line 6414 "sql_yacc.yy" {} break; case 1196: -#line 6413 "sql_yacc.yy" +#line 6415 "sql_yacc.yy" {} break; case 1199: -#line 6421 "sql_yacc.yy" +#line 6423 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; - if (add_proc_to_list(thd, yyvsp[0].item)) + if (add_proc_to_list(thd, (yyvsp[(2) - (2)].item))) MYSQL_YYABORT; - if (!yyvsp[0].item->name) - yyvsp[0].item->set_name(yyvsp[-1].simple_string,(uint) ((char*) lip->tok_end - yyvsp[-1].simple_string), + if (!(yyvsp[(2) - (2)].item)->name) + (yyvsp[(2) - (2)].item)->set_name((yyvsp[(1) - (2)].simple_string),(uint) ((char*) lip->tok_end - (yyvsp[(1) - (2)].simple_string)), thd->charset()); } break; case 1200: -#line 6435 "sql_yacc.yy" +#line 6437 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe && (!(lex->result= new select_dumpvar()))) @@ -22311,21 +22646,21 @@ break; case 1201: -#line 6441 "sql_yacc.yy" +#line 6443 "sql_yacc.yy" {} break; case 1203: -#line 6446 "sql_yacc.yy" +#line 6448 "sql_yacc.yy" {} break; case 1204: -#line 6451 "sql_yacc.yy" +#line 6453 "sql_yacc.yy" { LEX *lex=Lex; if (lex->result) - ((select_dumpvar *)lex->result)->var_list.push_back( new my_var(yyvsp[0].lex_str,0,0,(enum_field_types)0)); + ((select_dumpvar *)lex->result)->var_list.push_back( new my_var((yyvsp[(2) - (2)].lex_str),0,0,(enum_field_types)0)); else /* The parser won't create select_result instance only @@ -22336,21 +22671,21 @@ break; case 1205: -#line 6463 "sql_yacc.yy" +#line 6465 "sql_yacc.yy" { LEX *lex=Lex; sp_variable_t *t; - if (!lex->spcont || !(t=lex->spcont->find_variable(&yyvsp[0].lex_str))) + if (!lex->spcont || !(t=lex->spcont->find_variable(&(yyvsp[(1) - (1)].lex_str)))) { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } if (lex->result) { my_var *var; ((select_dumpvar *)lex->result)-> - var_list.push_back(var= new my_var(yyvsp[0].lex_str,1,t->offset,t->type)); + var_list.push_back(var= new my_var((yyvsp[(1) - (1)].lex_str),1,t->offset,t->type)); #ifndef DBUG_OFF if (var) var->sp= lex->sphead; @@ -22368,7 +22703,7 @@ break; case 1206: -#line 6495 "sql_yacc.yy" +#line 6497 "sql_yacc.yy" { if (! Lex->parsing_options.allows_select_into) { @@ -22379,24 +22714,24 @@ break; case 1208: -#line 6507 "sql_yacc.yy" +#line 6509 "sql_yacc.yy" { LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_SIDEEFFECT); - if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str, 0)) || + if (!(lex->exchange= new sql_exchange((yyvsp[(2) - (2)].lex_str).str, 0)) || !(lex->result= new select_export(lex->exchange))) MYSQL_YYABORT; } break; case 1210: -#line 6516 "sql_yacc.yy" +#line 6518 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe) { lex->uncacheable(UNCACHEABLE_SIDEEFFECT); - if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str,1))) + if (!(lex->exchange= new sql_exchange((yyvsp[(2) - (2)].lex_str).str,1))) MYSQL_YYABORT; if (!(lex->result= new select_dump(lex->exchange))) MYSQL_YYABORT; @@ -22405,14 +22740,14 @@ break; case 1211: -#line 6528 "sql_yacc.yy" +#line 6530 "sql_yacc.yy" { Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } break; case 1212: -#line 6538 "sql_yacc.yy" +#line 6540 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DO; @@ -22421,54 +22756,54 @@ break; case 1213: -#line 6544 "sql_yacc.yy" +#line 6546 "sql_yacc.yy" { - Lex->insert_list= yyvsp[0].item_list; + Lex->insert_list= (yyvsp[(3) - (3)].item_list); } break; case 1214: -#line 6555 "sql_yacc.yy" +#line 6557 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DROP_TABLE; - lex->drop_temporary= yyvsp[-4].num; - lex->drop_if_exists= yyvsp[-2].num; + lex->drop_temporary= (yyvsp[(2) - (6)].num); + lex->drop_if_exists= (yyvsp[(4) - (6)].num); } break; case 1215: -#line 6561 "sql_yacc.yy" +#line 6563 "sql_yacc.yy" {} break; case 1216: -#line 6562 "sql_yacc.yy" +#line 6564 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_INDEX; lex->alter_info.reset(); lex->alter_info.flags= ALTER_DROP_INDEX; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - yyvsp[-3].lex_str.str)); - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, NULL, + (yyvsp[(3) - (6)].lex_str).str)); + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(5) - (6)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; } break; case 1217: -#line 6574 "sql_yacc.yy" +#line 6576 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_DB; - lex->drop_if_exists=yyvsp[-1].num; - lex->name=yyvsp[0].lex_str.str; + lex->drop_if_exists=(yyvsp[(3) - (4)].num); + lex->name=(yyvsp[(4) - (4)].lex_str).str; } break; case 1218: -#line 6581 "sql_yacc.yy" +#line 6583 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -22477,13 +22812,13 @@ MYSQL_YYABORT; } lex->sql_command = SQLCOM_DROP_FUNCTION; - lex->drop_if_exists= yyvsp[-1].num; - lex->spname= yyvsp[0].spname; + lex->drop_if_exists= (yyvsp[(3) - (4)].num); + lex->spname= (yyvsp[(4) - (4)].spname); } break; case 1219: -#line 6593 "sql_yacc.yy" +#line 6595 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -22492,67 +22827,67 @@ MYSQL_YYABORT; } lex->sql_command = SQLCOM_DROP_PROCEDURE; - lex->drop_if_exists= yyvsp[-1].num; - lex->spname= yyvsp[0].spname; + lex->drop_if_exists= (yyvsp[(3) - (4)].num); + lex->spname= (yyvsp[(4) - (4)].spname); } break; case 1220: -#line 6605 "sql_yacc.yy" +#line 6607 "sql_yacc.yy" { Lex->sql_command = SQLCOM_DROP_USER; } break; case 1221: -#line 6609 "sql_yacc.yy" +#line 6611 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_VIEW; - lex->drop_if_exists= yyvsp[-2].num; + lex->drop_if_exists= (yyvsp[(3) - (5)].num); } break; case 1222: -#line 6615 "sql_yacc.yy" +#line 6617 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_TRIGGER; - lex->drop_if_exists= yyvsp[-1].num; - lex->spname= yyvsp[0].spname; + lex->drop_if_exists= (yyvsp[(3) - (4)].num); + lex->spname= (yyvsp[(4) - (4)].spname); } break; case 1225: -#line 6629 "sql_yacc.yy" +#line 6631 "sql_yacc.yy" { - if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL, TL_OPTION_UPDATING)) + if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; } break; case 1226: -#line 6636 "sql_yacc.yy" - { yyval.num= 0; } +#line 6638 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 1227: -#line 6637 "sql_yacc.yy" - { yyval.num= 1; } +#line 6639 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 1228: -#line 6641 "sql_yacc.yy" - { yyval.num= 0; } +#line 6643 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 1229: -#line 6642 "sql_yacc.yy" - { yyval.num= 1; } +#line 6644 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 1230: -#line 6650 "sql_yacc.yy" +#line 6652 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_INSERT; @@ -22564,20 +22899,20 @@ break; case 1231: -#line 6659 "sql_yacc.yy" +#line 6661 "sql_yacc.yy" { - Select->set_lock_for_tables(yyvsp[-2].lock_type); + Select->set_lock_for_tables((yyvsp[(3) - (5)].lock_type)); Lex->current_select= &Lex->select_lex; } break; case 1232: -#line 6664 "sql_yacc.yy" +#line 6666 "sql_yacc.yy" {} break; case 1233: -#line 6669 "sql_yacc.yy" +#line 6671 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPLACE; @@ -22587,20 +22922,20 @@ break; case 1234: -#line 6676 "sql_yacc.yy" +#line 6678 "sql_yacc.yy" { - Select->set_lock_for_tables(yyvsp[-1].lock_type); + Select->set_lock_for_tables((yyvsp[(3) - (4)].lock_type)); Lex->current_select= &Lex->select_lex; } break; case 1235: -#line 6681 "sql_yacc.yy" +#line 6683 "sql_yacc.yy" {} break; case 1236: -#line 6686 "sql_yacc.yy" +#line 6688 "sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* @@ -22608,50 +22943,50 @@ insert visible only after the table unlocking but everyone can read table. */ - yyval.lock_type= (Lex->sphead ? TL_WRITE_DEFAULT : TL_WRITE_CONCURRENT_INSERT); + (yyval.lock_type)= (Lex->sphead ? TL_WRITE_DEFAULT : TL_WRITE_CONCURRENT_INSERT); #else - yyval.lock_type= TL_WRITE_CONCURRENT_INSERT; + (yyval.lock_type)= TL_WRITE_CONCURRENT_INSERT; #endif } break; case 1237: -#line 6698 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_LOW_PRIORITY; } +#line 6700 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1238: -#line 6699 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_DELAYED; } +#line 6701 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_DELAYED; } break; case 1239: -#line 6700 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE; } +#line 6702 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE; } break; case 1240: -#line 6704 "sql_yacc.yy" - { yyval.lock_type= yyvsp[0].lock_type; } +#line 6706 "sql_yacc.yy" + { (yyval.lock_type)= (yyvsp[(1) - (1)].lock_type); } break; case 1241: -#line 6705 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_DELAYED; } +#line 6707 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_DELAYED; } break; case 1242: -#line 6708 "sql_yacc.yy" +#line 6710 "sql_yacc.yy" {} break; case 1243: -#line 6709 "sql_yacc.yy" +#line 6711 "sql_yacc.yy" {} break; case 1244: -#line 6713 "sql_yacc.yy" +#line 6715 "sql_yacc.yy" { LEX *lex=Lex; lex->field_list.empty(); @@ -22661,22 +22996,22 @@ break; case 1245: -#line 6721 "sql_yacc.yy" +#line 6723 "sql_yacc.yy" {} break; case 1246: -#line 6722 "sql_yacc.yy" +#line 6724 "sql_yacc.yy" {} break; case 1247: -#line 6723 "sql_yacc.yy" +#line 6725 "sql_yacc.yy" {} break; case 1248: -#line 6725 "sql_yacc.yy" +#line 6727 "sql_yacc.yy" { LEX *lex=Lex; if (!(lex->insert_list = new List_item) || @@ -22686,77 +23021,77 @@ break; case 1250: -#line 6734 "sql_yacc.yy" - { Lex->field_list.push_back(yyvsp[0].item); } +#line 6736 "sql_yacc.yy" + { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1251: -#line 6735 "sql_yacc.yy" - { Lex->field_list.push_back(yyvsp[0].item); } +#line 6737 "sql_yacc.yy" + { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1252: -#line 6738 "sql_yacc.yy" +#line 6740 "sql_yacc.yy" {} break; case 1253: -#line 6739 "sql_yacc.yy" +#line 6741 "sql_yacc.yy" {} break; case 1254: -#line 6740 "sql_yacc.yy" +#line 6742 "sql_yacc.yy" { Select->set_braces(0);} break; case 1255: -#line 6740 "sql_yacc.yy" +#line 6742 "sql_yacc.yy" {} break; case 1256: -#line 6741 "sql_yacc.yy" +#line 6743 "sql_yacc.yy" { Select->set_braces(1);} break; case 1257: -#line 6741 "sql_yacc.yy" +#line 6743 "sql_yacc.yy" {} break; case 1262: -#line 6755 "sql_yacc.yy" +#line 6757 "sql_yacc.yy" { LEX *lex=Lex; - if (lex->field_list.push_back(yyvsp[-2].item) || - lex->insert_list->push_back(yyvsp[0].item)) + if (lex->field_list.push_back((yyvsp[(1) - (3)].item)) || + lex->insert_list->push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; } break; case 1263: -#line 6762 "sql_yacc.yy" +#line 6764 "sql_yacc.yy" {} break; case 1264: -#line 6763 "sql_yacc.yy" +#line 6765 "sql_yacc.yy" {} break; case 1265: -#line 6767 "sql_yacc.yy" +#line 6769 "sql_yacc.yy" {} break; case 1266: -#line 6768 "sql_yacc.yy" +#line 6770 "sql_yacc.yy" {} break; case 1267: -#line 6773 "sql_yacc.yy" +#line 6775 "sql_yacc.yy" { if (!(Lex->insert_list = new List_item)) MYSQL_YYABORT; @@ -22764,7 +23099,7 @@ break; case 1268: -#line 6778 "sql_yacc.yy" +#line 6780 "sql_yacc.yy" { LEX *lex=Lex; if (lex->many_values.push_back(lex->insert_list)) @@ -22773,43 +23108,43 @@ break; case 1269: -#line 6785 "sql_yacc.yy" +#line 6787 "sql_yacc.yy" {} break; case 1271: -#line 6790 "sql_yacc.yy" +#line 6792 "sql_yacc.yy" { - if (Lex->insert_list->push_back(yyvsp[0].item)) + if (Lex->insert_list->push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; } break; case 1272: -#line 6795 "sql_yacc.yy" +#line 6797 "sql_yacc.yy" { - if (Lex->insert_list->push_back(yyvsp[0].item)) + if (Lex->insert_list->push_back((yyvsp[(1) - (1)].item))) MYSQL_YYABORT; } break; case 1273: -#line 6802 "sql_yacc.yy" - { yyval.item= yyvsp[0].item;} +#line 6804 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1274: -#line 6803 "sql_yacc.yy" - {yyval.item= new Item_default_value(Lex->current_context()); } +#line 6805 "sql_yacc.yy" + {(yyval.item)= new Item_default_value(Lex->current_context()); } break; case 1276: -#line 6808 "sql_yacc.yy" +#line 6810 "sql_yacc.yy" { Lex->duplicates= DUP_UPDATE; } break; case 1278: -#line 6816 "sql_yacc.yy" +#line 6818 "sql_yacc.yy" { LEX *lex= Lex; mysql_init_select(lex); @@ -22820,7 +23155,7 @@ break; case 1279: -#line 6825 "sql_yacc.yy" +#line 6827 "sql_yacc.yy" { LEX *lex= Lex; if (lex->select_lex.table_list.elements > 1) @@ -22837,45 +23172,45 @@ be too pessimistic. We will decrease lock level if possible in mysql_multi_update(). */ - Select->set_lock_for_tables(yyvsp[-4].lock_type); + Select->set_lock_for_tables((yyvsp[(3) - (7)].lock_type)); } break; case 1280: -#line 6843 "sql_yacc.yy" +#line 6845 "sql_yacc.yy" {} break; case 1283: -#line 6852 "sql_yacc.yy" +#line 6854 "sql_yacc.yy" { - if (add_item_to_list(YYTHD, yyvsp[-2].item) || add_value_to_list(YYTHD, yyvsp[0].item)) + if (add_item_to_list(YYTHD, (yyvsp[(1) - (3)].item)) || add_value_to_list(YYTHD, (yyvsp[(3) - (3)].item))) MYSQL_YYABORT; } break; case 1286: -#line 6863 "sql_yacc.yy" +#line 6865 "sql_yacc.yy" { LEX *lex= Lex; - if (lex->update_list.push_back(yyvsp[-2].item) || - lex->value_list.push_back(yyvsp[0].item)) + if (lex->update_list.push_back((yyvsp[(1) - (3)].item)) || + lex->value_list.push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; } break; case 1287: -#line 6871 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_DEFAULT; } +#line 6873 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1288: -#line 6872 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_LOW_PRIORITY; } +#line 6874 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1289: -#line 6878 "sql_yacc.yy" +#line 6880 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; @@ -22887,31 +23222,31 @@ break; case 1290: -#line 6886 "sql_yacc.yy" +#line 6888 "sql_yacc.yy" {} break; case 1291: -#line 6891 "sql_yacc.yy" +#line 6893 "sql_yacc.yy" { - if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL, TL_OPTION_UPDATING, + if (!Select->add_table_to_list(YYTHD, (yyvsp[(2) - (2)].table), NULL, TL_OPTION_UPDATING, Lex->lock_option)) MYSQL_YYABORT; } break; case 1292: -#line 6897 "sql_yacc.yy" +#line 6899 "sql_yacc.yy" {} break; case 1293: -#line 6899 "sql_yacc.yy" +#line 6901 "sql_yacc.yy" { mysql_init_multi_delete(Lex); } break; case 1294: -#line 6901 "sql_yacc.yy" +#line 6903 "sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -22919,12 +23254,12 @@ break; case 1295: -#line 6906 "sql_yacc.yy" +#line 6908 "sql_yacc.yy" { mysql_init_multi_delete(Lex); } break; case 1296: -#line 6908 "sql_yacc.yy" +#line 6910 "sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -22932,19 +23267,19 @@ break; case 1297: -#line 6915 "sql_yacc.yy" +#line 6917 "sql_yacc.yy" {} break; case 1298: -#line 6916 "sql_yacc.yy" +#line 6918 "sql_yacc.yy" {} break; case 1299: -#line 6920 "sql_yacc.yy" +#line 6922 "sql_yacc.yy" { - if (!Select->add_table_to_list(YYTHD, new Table_ident(yyvsp[-2].lex_str), yyvsp[0].lex_str_ptr, + if (!Select->add_table_to_list(YYTHD, new Table_ident((yyvsp[(1) - (3)].lex_str)), (yyvsp[(3) - (3)].lex_str_ptr), TL_OPTION_UPDATING | TL_OPTION_ALIAS, Lex->lock_option)) MYSQL_YYABORT; @@ -22952,11 +23287,11 @@ break; case 1300: -#line 6927 "sql_yacc.yy" +#line 6929 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, - new Table_ident(YYTHD, yyvsp[-4].lex_str, yyvsp[-2].lex_str, 0), - yyvsp[0].lex_str_ptr, + new Table_ident(YYTHD, (yyvsp[(1) - (5)].lex_str), (yyvsp[(3) - (5)].lex_str), 0), + (yyvsp[(5) - (5)].lex_str_ptr), TL_OPTION_UPDATING | TL_OPTION_ALIAS, Lex->lock_option)) @@ -22965,42 +23300,42 @@ break; case 1301: -#line 6939 "sql_yacc.yy" +#line 6941 "sql_yacc.yy" {} break; case 1302: -#line 6940 "sql_yacc.yy" +#line 6942 "sql_yacc.yy" {} break; case 1303: -#line 6944 "sql_yacc.yy" +#line 6946 "sql_yacc.yy" {} break; case 1304: -#line 6945 "sql_yacc.yy" +#line 6947 "sql_yacc.yy" {} break; case 1305: -#line 6948 "sql_yacc.yy" +#line 6950 "sql_yacc.yy" { Select->options|= OPTION_QUICK; } break; case 1306: -#line 6949 "sql_yacc.yy" +#line 6951 "sql_yacc.yy" { Lex->lock_option= TL_WRITE_LOW_PRIORITY; } break; case 1307: -#line 6950 "sql_yacc.yy" +#line 6952 "sql_yacc.yy" { Lex->ignore= 1; } break; case 1308: -#line 6954 "sql_yacc.yy" +#line 6956 "sql_yacc.yy" { LEX* lex= Lex; lex->sql_command= SQLCOM_TRUNCATE; @@ -23011,84 +23346,84 @@ break; case 1315: -#line 6977 "sql_yacc.yy" +#line 6979 "sql_yacc.yy" { Lex->profile_options|= PROFILE_CPU; } break; case 1316: -#line 6981 "sql_yacc.yy" +#line 6983 "sql_yacc.yy" { Lex->profile_options|= PROFILE_MEMORY; } break; case 1317: -#line 6985 "sql_yacc.yy" +#line 6987 "sql_yacc.yy" { Lex->profile_options|= PROFILE_BLOCK_IO; } break; case 1318: -#line 6989 "sql_yacc.yy" +#line 6991 "sql_yacc.yy" { Lex->profile_options|= PROFILE_CONTEXT; } break; case 1319: -#line 6993 "sql_yacc.yy" +#line 6995 "sql_yacc.yy" { Lex->profile_options|= PROFILE_PAGE_FAULTS; } break; case 1320: -#line 6997 "sql_yacc.yy" +#line 6999 "sql_yacc.yy" { Lex->profile_options|= PROFILE_IPC; } break; case 1321: -#line 7001 "sql_yacc.yy" +#line 7003 "sql_yacc.yy" { Lex->profile_options|= PROFILE_SWAPS; } break; case 1322: -#line 7005 "sql_yacc.yy" +#line 7007 "sql_yacc.yy" { Lex->profile_options|= PROFILE_SOURCE; } break; case 1323: -#line 7009 "sql_yacc.yy" +#line 7011 "sql_yacc.yy" { Lex->profile_options|= PROFILE_ALL; } break; case 1324: -#line 7016 "sql_yacc.yy" +#line 7018 "sql_yacc.yy" { Lex->profile_query_id= 0; } break; case 1325: -#line 7020 "sql_yacc.yy" +#line 7022 "sql_yacc.yy" { - Lex->profile_query_id= atoi(yyvsp[0].lex_str.str); + Lex->profile_query_id= atoi((yyvsp[(3) - (3)].lex_str).str); } break; case 1326: -#line 7028 "sql_yacc.yy" +#line 7030 "sql_yacc.yy" { LEX *lex=Lex; lex->wild=0; @@ -23100,12 +23435,12 @@ break; case 1327: -#line 7037 "sql_yacc.yy" +#line 7039 "sql_yacc.yy" {} break; case 1328: -#line 7042 "sql_yacc.yy" +#line 7044 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23116,97 +23451,97 @@ break; case 1329: -#line 7050 "sql_yacc.yy" +#line 7052 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_TABLES; - lex->select_lex.db= yyvsp[-1].simple_string; + lex->select_lex.db= (yyvsp[(3) - (4)].simple_string); if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_NAMES)) MYSQL_YYABORT; } break; case 1330: -#line 7059 "sql_yacc.yy" +#line 7061 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_TRIGGERS; - lex->select_lex.db= yyvsp[-1].simple_string; + lex->select_lex.db= (yyvsp[(3) - (4)].simple_string); if (prepare_schema_table(YYTHD, lex, 0, SCH_TRIGGERS)) MYSQL_YYABORT; } break; case 1331: -#line 7068 "sql_yacc.yy" +#line 7070 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_TABLE_STATUS; - lex->select_lex.db= yyvsp[-1].simple_string; + lex->select_lex.db= (yyvsp[(3) - (4)].simple_string); if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLES)) MYSQL_YYABORT; } break; case 1332: -#line 7077 "sql_yacc.yy" +#line 7079 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_OPEN_TABLES; - lex->select_lex.db= yyvsp[-1].simple_string; + lex->select_lex.db= (yyvsp[(3) - (4)].simple_string); if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES)) MYSQL_YYABORT; } break; case 1333: -#line 7086 "sql_yacc.yy" - { Lex->create_info.db_type= yyvsp[0].db_type; } +#line 7088 "sql_yacc.yy" + { Lex->create_info.db_type= (yyvsp[(2) - (2)].db_type); } break; case 1335: -#line 7089 "sql_yacc.yy" +#line 7091 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_FIELDS; - if (yyvsp[-1].simple_string) - yyvsp[-2].table->change_db(yyvsp[-1].simple_string); - if (prepare_schema_table(YYTHD, lex, yyvsp[-2].table, SCH_COLUMNS)) + if ((yyvsp[(5) - (6)].simple_string)) + (yyvsp[(4) - (6)].table)->change_db((yyvsp[(5) - (6)].simple_string)); + if (prepare_schema_table(YYTHD, lex, (yyvsp[(4) - (6)].table), SCH_COLUMNS)) MYSQL_YYABORT; } break; case 1336: -#line 7102 "sql_yacc.yy" +#line 7104 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_NEW_MASTER; - Lex->mi.log_file_name = yyvsp[-8].lex_str.str; - Lex->mi.pos = yyvsp[-4].ulonglong_number; - Lex->mi.server_id = yyvsp[0].ulong_num; + Lex->mi.log_file_name = (yyvsp[(8) - (16)].lex_str).str; + Lex->mi.pos = (yyvsp[(12) - (16)].ulonglong_number); + Lex->mi.server_id = (yyvsp[(16) - (16)].ulong_num); } break; case 1337: -#line 7109 "sql_yacc.yy" +#line 7111 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_BINLOGS; } break; case 1338: -#line 7113 "sql_yacc.yy" +#line 7115 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS; } break; case 1339: -#line 7117 "sql_yacc.yy" +#line 7119 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS; @@ -23214,20 +23549,20 @@ break; case 1341: -#line 7122 "sql_yacc.yy" +#line 7124 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_KEYS; - if (yyvsp[-1].simple_string) - yyvsp[-2].table->change_db(yyvsp[-1].simple_string); - if (prepare_schema_table(YYTHD, lex, yyvsp[-2].table, SCH_STATISTICS)) + if ((yyvsp[(4) - (5)].simple_string)) + (yyvsp[(3) - (5)].table)->change_db((yyvsp[(4) - (5)].simple_string)); + if (prepare_schema_table(YYTHD, lex, (yyvsp[(3) - (5)].table), SCH_STATISTICS)) MYSQL_YYABORT; } break; case 1342: -#line 7132 "sql_yacc.yy" +#line 7134 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_COLUMN_TYPES; @@ -23235,7 +23570,7 @@ break; case 1343: -#line 7137 "sql_yacc.yy" +#line 7139 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -23244,7 +23579,7 @@ break; case 1344: -#line 7143 "sql_yacc.yy" +#line 7145 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -23252,7 +23587,7 @@ break; case 1345: -#line 7148 "sql_yacc.yy" +#line 7150 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_PRIVILEGES; @@ -23260,32 +23595,32 @@ break; case 1346: -#line 7153 "sql_yacc.yy" +#line 7155 "sql_yacc.yy" { (void) create_select_for_variable("warning_count"); } break; case 1347: -#line 7155 "sql_yacc.yy" +#line 7157 "sql_yacc.yy" { (void) create_select_for_variable("error_count"); } break; case 1348: -#line 7157 "sql_yacc.yy" +#line 7159 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_WARNS;} break; case 1349: -#line 7159 "sql_yacc.yy" +#line 7161 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_ERRORS;} break; case 1350: -#line 7161 "sql_yacc.yy" +#line 7163 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_PROFILES; } break; case 1351: -#line 7163 "sql_yacc.yy" +#line 7165 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23296,46 +23631,46 @@ break; case 1352: -#line 7171 "sql_yacc.yy" +#line 7173 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_STATUS; - lex->option_type= yyvsp[-2].var_type; + lex->option_type= (yyvsp[(1) - (3)].var_type); if (prepare_schema_table(YYTHD, lex, 0, SCH_STATUS)) MYSQL_YYABORT; } break; case 1353: -#line 7180 "sql_yacc.yy" +#line 7182 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; WARN_DEPRECATED("SHOW INNODB STATUS", "SHOW ENGINE INNODB STATUS"); } break; case 1354: -#line 7182 "sql_yacc.yy" +#line 7184 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MUTEX_STATUS; } break; case 1355: -#line 7184 "sql_yacc.yy" +#line 7186 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;} break; case 1356: -#line 7186 "sql_yacc.yy" +#line 7188 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_VARIABLES; - lex->option_type= yyvsp[-2].var_type; + lex->option_type= (yyvsp[(1) - (3)].var_type); if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES)) MYSQL_YYABORT; } break; case 1357: -#line 7195 "sql_yacc.yy" +#line 7197 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23346,7 +23681,7 @@ break; case 1358: -#line 7203 "sql_yacc.yy" +#line 7205 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23357,17 +23692,17 @@ break; case 1359: -#line 7211 "sql_yacc.yy" +#line 7213 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW BDB LOGS", "SHOW ENGINE BDB LOGS"); } break; case 1360: -#line 7213 "sql_yacc.yy" +#line 7215 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW LOGS", "SHOW ENGINE BDB LOGS"); } break; case 1361: -#line 7215 "sql_yacc.yy" +#line 7217 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; @@ -23380,82 +23715,82 @@ break; case 1362: -#line 7225 "sql_yacc.yy" +#line 7227 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; - lex->grant_user=yyvsp[0].lex_user; + lex->grant_user=(yyvsp[(3) - (3)].lex_user); lex->grant_user->password=null_lex_str; } break; case 1363: -#line 7232 "sql_yacc.yy" +#line 7234 "sql_yacc.yy" { Lex->sql_command=SQLCOM_SHOW_CREATE_DB; - Lex->create_info.options=yyvsp[-1].num; - Lex->name=yyvsp[0].lex_str.str; + Lex->create_info.options=(yyvsp[(3) - (4)].num); + Lex->name=(yyvsp[(4) - (4)].lex_str).str; } break; case 1364: -#line 7238 "sql_yacc.yy" +#line 7240 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; - if (!lex->select_lex.add_table_to_list(YYTHD, yyvsp[0].table, NULL,0)) + if (!lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(3) - (3)].table), NULL,0)) MYSQL_YYABORT; lex->only_view= 0; } break; case 1365: -#line 7246 "sql_yacc.yy" +#line 7248 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; - if (!lex->select_lex.add_table_to_list(YYTHD, yyvsp[0].table, NULL, 0)) + if (!lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(3) - (3)].table), NULL, 0)) MYSQL_YYABORT; lex->only_view= 1; } break; case 1366: -#line 7254 "sql_yacc.yy" +#line 7256 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MASTER_STAT; } break; case 1367: -#line 7258 "sql_yacc.yy" +#line 7260 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; } break; case 1368: -#line 7262 "sql_yacc.yy" +#line 7264 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE_PROC; - lex->spname= yyvsp[0].spname; + lex->spname= (yyvsp[(3) - (3)].spname); } break; case 1369: -#line 7269 "sql_yacc.yy" +#line 7271 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE_FUNC; - lex->spname= yyvsp[0].spname; + lex->spname= (yyvsp[(3) - (3)].spname); } break; case 1370: -#line 7276 "sql_yacc.yy" +#line 7278 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23468,7 +23803,7 @@ break; case 1371: -#line 7286 "sql_yacc.yy" +#line 7288 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23481,43 +23816,43 @@ break; case 1372: -#line 7296 "sql_yacc.yy" +#line 7298 "sql_yacc.yy" { #ifdef DBUG_OFF my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; #else Lex->sql_command= SQLCOM_SHOW_PROC_CODE; - Lex->spname= yyvsp[0].spname; + Lex->spname= (yyvsp[(3) - (3)].spname); #endif } break; case 1373: -#line 7306 "sql_yacc.yy" +#line 7308 "sql_yacc.yy" { #ifdef DBUG_OFF my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; #else Lex->sql_command= SQLCOM_SHOW_FUNC_CODE; - Lex->spname= yyvsp[0].spname; + Lex->spname= (yyvsp[(3) - (3)].spname); #endif #ifdef ENABLE_SENNA } break; case 1374: -#line 7317 "sql_yacc.yy" +#line 7319 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_SENNA_STATUS; - Lex->select_lex.db = yyvsp[-1].simple_string; + Lex->select_lex.db = (yyvsp[(3) - (4)].simple_string); #endif } break; case 1375: -#line 7326 "sql_yacc.yy" +#line 7328 "sql_yacc.yy" { switch (Lex->create_info.db_type) { case DB_TYPE_NDBCLUSTER: @@ -23534,7 +23869,7 @@ break; case 1376: -#line 7340 "sql_yacc.yy" +#line 7342 "sql_yacc.yy" { switch (Lex->create_info.db_type) { case DB_TYPE_BERKELEY_DB: @@ -23548,62 +23883,62 @@ break; case 1381: -#line 7360 "sql_yacc.yy" - { yyval.simple_string= 0; } +#line 7362 "sql_yacc.yy" + { (yyval.simple_string)= 0; } break; case 1382: -#line 7361 "sql_yacc.yy" - { yyval.simple_string= yyvsp[0].lex_str.str; } +#line 7363 "sql_yacc.yy" + { (yyval.simple_string)= (yyvsp[(2) - (2)].lex_str).str; } break; case 1383: -#line 7364 "sql_yacc.yy" +#line 7366 "sql_yacc.yy" { Lex->verbose=0; } break; case 1384: -#line 7365 "sql_yacc.yy" +#line 7367 "sql_yacc.yy" { Lex->verbose=1; } break; case 1387: -#line 7372 "sql_yacc.yy" +#line 7374 "sql_yacc.yy" { Lex->mi.log_file_name = 0; } break; case 1388: -#line 7373 "sql_yacc.yy" - { Lex->mi.log_file_name = yyvsp[0].lex_str.str; } +#line 7375 "sql_yacc.yy" + { Lex->mi.log_file_name = (yyvsp[(2) - (2)].lex_str).str; } break; case 1389: -#line 7376 "sql_yacc.yy" +#line 7378 "sql_yacc.yy" { Lex->mi.pos = 4; /* skip magic number */ } break; case 1390: -#line 7377 "sql_yacc.yy" - { Lex->mi.pos = yyvsp[0].ulonglong_number; } +#line 7379 "sql_yacc.yy" + { Lex->mi.pos = (yyvsp[(2) - (2)].ulonglong_number); } break; case 1392: -#line 7382 "sql_yacc.yy" - { Lex->wild= new (YYTHD->mem_root) String(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, +#line 7384 "sql_yacc.yy" + { Lex->wild= new (YYTHD->mem_root) String((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, system_charset_info); } break; case 1393: -#line 7385 "sql_yacc.yy" +#line 7387 "sql_yacc.yy" { - Select->where= yyvsp[0].item; - if (yyvsp[0].item) - yyvsp[0].item->top_level_item(); + Select->where= (yyvsp[(2) - (2)].item); + if ((yyvsp[(2) - (2)].item)) + (yyvsp[(2) - (2)].item)->top_level_item(); } break; case 1394: -#line 7396 "sql_yacc.yy" +#line 7398 "sql_yacc.yy" { LEX *lex= Lex; lex->lock_option= TL_READ; @@ -23613,23 +23948,23 @@ lex->orig_sql_command= SQLCOM_SHOW_FIELDS; lex->select_lex.db= 0; lex->verbose= 0; - if (prepare_schema_table(YYTHD, lex, yyvsp[0].table, SCH_COLUMNS)) + if (prepare_schema_table(YYTHD, lex, (yyvsp[(2) - (2)].table), SCH_COLUMNS)) MYSQL_YYABORT; } break; case 1395: -#line 7408 "sql_yacc.yy" +#line 7410 "sql_yacc.yy" {} break; case 1396: -#line 7410 "sql_yacc.yy" +#line 7412 "sql_yacc.yy" { Lex->describe|= DESCRIBE_NORMAL; } break; case 1397: -#line 7412 "sql_yacc.yy" +#line 7414 "sql_yacc.yy" { LEX *lex=Lex; lex->select_lex.options|= SELECT_DESCRIBE; @@ -23637,117 +23972,117 @@ break; case 1400: -#line 7423 "sql_yacc.yy" +#line 7425 "sql_yacc.yy" {} break; case 1401: -#line 7424 "sql_yacc.yy" +#line 7426 "sql_yacc.yy" { Lex->describe|= DESCRIBE_EXTENDED; } break; case 1402: -#line 7428 "sql_yacc.yy" +#line 7430 "sql_yacc.yy" {} break; case 1403: -#line 7429 "sql_yacc.yy" - { Lex->wild= yyvsp[0].string; } +#line 7431 "sql_yacc.yy" + { Lex->wild= (yyvsp[(1) - (1)].string); } break; case 1404: -#line 7431 "sql_yacc.yy" - { Lex->wild= new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,system_charset_info); } +#line 7433 "sql_yacc.yy" + { Lex->wild= new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); } break; case 1405: -#line 7438 "sql_yacc.yy" +#line 7440 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_FLUSH; lex->type= 0; - lex->no_write_to_binlog= yyvsp[0].num; + lex->no_write_to_binlog= (yyvsp[(2) - (2)].num); } break; case 1406: -#line 7445 "sql_yacc.yy" +#line 7447 "sql_yacc.yy" {} break; case 1409: -#line 7453 "sql_yacc.yy" +#line 7455 "sql_yacc.yy" { Lex->type|= REFRESH_TABLES; } break; case 1410: -#line 7453 "sql_yacc.yy" +#line 7455 "sql_yacc.yy" {} break; case 1411: -#line 7454 "sql_yacc.yy" +#line 7456 "sql_yacc.yy" { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; } break; case 1412: -#line 7455 "sql_yacc.yy" +#line 7457 "sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE_FREE; } break; case 1413: -#line 7456 "sql_yacc.yy" +#line 7458 "sql_yacc.yy" { Lex->type|= REFRESH_HOSTS; } break; case 1414: -#line 7457 "sql_yacc.yy" +#line 7459 "sql_yacc.yy" { Lex->type|= REFRESH_GRANT; } break; case 1415: -#line 7458 "sql_yacc.yy" +#line 7460 "sql_yacc.yy" { Lex->type|= REFRESH_LOG; } break; case 1416: -#line 7459 "sql_yacc.yy" +#line 7461 "sql_yacc.yy" { Lex->type|= REFRESH_STATUS; } break; case 1417: -#line 7460 "sql_yacc.yy" +#line 7462 "sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1418: -#line 7461 "sql_yacc.yy" +#line 7463 "sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1419: -#line 7462 "sql_yacc.yy" +#line 7464 "sql_yacc.yy" { Lex->type|= REFRESH_DES_KEY_FILE; } break; case 1420: -#line 7463 "sql_yacc.yy" +#line 7465 "sql_yacc.yy" { Lex->type|= REFRESH_USER_RESOURCES; } break; case 1421: -#line 7466 "sql_yacc.yy" +#line 7468 "sql_yacc.yy" {;} break; case 1422: -#line 7467 "sql_yacc.yy" +#line 7469 "sql_yacc.yy" {;} break; case 1423: -#line 7471 "sql_yacc.yy" +#line 7473 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RESET; lex->type=0; @@ -23755,27 +24090,27 @@ break; case 1424: -#line 7475 "sql_yacc.yy" +#line 7477 "sql_yacc.yy" {} break; case 1427: -#line 7483 "sql_yacc.yy" +#line 7485 "sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1428: -#line 7484 "sql_yacc.yy" +#line 7486 "sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1429: -#line 7485 "sql_yacc.yy" +#line 7487 "sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE;} break; case 1430: -#line 7489 "sql_yacc.yy" +#line 7491 "sql_yacc.yy" { LEX *lex=Lex; lex->type=0; @@ -23784,67 +24119,67 @@ break; case 1431: -#line 7494 "sql_yacc.yy" +#line 7496 "sql_yacc.yy" {} break; case 1433: -#line 7503 "sql_yacc.yy" +#line 7505 "sql_yacc.yy" { - Lex->to_log = yyvsp[0].lex_str.str; + Lex->to_log = (yyvsp[(2) - (2)].lex_str).str; } break; case 1434: -#line 7507 "sql_yacc.yy" +#line 7509 "sql_yacc.yy" { LEX *lex= Lex; lex->value_list.empty(); - lex->value_list.push_front(yyvsp[0].item); + lex->value_list.push_front((yyvsp[(2) - (2)].item)); lex->sql_command= SQLCOM_PURGE_BEFORE; } break; case 1435: -#line 7518 "sql_yacc.yy" +#line 7520 "sql_yacc.yy" { Lex->sql_command= SQLCOM_KILL; } break; case 1436: -#line 7519 "sql_yacc.yy" +#line 7521 "sql_yacc.yy" { LEX *lex=Lex; lex->value_list.empty(); - lex->value_list.push_front(yyvsp[0].item); + lex->value_list.push_front((yyvsp[(4) - (4)].item)); } break; case 1437: -#line 7526 "sql_yacc.yy" +#line 7528 "sql_yacc.yy" { Lex->type= 0; } break; case 1438: -#line 7527 "sql_yacc.yy" +#line 7529 "sql_yacc.yy" { Lex->type= 0; } break; case 1439: -#line 7528 "sql_yacc.yy" +#line 7530 "sql_yacc.yy" { Lex->type= ONLY_KILL_QUERY; } break; case 1440: -#line 7534 "sql_yacc.yy" +#line 7536 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_CHANGE_DB; - lex->select_lex.db= yyvsp[0].lex_str.str; + lex->select_lex.db= (yyvsp[(2) - (2)].lex_str).str; } break; case 1441: -#line 7543 "sql_yacc.yy" +#line 7545 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -23860,12 +24195,12 @@ break; case 1442: -#line 7556 "sql_yacc.yy" +#line 7558 "sql_yacc.yy" {} break; case 1443: -#line 7559 "sql_yacc.yy" +#line 7561 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -23877,27 +24212,27 @@ WARN_DEPRECATED("LOAD TABLE FROM MASTER", "mysqldump or future " "BACKUP/RESTORE DATABASE facility"); - if (!Select->add_table_to_list(YYTHD, yyvsp[-2].table, NULL, TL_OPTION_UPDATING)) + if (!Select->add_table_to_list(YYTHD, (yyvsp[(3) - (5)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; } break; case 1444: -#line 7576 "sql_yacc.yy" +#line 7578 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_LOAD; - lex->lock_option= yyvsp[-3].lock_type; - lex->local_file= yyvsp[-2].num; + lex->lock_option= (yyvsp[(1) - (4)].lock_type); + lex->local_file= (yyvsp[(2) - (4)].num); lex->duplicates= DUP_ERROR; lex->ignore= 0; - if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str, 0))) + if (!(lex->exchange= new sql_exchange((yyvsp[(4) - (4)].lex_str).str, 0))) MYSQL_YYABORT; } break; case 1445: -#line 7587 "sql_yacc.yy" +#line 7589 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -23907,10 +24242,10 @@ break; case 1446: -#line 7594 "sql_yacc.yy" +#line 7596 "sql_yacc.yy" { LEX *lex=Lex; - if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL, TL_OPTION_UPDATING, + if (!Select->add_table_to_list(YYTHD, (yyvsp[(10) - (10)].table), NULL, TL_OPTION_UPDATING, lex->lock_option)) MYSQL_YYABORT; lex->field_list.empty(); @@ -23920,17 +24255,17 @@ break; case 1447: -#line 7604 "sql_yacc.yy" - { Lex->exchange->cs= yyvsp[0].charset; } +#line 7606 "sql_yacc.yy" + { Lex->exchange->cs= (yyvsp[(12) - (12)].charset); } break; case 1448: -#line 7607 "sql_yacc.yy" +#line 7609 "sql_yacc.yy" {} break; case 1449: -#line 7610 "sql_yacc.yy" +#line 7612 "sql_yacc.yy" { Lex->sql_command = SQLCOM_LOAD_MASTER_DATA; WARN_DEPRECATED("LOAD DATA FROM MASTER", @@ -23940,215 +24275,215 @@ break; case 1450: -#line 7618 "sql_yacc.yy" - { yyval.num=0;} +#line 7620 "sql_yacc.yy" + { (yyval.num)=0;} break; case 1451: -#line 7619 "sql_yacc.yy" - { yyval.num=1;} +#line 7621 "sql_yacc.yy" + { (yyval.num)=1;} break; case 1452: -#line 7622 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_DEFAULT; } +#line 7624 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1453: -#line 7624 "sql_yacc.yy" +#line 7626 "sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* Ignore this option in SP to avoid problem with query cache */ if (Lex->sphead != 0) - yyval.lock_type= TL_WRITE_DEFAULT; + (yyval.lock_type)= TL_WRITE_DEFAULT; else #endif - yyval.lock_type= TL_WRITE_CONCURRENT_INSERT; + (yyval.lock_type)= TL_WRITE_CONCURRENT_INSERT; } break; case 1454: -#line 7635 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_LOW_PRIORITY; } +#line 7637 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1455: -#line 7639 "sql_yacc.yy" +#line 7641 "sql_yacc.yy" { Lex->duplicates=DUP_ERROR; } break; case 1456: -#line 7640 "sql_yacc.yy" +#line 7642 "sql_yacc.yy" { Lex->duplicates=DUP_REPLACE; } break; case 1457: -#line 7641 "sql_yacc.yy" +#line 7643 "sql_yacc.yy" { Lex->ignore= 1; } break; case 1462: -#line 7653 "sql_yacc.yy" +#line 7655 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->field_term= yyvsp[0].string; + Lex->exchange->field_term= (yyvsp[(3) - (3)].string); } break; case 1463: -#line 7658 "sql_yacc.yy" +#line 7660 "sql_yacc.yy" { LEX *lex= Lex; DBUG_ASSERT(lex->exchange != 0); - lex->exchange->enclosed= yyvsp[0].string; + lex->exchange->enclosed= (yyvsp[(4) - (4)].string); lex->exchange->opt_enclosed= 1; } break; case 1464: -#line 7665 "sql_yacc.yy" +#line 7667 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->enclosed= yyvsp[0].string; + Lex->exchange->enclosed= (yyvsp[(3) - (3)].string); } break; case 1465: -#line 7670 "sql_yacc.yy" +#line 7672 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->escaped= yyvsp[0].string; + Lex->exchange->escaped= (yyvsp[(3) - (3)].string); } break; case 1470: -#line 7685 "sql_yacc.yy" +#line 7687 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->line_term= yyvsp[0].string; + Lex->exchange->line_term= (yyvsp[(3) - (3)].string); } break; case 1471: -#line 7690 "sql_yacc.yy" +#line 7692 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->line_start= yyvsp[0].string; + Lex->exchange->line_start= (yyvsp[(3) - (3)].string); } break; case 1473: -#line 7698 "sql_yacc.yy" +#line 7700 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->skip_lines= atol(yyvsp[-1].lex_str.str); + Lex->exchange->skip_lines= atol((yyvsp[(2) - (3)].lex_str).str); } break; case 1474: -#line 7704 "sql_yacc.yy" +#line 7706 "sql_yacc.yy" { } break; case 1475: -#line 7705 "sql_yacc.yy" +#line 7707 "sql_yacc.yy" { } break; case 1476: -#line 7706 "sql_yacc.yy" +#line 7708 "sql_yacc.yy" { } break; case 1477: -#line 7710 "sql_yacc.yy" - { Lex->field_list.push_back(yyvsp[0].item); } +#line 7712 "sql_yacc.yy" + { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1478: -#line 7712 "sql_yacc.yy" - { Lex->field_list.push_back(yyvsp[0].item); } +#line 7714 "sql_yacc.yy" + { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1479: -#line 7716 "sql_yacc.yy" - {yyval.item= yyvsp[0].item;} +#line 7718 "sql_yacc.yy" + {(yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1480: -#line 7718 "sql_yacc.yy" - { yyval.item= new Item_user_var_as_out_param(yyvsp[0].lex_str); } +#line 7720 "sql_yacc.yy" + { (yyval.item)= new Item_user_var_as_out_param((yyvsp[(2) - (2)].lex_str)); } break; case 1481: -#line 7722 "sql_yacc.yy" +#line 7724 "sql_yacc.yy" { } break; case 1482: -#line 7723 "sql_yacc.yy" +#line 7725 "sql_yacc.yy" { } break; case 1483: -#line 7730 "sql_yacc.yy" +#line 7732 "sql_yacc.yy" { THD *thd= YYTHD; - yyval.item = new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,thd->variables.collation_connection); + (yyval.item) = new Item_string((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,thd->variables.collation_connection); } break; case 1484: -#line 7735 "sql_yacc.yy" - { yyval.item= new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,national_charset_info); } +#line 7737 "sql_yacc.yy" + { (yyval.item)= new Item_string((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,national_charset_info); } break; case 1485: -#line 7737 "sql_yacc.yy" - { yyval.item = new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,Lex->underscore_charset); } +#line 7739 "sql_yacc.yy" + { (yyval.item) = new Item_string((yyvsp[(2) - (2)].lex_str).str,(yyvsp[(2) - (2)].lex_str).length,Lex->underscore_charset); } break; case 1486: -#line 7739 "sql_yacc.yy" - { ((Item_string*) yyvsp[-1].item)->append(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); } +#line 7741 "sql_yacc.yy" + { ((Item_string*) (yyvsp[(1) - (2)].item))->append((yyvsp[(2) - (2)].lex_str).str,(yyvsp[(2) - (2)].lex_str).length); } break; case 1487: -#line 7744 "sql_yacc.yy" - { yyval.string= new (YYTHD->mem_root) String(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,YYTHD->variables.collation_connection); } +#line 7746 "sql_yacc.yy" + { (yyval.string)= new (YYTHD->mem_root) String((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,YYTHD->variables.collation_connection); } break; case 1488: -#line 7746 "sql_yacc.yy" +#line 7748 "sql_yacc.yy" { - Item *tmp= new Item_hex_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + Item *tmp= new Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); /* it is OK only emulate fix_fields, because we need only value of constant */ - yyval.string= tmp ? + (yyval.string)= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : (String*) 0; } break; case 1489: -#line 7757 "sql_yacc.yy" +#line 7759 "sql_yacc.yy" { - Item *tmp= new Item_bin_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + Item *tmp= new Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); /* it is OK only emulate fix_fields, because we need only value of constant */ - yyval.string= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : + (yyval.string)= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : (String*) 0; } break; case 1490: -#line 7770 "sql_yacc.yy" +#line 7772 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24160,7 +24495,7 @@ MYSQL_YYABORT; } item= new Item_param((uint) (lip->tok_start - thd->query)); - if (!(yyval.item= item) || lex->param_list.push_back(item)) + if (!((yyval.item)= item) || lex->param_list.push_back(item)) { my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); MYSQL_YYABORT; @@ -24169,65 +24504,65 @@ break; case 1491: -#line 7790 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7792 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1492: -#line 7791 "sql_yacc.yy" - { yyval.item = yyvsp[0].item_num; } +#line 7793 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(2) - (2)].item_num); } break; case 1493: -#line 7793 "sql_yacc.yy" +#line 7795 "sql_yacc.yy" { - yyvsp[0].item_num->max_length++; - yyval.item= yyvsp[0].item_num->neg(); + (yyvsp[(2) - (2)].item_num)->max_length++; + (yyval.item)= (yyvsp[(2) - (2)].item_num)->neg(); } break; case 1494: -#line 7801 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7803 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1495: -#line 7802 "sql_yacc.yy" - { yyval.item = yyvsp[0].item_num; } +#line 7804 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(1) - (1)].item_num); } break; case 1496: -#line 7804 "sql_yacc.yy" +#line 7806 "sql_yacc.yy" { - yyval.item = new Item_null(); + (yyval.item) = new Item_null(); YYTHD->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT; } break; case 1497: -#line 7808 "sql_yacc.yy" - { yyval.item= new Item_int((char*) "FALSE",0,1); } +#line 7810 "sql_yacc.yy" + { (yyval.item)= new Item_int((char*) "FALSE",0,1); } break; case 1498: -#line 7809 "sql_yacc.yy" - { yyval.item= new Item_int((char*) "TRUE",1,1); } +#line 7811 "sql_yacc.yy" + { (yyval.item)= new Item_int((char*) "TRUE",1,1); } break; case 1499: -#line 7810 "sql_yacc.yy" - { yyval.item = new Item_hex_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length);} +#line 7812 "sql_yacc.yy" + { (yyval.item) = new Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);} break; case 1500: -#line 7811 "sql_yacc.yy" - { yyval.item= new Item_bin_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 7813 "sql_yacc.yy" + { (yyval.item)= new Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1501: -#line 7813 "sql_yacc.yy" +#line 7815 "sql_yacc.yy" { - Item *tmp= new Item_hex_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + Item *tmp= new Item_hex_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); /* it is OK only emulate fix_fieds, because we need only value of constant @@ -24235,16 +24570,16 @@ String *str= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : (String*) 0; - yyval.item= new Item_string(str ? str->ptr() : "", + (yyval.item)= new Item_string(str ? str->ptr() : "", str ? str->length() : 0, Lex->underscore_charset); } break; case 1502: -#line 7827 "sql_yacc.yy" +#line 7829 "sql_yacc.yy" { - Item *tmp= new Item_bin_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + Item *tmp= new Item_bin_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); /* it is OK only emulate fix_fieds, because we need only value of constant @@ -24252,46 +24587,46 @@ String *str= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : (String*) 0; - yyval.item= new Item_string(str ? str->ptr() : "", + (yyval.item)= new Item_string(str ? str->ptr() : "", str ? str->length() : 0, Lex->charset); } break; case 1503: -#line 7840 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7842 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1504: -#line 7841 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7843 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1505: -#line 7842 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7844 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1506: -#line 7845 "sql_yacc.yy" - { int error; yyval.item_num = new Item_int(yyvsp[0].lex_str.str, (longlong) my_strtoll10(yyvsp[0].lex_str.str, NULL, &error), yyvsp[0].lex_str.length); } +#line 7847 "sql_yacc.yy" + { int error; (yyval.item_num) = new Item_int((yyvsp[(1) - (1)].lex_str).str, (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error), (yyvsp[(1) - (1)].lex_str).length); } break; case 1507: -#line 7846 "sql_yacc.yy" - { int error; yyval.item_num = new Item_int(yyvsp[0].lex_str.str, (longlong) my_strtoll10(yyvsp[0].lex_str.str, NULL, &error), yyvsp[0].lex_str.length); } +#line 7848 "sql_yacc.yy" + { int error; (yyval.item_num) = new Item_int((yyvsp[(1) - (1)].lex_str).str, (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error), (yyvsp[(1) - (1)].lex_str).length); } break; case 1508: -#line 7847 "sql_yacc.yy" - { yyval.item_num = new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 7849 "sql_yacc.yy" + { (yyval.item_num) = new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1509: -#line 7849 "sql_yacc.yy" +#line 7851 "sql_yacc.yy" { - yyval.item_num= new Item_decimal(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, YYTHD->charset()); + (yyval.item_num)= new Item_decimal((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, YYTHD->charset()); if (YYTHD->net.report_error) { MYSQL_YYABORT; @@ -24300,9 +24635,9 @@ break; case 1510: -#line 7857 "sql_yacc.yy" +#line 7859 "sql_yacc.yy" { - yyval.item_num = new Item_float(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + (yyval.item_num) = new Item_float((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (YYTHD->net.report_error) { MYSQL_YYABORT; @@ -24311,49 +24646,49 @@ break; case 1511: -#line 7871 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 7873 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1512: -#line 7872 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 7874 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1513: -#line 7876 "sql_yacc.yy" +#line 7878 "sql_yacc.yy" { SELECT_LEX *sel= Select; - yyval.item = new Item_field(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, "*"); + (yyval.item) = new Item_field(Lex->current_context(), NullS, (yyvsp[(1) - (3)].lex_str).str, "*"); sel->with_wild++; } break; case 1514: -#line 7882 "sql_yacc.yy" +#line 7884 "sql_yacc.yy" { SELECT_LEX *sel= Select; - yyval.item = new Item_field(Lex->current_context(), (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str), - yyvsp[-2].lex_str.str,"*"); + (yyval.item) = new Item_field(Lex->current_context(), (YYTHD->client_capabilities & + CLIENT_NO_SCHEMA ? NullS : (yyvsp[(1) - (5)].lex_str).str), + (yyvsp[(3) - (5)].lex_str).str,"*"); sel->with_wild++; } break; case 1515: -#line 7892 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 7894 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1516: -#line 7896 "sql_yacc.yy" +#line 7898 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; Lex_input_stream *lip= thd->m_lip; sp_variable_t *spv; sp_pcontext *spc = lex->spcont; - if (spc && (spv = spc->find_variable(&yyvsp[0].lex_str))) + if (spc && (spv = spc->find_variable(&(yyvsp[(1) - (1)].lex_str)))) { /* We're compiling a stored procedure and found a variable */ if (! lex->parsing_options.allows_variable) @@ -24363,50 +24698,50 @@ } Item_splocal *splocal; - splocal= new Item_splocal(yyvsp[0].lex_str, spv->offset, spv->type, + splocal= new Item_splocal((yyvsp[(1) - (1)].lex_str), spv->offset, spv->type, lip->tok_start_prev - lex->sphead->m_tmp_query); #ifndef DBUG_OFF if (splocal) splocal->m_sp= lex->sphead; #endif - yyval.item = (Item*) splocal; + (yyval.item) = (Item*) splocal; lex->safe_to_cache_query=0; } else { SELECT_LEX *sel=Select; - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, NullS, yyvsp[0].lex_str.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, NullS, yyvsp[0].lex_str.str); + (Item*) new Item_field(Lex->current_context(), NullS, NullS, (yyvsp[(1) - (1)].lex_str).str) : + (Item*) new Item_ref(Lex->current_context(), NullS, NullS, (yyvsp[(1) - (1)].lex_str).str); } } break; case 1517: -#line 7931 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 7933 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1518: -#line 7936 "sql_yacc.yy" +#line 7938 "sql_yacc.yy" { SELECT_LEX *sel=Select; - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, NullS, yyvsp[0].lex_str.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, NullS, yyvsp[0].lex_str.str); + (Item*) new Item_field(Lex->current_context(), NullS, NullS, (yyvsp[(1) - (1)].lex_str).str) : + (Item*) new Item_ref(Lex->current_context(), NullS, NullS, (yyvsp[(1) - (1)].lex_str).str); } break; case 1519: -#line 7943 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 7945 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1520: -#line 7948 "sql_yacc.yy" +#line 7950 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24417,11 +24752,11 @@ should be changed in future. */ if (lex->sphead && lex->sphead->m_type == TYPE_ENUM_TRIGGER && - (!my_strcasecmp(system_charset_info, yyvsp[-2].lex_str.str, "NEW") || - !my_strcasecmp(system_charset_info, yyvsp[-2].lex_str.str, "OLD"))) + (!my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "NEW") || + !my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "OLD"))) { Item_trigger_field *trg_fld; - bool new_row= (yyvsp[-2].lex_str.str[0]=='N' || yyvsp[-2].lex_str.str[0]=='n'); + bool new_row= ((yyvsp[(1) - (3)].lex_str).str[0]=='N' || (yyvsp[(1) - (3)].lex_str).str[0]=='n'); if (lex->trg_chistics.event == TRG_EVENT_INSERT && !new_row) @@ -24446,7 +24781,7 @@ new_row ? Item_trigger_field::NEW_ROW: Item_trigger_field::OLD_ROW, - yyvsp[0].lex_str.str, + (yyvsp[(3) - (3)].lex_str).str, SELECT_ACL, read_only))) MYSQL_YYABORT; @@ -24458,7 +24793,7 @@ lex->trg_table_fields.link_in_list((byte *)trg_fld, (byte**)&trg_fld->next_trg_field); - yyval.item= (Item *)trg_fld; + (yyval.item)= (Item *)trg_fld; } else { @@ -24466,18 +24801,18 @@ if (sel->no_table_names_allowed) { my_error(ER_TABLENAME_NOT_ALLOWED_HERE, - MYF(0), yyvsp[-2].lex_str.str, thd->where); + MYF(0), (yyvsp[(1) - (3)].lex_str).str, thd->where); } - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str); + (Item*) new Item_field(Lex->current_context(), NullS, (yyvsp[(1) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).str) : + (Item*) new Item_ref(Lex->current_context(), NullS, (yyvsp[(1) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).str); } } break; case 1521: -#line 8016 "sql_yacc.yy" +#line 8018 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24485,17 +24820,17 @@ if (sel->no_table_names_allowed) { my_error(ER_TABLENAME_NOT_ALLOWED_HERE, - MYF(0), yyvsp[-2].lex_str.str, thd->where); + MYF(0), (yyvsp[(2) - (4)].lex_str).str, thd->where); } - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str); + (Item*) new Item_field(Lex->current_context(), NullS, (yyvsp[(2) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).str) : + (Item*) new Item_ref(Lex->current_context(), NullS, (yyvsp[(2) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).str); } break; case 1522: -#line 8031 "sql_yacc.yy" +#line 8033 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24503,1605 +24838,1605 @@ if (sel->no_table_names_allowed) { my_error(ER_TABLENAME_NOT_ALLOWED_HERE, - MYF(0), yyvsp[-2].lex_str.str, thd->where); + MYF(0), (yyvsp[(3) - (5)].lex_str).str, thd->where); } - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? (Item*) new Item_field(Lex->current_context(), (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str), - yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str) : + CLIENT_NO_SCHEMA ? NullS : (yyvsp[(1) - (5)].lex_str).str), + (yyvsp[(3) - (5)].lex_str).str, (yyvsp[(5) - (5)].lex_str).str) : (Item*) new Item_ref(Lex->current_context(), (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str), - yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str); + CLIENT_NO_SCHEMA ? NullS : (yyvsp[(1) - (5)].lex_str).str), + (yyvsp[(3) - (5)].lex_str).str, (yyvsp[(5) - (5)].lex_str).str); } break; case 1523: -#line 8054 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8056 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1524: -#line 8056 "sql_yacc.yy" +#line 8058 "sql_yacc.yy" { TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; - if (my_strcasecmp(table_alias_charset, yyvsp[-4].lex_str.str, table->db)) + if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (5)].lex_str).str, table->db)) { - my_error(ER_WRONG_DB_NAME, MYF(0), yyvsp[-4].lex_str.str); + my_error(ER_WRONG_DB_NAME, MYF(0), (yyvsp[(1) - (5)].lex_str).str); MYSQL_YYABORT; } - if (my_strcasecmp(table_alias_charset, yyvsp[-2].lex_str.str, + if (my_strcasecmp(table_alias_charset, (yyvsp[(3) - (5)].lex_str).str, table->table_name)) { - my_error(ER_WRONG_TABLE_NAME, MYF(0), yyvsp[-2].lex_str.str); + my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(3) - (5)].lex_str).str); MYSQL_YYABORT; } - yyval.lex_str=yyvsp[0].lex_str; + (yyval.lex_str)=(yyvsp[(5) - (5)].lex_str); } break; case 1525: -#line 8072 "sql_yacc.yy" +#line 8074 "sql_yacc.yy" { TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; - if (my_strcasecmp(table_alias_charset, yyvsp[-2].lex_str.str, table->alias)) + if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (3)].lex_str).str, table->alias)) { - my_error(ER_WRONG_TABLE_NAME, MYF(0), yyvsp[-2].lex_str.str); + my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(1) - (3)].lex_str).str); MYSQL_YYABORT; } - yyval.lex_str=yyvsp[0].lex_str; + (yyval.lex_str)=(yyvsp[(3) - (3)].lex_str); } break; case 1526: -#line 8081 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8083 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str);} break; case 1527: -#line 8084 "sql_yacc.yy" - { yyval.table=new Table_ident(yyvsp[0].lex_str); } +#line 8086 "sql_yacc.yy" + { (yyval.table)=new Table_ident((yyvsp[(1) - (1)].lex_str)); } break; case 1528: -#line 8085 "sql_yacc.yy" - { yyval.table=new Table_ident(YYTHD, yyvsp[-2].lex_str,yyvsp[0].lex_str,0);} +#line 8087 "sql_yacc.yy" + { (yyval.table)=new Table_ident(YYTHD, (yyvsp[(1) - (3)].lex_str),(yyvsp[(3) - (3)].lex_str),0);} break; case 1529: -#line 8086 "sql_yacc.yy" - { yyval.table=new Table_ident(yyvsp[0].lex_str);} +#line 8088 "sql_yacc.yy" + { (yyval.table)=new Table_ident((yyvsp[(2) - (2)].lex_str));} break; case 1530: -#line 8090 "sql_yacc.yy" - { LEX_STRING db={(char*) any_db,3}; yyval.table=new Table_ident(YYTHD, db,yyvsp[0].lex_str,0); } +#line 8092 "sql_yacc.yy" + { LEX_STRING db={(char*) any_db,3}; (yyval.table)=new Table_ident(YYTHD, db,(yyvsp[(1) - (1)].lex_str),0); } break; case 1531: -#line 8094 "sql_yacc.yy" - { yyval.lex_str= yyvsp[0].lex_str; } +#line 8096 "sql_yacc.yy" + { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 1532: -#line 8096 "sql_yacc.yy" +#line 8098 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_system_charset) { CHARSET_INFO *cs= system_charset_info; int dummy_error; - uint wlen= cs->cset->well_formed_len(cs, yyvsp[0].lex_str.str, - yyvsp[0].lex_str.str+yyvsp[0].lex_str.length, - yyvsp[0].lex_str.length, &dummy_error); - if (wlen < yyvsp[0].lex_str.length) + uint wlen= cs->cset->well_formed_len(cs, (yyvsp[(1) - (1)].lex_str).str, + (yyvsp[(1) - (1)].lex_str).str+(yyvsp[(1) - (1)].lex_str).length, + (yyvsp[(1) - (1)].lex_str).length, &dummy_error); + if (wlen < (yyvsp[(1) - (1)].lex_str).length) { my_error(ER_INVALID_CHARACTER_STRING, MYF(0), - cs->csname, yyvsp[0].lex_str.str + wlen); + cs->csname, (yyvsp[(1) - (1)].lex_str).str + wlen); MYSQL_YYABORT; } - yyval.lex_str= yyvsp[0].lex_str; + (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } else - thd->convert_string(&yyval.lex_str, system_charset_info, - yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset()); + thd->convert_string(&(yyval.lex_str), system_charset_info, + (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()); } break; case 1533: -#line 8121 "sql_yacc.yy" +#line 8123 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_system_charset) - yyval.lex_str= yyvsp[0].lex_str; + (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); else - thd->convert_string(&yyval.lex_str, system_charset_info, - yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset()); + thd->convert_string(&(yyval.lex_str), system_charset_info, + (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()); } break; case 1534: -#line 8133 "sql_yacc.yy" +#line 8135 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_collation_connection) - yyval.lex_str= yyvsp[0].lex_str; + (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); else - thd->convert_string(&yyval.lex_str, thd->variables.collation_connection, - yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset()); + thd->convert_string(&(yyval.lex_str), thd->variables.collation_connection, + (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()); } break; case 1535: -#line 8146 "sql_yacc.yy" +#line 8148 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_character_set_filesystem) - yyval.lex_str= yyvsp[0].lex_str; + (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); else - thd->convert_string(&yyval.lex_str, thd->variables.character_set_filesystem, - yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset()); + thd->convert_string(&(yyval.lex_str), thd->variables.character_set_filesystem, + (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()); } break; case 1536: -#line 8157 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 8159 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1537: -#line 8159 "sql_yacc.yy" +#line 8161 "sql_yacc.yy" { THD *thd= YYTHD; - yyval.lex_str.str= thd->strmake(yyvsp[0].symbol.str, yyvsp[0].symbol.length); - yyval.lex_str.length= yyvsp[0].symbol.length; + (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); + (yyval.lex_str).length= (yyvsp[(1) - (1)].symbol).length; } break; case 1538: -#line 8167 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 8169 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1539: -#line 8169 "sql_yacc.yy" +#line 8171 "sql_yacc.yy" { THD *thd= YYTHD; - yyval.lex_str.str= thd->strmake(yyvsp[0].symbol.str, yyvsp[0].symbol.length); - yyval.lex_str.length= yyvsp[0].symbol.length; + (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); + (yyval.lex_str).length= (yyvsp[(1) - (1)].symbol).length; } break; case 1540: -#line 8177 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8179 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1541: -#line 8178 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8180 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1542: -#line 8179 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8181 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1543: -#line 8183 "sql_yacc.yy" +#line 8185 "sql_yacc.yy" { THD *thd= YYTHD; - if (!(yyval.lex_user=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) + if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; - yyval.lex_user->user = yyvsp[0].lex_str; - yyval.lex_user->host.str= (char *) "%"; - yyval.lex_user->host.length= 1; + (yyval.lex_user)->user = (yyvsp[(1) - (1)].lex_str); + (yyval.lex_user)->host.str= (char *) "%"; + (yyval.lex_user)->host.length= 1; - if (check_string_length(&yyval.lex_user->user, + if (check_string_length(&(yyval.lex_user)->user, ER(ER_USERNAME), USERNAME_LENGTH)) MYSQL_YYABORT; } break; case 1544: -#line 8196 "sql_yacc.yy" +#line 8198 "sql_yacc.yy" { THD *thd= YYTHD; - if (!(yyval.lex_user=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) + if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; - yyval.lex_user->user = yyvsp[-2].lex_str; yyval.lex_user->host=yyvsp[0].lex_str; + (yyval.lex_user)->user = (yyvsp[(1) - (3)].lex_str); (yyval.lex_user)->host=(yyvsp[(3) - (3)].lex_str); - if (check_string_length(&yyval.lex_user->user, + if (check_string_length(&(yyval.lex_user)->user, ER(ER_USERNAME), USERNAME_LENGTH) || - check_string_length(&yyval.lex_user->host, + check_string_length(&(yyval.lex_user)->host, ER(ER_HOSTNAME), HOSTNAME_LENGTH)) MYSQL_YYABORT; } break; case 1545: -#line 8209 "sql_yacc.yy" +#line 8211 "sql_yacc.yy" { - if (!(yyval.lex_user=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user)))) + if (!((yyval.lex_user)=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; /* empty LEX_USER means current_user and will be handled in the get_current_user() function later */ - bzero(yyval.lex_user, sizeof(LEX_USER)); + bzero((yyval.lex_user), sizeof(LEX_USER)); } break; case 1546: -#line 8222 "sql_yacc.yy" +#line 8224 "sql_yacc.yy" {} break; case 1547: -#line 8223 "sql_yacc.yy" +#line 8225 "sql_yacc.yy" {} break; case 1548: -#line 8224 "sql_yacc.yy" +#line 8226 "sql_yacc.yy" {} break; case 1549: -#line 8225 "sql_yacc.yy" +#line 8227 "sql_yacc.yy" {} break; case 1550: -#line 8226 "sql_yacc.yy" +#line 8228 "sql_yacc.yy" {} break; case 1551: -#line 8227 "sql_yacc.yy" +#line 8229 "sql_yacc.yy" {} break; case 1552: -#line 8228 "sql_yacc.yy" +#line 8230 "sql_yacc.yy" {} break; case 1553: -#line 8229 "sql_yacc.yy" +#line 8231 "sql_yacc.yy" {} break; case 1554: -#line 8230 "sql_yacc.yy" +#line 8232 "sql_yacc.yy" {} break; case 1555: -#line 8231 "sql_yacc.yy" +#line 8233 "sql_yacc.yy" {} break; case 1556: -#line 8232 "sql_yacc.yy" +#line 8234 "sql_yacc.yy" {} break; case 1557: -#line 8233 "sql_yacc.yy" +#line 8235 "sql_yacc.yy" {} break; case 1558: -#line 8234 "sql_yacc.yy" +#line 8236 "sql_yacc.yy" {} break; case 1559: -#line 8235 "sql_yacc.yy" +#line 8237 "sql_yacc.yy" {} break; case 1560: -#line 8236 "sql_yacc.yy" +#line 8238 "sql_yacc.yy" {} break; case 1561: -#line 8237 "sql_yacc.yy" +#line 8239 "sql_yacc.yy" {} break; case 1562: -#line 8238 "sql_yacc.yy" +#line 8240 "sql_yacc.yy" {} break; case 1563: -#line 8239 "sql_yacc.yy" +#line 8241 "sql_yacc.yy" {} break; case 1564: -#line 8240 "sql_yacc.yy" +#line 8242 "sql_yacc.yy" {} break; case 1565: -#line 8241 "sql_yacc.yy" +#line 8243 "sql_yacc.yy" {} break; case 1566: -#line 8242 "sql_yacc.yy" +#line 8244 "sql_yacc.yy" {} break; case 1567: -#line 8243 "sql_yacc.yy" +#line 8245 "sql_yacc.yy" {} break; case 1568: -#line 8244 "sql_yacc.yy" +#line 8246 "sql_yacc.yy" {} break; case 1569: -#line 8245 "sql_yacc.yy" +#line 8247 "sql_yacc.yy" {} break; case 1570: -#line 8246 "sql_yacc.yy" +#line 8248 "sql_yacc.yy" {} break; case 1571: -#line 8247 "sql_yacc.yy" +#line 8249 "sql_yacc.yy" {} break; case 1572: -#line 8248 "sql_yacc.yy" +#line 8250 "sql_yacc.yy" {} break; case 1573: -#line 8249 "sql_yacc.yy" +#line 8251 "sql_yacc.yy" {} break; case 1574: -#line 8250 "sql_yacc.yy" +#line 8252 "sql_yacc.yy" {} break; case 1575: -#line 8251 "sql_yacc.yy" +#line 8253 "sql_yacc.yy" {} break; case 1576: -#line 8252 "sql_yacc.yy" +#line 8254 "sql_yacc.yy" {} break; case 1577: -#line 8253 "sql_yacc.yy" +#line 8255 "sql_yacc.yy" {} break; case 1578: -#line 8254 "sql_yacc.yy" +#line 8256 "sql_yacc.yy" {} break; case 1579: -#line 8255 "sql_yacc.yy" +#line 8257 "sql_yacc.yy" {} break; case 1580: -#line 8256 "sql_yacc.yy" +#line 8258 "sql_yacc.yy" {} break; case 1581: -#line 8257 "sql_yacc.yy" +#line 8259 "sql_yacc.yy" {} break; case 1582: -#line 8258 "sql_yacc.yy" +#line 8260 "sql_yacc.yy" {} break; case 1583: -#line 8268 "sql_yacc.yy" +#line 8270 "sql_yacc.yy" {} break; case 1584: -#line 8269 "sql_yacc.yy" +#line 8271 "sql_yacc.yy" {} break; case 1585: -#line 8270 "sql_yacc.yy" +#line 8272 "sql_yacc.yy" {} break; case 1586: -#line 8271 "sql_yacc.yy" +#line 8273 "sql_yacc.yy" {} break; case 1587: -#line 8272 "sql_yacc.yy" +#line 8274 "sql_yacc.yy" {} break; case 1588: -#line 8273 "sql_yacc.yy" +#line 8275 "sql_yacc.yy" {} break; case 1589: -#line 8274 "sql_yacc.yy" +#line 8276 "sql_yacc.yy" {} break; case 1590: -#line 8275 "sql_yacc.yy" +#line 8277 "sql_yacc.yy" {} break; case 1591: -#line 8276 "sql_yacc.yy" +#line 8278 "sql_yacc.yy" {} break; case 1592: -#line 8277 "sql_yacc.yy" +#line 8279 "sql_yacc.yy" {} break; case 1593: -#line 8278 "sql_yacc.yy" +#line 8280 "sql_yacc.yy" {} break; case 1594: -#line 8279 "sql_yacc.yy" +#line 8281 "sql_yacc.yy" {} break; case 1595: -#line 8280 "sql_yacc.yy" +#line 8282 "sql_yacc.yy" {} break; case 1596: -#line 8281 "sql_yacc.yy" +#line 8283 "sql_yacc.yy" {} break; case 1597: -#line 8282 "sql_yacc.yy" +#line 8284 "sql_yacc.yy" {} break; case 1598: -#line 8283 "sql_yacc.yy" +#line 8285 "sql_yacc.yy" {} break; case 1599: -#line 8284 "sql_yacc.yy" +#line 8286 "sql_yacc.yy" {} break; case 1600: -#line 8285 "sql_yacc.yy" +#line 8287 "sql_yacc.yy" {} break; case 1601: -#line 8286 "sql_yacc.yy" +#line 8288 "sql_yacc.yy" {} break; case 1602: -#line 8287 "sql_yacc.yy" +#line 8289 "sql_yacc.yy" {} break; case 1603: -#line 8288 "sql_yacc.yy" +#line 8290 "sql_yacc.yy" {} break; case 1604: -#line 8289 "sql_yacc.yy" +#line 8291 "sql_yacc.yy" {} break; case 1605: -#line 8290 "sql_yacc.yy" +#line 8292 "sql_yacc.yy" {} break; case 1606: -#line 8291 "sql_yacc.yy" +#line 8293 "sql_yacc.yy" {} break; case 1607: -#line 8292 "sql_yacc.yy" +#line 8294 "sql_yacc.yy" {} break; case 1608: -#line 8293 "sql_yacc.yy" +#line 8295 "sql_yacc.yy" {} break; case 1609: -#line 8294 "sql_yacc.yy" +#line 8296 "sql_yacc.yy" {} break; case 1610: -#line 8295 "sql_yacc.yy" +#line 8297 "sql_yacc.yy" {} break; case 1611: -#line 8296 "sql_yacc.yy" +#line 8298 "sql_yacc.yy" {} break; case 1612: -#line 8297 "sql_yacc.yy" +#line 8299 "sql_yacc.yy" {} break; case 1613: -#line 8298 "sql_yacc.yy" +#line 8300 "sql_yacc.yy" {} break; case 1614: -#line 8299 "sql_yacc.yy" +#line 8301 "sql_yacc.yy" {} break; case 1615: -#line 8300 "sql_yacc.yy" +#line 8302 "sql_yacc.yy" {} break; case 1616: -#line 8301 "sql_yacc.yy" +#line 8303 "sql_yacc.yy" {} break; case 1617: -#line 8302 "sql_yacc.yy" +#line 8304 "sql_yacc.yy" {} break; case 1618: -#line 8303 "sql_yacc.yy" +#line 8305 "sql_yacc.yy" {} break; case 1619: -#line 8304 "sql_yacc.yy" +#line 8306 "sql_yacc.yy" {} break; case 1620: -#line 8305 "sql_yacc.yy" +#line 8307 "sql_yacc.yy" {} break; case 1621: -#line 8306 "sql_yacc.yy" +#line 8308 "sql_yacc.yy" {} break; case 1622: -#line 8307 "sql_yacc.yy" +#line 8309 "sql_yacc.yy" {} break; case 1623: -#line 8308 "sql_yacc.yy" +#line 8310 "sql_yacc.yy" {} break; case 1624: -#line 8309 "sql_yacc.yy" +#line 8311 "sql_yacc.yy" {} break; case 1625: -#line 8310 "sql_yacc.yy" +#line 8312 "sql_yacc.yy" {} break; case 1626: -#line 8311 "sql_yacc.yy" +#line 8313 "sql_yacc.yy" {} break; case 1627: -#line 8312 "sql_yacc.yy" +#line 8314 "sql_yacc.yy" {} break; case 1628: -#line 8313 "sql_yacc.yy" +#line 8315 "sql_yacc.yy" {} break; case 1629: -#line 8314 "sql_yacc.yy" +#line 8316 "sql_yacc.yy" {} break; case 1630: -#line 8315 "sql_yacc.yy" +#line 8317 "sql_yacc.yy" {} break; case 1631: -#line 8316 "sql_yacc.yy" +#line 8318 "sql_yacc.yy" {} break; case 1632: -#line 8317 "sql_yacc.yy" +#line 8319 "sql_yacc.yy" {} break; case 1633: -#line 8318 "sql_yacc.yy" +#line 8320 "sql_yacc.yy" {} break; case 1634: -#line 8319 "sql_yacc.yy" +#line 8321 "sql_yacc.yy" {} break; case 1635: -#line 8320 "sql_yacc.yy" +#line 8322 "sql_yacc.yy" {} break; case 1636: -#line 8321 "sql_yacc.yy" +#line 8323 "sql_yacc.yy" {} break; case 1637: -#line 8322 "sql_yacc.yy" +#line 8324 "sql_yacc.yy" {} break; case 1638: -#line 8323 "sql_yacc.yy" +#line 8325 "sql_yacc.yy" {} break; case 1639: -#line 8324 "sql_yacc.yy" +#line 8326 "sql_yacc.yy" {} break; case 1640: -#line 8325 "sql_yacc.yy" +#line 8327 "sql_yacc.yy" {} break; case 1641: -#line 8326 "sql_yacc.yy" +#line 8328 "sql_yacc.yy" {} break; case 1642: -#line 8327 "sql_yacc.yy" +#line 8329 "sql_yacc.yy" {} break; case 1643: -#line 8328 "sql_yacc.yy" +#line 8330 "sql_yacc.yy" {} break; case 1644: -#line 8329 "sql_yacc.yy" +#line 8331 "sql_yacc.yy" {} break; case 1645: -#line 8330 "sql_yacc.yy" +#line 8332 "sql_yacc.yy" {} break; case 1646: -#line 8331 "sql_yacc.yy" +#line 8333 "sql_yacc.yy" {} break; case 1647: -#line 8332 "sql_yacc.yy" +#line 8334 "sql_yacc.yy" {} break; case 1648: -#line 8333 "sql_yacc.yy" +#line 8335 "sql_yacc.yy" {} break; case 1649: -#line 8334 "sql_yacc.yy" +#line 8336 "sql_yacc.yy" {} break; case 1650: -#line 8335 "sql_yacc.yy" +#line 8337 "sql_yacc.yy" {} break; case 1651: -#line 8336 "sql_yacc.yy" +#line 8338 "sql_yacc.yy" {} break; case 1652: -#line 8337 "sql_yacc.yy" +#line 8339 "sql_yacc.yy" {} break; case 1653: -#line 8338 "sql_yacc.yy" +#line 8340 "sql_yacc.yy" {} break; case 1654: -#line 8339 "sql_yacc.yy" +#line 8341 "sql_yacc.yy" {} break; case 1655: -#line 8340 "sql_yacc.yy" +#line 8342 "sql_yacc.yy" {} break; case 1656: -#line 8341 "sql_yacc.yy" +#line 8343 "sql_yacc.yy" {} break; case 1657: -#line 8342 "sql_yacc.yy" +#line 8344 "sql_yacc.yy" {} break; case 1658: -#line 8343 "sql_yacc.yy" +#line 8345 "sql_yacc.yy" {} break; case 1659: -#line 8344 "sql_yacc.yy" +#line 8346 "sql_yacc.yy" {} break; case 1660: -#line 8345 "sql_yacc.yy" +#line 8347 "sql_yacc.yy" {} break; case 1661: -#line 8346 "sql_yacc.yy" +#line 8348 "sql_yacc.yy" {} break; case 1662: -#line 8347 "sql_yacc.yy" +#line 8349 "sql_yacc.yy" {} break; case 1663: -#line 8348 "sql_yacc.yy" +#line 8350 "sql_yacc.yy" {} break; case 1664: -#line 8349 "sql_yacc.yy" +#line 8351 "sql_yacc.yy" {} break; case 1665: -#line 8350 "sql_yacc.yy" +#line 8352 "sql_yacc.yy" {} break; case 1666: -#line 8351 "sql_yacc.yy" +#line 8353 "sql_yacc.yy" {} break; case 1667: -#line 8352 "sql_yacc.yy" +#line 8354 "sql_yacc.yy" {} break; case 1668: -#line 8353 "sql_yacc.yy" +#line 8355 "sql_yacc.yy" {} break; case 1669: -#line 8354 "sql_yacc.yy" +#line 8356 "sql_yacc.yy" {} break; case 1670: -#line 8355 "sql_yacc.yy" +#line 8357 "sql_yacc.yy" {} break; case 1671: -#line 8356 "sql_yacc.yy" +#line 8358 "sql_yacc.yy" {} break; case 1672: -#line 8357 "sql_yacc.yy" +#line 8359 "sql_yacc.yy" {} break; case 1673: -#line 8358 "sql_yacc.yy" +#line 8360 "sql_yacc.yy" {} break; case 1674: -#line 8359 "sql_yacc.yy" +#line 8361 "sql_yacc.yy" {} break; case 1675: -#line 8360 "sql_yacc.yy" +#line 8362 "sql_yacc.yy" {} break; case 1676: -#line 8361 "sql_yacc.yy" +#line 8363 "sql_yacc.yy" {} break; case 1677: -#line 8362 "sql_yacc.yy" +#line 8364 "sql_yacc.yy" {} break; case 1678: -#line 8363 "sql_yacc.yy" +#line 8365 "sql_yacc.yy" {} break; case 1679: -#line 8364 "sql_yacc.yy" +#line 8366 "sql_yacc.yy" {} break; case 1680: -#line 8365 "sql_yacc.yy" +#line 8367 "sql_yacc.yy" {} break; case 1681: -#line 8366 "sql_yacc.yy" +#line 8368 "sql_yacc.yy" {} break; case 1682: -#line 8367 "sql_yacc.yy" +#line 8369 "sql_yacc.yy" {} break; case 1683: -#line 8368 "sql_yacc.yy" +#line 8370 "sql_yacc.yy" {} break; case 1684: -#line 8369 "sql_yacc.yy" +#line 8371 "sql_yacc.yy" {} break; case 1685: -#line 8370 "sql_yacc.yy" +#line 8372 "sql_yacc.yy" {} break; case 1686: -#line 8371 "sql_yacc.yy" +#line 8373 "sql_yacc.yy" {} break; case 1687: -#line 8372 "sql_yacc.yy" +#line 8374 "sql_yacc.yy" {} break; case 1688: -#line 8373 "sql_yacc.yy" +#line 8375 "sql_yacc.yy" {} break; case 1689: -#line 8374 "sql_yacc.yy" +#line 8376 "sql_yacc.yy" {} break; case 1690: -#line 8375 "sql_yacc.yy" +#line 8377 "sql_yacc.yy" {} break; case 1691: -#line 8376 "sql_yacc.yy" +#line 8378 "sql_yacc.yy" {} break; case 1692: -#line 8377 "sql_yacc.yy" +#line 8379 "sql_yacc.yy" {} break; case 1693: -#line 8378 "sql_yacc.yy" +#line 8380 "sql_yacc.yy" {} break; case 1694: -#line 8379 "sql_yacc.yy" +#line 8381 "sql_yacc.yy" {} break; case 1695: -#line 8380 "sql_yacc.yy" +#line 8382 "sql_yacc.yy" {} break; case 1696: -#line 8381 "sql_yacc.yy" +#line 8383 "sql_yacc.yy" {} break; case 1697: -#line 8382 "sql_yacc.yy" +#line 8384 "sql_yacc.yy" {} break; case 1698: -#line 8383 "sql_yacc.yy" +#line 8385 "sql_yacc.yy" {} break; case 1699: -#line 8384 "sql_yacc.yy" +#line 8386 "sql_yacc.yy" {} break; case 1700: -#line 8385 "sql_yacc.yy" +#line 8387 "sql_yacc.yy" {} break; case 1701: -#line 8386 "sql_yacc.yy" +#line 8388 "sql_yacc.yy" {} break; case 1702: -#line 8387 "sql_yacc.yy" +#line 8389 "sql_yacc.yy" {} break; case 1703: -#line 8388 "sql_yacc.yy" +#line 8390 "sql_yacc.yy" {} break; case 1704: -#line 8389 "sql_yacc.yy" +#line 8391 "sql_yacc.yy" {} break; case 1705: -#line 8390 "sql_yacc.yy" +#line 8392 "sql_yacc.yy" {} break; case 1706: -#line 8391 "sql_yacc.yy" +#line 8393 "sql_yacc.yy" {} break; case 1707: -#line 8392 "sql_yacc.yy" +#line 8394 "sql_yacc.yy" {} break; case 1708: -#line 8393 "sql_yacc.yy" +#line 8395 "sql_yacc.yy" {} break; case 1709: -#line 8394 "sql_yacc.yy" +#line 8396 "sql_yacc.yy" {} break; case 1710: -#line 8395 "sql_yacc.yy" +#line 8397 "sql_yacc.yy" {} break; case 1711: -#line 8396 "sql_yacc.yy" +#line 8398 "sql_yacc.yy" {} break; case 1712: -#line 8397 "sql_yacc.yy" +#line 8399 "sql_yacc.yy" {} break; case 1713: -#line 8398 "sql_yacc.yy" +#line 8400 "sql_yacc.yy" {} break; case 1714: -#line 8399 "sql_yacc.yy" +#line 8401 "sql_yacc.yy" {} break; case 1715: -#line 8400 "sql_yacc.yy" +#line 8402 "sql_yacc.yy" {} break; case 1716: -#line 8401 "sql_yacc.yy" +#line 8403 "sql_yacc.yy" {} break; case 1717: -#line 8402 "sql_yacc.yy" +#line 8404 "sql_yacc.yy" {} break; case 1718: -#line 8403 "sql_yacc.yy" +#line 8405 "sql_yacc.yy" {} break; case 1719: -#line 8404 "sql_yacc.yy" +#line 8406 "sql_yacc.yy" {} break; case 1720: -#line 8405 "sql_yacc.yy" +#line 8407 "sql_yacc.yy" {} break; case 1721: -#line 8406 "sql_yacc.yy" +#line 8408 "sql_yacc.yy" {} break; case 1722: -#line 8407 "sql_yacc.yy" +#line 8409 "sql_yacc.yy" {} break; case 1723: -#line 8408 "sql_yacc.yy" +#line 8410 "sql_yacc.yy" {} break; case 1724: -#line 8409 "sql_yacc.yy" +#line 8411 "sql_yacc.yy" {} break; case 1725: -#line 8410 "sql_yacc.yy" +#line 8412 "sql_yacc.yy" {} break; case 1726: -#line 8411 "sql_yacc.yy" +#line 8413 "sql_yacc.yy" {} break; case 1727: -#line 8412 "sql_yacc.yy" +#line 8414 "sql_yacc.yy" {} break; case 1728: -#line 8413 "sql_yacc.yy" +#line 8415 "sql_yacc.yy" {} break; case 1729: -#line 8414 "sql_yacc.yy" +#line 8416 "sql_yacc.yy" {} break; case 1730: -#line 8415 "sql_yacc.yy" +#line 8417 "sql_yacc.yy" {} break; case 1731: -#line 8416 "sql_yacc.yy" +#line 8418 "sql_yacc.yy" {} break; case 1732: -#line 8417 "sql_yacc.yy" +#line 8419 "sql_yacc.yy" {} break; case 1733: -#line 8418 "sql_yacc.yy" +#line 8420 "sql_yacc.yy" {} break; case 1734: -#line 8419 "sql_yacc.yy" +#line 8421 "sql_yacc.yy" {} break; case 1735: -#line 8420 "sql_yacc.yy" +#line 8422 "sql_yacc.yy" {} break; case 1736: -#line 8421 "sql_yacc.yy" +#line 8423 "sql_yacc.yy" {} break; case 1737: -#line 8422 "sql_yacc.yy" +#line 8424 "sql_yacc.yy" {} break; case 1738: -#line 8423 "sql_yacc.yy" +#line 8425 "sql_yacc.yy" {} break; case 1739: -#line 8424 "sql_yacc.yy" +#line 8426 "sql_yacc.yy" {} break; case 1740: -#line 8425 "sql_yacc.yy" +#line 8427 "sql_yacc.yy" {} break; case 1741: -#line 8426 "sql_yacc.yy" +#line 8428 "sql_yacc.yy" {} break; case 1742: -#line 8427 "sql_yacc.yy" +#line 8429 "sql_yacc.yy" {} break; case 1743: -#line 8428 "sql_yacc.yy" +#line 8430 "sql_yacc.yy" {} break; case 1744: -#line 8429 "sql_yacc.yy" +#line 8431 "sql_yacc.yy" {} break; case 1745: -#line 8430 "sql_yacc.yy" +#line 8432 "sql_yacc.yy" {} break; case 1746: -#line 8431 "sql_yacc.yy" +#line 8433 "sql_yacc.yy" {} break; case 1747: -#line 8432 "sql_yacc.yy" +#line 8434 "sql_yacc.yy" {} break; case 1748: -#line 8433 "sql_yacc.yy" +#line 8435 "sql_yacc.yy" {} break; case 1749: -#line 8434 "sql_yacc.yy" +#line 8436 "sql_yacc.yy" {} break; case 1750: -#line 8435 "sql_yacc.yy" +#line 8437 "sql_yacc.yy" {} break; case 1751: -#line 8436 "sql_yacc.yy" +#line 8438 "sql_yacc.yy" {} break; case 1752: -#line 8437 "sql_yacc.yy" +#line 8439 "sql_yacc.yy" {} break; case 1753: -#line 8438 "sql_yacc.yy" +#line 8440 "sql_yacc.yy" {} break; case 1754: -#line 8439 "sql_yacc.yy" +#line 8441 "sql_yacc.yy" {} break; case 1755: -#line 8440 "sql_yacc.yy" +#line 8442 "sql_yacc.yy" {} break; case 1756: -#line 8441 "sql_yacc.yy" +#line 8443 "sql_yacc.yy" {} break; case 1757: -#line 8442 "sql_yacc.yy" +#line 8444 "sql_yacc.yy" {} break; case 1758: -#line 8443 "sql_yacc.yy" +#line 8445 "sql_yacc.yy" {} break; case 1759: -#line 8444 "sql_yacc.yy" +#line 8446 "sql_yacc.yy" {} break; case 1760: -#line 8445 "sql_yacc.yy" +#line 8447 "sql_yacc.yy" {} break; case 1761: -#line 8446 "sql_yacc.yy" +#line 8448 "sql_yacc.yy" {} break; case 1762: -#line 8447 "sql_yacc.yy" +#line 8449 "sql_yacc.yy" {} break; case 1763: -#line 8448 "sql_yacc.yy" +#line 8450 "sql_yacc.yy" {} break; case 1764: -#line 8449 "sql_yacc.yy" +#line 8451 "sql_yacc.yy" {} break; case 1765: -#line 8450 "sql_yacc.yy" +#line 8452 "sql_yacc.yy" {} break; case 1766: -#line 8451 "sql_yacc.yy" +#line 8453 "sql_yacc.yy" {} break; case 1767: -#line 8452 "sql_yacc.yy" +#line 8454 "sql_yacc.yy" {} break; case 1768: -#line 8453 "sql_yacc.yy" +#line 8455 "sql_yacc.yy" {} break; case 1769: -#line 8454 "sql_yacc.yy" +#line 8456 "sql_yacc.yy" {} break; case 1770: -#line 8455 "sql_yacc.yy" +#line 8457 "sql_yacc.yy" {} break; case 1771: -#line 8456 "sql_yacc.yy" +#line 8458 "sql_yacc.yy" {} break; case 1772: -#line 8457 "sql_yacc.yy" +#line 8459 "sql_yacc.yy" {} break; case 1773: -#line 8458 "sql_yacc.yy" +#line 8460 "sql_yacc.yy" {} break; case 1774: -#line 8459 "sql_yacc.yy" +#line 8461 "sql_yacc.yy" {} break; case 1775: -#line 8460 "sql_yacc.yy" +#line 8462 "sql_yacc.yy" {} break; case 1776: -#line 8461 "sql_yacc.yy" +#line 8463 "sql_yacc.yy" {} break; case 1777: -#line 8462 "sql_yacc.yy" +#line 8464 "sql_yacc.yy" {} break; case 1778: -#line 8463 "sql_yacc.yy" +#line 8465 "sql_yacc.yy" {} break; case 1779: -#line 8464 "sql_yacc.yy" +#line 8466 "sql_yacc.yy" {} break; case 1780: -#line 8465 "sql_yacc.yy" +#line 8467 "sql_yacc.yy" {} break; case 1781: -#line 8466 "sql_yacc.yy" +#line 8468 "sql_yacc.yy" {} break; case 1782: -#line 8467 "sql_yacc.yy" +#line 8469 "sql_yacc.yy" {} break; case 1783: -#line 8468 "sql_yacc.yy" +#line 8470 "sql_yacc.yy" {} break; case 1784: -#line 8469 "sql_yacc.yy" +#line 8471 "sql_yacc.yy" {} break; case 1785: -#line 8470 "sql_yacc.yy" +#line 8472 "sql_yacc.yy" {} break; case 1786: -#line 8471 "sql_yacc.yy" +#line 8473 "sql_yacc.yy" {} break; case 1787: -#line 8472 "sql_yacc.yy" +#line 8474 "sql_yacc.yy" {} break; case 1788: -#line 8473 "sql_yacc.yy" +#line 8475 "sql_yacc.yy" {} break; case 1789: -#line 8474 "sql_yacc.yy" +#line 8476 "sql_yacc.yy" {} break; case 1790: -#line 8475 "sql_yacc.yy" +#line 8477 "sql_yacc.yy" {} break; case 1791: -#line 8476 "sql_yacc.yy" +#line 8478 "sql_yacc.yy" {} break; case 1792: -#line 8477 "sql_yacc.yy" +#line 8479 "sql_yacc.yy" {} break; case 1793: -#line 8478 "sql_yacc.yy" +#line 8480 "sql_yacc.yy" {} break; case 1794: -#line 8479 "sql_yacc.yy" +#line 8481 "sql_yacc.yy" {} break; case 1795: -#line 8480 "sql_yacc.yy" +#line 8482 "sql_yacc.yy" {} break; case 1796: -#line 8481 "sql_yacc.yy" +#line 8483 "sql_yacc.yy" {} break; case 1797: -#line 8482 "sql_yacc.yy" +#line 8484 "sql_yacc.yy" {} break; case 1798: -#line 8483 "sql_yacc.yy" +#line 8485 "sql_yacc.yy" {} break; case 1799: -#line 8484 "sql_yacc.yy" +#line 8486 "sql_yacc.yy" {} break; case 1800: -#line 8485 "sql_yacc.yy" +#line 8487 "sql_yacc.yy" {} break; case 1801: -#line 8486 "sql_yacc.yy" +#line 8488 "sql_yacc.yy" {} break; case 1802: -#line 8487 "sql_yacc.yy" +#line 8489 "sql_yacc.yy" {} break; case 1803: -#line 8488 "sql_yacc.yy" +#line 8490 "sql_yacc.yy" {} break; case 1804: -#line 8489 "sql_yacc.yy" +#line 8491 "sql_yacc.yy" {} break; case 1805: -#line 8490 "sql_yacc.yy" +#line 8492 "sql_yacc.yy" {} break; case 1806: -#line 8491 "sql_yacc.yy" +#line 8493 "sql_yacc.yy" {} break; case 1807: -#line 8492 "sql_yacc.yy" +#line 8494 "sql_yacc.yy" {} break; case 1808: -#line 8493 "sql_yacc.yy" +#line 8495 "sql_yacc.yy" {} break; case 1809: -#line 8494 "sql_yacc.yy" +#line 8496 "sql_yacc.yy" {} break; case 1810: -#line 8495 "sql_yacc.yy" +#line 8497 "sql_yacc.yy" {} break; case 1811: -#line 8496 "sql_yacc.yy" +#line 8498 "sql_yacc.yy" {} break; case 1812: -#line 8497 "sql_yacc.yy" +#line 8499 "sql_yacc.yy" {} break; case 1813: -#line 8498 "sql_yacc.yy" +#line 8500 "sql_yacc.yy" {} break; case 1814: -#line 8499 "sql_yacc.yy" +#line 8501 "sql_yacc.yy" {} break; case 1815: -#line 8500 "sql_yacc.yy" +#line 8502 "sql_yacc.yy" {} break; case 1816: -#line 8501 "sql_yacc.yy" +#line 8503 "sql_yacc.yy" {} break; case 1817: -#line 8502 "sql_yacc.yy" +#line 8504 "sql_yacc.yy" {} break; case 1818: -#line 8503 "sql_yacc.yy" +#line 8505 "sql_yacc.yy" {} break; case 1819: -#line 8510 "sql_yacc.yy" +#line 8512 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SET_OPTION; @@ -26113,22 +26448,22 @@ break; case 1820: -#line 8519 "sql_yacc.yy" +#line 8521 "sql_yacc.yy" {} break; case 1821: -#line 8523 "sql_yacc.yy" +#line 8525 "sql_yacc.yy" {} break; case 1822: -#line 8524 "sql_yacc.yy" +#line 8526 "sql_yacc.yy" {} break; case 1825: -#line 8531 "sql_yacc.yy" +#line 8533 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26161,7 +26496,7 @@ break; case 1826: -#line 8561 "sql_yacc.yy" +#line 8563 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26210,94 +26545,94 @@ break; case 1827: -#line 8608 "sql_yacc.yy" +#line 8610 "sql_yacc.yy" {} break; case 1828: -#line 8609 "sql_yacc.yy" - { yyval.var_type=OPT_GLOBAL; } +#line 8611 "sql_yacc.yy" + { (yyval.var_type)=OPT_GLOBAL; } break; case 1829: -#line 8610 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8612 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1830: -#line 8611 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8613 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1831: -#line 8615 "sql_yacc.yy" - { yyval.num= OPT_DEFAULT; } +#line 8617 "sql_yacc.yy" + { (yyval.num)= OPT_DEFAULT; } break; case 1832: -#line 8616 "sql_yacc.yy" - { Lex->one_shot_set= 1; yyval.num= OPT_SESSION; } +#line 8618 "sql_yacc.yy" + { Lex->one_shot_set= 1; (yyval.num)= OPT_SESSION; } break; case 1833: -#line 8620 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8622 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1834: -#line 8621 "sql_yacc.yy" - { yyval.var_type=OPT_GLOBAL; } +#line 8623 "sql_yacc.yy" + { (yyval.var_type)=OPT_GLOBAL; } break; case 1835: -#line 8622 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8624 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1836: -#line 8623 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8625 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1837: -#line 8627 "sql_yacc.yy" - { yyval.var_type=OPT_DEFAULT; } +#line 8629 "sql_yacc.yy" + { (yyval.var_type)=OPT_DEFAULT; } break; case 1838: -#line 8628 "sql_yacc.yy" - { yyval.var_type=OPT_GLOBAL; } +#line 8630 "sql_yacc.yy" + { (yyval.var_type)=OPT_GLOBAL; } break; case 1839: -#line 8629 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8631 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1840: -#line 8630 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8632 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1843: -#line 8639 "sql_yacc.yy" +#line 8641 "sql_yacc.yy" { LEX *lex=Lex; - if (yyvsp[-2].variable.var == &trg_new_row_fake_var) + if ((yyvsp[(2) - (4)].variable).var == &trg_new_row_fake_var) { /* We are in trigger and assigning value to field of new row */ Item *it; Item_trigger_field *trg_fld; sp_instr_set_trigger_field *sp_fld; LINT_INIT(sp_fld); - if (yyvsp[-3].var_type) + if ((yyvsp[(1) - (4)].var_type)) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } - if (yyvsp[0].item) - it= yyvsp[0].item; + if ((yyvsp[(4) - (4)].item)) + it= (yyvsp[(4) - (4)].item); else { /* QQ: Shouldn't this be field's default value ? */ @@ -26309,7 +26644,7 @@ lex->trg_chistics.event == TRG_EVENT_UPDATE)); if (!(trg_fld= new Item_trigger_field(Lex->current_context(), Item_trigger_field::NEW_ROW, - yyvsp[-2].variable.base_name.str, + (yyvsp[(2) - (4)].variable).base_name.str, UPDATE_ACL, FALSE)) || !(sp_fld= new sp_instr_set_trigger_field(lex->sphead-> instructions(), @@ -26327,12 +26662,12 @@ lex->sphead->add_instr(sp_fld); } - else if (yyvsp[-2].variable.var) + else if ((yyvsp[(2) - (4)].variable).var) { /* System variable */ - if (yyvsp[-3].var_type) - lex->option_type= yyvsp[-3].var_type; - lex->var_list.push_back(new set_var(lex->option_type, yyvsp[-2].variable.var, - &yyvsp[-2].variable.base_name, yyvsp[0].item)); + if ((yyvsp[(1) - (4)].var_type)) + lex->option_type= (yyvsp[(1) - (4)].var_type); + lex->var_list.push_back(new set_var(lex->option_type, (yyvsp[(2) - (4)].variable).var, + &(yyvsp[(2) - (4)].variable).base_name, (yyvsp[(4) - (4)].item))); } else { @@ -26341,16 +26676,16 @@ sp_variable_t *spv; sp_instr_set *sp_set; Item *it; - if (yyvsp[-3].var_type) + if ((yyvsp[(1) - (4)].var_type)) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } - spv= ctx->find_variable(&yyvsp[-2].variable.base_name); + spv= ctx->find_variable(&(yyvsp[(2) - (4)].variable).base_name); - if (yyvsp[0].item) - it= yyvsp[0].item; + if ((yyvsp[(4) - (4)].item)) + it= (yyvsp[(4) - (4)].item); else if (spv->dflt) it= spv->dflt; else @@ -26363,45 +26698,45 @@ break; case 1844: -#line 8719 "sql_yacc.yy" +#line 8721 "sql_yacc.yy" { LEX *lex=Lex; - if (yyvsp[-4].var_type) - lex->option_type= yyvsp[-4].var_type; + if ((yyvsp[(1) - (5)].var_type)) + lex->option_type= (yyvsp[(1) - (5)].var_type); lex->var_list.push_back(new set_var(lex->option_type, find_sys_var("tx_isolation"), &null_lex_str, - new Item_int((int32) yyvsp[0].tx_isolation))); + new Item_int((int32) (yyvsp[(5) - (5)].tx_isolation)))); } break; case 1845: -#line 8732 "sql_yacc.yy" +#line 8734 "sql_yacc.yy" { - Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var(yyvsp[-2].lex_str,yyvsp[0].item))); + Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var((yyvsp[(2) - (4)].lex_str),(yyvsp[(4) - (4)].item)))); } break; case 1846: -#line 8736 "sql_yacc.yy" +#line 8738 "sql_yacc.yy" { LEX *lex=Lex; - lex->var_list.push_back(new set_var(yyvsp[-3].var_type, yyvsp[-2].variable.var, &yyvsp[-2].variable.base_name, yyvsp[0].item)); + lex->var_list.push_back(new set_var((yyvsp[(3) - (6)].var_type), (yyvsp[(4) - (6)].variable).var, &(yyvsp[(4) - (6)].variable).base_name, (yyvsp[(6) - (6)].item))); } break; case 1847: -#line 8741 "sql_yacc.yy" +#line 8743 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; - yyvsp[0].charset= yyvsp[0].charset ? yyvsp[0].charset: global_system_variables.character_set_client; - lex->var_list.push_back(new set_var_collation_client(yyvsp[0].charset,thd->variables.collation_database,yyvsp[0].charset)); + (yyvsp[(2) - (2)].charset)= (yyvsp[(2) - (2)].charset) ? (yyvsp[(2) - (2)].charset): global_system_variables.character_set_client; + lex->var_list.push_back(new set_var_collation_client((yyvsp[(2) - (2)].charset),thd->variables.collation_database,(yyvsp[(2) - (2)].charset))); } break; case 1848: -#line 8748 "sql_yacc.yy" +#line 8750 "sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; @@ -26419,23 +26754,23 @@ break; case 1849: -#line 8763 "sql_yacc.yy" +#line 8765 "sql_yacc.yy" { LEX *lex= Lex; - yyvsp[-1].charset= yyvsp[-1].charset ? yyvsp[-1].charset : global_system_variables.character_set_client; - yyvsp[0].charset= yyvsp[0].charset ? yyvsp[0].charset : yyvsp[-1].charset; - if (!my_charset_same(yyvsp[-1].charset,yyvsp[0].charset)) + (yyvsp[(2) - (3)].charset)= (yyvsp[(2) - (3)].charset) ? (yyvsp[(2) - (3)].charset) : global_system_variables.character_set_client; + (yyvsp[(3) - (3)].charset)= (yyvsp[(3) - (3)].charset) ? (yyvsp[(3) - (3)].charset) : (yyvsp[(2) - (3)].charset); + if (!my_charset_same((yyvsp[(2) - (3)].charset),(yyvsp[(3) - (3)].charset))) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - yyvsp[0].charset->name, yyvsp[-1].charset->csname); + (yyvsp[(3) - (3)].charset)->name, (yyvsp[(2) - (3)].charset)->csname); MYSQL_YYABORT; } - lex->var_list.push_back(new set_var_collation_client(yyvsp[0].charset,yyvsp[0].charset,yyvsp[0].charset)); + lex->var_list.push_back(new set_var_collation_client((yyvsp[(3) - (3)].charset),(yyvsp[(3) - (3)].charset),(yyvsp[(3) - (3)].charset))); } break; case 1850: -#line 8776 "sql_yacc.yy" +#line 8778 "sql_yacc.yy" { THD *thd=YYTHD; LEX_USER *user; @@ -26454,33 +26789,33 @@ MYSQL_YYABORT; user->host=null_lex_str; user->user.str=thd->security_ctx->priv_user; - thd->lex->var_list.push_back(new set_var_password(user, yyvsp[0].simple_string)); + thd->lex->var_list.push_back(new set_var_password(user, (yyvsp[(3) - (3)].simple_string))); } break; case 1851: -#line 8797 "sql_yacc.yy" +#line 8799 "sql_yacc.yy" { - Lex->var_list.push_back(new set_var_password(yyvsp[-2].lex_user,yyvsp[0].simple_string)); + Lex->var_list.push_back(new set_var_password((yyvsp[(3) - (5)].lex_user),(yyvsp[(5) - (5)].simple_string))); } break; case 1852: -#line 8804 "sql_yacc.yy" +#line 8806 "sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; sp_variable_t *spv; /* We have to lookup here since local vars can shadow sysvars */ - if (!spc || !(spv = spc->find_variable(&yyvsp[0].lex_str))) + if (!spc || !(spv = spc->find_variable(&(yyvsp[(1) - (1)].lex_str)))) { /* Not an SP local variable */ - sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + sys_var *tmp=find_sys_var((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (!tmp) MYSQL_YYABORT; - yyval.variable.var= tmp; - yyval.variable.base_name= null_lex_str; + (yyval.variable).var= tmp; + (yyval.variable).base_name= null_lex_str; /* If this is time_zone variable we should open time zone describing tables @@ -26500,26 +26835,26 @@ else { /* An SP local variable */ - yyval.variable.var= NULL; - yyval.variable.base_name= yyvsp[0].lex_str; + (yyval.variable).var= NULL; + (yyval.variable).base_name= (yyvsp[(1) - (1)].lex_str); } } break; case 1853: -#line 8842 "sql_yacc.yy" +#line 8844 "sql_yacc.yy" { LEX *lex= Lex; - if (check_reserved_words(&yyvsp[-2].lex_str)) + if (check_reserved_words(&(yyvsp[(1) - (3)].lex_str))) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } if (lex->sphead && lex->sphead->m_type == TYPE_ENUM_TRIGGER && - (!my_strcasecmp(system_charset_info, yyvsp[-2].lex_str.str, "NEW") || - !my_strcasecmp(system_charset_info, yyvsp[-2].lex_str.str, "OLD"))) + (!my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "NEW") || + !my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "OLD"))) { - if (yyvsp[-2].lex_str.str[0]=='O' || yyvsp[-2].lex_str.str[0]=='o') + if ((yyvsp[(1) - (3)].lex_str).str[0]=='O' || (yyvsp[(1) - (3)].lex_str).str[0]=='o') { my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "OLD", ""); MYSQL_YYABORT; @@ -26536,106 +26871,106 @@ MYSQL_YYABORT; } /* This special combination will denote field of NEW row */ - yyval.variable.var= &trg_new_row_fake_var; - yyval.variable.base_name= yyvsp[0].lex_str; + (yyval.variable).var= &trg_new_row_fake_var; + (yyval.variable).base_name= (yyvsp[(3) - (3)].lex_str); } else { - sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + sys_var *tmp=find_sys_var((yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length); if (!tmp) MYSQL_YYABORT; if (!tmp->is_struct()) - my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), yyvsp[0].lex_str.str); - yyval.variable.var= tmp; - yyval.variable.base_name= yyvsp[-2].lex_str; + my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), (yyvsp[(3) - (3)].lex_str).str); + (yyval.variable).var= tmp; + (yyval.variable).base_name= (yyvsp[(1) - (3)].lex_str); } } break; case 1854: -#line 8885 "sql_yacc.yy" +#line 8887 "sql_yacc.yy" { - sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + sys_var *tmp=find_sys_var((yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length); if (!tmp) MYSQL_YYABORT; if (!tmp->is_struct()) - my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), yyvsp[0].lex_str.str); - yyval.variable.var= tmp; - yyval.variable.base_name.str= (char*) "default"; - yyval.variable.base_name.length= 7; + my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), (yyvsp[(3) - (3)].lex_str).str); + (yyval.variable).var= tmp; + (yyval.variable).base_name.str= (char*) "default"; + (yyval.variable).base_name.length= 7; } break; case 1855: -#line 8898 "sql_yacc.yy" - { yyval.tx_isolation= ISO_READ_UNCOMMITTED; } +#line 8900 "sql_yacc.yy" + { (yyval.tx_isolation)= ISO_READ_UNCOMMITTED; } break; case 1856: -#line 8899 "sql_yacc.yy" - { yyval.tx_isolation= ISO_READ_COMMITTED; } +#line 8901 "sql_yacc.yy" + { (yyval.tx_isolation)= ISO_READ_COMMITTED; } break; case 1857: -#line 8900 "sql_yacc.yy" - { yyval.tx_isolation= ISO_REPEATABLE_READ; } +#line 8902 "sql_yacc.yy" + { (yyval.tx_isolation)= ISO_REPEATABLE_READ; } break; case 1858: -#line 8901 "sql_yacc.yy" - { yyval.tx_isolation= ISO_SERIALIZABLE; } +#line 8903 "sql_yacc.yy" + { (yyval.tx_isolation)= ISO_SERIALIZABLE; } break; case 1859: -#line 8905 "sql_yacc.yy" - { yyval.simple_string=yyvsp[0].lex_str.str;} +#line 8907 "sql_yacc.yy" + { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str;} break; case 1860: -#line 8907 "sql_yacc.yy" +#line 8909 "sql_yacc.yy" { - yyval.simple_string= yyvsp[-1].lex_str.length ? YYTHD->variables.old_passwords ? - Item_func_old_password::alloc(YYTHD, yyvsp[-1].lex_str.str) : - Item_func_password::alloc(YYTHD, yyvsp[-1].lex_str.str) : - yyvsp[-1].lex_str.str; + (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? YYTHD->variables.old_passwords ? + Item_func_old_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : + Item_func_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : + (yyvsp[(3) - (4)].lex_str).str; } break; case 1861: -#line 8914 "sql_yacc.yy" +#line 8916 "sql_yacc.yy" { - yyval.simple_string= yyvsp[-1].lex_str.length ? Item_func_old_password::alloc(YYTHD, yyvsp[-1].lex_str.str) : - yyvsp[-1].lex_str.str; + (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? Item_func_old_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : + (yyvsp[(3) - (4)].lex_str).str; } break; case 1862: -#line 8922 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 8924 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1863: -#line 8923 "sql_yacc.yy" - { yyval.item=0; } +#line 8925 "sql_yacc.yy" + { (yyval.item)=0; } break; case 1864: -#line 8924 "sql_yacc.yy" - { yyval.item=new Item_string("ON", 2, system_charset_info); } +#line 8926 "sql_yacc.yy" + { (yyval.item)=new Item_string("ON", 2, system_charset_info); } break; case 1865: -#line 8925 "sql_yacc.yy" - { yyval.item=new Item_string("ALL", 3, system_charset_info); } +#line 8927 "sql_yacc.yy" + { (yyval.item)=new Item_string("ALL", 3, system_charset_info); } break; case 1866: -#line 8926 "sql_yacc.yy" - { yyval.item=new Item_string("binary", 6, system_charset_info); } +#line 8928 "sql_yacc.yy" + { (yyval.item)=new Item_string("binary", 6, system_charset_info); } break; case 1867: -#line 8934 "sql_yacc.yy" +#line 8936 "sql_yacc.yy" { LEX *lex= Lex; @@ -26649,40 +26984,40 @@ break; case 1868: -#line 8945 "sql_yacc.yy" +#line 8947 "sql_yacc.yy" {} break; case 1873: -#line 8958 "sql_yacc.yy" +#line 8960 "sql_yacc.yy" { - if (!Select->add_table_to_list(YYTHD, yyvsp[-2].table, yyvsp[-1].lex_str_ptr, 0, (thr_lock_type) yyvsp[0].num)) + if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), (yyvsp[(2) - (3)].lex_str_ptr), 0, (thr_lock_type) (yyvsp[(3) - (3)].num))) MYSQL_YYABORT; } break; case 1874: -#line 8965 "sql_yacc.yy" - { yyval.num=TL_READ_NO_INSERT; } +#line 8967 "sql_yacc.yy" + { (yyval.num)=TL_READ_NO_INSERT; } break; case 1875: -#line 8966 "sql_yacc.yy" - { yyval.num=TL_WRITE_DEFAULT; } +#line 8968 "sql_yacc.yy" + { (yyval.num)=TL_WRITE_DEFAULT; } break; case 1876: -#line 8967 "sql_yacc.yy" - { yyval.num=TL_WRITE_LOW_PRIORITY; } +#line 8969 "sql_yacc.yy" + { (yyval.num)=TL_WRITE_LOW_PRIORITY; } break; case 1877: -#line 8968 "sql_yacc.yy" - { yyval.num= TL_READ; } +#line 8970 "sql_yacc.yy" + { (yyval.num)= TL_READ; } break; case 1878: -#line 8973 "sql_yacc.yy" +#line 8975 "sql_yacc.yy" { LEX *lex= Lex; @@ -26696,12 +27031,12 @@ break; case 1879: -#line 8984 "sql_yacc.yy" +#line 8986 "sql_yacc.yy" {} break; case 1880: -#line 8994 "sql_yacc.yy" +#line 8996 "sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26710,13 +27045,13 @@ MYSQL_YYABORT; } lex->sql_command = SQLCOM_HA_OPEN; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-2].table, yyvsp[0].lex_str_ptr, 0)) + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(2) - (4)].table), (yyvsp[(4) - (4)].lex_str_ptr), 0)) MYSQL_YYABORT; } break; case 1881: -#line 9006 "sql_yacc.yy" +#line 9008 "sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26725,13 +27060,13 @@ MYSQL_YYABORT; } lex->sql_command = SQLCOM_HA_CLOSE; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, 0, 0)) + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(2) - (3)].table), 0, 0)) MYSQL_YYABORT; } break; case 1882: -#line 9018 "sql_yacc.yy" +#line 9020 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -26743,104 +27078,104 @@ lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */ lex->current_select->select_limit= new Item_int((int32) 1); lex->current_select->offset_limit= 0; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, 0, 0)) + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(2) - (3)].table), 0, 0)) MYSQL_YYABORT; } break; case 1883: -#line 9032 "sql_yacc.yy" +#line 9034 "sql_yacc.yy" {} break; case 1884: -#line 9036 "sql_yacc.yy" +#line 9038 "sql_yacc.yy" { Lex->ident= null_lex_str; } break; case 1885: -#line 9037 "sql_yacc.yy" - { Lex->ident= yyvsp[-1].lex_str; } +#line 9039 "sql_yacc.yy" + { Lex->ident= (yyvsp[(1) - (2)].lex_str); } break; case 1886: -#line 9041 "sql_yacc.yy" +#line 9043 "sql_yacc.yy" { Lex->ha_read_mode = RFIRST; } break; case 1887: -#line 9042 "sql_yacc.yy" +#line 9044 "sql_yacc.yy" { Lex->ha_read_mode = RNEXT; } break; case 1888: -#line 9046 "sql_yacc.yy" +#line 9048 "sql_yacc.yy" { Lex->ha_read_mode = RFIRST; } break; case 1889: -#line 9047 "sql_yacc.yy" +#line 9049 "sql_yacc.yy" { Lex->ha_read_mode = RNEXT; } break; case 1890: -#line 9048 "sql_yacc.yy" +#line 9050 "sql_yacc.yy" { Lex->ha_read_mode = RPREV; } break; case 1891: -#line 9049 "sql_yacc.yy" +#line 9051 "sql_yacc.yy" { Lex->ha_read_mode = RLAST; } break; case 1892: -#line 9051 "sql_yacc.yy" +#line 9053 "sql_yacc.yy" { LEX *lex=Lex; lex->ha_read_mode = RKEY; - lex->ha_rkey_mode=yyvsp[0].ha_rkey_mode; + lex->ha_rkey_mode=(yyvsp[(1) - (1)].ha_rkey_mode); if (!(lex->insert_list = new List_item)) MYSQL_YYABORT; } break; case 1893: -#line 9057 "sql_yacc.yy" +#line 9059 "sql_yacc.yy" { } break; case 1894: -#line 9061 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_KEY_EXACT; } +#line 9063 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_KEY_EXACT; } break; case 1895: -#line 9062 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_KEY_OR_NEXT; } +#line 9064 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_NEXT; } break; case 1896: -#line 9063 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_KEY_OR_PREV; } +#line 9065 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_PREV; } break; case 1897: -#line 9064 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_AFTER_KEY; } +#line 9066 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_AFTER_KEY; } break; case 1898: -#line 9065 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_BEFORE_KEY; } +#line 9067 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_BEFORE_KEY; } break; case 1899: -#line 9072 "sql_yacc.yy" +#line 9074 "sql_yacc.yy" {} break; case 1900: -#line 9077 "sql_yacc.yy" +#line 9079 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_REVOKE; @@ -26849,7 +27184,7 @@ break; case 1901: -#line 9084 "sql_yacc.yy" +#line 9086 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -26864,7 +27199,7 @@ break; case 1902: -#line 9097 "sql_yacc.yy" +#line 9099 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -26878,19 +27213,19 @@ break; case 1903: -#line 9109 "sql_yacc.yy" +#line 9111 "sql_yacc.yy" { Lex->sql_command = SQLCOM_REVOKE_ALL; } break; case 1904: -#line 9116 "sql_yacc.yy" +#line 9118 "sql_yacc.yy" {} break; case 1905: -#line 9122 "sql_yacc.yy" +#line 9124 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_GRANT; @@ -26899,7 +27234,7 @@ break; case 1906: -#line 9130 "sql_yacc.yy" +#line 9132 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -26913,7 +27248,7 @@ break; case 1907: -#line 9143 "sql_yacc.yy" +#line 9145 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -26927,12 +27262,12 @@ break; case 1910: -#line 9160 "sql_yacc.yy" +#line 9162 "sql_yacc.yy" { } break; case 1911: -#line 9162 "sql_yacc.yy" +#line 9164 "sql_yacc.yy" { Lex->all_privileges= 1; Lex->grant= GLOBAL_ACLS; @@ -26940,172 +27275,172 @@ break; case 1916: -#line 9178 "sql_yacc.yy" +#line 9180 "sql_yacc.yy" { Lex->which_columns = SELECT_ACL;} break; case 1917: -#line 9178 "sql_yacc.yy" +#line 9180 "sql_yacc.yy" {} break; case 1918: -#line 9179 "sql_yacc.yy" +#line 9181 "sql_yacc.yy" { Lex->which_columns = INSERT_ACL;} break; case 1919: -#line 9179 "sql_yacc.yy" +#line 9181 "sql_yacc.yy" {} break; case 1920: -#line 9180 "sql_yacc.yy" +#line 9182 "sql_yacc.yy" { Lex->which_columns = UPDATE_ACL; } break; case 1921: -#line 9180 "sql_yacc.yy" +#line 9182 "sql_yacc.yy" {} break; case 1922: -#line 9181 "sql_yacc.yy" +#line 9183 "sql_yacc.yy" { Lex->which_columns = REFERENCES_ACL;} break; case 1923: -#line 9181 "sql_yacc.yy" +#line 9183 "sql_yacc.yy" {} break; case 1924: -#line 9182 "sql_yacc.yy" +#line 9184 "sql_yacc.yy" { Lex->grant |= DELETE_ACL;} break; case 1925: -#line 9183 "sql_yacc.yy" +#line 9185 "sql_yacc.yy" {} break; case 1926: -#line 9184 "sql_yacc.yy" +#line 9186 "sql_yacc.yy" { Lex->grant |= INDEX_ACL;} break; case 1927: -#line 9185 "sql_yacc.yy" +#line 9187 "sql_yacc.yy" { Lex->grant |= ALTER_ACL;} break; case 1928: -#line 9186 "sql_yacc.yy" +#line 9188 "sql_yacc.yy" { Lex->grant |= CREATE_ACL;} break; case 1929: -#line 9187 "sql_yacc.yy" +#line 9189 "sql_yacc.yy" { Lex->grant |= DROP_ACL;} break; case 1930: -#line 9188 "sql_yacc.yy" +#line 9190 "sql_yacc.yy" { Lex->grant |= EXECUTE_ACL;} break; case 1931: -#line 9189 "sql_yacc.yy" +#line 9191 "sql_yacc.yy" { Lex->grant |= RELOAD_ACL;} break; case 1932: -#line 9190 "sql_yacc.yy" +#line 9192 "sql_yacc.yy" { Lex->grant |= SHUTDOWN_ACL;} break; case 1933: -#line 9191 "sql_yacc.yy" +#line 9193 "sql_yacc.yy" { Lex->grant |= PROCESS_ACL;} break; case 1934: -#line 9192 "sql_yacc.yy" +#line 9194 "sql_yacc.yy" { Lex->grant |= FILE_ACL;} break; case 1935: -#line 9193 "sql_yacc.yy" +#line 9195 "sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 1936: -#line 9194 "sql_yacc.yy" +#line 9196 "sql_yacc.yy" { Lex->grant |= SHOW_DB_ACL;} break; case 1937: -#line 9195 "sql_yacc.yy" +#line 9197 "sql_yacc.yy" { Lex->grant |= SUPER_ACL;} break; case 1938: -#line 9196 "sql_yacc.yy" +#line 9198 "sql_yacc.yy" { Lex->grant |= CREATE_TMP_ACL;} break; case 1939: -#line 9197 "sql_yacc.yy" +#line 9199 "sql_yacc.yy" { Lex->grant |= LOCK_TABLES_ACL; } break; case 1940: -#line 9198 "sql_yacc.yy" +#line 9200 "sql_yacc.yy" { Lex->grant |= REPL_SLAVE_ACL; } break; case 1941: -#line 9199 "sql_yacc.yy" +#line 9201 "sql_yacc.yy" { Lex->grant |= REPL_CLIENT_ACL; } break; case 1942: -#line 9200 "sql_yacc.yy" +#line 9202 "sql_yacc.yy" { Lex->grant |= CREATE_VIEW_ACL; } break; case 1943: -#line 9201 "sql_yacc.yy" +#line 9203 "sql_yacc.yy" { Lex->grant |= SHOW_VIEW_ACL; } break; case 1944: -#line 9202 "sql_yacc.yy" +#line 9204 "sql_yacc.yy" { Lex->grant |= CREATE_PROC_ACL; } break; case 1945: -#line 9203 "sql_yacc.yy" +#line 9205 "sql_yacc.yy" { Lex->grant |= ALTER_PROC_ACL; } break; case 1946: -#line 9204 "sql_yacc.yy" +#line 9206 "sql_yacc.yy" { Lex->grant |= CREATE_USER_ACL; } break; case 1947: -#line 9209 "sql_yacc.yy" +#line 9211 "sql_yacc.yy" {} break; case 1948: -#line 9210 "sql_yacc.yy" +#line 9212 "sql_yacc.yy" {} break; case 1951: -#line 9220 "sql_yacc.yy" +#line 9222 "sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_subject) @@ -27113,12 +27448,12 @@ my_error(ER_DUP_ARGUMENT, MYF(0), "SUBJECT"); MYSQL_YYABORT; } - lex->x509_subject=yyvsp[0].lex_str.str; + lex->x509_subject=(yyvsp[(2) - (2)].lex_str).str; } break; case 1952: -#line 9230 "sql_yacc.yy" +#line 9232 "sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_issuer) @@ -27126,12 +27461,12 @@ my_error(ER_DUP_ARGUMENT, MYF(0), "ISSUER"); MYSQL_YYABORT; } - lex->x509_issuer=yyvsp[0].lex_str.str; + lex->x509_issuer=(yyvsp[(2) - (2)].lex_str).str; } break; case 1953: -#line 9240 "sql_yacc.yy" +#line 9242 "sql_yacc.yy" { LEX *lex=Lex; if (lex->ssl_cipher) @@ -27139,12 +27474,12 @@ my_error(ER_DUP_ARGUMENT, MYF(0), "CIPHER"); MYSQL_YYABORT; } - lex->ssl_cipher=yyvsp[0].lex_str.str; + lex->ssl_cipher=(yyvsp[(2) - (2)].lex_str).str; } break; case 1954: -#line 9253 "sql_yacc.yy" +#line 9255 "sql_yacc.yy" { LEX *lex= Lex; THD *thd= lex->thd; @@ -27162,10 +27497,10 @@ break; case 1955: -#line 9268 "sql_yacc.yy" +#line 9270 "sql_yacc.yy" { LEX *lex= Lex; - lex->current_select->db = yyvsp[-2].lex_str.str; + lex->current_select->db = (yyvsp[(1) - (3)].lex_str).str; if (lex->grant == GLOBAL_ACLS) lex->grant = DB_ACLS & ~GRANT_ACL; else if (lex->columns.elements) @@ -27178,7 +27513,7 @@ break; case 1956: -#line 9281 "sql_yacc.yy" +#line 9283 "sql_yacc.yy" { LEX *lex= Lex; lex->current_select->db = NULL; @@ -27194,10 +27529,10 @@ break; case 1957: -#line 9294 "sql_yacc.yy" +#line 9296 "sql_yacc.yy" { LEX *lex=Lex; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[0].table,NULL, + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(1) - (1)].table),NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; if (lex->grant == GLOBAL_ACLS) @@ -27206,71 +27541,71 @@ break; case 1958: -#line 9306 "sql_yacc.yy" - { if (Lex->users_list.push_back(yyvsp[0].lex_user)) MYSQL_YYABORT;} +#line 9308 "sql_yacc.yy" + { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT;} break; case 1959: -#line 9308 "sql_yacc.yy" +#line 9310 "sql_yacc.yy" { - if (Lex->users_list.push_back(yyvsp[0].lex_user)) + if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; } break; case 1960: -#line 9316 "sql_yacc.yy" - { if (Lex->users_list.push_back(yyvsp[0].lex_user)) MYSQL_YYABORT;} +#line 9318 "sql_yacc.yy" + { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT;} break; case 1961: -#line 9318 "sql_yacc.yy" +#line 9320 "sql_yacc.yy" { - if (Lex->users_list.push_back(yyvsp[0].lex_user)) + if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; } break; case 1962: -#line 9327 "sql_yacc.yy" +#line 9329 "sql_yacc.yy" { - yyval.lex_user=yyvsp[-3].lex_user; yyvsp[-3].lex_user->password=yyvsp[0].lex_str; - if (yyvsp[0].lex_str.length) + (yyval.lex_user)=(yyvsp[(1) - (4)].lex_user); (yyvsp[(1) - (4)].lex_user)->password=(yyvsp[(4) - (4)].lex_str); + if ((yyvsp[(4) - (4)].lex_str).length) { if (YYTHD->variables.old_passwords) { char *buff= (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1); if (buff) - make_scrambled_password_323(buff, yyvsp[0].lex_str.str); - yyvsp[-3].lex_user->password.str= buff; - yyvsp[-3].lex_user->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; + make_scrambled_password_323(buff, (yyvsp[(4) - (4)].lex_str).str); + (yyvsp[(1) - (4)].lex_user)->password.str= buff; + (yyvsp[(1) - (4)].lex_user)->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; } else { char *buff= (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1); if (buff) - make_scrambled_password(buff, yyvsp[0].lex_str.str); - yyvsp[-3].lex_user->password.str= buff; - yyvsp[-3].lex_user->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH; + make_scrambled_password(buff, (yyvsp[(4) - (4)].lex_str).str); + (yyvsp[(1) - (4)].lex_user)->password.str= buff; + (yyvsp[(1) - (4)].lex_user)->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH; } } } break; case 1963: -#line 9352 "sql_yacc.yy" - { yyval.lex_user= yyvsp[-4].lex_user; yyvsp[-4].lex_user->password= yyvsp[0].lex_str; } +#line 9354 "sql_yacc.yy" + { (yyval.lex_user)= (yyvsp[(1) - (5)].lex_user); (yyvsp[(1) - (5)].lex_user)->password= (yyvsp[(5) - (5)].lex_str); } break; case 1964: -#line 9354 "sql_yacc.yy" - { yyval.lex_user= yyvsp[0].lex_user; yyvsp[0].lex_user->password= null_lex_str; } +#line 9356 "sql_yacc.yy" + { (yyval.lex_user)= (yyvsp[(1) - (1)].lex_user); (yyvsp[(1) - (1)].lex_user)->password= null_lex_str; } break; case 1965: -#line 9360 "sql_yacc.yy" +#line 9362 "sql_yacc.yy" { LEX *lex=Lex; lex->grant |= lex->which_columns; @@ -27278,9 +27613,9 @@ break; case 1969: -#line 9372 "sql_yacc.yy" +#line 9374 "sql_yacc.yy" { - String *new_str = new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,system_charset_info); + String *new_str = new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); List_iterator iter(Lex->columns); class LEX_COLUMN *point; LEX *lex=Lex; @@ -27299,91 +27634,91 @@ break; case 1971: -#line 9394 "sql_yacc.yy" +#line 9396 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_SPECIFIED; } break; case 1972: -#line 9398 "sql_yacc.yy" +#line 9400 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_ANY; } break; case 1973: -#line 9402 "sql_yacc.yy" +#line 9404 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_X509; } break; case 1974: -#line 9406 "sql_yacc.yy" +#line 9408 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_NONE; } break; case 1975: -#line 9412 "sql_yacc.yy" +#line 9414 "sql_yacc.yy" {} break; case 1977: -#line 9416 "sql_yacc.yy" +#line 9418 "sql_yacc.yy" {} break; case 1978: -#line 9417 "sql_yacc.yy" +#line 9419 "sql_yacc.yy" {} break; case 1979: -#line 9421 "sql_yacc.yy" +#line 9423 "sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 1980: -#line 9423 "sql_yacc.yy" +#line 9425 "sql_yacc.yy" { LEX *lex=Lex; - lex->mqh.questions=yyvsp[0].ulong_num; + lex->mqh.questions=(yyvsp[(2) - (2)].ulong_num); lex->mqh.specified_limits|= USER_RESOURCES::QUERIES_PER_HOUR; } break; case 1981: -#line 9429 "sql_yacc.yy" +#line 9431 "sql_yacc.yy" { LEX *lex=Lex; - lex->mqh.updates=yyvsp[0].ulong_num; + lex->mqh.updates=(yyvsp[(2) - (2)].ulong_num); lex->mqh.specified_limits|= USER_RESOURCES::UPDATES_PER_HOUR; } break; case 1982: -#line 9435 "sql_yacc.yy" +#line 9437 "sql_yacc.yy" { LEX *lex=Lex; - lex->mqh.conn_per_hour= yyvsp[0].ulong_num; + lex->mqh.conn_per_hour= (yyvsp[(2) - (2)].ulong_num); lex->mqh.specified_limits|= USER_RESOURCES::CONNECTIONS_PER_HOUR; } break; case 1983: -#line 9441 "sql_yacc.yy" +#line 9443 "sql_yacc.yy" { LEX *lex=Lex; - lex->mqh.user_conn= yyvsp[0].ulong_num; + lex->mqh.user_conn= (yyvsp[(2) - (2)].ulong_num); lex->mqh.specified_limits|= USER_RESOURCES::USER_CONNECTIONS; } break; case 1984: -#line 9450 "sql_yacc.yy" +#line 9452 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_BEGIN; @@ -27392,114 +27727,114 @@ break; case 1985: -#line 9455 "sql_yacc.yy" +#line 9457 "sql_yacc.yy" {} break; case 1986: -#line 9459 "sql_yacc.yy" +#line 9461 "sql_yacc.yy" {} break; case 1987: -#line 9460 "sql_yacc.yy" +#line 9462 "sql_yacc.yy" {} break; case 1988: -#line 9464 "sql_yacc.yy" - { yyval.num= (YYTHD->variables.completion_type == 1); } +#line 9466 "sql_yacc.yy" + { (yyval.num)= (YYTHD->variables.completion_type == 1); } break; case 1989: -#line 9465 "sql_yacc.yy" - { yyval.num=0; } +#line 9467 "sql_yacc.yy" + { (yyval.num)=0; } break; case 1990: -#line 9466 "sql_yacc.yy" - { yyval.num=1; } +#line 9468 "sql_yacc.yy" + { (yyval.num)=1; } break; case 1991: -#line 9470 "sql_yacc.yy" - { yyval.num= (YYTHD->variables.completion_type == 2); } +#line 9472 "sql_yacc.yy" + { (yyval.num)= (YYTHD->variables.completion_type == 2); } break; case 1992: -#line 9471 "sql_yacc.yy" - { yyval.num=1; } +#line 9473 "sql_yacc.yy" + { (yyval.num)=1; } break; case 1993: -#line 9472 "sql_yacc.yy" - { yyval.num=0; } +#line 9474 "sql_yacc.yy" + { (yyval.num)=0; } break; case 1994: -#line 9476 "sql_yacc.yy" +#line 9478 "sql_yacc.yy" {} break; case 1995: -#line 9477 "sql_yacc.yy" +#line 9479 "sql_yacc.yy" {} break; case 1996: -#line 9482 "sql_yacc.yy" +#line 9484 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_COMMIT; - lex->tx_chain= yyvsp[-1].num; - lex->tx_release= yyvsp[0].num; + lex->tx_chain= (yyvsp[(3) - (4)].num); + lex->tx_release= (yyvsp[(4) - (4)].num); } break; case 1997: -#line 9492 "sql_yacc.yy" +#line 9494 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK; - lex->tx_chain= yyvsp[-1].num; - lex->tx_release= yyvsp[0].num; + lex->tx_chain= (yyvsp[(3) - (4)].num); + lex->tx_release= (yyvsp[(4) - (4)].num); } break; case 1998: -#line 9500 "sql_yacc.yy" +#line 9502 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT; - lex->ident= yyvsp[0].lex_str; + lex->ident= (yyvsp[(5) - (5)].lex_str); } break; case 1999: -#line 9509 "sql_yacc.yy" +#line 9511 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SAVEPOINT; - lex->ident= yyvsp[0].lex_str; + lex->ident= (yyvsp[(2) - (2)].lex_str); } break; case 2000: -#line 9518 "sql_yacc.yy" +#line 9520 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RELEASE_SAVEPOINT; - lex->ident= yyvsp[0].lex_str; + lex->ident= (yyvsp[(3) - (3)].lex_str); } break; case 2001: -#line 9531 "sql_yacc.yy" +#line 9533 "sql_yacc.yy" {} break; case 2003: -#line 9537 "sql_yacc.yy" +#line 9539 "sql_yacc.yy" { LEX *lex=Lex; if (lex->result) @@ -27519,14 +27854,14 @@ MYSQL_YYABORT; mysql_init_select(lex); lex->current_select->linkage=UNION_TYPE; - if (yyvsp[0].num) /* UNION DISTINCT - remember position */ + if ((yyvsp[(2) - (2)].num)) /* UNION DISTINCT - remember position */ lex->current_select->master_unit()->union_distinct= lex->current_select; } break; case 2004: -#line 9561 "sql_yacc.yy" +#line 9563 "sql_yacc.yy" { /* Remove from the name resolution context stack the context of the @@ -27537,22 +27872,22 @@ break; case 2005: -#line 9571 "sql_yacc.yy" - { yyval.num= 0; } +#line 9573 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 2006: -#line 9572 "sql_yacc.yy" - { yyval.num= 1; } +#line 9574 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 2007: -#line 9573 "sql_yacc.yy" - { yyval.num= 1; } +#line 9575 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 2008: -#line 9577 "sql_yacc.yy" +#line 9579 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27571,7 +27906,7 @@ break; case 2009: -#line 9593 "sql_yacc.yy" +#line 9595 "sql_yacc.yy" { THD *thd= YYTHD; thd->lex->current_select->no_table_names_allowed= 0; @@ -27580,29 +27915,29 @@ break; case 2012: -#line 9606 "sql_yacc.yy" - { yyval.num=1; } +#line 9608 "sql_yacc.yy" + { (yyval.num)=1; } break; case 2013: -#line 9607 "sql_yacc.yy" - { yyval.num=1; } +#line 9609 "sql_yacc.yy" + { (yyval.num)=1; } break; case 2014: -#line 9608 "sql_yacc.yy" - { yyval.num=0; } +#line 9610 "sql_yacc.yy" + { (yyval.num)=0; } break; case 2015: -#line 9613 "sql_yacc.yy" +#line 9615 "sql_yacc.yy" { - yyval.select_lex= yyvsp[-1].select_lex; + (yyval.select_lex)= (yyvsp[(3) - (4)].select_lex); } break; case 2016: -#line 9617 "sql_yacc.yy" +#line 9619 "sql_yacc.yy" { THD *thd= YYTHD; /* @@ -27611,7 +27946,7 @@ and some compilers can't guarnatee the order in which the local variables are initialized. */ - List_iterator it(yyvsp[-1].select_lex->item_list); + List_iterator it((yyvsp[(3) - (4)].select_lex)->item_list); Item *item; /* we must fill the items list for the "derived table". @@ -27622,19 +27957,19 @@ break; case 2017: -#line 9633 "sql_yacc.yy" - { yyval.select_lex= yyvsp[-4].select_lex; } +#line 9635 "sql_yacc.yy" + { (yyval.select_lex)= (yyvsp[(3) - (7)].select_lex); } break; case 2018: -#line 9637 "sql_yacc.yy" +#line 9639 "sql_yacc.yy" { - yyval.select_lex= Lex->current_select->master_unit()->first_select(); + (yyval.select_lex)= Lex->current_select->master_unit()->first_select(); } break; case 2019: -#line 9642 "sql_yacc.yy" +#line 9644 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sql_command == (int)SQLCOM_HA_READ || @@ -27657,7 +27992,7 @@ break; case 2020: -#line 9663 "sql_yacc.yy" +#line 9665 "sql_yacc.yy" { LEX *lex=Lex; lex->pop_context(); @@ -27675,32 +28010,32 @@ break; case 2021: -#line 9686 "sql_yacc.yy" +#line 9688 "sql_yacc.yy" {} break; case 2022: -#line 9688 "sql_yacc.yy" +#line 9690 "sql_yacc.yy" {} break; case 2023: -#line 9693 "sql_yacc.yy" +#line 9695 "sql_yacc.yy" {} break; case 2024: -#line 9695 "sql_yacc.yy" +#line 9697 "sql_yacc.yy" {} break; case 2025: -#line 9697 "sql_yacc.yy" +#line 9699 "sql_yacc.yy" {} break; case 2026: -#line 9708 "sql_yacc.yy" +#line 9710 "sql_yacc.yy" { /* We have to distinguish missing DEFINER-clause from case when @@ -27714,112 +28049,112 @@ break; case 2027: -#line 9719 "sql_yacc.yy" +#line 9721 "sql_yacc.yy" { - YYTHD->lex->definer= get_current_user(YYTHD, yyvsp[0].lex_user); + YYTHD->lex->definer= get_current_user(YYTHD, (yyvsp[(3) - (3)].lex_user)); } break; case 2028: -#line 9732 "sql_yacc.yy" +#line 9734 "sql_yacc.yy" {} break; case 2029: -#line 9734 "sql_yacc.yy" +#line 9736 "sql_yacc.yy" {} break; case 2030: -#line 9736 "sql_yacc.yy" +#line 9738 "sql_yacc.yy" {} break; case 2031: -#line 9741 "sql_yacc.yy" +#line 9743 "sql_yacc.yy" { Lex->create_view_mode= VIEW_CREATE_OR_REPLACE; } break; case 2032: -#line 9746 "sql_yacc.yy" +#line 9748 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2033: -#line 9748 "sql_yacc.yy" +#line 9750 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; } break; case 2034: -#line 9750 "sql_yacc.yy" +#line 9752 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; } break; case 2035: -#line 9755 "sql_yacc.yy" +#line 9757 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2036: -#line 9757 "sql_yacc.yy" +#line 9759 "sql_yacc.yy" {} break; case 2037: -#line 9762 "sql_yacc.yy" +#line 9764 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFAULT; } break; case 2038: -#line 9764 "sql_yacc.yy" +#line 9766 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFINER; } break; case 2039: -#line 9766 "sql_yacc.yy" +#line 9768 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_INVOKER; } break; case 2040: -#line 9771 "sql_yacc.yy" +#line 9773 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_CREATE_VIEW; /* first table in list is target VIEW name */ - if (!lex->select_lex.add_table_to_list(thd, yyvsp[0].table, NULL, TL_OPTION_UPDATING)) + if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(3) - (3)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; } break; case 2041: -#line 9780 "sql_yacc.yy" +#line 9782 "sql_yacc.yy" {} break; case 2042: -#line 9785 "sql_yacc.yy" +#line 9787 "sql_yacc.yy" {} break; case 2044: -#line 9791 "sql_yacc.yy" +#line 9793 "sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) - sql_memdup(&yyvsp[0].lex_str, sizeof(LEX_STRING))); + sql_memdup(&(yyvsp[(1) - (1)].lex_str), sizeof(LEX_STRING))); } break; case 2045: -#line 9796 "sql_yacc.yy" +#line 9798 "sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) - sql_memdup(&yyvsp[0].lex_str, sizeof(LEX_STRING))); + sql_memdup(&(yyvsp[(3) - (3)].lex_str), sizeof(LEX_STRING))); } break; case 2046: -#line 9803 "sql_yacc.yy" +#line 9805 "sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= FALSE; @@ -27830,7 +28165,7 @@ break; case 2047: -#line 9811 "sql_yacc.yy" +#line 9813 "sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= TRUE; @@ -27841,51 +28176,51 @@ break; case 2048: -#line 9822 "sql_yacc.yy" +#line 9824 "sql_yacc.yy" { THD *thd=YYTHD; LEX *lex= thd->lex; char *stmt_beg= (lex->sphead ? (char *)lex->sphead->m_tmp_query : thd->query); - lex->create_view_select_start= yyvsp[-1].simple_string - stmt_beg; + lex->create_view_select_start= (yyvsp[(2) - (3)].simple_string) - stmt_beg; } break; case 2049: -#line 9831 "sql_yacc.yy" +#line 9833 "sql_yacc.yy" { THD *thd=YYTHD; LEX *lex= thd->lex; char *stmt_beg= (lex->sphead ? (char *)lex->sphead->m_tmp_query : thd->query); - lex->create_view_select_start= yyvsp[-3].simple_string - stmt_beg; + lex->create_view_select_start= (yyvsp[(2) - (5)].simple_string) - stmt_beg; } break; case 2050: -#line 9843 "sql_yacc.yy" +#line 9845 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_NONE; } break; case 2051: -#line 9845 "sql_yacc.yy" +#line 9847 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2052: -#line 9847 "sql_yacc.yy" +#line 9849 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2053: -#line 9849 "sql_yacc.yy" +#line 9851 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_LOCAL; } break; case 2054: -#line 9861 "sql_yacc.yy" +#line 9863 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27902,15 +28237,15 @@ MYSQL_YYABORT; sp->reset_thd_mem_root(thd); sp->init(lex); - sp->init_sp_name(thd, yyvsp[-9].spname); + sp->init_sp_name(thd, (yyvsp[(3) - (12)].spname)); - lex->stmt_definition_begin= yyvsp[-10].simple_string; - lex->ident.str= yyvsp[-5].simple_string; - lex->ident.length= yyvsp[-2].simple_string - yyvsp[-5].simple_string; + lex->stmt_definition_begin= (yyvsp[(2) - (12)].simple_string); + lex->ident.str= (yyvsp[(7) - (12)].simple_string); + lex->ident.length= (yyvsp[(10) - (12)].simple_string) - (yyvsp[(7) - (12)].simple_string); sp->m_type= TYPE_ENUM_TRIGGER; lex->sphead= sp; - lex->spname= yyvsp[-9].spname; + lex->spname= (yyvsp[(3) - (12)].spname); /* We have to turn of CLIENT_MULTI_QUERIES while parsing a stored procedure, otherwise yylex will chop it into pieces @@ -27928,7 +28263,7 @@ break; case 2055: -#line 9901 "sql_yacc.yy" +#line 9903 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -27948,7 +28283,7 @@ sp_proc_stmt alternatives are not saving/restoring LEX, so lex->query_tables can be wiped out. */ - if (!lex->select_lex.add_table_to_list(YYTHD, yyvsp[-6].table, + if (!lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(8) - (14)].table), (LEX_STRING*) 0, TL_OPTION_UPDATING, TL_IGNORE)) @@ -27957,22 +28292,22 @@ break; case 2056: -#line 9936 "sql_yacc.yy" +#line 9938 "sql_yacc.yy" { LEX *lex=Lex; - lex->udf.type= yyvsp[-3].udf_type; - lex->stmt_definition_begin= yyvsp[-2].simple_string; - lex->spname= yyvsp[0].spname; + lex->udf.type= (yyvsp[(1) - (4)].udf_type); + lex->stmt_definition_begin= (yyvsp[(2) - (4)].simple_string); + lex->spname= (yyvsp[(4) - (4)].spname); } break; case 2057: -#line 9943 "sql_yacc.yy" +#line 9945 "sql_yacc.yy" {} break; case 2058: -#line 9945 "sql_yacc.yy" +#line 9947 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp; @@ -27983,13 +28318,13 @@ MYSQL_YYABORT; } - lex->stmt_definition_begin= yyvsp[-1].simple_string; + lex->stmt_definition_begin= (yyvsp[(2) - (3)].simple_string); /* Order is important here: new - reset - init */ sp= new sp_head(); sp->reset_thd_mem_root(YYTHD); sp->init(lex); - sp->init_sp_name(YYTHD, yyvsp[0].spname); + sp->init_sp_name(YYTHD, (yyvsp[(3) - (3)].spname)); sp->m_type= TYPE_ENUM_PROCEDURE; lex->sphead= sp; @@ -28004,7 +28339,7 @@ break; case 2059: -#line 9974 "sql_yacc.yy" +#line 9976 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28015,7 +28350,7 @@ break; case 2060: -#line 9983 "sql_yacc.yy" +#line 9985 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28027,7 +28362,7 @@ break; case 2061: -#line 9992 "sql_yacc.yy" +#line 9994 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28039,7 +28374,7 @@ break; case 2062: -#line 10001 "sql_yacc.yy" +#line 10003 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -28054,142 +28389,141 @@ break; case 2063: -#line 10017 "sql_yacc.yy" +#line 10019 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_START; } break; case 2064: -#line 10021 "sql_yacc.yy" +#line 10023 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_END; } break; case 2065: -#line 10025 "sql_yacc.yy" +#line 10027 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_PREPARE; } break; case 2066: -#line 10029 "sql_yacc.yy" +#line 10031 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_COMMIT; } break; case 2067: -#line 10033 "sql_yacc.yy" +#line 10035 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_ROLLBACK; } break; case 2068: -#line 10037 "sql_yacc.yy" +#line 10039 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_RECOVER; } break; case 2069: -#line 10043 "sql_yacc.yy" +#line 10045 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[0].string->length() <= MAXGTRIDSIZE); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (1)].string)->length() <= MAXGTRIDSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) MYSQL_YYABORT; - Lex->xid->set(1L, yyvsp[0].string->ptr(), yyvsp[0].string->length(), 0, 0); + Lex->xid->set(1L, (yyvsp[(1) - (1)].string)->ptr(), (yyvsp[(1) - (1)].string)->length(), 0, 0); } break; case 2070: -#line 10050 "sql_yacc.yy" +#line 10052 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-2].string->length() <= MAXGTRIDSIZE && yyvsp[0].string->length() <= MAXBQUALSIZE); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (3)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) MYSQL_YYABORT; - Lex->xid->set(1L, yyvsp[-2].string->ptr(), yyvsp[-2].string->length(), yyvsp[0].string->ptr(), yyvsp[0].string->length()); + Lex->xid->set(1L, (yyvsp[(1) - (3)].string)->ptr(), (yyvsp[(1) - (3)].string)->length(), (yyvsp[(3) - (3)].string)->ptr(), (yyvsp[(3) - (3)].string)->length()); } break; case 2071: -#line 10057 "sql_yacc.yy" +#line 10059 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-4].string->length() <= MAXGTRIDSIZE && yyvsp[-2].string->length() <= MAXBQUALSIZE); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (5)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) MYSQL_YYABORT; - Lex->xid->set(yyvsp[0].ulong_num, yyvsp[-4].string->ptr(), yyvsp[-4].string->length(), yyvsp[-2].string->ptr(), yyvsp[-2].string->length()); + Lex->xid->set((yyvsp[(5) - (5)].ulong_num), (yyvsp[(1) - (5)].string)->ptr(), (yyvsp[(1) - (5)].string)->length(), (yyvsp[(3) - (5)].string)->ptr(), (yyvsp[(3) - (5)].string)->length()); } break; case 2072: -#line 10065 "sql_yacc.yy" +#line 10067 "sql_yacc.yy" {} break; case 2073: -#line 10066 "sql_yacc.yy" +#line 10068 "sql_yacc.yy" {} break; case 2074: -#line 10070 "sql_yacc.yy" +#line 10072 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2075: -#line 10071 "sql_yacc.yy" +#line 10073 "sql_yacc.yy" { Lex->xa_opt=XA_JOIN; } break; case 2076: -#line 10072 "sql_yacc.yy" +#line 10074 "sql_yacc.yy" { Lex->xa_opt=XA_RESUME; } break; case 2077: -#line 10076 "sql_yacc.yy" +#line 10078 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2078: -#line 10077 "sql_yacc.yy" +#line 10079 "sql_yacc.yy" { Lex->xa_opt=XA_ONE_PHASE; } break; case 2079: -#line 10081 "sql_yacc.yy" +#line 10083 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2080: -#line 10082 "sql_yacc.yy" +#line 10084 "sql_yacc.yy" { Lex->xa_opt=XA_SUSPEND; } break; case 2082: -#line 10087 "sql_yacc.yy" +#line 10089 "sql_yacc.yy" { } break; case 2083: -#line 10088 "sql_yacc.yy" +#line 10090 "sql_yacc.yy" { Lex->xa_opt=XA_FOR_MIGRATE; } break; +/* Line 1267 of yacc.c. */ +#line 28521 "sql_yacc.cc" + default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 1000 of yacc.c. */ -#line 28188 "sql_yacc.cc" - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -28218,99 +28552,65 @@ if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); + } - if (yycount < 5) - { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) - { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ + { + /* Return failure if at end of input. */ if (yychar == YYEOF) - for (;;) - { - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - } - } + YYABORT; + } else { - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); + yydestruct ("Error: discarding", + yytoken, &yylval); yychar = YYEMPTY; - } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -28320,15 +28620,17 @@ `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) goto yyerrorlab; -#endif - yyvsp -= yylen; - yyssp -= yylen; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; @@ -28357,9 +28659,10 @@ if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - YYPOPSTACK; + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -28367,11 +28670,12 @@ if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -28391,21 +28695,39 @@ goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } Modified: mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/r/senna_create.result =================================================================== --- mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/r/senna_create.result 2007-12-11 04:26:30 UTC (rev 53) +++ mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/r/senna_create.result 2007-12-11 04:47:24 UTC (rev 54) @@ -208,3 +208,8 @@ Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size t1 ft c1 utf8 NGRAM OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 DROP TABLE t1; +CREATE TABLE t1 (c1 TEXT, FULLTEXT INDEX ft USING DELIMITED (c1)) DEFAULT CHARSET utf8; +SHOW SENNA STATUS; +Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size +t1 ft c1 utf8 DELIMITED OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 +DROP TABLE t1; Modified: mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/t/senna_create.test =================================================================== --- mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/t/senna_create.test 2007-12-11 04:26:30 UTC (rev 53) +++ mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/t/senna_create.test 2007-12-11 04:47:24 UTC (rev 54) @@ -214,3 +214,7 @@ SHOW SENNA STATUS; DROP TABLE t1; +# bugfix for delimited flags was ignored +CREATE TABLE t1 (c1 TEXT, FULLTEXT INDEX ft USING DELIMITED (c1)) DEFAULT CHARSET utf8; +SHOW SENNA STATUS; +DROP TABLE t1; Modified: mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.cc =================================================================== --- mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.cc 2007-12-11 04:26:30 UTC (rev 53) +++ mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.cc 2007-12-11 04:47:24 UTC (rev 54) @@ -1,8 +1,10 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Skeleton implementation for Bison's Yacc-like parsers in C + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -15,17 +17,25 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ +/* 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. -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -36,6 +46,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.3" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -45,8 +58,7 @@ /* Using locations. */ #define YYLSP_NEEDED 0 -/* If NAME_PREFIX is specified substitute the variables and functions - names. */ +/* Substitute the variable and function names. */ #define yyparse MYSQLparse #define yylex MYSQLlex #define yyerror MYSQLerror @@ -635,6 +647,7 @@ NEG = 828 }; #endif +/* Tokens. */ #define END_OF_INPUT 258 #define ABORT_SYM 259 #define ACTION 260 @@ -1623,9 +1636,15 @@ # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE #line 415 "sql_yacc.yy" -typedef union YYSTYPE { +{ int num; ulong ulong_num; ulonglong ulonglong_number; @@ -1663,9 +1682,10 @@ struct { int vars, conds, hndlrs, curs; } spblock; sp_name *spname; struct st_lex *lex; -} YYSTYPE; -/* Line 191 of yacc.c. */ -#line 1669 "sql_yacc.cc" +} +/* Line 193 of yacc.c. */ +#line 1688 "sql_yacc.cc" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1679,56 +1699,171 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); -/* Line 214 of yacc.c. */ -#line 1684 "sql_yacc.cc" +/* Line 216 of yacc.c. */ +#line 1704 "sql_yacc.cc" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -# ifndef YYFREE -# define YYFREE free +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int # endif -# ifndef YYMALLOC -# define YYMALLOC malloc +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if 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 +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# endif -# else -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else # 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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (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 -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif # endif -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -1738,24 +1873,24 @@ /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -1773,39 +1908,33 @@ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 482 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 45159 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 593 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 680 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 2083 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 3744 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 828 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned short yytranslate[] = +static const yytype_uint16 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1895,7 +2024,7 @@ #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short yyprhs[] = +static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, @@ -2108,8 +2237,8 @@ 6301, 6302, 6306, 6307 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = { 594, 0, -1, 3, -1, 595, 3, -1, 596, -1, 1218, -1, 796, -1, 837, -1, 827, -1, 631, -1, @@ -2745,7 +2874,7 @@ }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const yytype_uint16 yyrline[] = { 0, 1226, 1226, 1240, 1243, 1244, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, @@ -2799,169 +2928,169 @@ 3551, 3554, 3555, 3556, 3557, 3558, 3561, 3562, 3563, 3575, 3576, 3579, 3580, 3583, 3584, 3588, 3589, 3590, 3593, 3594, 3595, 3596, 3609, 3610, 3611, 3614, 3615, 3619, 3620, 3623, - 3624, 3627, 3632, 3637, 3642, 3647, 3652, 3657, 3662, 3667, - 3672, 3677, 3682, 3693, 3694, 3697, 3698, 3709, 3710, 3713, - 3714, 3717, 3718, 3726, 3725, 3752, 3751, 3766, 3765, 3784, - 3783, 3803, 3801, 3816, 3817, 3819, 3820, 3821, 3822, 3823, - 3826, 3834, 3835, 3839, 3844, 3843, 3851, 3860, 3850, 3872, - 3879, 3883, 3890, 3897, 3903, 3909, 3915, 3922, 3941, 3962, - 3967, 3971, 3978, 3979, 3982, 3983, 3987, 3988, 3989, 3993, - 3994, 3995, 3998, 3999, 4000, 4001, 4009, 4008, 4019, 4027, - 4026, 4036, 4046, 4055, 4056, 4063, 4063, 4069, 4070, 4074, - 4075, 4076, 4080, 4081, 4098, 4099, 4104, 4103, 4114, 4113, - 4124, 4123, 4133, 4134, 4135, 4140, 4139, 4151, 4152, 4155, - 4156, 4159, 4160, 4161, 4165, 4164, 4177, 4176, 4193, 4194, - 4197, 4198, 4201, 4202, 4203, 4204, 4205, 4206, 4210, 4209, - 4221, 4222, 4223, 4228, 4227, 4233, 4240, 4245, 4253, 4254, - 4257, 4269, 4278, 4279, 4282, 4295, 4296, 4301, 4300, 4310, - 4311, 4314, 4327, 4327, 4337, 4338, 4347, 4348, 4357, 4366, - 4368, 4371, 4393, 4397, 4396, 4416, 4424, 4416, 4430, 4431, - 4432, 4433, 4434, 4437, 4444, 4451, 4453, 4464, 4465, 4468, - 4469, 4475, 4476, 4477, 4478, 4484, 4490, 4496, 4506, 4509, - 4511, 4517, 4527, 4528, 4529, 4542, 4562, 4569, 4576, 4577, - 4580, 4581, 4582, 4583, 4584, 4588, 4589, 4593, 4593, 4610, - 4612, 4617, 4618, 4618, 4635, 4637, 4642, 4643, 4646, 4648, - 4650, 4652, 4654, 4655, 4656, 4660, 4661, 4662, 4663, 4665, - 4667, 4670, 4674, 4680, 4684, 4690, 4694, 4702, 4704, 4710, - 4713, 4715, 4717, 4718, 4720, 4723, 4724, 4727, 4728, 4731, - 4733, 4735, 4738, 4739, 4740, 4742, 4744, 4747, 4748, 4749, - 4750, 4751, 4752, 4755, 4756, 4758, 4758, 4759, 4759, 4760, - 4760, 4761, 4761, 4763, 4764, 4765, 4766, 4767, 4768, 4771, - 4772, 4776, 4780, 4781, 4788, 4789, 4790, 4791, 4792, 4794, - 4795, 4796, 4797, 4798, 4802, 4803, 4808, 4813, 4817, 4818, - 4822, 4823, 4827, 4834, 4836, 4842, 4844, 4855, 4857, 4868, - 4879, 4890, 4901, 4903, 4905, 4907, 4909, 4911, 4913, 4915, - 4917, 4919, 4921, 4923, 4925, 4931, 4933, 4935, 4940, 4945, - 4947, 4949, 4954, 4956, 4958, 4960, 4962, 4967, 4968, 4970, - 4972, 4974, 4976, 4978, 4980, 4982, 4984, 4986, 4988, 4990, - 4994, 4996, 5006, 5008, 5010, 5012, 5014, 5017, 5026, 5031, - 5036, 5038, 5040, 5042, 5044, 5046, 5048, 5050, 5055, 5060, - 5062, 5064, 5066, 5068, 5070, 5072, 5078, 5080, 5082, 5084, - 5086, 5088, 5090, 5092, 5094, 5095, 5101, 5106, 5108, 5110, - 5112, 5114, 5116, 5118, 5120, 5122, 5129, 5136, 5138, 5140, - 5142, 5144, 5146, 5148, 5150, 5152, 5154, 5156, 5158, 5160, - 5162, 5164, 5178, 5177, 5294, 5298, 5303, 5305, 5307, 5309, - 5311, 5313, 5318, 5320, 5322, 5324, 5326, 5331, 5335, 5337, - 5339, 5341, 5343, 5345, 5349, 5352, 5355, 5357, 5359, 5361, - 5363, 5365, 5367, 5370, 5373, 5375, 5377, 5379, 5381, 5383, - 5386, 5388, 5390, 5392, 5397, 5398, 5399, 5403, 5404, 5408, - 5408, 5414, 5418, 5425, 5456, 5458, 5460, 5462, 5464, 5466, - 5468, 5471, 5473, 5470, 5476, 5478, 5485, 5487, 5489, 5491, - 5493, 5495, 5497, 5499, 5501, 5504, 5503, 5518, 5517, 5532, - 5538, 5544, 5557, 5558, 5561, 5562, 5567, 5570, 5582, 5581, - 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, - 5607, 5611, 5612, 5616, 5616, 5621, 5622, 5625, 5626, 5629, - 5629, 5634, 5635, 5638, 5639, 5642, 5643, 5646, 5652, 5662, - 5663, 5672, 5677, 5678, 5698, 5700, 5704, 5702, 5719, 5717, - 5735, 5733, 5740, 5749, 5747, 5765, 5764, 5774, 5785, 5783, - 5802, 5801, 5812, 5822, 5823, 5824, 5829, 5829, 5848, 5846, - 5865, 5887, 5935, 5934, 5957, 5975, 5957, 5982, 5986, 6012, - 6013, 6015, 6017, 6020, 6021, 6027, 6034, 6043, 6042, 6049, - 6050, 6054, 6058, 6062, 6068, 6076, 6085, 6086, 6087, 6088, - 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 6097, 6100, - 6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6112, 6113, - 6114, 6115, 6118, 6120, 6121, 6124, 6125, 6128, 6130, 6134, - 6136, 6135, 6149, 6152, 6151, 6166, 6172, 6185, 6187, 6190, - 6192, 6196, 6197, 6210, 6228, 6232, 6233, 6237, 6250, 6252, - 6256, 6255, 6287, 6289, 6293, 6294, 6295, 6300, 6306, 6310, - 6311, 6315, 6319, 6326, 6333, 6342, 6346, 6347, 6348, 6353, - 6357, 6365, 6366, 6367, 6368, 6369, 6370, 6374, 6375, 6376, - 6377, 6378, 6381, 6384, 6383, 6412, 6413, 6416, 6417, 6420, - 6435, 6435, 6445, 6446, 6450, 6462, 6495, 6494, 6507, 6506, - 6515, 6527, 6538, 6537, 6554, 6561, 6561, 6573, 6580, 6592, - 6604, 6608, 6614, 6624, 6625, 6628, 6636, 6637, 6641, 6642, - 6650, 6659, 6649, 6669, 6676, 6668, 6686, 6698, 6699, 6700, - 6704, 6705, 6708, 6709, 6712, 6721, 6722, 6723, 6725, 6724, - 6734, 6735, 6738, 6739, 6740, 6740, 6741, 6741, 6745, 6746, - 6749, 6751, 6754, 6762, 6763, 6767, 6768, 6773, 6772, 6785, - 6786, 6789, 6794, 6802, 6803, 6806, 6808, 6808, 6816, 6825, - 6815, 6847, 6848, 6851, 6858, 6859, 6862, 6871, 6872, 6878, - 6877, 6891, 6890, 6899, 6898, 6906, 6905, 6915, 6916, 6919, - 6926, 6939, 6940, 6944, 6945, 6948, 6949, 6950, 6953, 6963, - 6965, 6967, 6969, 6972, 6973, 6976, 6980, 6984, 6988, 6992, - 6996, 7000, 7004, 7008, 7016, 7019, 7028, 7027, 7041, 7049, - 7058, 7067, 7076, 7086, 7085, 7088, 7098, 7108, 7112, 7117, - 7116, 7121, 7131, 7136, 7142, 7147, 7152, 7154, 7156, 7158, - 7160, 7162, 7170, 7179, 7181, 7183, 7185, 7194, 7202, 7210, - 7212, 7214, 7224, 7231, 7237, 7245, 7253, 7257, 7261, 7268, - 7275, 7285, 7295, 7305, 7316, 7325, 7339, 7352, 7353, 7355, - 7357, 7360, 7361, 7364, 7365, 7368, 7369, 7372, 7373, 7376, - 7377, 7379, 7381, 7384, 7396, 7395, 7410, 7409, 7419, 7420, - 7423, 7424, 7428, 7429, 7430, 7438, 7437, 7449, 7450, 7453, - 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, - 7463, 7466, 7467, 7471, 7470, 7479, 7480, 7483, 7484, 7485, - 7489, 7488, 7498, 7502, 7506, 7518, 7518, 7526, 7527, 7528, - 7533, 7543, 7542, 7558, 7576, 7587, 7594, 7604, 7575, 7609, - 7618, 7619, 7622, 7623, 7635, 7639, 7640, 7641, 7643, 7645, - 7648, 7649, 7652, 7657, 7664, 7669, 7675, 7677, 7680, 7681, - 7684, 7689, 7695, 7697, 7704, 7705, 7706, 7709, 7711, 7716, - 7717, 7722, 7723, 7729, 7734, 7736, 7738, 7743, 7745, 7756, - 7769, 7790, 7791, 7792, 7801, 7802, 7803, 7808, 7809, 7810, - 7811, 7812, 7826, 7840, 7841, 7842, 7845, 7846, 7847, 7848, - 7856, 7871, 7872, 7875, 7881, 7892, 7895, 7931, 7935, 7943, - 7947, 8015, 8030, 8054, 8055, 8071, 8081, 8084, 8085, 8086, - 8090, 8094, 8095, 8120, 8132, 8145, 8157, 8158, 8167, 8168, - 8177, 8178, 8179, 8182, 8195, 8208, 8222, 8223, 8224, 8225, - 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, - 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, - 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, - 8256, 8257, 8258, 8268, 8269, 8270, 8271, 8272, 8273, 8274, - 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, - 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, - 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, - 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, - 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, - 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, - 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, - 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, - 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, - 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, - 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, - 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, - 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, - 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, - 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, - 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, - 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, - 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, - 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, - 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, - 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, - 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, - 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8510, - 8509, 8523, 8524, 8527, 8528, 8531, 8531, 8608, 8609, 8610, - 8611, 8615, 8616, 8620, 8621, 8622, 8623, 8627, 8628, 8629, - 8630, 8634, 8635, 8638, 8718, 8731, 8735, 8740, 8747, 8762, - 8775, 8796, 8803, 8841, 8884, 8898, 8899, 8900, 8901, 8905, - 8906, 8913, 8922, 8923, 8924, 8925, 8926, 8934, 8933, 8949, - 8950, 8953, 8954, 8957, 8965, 8966, 8967, 8968, 8973, 8972, - 8993, 9005, 9018, 9017, 9036, 9037, 9041, 9042, 9046, 9047, - 9048, 9049, 9051, 9050, 9061, 9062, 9063, 9064, 9065, 9071, - 9076, 9083, 9096, 9108, 9115, 9120, 9128, 9141, 9155, 9157, - 9160, 9161, 9168, 9170, 9174, 9175, 9178, 9178, 9179, 9179, - 9180, 9180, 9181, 9181, 9182, 9183, 9184, 9185, 9186, 9187, - 9188, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9196, 9197, - 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9209, 9210, 9214, - 9215, 9219, 9229, 9239, 9252, 9267, 9280, 9293, 9306, 9307, - 9316, 9317, 9326, 9351, 9353, 9360, 9364, 9367, 9368, 9371, - 9392, 9393, 9397, 9401, 9405, 9412, 9413, 9416, 9417, 9421, - 9422, 9428, 9434, 9440, 9450, 9449, 9459, 9460, 9464, 9465, - 9466, 9470, 9471, 9472, 9476, 9477, 9481, 9491, 9498, 9508, - 9517, 9531, 9532, 9537, 9536, 9571, 9572, 9573, 9577, 9577, - 9601, 9602, 9606, 9607, 9608, 9612, 9617, 9616, 9636, 9642, - 9663, 9685, 9687, 9692, 9694, 9696, 9708, 9718, 9731, 9733, - 9735, 9740, 9745, 9747, 9749, 9755, 9756, 9762, 9763, 9765, - 9771, 9770, 9785, 9786, 9790, 9795, 9803, 9803, 9821, 9830, - 9843, 9844, 9846, 9848, 9861, 9859, 9936, 9935, 9945, 9974, - 9983, 9992, 9944, 10016, 10020, 10024, 10028, 10032, 10036, 10042, - 10049, 10056, 10065, 10066, 10070, 10071, 10072, 10076, 10077, 10081, - 10082, 10082, 10087, 10088 + 3624, 3627, 3632, 3637, 3642, 3647, 3652, 3657, 3662, 3668, + 3674, 3679, 3684, 3695, 3696, 3699, 3700, 3711, 3712, 3715, + 3716, 3719, 3720, 3728, 3727, 3754, 3753, 3768, 3767, 3786, + 3785, 3805, 3803, 3818, 3819, 3821, 3822, 3823, 3824, 3825, + 3828, 3836, 3837, 3841, 3846, 3845, 3853, 3862, 3852, 3874, + 3881, 3885, 3892, 3899, 3905, 3911, 3917, 3924, 3943, 3964, + 3969, 3973, 3980, 3981, 3984, 3985, 3989, 3990, 3991, 3995, + 3996, 3997, 4000, 4001, 4002, 4003, 4011, 4010, 4021, 4029, + 4028, 4038, 4048, 4057, 4058, 4065, 4065, 4071, 4072, 4076, + 4077, 4078, 4082, 4083, 4100, 4101, 4106, 4105, 4116, 4115, + 4126, 4125, 4135, 4136, 4137, 4142, 4141, 4153, 4154, 4157, + 4158, 4161, 4162, 4163, 4167, 4166, 4179, 4178, 4195, 4196, + 4199, 4200, 4203, 4204, 4205, 4206, 4207, 4208, 4212, 4211, + 4223, 4224, 4225, 4230, 4229, 4235, 4242, 4247, 4255, 4256, + 4259, 4271, 4280, 4281, 4284, 4297, 4298, 4303, 4302, 4312, + 4313, 4316, 4329, 4329, 4339, 4340, 4349, 4350, 4359, 4368, + 4370, 4373, 4395, 4399, 4398, 4418, 4426, 4418, 4432, 4433, + 4434, 4435, 4436, 4439, 4446, 4453, 4455, 4466, 4467, 4470, + 4471, 4477, 4478, 4479, 4480, 4486, 4492, 4498, 4508, 4511, + 4513, 4519, 4529, 4530, 4531, 4544, 4564, 4571, 4578, 4579, + 4582, 4583, 4584, 4585, 4586, 4590, 4591, 4595, 4595, 4612, + 4614, 4619, 4620, 4620, 4637, 4639, 4644, 4645, 4648, 4650, + 4652, 4654, 4656, 4657, 4658, 4662, 4663, 4664, 4665, 4667, + 4669, 4672, 4676, 4682, 4686, 4692, 4696, 4704, 4706, 4712, + 4715, 4717, 4719, 4720, 4722, 4725, 4726, 4729, 4730, 4733, + 4735, 4737, 4740, 4741, 4742, 4744, 4746, 4749, 4750, 4751, + 4752, 4753, 4754, 4757, 4758, 4760, 4760, 4761, 4761, 4762, + 4762, 4763, 4763, 4765, 4766, 4767, 4768, 4769, 4770, 4773, + 4774, 4778, 4782, 4783, 4790, 4791, 4792, 4793, 4794, 4796, + 4797, 4798, 4799, 4800, 4804, 4805, 4810, 4815, 4819, 4820, + 4824, 4825, 4829, 4836, 4838, 4844, 4846, 4857, 4859, 4870, + 4881, 4892, 4903, 4905, 4907, 4909, 4911, 4913, 4915, 4917, + 4919, 4921, 4923, 4925, 4927, 4933, 4935, 4937, 4942, 4947, + 4949, 4951, 4956, 4958, 4960, 4962, 4964, 4969, 4970, 4972, + 4974, 4976, 4978, 4980, 4982, 4984, 4986, 4988, 4990, 4992, + 4996, 4998, 5008, 5010, 5012, 5014, 5016, 5019, 5028, 5033, + 5038, 5040, 5042, 5044, 5046, 5048, 5050, 5052, 5057, 5062, + 5064, 5066, 5068, 5070, 5072, 5074, 5080, 5082, 5084, 5086, + 5088, 5090, 5092, 5094, 5096, 5097, 5103, 5108, 5110, 5112, + 5114, 5116, 5118, 5120, 5122, 5124, 5131, 5138, 5140, 5142, + 5144, 5146, 5148, 5150, 5152, 5154, 5156, 5158, 5160, 5162, + 5164, 5166, 5180, 5179, 5296, 5300, 5305, 5307, 5309, 5311, + 5313, 5315, 5320, 5322, 5324, 5326, 5328, 5333, 5337, 5339, + 5341, 5343, 5345, 5347, 5351, 5354, 5357, 5359, 5361, 5363, + 5365, 5367, 5369, 5372, 5375, 5377, 5379, 5381, 5383, 5385, + 5388, 5390, 5392, 5394, 5399, 5400, 5401, 5405, 5406, 5410, + 5410, 5416, 5420, 5427, 5458, 5460, 5462, 5464, 5466, 5468, + 5470, 5473, 5475, 5472, 5478, 5480, 5487, 5489, 5491, 5493, + 5495, 5497, 5499, 5501, 5503, 5506, 5505, 5520, 5519, 5534, + 5540, 5546, 5559, 5560, 5563, 5564, 5569, 5572, 5584, 5583, + 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, + 5609, 5613, 5614, 5618, 5618, 5623, 5624, 5627, 5628, 5631, + 5631, 5636, 5637, 5640, 5641, 5644, 5645, 5648, 5654, 5664, + 5665, 5674, 5679, 5680, 5700, 5702, 5706, 5704, 5721, 5719, + 5737, 5735, 5742, 5751, 5749, 5767, 5766, 5776, 5787, 5785, + 5804, 5803, 5814, 5824, 5825, 5826, 5831, 5831, 5850, 5848, + 5867, 5889, 5937, 5936, 5959, 5977, 5959, 5984, 5988, 6014, + 6015, 6017, 6019, 6022, 6023, 6029, 6036, 6045, 6044, 6051, + 6052, 6056, 6060, 6064, 6070, 6078, 6087, 6088, 6089, 6090, + 6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6102, + 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6114, 6115, + 6116, 6117, 6120, 6122, 6123, 6126, 6127, 6130, 6132, 6136, + 6138, 6137, 6151, 6154, 6153, 6168, 6174, 6187, 6189, 6192, + 6194, 6198, 6199, 6212, 6230, 6234, 6235, 6239, 6252, 6254, + 6258, 6257, 6289, 6291, 6295, 6296, 6297, 6302, 6308, 6312, + 6313, 6317, 6321, 6328, 6335, 6344, 6348, 6349, 6350, 6355, + 6359, 6367, 6368, 6369, 6370, 6371, 6372, 6376, 6377, 6378, + 6379, 6380, 6383, 6386, 6385, 6414, 6415, 6418, 6419, 6422, + 6437, 6437, 6447, 6448, 6452, 6464, 6497, 6496, 6509, 6508, + 6517, 6529, 6540, 6539, 6556, 6563, 6563, 6575, 6582, 6594, + 6606, 6610, 6616, 6626, 6627, 6630, 6638, 6639, 6643, 6644, + 6652, 6661, 6651, 6671, 6678, 6670, 6688, 6700, 6701, 6702, + 6706, 6707, 6710, 6711, 6714, 6723, 6724, 6725, 6727, 6726, + 6736, 6737, 6740, 6741, 6742, 6742, 6743, 6743, 6747, 6748, + 6751, 6753, 6756, 6764, 6765, 6769, 6770, 6775, 6774, 6787, + 6788, 6791, 6796, 6804, 6805, 6808, 6810, 6810, 6818, 6827, + 6817, 6849, 6850, 6853, 6860, 6861, 6864, 6873, 6874, 6880, + 6879, 6893, 6892, 6901, 6900, 6908, 6907, 6917, 6918, 6921, + 6928, 6941, 6942, 6946, 6947, 6950, 6951, 6952, 6955, 6965, + 6967, 6969, 6971, 6974, 6975, 6978, 6982, 6986, 6990, 6994, + 6998, 7002, 7006, 7010, 7018, 7021, 7030, 7029, 7043, 7051, + 7060, 7069, 7078, 7088, 7087, 7090, 7100, 7110, 7114, 7119, + 7118, 7123, 7133, 7138, 7144, 7149, 7154, 7156, 7158, 7160, + 7162, 7164, 7172, 7181, 7183, 7185, 7187, 7196, 7204, 7212, + 7214, 7216, 7226, 7233, 7239, 7247, 7255, 7259, 7263, 7270, + 7277, 7287, 7297, 7307, 7318, 7327, 7341, 7354, 7355, 7357, + 7359, 7362, 7363, 7366, 7367, 7370, 7371, 7374, 7375, 7378, + 7379, 7381, 7383, 7386, 7398, 7397, 7412, 7411, 7421, 7422, + 7425, 7426, 7430, 7431, 7432, 7440, 7439, 7451, 7452, 7455, + 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, + 7465, 7468, 7469, 7473, 7472, 7481, 7482, 7485, 7486, 7487, + 7491, 7490, 7500, 7504, 7508, 7520, 7520, 7528, 7529, 7530, + 7535, 7545, 7544, 7560, 7578, 7589, 7596, 7606, 7577, 7611, + 7620, 7621, 7624, 7625, 7637, 7641, 7642, 7643, 7645, 7647, + 7650, 7651, 7654, 7659, 7666, 7671, 7677, 7679, 7682, 7683, + 7686, 7691, 7697, 7699, 7706, 7707, 7708, 7711, 7713, 7718, + 7719, 7724, 7725, 7731, 7736, 7738, 7740, 7745, 7747, 7758, + 7771, 7792, 7793, 7794, 7803, 7804, 7805, 7810, 7811, 7812, + 7813, 7814, 7828, 7842, 7843, 7844, 7847, 7848, 7849, 7850, + 7858, 7873, 7874, 7877, 7883, 7894, 7897, 7933, 7937, 7945, + 7949, 8017, 8032, 8056, 8057, 8073, 8083, 8086, 8087, 8088, + 8092, 8096, 8097, 8122, 8134, 8147, 8159, 8160, 8169, 8170, + 8179, 8180, 8181, 8184, 8197, 8210, 8224, 8225, 8226, 8227, + 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 8237, + 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 8247, + 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 8257, + 8258, 8259, 8260, 8270, 8271, 8272, 8273, 8274, 8275, 8276, + 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, + 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, + 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, + 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, + 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, + 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, + 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, + 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, + 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, + 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, + 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, + 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, + 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, + 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, + 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, + 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, + 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, + 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, + 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, + 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, + 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, + 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, + 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8512, + 8511, 8525, 8526, 8529, 8530, 8533, 8533, 8610, 8611, 8612, + 8613, 8617, 8618, 8622, 8623, 8624, 8625, 8629, 8630, 8631, + 8632, 8636, 8637, 8640, 8720, 8733, 8737, 8742, 8749, 8764, + 8777, 8798, 8805, 8843, 8886, 8900, 8901, 8902, 8903, 8907, + 8908, 8915, 8924, 8925, 8926, 8927, 8928, 8936, 8935, 8951, + 8952, 8955, 8956, 8959, 8967, 8968, 8969, 8970, 8975, 8974, + 8995, 9007, 9020, 9019, 9038, 9039, 9043, 9044, 9048, 9049, + 9050, 9051, 9053, 9052, 9063, 9064, 9065, 9066, 9067, 9073, + 9078, 9085, 9098, 9110, 9117, 9122, 9130, 9143, 9157, 9159, + 9162, 9163, 9170, 9172, 9176, 9177, 9180, 9180, 9181, 9181, + 9182, 9182, 9183, 9183, 9184, 9185, 9186, 9187, 9188, 9189, + 9190, 9191, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, + 9200, 9201, 9202, 9203, 9204, 9205, 9206, 9211, 9212, 9216, + 9217, 9221, 9231, 9241, 9254, 9269, 9282, 9295, 9308, 9309, + 9318, 9319, 9328, 9353, 9355, 9362, 9366, 9369, 9370, 9373, + 9394, 9395, 9399, 9403, 9407, 9414, 9415, 9418, 9419, 9423, + 9424, 9430, 9436, 9442, 9452, 9451, 9461, 9462, 9466, 9467, + 9468, 9472, 9473, 9474, 9478, 9479, 9483, 9493, 9500, 9510, + 9519, 9533, 9534, 9539, 9538, 9573, 9574, 9575, 9579, 9579, + 9603, 9604, 9608, 9609, 9610, 9614, 9619, 9618, 9638, 9644, + 9665, 9687, 9689, 9694, 9696, 9698, 9710, 9720, 9733, 9735, + 9737, 9742, 9747, 9749, 9751, 9757, 9758, 9764, 9765, 9767, + 9773, 9772, 9787, 9788, 9792, 9797, 9805, 9805, 9823, 9832, + 9845, 9846, 9848, 9850, 9863, 9861, 9938, 9937, 9947, 9976, + 9985, 9994, 9946, 10018, 10022, 10026, 10030, 10034, 10038, 10044, + 10051, 10058, 10067, 10068, 10072, 10073, 10074, 10078, 10079, 10083, + 10084, 10084, 10089, 10090 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "END_OF_INPUT", "ABORT_SYM", "ACTION", @@ -3240,7 +3369,7 @@ # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -3306,7 +3435,7 @@ # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned short yyr1[] = +static const yytype_uint16 yyr1[] = { 0, 593, 594, 594, 595, 595, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, @@ -3520,7 +3649,7 @@ }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -3736,7 +3865,7 @@ /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned short yydefact[] = +static const yytype_uint16 yydefact[] = { 0, 2, 2035, 650, 0, 1984, 0, 0, 0, 0, 0, 1986, 94, 54, 1289, 1398, 1399, 1212, 1228, 0, @@ -4115,8 +4244,8 @@ 156, 172, 166, 163 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { -1, 52, 53, 54, 55, 56, 57, 990, 58, 538, 937, 1404, 1405, 59, 435, 60, 715, 1149, 1150, 1151, @@ -4571,7 +4700,7 @@ }; /* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = +static const yytype_int16 yypgoto[] = { -3252, -3252, -3252, -3251, -3252, -3252, -3252, -3252, -3252, -3252, -3252, -3252, 996, -3252, -3252, -3252, -3252, -3252, 1240, -1426, @@ -4648,7 +4777,7 @@ number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -2038 -static const short yytable[] = +static const yytype_int16 yytable[] = { 397, 725, 661, 690, 1104, 574, 1013, 1218, 1173, 1174, 1175, 1791, 397, 1433, 932, 397, 1040, 683, 683, 683, @@ -9168,7 +9297,7 @@ 0, 0, 392, 0, 393, 0, 0, 0, 0, 395 }; -static const short yycheck[] = +static const yytype_int16 yycheck[] = { 7, 510, 460, 480, 694, 435, 611, 779, 734, 735, 736, 1320, 19, 985, 535, 22, 636, 472, 473, 474, @@ -13690,7 +13819,7 @@ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned short yystos[] = +static const yytype_uint16 yystos[] = { 0, 3, 13, 14, 26, 28, 47, 48, 53, 57, 58, 70, 87, 106, 115, 116, 117, 128, 129, 151, @@ -14069,22 +14198,6 @@ 660, 173, 1151, 654 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -14110,30 +14223,63 @@ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* 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). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - ((Current).first_line = (Rhs)[1].first_line, \ - (Current).first_column = (Rhs)[1].first_column, \ - (Current).last_line = (Rhs)[N].last_line, \ - (Current).last_column = (Rhs)[N].last_column) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (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 (YYID (0)) #endif + +/* 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 YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -14154,42 +14300,96 @@ do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -14198,45 +14398,52 @@ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -14251,13 +14458,9 @@ if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -14267,45 +14470,47 @@ #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -14315,70 +14520,192 @@ # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; - + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif - } - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; - switch (yytype) - { - default: - break; + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + switch (yytype) { default: - break; + break; } } @@ -14386,13 +14713,13 @@ /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -14409,14 +14736,18 @@ `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -14426,22 +14757,28 @@ #endif #endif { - /* The lookahead symbol. */ + /* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif /* Three stacks and their tools: `yyss': related to states, @@ -14452,18 +14789,18 @@ to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -14472,9 +14809,9 @@ YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* 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")); @@ -14498,8 +14835,7 @@ `------------------------------------------------------------*/ 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. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -14512,18 +14848,18 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* 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 ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -14534,21 +14870,21 @@ } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -14579,19 +14915,17 @@ `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ - + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -14606,7 +14940,7 @@ else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -14626,22 +14960,21 @@ if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; - /* Discard the token being shifted unless it is eof. */ + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; + yystate = yyn; *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; goto yynewstate; @@ -14704,7 +15037,7 @@ THD *thd=YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_DEALLOCATE_PREPARE; - lex->prepared_stmt_name= yyvsp[0].lex_str; + lex->prepared_stmt_name= (yyvsp[(3) - (3)].lex_str); } break; @@ -14714,7 +15047,7 @@ THD *thd=YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_PREPARE; - lex->prepared_stmt_name= yyvsp[-2].lex_str; + lex->prepared_stmt_name= (yyvsp[(2) - (4)].lex_str); } break; @@ -14723,7 +15056,7 @@ { THD *thd=YYTHD; LEX *lex= thd->lex; - lex->prepared_stmt_code= yyvsp[0].lex_str; + lex->prepared_stmt_code= (yyvsp[(1) - (1)].lex_str); lex->prepared_stmt_code_is_varref= FALSE; } break; @@ -14733,7 +15066,7 @@ { THD *thd=YYTHD; LEX *lex= thd->lex; - lex->prepared_stmt_code= yyvsp[0].lex_str; + lex->prepared_stmt_code= (yyvsp[(2) - (2)].lex_str); lex->prepared_stmt_code_is_varref= TRUE; } break; @@ -14744,7 +15077,7 @@ THD *thd=YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_EXECUTE; - lex->prepared_stmt_name= yyvsp[0].lex_str; + lex->prepared_stmt_name= (yyvsp[(2) - (2)].lex_str); } break; @@ -14757,7 +15090,7 @@ #line 1361 "sql_yacc.yy" { LEX *lex=Lex; - LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&yyvsp[0].lex_str, sizeof(LEX_STRING)); + LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&(yyvsp[(2) - (2)].lex_str), sizeof(LEX_STRING)); if (!lexstr || lex->prepared_stmt_params.push_back(lexstr)) MYSQL_YYABORT; } @@ -14779,7 +15112,7 @@ { LEX *lex= Lex; lex->sql_command= SQLCOM_HELP; - lex->help_arg= yyvsp[0].lex_str.str; + lex->help_arg= (yyvsp[(3) - (3)].lex_str).str; } break; @@ -14800,42 +15133,42 @@ case 72: #line 1406 "sql_yacc.yy" { - Lex->mi.host = yyvsp[0].lex_str.str; + Lex->mi.host = (yyvsp[(3) - (3)].lex_str).str; } break; case 73: #line 1411 "sql_yacc.yy" { - Lex->mi.user = yyvsp[0].lex_str.str; + Lex->mi.user = (yyvsp[(3) - (3)].lex_str).str; } break; case 74: #line 1416 "sql_yacc.yy" { - Lex->mi.password = yyvsp[0].lex_str.str; + Lex->mi.password = (yyvsp[(3) - (3)].lex_str).str; } break; case 75: #line 1421 "sql_yacc.yy" { - Lex->mi.port = yyvsp[0].ulong_num; + Lex->mi.port = (yyvsp[(3) - (3)].ulong_num); } break; case 76: #line 1426 "sql_yacc.yy" { - Lex->mi.connect_retry = yyvsp[0].ulong_num; + Lex->mi.connect_retry = (yyvsp[(3) - (3)].ulong_num); } break; case 77: #line 1430 "sql_yacc.yy" { - Lex->mi.ssl= yyvsp[0].ulong_num ? + Lex->mi.ssl= (yyvsp[(3) - (3)].ulong_num) ? LEX_MASTER_INFO::SSL_ENABLE : LEX_MASTER_INFO::SSL_DISABLE; } break; @@ -14843,49 +15176,49 @@ case 78: #line 1435 "sql_yacc.yy" { - Lex->mi.ssl_ca= yyvsp[0].lex_str.str; + Lex->mi.ssl_ca= (yyvsp[(3) - (3)].lex_str).str; } break; case 79: #line 1439 "sql_yacc.yy" { - Lex->mi.ssl_capath= yyvsp[0].lex_str.str; + Lex->mi.ssl_capath= (yyvsp[(3) - (3)].lex_str).str; } break; case 80: #line 1443 "sql_yacc.yy" { - Lex->mi.ssl_cert= yyvsp[0].lex_str.str; + Lex->mi.ssl_cert= (yyvsp[(3) - (3)].lex_str).str; } break; case 81: #line 1447 "sql_yacc.yy" { - Lex->mi.ssl_cipher= yyvsp[0].lex_str.str; + Lex->mi.ssl_cipher= (yyvsp[(3) - (3)].lex_str).str; } break; case 82: #line 1451 "sql_yacc.yy" { - Lex->mi.ssl_key= yyvsp[0].lex_str.str; + Lex->mi.ssl_key= (yyvsp[(3) - (3)].lex_str).str; } break; case 84: #line 1460 "sql_yacc.yy" { - Lex->mi.log_file_name = yyvsp[0].lex_str.str; + Lex->mi.log_file_name = (yyvsp[(3) - (3)].lex_str).str; } break; case 85: #line 1464 "sql_yacc.yy" { - Lex->mi.pos = yyvsp[0].ulonglong_number; + Lex->mi.pos = (yyvsp[(3) - (3)].ulonglong_number); /* If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it instead of causing subsequent errors. @@ -14904,14 +15237,14 @@ case 86: #line 1480 "sql_yacc.yy" { - Lex->mi.relay_log_name = yyvsp[0].lex_str.str; + Lex->mi.relay_log_name = (yyvsp[(3) - (3)].lex_str).str; } break; case 87: #line 1484 "sql_yacc.yy" { - Lex->mi.relay_log_pos = yyvsp[0].ulong_num; + Lex->mi.relay_log_pos = (yyvsp[(3) - (3)].ulong_num); /* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */ Lex->mi.relay_log_pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.relay_log_pos); } @@ -14923,7 +15256,7 @@ THD *thd= YYTHD; LEX *lex=Lex; lex->sql_command= SQLCOM_CREATE_TABLE; - if (!lex->select_lex.add_table_to_list(thd, yyvsp[0].table, NULL, + if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(5) - (5)].table), NULL, TL_OPTION_UPDATING, TL_WRITE)) MYSQL_YYABORT; @@ -14934,7 +15267,7 @@ lex->col_list.empty(); lex->change=NullS; bzero((char*) &lex->create_info,sizeof(lex->create_info)); - lex->create_info.options=yyvsp[-3].num | yyvsp[-1].num; + lex->create_info.options=(yyvsp[(2) - (5)].num) | (yyvsp[(4) - (5)].num); lex->create_info.db_type= (enum db_type) lex->thd->variables.table_type; lex->create_info.default_table_charset= NULL; } @@ -14950,7 +15283,7 @@ { LEX *lex=Lex; lex->sql_command= SQLCOM_CREATE_INDEX; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[0].table, NULL, + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(7) - (7)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; lex->alter_info.reset(); @@ -14965,12 +15298,12 @@ { LEX *lex=Lex; #ifdef ENABLE_SENNA - Key *key= new Key(yyvsp[-9].key_type,yyvsp[-7].lex_str.str, yyvsp[-6].key_alg, 0, lex->col_list, + Key *key= new Key((yyvsp[(2) - (11)].key_type),(yyvsp[(4) - (11)].lex_str).str, (yyvsp[(5) - (11)].key_alg), 0, lex->col_list, lex->senna_flags, lex->senna_initial_n_segments); lex->alter_info.key_list.push_back(key); lex->senna_clear(); #else /* ENABLE_SENNA */ - Key *key= new Key(yyvsp[-9].key_type, yyvsp[-7].lex_str.str, yyvsp[-6].key_alg, 0, lex->col_list); + Key *key= new Key((yyvsp[(2) - (11)].key_type), (yyvsp[(4) - (11)].lex_str).str, (yyvsp[(5) - (11)].key_alg), 0, lex->col_list); lex->alter_info.key_list.push_back(key); #endif /* ENABLE_SENNA */ lex->col_list.empty(); @@ -14990,8 +15323,8 @@ { LEX *lex=Lex; lex->sql_command=SQLCOM_CREATE_DB; - lex->name=yyvsp[-2].lex_str.str; - lex->create_info.options=yyvsp[-3].num; + lex->name=(yyvsp[(4) - (6)].lex_str).str; + lex->create_info.options=(yyvsp[(3) - (6)].num); } break; @@ -15034,18 +15367,18 @@ case 98: #line 1585 "sql_yacc.yy" { - if (!yyvsp[-2].lex_str.str || check_db_name(yyvsp[-2].lex_str.str)) + if (!(yyvsp[(1) - (3)].lex_str).str || check_db_name((yyvsp[(1) - (3)].lex_str).str)) { - my_error(ER_WRONG_DB_NAME, MYF(0), yyvsp[-2].lex_str.str); + my_error(ER_WRONG_DB_NAME, MYF(0), (yyvsp[(1) - (3)].lex_str).str); MYSQL_YYABORT; } - if (check_routine_name(yyvsp[0].lex_str)) + if (check_routine_name((yyvsp[(3) - (3)].lex_str))) { - my_error(ER_SP_WRONG_NAME, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_WRONG_NAME, MYF(0), (yyvsp[(3) - (3)].lex_str).str); MYSQL_YYABORT; } - yyval.spname= new sp_name(yyvsp[-2].lex_str, yyvsp[0].lex_str, true); - yyval.spname->init_qname(YYTHD); + (yyval.spname)= new sp_name((yyvsp[(1) - (3)].lex_str), (yyvsp[(3) - (3)].lex_str), true); + (yyval.spname)->init_qname(YYTHD); } break; @@ -15054,16 +15387,16 @@ { THD *thd= YYTHD; LEX_STRING db; - if (check_routine_name(yyvsp[0].lex_str)) + if (check_routine_name((yyvsp[(1) - (1)].lex_str))) { - my_error(ER_SP_WRONG_NAME, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_WRONG_NAME, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } if (thd->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; - yyval.spname= new sp_name(db, yyvsp[0].lex_str, false); - if (yyval.spname) - yyval.spname->init_qname(YYTHD); + (yyval.spname)= new sp_name(db, (yyvsp[(1) - (1)].lex_str), false); + if ((yyval.spname)) + (yyval.spname)->init_qname(YYTHD); } break; @@ -15084,8 +15417,8 @@ } lex->sql_command = SQLCOM_CREATE_FUNCTION; lex->udf.name = lex->spname->m_name; - lex->udf.returns=(Item_result) yyvsp[-2].num; - lex->udf.dl=yyvsp[0].lex_str.str; + lex->udf.returns=(Item_result) (yyvsp[(2) - (4)].num); + lex->udf.dl=(yyvsp[(4) - (4)].lex_str).str; } break; @@ -15160,7 +15493,7 @@ sp_head *sp= lex->sphead; if (sp->fill_field_definition(YYTHD, lex, - (enum enum_field_types) yyvsp[0].num, + (enum enum_field_types) (yyvsp[(8) - (8)].num), &sp->m_return_field_def)) MYSQL_YYABORT; @@ -15225,7 +15558,7 @@ case 111: #line 1747 "sql_yacc.yy" - { Lex->sp_chistics.comment= yyvsp[0].lex_str; } + { Lex->sp_chistics.comment= (yyvsp[(2) - (2)].lex_str); } break; case 112: @@ -15293,9 +15626,9 @@ LEX *lex = Lex; lex->sql_command= SQLCOM_CALL; - lex->spname= yyvsp[0].spname; + lex->spname= (yyvsp[(2) - (2)].spname); lex->value_list.empty(); - sp_add_used_routine(lex, YYTHD, yyvsp[0].spname, TYPE_ENUM_PROCEDURE); + sp_add_used_routine(lex, YYTHD, (yyvsp[(2) - (2)].spname), TYPE_ENUM_PROCEDURE); } break; @@ -15307,14 +15640,14 @@ case 129: #line 1806 "sql_yacc.yy" { - Lex->value_list.push_back(yyvsp[0].item); + Lex->value_list.push_back((yyvsp[(3) - (3)].item)); } break; case 130: #line 1810 "sql_yacc.yy" { - Lex->value_list.push_back(yyvsp[0].item); + Lex->value_list.push_back((yyvsp[(1) - (1)].item)); } break; @@ -15344,17 +15677,17 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_variable(&yyvsp[-2].lex_str, TRUE)) + if (spc->find_variable(&(yyvsp[(1) - (3)].lex_str), TRUE)) { - my_error(ER_SP_DUP_PARAM, MYF(0), yyvsp[-2].lex_str.str); + my_error(ER_SP_DUP_PARAM, MYF(0), (yyvsp[(1) - (3)].lex_str).str); MYSQL_YYABORT; } - sp_variable_t *spvar= spc->push_variable(&yyvsp[-2].lex_str, - (enum enum_field_types)yyvsp[0].num, + sp_variable_t *spvar= spc->push_variable(&(yyvsp[(1) - (3)].lex_str), + (enum enum_field_types)(yyvsp[(3) - (3)].num), sp_param_in); if (lex->sphead->fill_field_definition(YYTHD, lex, - (enum enum_field_types) yyvsp[0].num, + (enum enum_field_types) (yyvsp[(3) - (3)].num), &spvar->field_def)) { MYSQL_YYABORT; @@ -15370,17 +15703,17 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_variable(&yyvsp[-1].lex_str, TRUE)) + if (spc->find_variable(&(yyvsp[(3) - (4)].lex_str), TRUE)) { - my_error(ER_SP_DUP_PARAM, MYF(0), yyvsp[-1].lex_str.str); + my_error(ER_SP_DUP_PARAM, MYF(0), (yyvsp[(3) - (4)].lex_str).str); MYSQL_YYABORT; } - sp_variable_t *spvar= spc->push_variable(&yyvsp[-1].lex_str, - (enum enum_field_types)yyvsp[0].num, - (sp_param_mode_t)yyvsp[-3].num); + sp_variable_t *spvar= spc->push_variable(&(yyvsp[(3) - (4)].lex_str), + (enum enum_field_types)(yyvsp[(4) - (4)].num), + (sp_param_mode_t)(yyvsp[(1) - (4)].num)); if (lex->sphead->fill_field_definition(YYTHD, lex, - (enum enum_field_types) yyvsp[0].num, + (enum enum_field_types) (yyvsp[(4) - (4)].num), &spvar->field_def)) { MYSQL_YYABORT; @@ -15392,22 +15725,22 @@ case 142: #line 1910 "sql_yacc.yy" - { yyval.num= sp_param_in; } + { (yyval.num)= sp_param_in; } break; case 143: #line 1911 "sql_yacc.yy" - { yyval.num= sp_param_in; } + { (yyval.num)= sp_param_in; } break; case 144: #line 1912 "sql_yacc.yy" - { yyval.num= sp_param_out; } + { (yyval.num)= sp_param_out; } break; case 145: #line 1913 "sql_yacc.yy" - { yyval.num= sp_param_inout; } + { (yyval.num)= sp_param_inout; } break; case 146: @@ -15423,7 +15756,7 @@ case 150: #line 1928 "sql_yacc.yy" { - yyval.spblock.vars= yyval.spblock.conds= yyval.spblock.hndlrs= yyval.spblock.curs= 0; + (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0; } break; @@ -15434,22 +15767,22 @@ because letting the grammar rules reflect it caused tricky shift/reduce conflicts with the wrong result. (And we get better error handling this way.) */ - if ((yyvsp[-1].spblock.vars || yyvsp[-1].spblock.conds) && (yyvsp[-2].spblock.curs || yyvsp[-2].spblock.hndlrs)) + if (((yyvsp[(2) - (3)].spblock).vars || (yyvsp[(2) - (3)].spblock).conds) && ((yyvsp[(1) - (3)].spblock).curs || (yyvsp[(1) - (3)].spblock).hndlrs)) { /* Variable or condition following cursor or handler */ my_message(ER_SP_VARCOND_AFTER_CURSHNDLR, ER(ER_SP_VARCOND_AFTER_CURSHNDLR), MYF(0)); MYSQL_YYABORT; } - if (yyvsp[-1].spblock.curs && yyvsp[-2].spblock.hndlrs) + if ((yyvsp[(2) - (3)].spblock).curs && (yyvsp[(1) - (3)].spblock).hndlrs) { /* Cursor following handler */ my_message(ER_SP_CURSOR_AFTER_HANDLER, ER(ER_SP_CURSOR_AFTER_HANDLER), MYF(0)); MYSQL_YYABORT; } - yyval.spblock.vars= yyvsp[-2].spblock.vars + yyvsp[-1].spblock.vars; - yyval.spblock.conds= yyvsp[-2].spblock.conds + yyvsp[-1].spblock.conds; - yyval.spblock.hndlrs= yyvsp[-2].spblock.hndlrs + yyvsp[-1].spblock.hndlrs; - yyval.spblock.curs= yyvsp[-2].spblock.curs + yyvsp[-1].spblock.curs; + (yyval.spblock).vars= (yyvsp[(1) - (3)].spblock).vars + (yyvsp[(2) - (3)].spblock).vars; + (yyval.spblock).conds= (yyvsp[(1) - (3)].spblock).conds + (yyvsp[(2) - (3)].spblock).conds; + (yyval.spblock).hndlrs= (yyvsp[(1) - (3)].spblock).hndlrs + (yyvsp[(2) - (3)].spblock).hndlrs; + (yyval.spblock).curs= (yyvsp[(1) - (3)].spblock).curs + (yyvsp[(2) - (3)].spblock).curs; } break; @@ -15459,7 +15792,7 @@ LEX *lex= Lex; lex->sphead->reset_lex(YYTHD); - lex->spcont->declare_var_boundary(yyvsp[0].num); + lex->spcont->declare_var_boundary((yyvsp[(2) - (2)].num)); } break; @@ -15469,8 +15802,8 @@ LEX *lex= Lex; sp_pcontext *pctx= lex->spcont; uint num_vars= pctx->context_var_count(); - enum enum_field_types var_type= (enum enum_field_types) yyvsp[-1].num; - Item *dflt_value_item= yyvsp[0].item; + enum enum_field_types var_type= (enum enum_field_types) (yyvsp[(4) - (5)].num); + Item *dflt_value_item= (yyvsp[(5) - (5)].item); if (!dflt_value_item) { @@ -15478,7 +15811,7 @@ /* QQ Set to the var_type with null_value? */ } - for (uint i = num_vars-yyvsp[-3].num ; i < num_vars ; i++) + for (uint i = num_vars-(yyvsp[(2) - (5)].num) ; i < num_vars ; i++) { uint var_idx= pctx->var_context2runtime(i); sp_variable_t *spvar= pctx->find_variable(var_idx); @@ -15509,8 +15842,8 @@ pctx->declare_var_boundary(0); lex->sphead->restore_lex(YYTHD); - yyval.spblock.vars= yyvsp[-3].num; - yyval.spblock.conds= yyval.spblock.hndlrs= yyval.spblock.curs= 0; + (yyval.spblock).vars= (yyvsp[(2) - (5)].num); + (yyval.spblock).conds= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0; } break; @@ -15520,14 +15853,14 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_cond(&yyvsp[-3].lex_str, TRUE)) + if (spc->find_cond(&(yyvsp[(2) - (5)].lex_str), TRUE)) { - my_error(ER_SP_DUP_COND, MYF(0), yyvsp[-3].lex_str.str); + my_error(ER_SP_DUP_COND, MYF(0), (yyvsp[(2) - (5)].lex_str).str); MYSQL_YYABORT; } - YYTHD->lex->spcont->push_cond(&yyvsp[-3].lex_str, yyvsp[0].spcondtype); - yyval.spblock.vars= yyval.spblock.hndlrs= yyval.spblock.curs= 0; - yyval.spblock.conds= 1; + YYTHD->lex->spcont->push_cond(&(yyvsp[(2) - (5)].lex_str), (yyvsp[(5) - (5)].spcondtype)); + (yyval.spblock).vars= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0; + (yyval.spblock).conds= 1; } break; @@ -15541,7 +15874,7 @@ sp_pcontext *ctx= lex->spcont; sp_instr_hpush_jump *i= - new sp_instr_hpush_jump(sp->instructions(), ctx, yyvsp[-2].num, + new sp_instr_hpush_jump(sp->instructions(), ctx, (yyvsp[(2) - (4)].num), ctx->current_var_count()); sp->add_instr(i); @@ -15558,7 +15891,7 @@ sp_label_t *hlab= lex->spcont->pop_label(); /* After this hdlr */ sp_instr_hreturn *i; - if (yyvsp[-5].num == SP_HANDLER_CONTINUE) + if ((yyvsp[(2) - (7)].num) == SP_HANDLER_CONTINUE) { i= new sp_instr_hreturn(sp->instructions(), ctx, ctx->current_var_count()); @@ -15575,9 +15908,9 @@ lex->spcont= ctx->pop_context(); - yyval.spblock.vars= yyval.spblock.conds= yyval.spblock.curs= 0; - yyval.spblock.hndlrs= yyvsp[-1].num; - lex->spcont->add_handlers(yyvsp[-1].num); + (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).curs= 0; + (yyval.spblock).hndlrs= (yyvsp[(6) - (7)].num); + lex->spcont->add_handlers((yyvsp[(6) - (7)].num)); } break; @@ -15590,18 +15923,18 @@ uint offp; sp_instr_cpush *i; - if (ctx->find_cursor(&yyvsp[-3].lex_str, &offp, TRUE)) + if (ctx->find_cursor(&(yyvsp[(2) - (5)].lex_str), &offp, TRUE)) { - my_error(ER_SP_DUP_CURS, MYF(0), yyvsp[-3].lex_str.str); - delete yyvsp[0].lex; + my_error(ER_SP_DUP_CURS, MYF(0), (yyvsp[(2) - (5)].lex_str).str); + delete (yyvsp[(5) - (5)].lex); MYSQL_YYABORT; } - i= new sp_instr_cpush(sp->instructions(), ctx, yyvsp[0].lex, + i= new sp_instr_cpush(sp->instructions(), ctx, (yyvsp[(5) - (5)].lex), ctx->current_cursor_count()); sp->add_instr(i); - ctx->push_cursor(&yyvsp[-3].lex_str); - yyval.spblock.vars= yyval.spblock.conds= yyval.spblock.hndlrs= 0; - yyval.spblock.curs= 1; + ctx->push_cursor(&(yyvsp[(2) - (5)].lex_str)); + (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).hndlrs= 0; + (yyval.spblock).curs= 1; } break; @@ -15635,29 +15968,29 @@ MYSQL_YYABORT; } lex->sp_lex_in_use= TRUE; - yyval.lex= lex; + (yyval.lex)= lex; lex->sphead->restore_lex(YYTHD); } break; case 160: #line 2126 "sql_yacc.yy" - { yyval.num= SP_HANDLER_EXIT; } + { (yyval.num)= SP_HANDLER_EXIT; } break; case 161: #line 2127 "sql_yacc.yy" - { yyval.num= SP_HANDLER_CONTINUE; } + { (yyval.num)= SP_HANDLER_CONTINUE; } break; case 162: #line 2133 "sql_yacc.yy" - { yyval.num= 1; } + { (yyval.num)= 1; } break; case 163: #line 2135 "sql_yacc.yy" - { yyval.num+= 1; } + { (yyval.num)+= 1; } break; case 164: @@ -15667,7 +16000,7 @@ sp_head *sp= lex->sphead; sp_pcontext *ctx= lex->spcont->parent_context(); - if (ctx->find_handler(yyvsp[0].spcondtype)) + if (ctx->find_handler((yyvsp[(1) - (1)].spcondtype))) { my_message(ER_SP_DUP_HANDLER, ER(ER_SP_DUP_HANDLER), MYF(0)); MYSQL_YYABORT; @@ -15677,8 +16010,8 @@ sp_instr_hpush_jump *i= (sp_instr_hpush_jump *)sp->last_instruction(); - i->add_condition(yyvsp[0].spcondtype); - ctx->push_handler(yyvsp[0].spcondtype); + i->add_condition((yyvsp[(1) - (1)].spcondtype)); + ctx->push_handler((yyvsp[(1) - (1)].spcondtype)); } } break; @@ -15686,24 +16019,24 @@ case 165: #line 2163 "sql_yacc.yy" { /* mysql errno */ - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::number; - yyval.spcondtype->mysqlerr= yyvsp[0].ulong_num; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::number; + (yyval.spcondtype)->mysqlerr= (yyvsp[(1) - (1)].ulong_num); } break; case 166: #line 2169 "sql_yacc.yy" { /* SQLSTATE */ - if (!sp_cond_check(&yyvsp[0].lex_str)) + if (!sp_cond_check(&(yyvsp[(3) - (3)].lex_str))) { - my_error(ER_SP_BAD_SQLSTATE, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_BAD_SQLSTATE, MYF(0), (yyvsp[(3) - (3)].lex_str).str); MYSQL_YYABORT; } - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::state; - memcpy(yyval.spcondtype->sqlstate, yyvsp[0].lex_str.str, 5); - yyval.spcondtype->sqlstate[5]= '\0'; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::state; + memcpy((yyval.spcondtype)->sqlstate, (yyvsp[(3) - (3)].lex_str).str, 5); + (yyval.spcondtype)->sqlstate[5]= '\0'; } break; @@ -15720,17 +16053,17 @@ case 169: #line 2189 "sql_yacc.yy" { - yyval.spcondtype= yyvsp[0].spcondtype; + (yyval.spcondtype)= (yyvsp[(1) - (1)].spcondtype); } break; case 170: #line 2193 "sql_yacc.yy" { - yyval.spcondtype= Lex->spcont->find_cond(&yyvsp[0].lex_str); - if (yyval.spcondtype == NULL) + (yyval.spcondtype)= Lex->spcont->find_cond(&(yyvsp[(1) - (1)].lex_str)); + if ((yyval.spcondtype) == NULL) { - my_error(ER_SP_COND_MISMATCH, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_COND_MISMATCH, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -15739,24 +16072,24 @@ case 171: #line 2202 "sql_yacc.yy" { - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::warning; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::warning; } break; case 172: #line 2207 "sql_yacc.yy" { - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::notfound; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::notfound; } break; case 173: #line 2212 "sql_yacc.yy" { - yyval.spcondtype= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); - yyval.spcondtype->type= sp_cond_type_t::exception; + (yyval.spcondtype)= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + (yyval.spcondtype)->type= sp_cond_type_t::exception; } break; @@ -15768,13 +16101,13 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_variable(&yyvsp[0].lex_str, TRUE)) + if (spc->find_variable(&(yyvsp[(1) - (1)].lex_str), TRUE)) { - my_error(ER_SP_DUP_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_DUP_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } - spc->push_variable(&yyvsp[0].lex_str, (enum_field_types)0, sp_param_in); - yyval.num= 1; + spc->push_variable(&(yyvsp[(1) - (1)].lex_str), (enum_field_types)0, sp_param_in); + (yyval.num)= 1; } break; @@ -15786,24 +16119,24 @@ LEX *lex= Lex; sp_pcontext *spc= lex->spcont; - if (spc->find_variable(&yyvsp[0].lex_str, TRUE)) + if (spc->find_variable(&(yyvsp[(3) - (3)].lex_str), TRUE)) { - my_error(ER_SP_DUP_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_DUP_VAR, MYF(0), (yyvsp[(3) - (3)].lex_str).str); MYSQL_YYABORT; } - spc->push_variable(&yyvsp[0].lex_str, (enum_field_types)0, sp_param_in); - yyval.num= yyvsp[-2].num + 1; + spc->push_variable(&(yyvsp[(3) - (3)].lex_str), (enum_field_types)0, sp_param_in); + (yyval.num)= (yyvsp[(1) - (3)].num) + 1; } break; case 176: #line 2252 "sql_yacc.yy" - { yyval.item = NULL; } + { (yyval.item) = NULL; } break; case 177: #line 2253 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } + { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 178: @@ -15882,7 +16215,7 @@ { sp_instr_freturn *i; - i= new sp_instr_freturn(sp->instructions(), lex->spcont, yyvsp[0].item, + i= new sp_instr_freturn(sp->instructions(), lex->spcont, (yyvsp[(3) - (3)].item), sp->m_return_field_def.sql_type, lex); sp->add_instr(i); sp->m_flags|= sp_head::HAS_RETURN; @@ -15930,11 +16263,11 @@ LEX *lex= Lex; sp_head *sp = lex->sphead; sp_pcontext *ctx= lex->spcont; - sp_label_t *lab= ctx->find_label(yyvsp[0].lex_str.str); + sp_label_t *lab= ctx->find_label((yyvsp[(2) - (2)].lex_str).str); if (! lab) { - my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", yyvsp[0].lex_str.str); + my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", (yyvsp[(2) - (2)].lex_str).str); MYSQL_YYABORT; } else @@ -15962,11 +16295,11 @@ LEX *lex= Lex; sp_head *sp= lex->sphead; sp_pcontext *ctx= lex->spcont; - sp_label_t *lab= ctx->find_label(yyvsp[0].lex_str.str); + sp_label_t *lab= ctx->find_label((yyvsp[(2) - (2)].lex_str).str); if (! lab || lab->type != SP_LAB_ITER) { - my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", yyvsp[0].lex_str.str); + my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", (yyvsp[(2) - (2)].lex_str).str); MYSQL_YYABORT; } else @@ -15995,9 +16328,9 @@ uint offset; sp_instr_copen *i; - if (! lex->spcont->find_cursor(&yyvsp[0].lex_str, &offset)) + if (! lex->spcont->find_cursor(&(yyvsp[(2) - (2)].lex_str), &offset)) { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(2) - (2)].lex_str).str); MYSQL_YYABORT; } i= new sp_instr_copen(sp->instructions(), lex->spcont, offset); @@ -16013,9 +16346,9 @@ uint offset; sp_instr_cfetch *i; - if (! lex->spcont->find_cursor(&yyvsp[-1].lex_str, &offset)) + if (! lex->spcont->find_cursor(&(yyvsp[(3) - (4)].lex_str), &offset)) { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), yyvsp[-1].lex_str.str); + my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(3) - (4)].lex_str).str); MYSQL_YYABORT; } i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset); @@ -16036,9 +16369,9 @@ uint offset; sp_instr_cclose *i; - if (! lex->spcont->find_cursor(&yyvsp[0].lex_str, &offset)) + if (! lex->spcont->find_cursor(&(yyvsp[(2) - (2)].lex_str), &offset)) { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(2) - (2)].lex_str).str); MYSQL_YYABORT; } i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset); @@ -16054,9 +16387,9 @@ sp_pcontext *spc= lex->spcont; sp_variable_t *spv; - if (!spc || !(spv = spc->find_variable(&yyvsp[0].lex_str))) + if (!spc || !(spv = spc->find_variable(&(yyvsp[(1) - (1)].lex_str)))) { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } else @@ -16077,9 +16410,9 @@ sp_pcontext *spc= lex->spcont; sp_variable_t *spv; - if (!spc || !(spv = spc->find_variable(&yyvsp[0].lex_str))) + if (!spc || !(spv = spc->find_variable(&(yyvsp[(3) - (3)].lex_str)))) { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(3) - (3)].lex_str).str); MYSQL_YYABORT; } else @@ -16105,7 +16438,7 @@ sp_pcontext *ctx= lex->spcont; uint ip= sp->instructions(); sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx, - yyvsp[-1].item, lex); + (yyvsp[(2) - (3)].item), lex); sp->push_backpatch(i, ctx->push_label((char *)"", 0)); sp->add_cont_backpatch(i); @@ -16150,7 +16483,7 @@ #line 2557 "sql_yacc.yy" { LEX *lex= Lex; - if (case_stmt_action_expr(lex, yyvsp[0].item)) + if (case_stmt_action_expr(lex, (yyvsp[(3) - (3)].item))) MYSQL_YYABORT; lex->sphead->restore_lex(YYTHD); /* For expr $3 */ @@ -16194,7 +16527,7 @@ /* Simple case: = */ LEX *lex= Lex; - case_stmt_action_when(lex, yyvsp[0].item, true); + case_stmt_action_when(lex, (yyvsp[(3) - (3)].item), true); lex->sphead->restore_lex(YYTHD); /* For expr $3 */ } break; @@ -16218,7 +16551,7 @@ #line 2627 "sql_yacc.yy" { LEX *lex= Lex; - case_stmt_action_when(lex, yyvsp[0].item, false); + case_stmt_action_when(lex, (yyvsp[(3) - (3)].item), false); lex->sphead->restore_lex(YYTHD); /* For expr $3 */ } break; @@ -16248,16 +16581,16 @@ { LEX *lex= Lex; sp_pcontext *ctx= lex->spcont; - sp_label_t *lab= ctx->find_label(yyvsp[-1].lex_str.str); + sp_label_t *lab= ctx->find_label((yyvsp[(1) - (2)].lex_str).str); if (lab) { - my_error(ER_SP_LABEL_REDEFINE, MYF(0), yyvsp[-1].lex_str.str); + my_error(ER_SP_LABEL_REDEFINE, MYF(0), (yyvsp[(1) - (2)].lex_str).str); MYSQL_YYABORT; } else { - lab= lex->spcont->push_label(yyvsp[-1].lex_str.str, + lab= lex->spcont->push_label((yyvsp[(1) - (2)].lex_str).str, lex->sphead->instructions()); lab->type= SP_LAB_ITER; } @@ -16269,14 +16602,14 @@ { LEX *lex= Lex; - if (yyvsp[0].lex_str.str) + if ((yyvsp[(5) - (5)].lex_str).str) { - sp_label_t *lab= lex->spcont->find_label(yyvsp[0].lex_str.str); + sp_label_t *lab= lex->spcont->find_label((yyvsp[(5) - (5)].lex_str).str); if (!lab || - my_strcasecmp(system_charset_info, yyvsp[0].lex_str.str, lab->name) != 0) + my_strcasecmp(system_charset_info, (yyvsp[(5) - (5)].lex_str).str, lab->name) != 0) { - my_error(ER_SP_LABEL_MISMATCH, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_LABEL_MISMATCH, MYF(0), (yyvsp[(5) - (5)].lex_str).str); MYSQL_YYABORT; } } @@ -16286,12 +16619,12 @@ case 227: #line 2692 "sql_yacc.yy" - { yyval.lex_str= null_lex_str; } + { (yyval.lex_str)= null_lex_str; } break; case 228: #line 2693 "sql_yacc.yy" - { yyval.lex_str= yyvsp[0].lex_str; } + { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 229: @@ -16315,12 +16648,12 @@ sp_pcontext *ctx= lex->spcont; sp->backpatch(ctx->last_label()); /* We always have a label */ - if (yyvsp[-2].spblock.hndlrs) + if ((yyvsp[(3) - (5)].spblock).hndlrs) sp->add_instr(new sp_instr_hpop(sp->instructions(), ctx, - yyvsp[-2].spblock.hndlrs)); - if (yyvsp[-2].spblock.curs) + (yyvsp[(3) - (5)].spblock).hndlrs)); + if ((yyvsp[(3) - (5)].spblock).curs) sp->add_instr(new sp_instr_cpop(sp->instructions(), ctx, - yyvsp[-2].spblock.curs)); + (yyvsp[(3) - (5)].spblock).curs)); lex->spcont= ctx->pop_context(); } break; @@ -16349,7 +16682,7 @@ sp_head *sp= lex->sphead; uint ip= sp->instructions(); sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont, - yyvsp[-1].item, lex); + (yyvsp[(3) - (4)].item), lex); /* Jumping forward */ sp->push_backpatch(i, lex->spcont->last_label()); @@ -16384,7 +16717,7 @@ uint ip= lex->sphead->instructions(); sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */ sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont, - yyvsp[-2].item, lab->ip, + (yyvsp[(5) - (7)].item), lab->ip, lex); lex->sphead->add_instr(i); lex->sphead->restore_lex(YYTHD); @@ -16432,7 +16765,7 @@ #line 2797 "sql_yacc.yy" { Lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE; - if (!Lex->select_lex.add_table_to_list(YYTHD, yyvsp[0].table, NULL, 0, TL_READ)) + if (!Lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(2) - (2)].table), NULL, 0, TL_READ)) MYSQL_YYABORT; } break; @@ -16441,7 +16774,7 @@ #line 2803 "sql_yacc.yy" { Lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE; - if (!Lex->select_lex.add_table_to_list(YYTHD, yyvsp[-1].table, NULL, 0, TL_READ)) + if (!Lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(3) - (4)].table), NULL, 0, TL_READ)) MYSQL_YYABORT; } break; @@ -16565,83 +16898,83 @@ case 265: #line 2871 "sql_yacc.yy" - { yyval.num= 0; } + { (yyval.num)= 0; } break; case 266: #line 2872 "sql_yacc.yy" - { yyval.num= yyvsp[0].num;} + { (yyval.num)= (yyvsp[(1) - (1)].num);} break; case 267: #line 2875 "sql_yacc.yy" - { yyval.num=yyvsp[0].num; } + { (yyval.num)=(yyvsp[(1) - (1)].num); } break; case 268: #line 2876 "sql_yacc.yy" - { yyval.num= yyvsp[-1].num | yyvsp[0].num; } + { (yyval.num)= (yyvsp[(1) - (2)].num) | (yyvsp[(2) - (2)].num); } break; case 269: #line 2879 "sql_yacc.yy" - { yyval.num=HA_LEX_CREATE_TMP_TABLE; } + { (yyval.num)=HA_LEX_CREATE_TMP_TABLE; } break; case 270: #line 2882 "sql_yacc.yy" - { yyval.num= 0; } + { (yyval.num)= 0; } break; case 271: #line 2883 "sql_yacc.yy" - { yyval.num=HA_LEX_CREATE_IF_NOT_EXISTS; } + { (yyval.num)=HA_LEX_CREATE_IF_NOT_EXISTS; } break; case 279: #line 2899 "sql_yacc.yy" - { Lex->create_info.db_type= yyvsp[0].db_type; Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; } + { Lex->create_info.db_type= (yyvsp[(3) - (3)].db_type); Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; } break; case 280: #line 2900 "sql_yacc.yy" - { Lex->create_info.db_type= yyvsp[0].db_type; WARN_DEPRECATED("TYPE=storage_engine","ENGINE=storage_engine"); Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; } + { Lex->create_info.db_type= (yyvsp[(3) - (3)].db_type); WARN_DEPRECATED("TYPE=storage_engine","ENGINE=storage_engine"); Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; } break; case 281: #line 2901 "sql_yacc.yy" - { Lex->create_info.max_rows= yyvsp[0].ulonglong_number; Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;} + { Lex->create_info.max_rows= (yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;} break; case 282: #line 2902 "sql_yacc.yy" - { Lex->create_info.min_rows= yyvsp[0].ulonglong_number; Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;} + { Lex->create_info.min_rows= (yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;} break; case 283: #line 2903 "sql_yacc.yy" - { Lex->create_info.avg_row_length=yyvsp[0].ulong_num; Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;} + { Lex->create_info.avg_row_length=(yyvsp[(3) - (3)].ulong_num); Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;} break; case 284: #line 2904 "sql_yacc.yy" - { Lex->create_info.password=yyvsp[0].lex_str.str; Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD; } + { Lex->create_info.password=(yyvsp[(3) - (3)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD; } break; case 285: #line 2905 "sql_yacc.yy" - { Lex->create_info.comment=yyvsp[0].lex_str; Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; } + { Lex->create_info.comment=(yyvsp[(3) - (3)].lex_str); Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; } break; case 286: #line 2906 "sql_yacc.yy" - { Lex->create_info.auto_increment_value=yyvsp[0].ulonglong_number; Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;} + { Lex->create_info.auto_increment_value=(yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;} break; case 287: #line 2908 "sql_yacc.yy" { - switch(yyvsp[0].ulong_num) { + switch((yyvsp[(3) - (3)].ulong_num)) { case 0: Lex->create_info.table_options|= HA_OPTION_NO_PACK_KEYS; break; @@ -16667,17 +17000,17 @@ case 289: #line 2928 "sql_yacc.yy" - { Lex->create_info.table_options|= yyvsp[0].ulong_num ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; } + { Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; } break; case 290: #line 2929 "sql_yacc.yy" - { Lex->create_info.table_options|= yyvsp[0].ulong_num ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE; } + { Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE; } break; case 291: #line 2930 "sql_yacc.yy" - { Lex->create_info.row_type= yyvsp[0].row_type; Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT; } + { Lex->create_info.row_type= (yyvsp[(3) - (3)].row_type); Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT; } break; case 292: @@ -16724,22 +17057,22 @@ case 298: #line 2963 "sql_yacc.yy" - { Lex->create_info.merge_insert_method= yyvsp[0].ulong_num; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;} + { Lex->create_info.merge_insert_method= (yyvsp[(3) - (3)].ulong_num); Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;} break; case 299: #line 2964 "sql_yacc.yy" - { Lex->create_info.data_file_name= yyvsp[0].lex_str.str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; } + { Lex->create_info.data_file_name= (yyvsp[(4) - (4)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; } break; case 300: #line 2965 "sql_yacc.yy" - { Lex->create_info.index_file_name= yyvsp[0].lex_str.str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; } + { Lex->create_info.index_file_name= (yyvsp[(4) - (4)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; } break; case 301: #line 2966 "sql_yacc.yy" - { Lex->create_info.connect_string.str= yyvsp[0].lex_str.str; Lex->create_info.connect_string.length= yyvsp[0].lex_str.length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; } + { Lex->create_info.connect_string.str= (yyvsp[(3) - (3)].lex_str).str; Lex->create_info.connect_string.length= (yyvsp[(3) - (3)].lex_str).length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; } break; case 302: @@ -16747,15 +17080,15 @@ { HA_CREATE_INFO *cinfo= &Lex->create_info; if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) && - cinfo->default_table_charset && yyvsp[0].charset && - !my_charset_same(cinfo->default_table_charset,yyvsp[0].charset)) + cinfo->default_table_charset && (yyvsp[(4) - (4)].charset) && + !my_charset_same(cinfo->default_table_charset,(yyvsp[(4) - (4)].charset))) { my_error(ER_CONFLICTING_DECLARATIONS, MYF(0), "CHARACTER SET ", cinfo->default_table_charset->csname, - "CHARACTER SET ", yyvsp[0].charset->csname); + "CHARACTER SET ", (yyvsp[(4) - (4)].charset)->csname); MYSQL_YYABORT; } - Lex->create_info.default_table_charset= yyvsp[0].charset; + Lex->create_info.default_table_charset= (yyvsp[(4) - (4)].charset); Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET; } break; @@ -16765,14 +17098,14 @@ { HA_CREATE_INFO *cinfo= &Lex->create_info; if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) && - cinfo->default_table_charset && yyvsp[0].charset && - !my_charset_same(cinfo->default_table_charset,yyvsp[0].charset)) + cinfo->default_table_charset && (yyvsp[(4) - (4)].charset) && + !my_charset_same(cinfo->default_table_charset,(yyvsp[(4) - (4)].charset))) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - yyvsp[0].charset->name, cinfo->default_table_charset->csname); + (yyvsp[(4) - (4)].charset)->name, cinfo->default_table_charset->csname); MYSQL_YYABORT; } - Lex->create_info.default_table_charset= yyvsp[0].charset; + Lex->create_info.default_table_charset= (yyvsp[(4) - (4)].charset); Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET; } break; @@ -16780,9 +17113,9 @@ case 304: #line 3004 "sql_yacc.yy" { - yyval.db_type = ha_resolve_by_name(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); - if (yyval.db_type == DB_TYPE_UNKNOWN) { - my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), yyvsp[0].lex_str.str); + (yyval.db_type) = ha_resolve_by_name((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length); + if ((yyval.db_type) == DB_TYPE_UNKNOWN) { + my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -16790,62 +17123,62 @@ case 305: #line 3013 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_DEFAULT; } + { (yyval.row_type)= ROW_TYPE_DEFAULT; } break; case 306: #line 3014 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_FIXED; } + { (yyval.row_type)= ROW_TYPE_FIXED; } break; case 307: #line 3015 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_DYNAMIC; } + { (yyval.row_type)= ROW_TYPE_DYNAMIC; } break; case 308: #line 3016 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_COMPRESSED; } + { (yyval.row_type)= ROW_TYPE_COMPRESSED; } break; case 309: #line 3017 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_REDUNDANT; } + { (yyval.row_type)= ROW_TYPE_REDUNDANT; } break; case 310: #line 3018 "sql_yacc.yy" - { yyval.row_type= ROW_TYPE_COMPACT; } + { (yyval.row_type)= ROW_TYPE_COMPACT; } break; case 311: #line 3021 "sql_yacc.yy" - { yyval.ulong_num= RAID_TYPE_0; } + { (yyval.ulong_num)= RAID_TYPE_0; } break; case 312: #line 3022 "sql_yacc.yy" - { yyval.ulong_num= RAID_TYPE_0; } + { (yyval.ulong_num)= RAID_TYPE_0; } break; case 313: #line 3023 "sql_yacc.yy" - { yyval.ulong_num=yyvsp[0].ulong_num;} + { (yyval.ulong_num)=(yyvsp[(1) - (1)].ulong_num);} break; case 314: #line 3026 "sql_yacc.yy" - { yyval.ulong_num= MERGE_INSERT_DISABLED; } + { (yyval.ulong_num)= MERGE_INSERT_DISABLED; } break; case 315: #line 3027 "sql_yacc.yy" - { yyval.ulong_num= MERGE_INSERT_TO_FIRST; } + { (yyval.ulong_num)= MERGE_INSERT_TO_FIRST; } break; case 316: #line 3028 "sql_yacc.yy" - { yyval.ulong_num= MERGE_INSERT_TO_LAST; } + { (yyval.ulong_num)= MERGE_INSERT_TO_LAST; } break; case 317: @@ -16855,32 +17188,32 @@ case 319: #line 3035 "sql_yacc.yy" - { yyval.udf_type = UDFTYPE_FUNCTION; } + { (yyval.udf_type) = UDFTYPE_FUNCTION; } break; case 320: #line 3036 "sql_yacc.yy" - { yyval.udf_type = UDFTYPE_AGGREGATE; } + { (yyval.udf_type) = UDFTYPE_AGGREGATE; } break; case 321: #line 3039 "sql_yacc.yy" - {yyval.num = (int) STRING_RESULT; } + {(yyval.num) = (int) STRING_RESULT; } break; case 322: #line 3040 "sql_yacc.yy" - {yyval.num = (int) REAL_RESULT; } + {(yyval.num) = (int) REAL_RESULT; } break; case 323: #line 3041 "sql_yacc.yy" - {yyval.num = (int) DECIMAL_RESULT; } + {(yyval.num) = (int) DECIMAL_RESULT; } break; case 324: #line 3042 "sql_yacc.yy" - {yyval.num = (int) INT_RESULT; } + {(yyval.num) = (int) INT_RESULT; } break; case 330: @@ -16898,12 +17231,12 @@ { LEX *lex=Lex; #ifdef ENABLE_SENNA - Key *key= new Key(yyvsp[-5].key_type,yyvsp[-4].simple_string, yyvsp[-3].key_alg, 0, lex->col_list, + Key *key= new Key((yyvsp[(1) - (6)].key_type),(yyvsp[(2) - (6)].simple_string), (yyvsp[(3) - (6)].key_alg), 0, lex->col_list, lex->senna_flags, lex->senna_initial_n_segments); lex->alter_info.key_list.push_back(key); lex->senna_clear(); #else /* ENABLE_SENNA */ - Key *key= new Key(yyvsp[-5].key_type, yyvsp[-4].simple_string, yyvsp[-3].key_alg, 0, lex->col_list); + Key *key= new Key((yyvsp[(1) - (6)].key_type), (yyvsp[(2) - (6)].simple_string), (yyvsp[(3) - (6)].key_alg), 0, lex->col_list); lex->alter_info.key_list.push_back(key); #endif /* ENABLE_SENNA */ lex->col_list.empty(); /* Alloced by sql_alloc */ @@ -16914,14 +17247,14 @@ #line 3081 "sql_yacc.yy" { LEX *lex=Lex; - const char *key_name= yyvsp[-4].simple_string ? yyvsp[-4].simple_string:yyvsp[-6].simple_string; + const char *key_name= (yyvsp[(3) - (7)].simple_string) ? (yyvsp[(3) - (7)].simple_string):(yyvsp[(1) - (7)].simple_string); #ifdef ENABLE_SENNA - Key *key= new Key(yyvsp[-5].key_type, key_name, yyvsp[-3].key_alg, 0, lex->col_list, + Key *key= new Key((yyvsp[(2) - (7)].key_type), key_name, (yyvsp[(4) - (7)].key_alg), 0, lex->col_list, lex->senna_flags, lex->senna_initial_n_segments); lex->alter_info.key_list.push_back(key); lex->senna_clear(); #else /* ENABLE_SENNA */ - Key *key= new Key(yyvsp[-5].key_type, key_name, yyvsp[-3].key_alg, 0, lex->col_list); + Key *key= new Key((yyvsp[(2) - (7)].key_type), key_name, (yyvsp[(4) - (7)].key_alg), 0, lex->col_list); lex->alter_info.key_list.push_back(key); #endif /* ENABLE_SENNA */ lex->col_list.empty(); /* Alloced by sql_alloc */ @@ -16932,9 +17265,9 @@ #line 3096 "sql_yacc.yy" { LEX *lex=Lex; - const char *key_name= yyvsp[-4].simple_string ? yyvsp[-4].simple_string : yyvsp[-7].simple_string; + const char *key_name= (yyvsp[(4) - (8)].simple_string) ? (yyvsp[(4) - (8)].simple_string) : (yyvsp[(1) - (8)].simple_string); Key *key= new foreign_key(key_name, lex->col_list, - yyvsp[0].table, + (yyvsp[(8) - (8)].table), lex->ref_list, lex->fk_delete_opt, lex->fk_update_opt, @@ -16973,17 +17306,17 @@ case 339: #line 3141 "sql_yacc.yy" - { yyval.simple_string=(char*) 0; } + { (yyval.simple_string)=(char*) 0; } break; case 340: #line 3142 "sql_yacc.yy" - { yyval.simple_string= yyvsp[0].simple_string; } + { (yyval.simple_string)= (yyvsp[(1) - (1)].simple_string); } break; case 341: #line 3146 "sql_yacc.yy" - { yyval.simple_string=yyvsp[0].simple_string; } + { (yyval.simple_string)=(yyvsp[(2) - (2)].simple_string); } break; case 342: @@ -17001,8 +17334,8 @@ #line 3159 "sql_yacc.yy" { LEX *lex=Lex; - if (add_field_to_list(lex->thd, yyvsp[-3].lex_str.str, - (enum enum_field_types) yyvsp[-1].num, + if (add_field_to_list(lex->thd, (yyvsp[(1) - (4)].lex_str).str, + (enum enum_field_types) (yyvsp[(3) - (4)].num), lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, &lex->comment, @@ -17014,149 +17347,149 @@ case 344: #line 3172 "sql_yacc.yy" - { yyval.num=yyvsp[-2].num; } + { (yyval.num)=(yyvsp[(1) - (3)].num); } break; case 345: #line 3173 "sql_yacc.yy" - { yyval.num=yyvsp[-2].num; } + { (yyval.num)=(yyvsp[(1) - (3)].num); } break; case 346: #line 3174 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_FLOAT; } + { (yyval.num)=FIELD_TYPE_FLOAT; } break; case 347: #line 3175 "sql_yacc.yy" { Lex->length= (char*) "1"; - yyval.num=FIELD_TYPE_BIT; } + (yyval.num)=FIELD_TYPE_BIT; } break; case 348: #line 3177 "sql_yacc.yy" - { Lex->length= yyvsp[-1].lex_str.str; - yyval.num=FIELD_TYPE_BIT; } + { Lex->length= (yyvsp[(3) - (4)].lex_str).str; + (yyval.num)=FIELD_TYPE_BIT; } break; case 349: #line 3179 "sql_yacc.yy" { Lex->length=(char*) "1"; - yyval.num=FIELD_TYPE_TINY; } + (yyval.num)=FIELD_TYPE_TINY; } break; case 350: #line 3181 "sql_yacc.yy" { Lex->length=(char*) "1"; - yyval.num=FIELD_TYPE_TINY; } + (yyval.num)=FIELD_TYPE_TINY; } break; case 351: #line 3183 "sql_yacc.yy" - { Lex->length=yyvsp[-2].lex_str.str; - yyval.num=FIELD_TYPE_STRING; } + { Lex->length=(yyvsp[(3) - (5)].lex_str).str; + (yyval.num)=FIELD_TYPE_STRING; } break; case 352: #line 3185 "sql_yacc.yy" { Lex->length=(char*) "1"; - yyval.num=FIELD_TYPE_STRING; } + (yyval.num)=FIELD_TYPE_STRING; } break; case 353: #line 3187 "sql_yacc.yy" - { Lex->length=yyvsp[-2].lex_str.str; - yyval.num=FIELD_TYPE_STRING; + { Lex->length=(yyvsp[(3) - (5)].lex_str).str; + (yyval.num)=FIELD_TYPE_STRING; Lex->charset=national_charset_info; } break; case 354: #line 3190 "sql_yacc.yy" { Lex->length=(char*) "1"; - yyval.num=FIELD_TYPE_STRING; + (yyval.num)=FIELD_TYPE_STRING; Lex->charset=national_charset_info; } break; case 355: #line 3193 "sql_yacc.yy" - { Lex->length=yyvsp[-1].lex_str.str; + { Lex->length=(yyvsp[(3) - (4)].lex_str).str; Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_STRING; } + (yyval.num)=FIELD_TYPE_STRING; } break; case 356: #line 3196 "sql_yacc.yy" { Lex->length= (char*) "1"; Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_STRING; } + (yyval.num)=FIELD_TYPE_STRING; } break; case 357: #line 3199 "sql_yacc.yy" - { Lex->length=yyvsp[-2].lex_str.str; - yyval.num= MYSQL_TYPE_VARCHAR; } + { Lex->length=(yyvsp[(3) - (5)].lex_str).str; + (yyval.num)= MYSQL_TYPE_VARCHAR; } break; case 358: #line 3201 "sql_yacc.yy" - { Lex->length=yyvsp[-2].lex_str.str; - yyval.num= MYSQL_TYPE_VARCHAR; + { Lex->length=(yyvsp[(3) - (5)].lex_str).str; + (yyval.num)= MYSQL_TYPE_VARCHAR; Lex->charset=national_charset_info; } break; case 359: #line 3204 "sql_yacc.yy" - { Lex->length=yyvsp[-1].lex_str.str; + { Lex->length=(yyvsp[(3) - (4)].lex_str).str; Lex->charset=&my_charset_bin; - yyval.num= MYSQL_TYPE_VARCHAR; } + (yyval.num)= MYSQL_TYPE_VARCHAR; } break; case 360: #line 3207 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_YEAR; } + { (yyval.num)=FIELD_TYPE_YEAR; } break; case 361: #line 3208 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_DATE; } + { (yyval.num)=FIELD_TYPE_DATE; } break; case 362: #line 3209 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_TIME; } + { (yyval.num)=FIELD_TYPE_TIME; } break; case 363: #line 3211 "sql_yacc.yy" { if (YYTHD->variables.sql_mode & MODE_MAXDB) - yyval.num=FIELD_TYPE_DATETIME; + (yyval.num)=FIELD_TYPE_DATETIME; else { /* Unlike other types TIMESTAMP fields are NOT NULL by default. */ Lex->type|= NOT_NULL_FLAG; - yyval.num=FIELD_TYPE_TIMESTAMP; + (yyval.num)=FIELD_TYPE_TIMESTAMP; } } break; case 364: #line 3223 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_DATETIME; } + { (yyval.num)=FIELD_TYPE_DATETIME; } break; case 365: #line 3224 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_TINY_BLOB; } + (yyval.num)=FIELD_TYPE_TINY_BLOB; } break; case 366: #line 3226 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_BLOB; } + (yyval.num)=FIELD_TYPE_BLOB; } break; case 367: @@ -17164,8 +17497,8 @@ { #ifdef HAVE_SPATIAL Lex->charset=&my_charset_bin; - Lex->uint_geom_type= (uint)yyvsp[0].num; - yyval.num=FIELD_TYPE_GEOMETRY; + Lex->uint_geom_type= (uint)(yyvsp[(1) - (1)].num); + (yyval.num)=FIELD_TYPE_GEOMETRY; #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -17177,59 +17510,59 @@ case 368: #line 3240 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 369: #line 3242 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_LONG_BLOB; } + (yyval.num)=FIELD_TYPE_LONG_BLOB; } break; case 370: #line 3244 "sql_yacc.yy" { Lex->charset=&my_charset_bin; - yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 371: #line 3246 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + { (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 372: #line 3247 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_TINY_BLOB; } + { (yyval.num)=FIELD_TYPE_TINY_BLOB; } break; case 373: #line 3248 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_BLOB; } + { (yyval.num)=FIELD_TYPE_BLOB; } break; case 374: #line 3249 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + { (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 375: #line 3250 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_LONG_BLOB; } + { (yyval.num)=FIELD_TYPE_LONG_BLOB; } break; case 376: #line 3252 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_NEWDECIMAL;} + { (yyval.num)=FIELD_TYPE_NEWDECIMAL;} break; case 377: #line 3254 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_NEWDECIMAL;} + { (yyval.num)=FIELD_TYPE_NEWDECIMAL;} break; case 378: #line 3256 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_NEWDECIMAL;} + { (yyval.num)=FIELD_TYPE_NEWDECIMAL;} break; case 379: @@ -17239,7 +17572,7 @@ case 380: #line 3258 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_ENUM; } + { (yyval.num)=FIELD_TYPE_ENUM; } break; case 381: @@ -17249,18 +17582,18 @@ case 382: #line 3260 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_SET; } + { (yyval.num)=FIELD_TYPE_SET; } break; case 383: #line 3261 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_MEDIUM_BLOB; } + { (yyval.num)=FIELD_TYPE_MEDIUM_BLOB; } break; case 384: #line 3263 "sql_yacc.yy" { - yyval.num=FIELD_TYPE_LONGLONG; + (yyval.num)=FIELD_TYPE_LONGLONG; Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG | UNIQUE_FLAG); } @@ -17268,44 +17601,44 @@ case 385: #line 3271 "sql_yacc.yy" - { yyval.num= Field::GEOM_GEOMETRY; } + { (yyval.num)= Field::GEOM_GEOMETRY; } break; case 386: #line 3272 "sql_yacc.yy" - { yyval.num= Field::GEOM_GEOMETRYCOLLECTION; } + { (yyval.num)= Field::GEOM_GEOMETRYCOLLECTION; } break; case 387: #line 3273 "sql_yacc.yy" { Lex->length= (char*)"21"; - yyval.num= Field::GEOM_POINT; + (yyval.num)= Field::GEOM_POINT; } break; case 388: #line 3276 "sql_yacc.yy" - { yyval.num= Field::GEOM_MULTIPOINT; } + { (yyval.num)= Field::GEOM_MULTIPOINT; } break; case 389: #line 3277 "sql_yacc.yy" - { yyval.num= Field::GEOM_LINESTRING; } + { (yyval.num)= Field::GEOM_LINESTRING; } break; case 390: #line 3278 "sql_yacc.yy" - { yyval.num= Field::GEOM_MULTILINESTRING; } + { (yyval.num)= Field::GEOM_MULTILINESTRING; } break; case 391: #line 3279 "sql_yacc.yy" - { yyval.num= Field::GEOM_POLYGON; } + { (yyval.num)= Field::GEOM_POLYGON; } break; case 392: #line 3280 "sql_yacc.yy" - { yyval.num= Field::GEOM_MULTIPOLYGON; } + { (yyval.num)= Field::GEOM_MULTIPOLYGON; } break; case 393: @@ -17360,43 +17693,43 @@ case 403: #line 3306 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_LONG; } + { (yyval.num)=FIELD_TYPE_LONG; } break; case 404: #line 3307 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_TINY; } + { (yyval.num)=FIELD_TYPE_TINY; } break; case 405: #line 3308 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_SHORT; } + { (yyval.num)=FIELD_TYPE_SHORT; } break; case 406: #line 3309 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_INT24; } + { (yyval.num)=FIELD_TYPE_INT24; } break; case 407: #line 3310 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_LONGLONG; } + { (yyval.num)=FIELD_TYPE_LONGLONG; } break; case 408: #line 3313 "sql_yacc.yy" - { yyval.num= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ? + { (yyval.num)= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ? FIELD_TYPE_FLOAT : FIELD_TYPE_DOUBLE; } break; case 409: #line 3315 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_DOUBLE; } + { (yyval.num)=FIELD_TYPE_DOUBLE; } break; case 410: #line 3316 "sql_yacc.yy" - { yyval.num=FIELD_TYPE_DOUBLE; } + { (yyval.num)=FIELD_TYPE_DOUBLE; } break; case 411: @@ -17406,7 +17739,7 @@ case 412: #line 3321 "sql_yacc.yy" - { Lex->length=yyvsp[-1].lex_str.str; Lex->dec= (char*)0; } + { Lex->length=(yyvsp[(2) - (3)].lex_str).str; Lex->dec= (char*)0; } break; case 413: @@ -17418,7 +17751,7 @@ #line 3326 "sql_yacc.yy" { LEX *lex=Lex; - lex->length=yyvsp[-3].lex_str.str; lex->dec=yyvsp[-1].lex_str.str; + lex->length=(yyvsp[(2) - (5)].lex_str).str; lex->dec=(yyvsp[(4) - (5)].lex_str).str; } break; @@ -17464,7 +17797,7 @@ case 423: #line 3346 "sql_yacc.yy" - { Lex->length= yyvsp[-1].lex_str.str; } + { Lex->length= (yyvsp[(2) - (3)].lex_str).str; } break; case 424: @@ -17504,7 +17837,7 @@ case 432: #line 3363 "sql_yacc.yy" - { Lex->default_value=yyvsp[0].item; } + { Lex->default_value=(yyvsp[(2) - (2)].item); } break; case 433: @@ -17555,33 +17888,33 @@ case 439: #line 3391 "sql_yacc.yy" - { Lex->comment= yyvsp[0].lex_str; } + { Lex->comment= (yyvsp[(2) - (2)].lex_str); } break; case 440: #line 3393 "sql_yacc.yy" { - if (Lex->charset && !my_charset_same(Lex->charset,yyvsp[0].charset)) + if (Lex->charset && !my_charset_same(Lex->charset,(yyvsp[(2) - (2)].charset))) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - yyvsp[0].charset->name,Lex->charset->csname); + (yyvsp[(2) - (2)].charset)->name,Lex->charset->csname); MYSQL_YYABORT; } else { - Lex->charset=yyvsp[0].charset; + Lex->charset=(yyvsp[(2) - (2)].charset); } } break; case 441: #line 3408 "sql_yacc.yy" - { yyval.item= new Item_func_now_local(); } + { (yyval.item)= new Item_func_now_local(); } break; case 442: #line 3409 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 443: @@ -17597,9 +17930,9 @@ case 445: #line 3419 "sql_yacc.yy" { - if (!(yyval.charset=get_charset_by_csname(yyvsp[0].lex_str.str,MY_CS_PRIMARY,MYF(0)))) + if (!((yyval.charset)=get_charset_by_csname((yyvsp[(1) - (1)].lex_str).str,MY_CS_PRIMARY,MYF(0)))) { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -17607,36 +17940,36 @@ case 446: #line 3426 "sql_yacc.yy" - { yyval.charset= &my_charset_bin; } + { (yyval.charset)= &my_charset_bin; } break; case 447: #line 3430 "sql_yacc.yy" - { yyval.charset=yyvsp[0].charset; } + { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 448: #line 3431 "sql_yacc.yy" - { yyval.charset=NULL; } + { (yyval.charset)=NULL; } break; case 449: #line 3434 "sql_yacc.yy" - { yyval.charset= NULL; } + { (yyval.charset)= NULL; } break; case 450: #line 3435 "sql_yacc.yy" - { yyval.charset= yyvsp[0].charset; } + { (yyval.charset)= (yyvsp[(2) - (2)].charset); } break; case 451: #line 3440 "sql_yacc.yy" { - if (!(yyval.charset=get_charset_by_csname(yyvsp[0].lex_str.str,MY_CS_PRIMARY,MYF(0))) && - !(yyval.charset=get_old_charset_by_name(yyvsp[0].lex_str.str))) + if (!((yyval.charset)=get_charset_by_csname((yyvsp[(1) - (1)].lex_str).str,MY_CS_PRIMARY,MYF(0))) && + !((yyval.charset)=get_old_charset_by_name((yyvsp[(1) - (1)].lex_str).str))) { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -17644,25 +17977,25 @@ case 452: #line 3448 "sql_yacc.yy" - { yyval.charset= &my_charset_bin; } + { (yyval.charset)= &my_charset_bin; } break; case 453: #line 3452 "sql_yacc.yy" - { yyval.charset=yyvsp[0].charset; } + { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 454: #line 3453 "sql_yacc.yy" - { yyval.charset=NULL; } + { (yyval.charset)=NULL; } break; case 455: #line 3457 "sql_yacc.yy" { - if (!(yyval.charset=get_charset_by_name(yyvsp[0].lex_str.str,MYF(0)))) + if (!((yyval.charset)=get_charset_by_name((yyvsp[(1) - (1)].lex_str).str,MYF(0)))) { - my_error(ER_UNKNOWN_COLLATION, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_UNKNOWN_COLLATION, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } } @@ -17670,22 +18003,22 @@ case 456: #line 3466 "sql_yacc.yy" - { yyval.charset=NULL; } + { (yyval.charset)=NULL; } break; case 457: #line 3467 "sql_yacc.yy" - { yyval.charset=yyvsp[0].charset; } + { (yyval.charset)=(yyvsp[(2) - (2)].charset); } break; case 458: #line 3471 "sql_yacc.yy" - { yyval.charset=yyvsp[0].charset; } + { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 459: #line 3472 "sql_yacc.yy" - { yyval.charset=NULL; } + { (yyval.charset)=NULL; } break; case 460: @@ -17727,7 +18060,7 @@ case 466: #line 3491 "sql_yacc.yy" - { Lex->charset=yyvsp[-1].charset; } + { Lex->charset=(yyvsp[(2) - (3)].charset); } break; case 467: @@ -17769,7 +18102,7 @@ case 473: #line 3510 "sql_yacc.yy" - { Lex->charset=yyvsp[0].charset; } + { Lex->charset=(yyvsp[(2) - (2)].charset); } break; case 476: @@ -17784,7 +18117,7 @@ case 477: #line 3525 "sql_yacc.yy" { - yyval.table=yyvsp[-2].table; + (yyval.table)=(yyvsp[(2) - (4)].table); } break; @@ -17800,12 +18133,12 @@ case 480: #line 3534 "sql_yacc.yy" - { Lex->ref_list.push_back(new key_part_spec(yyvsp[0].lex_str.str)); } + { Lex->ref_list.push_back(new key_part_spec((yyvsp[(3) - (3)].lex_str).str)); } break; case 481: #line 3535 "sql_yacc.yy" - { Lex->ref_list.push_back(new key_part_spec(yyvsp[0].lex_str.str)); } + { Lex->ref_list.push_back(new key_part_spec((yyvsp[(1) - (1)].lex_str).str)); } break; case 482: @@ -17830,12 +18163,12 @@ case 486: #line 3547 "sql_yacc.yy" - { Lex->fk_delete_opt= yyvsp[0].num; } + { Lex->fk_delete_opt= (yyvsp[(3) - (3)].num); } break; case 487: #line 3548 "sql_yacc.yy" - { Lex->fk_update_opt= yyvsp[0].num; } + { Lex->fk_update_opt= (yyvsp[(3) - (3)].num); } break; case 488: @@ -17855,44 +18188,44 @@ case 491: #line 3554 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_RESTRICT; } + { (yyval.num)= (int) foreign_key::FK_OPTION_RESTRICT; } break; case 492: #line 3555 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_CASCADE; } + { (yyval.num)= (int) foreign_key::FK_OPTION_CASCADE; } break; case 493: #line 3556 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_SET_NULL; } + { (yyval.num)= (int) foreign_key::FK_OPTION_SET_NULL; } break; case 494: #line 3557 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_NO_ACTION; } + { (yyval.num)= (int) foreign_key::FK_OPTION_NO_ACTION; } break; case 495: #line 3558 "sql_yacc.yy" - { yyval.num= (int) foreign_key::FK_OPTION_DEFAULT; } + { (yyval.num)= (int) foreign_key::FK_OPTION_DEFAULT; } break; case 496: #line 3561 "sql_yacc.yy" - { yyval.key_type= Key::MULTIPLE; } + { (yyval.key_type)= Key::MULTIPLE; } break; case 497: #line 3562 "sql_yacc.yy" - { yyval.key_type= Key::FULLTEXT; } + { (yyval.key_type)= Key::FULLTEXT; } break; case 498: #line 3564 "sql_yacc.yy" { #ifdef HAVE_SPATIAL - yyval.key_type= Key::SPATIAL; + (yyval.key_type)= Key::SPATIAL; #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -17903,12 +18236,12 @@ case 499: #line 3575 "sql_yacc.yy" - { yyval.key_type= Key::PRIMARY; } + { (yyval.key_type)= Key::PRIMARY; } break; case 500: #line 3576 "sql_yacc.yy" - { yyval.key_type= Key::UNIQUE; } + { (yyval.key_type)= Key::UNIQUE; } break; case 501: @@ -17943,24 +18276,24 @@ case 508: #line 3593 "sql_yacc.yy" - { yyval.key_type= Key::MULTIPLE; } + { (yyval.key_type)= Key::MULTIPLE; } break; case 509: #line 3594 "sql_yacc.yy" - { yyval.key_type= Key::UNIQUE; } + { (yyval.key_type)= Key::UNIQUE; } break; case 510: #line 3595 "sql_yacc.yy" - { yyval.key_type= Key::FULLTEXT;} + { (yyval.key_type)= Key::FULLTEXT;} break; case 511: #line 3597 "sql_yacc.yy" { #ifdef HAVE_SPATIAL - yyval.key_type= Key::SPATIAL; + (yyval.key_type)= Key::SPATIAL; #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -17971,39 +18304,39 @@ case 512: #line 3609 "sql_yacc.yy" - { yyval.key_alg= HA_KEY_ALG_UNDEF; } + { (yyval.key_alg)= HA_KEY_ALG_UNDEF; } break; case 513: #line 3610 "sql_yacc.yy" - { yyval.key_alg= yyvsp[0].key_alg; } + { (yyval.key_alg)= (yyvsp[(2) - (2)].key_alg); } break; case 514: #line 3611 "sql_yacc.yy" - { yyval.key_alg= yyvsp[0].key_alg; } + { (yyval.key_alg)= (yyvsp[(2) - (2)].key_alg); } break; case 515: #line 3614 "sql_yacc.yy" - { yyval.key_alg= HA_KEY_ALG_BTREE; } + { (yyval.key_alg)= HA_KEY_ALG_BTREE; } break; case 516: #line 3616 "sql_yacc.yy" { - yyval.key_alg= HA_KEY_ALG_RTREE; + (yyval.key_alg)= HA_KEY_ALG_RTREE; } break; case 517: #line 3619 "sql_yacc.yy" - { yyval.key_alg= HA_KEY_ALG_HASH; } + { (yyval.key_alg)= HA_KEY_ALG_HASH; } break; case 518: #line 3620 "sql_yacc.yy" - { yyval.key_alg= HA_KEY_ALG_UNDEF; } + { (yyval.key_alg)= HA_KEY_ALG_UNDEF; } break; case 521: @@ -18073,22 +18406,24 @@ #line 3662 "sql_yacc.yy" { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_NGRAM; Lex->senna_flags |= SEN_INDEX_DELIMITED; #endif /* ENABLE_SENNA */ } break; case 529: -#line 3667 "sql_yacc.yy" +#line 3668 "sql_yacc.yy" { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_DELIMITED; Lex->senna_flags &= ~SEN_INDEX_NGRAM; #endif /* ENABLE_SENNA */ } break; case 530: -#line 3672 "sql_yacc.yy" +#line 3674 "sql_yacc.yy" { #ifdef ENABLE_SENNA Lex->senna_flags |= SEN_INDEX_NGRAM; @@ -18097,7 +18432,7 @@ break; case 531: -#line 3677 "sql_yacc.yy" +#line 3679 "sql_yacc.yy" { #ifdef ENABLE_SENNA Lex->senna_flags |= 0x00080000; @@ -18106,84 +18441,84 @@ break; case 532: -#line 3682 "sql_yacc.yy" +#line 3684 "sql_yacc.yy" { #ifdef ENABLE_SENNA - if (yyvsp[0].ulong_num < 65536) { - Lex->senna_initial_n_segments=yyvsp[0].ulong_num; + if ((yyvsp[(1) - (1)].ulong_num) < 65536) { + Lex->senna_initial_n_segments=(yyvsp[(1) - (1)].ulong_num); } else { - Lex->senna_flags |= yyvsp[0].ulong_num; + Lex->senna_flags |= (yyvsp[(1) - (1)].ulong_num); } #endif /* ENABLE_SENNA */ } break; case 533: -#line 3693 "sql_yacc.yy" - { Lex->col_list.push_back(yyvsp[-1].key_part); } +#line 3695 "sql_yacc.yy" + { Lex->col_list.push_back((yyvsp[(3) - (4)].key_part)); } break; case 534: -#line 3694 "sql_yacc.yy" - { Lex->col_list.push_back(yyvsp[-1].key_part); } +#line 3696 "sql_yacc.yy" + { Lex->col_list.push_back((yyvsp[(1) - (2)].key_part)); } break; case 535: -#line 3697 "sql_yacc.yy" - { yyval.key_part=new key_part_spec(yyvsp[0].lex_str.str); } +#line 3699 "sql_yacc.yy" + { (yyval.key_part)=new key_part_spec((yyvsp[(1) - (1)].lex_str).str); } break; case 536: -#line 3699 "sql_yacc.yy" +#line 3701 "sql_yacc.yy" { - int key_part_len= atoi(yyvsp[-1].lex_str.str); + int key_part_len= atoi((yyvsp[(3) - (4)].lex_str).str); if (!key_part_len) { - my_error(ER_KEY_PART_0, MYF(0), yyvsp[-3].lex_str.str); + my_error(ER_KEY_PART_0, MYF(0), (yyvsp[(1) - (4)].lex_str).str); } - yyval.key_part=new key_part_spec(yyvsp[-3].lex_str.str,(uint) key_part_len); + (yyval.key_part)=new key_part_spec((yyvsp[(1) - (4)].lex_str).str,(uint) key_part_len); } break; case 537: -#line 3709 "sql_yacc.yy" - { yyval.simple_string=(char*) 0; } +#line 3711 "sql_yacc.yy" + { (yyval.simple_string)=(char*) 0; } break; case 538: -#line 3710 "sql_yacc.yy" - { yyval.simple_string=yyvsp[0].lex_str.str; } +#line 3712 "sql_yacc.yy" + { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str; } break; case 539: -#line 3713 "sql_yacc.yy" - { yyval.lex_str= null_lex_str; } +#line 3715 "sql_yacc.yy" + { (yyval.lex_str)= null_lex_str; } break; case 540: -#line 3714 "sql_yacc.yy" - { yyval.lex_str= yyvsp[0].lex_str; } +#line 3716 "sql_yacc.yy" + { (yyval.lex_str)= (yyvsp[(2) - (2)].lex_str); } break; case 541: -#line 3717 "sql_yacc.yy" - { Lex->interval_list.push_back(yyvsp[0].string); } +#line 3719 "sql_yacc.yy" + { Lex->interval_list.push_back((yyvsp[(1) - (1)].string)); } break; case 542: -#line 3718 "sql_yacc.yy" - { Lex->interval_list.push_back(yyvsp[0].string); } +#line 3720 "sql_yacc.yy" + { Lex->interval_list.push_back((yyvsp[(3) - (3)].string)); } break; case 543: -#line 3726 "sql_yacc.yy" +#line 3728 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_ALTER_TABLE; lex->name= 0; lex->duplicates= DUP_ERROR; - if (!lex->select_lex.add_table_to_list(thd, yyvsp[0].table, NULL, + if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(4) - (4)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; #ifdef ENABLE_SENNA @@ -18203,12 +18538,12 @@ break; case 544: -#line 3750 "sql_yacc.yy" +#line 3752 "sql_yacc.yy" {} break; case 545: -#line 3752 "sql_yacc.yy" +#line 3754 "sql_yacc.yy" { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -18216,19 +18551,19 @@ break; case 546: -#line 3757 "sql_yacc.yy" +#line 3759 "sql_yacc.yy" { LEX *lex=Lex; THD *thd= Lex->thd; lex->sql_command=SQLCOM_ALTER_DB; - lex->name= yyvsp[-2].simple_string; + lex->name= (yyvsp[(3) - (5)].simple_string); if (lex->name == NULL && thd->copy_db_to(&lex->name, NULL)) MYSQL_YYABORT; } break; case 547: -#line 3766 "sql_yacc.yy" +#line 3768 "sql_yacc.yy" { LEX *lex= Lex; @@ -18242,17 +18577,17 @@ break; case 548: -#line 3777 "sql_yacc.yy" +#line 3779 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ALTER_PROCEDURE; - lex->spname= yyvsp[-2].spname; + lex->spname= (yyvsp[(3) - (5)].spname); } break; case 549: -#line 3784 "sql_yacc.yy" +#line 3786 "sql_yacc.yy" { LEX *lex= Lex; @@ -18266,54 +18601,54 @@ break; case 550: -#line 3795 "sql_yacc.yy" +#line 3797 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ALTER_FUNCTION; - lex->spname= yyvsp[-2].spname; + lex->spname= (yyvsp[(3) - (5)].spname); } break; case 551: -#line 3803 "sql_yacc.yy" +#line 3805 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_CREATE_VIEW; lex->create_view_mode= VIEW_ALTER; /* first table in list is target VIEW name */ - lex->select_lex.add_table_to_list(thd, yyvsp[0].table, NULL, TL_OPTION_UPDATING); + lex->select_lex.add_table_to_list(thd, (yyvsp[(6) - (6)].table), NULL, TL_OPTION_UPDATING); } break; case 552: -#line 3812 "sql_yacc.yy" +#line 3814 "sql_yacc.yy" {} break; case 553: -#line 3816 "sql_yacc.yy" - { yyval.simple_string= 0; } +#line 3818 "sql_yacc.yy" + { (yyval.simple_string)= 0; } break; case 554: -#line 3817 "sql_yacc.yy" - { yyval.simple_string= yyvsp[0].lex_str.str; } +#line 3819 "sql_yacc.yy" + { (yyval.simple_string)= (yyvsp[(1) - (1)].lex_str).str; } break; case 556: -#line 3820 "sql_yacc.yy" +#line 3822 "sql_yacc.yy" { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; } break; case 557: -#line 3821 "sql_yacc.yy" +#line 3823 "sql_yacc.yy" { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; } break; case 560: -#line 3827 "sql_yacc.yy" +#line 3829 "sql_yacc.yy" { LEX *lex=Lex; lex->change=0; @@ -18322,35 +18657,35 @@ break; case 561: -#line 3834 "sql_yacc.yy" +#line 3836 "sql_yacc.yy" { } break; case 562: -#line 3836 "sql_yacc.yy" +#line 3838 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_ADD_INDEX; } break; case 563: -#line 3840 "sql_yacc.yy" +#line 3842 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_ADD_COLUMN | ALTER_ADD_INDEX; } break; case 564: -#line 3844 "sql_yacc.yy" +#line 3846 "sql_yacc.yy" { LEX *lex=Lex; - lex->change= yyvsp[0].lex_str.str; + lex->change= (yyvsp[(3) - (3)].lex_str).str; lex->alter_info.flags|= ALTER_CHANGE_COLUMN; } break; case 566: -#line 3851 "sql_yacc.yy" +#line 3853 "sql_yacc.yy" { LEX *lex=Lex; lex->length=lex->dec=0; lex->type=0; @@ -18362,39 +18697,39 @@ break; case 567: -#line 3860 "sql_yacc.yy" +#line 3862 "sql_yacc.yy" { LEX *lex=Lex; - if (add_field_to_list(lex->thd,yyvsp[-3].lex_str.str, - (enum enum_field_types) yyvsp[-1].num, + if (add_field_to_list(lex->thd,(yyvsp[(3) - (6)].lex_str).str, + (enum enum_field_types) (yyvsp[(5) - (6)].num), lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, &lex->comment, - yyvsp[-3].lex_str.str, &lex->interval_list, lex->charset, + (yyvsp[(3) - (6)].lex_str).str, &lex->interval_list, lex->charset, lex->uint_geom_type)) MYSQL_YYABORT; } break; case 569: -#line 3873 "sql_yacc.yy" +#line 3875 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN, - yyvsp[-1].lex_str.str)); + (yyvsp[(3) - (4)].lex_str).str)); lex->alter_info.flags|= ALTER_DROP_COLUMN; } break; case 570: -#line 3880 "sql_yacc.yy" +#line 3882 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_DROP_INDEX; } break; case 571: -#line 3884 "sql_yacc.yy" +#line 3886 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, @@ -18404,17 +18739,17 @@ break; case 572: -#line 3891 "sql_yacc.yy" +#line 3893 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - yyvsp[0].lex_str.str)); + (yyvsp[(3) - (3)].lex_str).str)); lex->alter_info.flags|= ALTER_DROP_INDEX; } break; case 573: -#line 3898 "sql_yacc.yy" +#line 3900 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= DISABLE; @@ -18423,7 +18758,7 @@ break; case 574: -#line 3904 "sql_yacc.yy" +#line 3906 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= ENABLE; @@ -18432,64 +18767,64 @@ break; case 575: -#line 3910 "sql_yacc.yy" +#line 3912 "sql_yacc.yy" { LEX *lex=Lex; - lex->alter_info.alter_list.push_back(new Alter_column(yyvsp[-3].lex_str.str,yyvsp[0].item)); + lex->alter_info.alter_list.push_back(new Alter_column((yyvsp[(3) - (6)].lex_str).str,(yyvsp[(6) - (6)].item))); lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT; } break; case 576: -#line 3916 "sql_yacc.yy" +#line 3918 "sql_yacc.yy" { LEX *lex=Lex; - lex->alter_info.alter_list.push_back(new Alter_column(yyvsp[-2].lex_str.str, + lex->alter_info.alter_list.push_back(new Alter_column((yyvsp[(3) - (5)].lex_str).str, (Item*) 0)); lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT; } break; case 577: -#line 3923 "sql_yacc.yy" +#line 3925 "sql_yacc.yy" { LEX *lex=Lex; THD *thd= lex->thd; - lex->select_lex.db=yyvsp[0].table->db.str; + lex->select_lex.db=(yyvsp[(3) - (3)].table)->db.str; if (lex->select_lex.db == NULL && thd->copy_db_to(&lex->select_lex.db, NULL)) { MYSQL_YYABORT; } - if (check_table_name(yyvsp[0].table->table.str,yyvsp[0].table->table.length) || - yyvsp[0].table->db.str && check_db_name(yyvsp[0].table->db.str)) + if (check_table_name((yyvsp[(3) - (3)].table)->table.str,(yyvsp[(3) - (3)].table)->table.length) || + (yyvsp[(3) - (3)].table)->db.str && check_db_name((yyvsp[(3) - (3)].table)->db.str)) { - my_error(ER_WRONG_TABLE_NAME, MYF(0), yyvsp[0].table->table.str); + my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(3) - (3)].table)->table.str); MYSQL_YYABORT; } - lex->name= yyvsp[0].table->table.str; + lex->name= (yyvsp[(3) - (3)].table)->table.str; lex->alter_info.flags|= ALTER_RENAME; } break; case 578: -#line 3942 "sql_yacc.yy" +#line 3944 "sql_yacc.yy" { - if (!yyvsp[-1].charset) + if (!(yyvsp[(4) - (5)].charset)) { THD *thd= YYTHD; - yyvsp[-1].charset= thd->variables.collation_database; + (yyvsp[(4) - (5)].charset)= thd->variables.collation_database; } - yyvsp[0].charset= yyvsp[0].charset ? yyvsp[0].charset : yyvsp[-1].charset; - if (!my_charset_same(yyvsp[-1].charset,yyvsp[0].charset)) + (yyvsp[(5) - (5)].charset)= (yyvsp[(5) - (5)].charset) ? (yyvsp[(5) - (5)].charset) : (yyvsp[(4) - (5)].charset); + if (!my_charset_same((yyvsp[(4) - (5)].charset),(yyvsp[(5) - (5)].charset))) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - yyvsp[0].charset->name, yyvsp[-1].charset->csname); + (yyvsp[(5) - (5)].charset)->name, (yyvsp[(4) - (5)].charset)->csname); MYSQL_YYABORT; } LEX *lex= Lex; lex->create_info.table_charset= - lex->create_info.default_table_charset= yyvsp[0].charset; + lex->create_info.default_table_charset= (yyvsp[(5) - (5)].charset); lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET | HA_CREATE_USED_DEFAULT_CHARSET); lex->alter_info.flags|= ALTER_CONVERT; @@ -18497,7 +18832,7 @@ break; case 579: -#line 3963 "sql_yacc.yy" +#line 3965 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= ALTER_OPTIONS; @@ -18505,14 +18840,14 @@ break; case 580: -#line 3968 "sql_yacc.yy" +#line 3970 "sql_yacc.yy" { Lex->alter_info.flags|= ALTER_FORCE; } break; case 581: -#line 3972 "sql_yacc.yy" +#line 3974 "sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= ALTER_ORDER; @@ -18520,77 +18855,77 @@ break; case 582: -#line 3978 "sql_yacc.yy" +#line 3980 "sql_yacc.yy" {} break; case 583: -#line 3979 "sql_yacc.yy" +#line 3981 "sql_yacc.yy" {} break; case 584: -#line 3982 "sql_yacc.yy" +#line 3984 "sql_yacc.yy" { Lex->ignore= 0;} break; case 585: -#line 3983 "sql_yacc.yy" +#line 3985 "sql_yacc.yy" { Lex->ignore= 1;} break; case 586: -#line 3987 "sql_yacc.yy" +#line 3989 "sql_yacc.yy" { Lex->drop_mode= DROP_DEFAULT; } break; case 587: -#line 3988 "sql_yacc.yy" +#line 3990 "sql_yacc.yy" { Lex->drop_mode= DROP_RESTRICT; } break; case 588: -#line 3989 "sql_yacc.yy" +#line 3991 "sql_yacc.yy" { Lex->drop_mode= DROP_CASCADE; } break; case 589: -#line 3993 "sql_yacc.yy" +#line 3995 "sql_yacc.yy" {} break; case 590: -#line 3994 "sql_yacc.yy" - { store_position_for_column(yyvsp[0].lex_str.str); } +#line 3996 "sql_yacc.yy" + { store_position_for_column((yyvsp[(2) - (2)].lex_str).str); } break; case 591: -#line 3995 "sql_yacc.yy" +#line 3997 "sql_yacc.yy" { store_position_for_column(first_keyword); } break; case 592: -#line 3998 "sql_yacc.yy" +#line 4000 "sql_yacc.yy" {} break; case 593: -#line 3999 "sql_yacc.yy" +#line 4001 "sql_yacc.yy" {} break; case 594: -#line 4000 "sql_yacc.yy" +#line 4002 "sql_yacc.yy" {} break; case 595: -#line 4001 "sql_yacc.yy" +#line 4003 "sql_yacc.yy" {} break; case 596: -#line 4009 "sql_yacc.yy" +#line 4011 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -18602,12 +18937,12 @@ break; case 597: -#line 4018 "sql_yacc.yy" +#line 4020 "sql_yacc.yy" {} break; case 598: -#line 4020 "sql_yacc.yy" +#line 4022 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -18617,7 +18952,7 @@ break; case 599: -#line 4027 "sql_yacc.yy" +#line 4029 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -18628,12 +18963,12 @@ break; case 600: -#line 4035 "sql_yacc.yy" +#line 4037 "sql_yacc.yy" {} break; case 601: -#line 4037 "sql_yacc.yy" +#line 4039 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -18642,58 +18977,58 @@ break; case 602: -#line 4047 "sql_yacc.yy" +#line 4049 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_BEGIN; - lex->start_transaction_opt= yyvsp[0].num; + lex->start_transaction_opt= (yyvsp[(3) - (3)].num); } break; case 603: -#line 4055 "sql_yacc.yy" - { yyval.num = 0; } +#line 4057 "sql_yacc.yy" + { (yyval.num) = 0; } break; case 604: -#line 4057 "sql_yacc.yy" +#line 4059 "sql_yacc.yy" { - yyval.num= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; + (yyval.num)= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; } break; case 605: -#line 4063 "sql_yacc.yy" +#line 4065 "sql_yacc.yy" { Lex->slave_thd_opt= 0; } break; case 606: -#line 4065 "sql_yacc.yy" +#line 4067 "sql_yacc.yy" {} break; case 609: -#line 4074 "sql_yacc.yy" +#line 4076 "sql_yacc.yy" {} break; case 610: -#line 4075 "sql_yacc.yy" +#line 4077 "sql_yacc.yy" { Lex->slave_thd_opt|=SLAVE_SQL; } break; case 611: -#line 4076 "sql_yacc.yy" +#line 4078 "sql_yacc.yy" { Lex->slave_thd_opt|=SLAVE_IO; } break; case 612: -#line 4080 "sql_yacc.yy" +#line 4082 "sql_yacc.yy" {} break; case 613: -#line 4082 "sql_yacc.yy" +#line 4084 "sql_yacc.yy" { LEX *lex=Lex; if ((lex->mi.log_file_name || lex->mi.pos) && @@ -18710,35 +19045,35 @@ break; case 616: -#line 4104 "sql_yacc.yy" +#line 4106 "sql_yacc.yy" { Lex->sql_command = SQLCOM_RESTORE_TABLE; } break; case 617: -#line 4108 "sql_yacc.yy" +#line 4110 "sql_yacc.yy" { - Lex->backup_dir = yyvsp[0].lex_str.str; + Lex->backup_dir = (yyvsp[(6) - (6)].lex_str).str; } break; case 618: -#line 4114 "sql_yacc.yy" +#line 4116 "sql_yacc.yy" { Lex->sql_command = SQLCOM_BACKUP_TABLE; } break; case 619: -#line 4118 "sql_yacc.yy" +#line 4120 "sql_yacc.yy" { - Lex->backup_dir = yyvsp[0].lex_str.str; + Lex->backup_dir = (yyvsp[(6) - (6)].lex_str).str; } break; case 620: -#line 4124 "sql_yacc.yy" +#line 4126 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_CHECKSUM; @@ -18746,92 +19081,92 @@ break; case 621: -#line 4129 "sql_yacc.yy" +#line 4131 "sql_yacc.yy" {} break; case 622: -#line 4133 "sql_yacc.yy" +#line 4135 "sql_yacc.yy" { Lex->check_opt.flags= 0; } break; case 623: -#line 4134 "sql_yacc.yy" +#line 4136 "sql_yacc.yy" { Lex->check_opt.flags= T_QUICK; } break; case 624: -#line 4135 "sql_yacc.yy" +#line 4137 "sql_yacc.yy" { Lex->check_opt.flags= T_EXTEND; } break; case 625: -#line 4140 "sql_yacc.yy" +#line 4142 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPAIR; - lex->no_write_to_binlog= yyvsp[-1].num; + lex->no_write_to_binlog= (yyvsp[(2) - (3)].num); lex->check_opt.init(); } break; case 626: -#line 4147 "sql_yacc.yy" +#line 4149 "sql_yacc.yy" {} break; case 627: -#line 4151 "sql_yacc.yy" +#line 4153 "sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 628: -#line 4152 "sql_yacc.yy" +#line 4154 "sql_yacc.yy" {} break; case 629: -#line 4155 "sql_yacc.yy" +#line 4157 "sql_yacc.yy" {} break; case 630: -#line 4156 "sql_yacc.yy" +#line 4158 "sql_yacc.yy" {} break; case 631: -#line 4159 "sql_yacc.yy" +#line 4161 "sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 632: -#line 4160 "sql_yacc.yy" +#line 4162 "sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 633: -#line 4161 "sql_yacc.yy" +#line 4163 "sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_USEFRM; } break; case 634: -#line 4165 "sql_yacc.yy" +#line 4167 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_ANALYZE; - lex->no_write_to_binlog= yyvsp[-1].num; + lex->no_write_to_binlog= (yyvsp[(2) - (3)].num); lex->check_opt.init(); } break; case 635: -#line 4172 "sql_yacc.yy" +#line 4174 "sql_yacc.yy" {} break; case 636: -#line 4177 "sql_yacc.yy" +#line 4179 "sql_yacc.yy" { LEX *lex=Lex; @@ -18846,153 +19181,153 @@ break; case 637: -#line 4189 "sql_yacc.yy" +#line 4191 "sql_yacc.yy" {} break; case 638: -#line 4193 "sql_yacc.yy" +#line 4195 "sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 639: -#line 4194 "sql_yacc.yy" +#line 4196 "sql_yacc.yy" {} break; case 640: -#line 4197 "sql_yacc.yy" +#line 4199 "sql_yacc.yy" {} break; case 641: -#line 4198 "sql_yacc.yy" +#line 4200 "sql_yacc.yy" {} break; case 642: -#line 4201 "sql_yacc.yy" +#line 4203 "sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 643: -#line 4202 "sql_yacc.yy" +#line 4204 "sql_yacc.yy" { Lex->check_opt.flags|= T_FAST; } break; case 644: -#line 4203 "sql_yacc.yy" +#line 4205 "sql_yacc.yy" { Lex->check_opt.flags|= T_MEDIUM; } break; case 645: -#line 4204 "sql_yacc.yy" +#line 4206 "sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 646: -#line 4205 "sql_yacc.yy" +#line 4207 "sql_yacc.yy" { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; } break; case 647: -#line 4206 "sql_yacc.yy" +#line 4208 "sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; } break; case 648: -#line 4210 "sql_yacc.yy" +#line 4212 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_OPTIMIZE; - lex->no_write_to_binlog= yyvsp[-1].num; + lex->no_write_to_binlog= (yyvsp[(2) - (3)].num); lex->check_opt.init(); } break; case 649: -#line 4217 "sql_yacc.yy" +#line 4219 "sql_yacc.yy" {} break; case 650: -#line 4221 "sql_yacc.yy" - { yyval.num= 0; } +#line 4223 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 651: -#line 4222 "sql_yacc.yy" - { yyval.num= 1; } +#line 4224 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 652: -#line 4223 "sql_yacc.yy" - { yyval.num= 1; } +#line 4225 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 653: -#line 4228 "sql_yacc.yy" +#line 4230 "sql_yacc.yy" { Lex->sql_command= SQLCOM_RENAME_TABLE; } break; case 654: -#line 4232 "sql_yacc.yy" +#line 4234 "sql_yacc.yy" {} break; case 655: -#line 4234 "sql_yacc.yy" +#line 4236 "sql_yacc.yy" { Lex->sql_command = SQLCOM_RENAME_USER; } break; case 656: -#line 4241 "sql_yacc.yy" +#line 4243 "sql_yacc.yy" { - if (Lex->users_list.push_back(yyvsp[-2].lex_user) || Lex->users_list.push_back(yyvsp[0].lex_user)) + if (Lex->users_list.push_back((yyvsp[(1) - (3)].lex_user)) || Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; } break; case 657: -#line 4246 "sql_yacc.yy" +#line 4248 "sql_yacc.yy" { - if (Lex->users_list.push_back(yyvsp[-2].lex_user) || Lex->users_list.push_back(yyvsp[0].lex_user)) + if (Lex->users_list.push_back((yyvsp[(3) - (5)].lex_user)) || Lex->users_list.push_back((yyvsp[(5) - (5)].lex_user))) MYSQL_YYABORT; } break; case 660: -#line 4258 "sql_yacc.yy" +#line 4260 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sl= lex->current_select; - if (!sl->add_table_to_list(lex->thd, yyvsp[-2].table,NULL,TL_OPTION_UPDATING, + if (!sl->add_table_to_list(lex->thd, (yyvsp[(1) - (3)].table),NULL,TL_OPTION_UPDATING, TL_IGNORE) || - !sl->add_table_to_list(lex->thd, yyvsp[0].table,NULL,TL_OPTION_UPDATING, + !sl->add_table_to_list(lex->thd, (yyvsp[(3) - (3)].table),NULL,TL_OPTION_UPDATING, TL_IGNORE)) MYSQL_YYABORT; } break; case 661: -#line 4270 "sql_yacc.yy" +#line 4272 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE; - lex->ident= yyvsp[0].lex_str; + lex->ident= (yyvsp[(5) - (5)].lex_str); } break; case 664: -#line 4283 "sql_yacc.yy" +#line 4285 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; - if (!sel->add_table_to_list(lex->thd, yyvsp[-1].table, NULL, 0, + if (!sel->add_table_to_list(lex->thd, (yyvsp[(1) - (2)].table), NULL, 0, TL_READ, sel->get_use_index(), (List *)0)) @@ -19001,17 +19336,17 @@ break; case 665: -#line 4295 "sql_yacc.yy" - { yyval.lex_str= yyvsp[0].lex_str; } +#line 4297 "sql_yacc.yy" + { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 666: -#line 4296 "sql_yacc.yy" - { yyval.lex_str = default_key_cache_base; } +#line 4298 "sql_yacc.yy" + { (yyval.lex_str) = default_key_cache_base; } break; case 667: -#line 4301 "sql_yacc.yy" +#line 4303 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; @@ -19019,16 +19354,16 @@ break; case 668: -#line 4306 "sql_yacc.yy" +#line 4308 "sql_yacc.yy" {} break; case 671: -#line 4315 "sql_yacc.yy" +#line 4317 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; - if (!sel->add_table_to_list(lex->thd, yyvsp[-2].table, NULL, yyvsp[0].num, + if (!sel->add_table_to_list(lex->thd, (yyvsp[(1) - (3)].table), NULL, (yyvsp[(3) - (3)].num), TL_READ, sel->get_use_index(), (List *)0)) @@ -19037,12 +19372,12 @@ break; case 672: -#line 4327 "sql_yacc.yy" +#line 4329 "sql_yacc.yy" { Select->interval_list.empty(); } break; case 673: -#line 4329 "sql_yacc.yy" +#line 4331 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -19051,12 +19386,12 @@ break; case 674: -#line 4337 "sql_yacc.yy" +#line 4339 "sql_yacc.yy" { Lex->select_lex.use_index_ptr= 0; } break; case 675: -#line 4339 "sql_yacc.yy" +#line 4341 "sql_yacc.yy" { SELECT_LEX *sel= &Lex->select_lex; sel->use_index_ptr= &sel->use_index; @@ -19064,17 +19399,17 @@ break; case 676: -#line 4347 "sql_yacc.yy" - { yyval.num= 0; } +#line 4349 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 677: -#line 4348 "sql_yacc.yy" - { yyval.num= TL_OPTION_IGNORE_LEAVES; } +#line 4350 "sql_yacc.yy" + { (yyval.num)= TL_OPTION_IGNORE_LEAVES; } break; case 678: -#line 4358 "sql_yacc.yy" +#line 4360 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -19082,7 +19417,7 @@ break; case 681: -#line 4372 "sql_yacc.yy" +#line 4374 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -19107,7 +19442,7 @@ break; case 683: -#line 4397 "sql_yacc.yy" +#line 4399 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -19126,7 +19461,7 @@ break; case 685: -#line 4416 "sql_yacc.yy" +#line 4418 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -19137,19 +19472,19 @@ break; case 686: -#line 4424 "sql_yacc.yy" +#line 4426 "sql_yacc.yy" { Select->parsing_place= NO_MATTER; } break; case 688: -#line 4430 "sql_yacc.yy" +#line 4432 "sql_yacc.yy" {} break; case 693: -#line 4439 "sql_yacc.yy" +#line 4441 "sql_yacc.yy" { Select->context.table_list= Select->context.first_name_resolution_table= @@ -19158,7 +19493,7 @@ break; case 696: -#line 4454 "sql_yacc.yy" +#line 4456 "sql_yacc.yy" { if (test_all_bits(Select->options, SELECT_ALL | SELECT_DISTINCT)) { @@ -19169,12 +19504,12 @@ break; case 699: -#line 4468 "sql_yacc.yy" +#line 4470 "sql_yacc.yy" { Select->options|= SELECT_STRAIGHT_JOIN; } break; case 700: -#line 4470 "sql_yacc.yy" +#line 4472 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19183,22 +19518,22 @@ break; case 701: -#line 4475 "sql_yacc.yy" +#line 4477 "sql_yacc.yy" { Select->options|= SELECT_DISTINCT; } break; case 702: -#line 4476 "sql_yacc.yy" +#line 4478 "sql_yacc.yy" { Select->options|= SELECT_SMALL_RESULT; } break; case 703: -#line 4477 "sql_yacc.yy" +#line 4479 "sql_yacc.yy" { Select->options|= SELECT_BIG_RESULT; } break; case 704: -#line 4479 "sql_yacc.yy" +#line 4481 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19207,7 +19542,7 @@ break; case 705: -#line 4485 "sql_yacc.yy" +#line 4487 "sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -19216,7 +19551,7 @@ break; case 706: -#line 4491 "sql_yacc.yy" +#line 4493 "sql_yacc.yy" { Lex->safe_to_cache_query=0; Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE; @@ -19225,7 +19560,7 @@ break; case 707: -#line 4497 "sql_yacc.yy" +#line 4499 "sql_yacc.yy" { /* Honor this flag only if SQL_NO_CACHE wasn't specified. */ if (Lex->select_lex.sql_cache != SELECT_LEX::SQL_NO_CACHE) @@ -19238,12 +19573,12 @@ break; case 708: -#line 4506 "sql_yacc.yy" +#line 4508 "sql_yacc.yy" { Select->options|= SELECT_ALL; } break; case 710: -#line 4512 "sql_yacc.yy" +#line 4514 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select->set_lock_for_tables(TL_WRITE); @@ -19252,7 +19587,7 @@ break; case 711: -#line 4518 "sql_yacc.yy" +#line 4520 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select-> @@ -19262,7 +19597,7 @@ break; case 714: -#line 4530 "sql_yacc.yy" +#line 4532 "sql_yacc.yy" { THD *thd= YYTHD; if (add_item_to_list(thd, @@ -19275,828 +19610,828 @@ break; case 715: -#line 4543 "sql_yacc.yy" +#line 4545 "sql_yacc.yy" { THD *thd= YYTHD; - DBUG_ASSERT(yyvsp[-3].simple_string < yyvsp[-1].simple_string); + DBUG_ASSERT((yyvsp[(1) - (4)].simple_string) < (yyvsp[(3) - (4)].simple_string)); - if (add_item_to_list(thd, yyvsp[-2].item)) + if (add_item_to_list(thd, (yyvsp[(2) - (4)].item))) MYSQL_YYABORT; - if (yyvsp[0].lex_str.str) + if ((yyvsp[(4) - (4)].lex_str).str) { - yyvsp[-2].item->is_autogenerated_name= FALSE; - yyvsp[-2].item->set_name(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, system_charset_info); + (yyvsp[(2) - (4)].item)->is_autogenerated_name= FALSE; + (yyvsp[(2) - (4)].item)->set_name((yyvsp[(4) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).length, system_charset_info); } - else if (!yyvsp[-2].item->name) + else if (!(yyvsp[(2) - (4)].item)->name) { - yyvsp[-2].item->set_name(yyvsp[-3].simple_string, (uint) (yyvsp[-1].simple_string - yyvsp[-3].simple_string), thd->charset()); + (yyvsp[(2) - (4)].item)->set_name((yyvsp[(1) - (4)].simple_string), (uint) ((yyvsp[(3) - (4)].simple_string) - (yyvsp[(1) - (4)].simple_string)), thd->charset()); } } break; case 716: -#line 4562 "sql_yacc.yy" +#line 4564 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; - yyval.simple_string= (char*) lip->tok_start; + (yyval.simple_string)= (char*) lip->tok_start; } break; case 717: -#line 4569 "sql_yacc.yy" +#line 4571 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; - yyval.simple_string=(char*) lip->tok_end; + (yyval.simple_string)=(char*) lip->tok_end; } break; case 718: -#line 4576 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 4578 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 719: -#line 4577 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 4579 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 720: -#line 4580 "sql_yacc.yy" - { yyval.lex_str=null_lex_str;} +#line 4582 "sql_yacc.yy" + { (yyval.lex_str)=null_lex_str;} break; case 721: -#line 4581 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 4583 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 722: -#line 4582 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 4584 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 723: -#line 4583 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 4585 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 724: -#line 4584 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 4586 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 725: -#line 4588 "sql_yacc.yy" +#line 4590 "sql_yacc.yy" {} break; case 726: -#line 4589 "sql_yacc.yy" +#line 4591 "sql_yacc.yy" {} break; case 727: -#line 4593 "sql_yacc.yy" +#line 4595 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 728: -#line 4595 "sql_yacc.yy" +#line 4597 "sql_yacc.yy" { List *list= Select->expr_list.pop(); if (list->elements) { - list->push_front(yyvsp[-2].item); - yyval.item= new Item_cond_or(*list); + list->push_front((yyvsp[(1) - (3)].item)); + (yyval.item)= new Item_cond_or(*list); /* optimize construction of logical OR to reduce amount of objects for complex expressions */ } else - yyval.item= yyvsp[-2].item; + (yyval.item)= (yyvsp[(1) - (3)].item); delete list; } break; case 730: -#line 4613 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 4615 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 731: -#line 4617 "sql_yacc.yy" - { yyval.item= new Item_cond_xor(yyvsp[-2].item,yyvsp[0].item); } +#line 4619 "sql_yacc.yy" + { (yyval.item)= new Item_cond_xor((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 732: -#line 4618 "sql_yacc.yy" +#line 4620 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 733: -#line 4620 "sql_yacc.yy" +#line 4622 "sql_yacc.yy" { List *list= Select->expr_list.pop(); if (list->elements) { - list->push_front(yyvsp[-2].item); - yyval.item= new Item_cond_and(*list); + list->push_front((yyvsp[(1) - (3)].item)); + (yyval.item)= new Item_cond_and(*list); /* optimize construction of logical AND to reduce amount of objects for complex expressions */ } else - yyval.item= yyvsp[-2].item; + (yyval.item)= (yyvsp[(1) - (3)].item); delete list; } break; case 735: -#line 4638 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 4640 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 736: -#line 4642 "sql_yacc.yy" - { yyval.item= negate_expression(YYTHD, yyvsp[0].item); } +#line 4644 "sql_yacc.yy" + { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); } break; case 738: -#line 4647 "sql_yacc.yy" - { yyval.item= new (YYTHD->mem_root) Item_func_istrue(yyvsp[-2].item); } +#line 4649 "sql_yacc.yy" + { (yyval.item)= new (YYTHD->mem_root) Item_func_istrue((yyvsp[(1) - (3)].item)); } break; case 739: -#line 4649 "sql_yacc.yy" - { yyval.item= new (YYTHD->mem_root) Item_func_isnottrue(yyvsp[-3].item); } +#line 4651 "sql_yacc.yy" + { (yyval.item)= new (YYTHD->mem_root) Item_func_isnottrue((yyvsp[(1) - (4)].item)); } break; case 740: -#line 4651 "sql_yacc.yy" - { yyval.item= new (YYTHD->mem_root) Item_func_isfalse(yyvsp[-2].item); } +#line 4653 "sql_yacc.yy" + { (yyval.item)= new (YYTHD->mem_root) Item_func_isfalse((yyvsp[(1) - (3)].item)); } break; case 741: -#line 4653 "sql_yacc.yy" - { yyval.item= new (YYTHD->mem_root) Item_func_isnotfalse(yyvsp[-3].item); } +#line 4655 "sql_yacc.yy" + { (yyval.item)= new (YYTHD->mem_root) Item_func_isnotfalse((yyvsp[(1) - (4)].item)); } break; case 742: -#line 4654 "sql_yacc.yy" - { yyval.item= new Item_func_isnull(yyvsp[-2].item); } +#line 4656 "sql_yacc.yy" + { (yyval.item)= new Item_func_isnull((yyvsp[(1) - (3)].item)); } break; case 743: -#line 4655 "sql_yacc.yy" - { yyval.item= new Item_func_isnotnull(yyvsp[-3].item); } +#line 4657 "sql_yacc.yy" + { (yyval.item)= new Item_func_isnotnull((yyvsp[(1) - (4)].item)); } break; case 745: -#line 4660 "sql_yacc.yy" - { yyval.item= new Item_func_isnull(yyvsp[-2].item); } +#line 4662 "sql_yacc.yy" + { (yyval.item)= new Item_func_isnull((yyvsp[(1) - (3)].item)); } break; case 746: -#line 4661 "sql_yacc.yy" - { yyval.item= new Item_func_isnotnull(yyvsp[-3].item); } +#line 4663 "sql_yacc.yy" + { (yyval.item)= new Item_func_isnotnull((yyvsp[(1) - (4)].item)); } break; case 747: -#line 4662 "sql_yacc.yy" - { yyval.item= new Item_func_equal(yyvsp[-2].item,yyvsp[0].item); } +#line 4664 "sql_yacc.yy" + { (yyval.item)= new Item_func_equal((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 748: -#line 4664 "sql_yacc.yy" - { yyval.item= (*yyvsp[-1].boolfunc2creator)(0)->create(yyvsp[-2].item,yyvsp[0].item); } +#line 4666 "sql_yacc.yy" + { (yyval.item)= (*(yyvsp[(2) - (3)].boolfunc2creator))(0)->create((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 749: -#line 4666 "sql_yacc.yy" - { yyval.item= all_any_subquery_creator(yyvsp[-5].item, yyvsp[-4].boolfunc2creator, yyvsp[-3].num, yyvsp[-1].select_lex); } +#line 4668 "sql_yacc.yy" + { (yyval.item)= all_any_subquery_creator((yyvsp[(1) - (6)].item), (yyvsp[(2) - (6)].boolfunc2creator), (yyvsp[(3) - (6)].num), (yyvsp[(5) - (6)].select_lex)); } break; case 751: -#line 4671 "sql_yacc.yy" +#line 4673 "sql_yacc.yy" { - yyval.item= new (YYTHD->mem_root) Item_in_subselect(yyvsp[-4].item, yyvsp[-1].select_lex); + (yyval.item)= new (YYTHD->mem_root) Item_in_subselect((yyvsp[(1) - (5)].item), (yyvsp[(4) - (5)].select_lex)); } break; case 752: -#line 4675 "sql_yacc.yy" +#line 4677 "sql_yacc.yy" { THD *thd= YYTHD; - Item *item= new (thd->mem_root) Item_in_subselect(yyvsp[-5].item, yyvsp[-1].select_lex); - yyval.item= negate_expression(thd, item); + Item *item= new (thd->mem_root) Item_in_subselect((yyvsp[(1) - (6)].item), (yyvsp[(5) - (6)].select_lex)); + (yyval.item)= negate_expression(thd, item); } break; case 753: -#line 4681 "sql_yacc.yy" +#line 4683 "sql_yacc.yy" { - yyval.item= handle_sql2003_note184_exception(YYTHD, yyvsp[-4].item, true, yyvsp[-1].item); + (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (5)].item), true, (yyvsp[(4) - (5)].item)); } break; case 754: -#line 4685 "sql_yacc.yy" +#line 4687 "sql_yacc.yy" { - yyvsp[-1].item_list->push_front(yyvsp[-3].item); - yyvsp[-1].item_list->push_front(yyvsp[-6].item); - yyval.item= new (YYTHD->mem_root) Item_func_in(*yyvsp[-1].item_list); + (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(4) - (7)].item)); + (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(1) - (7)].item)); + (yyval.item)= new (YYTHD->mem_root) Item_func_in(*(yyvsp[(6) - (7)].item_list)); } break; case 755: -#line 4691 "sql_yacc.yy" +#line 4693 "sql_yacc.yy" { - yyval.item= handle_sql2003_note184_exception(YYTHD, yyvsp[-5].item, false, yyvsp[-1].item); + (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (6)].item), false, (yyvsp[(5) - (6)].item)); } break; case 756: -#line 4695 "sql_yacc.yy" +#line 4697 "sql_yacc.yy" { - yyvsp[-1].item_list->push_front(yyvsp[-3].item); - yyvsp[-1].item_list->push_front(yyvsp[-7].item); - Item_func_in *item = new (YYTHD->mem_root) Item_func_in(*yyvsp[-1].item_list); + (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(5) - (8)].item)); + (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(1) - (8)].item)); + Item_func_in *item = new (YYTHD->mem_root) Item_func_in(*(yyvsp[(7) - (8)].item_list)); item->negate(); - yyval.item= item; + (yyval.item)= item; } break; case 757: -#line 4703 "sql_yacc.yy" - { yyval.item= new Item_func_between(yyvsp[-4].item,yyvsp[-2].item,yyvsp[0].item); } +#line 4705 "sql_yacc.yy" + { (yyval.item)= new Item_func_between((yyvsp[(1) - (5)].item),(yyvsp[(3) - (5)].item),(yyvsp[(5) - (5)].item)); } break; case 758: -#line 4705 "sql_yacc.yy" +#line 4707 "sql_yacc.yy" { - Item_func_between *item= new Item_func_between(yyvsp[-5].item,yyvsp[-2].item,yyvsp[0].item); + Item_func_between *item= new Item_func_between((yyvsp[(1) - (6)].item),(yyvsp[(4) - (6)].item),(yyvsp[(6) - (6)].item)); item->negate(); - yyval.item= item; + (yyval.item)= item; } break; case 759: -#line 4711 "sql_yacc.yy" - { yyval.item= new Item_func_eq(new Item_func_soundex(yyvsp[-3].item), - new Item_func_soundex(yyvsp[0].item)); } +#line 4713 "sql_yacc.yy" + { (yyval.item)= new Item_func_eq(new Item_func_soundex((yyvsp[(1) - (4)].item)), + new Item_func_soundex((yyvsp[(4) - (4)].item))); } break; case 760: -#line 4714 "sql_yacc.yy" - { yyval.item= new Item_func_like(yyvsp[-3].item,yyvsp[-1].item,yyvsp[0].item,Lex->escape_used); } +#line 4716 "sql_yacc.yy" + { (yyval.item)= new Item_func_like((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].item),Lex->escape_used); } break; case 761: -#line 4716 "sql_yacc.yy" - { yyval.item= new Item_func_not(new Item_func_like(yyvsp[-4].item,yyvsp[-1].item,yyvsp[0].item, Lex->escape_used)); } +#line 4718 "sql_yacc.yy" + { (yyval.item)= new Item_func_not(new Item_func_like((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].item), Lex->escape_used)); } break; case 762: -#line 4717 "sql_yacc.yy" - { yyval.item= new Item_func_regex(yyvsp[-2].item,yyvsp[0].item); } +#line 4719 "sql_yacc.yy" + { (yyval.item)= new Item_func_regex((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 763: -#line 4719 "sql_yacc.yy" - { yyval.item= negate_expression(YYTHD, new Item_func_regex(yyvsp[-3].item,yyvsp[0].item)); } +#line 4721 "sql_yacc.yy" + { (yyval.item)= negate_expression(YYTHD, new Item_func_regex((yyvsp[(1) - (4)].item),(yyvsp[(4) - (4)].item))); } break; case 765: -#line 4723 "sql_yacc.yy" - { yyval.item= new Item_func_bit_or(yyvsp[-2].item,yyvsp[0].item); } +#line 4725 "sql_yacc.yy" + { (yyval.item)= new Item_func_bit_or((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 767: -#line 4727 "sql_yacc.yy" - { yyval.item= new Item_func_bit_and(yyvsp[-2].item,yyvsp[0].item); } +#line 4729 "sql_yacc.yy" + { (yyval.item)= new Item_func_bit_and((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 769: -#line 4732 "sql_yacc.yy" - { yyval.item= new Item_func_shift_left(yyvsp[-2].item,yyvsp[0].item); } +#line 4734 "sql_yacc.yy" + { (yyval.item)= new Item_func_shift_left((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 770: -#line 4734 "sql_yacc.yy" - { yyval.item= new Item_func_shift_right(yyvsp[-2].item,yyvsp[0].item); } +#line 4736 "sql_yacc.yy" + { (yyval.item)= new Item_func_shift_right((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 772: -#line 4738 "sql_yacc.yy" - { yyval.item= new Item_func_plus(yyvsp[-2].item,yyvsp[0].item); } +#line 4740 "sql_yacc.yy" + { (yyval.item)= new Item_func_plus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 773: -#line 4739 "sql_yacc.yy" - { yyval.item= new Item_func_minus(yyvsp[-2].item,yyvsp[0].item); } +#line 4741 "sql_yacc.yy" + { (yyval.item)= new Item_func_minus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 774: -#line 4741 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-3].item,yyvsp[-1].item,yyvsp[0].interval,0); } +#line 4743 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].interval),0); } break; case 775: -#line 4743 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-3].item,yyvsp[-1].item,yyvsp[0].interval,1); } +#line 4745 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].interval),1); } break; case 777: -#line 4747 "sql_yacc.yy" - { yyval.item= new Item_func_mul(yyvsp[-2].item,yyvsp[0].item); } +#line 4749 "sql_yacc.yy" + { (yyval.item)= new Item_func_mul((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 778: -#line 4748 "sql_yacc.yy" - { yyval.item= new Item_func_div(yyvsp[-2].item,yyvsp[0].item); } +#line 4750 "sql_yacc.yy" + { (yyval.item)= new Item_func_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 779: -#line 4749 "sql_yacc.yy" - { yyval.item= new Item_func_mod(yyvsp[-2].item,yyvsp[0].item); } +#line 4751 "sql_yacc.yy" + { (yyval.item)= new Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 780: -#line 4750 "sql_yacc.yy" - { yyval.item= new Item_func_int_div(yyvsp[-2].item,yyvsp[0].item); } +#line 4752 "sql_yacc.yy" + { (yyval.item)= new Item_func_int_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 781: -#line 4751 "sql_yacc.yy" - { yyval.item= new Item_func_mod(yyvsp[-2].item,yyvsp[0].item); } +#line 4753 "sql_yacc.yy" + { (yyval.item)= new Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 783: -#line 4755 "sql_yacc.yy" - { yyval.item= new Item_func_bit_xor(yyvsp[-2].item,yyvsp[0].item); } +#line 4757 "sql_yacc.yy" + { (yyval.item)= new Item_func_bit_xor((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); } break; case 793: -#line 4763 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_eq_creator; } +#line 4765 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_eq_creator; } break; case 794: -#line 4764 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_ge_creator; } +#line 4766 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_ge_creator; } break; case 795: -#line 4765 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_gt_creator; } +#line 4767 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_gt_creator; } break; case 796: -#line 4766 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_le_creator; } +#line 4768 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_le_creator; } break; case 797: -#line 4767 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_lt_creator; } +#line 4769 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_lt_creator; } break; case 798: -#line 4768 "sql_yacc.yy" - { yyval.boolfunc2creator = &comp_ne_creator; } +#line 4770 "sql_yacc.yy" + { (yyval.boolfunc2creator) = &comp_ne_creator; } break; case 799: -#line 4771 "sql_yacc.yy" - { yyval.num = 1; } +#line 4773 "sql_yacc.yy" + { (yyval.num) = 1; } break; case 800: -#line 4772 "sql_yacc.yy" - { yyval.num = 0; } +#line 4774 "sql_yacc.yy" + { (yyval.num) = 0; } break; case 801: -#line 4776 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 4778 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(2) - (2)].item); } break; case 803: -#line 4782 "sql_yacc.yy" +#line 4784 "sql_yacc.yy" { - yyval.item= new Item_func_set_collation(yyvsp[-2].item, - new Item_string(yyvsp[0].lex_str.str, - yyvsp[0].lex_str.length, + (yyval.item)= new Item_func_set_collation((yyvsp[(1) - (3)].item), + new Item_string((yyvsp[(3) - (3)].lex_str).str, + (yyvsp[(3) - (3)].lex_str).length, YYTHD->charset())); } break; case 808: -#line 4793 "sql_yacc.yy" - { yyval.item= new Item_func_concat(yyvsp[-2].item, yyvsp[0].item); } +#line 4795 "sql_yacc.yy" + { (yyval.item)= new Item_func_concat((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item)); } break; case 809: -#line 4794 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 4796 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 810: -#line 4795 "sql_yacc.yy" - { yyval.item= new Item_func_neg(yyvsp[0].item); } +#line 4797 "sql_yacc.yy" + { (yyval.item)= new Item_func_neg((yyvsp[(2) - (2)].item)); } break; case 811: -#line 4796 "sql_yacc.yy" - { yyval.item= new Item_func_bit_neg(yyvsp[0].item); } +#line 4798 "sql_yacc.yy" + { (yyval.item)= new Item_func_bit_neg((yyvsp[(2) - (2)].item)); } break; case 812: -#line 4797 "sql_yacc.yy" - { yyval.item= negate_expression(YYTHD, yyvsp[0].item); } +#line 4799 "sql_yacc.yy" + { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); } break; case 813: -#line 4799 "sql_yacc.yy" +#line 4801 "sql_yacc.yy" { - yyval.item= new Item_singlerow_subselect(yyvsp[-1].select_lex); + (yyval.item)= new Item_singlerow_subselect((yyvsp[(2) - (3)].select_lex)); } break; case 814: -#line 4802 "sql_yacc.yy" - { yyval.item= yyvsp[-1].item; } +#line 4804 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(2) - (3)].item); } break; case 815: -#line 4804 "sql_yacc.yy" +#line 4806 "sql_yacc.yy" { - yyvsp[-1].item_list->push_front(yyvsp[-3].item); - yyval.item= new Item_row(*yyvsp[-1].item_list); + (yyvsp[(4) - (5)].item_list)->push_front((yyvsp[(2) - (5)].item)); + (yyval.item)= new Item_row(*(yyvsp[(4) - (5)].item_list)); } break; case 816: -#line 4809 "sql_yacc.yy" +#line 4811 "sql_yacc.yy" { - yyvsp[-1].item_list->push_front(yyvsp[-3].item); - yyval.item= new Item_row(*yyvsp[-1].item_list); + (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); + (yyval.item)= new Item_row(*(yyvsp[(5) - (6)].item_list)); } break; case 817: -#line 4814 "sql_yacc.yy" +#line 4816 "sql_yacc.yy" { - yyval.item= new Item_exists_subselect(yyvsp[-1].select_lex); + (yyval.item)= new Item_exists_subselect((yyvsp[(3) - (4)].select_lex)); } break; case 818: -#line 4817 "sql_yacc.yy" - { yyval.item= yyvsp[-1].item; } +#line 4819 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(3) - (4)].item); } break; case 819: -#line 4819 "sql_yacc.yy" - { yyvsp[-5].item_list->push_front(yyvsp[-2].item); +#line 4821 "sql_yacc.yy" + { (yyvsp[(2) - (7)].item_list)->push_front((yyvsp[(5) - (7)].item)); Select->add_ftfunc_to_list((Item_func_match*) - (yyval.item=new Item_func_match(*yyvsp[-5].item_list,yyvsp[-1].num))); } + ((yyval.item)=new Item_func_match(*(yyvsp[(2) - (7)].item_list),(yyvsp[(6) - (7)].num)))); } break; case 820: -#line 4822 "sql_yacc.yy" - { yyval.item= new Item_func_ascii(yyvsp[-1].item); } +#line 4824 "sql_yacc.yy" + { (yyval.item)= new Item_func_ascii((yyvsp[(3) - (4)].item)); } break; case 821: -#line 4824 "sql_yacc.yy" +#line 4826 "sql_yacc.yy" { - yyval.item= create_func_cast(yyvsp[0].item, ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); + (yyval.item)= create_func_cast((yyvsp[(2) - (2)].item), ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); } break; case 822: -#line 4828 "sql_yacc.yy" +#line 4830 "sql_yacc.yy" { LEX *lex= Lex; - yyval.item= create_func_cast(yyvsp[-3].item, yyvsp[-1].cast_type, lex->length, lex->dec, lex->charset); - if (!yyval.item) + (yyval.item)= create_func_cast((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), lex->length, lex->dec, lex->charset); + if (!(yyval.item)) MYSQL_YYABORT; } break; case 823: -#line 4835 "sql_yacc.yy" - { yyval.item= new Item_func_case(* yyvsp[-2].item_list, yyvsp[-3].item, yyvsp[-1].item ); } +#line 4837 "sql_yacc.yy" + { (yyval.item)= new Item_func_case(* (yyvsp[(3) - (5)].item_list), (yyvsp[(2) - (5)].item), (yyvsp[(4) - (5)].item) ); } break; case 824: -#line 4837 "sql_yacc.yy" +#line 4839 "sql_yacc.yy" { - yyval.item= create_func_cast(yyvsp[-3].item, yyvsp[-1].cast_type, Lex->length, Lex->dec, Lex->charset); - if (!yyval.item) + (yyval.item)= create_func_cast((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), Lex->length, Lex->dec, Lex->charset); + if (!(yyval.item)) MYSQL_YYABORT; } break; case 825: -#line 4843 "sql_yacc.yy" - { yyval.item= new Item_func_conv_charset(yyvsp[-3].item,yyvsp[-1].charset); } +#line 4845 "sql_yacc.yy" + { (yyval.item)= new Item_func_conv_charset((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].charset)); } break; case 826: -#line 4845 "sql_yacc.yy" +#line 4847 "sql_yacc.yy" { - if (yyvsp[-1].item->is_splocal()) + if ((yyvsp[(3) - (4)].item)->is_splocal()) { - Item_splocal *il= static_cast(yyvsp[-1].item); + Item_splocal *il= static_cast((yyvsp[(3) - (4)].item)); my_error(ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str); MYSQL_YYABORT; } - yyval.item= new Item_default_value(Lex->current_context(), yyvsp[-1].item); + (yyval.item)= new Item_default_value(Lex->current_context(), (yyvsp[(3) - (4)].item)); } break; case 827: -#line 4856 "sql_yacc.yy" - { yyval.item= new Item_insert_value(Lex->current_context(), yyvsp[-1].item); } +#line 4858 "sql_yacc.yy" + { (yyval.item)= new Item_insert_value(Lex->current_context(), (yyvsp[(3) - (4)].item)); } break; case 828: -#line 4858 "sql_yacc.yy" +#line 4860 "sql_yacc.yy" { - if (!yyvsp[-2].symbol.symbol->create_func) + if (!(yyvsp[(1) - (3)].symbol).symbol->create_func) { my_error(ER_FEATURE_DISABLED, MYF(0), - yyvsp[-2].symbol.symbol->group->name, - yyvsp[-2].symbol.symbol->group->needed_define); + (yyvsp[(1) - (3)].symbol).symbol->group->name, + (yyvsp[(1) - (3)].symbol).symbol->group->needed_define); MYSQL_YYABORT; } - yyval.item= ((Item*(*)(void))(yyvsp[-2].symbol.symbol->create_func))(); + (yyval.item)= ((Item*(*)(void))((yyvsp[(1) - (3)].symbol).symbol->create_func))(); } break; case 829: -#line 4869 "sql_yacc.yy" +#line 4871 "sql_yacc.yy" { - if (!yyvsp[-3].symbol.symbol->create_func) + if (!(yyvsp[(1) - (4)].symbol).symbol->create_func) { my_error(ER_FEATURE_DISABLED, MYF(0), - yyvsp[-3].symbol.symbol->group->name, - yyvsp[-3].symbol.symbol->group->needed_define); + (yyvsp[(1) - (4)].symbol).symbol->group->name, + (yyvsp[(1) - (4)].symbol).symbol->group->needed_define); MYSQL_YYABORT; } - yyval.item= ((Item*(*)(Item*))(yyvsp[-3].symbol.symbol->create_func))(yyvsp[-1].item); + (yyval.item)= ((Item*(*)(Item*))((yyvsp[(1) - (4)].symbol).symbol->create_func))((yyvsp[(3) - (4)].item)); } break; case 830: -#line 4880 "sql_yacc.yy" +#line 4882 "sql_yacc.yy" { - if (!yyvsp[-5].symbol.symbol->create_func) + if (!(yyvsp[(1) - (6)].symbol).symbol->create_func) { my_error(ER_FEATURE_DISABLED, MYF(0), - yyvsp[-5].symbol.symbol->group->name, - yyvsp[-5].symbol.symbol->group->needed_define); + (yyvsp[(1) - (6)].symbol).symbol->group->name, + (yyvsp[(1) - (6)].symbol).symbol->group->needed_define); MYSQL_YYABORT; } - yyval.item= ((Item*(*)(Item*,Item*))(yyvsp[-5].symbol.symbol->create_func))(yyvsp[-3].item,yyvsp[-1].item); + (yyval.item)= ((Item*(*)(Item*,Item*))((yyvsp[(1) - (6)].symbol).symbol->create_func))((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 831: -#line 4891 "sql_yacc.yy" +#line 4893 "sql_yacc.yy" { - if (!yyvsp[-7].symbol.symbol->create_func) + if (!(yyvsp[(1) - (8)].symbol).symbol->create_func) { my_error(ER_FEATURE_DISABLED, MYF(0), - yyvsp[-7].symbol.symbol->group->name, - yyvsp[-7].symbol.symbol->group->needed_define); + (yyvsp[(1) - (8)].symbol).symbol->group->name, + (yyvsp[(1) - (8)].symbol).symbol->group->needed_define); MYSQL_YYABORT; } - yyval.item= ((Item*(*)(Item*,Item*,Item*))(yyvsp[-7].symbol.symbol->create_func))(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); + (yyval.item)= ((Item*(*)(Item*,Item*,Item*))((yyvsp[(1) - (8)].symbol).symbol->create_func))((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 832: -#line 4902 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-3].item, yyvsp[-1].item, INTERVAL_DAY, 0);} +#line 4904 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 0);} break; case 833: -#line 4904 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-5].item, yyvsp[-2].item, yyvsp[-1].interval, 0); } +#line 4906 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 0); } break; case 834: -#line 4906 "sql_yacc.yy" - { yyval.item= new Item_func_repeat(yyvsp[-3].item,yyvsp[-1].item); } +#line 4908 "sql_yacc.yy" + { (yyval.item)= new Item_func_repeat((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 835: -#line 4908 "sql_yacc.yy" - { yyval.item= new Item_func_atan(yyvsp[-1].item); } +#line 4910 "sql_yacc.yy" + { (yyval.item)= new Item_func_atan((yyvsp[(3) - (4)].item)); } break; case 836: -#line 4910 "sql_yacc.yy" - { yyval.item= new Item_func_atan(yyvsp[-3].item,yyvsp[-1].item); } +#line 4912 "sql_yacc.yy" + { (yyval.item)= new Item_func_atan((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 837: -#line 4912 "sql_yacc.yy" - { yyval.item= new Item_func_char(*yyvsp[-1].item_list); } +#line 4914 "sql_yacc.yy" + { (yyval.item)= new Item_func_char(*(yyvsp[(3) - (4)].item_list)); } break; case 838: -#line 4914 "sql_yacc.yy" - { yyval.item= new Item_func_char(*yyvsp[-3].item_list, yyvsp[-1].charset); } +#line 4916 "sql_yacc.yy" + { (yyval.item)= new Item_func_char(*(yyvsp[(3) - (6)].item_list), (yyvsp[(5) - (6)].charset)); } break; case 839: -#line 4916 "sql_yacc.yy" - { yyval.item= new Item_func_charset(yyvsp[-1].item); } +#line 4918 "sql_yacc.yy" + { (yyval.item)= new Item_func_charset((yyvsp[(3) - (4)].item)); } break; case 840: -#line 4918 "sql_yacc.yy" - { yyval.item= new Item_func_coalesce(* yyvsp[-1].item_list); } +#line 4920 "sql_yacc.yy" + { (yyval.item)= new Item_func_coalesce(* (yyvsp[(3) - (4)].item_list)); } break; case 841: -#line 4920 "sql_yacc.yy" - { yyval.item= new Item_func_collation(yyvsp[-1].item); } +#line 4922 "sql_yacc.yy" + { (yyval.item)= new Item_func_collation((yyvsp[(3) - (4)].item)); } break; case 842: -#line 4922 "sql_yacc.yy" - { yyval.item= new Item_func_concat(* yyvsp[-1].item_list); } +#line 4924 "sql_yacc.yy" + { (yyval.item)= new Item_func_concat(* (yyvsp[(3) - (4)].item_list)); } break; case 843: -#line 4924 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_concat_ws(*yyvsp[-1].item_list); } +#line 4926 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_concat_ws(*(yyvsp[(5) - (6)].item_list)); } break; case 844: -#line 4926 "sql_yacc.yy" +#line 4928 "sql_yacc.yy" { if (Lex->add_time_zone_tables_to_query_tables(YYTHD)) MYSQL_YYABORT; - yyval.item= new Item_func_convert_tz(yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); + (yyval.item)= new Item_func_convert_tz((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); } break; case 845: -#line 4932 "sql_yacc.yy" - { yyval.item= new Item_func_curdate_local(); Lex->safe_to_cache_query=0; } +#line 4934 "sql_yacc.yy" + { (yyval.item)= new Item_func_curdate_local(); Lex->safe_to_cache_query=0; } break; case 846: -#line 4934 "sql_yacc.yy" - { yyval.item= new Item_func_curtime_local(); Lex->safe_to_cache_query=0; } +#line 4936 "sql_yacc.yy" + { (yyval.item)= new Item_func_curtime_local(); Lex->safe_to_cache_query=0; } break; case 847: -#line 4936 "sql_yacc.yy" +#line 4938 "sql_yacc.yy" { - yyval.item= new Item_func_curtime_local(yyvsp[-1].item); + (yyval.item)= new Item_func_curtime_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0; } break; case 848: -#line 4941 "sql_yacc.yy" +#line 4943 "sql_yacc.yy" { - yyval.item= new Item_func_current_user(Lex->current_context()); + (yyval.item)= new Item_func_current_user(Lex->current_context()); Lex->safe_to_cache_query= 0; } break; case 849: -#line 4946 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-4].item,yyvsp[-2].item,yyvsp[-1].interval,0); } +#line 4948 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (7)].item),(yyvsp[(5) - (7)].item),(yyvsp[(6) - (7)].interval),0); } break; case 850: -#line 4948 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-4].item,yyvsp[-2].item,yyvsp[-1].interval,1); } +#line 4950 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (7)].item),(yyvsp[(5) - (7)].item),(yyvsp[(6) - (7)].interval),1); } break; case 851: -#line 4950 "sql_yacc.yy" +#line 4952 "sql_yacc.yy" { - yyval.item= new Item_func_database(); + (yyval.item)= new Item_func_database(); Lex->safe_to_cache_query=0; } break; case 852: -#line 4955 "sql_yacc.yy" - { yyval.item= new Item_date_typecast(yyvsp[-1].item); } +#line 4957 "sql_yacc.yy" + { (yyval.item)= new Item_date_typecast((yyvsp[(3) - (4)].item)); } break; case 853: -#line 4957 "sql_yacc.yy" - { yyval.item= new Item_func_dayofmonth(yyvsp[-1].item); } +#line 4959 "sql_yacc.yy" + { (yyval.item)= new Item_func_dayofmonth((yyvsp[(3) - (4)].item)); } break; case 854: -#line 4959 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_elt(*yyvsp[-1].item_list); } +#line 4961 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_elt(*(yyvsp[(5) - (6)].item_list)); } break; case 855: -#line 4961 "sql_yacc.yy" - { yyval.item= new Item_func_make_set(yyvsp[-3].item, *yyvsp[-1].item_list); } +#line 4963 "sql_yacc.yy" + { (yyval.item)= new Item_func_make_set((yyvsp[(3) - (6)].item), *(yyvsp[(5) - (6)].item_list)); } break; case 856: -#line 4963 "sql_yacc.yy" +#line 4965 "sql_yacc.yy" { - yyval.item= new Item_func_encrypt(yyvsp[-1].item); + (yyval.item)= new Item_func_encrypt((yyvsp[(3) - (4)].item)); Lex->uncacheable(UNCACHEABLE_RAND); } break; case 857: -#line 4967 "sql_yacc.yy" - { yyval.item= new Item_func_encrypt(yyvsp[-3].item,yyvsp[-1].item); } +#line 4969 "sql_yacc.yy" + { (yyval.item)= new Item_func_encrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 858: -#line 4969 "sql_yacc.yy" - { yyval.item= new Item_func_decode(yyvsp[-3].item,yyvsp[-1].lex_str.str); } +#line 4971 "sql_yacc.yy" + { (yyval.item)= new Item_func_decode((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].lex_str).str); } break; case 859: -#line 4971 "sql_yacc.yy" - { yyval.item= new Item_func_encode(yyvsp[-3].item,yyvsp[-1].lex_str.str); } +#line 4973 "sql_yacc.yy" + { (yyval.item)= new Item_func_encode((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].lex_str).str); } break; case 860: -#line 4973 "sql_yacc.yy" - { yyval.item= new Item_func_des_decrypt(yyvsp[-1].item); } +#line 4975 "sql_yacc.yy" + { (yyval.item)= new Item_func_des_decrypt((yyvsp[(3) - (4)].item)); } break; case 861: -#line 4975 "sql_yacc.yy" - { yyval.item= new Item_func_des_decrypt(yyvsp[-3].item,yyvsp[-1].item); } +#line 4977 "sql_yacc.yy" + { (yyval.item)= new Item_func_des_decrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 862: -#line 4977 "sql_yacc.yy" - { yyval.item= new Item_func_des_encrypt(yyvsp[-1].item); } +#line 4979 "sql_yacc.yy" + { (yyval.item)= new Item_func_des_encrypt((yyvsp[(3) - (4)].item)); } break; case 863: -#line 4979 "sql_yacc.yy" - { yyval.item= new Item_func_des_encrypt(yyvsp[-3].item,yyvsp[-1].item); } +#line 4981 "sql_yacc.yy" + { (yyval.item)= new Item_func_des_encrypt((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 864: -#line 4981 "sql_yacc.yy" - { yyval.item= new Item_func_export_set(yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); } +#line 4983 "sql_yacc.yy" + { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); } break; case 865: -#line 4983 "sql_yacc.yy" - { yyval.item= new Item_func_export_set(yyvsp[-7].item, yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); } +#line 4985 "sql_yacc.yy" + { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (10)].item), (yyvsp[(5) - (10)].item), (yyvsp[(7) - (10)].item), (yyvsp[(9) - (10)].item)); } break; case 866: -#line 4985 "sql_yacc.yy" - { yyval.item= new Item_func_export_set(yyvsp[-9].item, yyvsp[-7].item, yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); } +#line 4987 "sql_yacc.yy" + { (yyval.item)= new Item_func_export_set((yyvsp[(3) - (12)].item), (yyvsp[(5) - (12)].item), (yyvsp[(7) - (12)].item), (yyvsp[(9) - (12)].item), (yyvsp[(11) - (12)].item)); } break; case 867: -#line 4987 "sql_yacc.yy" - { yyval.item= new Item_func_format(yyvsp[-3].item,atoi(yyvsp[-1].lex_str.str)); } +#line 4989 "sql_yacc.yy" + { (yyval.item)= new Item_func_format((yyvsp[(3) - (6)].item),atoi((yyvsp[(5) - (6)].lex_str).str)); } break; case 868: -#line 4989 "sql_yacc.yy" - { yyval.item= new Item_func_from_unixtime(yyvsp[-1].item); } +#line 4991 "sql_yacc.yy" + { (yyval.item)= new Item_func_from_unixtime((yyvsp[(3) - (4)].item)); } break; case 869: -#line 4991 "sql_yacc.yy" +#line 4993 "sql_yacc.yy" { - yyval.item= new Item_func_date_format (new Item_func_from_unixtime(yyvsp[-3].item),yyvsp[-1].item,0); + (yyval.item)= new Item_func_date_format (new Item_func_from_unixtime((yyvsp[(3) - (6)].item)),(yyvsp[(5) - (6)].item),0); } break; case 870: -#line 4995 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_field(*yyvsp[-1].item_list); } +#line 4997 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_field(*(yyvsp[(5) - (6)].item_list)); } break; case 871: -#line 4997 "sql_yacc.yy" +#line 4999 "sql_yacc.yy" { #ifdef HAVE_SPATIAL - yyval.item= yyvsp[0].item; + (yyval.item)= (yyvsp[(1) - (1)].item); #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -20106,364 +20441,364 @@ break; case 872: -#line 5007 "sql_yacc.yy" - { yyval.item= new Item_func_get_format(yyvsp[-3].date_time_type, yyvsp[-1].item); } +#line 5009 "sql_yacc.yy" + { (yyval.item)= new Item_func_get_format((yyvsp[(3) - (6)].date_time_type), (yyvsp[(5) - (6)].item)); } break; case 873: -#line 5009 "sql_yacc.yy" - { yyval.item= new Item_func_hour(yyvsp[-1].item); } +#line 5011 "sql_yacc.yy" + { (yyval.item)= new Item_func_hour((yyvsp[(3) - (4)].item)); } break; case 874: -#line 5011 "sql_yacc.yy" - { yyval.item= new Item_func_if(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5013 "sql_yacc.yy" + { (yyval.item)= new Item_func_if((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 875: -#line 5013 "sql_yacc.yy" - { yyval.item= new Item_func_insert(yyvsp[-7].item,yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5015 "sql_yacc.yy" + { (yyval.item)= new Item_func_insert((yyvsp[(3) - (10)].item),(yyvsp[(5) - (10)].item),(yyvsp[(7) - (10)].item),(yyvsp[(9) - (10)].item)); } break; case 876: -#line 5016 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[0].item,yyvsp[-3].item,yyvsp[-2].interval,0); } +#line 5018 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(4) - (4)].item),(yyvsp[(1) - (4)].item),(yyvsp[(2) - (4)].interval),0); } break; case 877: -#line 5018 "sql_yacc.yy" +#line 5020 "sql_yacc.yy" { - if (yyvsp[0].item->type() != Item::ROW_ITEM) + if ((yyvsp[(1) - (1)].item)->type() != Item::ROW_ITEM) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } - yyval.item= new Item_func_interval((Item_row *)yyvsp[0].item); + (yyval.item)= new Item_func_interval((Item_row *)(yyvsp[(1) - (1)].item)); } break; case 878: -#line 5027 "sql_yacc.yy" +#line 5029 "sql_yacc.yy" { - yyval.item= new Item_func_last_insert_id(); + (yyval.item)= new Item_func_last_insert_id(); Lex->safe_to_cache_query= 0; } break; case 879: -#line 5032 "sql_yacc.yy" +#line 5034 "sql_yacc.yy" { - yyval.item= new Item_func_last_insert_id(yyvsp[-1].item); + (yyval.item)= new Item_func_last_insert_id((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query= 0; } break; case 880: -#line 5037 "sql_yacc.yy" - { yyval.item= new Item_func_left(yyvsp[-3].item,yyvsp[-1].item); } +#line 5039 "sql_yacc.yy" + { (yyval.item)= new Item_func_left((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 881: -#line 5039 "sql_yacc.yy" - { yyval.item= new Item_func_locate(yyvsp[-1].item,yyvsp[-3].item); } +#line 5041 "sql_yacc.yy" + { (yyval.item)= new Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 882: -#line 5041 "sql_yacc.yy" - { yyval.item= new Item_func_locate(yyvsp[-3].item,yyvsp[-5].item,yyvsp[-1].item); } +#line 5043 "sql_yacc.yy" + { (yyval.item)= new Item_func_locate((yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 883: -#line 5043 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_max(*yyvsp[-1].item_list); } +#line 5045 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_max(*(yyvsp[(5) - (6)].item_list)); } break; case 884: -#line 5045 "sql_yacc.yy" - { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_min(*yyvsp[-1].item_list); } +#line 5047 "sql_yacc.yy" + { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new Item_func_min(*(yyvsp[(5) - (6)].item_list)); } break; case 885: -#line 5047 "sql_yacc.yy" - { yyval.item= new Item_func_log(yyvsp[-1].item); } +#line 5049 "sql_yacc.yy" + { (yyval.item)= new Item_func_log((yyvsp[(3) - (4)].item)); } break; case 886: -#line 5049 "sql_yacc.yy" - { yyval.item= new Item_func_log(yyvsp[-3].item, yyvsp[-1].item); } +#line 5051 "sql_yacc.yy" + { (yyval.item)= new Item_func_log((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 887: -#line 5051 "sql_yacc.yy" +#line 5053 "sql_yacc.yy" { - yyval.item= new Item_master_pos_wait(yyvsp[-3].item, yyvsp[-1].item); + (yyval.item)= new Item_master_pos_wait((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); Lex->safe_to_cache_query=0; } break; case 888: -#line 5056 "sql_yacc.yy" +#line 5058 "sql_yacc.yy" { - yyval.item= new Item_master_pos_wait(yyvsp[-5].item, yyvsp[-3].item, yyvsp[-1].item); + (yyval.item)= new Item_master_pos_wait((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); Lex->safe_to_cache_query=0; } break; case 889: -#line 5061 "sql_yacc.yy" - { yyval.item= new Item_func_microsecond(yyvsp[-1].item); } +#line 5063 "sql_yacc.yy" + { (yyval.item)= new Item_func_microsecond((yyvsp[(3) - (4)].item)); } break; case 890: -#line 5063 "sql_yacc.yy" - { yyval.item= new Item_func_minute(yyvsp[-1].item); } +#line 5065 "sql_yacc.yy" + { (yyval.item)= new Item_func_minute((yyvsp[(3) - (4)].item)); } break; case 891: -#line 5065 "sql_yacc.yy" - { yyval.item = new Item_func_mod( yyvsp[-3].item, yyvsp[-1].item); } +#line 5067 "sql_yacc.yy" + { (yyval.item) = new Item_func_mod( (yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 892: -#line 5067 "sql_yacc.yy" - { yyval.item= new Item_func_month(yyvsp[-1].item); } +#line 5069 "sql_yacc.yy" + { (yyval.item)= new Item_func_month((yyvsp[(3) - (4)].item)); } break; case 893: -#line 5069 "sql_yacc.yy" - { yyval.item= new Item_func_now_local(); Lex->safe_to_cache_query=0;} +#line 5071 "sql_yacc.yy" + { (yyval.item)= new Item_func_now_local(); Lex->safe_to_cache_query=0;} break; case 894: -#line 5071 "sql_yacc.yy" - { yyval.item= new Item_func_now_local(yyvsp[-1].item); Lex->safe_to_cache_query=0;} +#line 5073 "sql_yacc.yy" + { (yyval.item)= new Item_func_now_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0;} break; case 895: -#line 5073 "sql_yacc.yy" +#line 5075 "sql_yacc.yy" { - yyval.item= YYTHD->variables.old_passwords ? - (Item *) new Item_func_old_password(yyvsp[-1].item) : - (Item *) new Item_func_password(yyvsp[-1].item); + (yyval.item)= YYTHD->variables.old_passwords ? + (Item *) new Item_func_old_password((yyvsp[(3) - (4)].item)) : + (Item *) new Item_func_password((yyvsp[(3) - (4)].item)); } break; case 896: -#line 5079 "sql_yacc.yy" - { yyval.item= new Item_func_old_password(yyvsp[-1].item); } +#line 5081 "sql_yacc.yy" + { (yyval.item)= new Item_func_old_password((yyvsp[(3) - (4)].item)); } break; case 897: -#line 5081 "sql_yacc.yy" - { yyval.item = new Item_func_locate(yyvsp[-1].item,yyvsp[-3].item); } +#line 5083 "sql_yacc.yy" + { (yyval.item) = new Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 898: -#line 5083 "sql_yacc.yy" - { yyval.item = new Item_func_quarter(yyvsp[-1].item); } +#line 5085 "sql_yacc.yy" + { (yyval.item) = new Item_func_quarter((yyvsp[(3) - (4)].item)); } break; case 899: -#line 5085 "sql_yacc.yy" - { yyval.item= new Item_func_rand(yyvsp[-1].item); Lex->uncacheable(UNCACHEABLE_RAND);} +#line 5087 "sql_yacc.yy" + { (yyval.item)= new Item_func_rand((yyvsp[(3) - (4)].item)); Lex->uncacheable(UNCACHEABLE_RAND);} break; case 900: -#line 5087 "sql_yacc.yy" - { yyval.item= new Item_func_rand(); Lex->uncacheable(UNCACHEABLE_RAND);} +#line 5089 "sql_yacc.yy" + { (yyval.item)= new Item_func_rand(); Lex->uncacheable(UNCACHEABLE_RAND);} break; case 901: -#line 5089 "sql_yacc.yy" - { yyval.item= new Item_func_replace(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5091 "sql_yacc.yy" + { (yyval.item)= new Item_func_replace((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 902: -#line 5091 "sql_yacc.yy" - { yyval.item= new Item_func_right(yyvsp[-3].item,yyvsp[-1].item); } +#line 5093 "sql_yacc.yy" + { (yyval.item)= new Item_func_right((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 903: -#line 5093 "sql_yacc.yy" - { yyval.item= new Item_func_round(yyvsp[-1].item, new Item_int((char*)"0",0,1),0); } +#line 5095 "sql_yacc.yy" + { (yyval.item)= new Item_func_round((yyvsp[(3) - (4)].item), new Item_int((char*)"0",0,1),0); } break; case 904: -#line 5094 "sql_yacc.yy" - { yyval.item= new Item_func_round(yyvsp[-3].item,yyvsp[-1].item,0); } +#line 5096 "sql_yacc.yy" + { (yyval.item)= new Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),0); } break; case 905: -#line 5096 "sql_yacc.yy" +#line 5098 "sql_yacc.yy" { - yyval.item= new Item_func_row_count(); + (yyval.item)= new Item_func_row_count(); Lex->safe_to_cache_query= 0; #ifdef ENABLE_SENNA } break; case 906: -#line 5102 "sql_yacc.yy" +#line 5104 "sql_yacc.yy" { - yyval.item= new Item_func_senna_kwic(* yyvsp[-1].item_list); + (yyval.item)= new Item_func_senna_kwic(* (yyvsp[(3) - (4)].item_list)); #endif } break; case 907: -#line 5107 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-3].item, yyvsp[-1].item, INTERVAL_DAY, 1);} +#line 5109 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 1);} break; case 908: -#line 5109 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-5].item, yyvsp[-2].item, yyvsp[-1].interval, 1); } +#line 5111 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 1); } break; case 909: -#line 5111 "sql_yacc.yy" - { yyval.item= new Item_func_second(yyvsp[-1].item); } +#line 5113 "sql_yacc.yy" + { (yyval.item)= new Item_func_second((yyvsp[(3) - (4)].item)); } break; case 910: -#line 5113 "sql_yacc.yy" - { yyval.item= new Item_func_substr(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5115 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 911: -#line 5115 "sql_yacc.yy" - { yyval.item= new Item_func_substr(yyvsp[-3].item,yyvsp[-1].item); } +#line 5117 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 912: -#line 5117 "sql_yacc.yy" - { yyval.item= new Item_func_substr(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5119 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 913: -#line 5119 "sql_yacc.yy" - { yyval.item= new Item_func_substr(yyvsp[-3].item,yyvsp[-1].item); } +#line 5121 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 914: -#line 5121 "sql_yacc.yy" - { yyval.item= new Item_func_substr_index(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); } +#line 5123 "sql_yacc.yy" + { (yyval.item)= new Item_func_substr_index((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); } break; case 915: -#line 5123 "sql_yacc.yy" +#line 5125 "sql_yacc.yy" { if (global_system_variables.sysdate_is_now == 0) - yyval.item= new Item_func_sysdate_local(); - else yyval.item= new Item_func_now_local(); + (yyval.item)= new Item_func_sysdate_local(); + else (yyval.item)= new Item_func_now_local(); Lex->safe_to_cache_query=0; } break; case 916: -#line 5130 "sql_yacc.yy" +#line 5132 "sql_yacc.yy" { if (global_system_variables.sysdate_is_now == 0) - yyval.item= new Item_func_sysdate_local(yyvsp[-1].item); - else yyval.item= new Item_func_now_local(yyvsp[-1].item); + (yyval.item)= new Item_func_sysdate_local((yyvsp[(3) - (4)].item)); + else (yyval.item)= new Item_func_now_local((yyvsp[(3) - (4)].item)); Lex->safe_to_cache_query=0; } break; case 917: -#line 5137 "sql_yacc.yy" - { yyval.item= new Item_time_typecast(yyvsp[-1].item); } +#line 5139 "sql_yacc.yy" + { (yyval.item)= new Item_time_typecast((yyvsp[(3) - (4)].item)); } break; case 918: -#line 5139 "sql_yacc.yy" - { yyval.item= new Item_datetime_typecast(yyvsp[-1].item); } +#line 5141 "sql_yacc.yy" + { (yyval.item)= new Item_datetime_typecast((yyvsp[(3) - (4)].item)); } break; case 919: -#line 5141 "sql_yacc.yy" - { yyval.item= new Item_func_add_time(yyvsp[-3].item, yyvsp[-1].item, 1, 0); } +#line 5143 "sql_yacc.yy" + { (yyval.item)= new Item_func_add_time((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), 1, 0); } break; case 920: -#line 5143 "sql_yacc.yy" - { yyval.item= new Item_date_add_interval(yyvsp[-1].item,yyvsp[-3].item,yyvsp[-5].interval_time_st,0); } +#line 5145 "sql_yacc.yy" + { (yyval.item)= new Item_date_add_interval((yyvsp[(7) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].interval_time_st),0); } break; case 921: -#line 5145 "sql_yacc.yy" - { yyval.item= new Item_func_timestamp_diff(yyvsp[-3].item,yyvsp[-1].item,yyvsp[-5].interval_time_st); } +#line 5147 "sql_yacc.yy" + { (yyval.item)= new Item_func_timestamp_diff((yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item),(yyvsp[(3) - (8)].interval_time_st)); } break; case 922: -#line 5147 "sql_yacc.yy" - { yyval.item= new Item_func_trim(yyvsp[-1].item); } +#line 5149 "sql_yacc.yy" + { (yyval.item)= new Item_func_trim((yyvsp[(3) - (4)].item)); } break; case 923: -#line 5149 "sql_yacc.yy" - { yyval.item= new Item_func_ltrim(yyvsp[-1].item,yyvsp[-3].item); } +#line 5151 "sql_yacc.yy" + { (yyval.item)= new Item_func_ltrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 924: -#line 5151 "sql_yacc.yy" - { yyval.item= new Item_func_rtrim(yyvsp[-1].item,yyvsp[-3].item); } +#line 5153 "sql_yacc.yy" + { (yyval.item)= new Item_func_rtrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 925: -#line 5153 "sql_yacc.yy" - { yyval.item= new Item_func_trim(yyvsp[-1].item,yyvsp[-3].item); } +#line 5155 "sql_yacc.yy" + { (yyval.item)= new Item_func_trim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); } break; case 926: -#line 5155 "sql_yacc.yy" - { yyval.item= new Item_func_ltrim(yyvsp[-1].item); } +#line 5157 "sql_yacc.yy" + { (yyval.item)= new Item_func_ltrim((yyvsp[(5) - (6)].item)); } break; case 927: -#line 5157 "sql_yacc.yy" - { yyval.item= new Item_func_rtrim(yyvsp[-1].item); } +#line 5159 "sql_yacc.yy" + { (yyval.item)= new Item_func_rtrim((yyvsp[(5) - (6)].item)); } break; case 928: -#line 5159 "sql_yacc.yy" - { yyval.item= new Item_func_trim(yyvsp[-1].item); } +#line 5161 "sql_yacc.yy" + { (yyval.item)= new Item_func_trim((yyvsp[(5) - (6)].item)); } break; case 929: -#line 5161 "sql_yacc.yy" - { yyval.item= new Item_func_trim(yyvsp[-1].item,yyvsp[-3].item); } +#line 5163 "sql_yacc.yy" + { (yyval.item)= new Item_func_trim((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); } break; case 930: -#line 5163 "sql_yacc.yy" - { yyval.item= new Item_func_round(yyvsp[-3].item,yyvsp[-1].item,1); } +#line 5165 "sql_yacc.yy" + { (yyval.item)= new Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),1); } break; case 931: -#line 5165 "sql_yacc.yy" +#line 5167 "sql_yacc.yy" { LEX *lex= Lex; - sp_name *name= new sp_name(yyvsp[-5].lex_str, yyvsp[-3].lex_str, true); + sp_name *name= new sp_name((yyvsp[(1) - (6)].lex_str), (yyvsp[(3) - (6)].lex_str), true); name->init_qname(YYTHD); sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION); - if (yyvsp[-1].item_list) - yyval.item= new Item_func_sp(Lex->current_context(), name, *yyvsp[-1].item_list); + if ((yyvsp[(5) - (6)].item_list)) + (yyval.item)= new Item_func_sp(Lex->current_context(), name, *(yyvsp[(5) - (6)].item_list)); else - yyval.item= new Item_func_sp(Lex->current_context(), name); + (yyval.item)= new Item_func_sp(Lex->current_context(), name); lex->safe_to_cache_query=0; } break; case 932: -#line 5178 "sql_yacc.yy" +#line 5180 "sql_yacc.yy" { #ifdef HAVE_DLOPEN udf_func *udf= 0; LEX *lex= Lex; if (using_udf_functions && - (udf= find_udf(yyvsp[-1].lex_str.str, yyvsp[-1].lex_str.length)) && + (udf= find_udf((yyvsp[(1) - (2)].lex_str).str, (yyvsp[(1) - (2)].lex_str).length)) && udf->type == UDFTYPE_AGGREGATE) { if (lex->current_select->inc_in_sum_expr()) @@ -20478,7 +20813,7 @@ break; case 933: -#line 5196 "sql_yacc.yy" +#line 5198 "sql_yacc.yy" { LEX *lex= Lex; #ifdef HAVE_DLOPEN @@ -20493,65 +20828,65 @@ case STRING_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_func_udf_str(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_func_udf_str(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_func_udf_str(udf); + (yyval.item) = new Item_func_udf_str(udf); } else { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_sum_udf_str(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_sum_udf_str(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_sum_udf_str(udf); + (yyval.item) = new Item_sum_udf_str(udf); } break; case REAL_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_func_udf_float(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_func_udf_float(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_func_udf_float(udf); + (yyval.item) = new Item_func_udf_float(udf); } else { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_sum_udf_float(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_sum_udf_float(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_sum_udf_float(udf); + (yyval.item) = new Item_sum_udf_float(udf); } break; case INT_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_func_udf_int(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_func_udf_int(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_func_udf_int(udf); + (yyval.item) = new Item_func_udf_int(udf); } else { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_sum_udf_int(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_sum_udf_int(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_sum_udf_int(udf); + (yyval.item) = new Item_sum_udf_int(udf); } break; case DECIMAL_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_func_udf_decimal(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_func_udf_decimal(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_func_udf_decimal(udf); + (yyval.item) = new Item_func_udf_decimal(udf); } else { - if (yyvsp[-1].item_list != NULL) - yyval.item = new Item_sum_udf_decimal(udf, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list) != NULL) + (yyval.item) = new Item_sum_udf_decimal(udf, *(yyvsp[(4) - (5)].item_list)); else - yyval.item = new Item_sum_udf_decimal(udf); + (yyval.item) = new Item_sum_udf_decimal(udf); } break; default: @@ -20565,289 +20900,289 @@ LEX_STRING db; if (thd->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; - sp_name *name= new sp_name(db, yyvsp[-4].lex_str, false); + sp_name *name= new sp_name(db, (yyvsp[(1) - (5)].lex_str), false); if (name) name->init_qname(thd); sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION); - if (yyvsp[-1].item_list) - yyval.item= new Item_func_sp(Lex->current_context(), name, *yyvsp[-1].item_list); + if ((yyvsp[(4) - (5)].item_list)) + (yyval.item)= new Item_func_sp(Lex->current_context(), name, *(yyvsp[(4) - (5)].item_list)); else - yyval.item= new Item_func_sp(Lex->current_context(), name); + (yyval.item)= new Item_func_sp(Lex->current_context(), name); lex->safe_to_cache_query=0; } } break; case 934: -#line 5295 "sql_yacc.yy" +#line 5297 "sql_yacc.yy" { - yyval.item= new Item_func_unique_users(yyvsp[-7].item,atoi(yyvsp[-5].lex_str.str),atoi(yyvsp[-3].lex_str.str), * yyvsp[-1].item_list); + (yyval.item)= new Item_func_unique_users((yyvsp[(3) - (10)].item),atoi((yyvsp[(5) - (10)].lex_str).str),atoi((yyvsp[(7) - (10)].lex_str).str), * (yyvsp[(9) - (10)].item_list)); } break; case 935: -#line 5299 "sql_yacc.yy" +#line 5301 "sql_yacc.yy" { - yyval.item= new Item_func_unix_timestamp(); + (yyval.item)= new Item_func_unix_timestamp(); Lex->safe_to_cache_query=0; } break; case 936: -#line 5304 "sql_yacc.yy" - { yyval.item= new Item_func_unix_timestamp(yyvsp[-1].item); } +#line 5306 "sql_yacc.yy" + { (yyval.item)= new Item_func_unix_timestamp((yyvsp[(3) - (4)].item)); } break; case 937: -#line 5306 "sql_yacc.yy" - { yyval.item= new Item_func_user(); Lex->safe_to_cache_query=0; } +#line 5308 "sql_yacc.yy" + { (yyval.item)= new Item_func_user(); Lex->safe_to_cache_query=0; } break; case 938: -#line 5308 "sql_yacc.yy" - { yyval.item= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;} +#line 5310 "sql_yacc.yy" + { (yyval.item)= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;} break; case 939: -#line 5310 "sql_yacc.yy" - { yyval.item= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;} +#line 5312 "sql_yacc.yy" + { (yyval.item)= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;} break; case 940: -#line 5312 "sql_yacc.yy" - { yyval.item= new Item_func_now_utc(); Lex->safe_to_cache_query=0;} +#line 5314 "sql_yacc.yy" + { (yyval.item)= new Item_func_now_utc(); Lex->safe_to_cache_query=0;} break; case 941: -#line 5314 "sql_yacc.yy" +#line 5316 "sql_yacc.yy" { - yyval.item= new Item_func_week(yyvsp[-1].item,new Item_int((char*) "0", + (yyval.item)= new Item_func_week((yyvsp[(3) - (4)].item),new Item_int((char*) "0", YYTHD->variables.default_week_format,1)); } break; case 942: -#line 5319 "sql_yacc.yy" - { yyval.item= new Item_func_week(yyvsp[-3].item,yyvsp[-1].item); } +#line 5321 "sql_yacc.yy" + { (yyval.item)= new Item_func_week((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); } break; case 943: -#line 5321 "sql_yacc.yy" - { yyval.item= new Item_func_year(yyvsp[-1].item); } +#line 5323 "sql_yacc.yy" + { (yyval.item)= new Item_func_year((yyvsp[(3) - (4)].item)); } break; case 944: -#line 5323 "sql_yacc.yy" - { yyval.item= new Item_func_yearweek(yyvsp[-1].item,new Item_int((char*) "0",0,1)); } +#line 5325 "sql_yacc.yy" + { (yyval.item)= new Item_func_yearweek((yyvsp[(3) - (4)].item),new Item_int((char*) "0",0,1)); } break; case 945: -#line 5325 "sql_yacc.yy" - { yyval.item= new Item_func_yearweek(yyvsp[-3].item, yyvsp[-1].item); } +#line 5327 "sql_yacc.yy" + { (yyval.item)= new Item_func_yearweek((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); } break; case 946: -#line 5327 "sql_yacc.yy" +#line 5329 "sql_yacc.yy" { - yyval.item=new Item_func_benchmark(yyvsp[-3].ulong_num,yyvsp[-1].item); + (yyval.item)=new Item_func_benchmark((yyvsp[(3) - (6)].ulong_num),(yyvsp[(5) - (6)].item)); Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } break; case 947: -#line 5332 "sql_yacc.yy" - { yyval.item=new Item_extract( yyvsp[-3].interval, yyvsp[-1].item); } +#line 5334 "sql_yacc.yy" + { (yyval.item)=new Item_extract( (yyvsp[(3) - (6)].interval), (yyvsp[(5) - (6)].item)); } break; case 948: -#line 5336 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_rel(yyvsp[-3].item, yyvsp[-1].item, Item_func::SP_CONTAINS_FUNC)); } +#line 5338 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_rel((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), Item_func::SP_CONTAINS_FUNC)); } break; case 949: -#line 5338 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5340 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 950: -#line 5340 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5342 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 951: -#line 5342 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_wkb(yyvsp[-1].item)); } +#line 5344 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_wkb((yyvsp[(3) - (4)].item))); } break; case 952: -#line 5344 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_wkb(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5346 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_wkb((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 953: -#line 5346 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5348 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_geometrycollection, Geometry::wkb_point)); } break; case 954: -#line 5350 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5352 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_linestring, Geometry::wkb_point)); } break; case 955: -#line 5353 "sql_yacc.yy" - { yyval.item= GEOM_NEW( Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5355 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW( Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multilinestring, Geometry::wkb_linestring)); } break; case 956: -#line 5356 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5358 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 957: -#line 5358 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5360 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 958: -#line 5360 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5362 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 959: -#line 5362 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5364 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 960: -#line 5364 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5366 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 961: -#line 5366 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5368 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 962: -#line 5368 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5370 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multipoint, Geometry::wkb_point)); } break; case 963: -#line 5371 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5373 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_multipolygon, Geometry::wkb_polygon)); } break; case 964: -#line 5374 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_point(yyvsp[-3].item,yyvsp[-1].item)); } +#line 5376 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_point((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item))); } break; case 965: -#line 5376 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5378 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 966: -#line 5378 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5380 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 967: -#line 5380 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5382 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 968: -#line 5382 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5384 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 969: -#line 5384 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list, +#line 5386 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), Geometry::wkb_polygon, Geometry::wkb_linestring)); } break; case 970: -#line 5387 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5389 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 971: -#line 5389 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5391 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 972: -#line 5391 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); } +#line 5393 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (4)].item))); } break; case 973: -#line 5393 "sql_yacc.yy" - { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); } +#line 5395 "sql_yacc.yy" + { (yyval.item)= GEOM_NEW(Item_func_geometry_from_text((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item))); } break; case 974: -#line 5397 "sql_yacc.yy" - { yyval.num= FT_NL; } +#line 5399 "sql_yacc.yy" + { (yyval.num)= FT_NL; } break; case 975: -#line 5398 "sql_yacc.yy" - { yyval.num= FT_NL | FT_EXPAND; } +#line 5400 "sql_yacc.yy" + { (yyval.num)= FT_NL | FT_EXPAND; } break; case 976: -#line 5399 "sql_yacc.yy" - { yyval.num= FT_BOOL; } +#line 5401 "sql_yacc.yy" + { (yyval.num)= FT_BOOL; } break; case 977: -#line 5403 "sql_yacc.yy" - { yyval.item_list= NULL; } +#line 5405 "sql_yacc.yy" + { (yyval.item_list)= NULL; } break; case 978: -#line 5404 "sql_yacc.yy" - { yyval.item_list= yyvsp[0].item_list;} +#line 5406 "sql_yacc.yy" + { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 979: -#line 5408 "sql_yacc.yy" +#line 5410 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 980: -#line 5410 "sql_yacc.yy" - { yyval.item_list= Select->expr_list.pop(); } +#line 5412 "sql_yacc.yy" + { (yyval.item_list)= Select->expr_list.pop(); } break; case 981: -#line 5415 "sql_yacc.yy" +#line 5417 "sql_yacc.yy" { - Select->expr_list.head()->push_back(yyvsp[0].item); + Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 982: -#line 5419 "sql_yacc.yy" +#line 5421 "sql_yacc.yy" { - Select->expr_list.head()->push_back(yyvsp[0].item); + Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 983: -#line 5426 "sql_yacc.yy" +#line 5428 "sql_yacc.yy" { udf_func *udf= Select->udf_list.head(); /* @@ -20856,7 +21191,7 @@ because the syntax will not allow having an explicit name here. See WL#1017 re. udf attributes. */ - if (yyvsp[0].lex_str.str) + if ((yyvsp[(4) - (4)].lex_str).str) { if (!udf) { @@ -20868,138 +21203,138 @@ MYSQL_YYABORT; } - yyvsp[-2].item->is_autogenerated_name= FALSE; - yyvsp[-2].item->set_name(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, system_charset_info); + (yyvsp[(2) - (4)].item)->is_autogenerated_name= FALSE; + (yyvsp[(2) - (4)].item)->set_name((yyvsp[(4) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).length, system_charset_info); } else if (udf) - yyvsp[-2].item->set_name(yyvsp[-3].simple_string, (uint) (yyvsp[-1].simple_string - yyvsp[-3].simple_string), YYTHD->charset()); - yyval.item= yyvsp[-2].item; + (yyvsp[(2) - (4)].item)->set_name((yyvsp[(1) - (4)].simple_string), (uint) ((yyvsp[(3) - (4)].simple_string) - (yyvsp[(1) - (4)].simple_string)), YYTHD->charset()); + (yyval.item)= (yyvsp[(2) - (4)].item); } break; case 984: -#line 5457 "sql_yacc.yy" - { yyval.item=new Item_sum_avg(yyvsp[-1].item); } +#line 5459 "sql_yacc.yy" + { (yyval.item)=new Item_sum_avg((yyvsp[(3) - (4)].item)); } break; case 985: -#line 5459 "sql_yacc.yy" - { yyval.item=new Item_sum_avg_distinct(yyvsp[-1].item); } +#line 5461 "sql_yacc.yy" + { (yyval.item)=new Item_sum_avg_distinct((yyvsp[(4) - (5)].item)); } break; case 986: -#line 5461 "sql_yacc.yy" - { yyval.item=new Item_sum_and(yyvsp[-1].item); } +#line 5463 "sql_yacc.yy" + { (yyval.item)=new Item_sum_and((yyvsp[(3) - (4)].item)); } break; case 987: -#line 5463 "sql_yacc.yy" - { yyval.item=new Item_sum_or(yyvsp[-1].item); } +#line 5465 "sql_yacc.yy" + { (yyval.item)=new Item_sum_or((yyvsp[(3) - (4)].item)); } break; case 988: -#line 5465 "sql_yacc.yy" - { yyval.item=new Item_sum_xor(yyvsp[-1].item); } +#line 5467 "sql_yacc.yy" + { (yyval.item)=new Item_sum_xor((yyvsp[(3) - (4)].item)); } break; case 989: -#line 5467 "sql_yacc.yy" - { yyval.item=new Item_sum_count(new Item_int((int32) 0L,1)); } +#line 5469 "sql_yacc.yy" + { (yyval.item)=new Item_sum_count(new Item_int((int32) 0L,1)); } break; case 990: -#line 5469 "sql_yacc.yy" - { yyval.item=new Item_sum_count(yyvsp[-1].item); } +#line 5471 "sql_yacc.yy" + { (yyval.item)=new Item_sum_count((yyvsp[(3) - (4)].item)); } break; case 991: -#line 5471 "sql_yacc.yy" +#line 5473 "sql_yacc.yy" { Select->in_sum_expr++; } break; case 992: -#line 5473 "sql_yacc.yy" +#line 5475 "sql_yacc.yy" { Select->in_sum_expr--; } break; case 993: -#line 5475 "sql_yacc.yy" - { yyval.item=new Item_sum_count_distinct(* yyvsp[-2].item_list); } +#line 5477 "sql_yacc.yy" + { (yyval.item)=new Item_sum_count_distinct(* (yyvsp[(5) - (7)].item_list)); } break; case 994: -#line 5477 "sql_yacc.yy" - { yyval.item= new Item_sum_unique_users(yyvsp[-7].item,atoi(yyvsp[-5].lex_str.str),atoi(yyvsp[-3].lex_str.str),yyvsp[-1].item); } +#line 5479 "sql_yacc.yy" + { (yyval.item)= new Item_sum_unique_users((yyvsp[(3) - (10)].item),atoi((yyvsp[(5) - (10)].lex_str).str),atoi((yyvsp[(7) - (10)].lex_str).str),(yyvsp[(9) - (10)].item)); } break; case 995: -#line 5479 "sql_yacc.yy" - { yyval.item=new Item_sum_min(yyvsp[-1].item); } +#line 5481 "sql_yacc.yy" + { (yyval.item)=new Item_sum_min((yyvsp[(3) - (4)].item)); } break; case 996: -#line 5486 "sql_yacc.yy" - { yyval.item=new Item_sum_min(yyvsp[-1].item); } +#line 5488 "sql_yacc.yy" + { (yyval.item)=new Item_sum_min((yyvsp[(4) - (5)].item)); } break; case 997: -#line 5488 "sql_yacc.yy" - { yyval.item=new Item_sum_max(yyvsp[-1].item); } +#line 5490 "sql_yacc.yy" + { (yyval.item)=new Item_sum_max((yyvsp[(3) - (4)].item)); } break; case 998: -#line 5490 "sql_yacc.yy" - { yyval.item=new Item_sum_max(yyvsp[-1].item); } +#line 5492 "sql_yacc.yy" + { (yyval.item)=new Item_sum_max((yyvsp[(4) - (5)].item)); } break; case 999: -#line 5492 "sql_yacc.yy" - { yyval.item=new Item_sum_std(yyvsp[-1].item, 0); } +#line 5494 "sql_yacc.yy" + { (yyval.item)=new Item_sum_std((yyvsp[(3) - (4)].item), 0); } break; case 1000: -#line 5494 "sql_yacc.yy" - { yyval.item=new Item_sum_variance(yyvsp[-1].item, 0); } +#line 5496 "sql_yacc.yy" + { (yyval.item)=new Item_sum_variance((yyvsp[(3) - (4)].item), 0); } break; case 1001: -#line 5496 "sql_yacc.yy" - { yyval.item=new Item_sum_std(yyvsp[-1].item, 1); } +#line 5498 "sql_yacc.yy" + { (yyval.item)=new Item_sum_std((yyvsp[(3) - (4)].item), 1); } break; case 1002: -#line 5498 "sql_yacc.yy" - { yyval.item=new Item_sum_variance(yyvsp[-1].item, 1); } +#line 5500 "sql_yacc.yy" + { (yyval.item)=new Item_sum_variance((yyvsp[(3) - (4)].item), 1); } break; case 1003: -#line 5500 "sql_yacc.yy" - { yyval.item=new Item_sum_sum(yyvsp[-1].item); } +#line 5502 "sql_yacc.yy" + { (yyval.item)=new Item_sum_sum((yyvsp[(3) - (4)].item)); } break; case 1004: -#line 5502 "sql_yacc.yy" - { yyval.item=new Item_sum_sum_distinct(yyvsp[-1].item); } +#line 5504 "sql_yacc.yy" + { (yyval.item)=new Item_sum_sum_distinct((yyvsp[(4) - (5)].item)); } break; case 1005: -#line 5504 "sql_yacc.yy" +#line 5506 "sql_yacc.yy" { Select->in_sum_expr++; } break; case 1006: -#line 5508 "sql_yacc.yy" +#line 5510 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->in_sum_expr--; - yyval.item=new Item_func_group_concat(Lex->current_context(), yyvsp[-5].num, yyvsp[-3].item_list, - sel->gorder_list, yyvsp[-1].string); - yyvsp[-3].item_list->empty(); + (yyval.item)=new Item_func_group_concat(Lex->current_context(), (yyvsp[(3) - (8)].num), (yyvsp[(5) - (8)].item_list), + sel->gorder_list, (yyvsp[(7) - (8)].string)); + (yyvsp[(5) - (8)].item_list)->empty(); } break; case 1007: -#line 5518 "sql_yacc.yy" +#line 5520 "sql_yacc.yy" { if (! Lex->parsing_options.allows_variable) { @@ -21010,72 +21345,72 @@ break; case 1008: -#line 5526 "sql_yacc.yy" +#line 5528 "sql_yacc.yy" { - yyval.item= yyvsp[0].item; + (yyval.item)= (yyvsp[(3) - (3)].item); } break; case 1009: -#line 5533 "sql_yacc.yy" +#line 5535 "sql_yacc.yy" { - yyval.item= new Item_func_set_user_var(yyvsp[-2].lex_str, yyvsp[0].item); + (yyval.item)= new Item_func_set_user_var((yyvsp[(1) - (3)].lex_str), (yyvsp[(3) - (3)].item)); LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_RAND); } break; case 1010: -#line 5539 "sql_yacc.yy" +#line 5541 "sql_yacc.yy" { - yyval.item= new Item_func_get_user_var(yyvsp[0].lex_str); + (yyval.item)= new Item_func_get_user_var((yyvsp[(1) - (1)].lex_str)); LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_RAND); } break; case 1011: -#line 5545 "sql_yacc.yy" +#line 5547 "sql_yacc.yy" { - if (yyvsp[-1].lex_str.str && yyvsp[0].lex_str.str && check_reserved_words(&yyvsp[-1].lex_str)) + if ((yyvsp[(3) - (4)].lex_str).str && (yyvsp[(4) - (4)].lex_str).str && check_reserved_words(&(yyvsp[(3) - (4)].lex_str))) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } - if (!(yyval.item= get_system_var(YYTHD, yyvsp[-2].var_type, yyvsp[-1].lex_str, yyvsp[0].lex_str))) + if (!((yyval.item)= get_system_var(YYTHD, (yyvsp[(2) - (4)].var_type), (yyvsp[(3) - (4)].lex_str), (yyvsp[(4) - (4)].lex_str)))) MYSQL_YYABORT; } break; case 1012: -#line 5557 "sql_yacc.yy" - { yyval.num = 0; } +#line 5559 "sql_yacc.yy" + { (yyval.num) = 0; } break; case 1013: -#line 5558 "sql_yacc.yy" - { yyval.num = 1; } +#line 5560 "sql_yacc.yy" + { (yyval.num) = 1; } break; case 1014: -#line 5561 "sql_yacc.yy" - { yyval.string = new (YYTHD->mem_root) String(",",1,default_charset_info); } +#line 5563 "sql_yacc.yy" + { (yyval.string) = new (YYTHD->mem_root) String(",",1,default_charset_info); } break; case 1015: -#line 5562 "sql_yacc.yy" - { yyval.string = yyvsp[0].string; } +#line 5564 "sql_yacc.yy" + { (yyval.string) = (yyvsp[(2) - (2)].string); } break; case 1016: -#line 5567 "sql_yacc.yy" +#line 5569 "sql_yacc.yy" { Select->gorder_list = NULL; } break; case 1017: -#line 5571 "sql_yacc.yy" +#line 5573 "sql_yacc.yy" { SELECT_LEX *select= Select; select->gorder_list= @@ -21086,7 +21421,7 @@ break; case 1018: -#line 5582 "sql_yacc.yy" +#line 5584 "sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->inc_in_sum_expr()) @@ -21098,384 +21433,384 @@ break; case 1019: -#line 5591 "sql_yacc.yy" +#line 5593 "sql_yacc.yy" { Select->in_sum_expr--; - yyval.item= yyvsp[0].item; + (yyval.item)= (yyvsp[(3) - (3)].item); } break; case 1020: -#line 5597 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } +#line 5599 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } break; case 1021: -#line 5598 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_CHAR; Lex->dec= 0; } +#line 5600 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->dec= 0; } break; case 1022: -#line 5599 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; } +#line 5601 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; } break; case 1023: -#line 5600 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5602 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1024: -#line 5601 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5603 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1025: -#line 5602 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5604 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1026: -#line 5603 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5605 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1027: -#line 5604 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5606 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1028: -#line 5605 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5607 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1029: -#line 5606 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } +#line 5608 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1030: -#line 5607 "sql_yacc.yy" - { yyval.cast_type=ITEM_CAST_DECIMAL; Lex->charset= NULL; } +#line 5609 "sql_yacc.yy" + { (yyval.cast_type)=ITEM_CAST_DECIMAL; Lex->charset= NULL; } break; case 1031: -#line 5611 "sql_yacc.yy" - { yyval.item_list= NULL; } +#line 5613 "sql_yacc.yy" + { (yyval.item_list)= NULL; } break; case 1032: -#line 5612 "sql_yacc.yy" - { yyval.item_list= yyvsp[0].item_list;} +#line 5614 "sql_yacc.yy" + { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 1033: -#line 5616 "sql_yacc.yy" +#line 5618 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 1034: -#line 5618 "sql_yacc.yy" - { yyval.item_list= Select->expr_list.pop(); } +#line 5620 "sql_yacc.yy" + { (yyval.item_list)= Select->expr_list.pop(); } break; case 1035: -#line 5621 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 5623 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 1036: -#line 5622 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 5624 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 1037: -#line 5625 "sql_yacc.yy" - { yyval.item_list= yyvsp[0].item_list; } +#line 5627 "sql_yacc.yy" + { (yyval.item_list)= (yyvsp[(1) - (1)].item_list); } break; case 1038: -#line 5626 "sql_yacc.yy" - { yyval.item_list= yyvsp[-1].item_list; } +#line 5628 "sql_yacc.yy" + { (yyval.item_list)= (yyvsp[(2) - (3)].item_list); } break; case 1039: -#line 5629 "sql_yacc.yy" +#line 5631 "sql_yacc.yy" { Select->expr_list.push_front(new List); } break; case 1040: -#line 5631 "sql_yacc.yy" - { yyval.item_list= Select->expr_list.pop(); } +#line 5633 "sql_yacc.yy" + { (yyval.item_list)= Select->expr_list.pop(); } break; case 1041: -#line 5634 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 5636 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(1) - (1)].item)); } break; case 1042: -#line 5635 "sql_yacc.yy" - { Select->expr_list.head()->push_back(yyvsp[0].item); } +#line 5637 "sql_yacc.yy" + { Select->expr_list.head()->push_back((yyvsp[(3) - (3)].item)); } break; case 1043: -#line 5638 "sql_yacc.yy" - { yyval.item= NULL; } +#line 5640 "sql_yacc.yy" + { (yyval.item)= NULL; } break; case 1044: -#line 5639 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 5641 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1045: -#line 5642 "sql_yacc.yy" - { yyval.item= NULL; } +#line 5644 "sql_yacc.yy" + { (yyval.item)= NULL; } break; case 1046: -#line 5643 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 5645 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 1047: -#line 5647 "sql_yacc.yy" +#line 5649 "sql_yacc.yy" { - yyval.item_list= new List; - yyval.item_list->push_back(yyvsp[-2].item); - yyval.item_list->push_back(yyvsp[0].item); + (yyval.item_list)= new List; + (yyval.item_list)->push_back((yyvsp[(2) - (4)].item)); + (yyval.item_list)->push_back((yyvsp[(4) - (4)].item)); } break; case 1048: -#line 5653 "sql_yacc.yy" +#line 5655 "sql_yacc.yy" { - yyvsp[-4].item_list->push_back(yyvsp[-2].item); - yyvsp[-4].item_list->push_back(yyvsp[0].item); - yyval.item_list= yyvsp[-4].item_list; + (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(3) - (5)].item)); + (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(5) - (5)].item)); + (yyval.item_list)= (yyvsp[(1) - (5)].item_list); } break; case 1049: -#line 5662 "sql_yacc.yy" - { yyval.table_list=yyvsp[0].table_list; } +#line 5664 "sql_yacc.yy" + { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1050: -#line 5664 "sql_yacc.yy" +#line 5666 "sql_yacc.yy" { LEX *lex= Lex; - if (!(yyval.table_list= lex->current_select->nest_last_join(lex->thd))) + if (!((yyval.table_list)= lex->current_select->nest_last_join(lex->thd))) MYSQL_YYABORT; } break; case 1051: -#line 5672 "sql_yacc.yy" - { MYSQL_YYABORT_UNLESS(yyval.table_list=yyvsp[0].table_list); } +#line 5674 "sql_yacc.yy" + { MYSQL_YYABORT_UNLESS((yyval.table_list)=(yyvsp[(1) - (1)].table_list)); } break; case 1052: -#line 5677 "sql_yacc.yy" - { yyval.table_list=yyvsp[0].table_list; } +#line 5679 "sql_yacc.yy" + { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1053: -#line 5679 "sql_yacc.yy" +#line 5681 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-2].table_list && (yyval.table_list=yyvsp[0].table_list)); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1054: -#line 5699 "sql_yacc.yy" - { MYSQL_YYABORT_UNLESS(yyvsp[-2].table_list && (yyval.table_list=yyvsp[0].table_list)); } +#line 5701 "sql_yacc.yy" + { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1055: -#line 5701 "sql_yacc.yy" - { MYSQL_YYABORT_UNLESS(yyvsp[-2].table_list && (yyval.table_list=yyvsp[0].table_list)); yyvsp[0].table_list->straight=1; } +#line 5703 "sql_yacc.yy" + { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); (yyvsp[(3) - (3)].table_list)->straight=1; } break; case 1056: -#line 5704 "sql_yacc.yy" +#line 5706 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-3].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-3].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (4)].table_list), (yyvsp[(3) - (4)].table_list))) MYSQL_YYABORT; Select->parsing_place= IN_ON; } break; case 1057: -#line 5712 "sql_yacc.yy" +#line 5714 "sql_yacc.yy" { - add_join_on(yyvsp[-3].table_list,yyvsp[0].item); + add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); Lex->pop_context(); Select->parsing_place= NO_MATTER; } break; case 1058: -#line 5719 "sql_yacc.yy" +#line 5721 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-3].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-3].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (4)].table_list), (yyvsp[(3) - (4)].table_list))) MYSQL_YYABORT; Select->parsing_place= IN_ON; } break; case 1059: -#line 5727 "sql_yacc.yy" +#line 5729 "sql_yacc.yy" { - yyvsp[-3].table_list->straight=1; - add_join_on(yyvsp[-3].table_list,yyvsp[0].item); + (yyvsp[(3) - (6)].table_list)->straight=1; + add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); Lex->pop_context(); Select->parsing_place= NO_MATTER; } break; case 1060: -#line 5735 "sql_yacc.yy" +#line 5737 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-3].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); } break; case 1061: -#line 5739 "sql_yacc.yy" - { add_join_natural(yyvsp[-7].table_list,yyvsp[-5].table_list,yyvsp[-1].string_list,Select); yyval.table_list=yyvsp[-5].table_list; } +#line 5741 "sql_yacc.yy" + { add_join_natural((yyvsp[(1) - (8)].table_list),(yyvsp[(3) - (8)].table_list),(yyvsp[(7) - (8)].string_list),Select); (yyval.table_list)=(yyvsp[(3) - (8)].table_list); } break; case 1062: -#line 5741 "sql_yacc.yy" +#line 5743 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-3].table_list && (yyval.table_list=yyvsp[0].table_list)); - add_join_natural(yyvsp[-3].table_list,yyvsp[0].table_list,NULL,Select); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && ((yyval.table_list)=(yyvsp[(4) - (4)].table_list))); + add_join_natural((yyvsp[(1) - (4)].table_list),(yyvsp[(4) - (4)].table_list),NULL,Select); } break; case 1063: -#line 5749 "sql_yacc.yy" +#line 5751 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-5].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-5].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (6)].table_list), (yyvsp[(5) - (6)].table_list))) MYSQL_YYABORT; Select->parsing_place= IN_ON; } break; case 1064: -#line 5757 "sql_yacc.yy" +#line 5759 "sql_yacc.yy" { - add_join_on(yyvsp[-3].table_list,yyvsp[0].item); + add_join_on((yyvsp[(5) - (8)].table_list),(yyvsp[(8) - (8)].item)); Lex->pop_context(); - yyvsp[-3].table_list->outer_join|=JOIN_TYPE_LEFT; - yyval.table_list=yyvsp[-3].table_list; + (yyvsp[(5) - (8)].table_list)->outer_join|=JOIN_TYPE_LEFT; + (yyval.table_list)=(yyvsp[(5) - (8)].table_list); Select->parsing_place= NO_MATTER; } break; case 1065: -#line 5765 "sql_yacc.yy" +#line 5767 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-4].table_list && yyvsp[0].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } break; case 1066: -#line 5769 "sql_yacc.yy" +#line 5771 "sql_yacc.yy" { - add_join_natural(yyvsp[-9].table_list,yyvsp[-5].table_list,yyvsp[-1].string_list,Select); - yyvsp[-5].table_list->outer_join|=JOIN_TYPE_LEFT; - yyval.table_list=yyvsp[-5].table_list; + add_join_natural((yyvsp[(1) - (10)].table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select); + (yyvsp[(5) - (10)].table_list)->outer_join|=JOIN_TYPE_LEFT; + (yyval.table_list)=(yyvsp[(5) - (10)].table_list); } break; case 1067: -#line 5775 "sql_yacc.yy" +#line 5777 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-5].table_list && yyvsp[0].table_list); - add_join_natural(yyvsp[-5].table_list,yyvsp[0].table_list,NULL,Select); - yyvsp[0].table_list->outer_join|=JOIN_TYPE_LEFT; - yyval.table_list=yyvsp[0].table_list; + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); + add_join_natural((yyvsp[(1) - (6)].table_list),(yyvsp[(6) - (6)].table_list),NULL,Select); + (yyvsp[(6) - (6)].table_list)->outer_join|=JOIN_TYPE_LEFT; + (yyval.table_list)=(yyvsp[(6) - (6)].table_list); } break; case 1068: -#line 5785 "sql_yacc.yy" +#line 5787 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-5].table_list && yyvsp[-1].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-5].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (6)].table_list), (yyvsp[(5) - (6)].table_list))) MYSQL_YYABORT; Select->parsing_place= IN_ON; } break; case 1069: -#line 5793 "sql_yacc.yy" +#line 5795 "sql_yacc.yy" { LEX *lex= Lex; - if (!(yyval.table_list= lex->current_select->convert_right_join())) + if (!((yyval.table_list)= lex->current_select->convert_right_join())) MYSQL_YYABORT; - add_join_on(yyval.table_list, yyvsp[0].item); + add_join_on((yyval.table_list), (yyvsp[(8) - (8)].item)); Lex->pop_context(); Select->parsing_place= NO_MATTER; } break; case 1070: -#line 5802 "sql_yacc.yy" +#line 5804 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-4].table_list && yyvsp[0].table_list); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } break; case 1071: -#line 5806 "sql_yacc.yy" +#line 5808 "sql_yacc.yy" { LEX *lex= Lex; - if (!(yyval.table_list= lex->current_select->convert_right_join())) + if (!((yyval.table_list)= lex->current_select->convert_right_join())) MYSQL_YYABORT; - add_join_natural(yyval.table_list,yyvsp[-5].table_list,yyvsp[-1].string_list,Select); + add_join_natural((yyval.table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select); } break; case 1072: -#line 5813 "sql_yacc.yy" +#line 5815 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-5].table_list && yyvsp[0].table_list); - add_join_natural(yyvsp[0].table_list,yyvsp[-5].table_list,NULL,Select); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); + add_join_natural((yyvsp[(6) - (6)].table_list),(yyvsp[(1) - (6)].table_list),NULL,Select); LEX *lex= Lex; - if (!(yyval.table_list= lex->current_select->convert_right_join())) + if (!((yyval.table_list)= lex->current_select->convert_right_join())) MYSQL_YYABORT; } break; case 1073: -#line 5822 "sql_yacc.yy" +#line 5824 "sql_yacc.yy" {} break; case 1074: -#line 5823 "sql_yacc.yy" +#line 5825 "sql_yacc.yy" {} break; case 1075: -#line 5824 "sql_yacc.yy" +#line 5826 "sql_yacc.yy" {} break; case 1076: -#line 5829 "sql_yacc.yy" +#line 5831 "sql_yacc.yy" { SELECT_LEX *sel= Select; sel->use_index_ptr=sel->ignore_index_ptr=0; @@ -21484,50 +21819,50 @@ break; case 1077: -#line 5835 "sql_yacc.yy" +#line 5837 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; - if (!(yyval.table_list= sel->add_table_to_list(lex->thd, yyvsp[-2].table, yyvsp[-1].lex_str_ptr, + if (!((yyval.table_list)= sel->add_table_to_list(lex->thd, (yyvsp[(2) - (4)].table), (yyvsp[(3) - (4)].lex_str_ptr), sel->get_table_join_options(), lex->lock_option, sel->get_use_index(), sel->get_ignore_index()))) MYSQL_YYABORT; - sel->add_joined_table(yyval.table_list); + sel->add_joined_table((yyval.table_list)); } break; case 1078: -#line 5848 "sql_yacc.yy" +#line 5850 "sql_yacc.yy" { /* Change the current name resolution context to a local context. */ - if (push_new_name_resolution_context(YYTHD, yyvsp[-5].table_list, yyvsp[-1].table_list)) + if (push_new_name_resolution_context(YYTHD, (yyvsp[(3) - (8)].table_list), (yyvsp[(7) - (8)].table_list))) MYSQL_YYABORT; } break; case 1079: -#line 5855 "sql_yacc.yy" +#line 5857 "sql_yacc.yy" { LEX *lex= Lex; - MYSQL_YYABORT_UNLESS(yyvsp[-8].table_list && yyvsp[-4].table_list); - add_join_on(yyvsp[-4].table_list,yyvsp[-1].item); + MYSQL_YYABORT_UNLESS((yyvsp[(3) - (11)].table_list) && (yyvsp[(7) - (11)].table_list)); + add_join_on((yyvsp[(7) - (11)].table_list),(yyvsp[(10) - (11)].item)); Lex->pop_context(); - yyvsp[-4].table_list->outer_join|=JOIN_TYPE_LEFT; - yyval.table_list=yyvsp[-4].table_list; - if (!(yyval.table_list= lex->current_select->nest_last_join(lex->thd))) + (yyvsp[(7) - (11)].table_list)->outer_join|=JOIN_TYPE_LEFT; + (yyval.table_list)=(yyvsp[(7) - (11)].table_list); + if (!((yyval.table_list)= lex->current_select->nest_last_join(lex->thd))) MYSQL_YYABORT; } break; case 1080: -#line 5866 "sql_yacc.yy" +#line 5868 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; - if (yyvsp[-2].num) + if ((yyvsp[(1) - (3)].num)) { if (sel->set_braces(1)) { @@ -21539,31 +21874,31 @@ sel->master_unit()->global_parameters= sel->master_unit()->fake_select_lex; } - if (yyvsp[-1].select_lex->init_nested_join(lex->thd)) + if ((yyvsp[(2) - (3)].select_lex)->init_nested_join(lex->thd)) MYSQL_YYABORT; - yyval.table_list= 0; + (yyval.table_list)= 0; /* incomplete derived tables return NULL, we must be nested in select_derived rule to be here. */ } break; case 1081: -#line 5888 "sql_yacc.yy" +#line 5890 "sql_yacc.yy" { /* Use $2 instead of Lex->current_select as derived table will alter value of Lex->current_select. */ - if (!(yyvsp[-3].table_list || yyvsp[0].lex_str_ptr) && yyvsp[-4].select_lex->embedding && - !yyvsp[-4].select_lex->embedding->nested_join->join_list.elements) + if (!((yyvsp[(3) - (6)].table_list) || (yyvsp[(6) - (6)].lex_str_ptr)) && (yyvsp[(2) - (6)].select_lex)->embedding && + !(yyvsp[(2) - (6)].select_lex)->embedding->nested_join->join_list.elements) { /* we have a derived table ($3 == NULL) but no alias, Since we are nested in further parentheses so we can pass NULL to the outer level parentheses Permits parsing of "((((select ...))) as xyz)" */ - yyval.table_list= 0; + (yyval.table_list)= 0; } else - if (!yyvsp[-3].table_list) + if (!(yyvsp[(3) - (6)].table_list)) { /* Handle case of derived table, alias may be NULL if there are no outer parentheses, add_table_to_list() will throw @@ -21572,46 +21907,46 @@ SELECT_LEX *sel= lex->current_select; SELECT_LEX_UNIT *unit= sel->master_unit(); lex->current_select= sel= unit->outer_select(); - if (!(yyval.table_list= sel-> - add_table_to_list(lex->thd, new Table_ident(unit), yyvsp[0].lex_str_ptr, 0, + if (!((yyval.table_list)= sel-> + add_table_to_list(lex->thd, new Table_ident(unit), (yyvsp[(6) - (6)].lex_str_ptr), 0, TL_READ,(List *)0, (List *)0))) MYSQL_YYABORT; - sel->add_joined_table(yyval.table_list); + sel->add_joined_table((yyval.table_list)); lex->pop_context(); } else - if (yyvsp[-2].num || yyvsp[0].lex_str_ptr) + if ((yyvsp[(4) - (6)].num) || (yyvsp[(6) - (6)].lex_str_ptr)) { /* simple nested joins cannot have aliases or unions */ my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } else - yyval.table_list= yyvsp[-3].table_list; + (yyval.table_list)= (yyvsp[(3) - (6)].table_list); } break; case 1082: -#line 5935 "sql_yacc.yy" +#line 5937 "sql_yacc.yy" { LEX *lex= Lex; - if (yyvsp[0].select_lex->init_nested_join(lex->thd)) + if ((yyvsp[(1) - (1)].select_lex)->init_nested_join(lex->thd)) MYSQL_YYABORT; } break; case 1083: -#line 5941 "sql_yacc.yy" +#line 5943 "sql_yacc.yy" { LEX *lex= Lex; /* for normal joins, $3 != NULL and end_nested_join() != NULL, for derived tables, both must equal NULL */ - if (!(yyval.table_list= yyvsp[-2].select_lex->end_nested_join(lex->thd)) && yyvsp[0].table_list) + if (!((yyval.table_list)= (yyvsp[(1) - (3)].select_lex)->end_nested_join(lex->thd)) && (yyvsp[(3) - (3)].table_list)) MYSQL_YYABORT; - if (!yyvsp[0].table_list && yyval.table_list) + if (!(yyvsp[(3) - (3)].table_list) && (yyval.table_list)) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; @@ -21620,7 +21955,7 @@ break; case 1084: -#line 5957 "sql_yacc.yy" +#line 5959 "sql_yacc.yy" { LEX *lex= Lex; lex->derived_tables|= DERIVED_SUBQUERY; @@ -21641,19 +21976,19 @@ break; case 1085: -#line 5975 "sql_yacc.yy" +#line 5977 "sql_yacc.yy" { Select->parsing_place= NO_MATTER; } break; case 1087: -#line 5982 "sql_yacc.yy" - { yyval.select_lex= Select; } +#line 5984 "sql_yacc.yy" + { (yyval.select_lex)= Select; } break; case 1088: -#line 5987 "sql_yacc.yy" +#line 5989 "sql_yacc.yy" { LEX *lex= Lex; @@ -21672,333 +22007,333 @@ MYSQL_YYABORT; } embedding= Select->embedding; - yyval.num= embedding && + (yyval.num)= embedding && !embedding->nested_join->join_list.elements; /* return true if we are deeply nested */ } break; case 1089: -#line 6012 "sql_yacc.yy" +#line 6014 "sql_yacc.yy" {} break; case 1090: -#line 6013 "sql_yacc.yy" +#line 6015 "sql_yacc.yy" {} break; case 1093: -#line 6020 "sql_yacc.yy" +#line 6022 "sql_yacc.yy" {} break; case 1094: -#line 6022 "sql_yacc.yy" +#line 6024 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->use_index= *yyvsp[0].string_list; + sel->use_index= *(yyvsp[(2) - (2)].string_list); sel->use_index_ptr= &sel->use_index; } break; case 1095: -#line 6028 "sql_yacc.yy" +#line 6030 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->use_index= *yyvsp[0].string_list; + sel->use_index= *(yyvsp[(2) - (2)].string_list); sel->use_index_ptr= &sel->use_index; sel->table_join_options|= TL_OPTION_FORCE_INDEX; } break; case 1096: -#line 6035 "sql_yacc.yy" +#line 6037 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->ignore_index= *yyvsp[0].string_list; + sel->ignore_index= *(yyvsp[(2) - (2)].string_list); sel->ignore_index_ptr= &sel->ignore_index; } break; case 1097: -#line 6043 "sql_yacc.yy" +#line 6045 "sql_yacc.yy" { Select->interval_list.empty(); } break; case 1098: -#line 6045 "sql_yacc.yy" - { yyval.string_list= &Select->interval_list; } +#line 6047 "sql_yacc.yy" + { (yyval.string_list)= &Select->interval_list; } break; case 1099: -#line 6049 "sql_yacc.yy" +#line 6051 "sql_yacc.yy" {} break; case 1100: -#line 6050 "sql_yacc.yy" +#line 6052 "sql_yacc.yy" {} break; case 1101: -#line 6055 "sql_yacc.yy" +#line 6057 "sql_yacc.yy" { Select-> - interval_list.push_back(new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, + interval_list.push_back(new (YYTHD->mem_root) String((const char*) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, system_charset_info)); } break; case 1102: -#line 6059 "sql_yacc.yy" +#line 6061 "sql_yacc.yy" { Select-> - interval_list.push_back(new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, + interval_list.push_back(new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, system_charset_info)); } break; case 1103: -#line 6063 "sql_yacc.yy" +#line 6065 "sql_yacc.yy" { Select-> interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7, system_charset_info)); } break; case 1104: -#line 6069 "sql_yacc.yy" +#line 6071 "sql_yacc.yy" { - if (!(yyval.string_list= new List)) + if (!((yyval.string_list)= new List)) MYSQL_YYABORT; - yyval.string_list->push_back(new (YYTHD->mem_root) - String((const char *) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, + (yyval.string_list)->push_back(new (YYTHD->mem_root) + String((const char *) (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, system_charset_info)); } break; case 1105: -#line 6077 "sql_yacc.yy" +#line 6079 "sql_yacc.yy" { - yyvsp[-2].string_list->push_back(new (YYTHD->mem_root) - String((const char *) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, + (yyvsp[(1) - (3)].string_list)->push_back(new (YYTHD->mem_root) + String((const char *) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, system_charset_info)); - yyval.string_list= yyvsp[-2].string_list; + (yyval.string_list)= (yyvsp[(1) - (3)].string_list); } break; case 1106: -#line 6085 "sql_yacc.yy" +#line 6087 "sql_yacc.yy" {} break; case 1107: -#line 6086 "sql_yacc.yy" - { yyval.interval=INTERVAL_DAY_HOUR; } +#line 6088 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_DAY_HOUR; } break; case 1108: -#line 6087 "sql_yacc.yy" - { yyval.interval=INTERVAL_DAY_MICROSECOND; } +#line 6089 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_DAY_MICROSECOND; } break; case 1109: -#line 6088 "sql_yacc.yy" - { yyval.interval=INTERVAL_DAY_MINUTE; } +#line 6090 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_DAY_MINUTE; } break; case 1110: -#line 6089 "sql_yacc.yy" - { yyval.interval=INTERVAL_DAY_SECOND; } +#line 6091 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_DAY_SECOND; } break; case 1111: -#line 6090 "sql_yacc.yy" - { yyval.interval=INTERVAL_HOUR_MICROSECOND; } +#line 6092 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_HOUR_MICROSECOND; } break; case 1112: -#line 6091 "sql_yacc.yy" - { yyval.interval=INTERVAL_HOUR_MINUTE; } +#line 6093 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_HOUR_MINUTE; } break; case 1113: -#line 6092 "sql_yacc.yy" - { yyval.interval=INTERVAL_HOUR_SECOND; } +#line 6094 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_HOUR_SECOND; } break; case 1114: -#line 6093 "sql_yacc.yy" - { yyval.interval=INTERVAL_MICROSECOND; } +#line 6095 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_MICROSECOND; } break; case 1115: -#line 6094 "sql_yacc.yy" - { yyval.interval=INTERVAL_MINUTE_MICROSECOND; } +#line 6096 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_MINUTE_MICROSECOND; } break; case 1116: -#line 6095 "sql_yacc.yy" - { yyval.interval=INTERVAL_MINUTE_SECOND; } +#line 6097 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_MINUTE_SECOND; } break; case 1117: -#line 6096 "sql_yacc.yy" - { yyval.interval=INTERVAL_SECOND_MICROSECOND; } +#line 6098 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_SECOND_MICROSECOND; } break; case 1118: -#line 6097 "sql_yacc.yy" - { yyval.interval=INTERVAL_YEAR_MONTH; } +#line 6099 "sql_yacc.yy" + { (yyval.interval)=INTERVAL_YEAR_MONTH; } break; case 1119: -#line 6100 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_DAY; } +#line 6102 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_DAY; } break; case 1120: -#line 6101 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_WEEK; } +#line 6103 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_WEEK; } break; case 1121: -#line 6102 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_HOUR; } +#line 6104 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_HOUR; } break; case 1122: -#line 6103 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_MICROSECOND; } +#line 6105 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_MICROSECOND; } break; case 1123: -#line 6104 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_MINUTE; } +#line 6106 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_MINUTE; } break; case 1124: -#line 6105 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_MONTH; } +#line 6107 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_MONTH; } break; case 1125: -#line 6106 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_QUARTER; } +#line 6108 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_QUARTER; } break; case 1126: -#line 6107 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_SECOND; } +#line 6109 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_SECOND; } break; case 1127: -#line 6108 "sql_yacc.yy" - { yyval.interval_time_st=INTERVAL_YEAR; } +#line 6110 "sql_yacc.yy" + { (yyval.interval_time_st)=INTERVAL_YEAR; } break; case 1128: -#line 6112 "sql_yacc.yy" - {yyval.date_time_type=MYSQL_TIMESTAMP_DATE;} +#line 6114 "sql_yacc.yy" + {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATE;} break; case 1129: -#line 6113 "sql_yacc.yy" - {yyval.date_time_type=MYSQL_TIMESTAMP_TIME;} +#line 6115 "sql_yacc.yy" + {(yyval.date_time_type)=MYSQL_TIMESTAMP_TIME;} break; case 1130: -#line 6114 "sql_yacc.yy" - {yyval.date_time_type=MYSQL_TIMESTAMP_DATETIME;} +#line 6116 "sql_yacc.yy" + {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATETIME;} break; case 1131: -#line 6115 "sql_yacc.yy" - {yyval.date_time_type=MYSQL_TIMESTAMP_DATETIME;} +#line 6117 "sql_yacc.yy" + {(yyval.date_time_type)=MYSQL_TIMESTAMP_DATETIME;} break; case 1135: -#line 6124 "sql_yacc.yy" - { yyval.lex_str_ptr=0; } +#line 6126 "sql_yacc.yy" + { (yyval.lex_str_ptr)=0; } break; case 1136: -#line 6126 "sql_yacc.yy" - { yyval.lex_str_ptr= (LEX_STRING*) sql_memdup(&yyvsp[0].lex_str,sizeof(LEX_STRING)); } +#line 6128 "sql_yacc.yy" + { (yyval.lex_str_ptr)= (LEX_STRING*) sql_memdup(&(yyvsp[(2) - (2)].lex_str),sizeof(LEX_STRING)); } break; case 1139: -#line 6134 "sql_yacc.yy" +#line 6136 "sql_yacc.yy" { Select->where= 0; } break; case 1140: -#line 6136 "sql_yacc.yy" +#line 6138 "sql_yacc.yy" { Select->parsing_place= IN_WHERE; } break; case 1141: -#line 6140 "sql_yacc.yy" +#line 6142 "sql_yacc.yy" { SELECT_LEX *select= Select; - select->where= yyvsp[0].item; + select->where= (yyvsp[(3) - (3)].item); select->parsing_place= NO_MATTER; - if (yyvsp[0].item) - yyvsp[0].item->top_level_item(); + if ((yyvsp[(3) - (3)].item)) + (yyvsp[(3) - (3)].item)->top_level_item(); } break; case 1143: -#line 6152 "sql_yacc.yy" +#line 6154 "sql_yacc.yy" { Select->parsing_place= IN_HAVING; } break; case 1144: -#line 6156 "sql_yacc.yy" +#line 6158 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->having= yyvsp[0].item; + sel->having= (yyvsp[(3) - (3)].item); sel->parsing_place= NO_MATTER; - if (yyvsp[0].item) - yyvsp[0].item->top_level_item(); + if ((yyvsp[(3) - (3)].item)) + (yyvsp[(3) - (3)].item)->top_level_item(); } break; case 1145: -#line 6167 "sql_yacc.yy" +#line 6169 "sql_yacc.yy" { Lex->escape_used= TRUE; - yyval.item= yyvsp[0].item; + (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 1146: -#line 6172 "sql_yacc.yy" +#line 6174 "sql_yacc.yy" { Lex->escape_used= FALSE; - yyval.item= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? + (yyval.item)= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? new Item_string("", 0, &my_charset_latin1) : new Item_string("\\", 1, &my_charset_latin1)); } break; case 1149: -#line 6191 "sql_yacc.yy" - { if (add_group_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) MYSQL_YYABORT; } +#line 6193 "sql_yacc.yy" + { if (add_group_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1150: -#line 6193 "sql_yacc.yy" - { if (add_group_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) MYSQL_YYABORT; } +#line 6195 "sql_yacc.yy" + { if (add_group_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1151: -#line 6196 "sql_yacc.yy" +#line 6198 "sql_yacc.yy" {} break; case 1152: -#line 6198 "sql_yacc.yy" +#line 6200 "sql_yacc.yy" { LEX *lex=Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) @@ -22014,7 +22349,7 @@ break; case 1153: -#line 6211 "sql_yacc.yy" +#line 6213 "sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) @@ -22028,17 +22363,17 @@ break; case 1157: -#line 6238 "sql_yacc.yy" +#line 6240 "sql_yacc.yy" { THD *thd= YYTHD; - bool ascending= (yyvsp[0].num == 1) ? true : false; - if (add_order_to_list(thd, yyvsp[-1].item, ascending)) + bool ascending= ((yyvsp[(2) - (2)].num) == 1) ? true : false; + if (add_order_to_list(thd, (yyvsp[(1) - (2)].item), ascending)) MYSQL_YYABORT; } break; case 1160: -#line 6256 "sql_yacc.yy" +#line 6258 "sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= lex->current_select; @@ -22071,32 +22406,32 @@ break; case 1162: -#line 6288 "sql_yacc.yy" - { if (add_order_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) MYSQL_YYABORT; } +#line 6290 "sql_yacc.yy" + { if (add_order_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1163: -#line 6290 "sql_yacc.yy" - { if (add_order_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) MYSQL_YYABORT; } +#line 6292 "sql_yacc.yy" + { if (add_order_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1164: -#line 6293 "sql_yacc.yy" - { yyval.num = 1; } +#line 6295 "sql_yacc.yy" + { (yyval.num) = 1; } break; case 1165: -#line 6294 "sql_yacc.yy" - { yyval.num =1; } +#line 6296 "sql_yacc.yy" + { (yyval.num) =1; } break; case 1166: -#line 6295 "sql_yacc.yy" - { yyval.num =0; } +#line 6297 "sql_yacc.yy" + { (yyval.num) =0; } break; case 1167: -#line 6300 "sql_yacc.yy" +#line 6302 "sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -22106,79 +22441,79 @@ break; case 1168: -#line 6306 "sql_yacc.yy" +#line 6308 "sql_yacc.yy" {} break; case 1169: -#line 6310 "sql_yacc.yy" +#line 6312 "sql_yacc.yy" {} break; case 1170: -#line 6311 "sql_yacc.yy" +#line 6313 "sql_yacc.yy" {} break; case 1171: -#line 6315 "sql_yacc.yy" +#line 6317 "sql_yacc.yy" {} break; case 1172: -#line 6320 "sql_yacc.yy" +#line 6322 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->select_limit= yyvsp[0].item; + sel->select_limit= (yyvsp[(1) - (1)].item); sel->offset_limit= 0; sel->explicit_limit= 1; } break; case 1173: -#line 6327 "sql_yacc.yy" +#line 6329 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->select_limit= yyvsp[0].item; - sel->offset_limit= yyvsp[-2].item; + sel->select_limit= (yyvsp[(3) - (3)].item); + sel->offset_limit= (yyvsp[(1) - (3)].item); sel->explicit_limit= 1; } break; case 1174: -#line 6334 "sql_yacc.yy" +#line 6336 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->select_limit= yyvsp[-2].item; - sel->offset_limit= yyvsp[0].item; + sel->select_limit= (yyvsp[(1) - (3)].item); + sel->offset_limit= (yyvsp[(3) - (3)].item); sel->explicit_limit= 1; } break; case 1175: -#line 6343 "sql_yacc.yy" +#line 6345 "sql_yacc.yy" { - ((Item_param *) yyvsp[0].item)->set_strict_type(INT_RESULT); + ((Item_param *) (yyvsp[(1) - (1)].item))->set_strict_type(INT_RESULT); } break; case 1176: -#line 6346 "sql_yacc.yy" - { yyval.item= new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 6348 "sql_yacc.yy" + { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1177: -#line 6347 "sql_yacc.yy" - { yyval.item= new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 6349 "sql_yacc.yy" + { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1178: -#line 6348 "sql_yacc.yy" - { yyval.item= new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 6350 "sql_yacc.yy" + { (yyval.item)= new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1179: -#line 6353 "sql_yacc.yy" +#line 6355 "sql_yacc.yy" { LEX *lex=Lex; lex->current_select->select_limit= 0; @@ -22186,71 +22521,71 @@ break; case 1180: -#line 6358 "sql_yacc.yy" +#line 6360 "sql_yacc.yy" { SELECT_LEX *sel= Select; - sel->select_limit= yyvsp[0].item; + sel->select_limit= (yyvsp[(2) - (2)].item); sel->explicit_limit= 1; } break; case 1181: -#line 6365 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6367 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1182: -#line 6366 "sql_yacc.yy" - { yyval.ulong_num= (ulong) strtol(yyvsp[0].lex_str.str, (char**) 0, 16); } +#line 6368 "sql_yacc.yy" + { (yyval.ulong_num)= (ulong) strtol((yyvsp[(1) - (1)].lex_str).str, (char**) 0, 16); } break; case 1183: -#line 6367 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6369 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1184: -#line 6368 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6370 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1185: -#line 6369 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6371 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1186: -#line 6370 "sql_yacc.yy" - { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6372 "sql_yacc.yy" + { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1187: -#line 6374 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6376 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1188: -#line 6375 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6377 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1189: -#line 6376 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6378 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1190: -#line 6377 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6379 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1191: -#line 6378 "sql_yacc.yy" - { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); } +#line 6380 "sql_yacc.yy" + { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1193: -#line 6384 "sql_yacc.yy" +#line 6386 "sql_yacc.yy" { LEX *lex=Lex; @@ -22271,38 +22606,38 @@ if (add_proc_to_list(lex->thd, new Item_field(&lex-> current_select-> context, - NULL,NULL,yyvsp[0].lex_str.str))) + NULL,NULL,(yyvsp[(2) - (2)].lex_str).str))) MYSQL_YYABORT; Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } break; case 1195: -#line 6412 "sql_yacc.yy" +#line 6414 "sql_yacc.yy" {} break; case 1196: -#line 6413 "sql_yacc.yy" +#line 6415 "sql_yacc.yy" {} break; case 1199: -#line 6421 "sql_yacc.yy" +#line 6423 "sql_yacc.yy" { THD *thd= YYTHD; Lex_input_stream *lip= thd->m_lip; - if (add_proc_to_list(thd, yyvsp[0].item)) + if (add_proc_to_list(thd, (yyvsp[(2) - (2)].item))) MYSQL_YYABORT; - if (!yyvsp[0].item->name) - yyvsp[0].item->set_name(yyvsp[-1].simple_string,(uint) ((char*) lip->tok_end - yyvsp[-1].simple_string), + if (!(yyvsp[(2) - (2)].item)->name) + (yyvsp[(2) - (2)].item)->set_name((yyvsp[(1) - (2)].simple_string),(uint) ((char*) lip->tok_end - (yyvsp[(1) - (2)].simple_string)), thd->charset()); } break; case 1200: -#line 6435 "sql_yacc.yy" +#line 6437 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe && (!(lex->result= new select_dumpvar()))) @@ -22311,21 +22646,21 @@ break; case 1201: -#line 6441 "sql_yacc.yy" +#line 6443 "sql_yacc.yy" {} break; case 1203: -#line 6446 "sql_yacc.yy" +#line 6448 "sql_yacc.yy" {} break; case 1204: -#line 6451 "sql_yacc.yy" +#line 6453 "sql_yacc.yy" { LEX *lex=Lex; if (lex->result) - ((select_dumpvar *)lex->result)->var_list.push_back( new my_var(yyvsp[0].lex_str,0,0,(enum_field_types)0)); + ((select_dumpvar *)lex->result)->var_list.push_back( new my_var((yyvsp[(2) - (2)].lex_str),0,0,(enum_field_types)0)); else /* The parser won't create select_result instance only @@ -22336,21 +22671,21 @@ break; case 1205: -#line 6463 "sql_yacc.yy" +#line 6465 "sql_yacc.yy" { LEX *lex=Lex; sp_variable_t *t; - if (!lex->spcont || !(t=lex->spcont->find_variable(&yyvsp[0].lex_str))) + if (!lex->spcont || !(t=lex->spcont->find_variable(&(yyvsp[(1) - (1)].lex_str)))) { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), yyvsp[0].lex_str.str); + my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str); MYSQL_YYABORT; } if (lex->result) { my_var *var; ((select_dumpvar *)lex->result)-> - var_list.push_back(var= new my_var(yyvsp[0].lex_str,1,t->offset,t->type)); + var_list.push_back(var= new my_var((yyvsp[(1) - (1)].lex_str),1,t->offset,t->type)); #ifndef DBUG_OFF if (var) var->sp= lex->sphead; @@ -22368,7 +22703,7 @@ break; case 1206: -#line 6495 "sql_yacc.yy" +#line 6497 "sql_yacc.yy" { if (! Lex->parsing_options.allows_select_into) { @@ -22379,24 +22714,24 @@ break; case 1208: -#line 6507 "sql_yacc.yy" +#line 6509 "sql_yacc.yy" { LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_SIDEEFFECT); - if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str, 0)) || + if (!(lex->exchange= new sql_exchange((yyvsp[(2) - (2)].lex_str).str, 0)) || !(lex->result= new select_export(lex->exchange))) MYSQL_YYABORT; } break; case 1210: -#line 6516 "sql_yacc.yy" +#line 6518 "sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe) { lex->uncacheable(UNCACHEABLE_SIDEEFFECT); - if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str,1))) + if (!(lex->exchange= new sql_exchange((yyvsp[(2) - (2)].lex_str).str,1))) MYSQL_YYABORT; if (!(lex->result= new select_dump(lex->exchange))) MYSQL_YYABORT; @@ -22405,14 +22740,14 @@ break; case 1211: -#line 6528 "sql_yacc.yy" +#line 6530 "sql_yacc.yy" { Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } break; case 1212: -#line 6538 "sql_yacc.yy" +#line 6540 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DO; @@ -22421,54 +22756,54 @@ break; case 1213: -#line 6544 "sql_yacc.yy" +#line 6546 "sql_yacc.yy" { - Lex->insert_list= yyvsp[0].item_list; + Lex->insert_list= (yyvsp[(3) - (3)].item_list); } break; case 1214: -#line 6555 "sql_yacc.yy" +#line 6557 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DROP_TABLE; - lex->drop_temporary= yyvsp[-4].num; - lex->drop_if_exists= yyvsp[-2].num; + lex->drop_temporary= (yyvsp[(2) - (6)].num); + lex->drop_if_exists= (yyvsp[(4) - (6)].num); } break; case 1215: -#line 6561 "sql_yacc.yy" +#line 6563 "sql_yacc.yy" {} break; case 1216: -#line 6562 "sql_yacc.yy" +#line 6564 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_INDEX; lex->alter_info.reset(); lex->alter_info.flags= ALTER_DROP_INDEX; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - yyvsp[-3].lex_str.str)); - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, NULL, + (yyvsp[(3) - (6)].lex_str).str)); + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(5) - (6)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; } break; case 1217: -#line 6574 "sql_yacc.yy" +#line 6576 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_DB; - lex->drop_if_exists=yyvsp[-1].num; - lex->name=yyvsp[0].lex_str.str; + lex->drop_if_exists=(yyvsp[(3) - (4)].num); + lex->name=(yyvsp[(4) - (4)].lex_str).str; } break; case 1218: -#line 6581 "sql_yacc.yy" +#line 6583 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -22477,13 +22812,13 @@ MYSQL_YYABORT; } lex->sql_command = SQLCOM_DROP_FUNCTION; - lex->drop_if_exists= yyvsp[-1].num; - lex->spname= yyvsp[0].spname; + lex->drop_if_exists= (yyvsp[(3) - (4)].num); + lex->spname= (yyvsp[(4) - (4)].spname); } break; case 1219: -#line 6593 "sql_yacc.yy" +#line 6595 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -22492,67 +22827,67 @@ MYSQL_YYABORT; } lex->sql_command = SQLCOM_DROP_PROCEDURE; - lex->drop_if_exists= yyvsp[-1].num; - lex->spname= yyvsp[0].spname; + lex->drop_if_exists= (yyvsp[(3) - (4)].num); + lex->spname= (yyvsp[(4) - (4)].spname); } break; case 1220: -#line 6605 "sql_yacc.yy" +#line 6607 "sql_yacc.yy" { Lex->sql_command = SQLCOM_DROP_USER; } break; case 1221: -#line 6609 "sql_yacc.yy" +#line 6611 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_VIEW; - lex->drop_if_exists= yyvsp[-2].num; + lex->drop_if_exists= (yyvsp[(3) - (5)].num); } break; case 1222: -#line 6615 "sql_yacc.yy" +#line 6617 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_TRIGGER; - lex->drop_if_exists= yyvsp[-1].num; - lex->spname= yyvsp[0].spname; + lex->drop_if_exists= (yyvsp[(3) - (4)].num); + lex->spname= (yyvsp[(4) - (4)].spname); } break; case 1225: -#line 6629 "sql_yacc.yy" +#line 6631 "sql_yacc.yy" { - if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL, TL_OPTION_UPDATING)) + if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; } break; case 1226: -#line 6636 "sql_yacc.yy" - { yyval.num= 0; } +#line 6638 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 1227: -#line 6637 "sql_yacc.yy" - { yyval.num= 1; } +#line 6639 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 1228: -#line 6641 "sql_yacc.yy" - { yyval.num= 0; } +#line 6643 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 1229: -#line 6642 "sql_yacc.yy" - { yyval.num= 1; } +#line 6644 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 1230: -#line 6650 "sql_yacc.yy" +#line 6652 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_INSERT; @@ -22564,20 +22899,20 @@ break; case 1231: -#line 6659 "sql_yacc.yy" +#line 6661 "sql_yacc.yy" { - Select->set_lock_for_tables(yyvsp[-2].lock_type); + Select->set_lock_for_tables((yyvsp[(3) - (5)].lock_type)); Lex->current_select= &Lex->select_lex; } break; case 1232: -#line 6664 "sql_yacc.yy" +#line 6666 "sql_yacc.yy" {} break; case 1233: -#line 6669 "sql_yacc.yy" +#line 6671 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPLACE; @@ -22587,20 +22922,20 @@ break; case 1234: -#line 6676 "sql_yacc.yy" +#line 6678 "sql_yacc.yy" { - Select->set_lock_for_tables(yyvsp[-1].lock_type); + Select->set_lock_for_tables((yyvsp[(3) - (4)].lock_type)); Lex->current_select= &Lex->select_lex; } break; case 1235: -#line 6681 "sql_yacc.yy" +#line 6683 "sql_yacc.yy" {} break; case 1236: -#line 6686 "sql_yacc.yy" +#line 6688 "sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* @@ -22608,50 +22943,50 @@ insert visible only after the table unlocking but everyone can read table. */ - yyval.lock_type= (Lex->sphead ? TL_WRITE_DEFAULT : TL_WRITE_CONCURRENT_INSERT); + (yyval.lock_type)= (Lex->sphead ? TL_WRITE_DEFAULT : TL_WRITE_CONCURRENT_INSERT); #else - yyval.lock_type= TL_WRITE_CONCURRENT_INSERT; + (yyval.lock_type)= TL_WRITE_CONCURRENT_INSERT; #endif } break; case 1237: -#line 6698 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_LOW_PRIORITY; } +#line 6700 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1238: -#line 6699 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_DELAYED; } +#line 6701 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_DELAYED; } break; case 1239: -#line 6700 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE; } +#line 6702 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE; } break; case 1240: -#line 6704 "sql_yacc.yy" - { yyval.lock_type= yyvsp[0].lock_type; } +#line 6706 "sql_yacc.yy" + { (yyval.lock_type)= (yyvsp[(1) - (1)].lock_type); } break; case 1241: -#line 6705 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_DELAYED; } +#line 6707 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_DELAYED; } break; case 1242: -#line 6708 "sql_yacc.yy" +#line 6710 "sql_yacc.yy" {} break; case 1243: -#line 6709 "sql_yacc.yy" +#line 6711 "sql_yacc.yy" {} break; case 1244: -#line 6713 "sql_yacc.yy" +#line 6715 "sql_yacc.yy" { LEX *lex=Lex; lex->field_list.empty(); @@ -22661,22 +22996,22 @@ break; case 1245: -#line 6721 "sql_yacc.yy" +#line 6723 "sql_yacc.yy" {} break; case 1246: -#line 6722 "sql_yacc.yy" +#line 6724 "sql_yacc.yy" {} break; case 1247: -#line 6723 "sql_yacc.yy" +#line 6725 "sql_yacc.yy" {} break; case 1248: -#line 6725 "sql_yacc.yy" +#line 6727 "sql_yacc.yy" { LEX *lex=Lex; if (!(lex->insert_list = new List_item) || @@ -22686,77 +23021,77 @@ break; case 1250: -#line 6734 "sql_yacc.yy" - { Lex->field_list.push_back(yyvsp[0].item); } +#line 6736 "sql_yacc.yy" + { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1251: -#line 6735 "sql_yacc.yy" - { Lex->field_list.push_back(yyvsp[0].item); } +#line 6737 "sql_yacc.yy" + { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1252: -#line 6738 "sql_yacc.yy" +#line 6740 "sql_yacc.yy" {} break; case 1253: -#line 6739 "sql_yacc.yy" +#line 6741 "sql_yacc.yy" {} break; case 1254: -#line 6740 "sql_yacc.yy" +#line 6742 "sql_yacc.yy" { Select->set_braces(0);} break; case 1255: -#line 6740 "sql_yacc.yy" +#line 6742 "sql_yacc.yy" {} break; case 1256: -#line 6741 "sql_yacc.yy" +#line 6743 "sql_yacc.yy" { Select->set_braces(1);} break; case 1257: -#line 6741 "sql_yacc.yy" +#line 6743 "sql_yacc.yy" {} break; case 1262: -#line 6755 "sql_yacc.yy" +#line 6757 "sql_yacc.yy" { LEX *lex=Lex; - if (lex->field_list.push_back(yyvsp[-2].item) || - lex->insert_list->push_back(yyvsp[0].item)) + if (lex->field_list.push_back((yyvsp[(1) - (3)].item)) || + lex->insert_list->push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; } break; case 1263: -#line 6762 "sql_yacc.yy" +#line 6764 "sql_yacc.yy" {} break; case 1264: -#line 6763 "sql_yacc.yy" +#line 6765 "sql_yacc.yy" {} break; case 1265: -#line 6767 "sql_yacc.yy" +#line 6769 "sql_yacc.yy" {} break; case 1266: -#line 6768 "sql_yacc.yy" +#line 6770 "sql_yacc.yy" {} break; case 1267: -#line 6773 "sql_yacc.yy" +#line 6775 "sql_yacc.yy" { if (!(Lex->insert_list = new List_item)) MYSQL_YYABORT; @@ -22764,7 +23099,7 @@ break; case 1268: -#line 6778 "sql_yacc.yy" +#line 6780 "sql_yacc.yy" { LEX *lex=Lex; if (lex->many_values.push_back(lex->insert_list)) @@ -22773,43 +23108,43 @@ break; case 1269: -#line 6785 "sql_yacc.yy" +#line 6787 "sql_yacc.yy" {} break; case 1271: -#line 6790 "sql_yacc.yy" +#line 6792 "sql_yacc.yy" { - if (Lex->insert_list->push_back(yyvsp[0].item)) + if (Lex->insert_list->push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; } break; case 1272: -#line 6795 "sql_yacc.yy" +#line 6797 "sql_yacc.yy" { - if (Lex->insert_list->push_back(yyvsp[0].item)) + if (Lex->insert_list->push_back((yyvsp[(1) - (1)].item))) MYSQL_YYABORT; } break; case 1273: -#line 6802 "sql_yacc.yy" - { yyval.item= yyvsp[0].item;} +#line 6804 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1274: -#line 6803 "sql_yacc.yy" - {yyval.item= new Item_default_value(Lex->current_context()); } +#line 6805 "sql_yacc.yy" + {(yyval.item)= new Item_default_value(Lex->current_context()); } break; case 1276: -#line 6808 "sql_yacc.yy" +#line 6810 "sql_yacc.yy" { Lex->duplicates= DUP_UPDATE; } break; case 1278: -#line 6816 "sql_yacc.yy" +#line 6818 "sql_yacc.yy" { LEX *lex= Lex; mysql_init_select(lex); @@ -22820,7 +23155,7 @@ break; case 1279: -#line 6825 "sql_yacc.yy" +#line 6827 "sql_yacc.yy" { LEX *lex= Lex; if (lex->select_lex.table_list.elements > 1) @@ -22837,45 +23172,45 @@ be too pessimistic. We will decrease lock level if possible in mysql_multi_update(). */ - Select->set_lock_for_tables(yyvsp[-4].lock_type); + Select->set_lock_for_tables((yyvsp[(3) - (7)].lock_type)); } break; case 1280: -#line 6843 "sql_yacc.yy" +#line 6845 "sql_yacc.yy" {} break; case 1283: -#line 6852 "sql_yacc.yy" +#line 6854 "sql_yacc.yy" { - if (add_item_to_list(YYTHD, yyvsp[-2].item) || add_value_to_list(YYTHD, yyvsp[0].item)) + if (add_item_to_list(YYTHD, (yyvsp[(1) - (3)].item)) || add_value_to_list(YYTHD, (yyvsp[(3) - (3)].item))) MYSQL_YYABORT; } break; case 1286: -#line 6863 "sql_yacc.yy" +#line 6865 "sql_yacc.yy" { LEX *lex= Lex; - if (lex->update_list.push_back(yyvsp[-2].item) || - lex->value_list.push_back(yyvsp[0].item)) + if (lex->update_list.push_back((yyvsp[(1) - (3)].item)) || + lex->value_list.push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; } break; case 1287: -#line 6871 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_DEFAULT; } +#line 6873 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1288: -#line 6872 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_LOW_PRIORITY; } +#line 6874 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1289: -#line 6878 "sql_yacc.yy" +#line 6880 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; @@ -22887,31 +23222,31 @@ break; case 1290: -#line 6886 "sql_yacc.yy" +#line 6888 "sql_yacc.yy" {} break; case 1291: -#line 6891 "sql_yacc.yy" +#line 6893 "sql_yacc.yy" { - if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL, TL_OPTION_UPDATING, + if (!Select->add_table_to_list(YYTHD, (yyvsp[(2) - (2)].table), NULL, TL_OPTION_UPDATING, Lex->lock_option)) MYSQL_YYABORT; } break; case 1292: -#line 6897 "sql_yacc.yy" +#line 6899 "sql_yacc.yy" {} break; case 1293: -#line 6899 "sql_yacc.yy" +#line 6901 "sql_yacc.yy" { mysql_init_multi_delete(Lex); } break; case 1294: -#line 6901 "sql_yacc.yy" +#line 6903 "sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -22919,12 +23254,12 @@ break; case 1295: -#line 6906 "sql_yacc.yy" +#line 6908 "sql_yacc.yy" { mysql_init_multi_delete(Lex); } break; case 1296: -#line 6908 "sql_yacc.yy" +#line 6910 "sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -22932,19 +23267,19 @@ break; case 1297: -#line 6915 "sql_yacc.yy" +#line 6917 "sql_yacc.yy" {} break; case 1298: -#line 6916 "sql_yacc.yy" +#line 6918 "sql_yacc.yy" {} break; case 1299: -#line 6920 "sql_yacc.yy" +#line 6922 "sql_yacc.yy" { - if (!Select->add_table_to_list(YYTHD, new Table_ident(yyvsp[-2].lex_str), yyvsp[0].lex_str_ptr, + if (!Select->add_table_to_list(YYTHD, new Table_ident((yyvsp[(1) - (3)].lex_str)), (yyvsp[(3) - (3)].lex_str_ptr), TL_OPTION_UPDATING | TL_OPTION_ALIAS, Lex->lock_option)) MYSQL_YYABORT; @@ -22952,11 +23287,11 @@ break; case 1300: -#line 6927 "sql_yacc.yy" +#line 6929 "sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, - new Table_ident(YYTHD, yyvsp[-4].lex_str, yyvsp[-2].lex_str, 0), - yyvsp[0].lex_str_ptr, + new Table_ident(YYTHD, (yyvsp[(1) - (5)].lex_str), (yyvsp[(3) - (5)].lex_str), 0), + (yyvsp[(5) - (5)].lex_str_ptr), TL_OPTION_UPDATING | TL_OPTION_ALIAS, Lex->lock_option)) @@ -22965,42 +23300,42 @@ break; case 1301: -#line 6939 "sql_yacc.yy" +#line 6941 "sql_yacc.yy" {} break; case 1302: -#line 6940 "sql_yacc.yy" +#line 6942 "sql_yacc.yy" {} break; case 1303: -#line 6944 "sql_yacc.yy" +#line 6946 "sql_yacc.yy" {} break; case 1304: -#line 6945 "sql_yacc.yy" +#line 6947 "sql_yacc.yy" {} break; case 1305: -#line 6948 "sql_yacc.yy" +#line 6950 "sql_yacc.yy" { Select->options|= OPTION_QUICK; } break; case 1306: -#line 6949 "sql_yacc.yy" +#line 6951 "sql_yacc.yy" { Lex->lock_option= TL_WRITE_LOW_PRIORITY; } break; case 1307: -#line 6950 "sql_yacc.yy" +#line 6952 "sql_yacc.yy" { Lex->ignore= 1; } break; case 1308: -#line 6954 "sql_yacc.yy" +#line 6956 "sql_yacc.yy" { LEX* lex= Lex; lex->sql_command= SQLCOM_TRUNCATE; @@ -23011,84 +23346,84 @@ break; case 1315: -#line 6977 "sql_yacc.yy" +#line 6979 "sql_yacc.yy" { Lex->profile_options|= PROFILE_CPU; } break; case 1316: -#line 6981 "sql_yacc.yy" +#line 6983 "sql_yacc.yy" { Lex->profile_options|= PROFILE_MEMORY; } break; case 1317: -#line 6985 "sql_yacc.yy" +#line 6987 "sql_yacc.yy" { Lex->profile_options|= PROFILE_BLOCK_IO; } break; case 1318: -#line 6989 "sql_yacc.yy" +#line 6991 "sql_yacc.yy" { Lex->profile_options|= PROFILE_CONTEXT; } break; case 1319: -#line 6993 "sql_yacc.yy" +#line 6995 "sql_yacc.yy" { Lex->profile_options|= PROFILE_PAGE_FAULTS; } break; case 1320: -#line 6997 "sql_yacc.yy" +#line 6999 "sql_yacc.yy" { Lex->profile_options|= PROFILE_IPC; } break; case 1321: -#line 7001 "sql_yacc.yy" +#line 7003 "sql_yacc.yy" { Lex->profile_options|= PROFILE_SWAPS; } break; case 1322: -#line 7005 "sql_yacc.yy" +#line 7007 "sql_yacc.yy" { Lex->profile_options|= PROFILE_SOURCE; } break; case 1323: -#line 7009 "sql_yacc.yy" +#line 7011 "sql_yacc.yy" { Lex->profile_options|= PROFILE_ALL; } break; case 1324: -#line 7016 "sql_yacc.yy" +#line 7018 "sql_yacc.yy" { Lex->profile_query_id= 0; } break; case 1325: -#line 7020 "sql_yacc.yy" +#line 7022 "sql_yacc.yy" { - Lex->profile_query_id= atoi(yyvsp[0].lex_str.str); + Lex->profile_query_id= atoi((yyvsp[(3) - (3)].lex_str).str); } break; case 1326: -#line 7028 "sql_yacc.yy" +#line 7030 "sql_yacc.yy" { LEX *lex=Lex; lex->wild=0; @@ -23100,12 +23435,12 @@ break; case 1327: -#line 7037 "sql_yacc.yy" +#line 7039 "sql_yacc.yy" {} break; case 1328: -#line 7042 "sql_yacc.yy" +#line 7044 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23116,97 +23451,97 @@ break; case 1329: -#line 7050 "sql_yacc.yy" +#line 7052 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_TABLES; - lex->select_lex.db= yyvsp[-1].simple_string; + lex->select_lex.db= (yyvsp[(3) - (4)].simple_string); if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_NAMES)) MYSQL_YYABORT; } break; case 1330: -#line 7059 "sql_yacc.yy" +#line 7061 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_TRIGGERS; - lex->select_lex.db= yyvsp[-1].simple_string; + lex->select_lex.db= (yyvsp[(3) - (4)].simple_string); if (prepare_schema_table(YYTHD, lex, 0, SCH_TRIGGERS)) MYSQL_YYABORT; } break; case 1331: -#line 7068 "sql_yacc.yy" +#line 7070 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_TABLE_STATUS; - lex->select_lex.db= yyvsp[-1].simple_string; + lex->select_lex.db= (yyvsp[(3) - (4)].simple_string); if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLES)) MYSQL_YYABORT; } break; case 1332: -#line 7077 "sql_yacc.yy" +#line 7079 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_OPEN_TABLES; - lex->select_lex.db= yyvsp[-1].simple_string; + lex->select_lex.db= (yyvsp[(3) - (4)].simple_string); if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES)) MYSQL_YYABORT; } break; case 1333: -#line 7086 "sql_yacc.yy" - { Lex->create_info.db_type= yyvsp[0].db_type; } +#line 7088 "sql_yacc.yy" + { Lex->create_info.db_type= (yyvsp[(2) - (2)].db_type); } break; case 1335: -#line 7089 "sql_yacc.yy" +#line 7091 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_FIELDS; - if (yyvsp[-1].simple_string) - yyvsp[-2].table->change_db(yyvsp[-1].simple_string); - if (prepare_schema_table(YYTHD, lex, yyvsp[-2].table, SCH_COLUMNS)) + if ((yyvsp[(5) - (6)].simple_string)) + (yyvsp[(4) - (6)].table)->change_db((yyvsp[(5) - (6)].simple_string)); + if (prepare_schema_table(YYTHD, lex, (yyvsp[(4) - (6)].table), SCH_COLUMNS)) MYSQL_YYABORT; } break; case 1336: -#line 7102 "sql_yacc.yy" +#line 7104 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_NEW_MASTER; - Lex->mi.log_file_name = yyvsp[-8].lex_str.str; - Lex->mi.pos = yyvsp[-4].ulonglong_number; - Lex->mi.server_id = yyvsp[0].ulong_num; + Lex->mi.log_file_name = (yyvsp[(8) - (16)].lex_str).str; + Lex->mi.pos = (yyvsp[(12) - (16)].ulonglong_number); + Lex->mi.server_id = (yyvsp[(16) - (16)].ulong_num); } break; case 1337: -#line 7109 "sql_yacc.yy" +#line 7111 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_BINLOGS; } break; case 1338: -#line 7113 "sql_yacc.yy" +#line 7115 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS; } break; case 1339: -#line 7117 "sql_yacc.yy" +#line 7119 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS; @@ -23214,20 +23549,20 @@ break; case 1341: -#line 7122 "sql_yacc.yy" +#line 7124 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_KEYS; - if (yyvsp[-1].simple_string) - yyvsp[-2].table->change_db(yyvsp[-1].simple_string); - if (prepare_schema_table(YYTHD, lex, yyvsp[-2].table, SCH_STATISTICS)) + if ((yyvsp[(4) - (5)].simple_string)) + (yyvsp[(3) - (5)].table)->change_db((yyvsp[(4) - (5)].simple_string)); + if (prepare_schema_table(YYTHD, lex, (yyvsp[(3) - (5)].table), SCH_STATISTICS)) MYSQL_YYABORT; } break; case 1342: -#line 7132 "sql_yacc.yy" +#line 7134 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_COLUMN_TYPES; @@ -23235,7 +23570,7 @@ break; case 1343: -#line 7137 "sql_yacc.yy" +#line 7139 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -23244,7 +23579,7 @@ break; case 1344: -#line 7143 "sql_yacc.yy" +#line 7145 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -23252,7 +23587,7 @@ break; case 1345: -#line 7148 "sql_yacc.yy" +#line 7150 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_PRIVILEGES; @@ -23260,32 +23595,32 @@ break; case 1346: -#line 7153 "sql_yacc.yy" +#line 7155 "sql_yacc.yy" { (void) create_select_for_variable("warning_count"); } break; case 1347: -#line 7155 "sql_yacc.yy" +#line 7157 "sql_yacc.yy" { (void) create_select_for_variable("error_count"); } break; case 1348: -#line 7157 "sql_yacc.yy" +#line 7159 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_WARNS;} break; case 1349: -#line 7159 "sql_yacc.yy" +#line 7161 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_ERRORS;} break; case 1350: -#line 7161 "sql_yacc.yy" +#line 7163 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_PROFILES; } break; case 1351: -#line 7163 "sql_yacc.yy" +#line 7165 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23296,46 +23631,46 @@ break; case 1352: -#line 7171 "sql_yacc.yy" +#line 7173 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_STATUS; - lex->option_type= yyvsp[-2].var_type; + lex->option_type= (yyvsp[(1) - (3)].var_type); if (prepare_schema_table(YYTHD, lex, 0, SCH_STATUS)) MYSQL_YYABORT; } break; case 1353: -#line 7180 "sql_yacc.yy" +#line 7182 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; WARN_DEPRECATED("SHOW INNODB STATUS", "SHOW ENGINE INNODB STATUS"); } break; case 1354: -#line 7182 "sql_yacc.yy" +#line 7184 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MUTEX_STATUS; } break; case 1355: -#line 7184 "sql_yacc.yy" +#line 7186 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;} break; case 1356: -#line 7186 "sql_yacc.yy" +#line 7188 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; lex->orig_sql_command= SQLCOM_SHOW_VARIABLES; - lex->option_type= yyvsp[-2].var_type; + lex->option_type= (yyvsp[(1) - (3)].var_type); if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES)) MYSQL_YYABORT; } break; case 1357: -#line 7195 "sql_yacc.yy" +#line 7197 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23346,7 +23681,7 @@ break; case 1358: -#line 7203 "sql_yacc.yy" +#line 7205 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23357,17 +23692,17 @@ break; case 1359: -#line 7211 "sql_yacc.yy" +#line 7213 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW BDB LOGS", "SHOW ENGINE BDB LOGS"); } break; case 1360: -#line 7213 "sql_yacc.yy" +#line 7215 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW LOGS", "SHOW ENGINE BDB LOGS"); } break; case 1361: -#line 7215 "sql_yacc.yy" +#line 7217 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; @@ -23380,82 +23715,82 @@ break; case 1362: -#line 7225 "sql_yacc.yy" +#line 7227 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; - lex->grant_user=yyvsp[0].lex_user; + lex->grant_user=(yyvsp[(3) - (3)].lex_user); lex->grant_user->password=null_lex_str; } break; case 1363: -#line 7232 "sql_yacc.yy" +#line 7234 "sql_yacc.yy" { Lex->sql_command=SQLCOM_SHOW_CREATE_DB; - Lex->create_info.options=yyvsp[-1].num; - Lex->name=yyvsp[0].lex_str.str; + Lex->create_info.options=(yyvsp[(3) - (4)].num); + Lex->name=(yyvsp[(4) - (4)].lex_str).str; } break; case 1364: -#line 7238 "sql_yacc.yy" +#line 7240 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; - if (!lex->select_lex.add_table_to_list(YYTHD, yyvsp[0].table, NULL,0)) + if (!lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(3) - (3)].table), NULL,0)) MYSQL_YYABORT; lex->only_view= 0; } break; case 1365: -#line 7246 "sql_yacc.yy" +#line 7248 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; - if (!lex->select_lex.add_table_to_list(YYTHD, yyvsp[0].table, NULL, 0)) + if (!lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(3) - (3)].table), NULL, 0)) MYSQL_YYABORT; lex->only_view= 1; } break; case 1366: -#line 7254 "sql_yacc.yy" +#line 7256 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MASTER_STAT; } break; case 1367: -#line 7258 "sql_yacc.yy" +#line 7260 "sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; } break; case 1368: -#line 7262 "sql_yacc.yy" +#line 7264 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE_PROC; - lex->spname= yyvsp[0].spname; + lex->spname= (yyvsp[(3) - (3)].spname); } break; case 1369: -#line 7269 "sql_yacc.yy" +#line 7271 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE_FUNC; - lex->spname= yyvsp[0].spname; + lex->spname= (yyvsp[(3) - (3)].spname); } break; case 1370: -#line 7276 "sql_yacc.yy" +#line 7278 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23468,7 +23803,7 @@ break; case 1371: -#line 7286 "sql_yacc.yy" +#line 7288 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -23481,43 +23816,43 @@ break; case 1372: -#line 7296 "sql_yacc.yy" +#line 7298 "sql_yacc.yy" { #ifdef DBUG_OFF my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; #else Lex->sql_command= SQLCOM_SHOW_PROC_CODE; - Lex->spname= yyvsp[0].spname; + Lex->spname= (yyvsp[(3) - (3)].spname); #endif } break; case 1373: -#line 7306 "sql_yacc.yy" +#line 7308 "sql_yacc.yy" { #ifdef DBUG_OFF my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; #else Lex->sql_command= SQLCOM_SHOW_FUNC_CODE; - Lex->spname= yyvsp[0].spname; + Lex->spname= (yyvsp[(3) - (3)].spname); #endif #ifdef ENABLE_SENNA } break; case 1374: -#line 7317 "sql_yacc.yy" +#line 7319 "sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_SENNA_STATUS; - Lex->select_lex.db = yyvsp[-1].simple_string; + Lex->select_lex.db = (yyvsp[(3) - (4)].simple_string); #endif } break; case 1375: -#line 7326 "sql_yacc.yy" +#line 7328 "sql_yacc.yy" { switch (Lex->create_info.db_type) { case DB_TYPE_NDBCLUSTER: @@ -23534,7 +23869,7 @@ break; case 1376: -#line 7340 "sql_yacc.yy" +#line 7342 "sql_yacc.yy" { switch (Lex->create_info.db_type) { case DB_TYPE_BERKELEY_DB: @@ -23548,62 +23883,62 @@ break; case 1381: -#line 7360 "sql_yacc.yy" - { yyval.simple_string= 0; } +#line 7362 "sql_yacc.yy" + { (yyval.simple_string)= 0; } break; case 1382: -#line 7361 "sql_yacc.yy" - { yyval.simple_string= yyvsp[0].lex_str.str; } +#line 7363 "sql_yacc.yy" + { (yyval.simple_string)= (yyvsp[(2) - (2)].lex_str).str; } break; case 1383: -#line 7364 "sql_yacc.yy" +#line 7366 "sql_yacc.yy" { Lex->verbose=0; } break; case 1384: -#line 7365 "sql_yacc.yy" +#line 7367 "sql_yacc.yy" { Lex->verbose=1; } break; case 1387: -#line 7372 "sql_yacc.yy" +#line 7374 "sql_yacc.yy" { Lex->mi.log_file_name = 0; } break; case 1388: -#line 7373 "sql_yacc.yy" - { Lex->mi.log_file_name = yyvsp[0].lex_str.str; } +#line 7375 "sql_yacc.yy" + { Lex->mi.log_file_name = (yyvsp[(2) - (2)].lex_str).str; } break; case 1389: -#line 7376 "sql_yacc.yy" +#line 7378 "sql_yacc.yy" { Lex->mi.pos = 4; /* skip magic number */ } break; case 1390: -#line 7377 "sql_yacc.yy" - { Lex->mi.pos = yyvsp[0].ulonglong_number; } +#line 7379 "sql_yacc.yy" + { Lex->mi.pos = (yyvsp[(2) - (2)].ulonglong_number); } break; case 1392: -#line 7382 "sql_yacc.yy" - { Lex->wild= new (YYTHD->mem_root) String(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, +#line 7384 "sql_yacc.yy" + { Lex->wild= new (YYTHD->mem_root) String((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, system_charset_info); } break; case 1393: -#line 7385 "sql_yacc.yy" +#line 7387 "sql_yacc.yy" { - Select->where= yyvsp[0].item; - if (yyvsp[0].item) - yyvsp[0].item->top_level_item(); + Select->where= (yyvsp[(2) - (2)].item); + if ((yyvsp[(2) - (2)].item)) + (yyvsp[(2) - (2)].item)->top_level_item(); } break; case 1394: -#line 7396 "sql_yacc.yy" +#line 7398 "sql_yacc.yy" { LEX *lex= Lex; lex->lock_option= TL_READ; @@ -23613,23 +23948,23 @@ lex->orig_sql_command= SQLCOM_SHOW_FIELDS; lex->select_lex.db= 0; lex->verbose= 0; - if (prepare_schema_table(YYTHD, lex, yyvsp[0].table, SCH_COLUMNS)) + if (prepare_schema_table(YYTHD, lex, (yyvsp[(2) - (2)].table), SCH_COLUMNS)) MYSQL_YYABORT; } break; case 1395: -#line 7408 "sql_yacc.yy" +#line 7410 "sql_yacc.yy" {} break; case 1396: -#line 7410 "sql_yacc.yy" +#line 7412 "sql_yacc.yy" { Lex->describe|= DESCRIBE_NORMAL; } break; case 1397: -#line 7412 "sql_yacc.yy" +#line 7414 "sql_yacc.yy" { LEX *lex=Lex; lex->select_lex.options|= SELECT_DESCRIBE; @@ -23637,117 +23972,117 @@ break; case 1400: -#line 7423 "sql_yacc.yy" +#line 7425 "sql_yacc.yy" {} break; case 1401: -#line 7424 "sql_yacc.yy" +#line 7426 "sql_yacc.yy" { Lex->describe|= DESCRIBE_EXTENDED; } break; case 1402: -#line 7428 "sql_yacc.yy" +#line 7430 "sql_yacc.yy" {} break; case 1403: -#line 7429 "sql_yacc.yy" - { Lex->wild= yyvsp[0].string; } +#line 7431 "sql_yacc.yy" + { Lex->wild= (yyvsp[(1) - (1)].string); } break; case 1404: -#line 7431 "sql_yacc.yy" - { Lex->wild= new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,system_charset_info); } +#line 7433 "sql_yacc.yy" + { Lex->wild= new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); } break; case 1405: -#line 7438 "sql_yacc.yy" +#line 7440 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_FLUSH; lex->type= 0; - lex->no_write_to_binlog= yyvsp[0].num; + lex->no_write_to_binlog= (yyvsp[(2) - (2)].num); } break; case 1406: -#line 7445 "sql_yacc.yy" +#line 7447 "sql_yacc.yy" {} break; case 1409: -#line 7453 "sql_yacc.yy" +#line 7455 "sql_yacc.yy" { Lex->type|= REFRESH_TABLES; } break; case 1410: -#line 7453 "sql_yacc.yy" +#line 7455 "sql_yacc.yy" {} break; case 1411: -#line 7454 "sql_yacc.yy" +#line 7456 "sql_yacc.yy" { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; } break; case 1412: -#line 7455 "sql_yacc.yy" +#line 7457 "sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE_FREE; } break; case 1413: -#line 7456 "sql_yacc.yy" +#line 7458 "sql_yacc.yy" { Lex->type|= REFRESH_HOSTS; } break; case 1414: -#line 7457 "sql_yacc.yy" +#line 7459 "sql_yacc.yy" { Lex->type|= REFRESH_GRANT; } break; case 1415: -#line 7458 "sql_yacc.yy" +#line 7460 "sql_yacc.yy" { Lex->type|= REFRESH_LOG; } break; case 1416: -#line 7459 "sql_yacc.yy" +#line 7461 "sql_yacc.yy" { Lex->type|= REFRESH_STATUS; } break; case 1417: -#line 7460 "sql_yacc.yy" +#line 7462 "sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1418: -#line 7461 "sql_yacc.yy" +#line 7463 "sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1419: -#line 7462 "sql_yacc.yy" +#line 7464 "sql_yacc.yy" { Lex->type|= REFRESH_DES_KEY_FILE; } break; case 1420: -#line 7463 "sql_yacc.yy" +#line 7465 "sql_yacc.yy" { Lex->type|= REFRESH_USER_RESOURCES; } break; case 1421: -#line 7466 "sql_yacc.yy" +#line 7468 "sql_yacc.yy" {;} break; case 1422: -#line 7467 "sql_yacc.yy" +#line 7469 "sql_yacc.yy" {;} break; case 1423: -#line 7471 "sql_yacc.yy" +#line 7473 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RESET; lex->type=0; @@ -23755,27 +24090,27 @@ break; case 1424: -#line 7475 "sql_yacc.yy" +#line 7477 "sql_yacc.yy" {} break; case 1427: -#line 7483 "sql_yacc.yy" +#line 7485 "sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1428: -#line 7484 "sql_yacc.yy" +#line 7486 "sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1429: -#line 7485 "sql_yacc.yy" +#line 7487 "sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE;} break; case 1430: -#line 7489 "sql_yacc.yy" +#line 7491 "sql_yacc.yy" { LEX *lex=Lex; lex->type=0; @@ -23784,67 +24119,67 @@ break; case 1431: -#line 7494 "sql_yacc.yy" +#line 7496 "sql_yacc.yy" {} break; case 1433: -#line 7503 "sql_yacc.yy" +#line 7505 "sql_yacc.yy" { - Lex->to_log = yyvsp[0].lex_str.str; + Lex->to_log = (yyvsp[(2) - (2)].lex_str).str; } break; case 1434: -#line 7507 "sql_yacc.yy" +#line 7509 "sql_yacc.yy" { LEX *lex= Lex; lex->value_list.empty(); - lex->value_list.push_front(yyvsp[0].item); + lex->value_list.push_front((yyvsp[(2) - (2)].item)); lex->sql_command= SQLCOM_PURGE_BEFORE; } break; case 1435: -#line 7518 "sql_yacc.yy" +#line 7520 "sql_yacc.yy" { Lex->sql_command= SQLCOM_KILL; } break; case 1436: -#line 7519 "sql_yacc.yy" +#line 7521 "sql_yacc.yy" { LEX *lex=Lex; lex->value_list.empty(); - lex->value_list.push_front(yyvsp[0].item); + lex->value_list.push_front((yyvsp[(4) - (4)].item)); } break; case 1437: -#line 7526 "sql_yacc.yy" +#line 7528 "sql_yacc.yy" { Lex->type= 0; } break; case 1438: -#line 7527 "sql_yacc.yy" +#line 7529 "sql_yacc.yy" { Lex->type= 0; } break; case 1439: -#line 7528 "sql_yacc.yy" +#line 7530 "sql_yacc.yy" { Lex->type= ONLY_KILL_QUERY; } break; case 1440: -#line 7534 "sql_yacc.yy" +#line 7536 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_CHANGE_DB; - lex->select_lex.db= yyvsp[0].lex_str.str; + lex->select_lex.db= (yyvsp[(2) - (2)].lex_str).str; } break; case 1441: -#line 7543 "sql_yacc.yy" +#line 7545 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -23860,12 +24195,12 @@ break; case 1442: -#line 7556 "sql_yacc.yy" +#line 7558 "sql_yacc.yy" {} break; case 1443: -#line 7559 "sql_yacc.yy" +#line 7561 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -23877,27 +24212,27 @@ WARN_DEPRECATED("LOAD TABLE FROM MASTER", "mysqldump or future " "BACKUP/RESTORE DATABASE facility"); - if (!Select->add_table_to_list(YYTHD, yyvsp[-2].table, NULL, TL_OPTION_UPDATING)) + if (!Select->add_table_to_list(YYTHD, (yyvsp[(3) - (5)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; } break; case 1444: -#line 7576 "sql_yacc.yy" +#line 7578 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_LOAD; - lex->lock_option= yyvsp[-3].lock_type; - lex->local_file= yyvsp[-2].num; + lex->lock_option= (yyvsp[(1) - (4)].lock_type); + lex->local_file= (yyvsp[(2) - (4)].num); lex->duplicates= DUP_ERROR; lex->ignore= 0; - if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str, 0))) + if (!(lex->exchange= new sql_exchange((yyvsp[(4) - (4)].lex_str).str, 0))) MYSQL_YYABORT; } break; case 1445: -#line 7587 "sql_yacc.yy" +#line 7589 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -23907,10 +24242,10 @@ break; case 1446: -#line 7594 "sql_yacc.yy" +#line 7596 "sql_yacc.yy" { LEX *lex=Lex; - if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL, TL_OPTION_UPDATING, + if (!Select->add_table_to_list(YYTHD, (yyvsp[(10) - (10)].table), NULL, TL_OPTION_UPDATING, lex->lock_option)) MYSQL_YYABORT; lex->field_list.empty(); @@ -23920,17 +24255,17 @@ break; case 1447: -#line 7604 "sql_yacc.yy" - { Lex->exchange->cs= yyvsp[0].charset; } +#line 7606 "sql_yacc.yy" + { Lex->exchange->cs= (yyvsp[(12) - (12)].charset); } break; case 1448: -#line 7607 "sql_yacc.yy" +#line 7609 "sql_yacc.yy" {} break; case 1449: -#line 7610 "sql_yacc.yy" +#line 7612 "sql_yacc.yy" { Lex->sql_command = SQLCOM_LOAD_MASTER_DATA; WARN_DEPRECATED("LOAD DATA FROM MASTER", @@ -23940,215 +24275,215 @@ break; case 1450: -#line 7618 "sql_yacc.yy" - { yyval.num=0;} +#line 7620 "sql_yacc.yy" + { (yyval.num)=0;} break; case 1451: -#line 7619 "sql_yacc.yy" - { yyval.num=1;} +#line 7621 "sql_yacc.yy" + { (yyval.num)=1;} break; case 1452: -#line 7622 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_DEFAULT; } +#line 7624 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1453: -#line 7624 "sql_yacc.yy" +#line 7626 "sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* Ignore this option in SP to avoid problem with query cache */ if (Lex->sphead != 0) - yyval.lock_type= TL_WRITE_DEFAULT; + (yyval.lock_type)= TL_WRITE_DEFAULT; else #endif - yyval.lock_type= TL_WRITE_CONCURRENT_INSERT; + (yyval.lock_type)= TL_WRITE_CONCURRENT_INSERT; } break; case 1454: -#line 7635 "sql_yacc.yy" - { yyval.lock_type= TL_WRITE_LOW_PRIORITY; } +#line 7637 "sql_yacc.yy" + { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1455: -#line 7639 "sql_yacc.yy" +#line 7641 "sql_yacc.yy" { Lex->duplicates=DUP_ERROR; } break; case 1456: -#line 7640 "sql_yacc.yy" +#line 7642 "sql_yacc.yy" { Lex->duplicates=DUP_REPLACE; } break; case 1457: -#line 7641 "sql_yacc.yy" +#line 7643 "sql_yacc.yy" { Lex->ignore= 1; } break; case 1462: -#line 7653 "sql_yacc.yy" +#line 7655 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->field_term= yyvsp[0].string; + Lex->exchange->field_term= (yyvsp[(3) - (3)].string); } break; case 1463: -#line 7658 "sql_yacc.yy" +#line 7660 "sql_yacc.yy" { LEX *lex= Lex; DBUG_ASSERT(lex->exchange != 0); - lex->exchange->enclosed= yyvsp[0].string; + lex->exchange->enclosed= (yyvsp[(4) - (4)].string); lex->exchange->opt_enclosed= 1; } break; case 1464: -#line 7665 "sql_yacc.yy" +#line 7667 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->enclosed= yyvsp[0].string; + Lex->exchange->enclosed= (yyvsp[(3) - (3)].string); } break; case 1465: -#line 7670 "sql_yacc.yy" +#line 7672 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->escaped= yyvsp[0].string; + Lex->exchange->escaped= (yyvsp[(3) - (3)].string); } break; case 1470: -#line 7685 "sql_yacc.yy" +#line 7687 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->line_term= yyvsp[0].string; + Lex->exchange->line_term= (yyvsp[(3) - (3)].string); } break; case 1471: -#line 7690 "sql_yacc.yy" +#line 7692 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->line_start= yyvsp[0].string; + Lex->exchange->line_start= (yyvsp[(3) - (3)].string); } break; case 1473: -#line 7698 "sql_yacc.yy" +#line 7700 "sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); - Lex->exchange->skip_lines= atol(yyvsp[-1].lex_str.str); + Lex->exchange->skip_lines= atol((yyvsp[(2) - (3)].lex_str).str); } break; case 1474: -#line 7704 "sql_yacc.yy" +#line 7706 "sql_yacc.yy" { } break; case 1475: -#line 7705 "sql_yacc.yy" +#line 7707 "sql_yacc.yy" { } break; case 1476: -#line 7706 "sql_yacc.yy" +#line 7708 "sql_yacc.yy" { } break; case 1477: -#line 7710 "sql_yacc.yy" - { Lex->field_list.push_back(yyvsp[0].item); } +#line 7712 "sql_yacc.yy" + { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1478: -#line 7712 "sql_yacc.yy" - { Lex->field_list.push_back(yyvsp[0].item); } +#line 7714 "sql_yacc.yy" + { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1479: -#line 7716 "sql_yacc.yy" - {yyval.item= yyvsp[0].item;} +#line 7718 "sql_yacc.yy" + {(yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1480: -#line 7718 "sql_yacc.yy" - { yyval.item= new Item_user_var_as_out_param(yyvsp[0].lex_str); } +#line 7720 "sql_yacc.yy" + { (yyval.item)= new Item_user_var_as_out_param((yyvsp[(2) - (2)].lex_str)); } break; case 1481: -#line 7722 "sql_yacc.yy" +#line 7724 "sql_yacc.yy" { } break; case 1482: -#line 7723 "sql_yacc.yy" +#line 7725 "sql_yacc.yy" { } break; case 1483: -#line 7730 "sql_yacc.yy" +#line 7732 "sql_yacc.yy" { THD *thd= YYTHD; - yyval.item = new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,thd->variables.collation_connection); + (yyval.item) = new Item_string((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,thd->variables.collation_connection); } break; case 1484: -#line 7735 "sql_yacc.yy" - { yyval.item= new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,national_charset_info); } +#line 7737 "sql_yacc.yy" + { (yyval.item)= new Item_string((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,national_charset_info); } break; case 1485: -#line 7737 "sql_yacc.yy" - { yyval.item = new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,Lex->underscore_charset); } +#line 7739 "sql_yacc.yy" + { (yyval.item) = new Item_string((yyvsp[(2) - (2)].lex_str).str,(yyvsp[(2) - (2)].lex_str).length,Lex->underscore_charset); } break; case 1486: -#line 7739 "sql_yacc.yy" - { ((Item_string*) yyvsp[-1].item)->append(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); } +#line 7741 "sql_yacc.yy" + { ((Item_string*) (yyvsp[(1) - (2)].item))->append((yyvsp[(2) - (2)].lex_str).str,(yyvsp[(2) - (2)].lex_str).length); } break; case 1487: -#line 7744 "sql_yacc.yy" - { yyval.string= new (YYTHD->mem_root) String(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,YYTHD->variables.collation_connection); } +#line 7746 "sql_yacc.yy" + { (yyval.string)= new (YYTHD->mem_root) String((yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,YYTHD->variables.collation_connection); } break; case 1488: -#line 7746 "sql_yacc.yy" +#line 7748 "sql_yacc.yy" { - Item *tmp= new Item_hex_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + Item *tmp= new Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); /* it is OK only emulate fix_fields, because we need only value of constant */ - yyval.string= tmp ? + (yyval.string)= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : (String*) 0; } break; case 1489: -#line 7757 "sql_yacc.yy" +#line 7759 "sql_yacc.yy" { - Item *tmp= new Item_bin_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + Item *tmp= new Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); /* it is OK only emulate fix_fields, because we need only value of constant */ - yyval.string= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : + (yyval.string)= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : (String*) 0; } break; case 1490: -#line 7770 "sql_yacc.yy" +#line 7772 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24160,7 +24495,7 @@ MYSQL_YYABORT; } item= new Item_param((uint) (lip->tok_start - thd->query)); - if (!(yyval.item= item) || lex->param_list.push_back(item)) + if (!((yyval.item)= item) || lex->param_list.push_back(item)) { my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); MYSQL_YYABORT; @@ -24169,65 +24504,65 @@ break; case 1491: -#line 7790 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7792 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1492: -#line 7791 "sql_yacc.yy" - { yyval.item = yyvsp[0].item_num; } +#line 7793 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(2) - (2)].item_num); } break; case 1493: -#line 7793 "sql_yacc.yy" +#line 7795 "sql_yacc.yy" { - yyvsp[0].item_num->max_length++; - yyval.item= yyvsp[0].item_num->neg(); + (yyvsp[(2) - (2)].item_num)->max_length++; + (yyval.item)= (yyvsp[(2) - (2)].item_num)->neg(); } break; case 1494: -#line 7801 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7803 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1495: -#line 7802 "sql_yacc.yy" - { yyval.item = yyvsp[0].item_num; } +#line 7804 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(1) - (1)].item_num); } break; case 1496: -#line 7804 "sql_yacc.yy" +#line 7806 "sql_yacc.yy" { - yyval.item = new Item_null(); + (yyval.item) = new Item_null(); YYTHD->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT; } break; case 1497: -#line 7808 "sql_yacc.yy" - { yyval.item= new Item_int((char*) "FALSE",0,1); } +#line 7810 "sql_yacc.yy" + { (yyval.item)= new Item_int((char*) "FALSE",0,1); } break; case 1498: -#line 7809 "sql_yacc.yy" - { yyval.item= new Item_int((char*) "TRUE",1,1); } +#line 7811 "sql_yacc.yy" + { (yyval.item)= new Item_int((char*) "TRUE",1,1); } break; case 1499: -#line 7810 "sql_yacc.yy" - { yyval.item = new Item_hex_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length);} +#line 7812 "sql_yacc.yy" + { (yyval.item) = new Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);} break; case 1500: -#line 7811 "sql_yacc.yy" - { yyval.item= new Item_bin_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 7813 "sql_yacc.yy" + { (yyval.item)= new Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1501: -#line 7813 "sql_yacc.yy" +#line 7815 "sql_yacc.yy" { - Item *tmp= new Item_hex_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + Item *tmp= new Item_hex_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); /* it is OK only emulate fix_fieds, because we need only value of constant @@ -24235,16 +24570,16 @@ String *str= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : (String*) 0; - yyval.item= new Item_string(str ? str->ptr() : "", + (yyval.item)= new Item_string(str ? str->ptr() : "", str ? str->length() : 0, Lex->underscore_charset); } break; case 1502: -#line 7827 "sql_yacc.yy" +#line 7829 "sql_yacc.yy" { - Item *tmp= new Item_bin_string(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + Item *tmp= new Item_bin_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); /* it is OK only emulate fix_fieds, because we need only value of constant @@ -24252,46 +24587,46 @@ String *str= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : (String*) 0; - yyval.item= new Item_string(str ? str->ptr() : "", + (yyval.item)= new Item_string(str ? str->ptr() : "", str ? str->length() : 0, Lex->charset); } break; case 1503: -#line 7840 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7842 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1504: -#line 7841 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7843 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1505: -#line 7842 "sql_yacc.yy" - { yyval.item = yyvsp[0].item; } +#line 7844 "sql_yacc.yy" + { (yyval.item) = (yyvsp[(2) - (2)].item); } break; case 1506: -#line 7845 "sql_yacc.yy" - { int error; yyval.item_num = new Item_int(yyvsp[0].lex_str.str, (longlong) my_strtoll10(yyvsp[0].lex_str.str, NULL, &error), yyvsp[0].lex_str.length); } +#line 7847 "sql_yacc.yy" + { int error; (yyval.item_num) = new Item_int((yyvsp[(1) - (1)].lex_str).str, (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error), (yyvsp[(1) - (1)].lex_str).length); } break; case 1507: -#line 7846 "sql_yacc.yy" - { int error; yyval.item_num = new Item_int(yyvsp[0].lex_str.str, (longlong) my_strtoll10(yyvsp[0].lex_str.str, NULL, &error), yyvsp[0].lex_str.length); } +#line 7848 "sql_yacc.yy" + { int error; (yyval.item_num) = new Item_int((yyvsp[(1) - (1)].lex_str).str, (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error), (yyvsp[(1) - (1)].lex_str).length); } break; case 1508: -#line 7847 "sql_yacc.yy" - { yyval.item_num = new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); } +#line 7849 "sql_yacc.yy" + { (yyval.item_num) = new Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1509: -#line 7849 "sql_yacc.yy" +#line 7851 "sql_yacc.yy" { - yyval.item_num= new Item_decimal(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, YYTHD->charset()); + (yyval.item_num)= new Item_decimal((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, YYTHD->charset()); if (YYTHD->net.report_error) { MYSQL_YYABORT; @@ -24300,9 +24635,9 @@ break; case 1510: -#line 7857 "sql_yacc.yy" +#line 7859 "sql_yacc.yy" { - yyval.item_num = new Item_float(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + (yyval.item_num) = new Item_float((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (YYTHD->net.report_error) { MYSQL_YYABORT; @@ -24311,49 +24646,49 @@ break; case 1511: -#line 7871 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 7873 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1512: -#line 7872 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 7874 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1513: -#line 7876 "sql_yacc.yy" +#line 7878 "sql_yacc.yy" { SELECT_LEX *sel= Select; - yyval.item = new Item_field(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, "*"); + (yyval.item) = new Item_field(Lex->current_context(), NullS, (yyvsp[(1) - (3)].lex_str).str, "*"); sel->with_wild++; } break; case 1514: -#line 7882 "sql_yacc.yy" +#line 7884 "sql_yacc.yy" { SELECT_LEX *sel= Select; - yyval.item = new Item_field(Lex->current_context(), (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str), - yyvsp[-2].lex_str.str,"*"); + (yyval.item) = new Item_field(Lex->current_context(), (YYTHD->client_capabilities & + CLIENT_NO_SCHEMA ? NullS : (yyvsp[(1) - (5)].lex_str).str), + (yyvsp[(3) - (5)].lex_str).str,"*"); sel->with_wild++; } break; case 1515: -#line 7892 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 7894 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1516: -#line 7896 "sql_yacc.yy" +#line 7898 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; Lex_input_stream *lip= thd->m_lip; sp_variable_t *spv; sp_pcontext *spc = lex->spcont; - if (spc && (spv = spc->find_variable(&yyvsp[0].lex_str))) + if (spc && (spv = spc->find_variable(&(yyvsp[(1) - (1)].lex_str)))) { /* We're compiling a stored procedure and found a variable */ if (! lex->parsing_options.allows_variable) @@ -24363,50 +24698,50 @@ } Item_splocal *splocal; - splocal= new Item_splocal(yyvsp[0].lex_str, spv->offset, spv->type, + splocal= new Item_splocal((yyvsp[(1) - (1)].lex_str), spv->offset, spv->type, lip->tok_start_prev - lex->sphead->m_tmp_query); #ifndef DBUG_OFF if (splocal) splocal->m_sp= lex->sphead; #endif - yyval.item = (Item*) splocal; + (yyval.item) = (Item*) splocal; lex->safe_to_cache_query=0; } else { SELECT_LEX *sel=Select; - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, NullS, yyvsp[0].lex_str.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, NullS, yyvsp[0].lex_str.str); + (Item*) new Item_field(Lex->current_context(), NullS, NullS, (yyvsp[(1) - (1)].lex_str).str) : + (Item*) new Item_ref(Lex->current_context(), NullS, NullS, (yyvsp[(1) - (1)].lex_str).str); } } break; case 1517: -#line 7931 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 7933 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1518: -#line 7936 "sql_yacc.yy" +#line 7938 "sql_yacc.yy" { SELECT_LEX *sel=Select; - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, NullS, yyvsp[0].lex_str.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, NullS, yyvsp[0].lex_str.str); + (Item*) new Item_field(Lex->current_context(), NullS, NullS, (yyvsp[(1) - (1)].lex_str).str) : + (Item*) new Item_ref(Lex->current_context(), NullS, NullS, (yyvsp[(1) - (1)].lex_str).str); } break; case 1519: -#line 7943 "sql_yacc.yy" - { yyval.item= yyvsp[0].item; } +#line 7945 "sql_yacc.yy" + { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1520: -#line 7948 "sql_yacc.yy" +#line 7950 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24417,11 +24752,11 @@ should be changed in future. */ if (lex->sphead && lex->sphead->m_type == TYPE_ENUM_TRIGGER && - (!my_strcasecmp(system_charset_info, yyvsp[-2].lex_str.str, "NEW") || - !my_strcasecmp(system_charset_info, yyvsp[-2].lex_str.str, "OLD"))) + (!my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "NEW") || + !my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "OLD"))) { Item_trigger_field *trg_fld; - bool new_row= (yyvsp[-2].lex_str.str[0]=='N' || yyvsp[-2].lex_str.str[0]=='n'); + bool new_row= ((yyvsp[(1) - (3)].lex_str).str[0]=='N' || (yyvsp[(1) - (3)].lex_str).str[0]=='n'); if (lex->trg_chistics.event == TRG_EVENT_INSERT && !new_row) @@ -24446,7 +24781,7 @@ new_row ? Item_trigger_field::NEW_ROW: Item_trigger_field::OLD_ROW, - yyvsp[0].lex_str.str, + (yyvsp[(3) - (3)].lex_str).str, SELECT_ACL, read_only))) MYSQL_YYABORT; @@ -24458,7 +24793,7 @@ lex->trg_table_fields.link_in_list((byte *)trg_fld, (byte**)&trg_fld->next_trg_field); - yyval.item= (Item *)trg_fld; + (yyval.item)= (Item *)trg_fld; } else { @@ -24466,18 +24801,18 @@ if (sel->no_table_names_allowed) { my_error(ER_TABLENAME_NOT_ALLOWED_HERE, - MYF(0), yyvsp[-2].lex_str.str, thd->where); + MYF(0), (yyvsp[(1) - (3)].lex_str).str, thd->where); } - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str); + (Item*) new Item_field(Lex->current_context(), NullS, (yyvsp[(1) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).str) : + (Item*) new Item_ref(Lex->current_context(), NullS, (yyvsp[(1) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).str); } } break; case 1521: -#line 8016 "sql_yacc.yy" +#line 8018 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24485,17 +24820,17 @@ if (sel->no_table_names_allowed) { my_error(ER_TABLENAME_NOT_ALLOWED_HERE, - MYF(0), yyvsp[-2].lex_str.str, thd->where); + MYF(0), (yyvsp[(2) - (4)].lex_str).str, thd->where); } - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str); + (Item*) new Item_field(Lex->current_context(), NullS, (yyvsp[(2) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).str) : + (Item*) new Item_ref(Lex->current_context(), NullS, (yyvsp[(2) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).str); } break; case 1522: -#line 8031 "sql_yacc.yy" +#line 8033 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24503,1605 +24838,1605 @@ if (sel->no_table_names_allowed) { my_error(ER_TABLENAME_NOT_ALLOWED_HERE, - MYF(0), yyvsp[-2].lex_str.str, thd->where); + MYF(0), (yyvsp[(3) - (5)].lex_str).str, thd->where); } - yyval.item= (sel->parsing_place != IN_HAVING || + (yyval.item)= (sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0) ? (Item*) new Item_field(Lex->current_context(), (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str), - yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str) : + CLIENT_NO_SCHEMA ? NullS : (yyvsp[(1) - (5)].lex_str).str), + (yyvsp[(3) - (5)].lex_str).str, (yyvsp[(5) - (5)].lex_str).str) : (Item*) new Item_ref(Lex->current_context(), (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str), - yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str); + CLIENT_NO_SCHEMA ? NullS : (yyvsp[(1) - (5)].lex_str).str), + (yyvsp[(3) - (5)].lex_str).str, (yyvsp[(5) - (5)].lex_str).str); } break; case 1523: -#line 8054 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8056 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1524: -#line 8056 "sql_yacc.yy" +#line 8058 "sql_yacc.yy" { TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; - if (my_strcasecmp(table_alias_charset, yyvsp[-4].lex_str.str, table->db)) + if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (5)].lex_str).str, table->db)) { - my_error(ER_WRONG_DB_NAME, MYF(0), yyvsp[-4].lex_str.str); + my_error(ER_WRONG_DB_NAME, MYF(0), (yyvsp[(1) - (5)].lex_str).str); MYSQL_YYABORT; } - if (my_strcasecmp(table_alias_charset, yyvsp[-2].lex_str.str, + if (my_strcasecmp(table_alias_charset, (yyvsp[(3) - (5)].lex_str).str, table->table_name)) { - my_error(ER_WRONG_TABLE_NAME, MYF(0), yyvsp[-2].lex_str.str); + my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(3) - (5)].lex_str).str); MYSQL_YYABORT; } - yyval.lex_str=yyvsp[0].lex_str; + (yyval.lex_str)=(yyvsp[(5) - (5)].lex_str); } break; case 1525: -#line 8072 "sql_yacc.yy" +#line 8074 "sql_yacc.yy" { TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; - if (my_strcasecmp(table_alias_charset, yyvsp[-2].lex_str.str, table->alias)) + if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (3)].lex_str).str, table->alias)) { - my_error(ER_WRONG_TABLE_NAME, MYF(0), yyvsp[-2].lex_str.str); + my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(1) - (3)].lex_str).str); MYSQL_YYABORT; } - yyval.lex_str=yyvsp[0].lex_str; + (yyval.lex_str)=(yyvsp[(3) - (3)].lex_str); } break; case 1526: -#line 8081 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8083 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str);} break; case 1527: -#line 8084 "sql_yacc.yy" - { yyval.table=new Table_ident(yyvsp[0].lex_str); } +#line 8086 "sql_yacc.yy" + { (yyval.table)=new Table_ident((yyvsp[(1) - (1)].lex_str)); } break; case 1528: -#line 8085 "sql_yacc.yy" - { yyval.table=new Table_ident(YYTHD, yyvsp[-2].lex_str,yyvsp[0].lex_str,0);} +#line 8087 "sql_yacc.yy" + { (yyval.table)=new Table_ident(YYTHD, (yyvsp[(1) - (3)].lex_str),(yyvsp[(3) - (3)].lex_str),0);} break; case 1529: -#line 8086 "sql_yacc.yy" - { yyval.table=new Table_ident(yyvsp[0].lex_str);} +#line 8088 "sql_yacc.yy" + { (yyval.table)=new Table_ident((yyvsp[(2) - (2)].lex_str));} break; case 1530: -#line 8090 "sql_yacc.yy" - { LEX_STRING db={(char*) any_db,3}; yyval.table=new Table_ident(YYTHD, db,yyvsp[0].lex_str,0); } +#line 8092 "sql_yacc.yy" + { LEX_STRING db={(char*) any_db,3}; (yyval.table)=new Table_ident(YYTHD, db,(yyvsp[(1) - (1)].lex_str),0); } break; case 1531: -#line 8094 "sql_yacc.yy" - { yyval.lex_str= yyvsp[0].lex_str; } +#line 8096 "sql_yacc.yy" + { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 1532: -#line 8096 "sql_yacc.yy" +#line 8098 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_system_charset) { CHARSET_INFO *cs= system_charset_info; int dummy_error; - uint wlen= cs->cset->well_formed_len(cs, yyvsp[0].lex_str.str, - yyvsp[0].lex_str.str+yyvsp[0].lex_str.length, - yyvsp[0].lex_str.length, &dummy_error); - if (wlen < yyvsp[0].lex_str.length) + uint wlen= cs->cset->well_formed_len(cs, (yyvsp[(1) - (1)].lex_str).str, + (yyvsp[(1) - (1)].lex_str).str+(yyvsp[(1) - (1)].lex_str).length, + (yyvsp[(1) - (1)].lex_str).length, &dummy_error); + if (wlen < (yyvsp[(1) - (1)].lex_str).length) { my_error(ER_INVALID_CHARACTER_STRING, MYF(0), - cs->csname, yyvsp[0].lex_str.str + wlen); + cs->csname, (yyvsp[(1) - (1)].lex_str).str + wlen); MYSQL_YYABORT; } - yyval.lex_str= yyvsp[0].lex_str; + (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } else - thd->convert_string(&yyval.lex_str, system_charset_info, - yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset()); + thd->convert_string(&(yyval.lex_str), system_charset_info, + (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()); } break; case 1533: -#line 8121 "sql_yacc.yy" +#line 8123 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_system_charset) - yyval.lex_str= yyvsp[0].lex_str; + (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); else - thd->convert_string(&yyval.lex_str, system_charset_info, - yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset()); + thd->convert_string(&(yyval.lex_str), system_charset_info, + (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()); } break; case 1534: -#line 8133 "sql_yacc.yy" +#line 8135 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_collation_connection) - yyval.lex_str= yyvsp[0].lex_str; + (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); else - thd->convert_string(&yyval.lex_str, thd->variables.collation_connection, - yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset()); + thd->convert_string(&(yyval.lex_str), thd->variables.collation_connection, + (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()); } break; case 1535: -#line 8146 "sql_yacc.yy" +#line 8148 "sql_yacc.yy" { THD *thd= YYTHD; if (thd->charset_is_character_set_filesystem) - yyval.lex_str= yyvsp[0].lex_str; + (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); else - thd->convert_string(&yyval.lex_str, thd->variables.character_set_filesystem, - yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset()); + thd->convert_string(&(yyval.lex_str), thd->variables.character_set_filesystem, + (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()); } break; case 1536: -#line 8157 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 8159 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1537: -#line 8159 "sql_yacc.yy" +#line 8161 "sql_yacc.yy" { THD *thd= YYTHD; - yyval.lex_str.str= thd->strmake(yyvsp[0].symbol.str, yyvsp[0].symbol.length); - yyval.lex_str.length= yyvsp[0].symbol.length; + (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); + (yyval.lex_str).length= (yyvsp[(1) - (1)].symbol).length; } break; case 1538: -#line 8167 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str; } +#line 8169 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1539: -#line 8169 "sql_yacc.yy" +#line 8171 "sql_yacc.yy" { THD *thd= YYTHD; - yyval.lex_str.str= thd->strmake(yyvsp[0].symbol.str, yyvsp[0].symbol.length); - yyval.lex_str.length= yyvsp[0].symbol.length; + (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); + (yyval.lex_str).length= (yyvsp[(1) - (1)].symbol).length; } break; case 1540: -#line 8177 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8179 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1541: -#line 8178 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8180 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1542: -#line 8179 "sql_yacc.yy" - { yyval.lex_str=yyvsp[0].lex_str;} +#line 8181 "sql_yacc.yy" + { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 1543: -#line 8183 "sql_yacc.yy" +#line 8185 "sql_yacc.yy" { THD *thd= YYTHD; - if (!(yyval.lex_user=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) + if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; - yyval.lex_user->user = yyvsp[0].lex_str; - yyval.lex_user->host.str= (char *) "%"; - yyval.lex_user->host.length= 1; + (yyval.lex_user)->user = (yyvsp[(1) - (1)].lex_str); + (yyval.lex_user)->host.str= (char *) "%"; + (yyval.lex_user)->host.length= 1; - if (check_string_length(&yyval.lex_user->user, + if (check_string_length(&(yyval.lex_user)->user, ER(ER_USERNAME), USERNAME_LENGTH)) MYSQL_YYABORT; } break; case 1544: -#line 8196 "sql_yacc.yy" +#line 8198 "sql_yacc.yy" { THD *thd= YYTHD; - if (!(yyval.lex_user=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) + if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; - yyval.lex_user->user = yyvsp[-2].lex_str; yyval.lex_user->host=yyvsp[0].lex_str; + (yyval.lex_user)->user = (yyvsp[(1) - (3)].lex_str); (yyval.lex_user)->host=(yyvsp[(3) - (3)].lex_str); - if (check_string_length(&yyval.lex_user->user, + if (check_string_length(&(yyval.lex_user)->user, ER(ER_USERNAME), USERNAME_LENGTH) || - check_string_length(&yyval.lex_user->host, + check_string_length(&(yyval.lex_user)->host, ER(ER_HOSTNAME), HOSTNAME_LENGTH)) MYSQL_YYABORT; } break; case 1545: -#line 8209 "sql_yacc.yy" +#line 8211 "sql_yacc.yy" { - if (!(yyval.lex_user=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user)))) + if (!((yyval.lex_user)=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; /* empty LEX_USER means current_user and will be handled in the get_current_user() function later */ - bzero(yyval.lex_user, sizeof(LEX_USER)); + bzero((yyval.lex_user), sizeof(LEX_USER)); } break; case 1546: -#line 8222 "sql_yacc.yy" +#line 8224 "sql_yacc.yy" {} break; case 1547: -#line 8223 "sql_yacc.yy" +#line 8225 "sql_yacc.yy" {} break; case 1548: -#line 8224 "sql_yacc.yy" +#line 8226 "sql_yacc.yy" {} break; case 1549: -#line 8225 "sql_yacc.yy" +#line 8227 "sql_yacc.yy" {} break; case 1550: -#line 8226 "sql_yacc.yy" +#line 8228 "sql_yacc.yy" {} break; case 1551: -#line 8227 "sql_yacc.yy" +#line 8229 "sql_yacc.yy" {} break; case 1552: -#line 8228 "sql_yacc.yy" +#line 8230 "sql_yacc.yy" {} break; case 1553: -#line 8229 "sql_yacc.yy" +#line 8231 "sql_yacc.yy" {} break; case 1554: -#line 8230 "sql_yacc.yy" +#line 8232 "sql_yacc.yy" {} break; case 1555: -#line 8231 "sql_yacc.yy" +#line 8233 "sql_yacc.yy" {} break; case 1556: -#line 8232 "sql_yacc.yy" +#line 8234 "sql_yacc.yy" {} break; case 1557: -#line 8233 "sql_yacc.yy" +#line 8235 "sql_yacc.yy" {} break; case 1558: -#line 8234 "sql_yacc.yy" +#line 8236 "sql_yacc.yy" {} break; case 1559: -#line 8235 "sql_yacc.yy" +#line 8237 "sql_yacc.yy" {} break; case 1560: -#line 8236 "sql_yacc.yy" +#line 8238 "sql_yacc.yy" {} break; case 1561: -#line 8237 "sql_yacc.yy" +#line 8239 "sql_yacc.yy" {} break; case 1562: -#line 8238 "sql_yacc.yy" +#line 8240 "sql_yacc.yy" {} break; case 1563: -#line 8239 "sql_yacc.yy" +#line 8241 "sql_yacc.yy" {} break; case 1564: -#line 8240 "sql_yacc.yy" +#line 8242 "sql_yacc.yy" {} break; case 1565: -#line 8241 "sql_yacc.yy" +#line 8243 "sql_yacc.yy" {} break; case 1566: -#line 8242 "sql_yacc.yy" +#line 8244 "sql_yacc.yy" {} break; case 1567: -#line 8243 "sql_yacc.yy" +#line 8245 "sql_yacc.yy" {} break; case 1568: -#line 8244 "sql_yacc.yy" +#line 8246 "sql_yacc.yy" {} break; case 1569: -#line 8245 "sql_yacc.yy" +#line 8247 "sql_yacc.yy" {} break; case 1570: -#line 8246 "sql_yacc.yy" +#line 8248 "sql_yacc.yy" {} break; case 1571: -#line 8247 "sql_yacc.yy" +#line 8249 "sql_yacc.yy" {} break; case 1572: -#line 8248 "sql_yacc.yy" +#line 8250 "sql_yacc.yy" {} break; case 1573: -#line 8249 "sql_yacc.yy" +#line 8251 "sql_yacc.yy" {} break; case 1574: -#line 8250 "sql_yacc.yy" +#line 8252 "sql_yacc.yy" {} break; case 1575: -#line 8251 "sql_yacc.yy" +#line 8253 "sql_yacc.yy" {} break; case 1576: -#line 8252 "sql_yacc.yy" +#line 8254 "sql_yacc.yy" {} break; case 1577: -#line 8253 "sql_yacc.yy" +#line 8255 "sql_yacc.yy" {} break; case 1578: -#line 8254 "sql_yacc.yy" +#line 8256 "sql_yacc.yy" {} break; case 1579: -#line 8255 "sql_yacc.yy" +#line 8257 "sql_yacc.yy" {} break; case 1580: -#line 8256 "sql_yacc.yy" +#line 8258 "sql_yacc.yy" {} break; case 1581: -#line 8257 "sql_yacc.yy" +#line 8259 "sql_yacc.yy" {} break; case 1582: -#line 8258 "sql_yacc.yy" +#line 8260 "sql_yacc.yy" {} break; case 1583: -#line 8268 "sql_yacc.yy" +#line 8270 "sql_yacc.yy" {} break; case 1584: -#line 8269 "sql_yacc.yy" +#line 8271 "sql_yacc.yy" {} break; case 1585: -#line 8270 "sql_yacc.yy" +#line 8272 "sql_yacc.yy" {} break; case 1586: -#line 8271 "sql_yacc.yy" +#line 8273 "sql_yacc.yy" {} break; case 1587: -#line 8272 "sql_yacc.yy" +#line 8274 "sql_yacc.yy" {} break; case 1588: -#line 8273 "sql_yacc.yy" +#line 8275 "sql_yacc.yy" {} break; case 1589: -#line 8274 "sql_yacc.yy" +#line 8276 "sql_yacc.yy" {} break; case 1590: -#line 8275 "sql_yacc.yy" +#line 8277 "sql_yacc.yy" {} break; case 1591: -#line 8276 "sql_yacc.yy" +#line 8278 "sql_yacc.yy" {} break; case 1592: -#line 8277 "sql_yacc.yy" +#line 8279 "sql_yacc.yy" {} break; case 1593: -#line 8278 "sql_yacc.yy" +#line 8280 "sql_yacc.yy" {} break; case 1594: -#line 8279 "sql_yacc.yy" +#line 8281 "sql_yacc.yy" {} break; case 1595: -#line 8280 "sql_yacc.yy" +#line 8282 "sql_yacc.yy" {} break; case 1596: -#line 8281 "sql_yacc.yy" +#line 8283 "sql_yacc.yy" {} break; case 1597: -#line 8282 "sql_yacc.yy" +#line 8284 "sql_yacc.yy" {} break; case 1598: -#line 8283 "sql_yacc.yy" +#line 8285 "sql_yacc.yy" {} break; case 1599: -#line 8284 "sql_yacc.yy" +#line 8286 "sql_yacc.yy" {} break; case 1600: -#line 8285 "sql_yacc.yy" +#line 8287 "sql_yacc.yy" {} break; case 1601: -#line 8286 "sql_yacc.yy" +#line 8288 "sql_yacc.yy" {} break; case 1602: -#line 8287 "sql_yacc.yy" +#line 8289 "sql_yacc.yy" {} break; case 1603: -#line 8288 "sql_yacc.yy" +#line 8290 "sql_yacc.yy" {} break; case 1604: -#line 8289 "sql_yacc.yy" +#line 8291 "sql_yacc.yy" {} break; case 1605: -#line 8290 "sql_yacc.yy" +#line 8292 "sql_yacc.yy" {} break; case 1606: -#line 8291 "sql_yacc.yy" +#line 8293 "sql_yacc.yy" {} break; case 1607: -#line 8292 "sql_yacc.yy" +#line 8294 "sql_yacc.yy" {} break; case 1608: -#line 8293 "sql_yacc.yy" +#line 8295 "sql_yacc.yy" {} break; case 1609: -#line 8294 "sql_yacc.yy" +#line 8296 "sql_yacc.yy" {} break; case 1610: -#line 8295 "sql_yacc.yy" +#line 8297 "sql_yacc.yy" {} break; case 1611: -#line 8296 "sql_yacc.yy" +#line 8298 "sql_yacc.yy" {} break; case 1612: -#line 8297 "sql_yacc.yy" +#line 8299 "sql_yacc.yy" {} break; case 1613: -#line 8298 "sql_yacc.yy" +#line 8300 "sql_yacc.yy" {} break; case 1614: -#line 8299 "sql_yacc.yy" +#line 8301 "sql_yacc.yy" {} break; case 1615: -#line 8300 "sql_yacc.yy" +#line 8302 "sql_yacc.yy" {} break; case 1616: -#line 8301 "sql_yacc.yy" +#line 8303 "sql_yacc.yy" {} break; case 1617: -#line 8302 "sql_yacc.yy" +#line 8304 "sql_yacc.yy" {} break; case 1618: -#line 8303 "sql_yacc.yy" +#line 8305 "sql_yacc.yy" {} break; case 1619: -#line 8304 "sql_yacc.yy" +#line 8306 "sql_yacc.yy" {} break; case 1620: -#line 8305 "sql_yacc.yy" +#line 8307 "sql_yacc.yy" {} break; case 1621: -#line 8306 "sql_yacc.yy" +#line 8308 "sql_yacc.yy" {} break; case 1622: -#line 8307 "sql_yacc.yy" +#line 8309 "sql_yacc.yy" {} break; case 1623: -#line 8308 "sql_yacc.yy" +#line 8310 "sql_yacc.yy" {} break; case 1624: -#line 8309 "sql_yacc.yy" +#line 8311 "sql_yacc.yy" {} break; case 1625: -#line 8310 "sql_yacc.yy" +#line 8312 "sql_yacc.yy" {} break; case 1626: -#line 8311 "sql_yacc.yy" +#line 8313 "sql_yacc.yy" {} break; case 1627: -#line 8312 "sql_yacc.yy" +#line 8314 "sql_yacc.yy" {} break; case 1628: -#line 8313 "sql_yacc.yy" +#line 8315 "sql_yacc.yy" {} break; case 1629: -#line 8314 "sql_yacc.yy" +#line 8316 "sql_yacc.yy" {} break; case 1630: -#line 8315 "sql_yacc.yy" +#line 8317 "sql_yacc.yy" {} break; case 1631: -#line 8316 "sql_yacc.yy" +#line 8318 "sql_yacc.yy" {} break; case 1632: -#line 8317 "sql_yacc.yy" +#line 8319 "sql_yacc.yy" {} break; case 1633: -#line 8318 "sql_yacc.yy" +#line 8320 "sql_yacc.yy" {} break; case 1634: -#line 8319 "sql_yacc.yy" +#line 8321 "sql_yacc.yy" {} break; case 1635: -#line 8320 "sql_yacc.yy" +#line 8322 "sql_yacc.yy" {} break; case 1636: -#line 8321 "sql_yacc.yy" +#line 8323 "sql_yacc.yy" {} break; case 1637: -#line 8322 "sql_yacc.yy" +#line 8324 "sql_yacc.yy" {} break; case 1638: -#line 8323 "sql_yacc.yy" +#line 8325 "sql_yacc.yy" {} break; case 1639: -#line 8324 "sql_yacc.yy" +#line 8326 "sql_yacc.yy" {} break; case 1640: -#line 8325 "sql_yacc.yy" +#line 8327 "sql_yacc.yy" {} break; case 1641: -#line 8326 "sql_yacc.yy" +#line 8328 "sql_yacc.yy" {} break; case 1642: -#line 8327 "sql_yacc.yy" +#line 8329 "sql_yacc.yy" {} break; case 1643: -#line 8328 "sql_yacc.yy" +#line 8330 "sql_yacc.yy" {} break; case 1644: -#line 8329 "sql_yacc.yy" +#line 8331 "sql_yacc.yy" {} break; case 1645: -#line 8330 "sql_yacc.yy" +#line 8332 "sql_yacc.yy" {} break; case 1646: -#line 8331 "sql_yacc.yy" +#line 8333 "sql_yacc.yy" {} break; case 1647: -#line 8332 "sql_yacc.yy" +#line 8334 "sql_yacc.yy" {} break; case 1648: -#line 8333 "sql_yacc.yy" +#line 8335 "sql_yacc.yy" {} break; case 1649: -#line 8334 "sql_yacc.yy" +#line 8336 "sql_yacc.yy" {} break; case 1650: -#line 8335 "sql_yacc.yy" +#line 8337 "sql_yacc.yy" {} break; case 1651: -#line 8336 "sql_yacc.yy" +#line 8338 "sql_yacc.yy" {} break; case 1652: -#line 8337 "sql_yacc.yy" +#line 8339 "sql_yacc.yy" {} break; case 1653: -#line 8338 "sql_yacc.yy" +#line 8340 "sql_yacc.yy" {} break; case 1654: -#line 8339 "sql_yacc.yy" +#line 8341 "sql_yacc.yy" {} break; case 1655: -#line 8340 "sql_yacc.yy" +#line 8342 "sql_yacc.yy" {} break; case 1656: -#line 8341 "sql_yacc.yy" +#line 8343 "sql_yacc.yy" {} break; case 1657: -#line 8342 "sql_yacc.yy" +#line 8344 "sql_yacc.yy" {} break; case 1658: -#line 8343 "sql_yacc.yy" +#line 8345 "sql_yacc.yy" {} break; case 1659: -#line 8344 "sql_yacc.yy" +#line 8346 "sql_yacc.yy" {} break; case 1660: -#line 8345 "sql_yacc.yy" +#line 8347 "sql_yacc.yy" {} break; case 1661: -#line 8346 "sql_yacc.yy" +#line 8348 "sql_yacc.yy" {} break; case 1662: -#line 8347 "sql_yacc.yy" +#line 8349 "sql_yacc.yy" {} break; case 1663: -#line 8348 "sql_yacc.yy" +#line 8350 "sql_yacc.yy" {} break; case 1664: -#line 8349 "sql_yacc.yy" +#line 8351 "sql_yacc.yy" {} break; case 1665: -#line 8350 "sql_yacc.yy" +#line 8352 "sql_yacc.yy" {} break; case 1666: -#line 8351 "sql_yacc.yy" +#line 8353 "sql_yacc.yy" {} break; case 1667: -#line 8352 "sql_yacc.yy" +#line 8354 "sql_yacc.yy" {} break; case 1668: -#line 8353 "sql_yacc.yy" +#line 8355 "sql_yacc.yy" {} break; case 1669: -#line 8354 "sql_yacc.yy" +#line 8356 "sql_yacc.yy" {} break; case 1670: -#line 8355 "sql_yacc.yy" +#line 8357 "sql_yacc.yy" {} break; case 1671: -#line 8356 "sql_yacc.yy" +#line 8358 "sql_yacc.yy" {} break; case 1672: -#line 8357 "sql_yacc.yy" +#line 8359 "sql_yacc.yy" {} break; case 1673: -#line 8358 "sql_yacc.yy" +#line 8360 "sql_yacc.yy" {} break; case 1674: -#line 8359 "sql_yacc.yy" +#line 8361 "sql_yacc.yy" {} break; case 1675: -#line 8360 "sql_yacc.yy" +#line 8362 "sql_yacc.yy" {} break; case 1676: -#line 8361 "sql_yacc.yy" +#line 8363 "sql_yacc.yy" {} break; case 1677: -#line 8362 "sql_yacc.yy" +#line 8364 "sql_yacc.yy" {} break; case 1678: -#line 8363 "sql_yacc.yy" +#line 8365 "sql_yacc.yy" {} break; case 1679: -#line 8364 "sql_yacc.yy" +#line 8366 "sql_yacc.yy" {} break; case 1680: -#line 8365 "sql_yacc.yy" +#line 8367 "sql_yacc.yy" {} break; case 1681: -#line 8366 "sql_yacc.yy" +#line 8368 "sql_yacc.yy" {} break; case 1682: -#line 8367 "sql_yacc.yy" +#line 8369 "sql_yacc.yy" {} break; case 1683: -#line 8368 "sql_yacc.yy" +#line 8370 "sql_yacc.yy" {} break; case 1684: -#line 8369 "sql_yacc.yy" +#line 8371 "sql_yacc.yy" {} break; case 1685: -#line 8370 "sql_yacc.yy" +#line 8372 "sql_yacc.yy" {} break; case 1686: -#line 8371 "sql_yacc.yy" +#line 8373 "sql_yacc.yy" {} break; case 1687: -#line 8372 "sql_yacc.yy" +#line 8374 "sql_yacc.yy" {} break; case 1688: -#line 8373 "sql_yacc.yy" +#line 8375 "sql_yacc.yy" {} break; case 1689: -#line 8374 "sql_yacc.yy" +#line 8376 "sql_yacc.yy" {} break; case 1690: -#line 8375 "sql_yacc.yy" +#line 8377 "sql_yacc.yy" {} break; case 1691: -#line 8376 "sql_yacc.yy" +#line 8378 "sql_yacc.yy" {} break; case 1692: -#line 8377 "sql_yacc.yy" +#line 8379 "sql_yacc.yy" {} break; case 1693: -#line 8378 "sql_yacc.yy" +#line 8380 "sql_yacc.yy" {} break; case 1694: -#line 8379 "sql_yacc.yy" +#line 8381 "sql_yacc.yy" {} break; case 1695: -#line 8380 "sql_yacc.yy" +#line 8382 "sql_yacc.yy" {} break; case 1696: -#line 8381 "sql_yacc.yy" +#line 8383 "sql_yacc.yy" {} break; case 1697: -#line 8382 "sql_yacc.yy" +#line 8384 "sql_yacc.yy" {} break; case 1698: -#line 8383 "sql_yacc.yy" +#line 8385 "sql_yacc.yy" {} break; case 1699: -#line 8384 "sql_yacc.yy" +#line 8386 "sql_yacc.yy" {} break; case 1700: -#line 8385 "sql_yacc.yy" +#line 8387 "sql_yacc.yy" {} break; case 1701: -#line 8386 "sql_yacc.yy" +#line 8388 "sql_yacc.yy" {} break; case 1702: -#line 8387 "sql_yacc.yy" +#line 8389 "sql_yacc.yy" {} break; case 1703: -#line 8388 "sql_yacc.yy" +#line 8390 "sql_yacc.yy" {} break; case 1704: -#line 8389 "sql_yacc.yy" +#line 8391 "sql_yacc.yy" {} break; case 1705: -#line 8390 "sql_yacc.yy" +#line 8392 "sql_yacc.yy" {} break; case 1706: -#line 8391 "sql_yacc.yy" +#line 8393 "sql_yacc.yy" {} break; case 1707: -#line 8392 "sql_yacc.yy" +#line 8394 "sql_yacc.yy" {} break; case 1708: -#line 8393 "sql_yacc.yy" +#line 8395 "sql_yacc.yy" {} break; case 1709: -#line 8394 "sql_yacc.yy" +#line 8396 "sql_yacc.yy" {} break; case 1710: -#line 8395 "sql_yacc.yy" +#line 8397 "sql_yacc.yy" {} break; case 1711: -#line 8396 "sql_yacc.yy" +#line 8398 "sql_yacc.yy" {} break; case 1712: -#line 8397 "sql_yacc.yy" +#line 8399 "sql_yacc.yy" {} break; case 1713: -#line 8398 "sql_yacc.yy" +#line 8400 "sql_yacc.yy" {} break; case 1714: -#line 8399 "sql_yacc.yy" +#line 8401 "sql_yacc.yy" {} break; case 1715: -#line 8400 "sql_yacc.yy" +#line 8402 "sql_yacc.yy" {} break; case 1716: -#line 8401 "sql_yacc.yy" +#line 8403 "sql_yacc.yy" {} break; case 1717: -#line 8402 "sql_yacc.yy" +#line 8404 "sql_yacc.yy" {} break; case 1718: -#line 8403 "sql_yacc.yy" +#line 8405 "sql_yacc.yy" {} break; case 1719: -#line 8404 "sql_yacc.yy" +#line 8406 "sql_yacc.yy" {} break; case 1720: -#line 8405 "sql_yacc.yy" +#line 8407 "sql_yacc.yy" {} break; case 1721: -#line 8406 "sql_yacc.yy" +#line 8408 "sql_yacc.yy" {} break; case 1722: -#line 8407 "sql_yacc.yy" +#line 8409 "sql_yacc.yy" {} break; case 1723: -#line 8408 "sql_yacc.yy" +#line 8410 "sql_yacc.yy" {} break; case 1724: -#line 8409 "sql_yacc.yy" +#line 8411 "sql_yacc.yy" {} break; case 1725: -#line 8410 "sql_yacc.yy" +#line 8412 "sql_yacc.yy" {} break; case 1726: -#line 8411 "sql_yacc.yy" +#line 8413 "sql_yacc.yy" {} break; case 1727: -#line 8412 "sql_yacc.yy" +#line 8414 "sql_yacc.yy" {} break; case 1728: -#line 8413 "sql_yacc.yy" +#line 8415 "sql_yacc.yy" {} break; case 1729: -#line 8414 "sql_yacc.yy" +#line 8416 "sql_yacc.yy" {} break; case 1730: -#line 8415 "sql_yacc.yy" +#line 8417 "sql_yacc.yy" {} break; case 1731: -#line 8416 "sql_yacc.yy" +#line 8418 "sql_yacc.yy" {} break; case 1732: -#line 8417 "sql_yacc.yy" +#line 8419 "sql_yacc.yy" {} break; case 1733: -#line 8418 "sql_yacc.yy" +#line 8420 "sql_yacc.yy" {} break; case 1734: -#line 8419 "sql_yacc.yy" +#line 8421 "sql_yacc.yy" {} break; case 1735: -#line 8420 "sql_yacc.yy" +#line 8422 "sql_yacc.yy" {} break; case 1736: -#line 8421 "sql_yacc.yy" +#line 8423 "sql_yacc.yy" {} break; case 1737: -#line 8422 "sql_yacc.yy" +#line 8424 "sql_yacc.yy" {} break; case 1738: -#line 8423 "sql_yacc.yy" +#line 8425 "sql_yacc.yy" {} break; case 1739: -#line 8424 "sql_yacc.yy" +#line 8426 "sql_yacc.yy" {} break; case 1740: -#line 8425 "sql_yacc.yy" +#line 8427 "sql_yacc.yy" {} break; case 1741: -#line 8426 "sql_yacc.yy" +#line 8428 "sql_yacc.yy" {} break; case 1742: -#line 8427 "sql_yacc.yy" +#line 8429 "sql_yacc.yy" {} break; case 1743: -#line 8428 "sql_yacc.yy" +#line 8430 "sql_yacc.yy" {} break; case 1744: -#line 8429 "sql_yacc.yy" +#line 8431 "sql_yacc.yy" {} break; case 1745: -#line 8430 "sql_yacc.yy" +#line 8432 "sql_yacc.yy" {} break; case 1746: -#line 8431 "sql_yacc.yy" +#line 8433 "sql_yacc.yy" {} break; case 1747: -#line 8432 "sql_yacc.yy" +#line 8434 "sql_yacc.yy" {} break; case 1748: -#line 8433 "sql_yacc.yy" +#line 8435 "sql_yacc.yy" {} break; case 1749: -#line 8434 "sql_yacc.yy" +#line 8436 "sql_yacc.yy" {} break; case 1750: -#line 8435 "sql_yacc.yy" +#line 8437 "sql_yacc.yy" {} break; case 1751: -#line 8436 "sql_yacc.yy" +#line 8438 "sql_yacc.yy" {} break; case 1752: -#line 8437 "sql_yacc.yy" +#line 8439 "sql_yacc.yy" {} break; case 1753: -#line 8438 "sql_yacc.yy" +#line 8440 "sql_yacc.yy" {} break; case 1754: -#line 8439 "sql_yacc.yy" +#line 8441 "sql_yacc.yy" {} break; case 1755: -#line 8440 "sql_yacc.yy" +#line 8442 "sql_yacc.yy" {} break; case 1756: -#line 8441 "sql_yacc.yy" +#line 8443 "sql_yacc.yy" {} break; case 1757: -#line 8442 "sql_yacc.yy" +#line 8444 "sql_yacc.yy" {} break; case 1758: -#line 8443 "sql_yacc.yy" +#line 8445 "sql_yacc.yy" {} break; case 1759: -#line 8444 "sql_yacc.yy" +#line 8446 "sql_yacc.yy" {} break; case 1760: -#line 8445 "sql_yacc.yy" +#line 8447 "sql_yacc.yy" {} break; case 1761: -#line 8446 "sql_yacc.yy" +#line 8448 "sql_yacc.yy" {} break; case 1762: -#line 8447 "sql_yacc.yy" +#line 8449 "sql_yacc.yy" {} break; case 1763: -#line 8448 "sql_yacc.yy" +#line 8450 "sql_yacc.yy" {} break; case 1764: -#line 8449 "sql_yacc.yy" +#line 8451 "sql_yacc.yy" {} break; case 1765: -#line 8450 "sql_yacc.yy" +#line 8452 "sql_yacc.yy" {} break; case 1766: -#line 8451 "sql_yacc.yy" +#line 8453 "sql_yacc.yy" {} break; case 1767: -#line 8452 "sql_yacc.yy" +#line 8454 "sql_yacc.yy" {} break; case 1768: -#line 8453 "sql_yacc.yy" +#line 8455 "sql_yacc.yy" {} break; case 1769: -#line 8454 "sql_yacc.yy" +#line 8456 "sql_yacc.yy" {} break; case 1770: -#line 8455 "sql_yacc.yy" +#line 8457 "sql_yacc.yy" {} break; case 1771: -#line 8456 "sql_yacc.yy" +#line 8458 "sql_yacc.yy" {} break; case 1772: -#line 8457 "sql_yacc.yy" +#line 8459 "sql_yacc.yy" {} break; case 1773: -#line 8458 "sql_yacc.yy" +#line 8460 "sql_yacc.yy" {} break; case 1774: -#line 8459 "sql_yacc.yy" +#line 8461 "sql_yacc.yy" {} break; case 1775: -#line 8460 "sql_yacc.yy" +#line 8462 "sql_yacc.yy" {} break; case 1776: -#line 8461 "sql_yacc.yy" +#line 8463 "sql_yacc.yy" {} break; case 1777: -#line 8462 "sql_yacc.yy" +#line 8464 "sql_yacc.yy" {} break; case 1778: -#line 8463 "sql_yacc.yy" +#line 8465 "sql_yacc.yy" {} break; case 1779: -#line 8464 "sql_yacc.yy" +#line 8466 "sql_yacc.yy" {} break; case 1780: -#line 8465 "sql_yacc.yy" +#line 8467 "sql_yacc.yy" {} break; case 1781: -#line 8466 "sql_yacc.yy" +#line 8468 "sql_yacc.yy" {} break; case 1782: -#line 8467 "sql_yacc.yy" +#line 8469 "sql_yacc.yy" {} break; case 1783: -#line 8468 "sql_yacc.yy" +#line 8470 "sql_yacc.yy" {} break; case 1784: -#line 8469 "sql_yacc.yy" +#line 8471 "sql_yacc.yy" {} break; case 1785: -#line 8470 "sql_yacc.yy" +#line 8472 "sql_yacc.yy" {} break; case 1786: -#line 8471 "sql_yacc.yy" +#line 8473 "sql_yacc.yy" {} break; case 1787: -#line 8472 "sql_yacc.yy" +#line 8474 "sql_yacc.yy" {} break; case 1788: -#line 8473 "sql_yacc.yy" +#line 8475 "sql_yacc.yy" {} break; case 1789: -#line 8474 "sql_yacc.yy" +#line 8476 "sql_yacc.yy" {} break; case 1790: -#line 8475 "sql_yacc.yy" +#line 8477 "sql_yacc.yy" {} break; case 1791: -#line 8476 "sql_yacc.yy" +#line 8478 "sql_yacc.yy" {} break; case 1792: -#line 8477 "sql_yacc.yy" +#line 8479 "sql_yacc.yy" {} break; case 1793: -#line 8478 "sql_yacc.yy" +#line 8480 "sql_yacc.yy" {} break; case 1794: -#line 8479 "sql_yacc.yy" +#line 8481 "sql_yacc.yy" {} break; case 1795: -#line 8480 "sql_yacc.yy" +#line 8482 "sql_yacc.yy" {} break; case 1796: -#line 8481 "sql_yacc.yy" +#line 8483 "sql_yacc.yy" {} break; case 1797: -#line 8482 "sql_yacc.yy" +#line 8484 "sql_yacc.yy" {} break; case 1798: -#line 8483 "sql_yacc.yy" +#line 8485 "sql_yacc.yy" {} break; case 1799: -#line 8484 "sql_yacc.yy" +#line 8486 "sql_yacc.yy" {} break; case 1800: -#line 8485 "sql_yacc.yy" +#line 8487 "sql_yacc.yy" {} break; case 1801: -#line 8486 "sql_yacc.yy" +#line 8488 "sql_yacc.yy" {} break; case 1802: -#line 8487 "sql_yacc.yy" +#line 8489 "sql_yacc.yy" {} break; case 1803: -#line 8488 "sql_yacc.yy" +#line 8490 "sql_yacc.yy" {} break; case 1804: -#line 8489 "sql_yacc.yy" +#line 8491 "sql_yacc.yy" {} break; case 1805: -#line 8490 "sql_yacc.yy" +#line 8492 "sql_yacc.yy" {} break; case 1806: -#line 8491 "sql_yacc.yy" +#line 8493 "sql_yacc.yy" {} break; case 1807: -#line 8492 "sql_yacc.yy" +#line 8494 "sql_yacc.yy" {} break; case 1808: -#line 8493 "sql_yacc.yy" +#line 8495 "sql_yacc.yy" {} break; case 1809: -#line 8494 "sql_yacc.yy" +#line 8496 "sql_yacc.yy" {} break; case 1810: -#line 8495 "sql_yacc.yy" +#line 8497 "sql_yacc.yy" {} break; case 1811: -#line 8496 "sql_yacc.yy" +#line 8498 "sql_yacc.yy" {} break; case 1812: -#line 8497 "sql_yacc.yy" +#line 8499 "sql_yacc.yy" {} break; case 1813: -#line 8498 "sql_yacc.yy" +#line 8500 "sql_yacc.yy" {} break; case 1814: -#line 8499 "sql_yacc.yy" +#line 8501 "sql_yacc.yy" {} break; case 1815: -#line 8500 "sql_yacc.yy" +#line 8502 "sql_yacc.yy" {} break; case 1816: -#line 8501 "sql_yacc.yy" +#line 8503 "sql_yacc.yy" {} break; case 1817: -#line 8502 "sql_yacc.yy" +#line 8504 "sql_yacc.yy" {} break; case 1818: -#line 8503 "sql_yacc.yy" +#line 8505 "sql_yacc.yy" {} break; case 1819: -#line 8510 "sql_yacc.yy" +#line 8512 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SET_OPTION; @@ -26113,22 +26448,22 @@ break; case 1820: -#line 8519 "sql_yacc.yy" +#line 8521 "sql_yacc.yy" {} break; case 1821: -#line 8523 "sql_yacc.yy" +#line 8525 "sql_yacc.yy" {} break; case 1822: -#line 8524 "sql_yacc.yy" +#line 8526 "sql_yacc.yy" {} break; case 1825: -#line 8531 "sql_yacc.yy" +#line 8533 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26161,7 +26496,7 @@ break; case 1826: -#line 8561 "sql_yacc.yy" +#line 8563 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26210,94 +26545,94 @@ break; case 1827: -#line 8608 "sql_yacc.yy" +#line 8610 "sql_yacc.yy" {} break; case 1828: -#line 8609 "sql_yacc.yy" - { yyval.var_type=OPT_GLOBAL; } +#line 8611 "sql_yacc.yy" + { (yyval.var_type)=OPT_GLOBAL; } break; case 1829: -#line 8610 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8612 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1830: -#line 8611 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8613 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1831: -#line 8615 "sql_yacc.yy" - { yyval.num= OPT_DEFAULT; } +#line 8617 "sql_yacc.yy" + { (yyval.num)= OPT_DEFAULT; } break; case 1832: -#line 8616 "sql_yacc.yy" - { Lex->one_shot_set= 1; yyval.num= OPT_SESSION; } +#line 8618 "sql_yacc.yy" + { Lex->one_shot_set= 1; (yyval.num)= OPT_SESSION; } break; case 1833: -#line 8620 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8622 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1834: -#line 8621 "sql_yacc.yy" - { yyval.var_type=OPT_GLOBAL; } +#line 8623 "sql_yacc.yy" + { (yyval.var_type)=OPT_GLOBAL; } break; case 1835: -#line 8622 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8624 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1836: -#line 8623 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8625 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1837: -#line 8627 "sql_yacc.yy" - { yyval.var_type=OPT_DEFAULT; } +#line 8629 "sql_yacc.yy" + { (yyval.var_type)=OPT_DEFAULT; } break; case 1838: -#line 8628 "sql_yacc.yy" - { yyval.var_type=OPT_GLOBAL; } +#line 8630 "sql_yacc.yy" + { (yyval.var_type)=OPT_GLOBAL; } break; case 1839: -#line 8629 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8631 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1840: -#line 8630 "sql_yacc.yy" - { yyval.var_type=OPT_SESSION; } +#line 8632 "sql_yacc.yy" + { (yyval.var_type)=OPT_SESSION; } break; case 1843: -#line 8639 "sql_yacc.yy" +#line 8641 "sql_yacc.yy" { LEX *lex=Lex; - if (yyvsp[-2].variable.var == &trg_new_row_fake_var) + if ((yyvsp[(2) - (4)].variable).var == &trg_new_row_fake_var) { /* We are in trigger and assigning value to field of new row */ Item *it; Item_trigger_field *trg_fld; sp_instr_set_trigger_field *sp_fld; LINT_INIT(sp_fld); - if (yyvsp[-3].var_type) + if ((yyvsp[(1) - (4)].var_type)) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } - if (yyvsp[0].item) - it= yyvsp[0].item; + if ((yyvsp[(4) - (4)].item)) + it= (yyvsp[(4) - (4)].item); else { /* QQ: Shouldn't this be field's default value ? */ @@ -26309,7 +26644,7 @@ lex->trg_chistics.event == TRG_EVENT_UPDATE)); if (!(trg_fld= new Item_trigger_field(Lex->current_context(), Item_trigger_field::NEW_ROW, - yyvsp[-2].variable.base_name.str, + (yyvsp[(2) - (4)].variable).base_name.str, UPDATE_ACL, FALSE)) || !(sp_fld= new sp_instr_set_trigger_field(lex->sphead-> instructions(), @@ -26327,12 +26662,12 @@ lex->sphead->add_instr(sp_fld); } - else if (yyvsp[-2].variable.var) + else if ((yyvsp[(2) - (4)].variable).var) { /* System variable */ - if (yyvsp[-3].var_type) - lex->option_type= yyvsp[-3].var_type; - lex->var_list.push_back(new set_var(lex->option_type, yyvsp[-2].variable.var, - &yyvsp[-2].variable.base_name, yyvsp[0].item)); + if ((yyvsp[(1) - (4)].var_type)) + lex->option_type= (yyvsp[(1) - (4)].var_type); + lex->var_list.push_back(new set_var(lex->option_type, (yyvsp[(2) - (4)].variable).var, + &(yyvsp[(2) - (4)].variable).base_name, (yyvsp[(4) - (4)].item))); } else { @@ -26341,16 +26676,16 @@ sp_variable_t *spv; sp_instr_set *sp_set; Item *it; - if (yyvsp[-3].var_type) + if ((yyvsp[(1) - (4)].var_type)) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } - spv= ctx->find_variable(&yyvsp[-2].variable.base_name); + spv= ctx->find_variable(&(yyvsp[(2) - (4)].variable).base_name); - if (yyvsp[0].item) - it= yyvsp[0].item; + if ((yyvsp[(4) - (4)].item)) + it= (yyvsp[(4) - (4)].item); else if (spv->dflt) it= spv->dflt; else @@ -26363,45 +26698,45 @@ break; case 1844: -#line 8719 "sql_yacc.yy" +#line 8721 "sql_yacc.yy" { LEX *lex=Lex; - if (yyvsp[-4].var_type) - lex->option_type= yyvsp[-4].var_type; + if ((yyvsp[(1) - (5)].var_type)) + lex->option_type= (yyvsp[(1) - (5)].var_type); lex->var_list.push_back(new set_var(lex->option_type, find_sys_var("tx_isolation"), &null_lex_str, - new Item_int((int32) yyvsp[0].tx_isolation))); + new Item_int((int32) (yyvsp[(5) - (5)].tx_isolation)))); } break; case 1845: -#line 8732 "sql_yacc.yy" +#line 8734 "sql_yacc.yy" { - Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var(yyvsp[-2].lex_str,yyvsp[0].item))); + Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var((yyvsp[(2) - (4)].lex_str),(yyvsp[(4) - (4)].item)))); } break; case 1846: -#line 8736 "sql_yacc.yy" +#line 8738 "sql_yacc.yy" { LEX *lex=Lex; - lex->var_list.push_back(new set_var(yyvsp[-3].var_type, yyvsp[-2].variable.var, &yyvsp[-2].variable.base_name, yyvsp[0].item)); + lex->var_list.push_back(new set_var((yyvsp[(3) - (6)].var_type), (yyvsp[(4) - (6)].variable).var, &(yyvsp[(4) - (6)].variable).base_name, (yyvsp[(6) - (6)].item))); } break; case 1847: -#line 8741 "sql_yacc.yy" +#line 8743 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; - yyvsp[0].charset= yyvsp[0].charset ? yyvsp[0].charset: global_system_variables.character_set_client; - lex->var_list.push_back(new set_var_collation_client(yyvsp[0].charset,thd->variables.collation_database,yyvsp[0].charset)); + (yyvsp[(2) - (2)].charset)= (yyvsp[(2) - (2)].charset) ? (yyvsp[(2) - (2)].charset): global_system_variables.character_set_client; + lex->var_list.push_back(new set_var_collation_client((yyvsp[(2) - (2)].charset),thd->variables.collation_database,(yyvsp[(2) - (2)].charset))); } break; case 1848: -#line 8748 "sql_yacc.yy" +#line 8750 "sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; @@ -26419,23 +26754,23 @@ break; case 1849: -#line 8763 "sql_yacc.yy" +#line 8765 "sql_yacc.yy" { LEX *lex= Lex; - yyvsp[-1].charset= yyvsp[-1].charset ? yyvsp[-1].charset : global_system_variables.character_set_client; - yyvsp[0].charset= yyvsp[0].charset ? yyvsp[0].charset : yyvsp[-1].charset; - if (!my_charset_same(yyvsp[-1].charset,yyvsp[0].charset)) + (yyvsp[(2) - (3)].charset)= (yyvsp[(2) - (3)].charset) ? (yyvsp[(2) - (3)].charset) : global_system_variables.character_set_client; + (yyvsp[(3) - (3)].charset)= (yyvsp[(3) - (3)].charset) ? (yyvsp[(3) - (3)].charset) : (yyvsp[(2) - (3)].charset); + if (!my_charset_same((yyvsp[(2) - (3)].charset),(yyvsp[(3) - (3)].charset))) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - yyvsp[0].charset->name, yyvsp[-1].charset->csname); + (yyvsp[(3) - (3)].charset)->name, (yyvsp[(2) - (3)].charset)->csname); MYSQL_YYABORT; } - lex->var_list.push_back(new set_var_collation_client(yyvsp[0].charset,yyvsp[0].charset,yyvsp[0].charset)); + lex->var_list.push_back(new set_var_collation_client((yyvsp[(3) - (3)].charset),(yyvsp[(3) - (3)].charset),(yyvsp[(3) - (3)].charset))); } break; case 1850: -#line 8776 "sql_yacc.yy" +#line 8778 "sql_yacc.yy" { THD *thd=YYTHD; LEX_USER *user; @@ -26454,33 +26789,33 @@ MYSQL_YYABORT; user->host=null_lex_str; user->user.str=thd->security_ctx->priv_user; - thd->lex->var_list.push_back(new set_var_password(user, yyvsp[0].simple_string)); + thd->lex->var_list.push_back(new set_var_password(user, (yyvsp[(3) - (3)].simple_string))); } break; case 1851: -#line 8797 "sql_yacc.yy" +#line 8799 "sql_yacc.yy" { - Lex->var_list.push_back(new set_var_password(yyvsp[-2].lex_user,yyvsp[0].simple_string)); + Lex->var_list.push_back(new set_var_password((yyvsp[(3) - (5)].lex_user),(yyvsp[(5) - (5)].simple_string))); } break; case 1852: -#line 8804 "sql_yacc.yy" +#line 8806 "sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; sp_variable_t *spv; /* We have to lookup here since local vars can shadow sysvars */ - if (!spc || !(spv = spc->find_variable(&yyvsp[0].lex_str))) + if (!spc || !(spv = spc->find_variable(&(yyvsp[(1) - (1)].lex_str)))) { /* Not an SP local variable */ - sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + sys_var *tmp=find_sys_var((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (!tmp) MYSQL_YYABORT; - yyval.variable.var= tmp; - yyval.variable.base_name= null_lex_str; + (yyval.variable).var= tmp; + (yyval.variable).base_name= null_lex_str; /* If this is time_zone variable we should open time zone describing tables @@ -26500,26 +26835,26 @@ else { /* An SP local variable */ - yyval.variable.var= NULL; - yyval.variable.base_name= yyvsp[0].lex_str; + (yyval.variable).var= NULL; + (yyval.variable).base_name= (yyvsp[(1) - (1)].lex_str); } } break; case 1853: -#line 8842 "sql_yacc.yy" +#line 8844 "sql_yacc.yy" { LEX *lex= Lex; - if (check_reserved_words(&yyvsp[-2].lex_str)) + if (check_reserved_words(&(yyvsp[(1) - (3)].lex_str))) { my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; } if (lex->sphead && lex->sphead->m_type == TYPE_ENUM_TRIGGER && - (!my_strcasecmp(system_charset_info, yyvsp[-2].lex_str.str, "NEW") || - !my_strcasecmp(system_charset_info, yyvsp[-2].lex_str.str, "OLD"))) + (!my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "NEW") || + !my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "OLD"))) { - if (yyvsp[-2].lex_str.str[0]=='O' || yyvsp[-2].lex_str.str[0]=='o') + if ((yyvsp[(1) - (3)].lex_str).str[0]=='O' || (yyvsp[(1) - (3)].lex_str).str[0]=='o') { my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "OLD", ""); MYSQL_YYABORT; @@ -26536,106 +26871,106 @@ MYSQL_YYABORT; } /* This special combination will denote field of NEW row */ - yyval.variable.var= &trg_new_row_fake_var; - yyval.variable.base_name= yyvsp[0].lex_str; + (yyval.variable).var= &trg_new_row_fake_var; + (yyval.variable).base_name= (yyvsp[(3) - (3)].lex_str); } else { - sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + sys_var *tmp=find_sys_var((yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length); if (!tmp) MYSQL_YYABORT; if (!tmp->is_struct()) - my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), yyvsp[0].lex_str.str); - yyval.variable.var= tmp; - yyval.variable.base_name= yyvsp[-2].lex_str; + my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), (yyvsp[(3) - (3)].lex_str).str); + (yyval.variable).var= tmp; + (yyval.variable).base_name= (yyvsp[(1) - (3)].lex_str); } } break; case 1854: -#line 8885 "sql_yacc.yy" +#line 8887 "sql_yacc.yy" { - sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); + sys_var *tmp=find_sys_var((yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length); if (!tmp) MYSQL_YYABORT; if (!tmp->is_struct()) - my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), yyvsp[0].lex_str.str); - yyval.variable.var= tmp; - yyval.variable.base_name.str= (char*) "default"; - yyval.variable.base_name.length= 7; + my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), (yyvsp[(3) - (3)].lex_str).str); + (yyval.variable).var= tmp; + (yyval.variable).base_name.str= (char*) "default"; + (yyval.variable).base_name.length= 7; } break; case 1855: -#line 8898 "sql_yacc.yy" - { yyval.tx_isolation= ISO_READ_UNCOMMITTED; } +#line 8900 "sql_yacc.yy" + { (yyval.tx_isolation)= ISO_READ_UNCOMMITTED; } break; case 1856: -#line 8899 "sql_yacc.yy" - { yyval.tx_isolation= ISO_READ_COMMITTED; } +#line 8901 "sql_yacc.yy" + { (yyval.tx_isolation)= ISO_READ_COMMITTED; } break; case 1857: -#line 8900 "sql_yacc.yy" - { yyval.tx_isolation= ISO_REPEATABLE_READ; } +#line 8902 "sql_yacc.yy" + { (yyval.tx_isolation)= ISO_REPEATABLE_READ; } break; case 1858: -#line 8901 "sql_yacc.yy" - { yyval.tx_isolation= ISO_SERIALIZABLE; } +#line 8903 "sql_yacc.yy" + { (yyval.tx_isolation)= ISO_SERIALIZABLE; } break; case 1859: -#line 8905 "sql_yacc.yy" - { yyval.simple_string=yyvsp[0].lex_str.str;} +#line 8907 "sql_yacc.yy" + { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str;} break; case 1860: -#line 8907 "sql_yacc.yy" +#line 8909 "sql_yacc.yy" { - yyval.simple_string= yyvsp[-1].lex_str.length ? YYTHD->variables.old_passwords ? - Item_func_old_password::alloc(YYTHD, yyvsp[-1].lex_str.str) : - Item_func_password::alloc(YYTHD, yyvsp[-1].lex_str.str) : - yyvsp[-1].lex_str.str; + (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? YYTHD->variables.old_passwords ? + Item_func_old_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : + Item_func_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : + (yyvsp[(3) - (4)].lex_str).str; } break; case 1861: -#line 8914 "sql_yacc.yy" +#line 8916 "sql_yacc.yy" { - yyval.simple_string= yyvsp[-1].lex_str.length ? Item_func_old_password::alloc(YYTHD, yyvsp[-1].lex_str.str) : - yyvsp[-1].lex_str.str; + (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? Item_func_old_password::alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str) : + (yyvsp[(3) - (4)].lex_str).str; } break; case 1862: -#line 8922 "sql_yacc.yy" - { yyval.item=yyvsp[0].item; } +#line 8924 "sql_yacc.yy" + { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1863: -#line 8923 "sql_yacc.yy" - { yyval.item=0; } +#line 8925 "sql_yacc.yy" + { (yyval.item)=0; } break; case 1864: -#line 8924 "sql_yacc.yy" - { yyval.item=new Item_string("ON", 2, system_charset_info); } +#line 8926 "sql_yacc.yy" + { (yyval.item)=new Item_string("ON", 2, system_charset_info); } break; case 1865: -#line 8925 "sql_yacc.yy" - { yyval.item=new Item_string("ALL", 3, system_charset_info); } +#line 8927 "sql_yacc.yy" + { (yyval.item)=new Item_string("ALL", 3, system_charset_info); } break; case 1866: -#line 8926 "sql_yacc.yy" - { yyval.item=new Item_string("binary", 6, system_charset_info); } +#line 8928 "sql_yacc.yy" + { (yyval.item)=new Item_string("binary", 6, system_charset_info); } break; case 1867: -#line 8934 "sql_yacc.yy" +#line 8936 "sql_yacc.yy" { LEX *lex= Lex; @@ -26649,40 +26984,40 @@ break; case 1868: -#line 8945 "sql_yacc.yy" +#line 8947 "sql_yacc.yy" {} break; case 1873: -#line 8958 "sql_yacc.yy" +#line 8960 "sql_yacc.yy" { - if (!Select->add_table_to_list(YYTHD, yyvsp[-2].table, yyvsp[-1].lex_str_ptr, 0, (thr_lock_type) yyvsp[0].num)) + if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), (yyvsp[(2) - (3)].lex_str_ptr), 0, (thr_lock_type) (yyvsp[(3) - (3)].num))) MYSQL_YYABORT; } break; case 1874: -#line 8965 "sql_yacc.yy" - { yyval.num=TL_READ_NO_INSERT; } +#line 8967 "sql_yacc.yy" + { (yyval.num)=TL_READ_NO_INSERT; } break; case 1875: -#line 8966 "sql_yacc.yy" - { yyval.num=TL_WRITE_DEFAULT; } +#line 8968 "sql_yacc.yy" + { (yyval.num)=TL_WRITE_DEFAULT; } break; case 1876: -#line 8967 "sql_yacc.yy" - { yyval.num=TL_WRITE_LOW_PRIORITY; } +#line 8969 "sql_yacc.yy" + { (yyval.num)=TL_WRITE_LOW_PRIORITY; } break; case 1877: -#line 8968 "sql_yacc.yy" - { yyval.num= TL_READ; } +#line 8970 "sql_yacc.yy" + { (yyval.num)= TL_READ; } break; case 1878: -#line 8973 "sql_yacc.yy" +#line 8975 "sql_yacc.yy" { LEX *lex= Lex; @@ -26696,12 +27031,12 @@ break; case 1879: -#line 8984 "sql_yacc.yy" +#line 8986 "sql_yacc.yy" {} break; case 1880: -#line 8994 "sql_yacc.yy" +#line 8996 "sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26710,13 +27045,13 @@ MYSQL_YYABORT; } lex->sql_command = SQLCOM_HA_OPEN; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-2].table, yyvsp[0].lex_str_ptr, 0)) + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(2) - (4)].table), (yyvsp[(4) - (4)].lex_str_ptr), 0)) MYSQL_YYABORT; } break; case 1881: -#line 9006 "sql_yacc.yy" +#line 9008 "sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26725,13 +27060,13 @@ MYSQL_YYABORT; } lex->sql_command = SQLCOM_HA_CLOSE; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, 0, 0)) + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(2) - (3)].table), 0, 0)) MYSQL_YYABORT; } break; case 1882: -#line 9018 "sql_yacc.yy" +#line 9020 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -26743,104 +27078,104 @@ lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */ lex->current_select->select_limit= new Item_int((int32) 1); lex->current_select->offset_limit= 0; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, 0, 0)) + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(2) - (3)].table), 0, 0)) MYSQL_YYABORT; } break; case 1883: -#line 9032 "sql_yacc.yy" +#line 9034 "sql_yacc.yy" {} break; case 1884: -#line 9036 "sql_yacc.yy" +#line 9038 "sql_yacc.yy" { Lex->ident= null_lex_str; } break; case 1885: -#line 9037 "sql_yacc.yy" - { Lex->ident= yyvsp[-1].lex_str; } +#line 9039 "sql_yacc.yy" + { Lex->ident= (yyvsp[(1) - (2)].lex_str); } break; case 1886: -#line 9041 "sql_yacc.yy" +#line 9043 "sql_yacc.yy" { Lex->ha_read_mode = RFIRST; } break; case 1887: -#line 9042 "sql_yacc.yy" +#line 9044 "sql_yacc.yy" { Lex->ha_read_mode = RNEXT; } break; case 1888: -#line 9046 "sql_yacc.yy" +#line 9048 "sql_yacc.yy" { Lex->ha_read_mode = RFIRST; } break; case 1889: -#line 9047 "sql_yacc.yy" +#line 9049 "sql_yacc.yy" { Lex->ha_read_mode = RNEXT; } break; case 1890: -#line 9048 "sql_yacc.yy" +#line 9050 "sql_yacc.yy" { Lex->ha_read_mode = RPREV; } break; case 1891: -#line 9049 "sql_yacc.yy" +#line 9051 "sql_yacc.yy" { Lex->ha_read_mode = RLAST; } break; case 1892: -#line 9051 "sql_yacc.yy" +#line 9053 "sql_yacc.yy" { LEX *lex=Lex; lex->ha_read_mode = RKEY; - lex->ha_rkey_mode=yyvsp[0].ha_rkey_mode; + lex->ha_rkey_mode=(yyvsp[(1) - (1)].ha_rkey_mode); if (!(lex->insert_list = new List_item)) MYSQL_YYABORT; } break; case 1893: -#line 9057 "sql_yacc.yy" +#line 9059 "sql_yacc.yy" { } break; case 1894: -#line 9061 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_KEY_EXACT; } +#line 9063 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_KEY_EXACT; } break; case 1895: -#line 9062 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_KEY_OR_NEXT; } +#line 9064 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_NEXT; } break; case 1896: -#line 9063 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_KEY_OR_PREV; } +#line 9065 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_PREV; } break; case 1897: -#line 9064 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_AFTER_KEY; } +#line 9066 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_AFTER_KEY; } break; case 1898: -#line 9065 "sql_yacc.yy" - { yyval.ha_rkey_mode=HA_READ_BEFORE_KEY; } +#line 9067 "sql_yacc.yy" + { (yyval.ha_rkey_mode)=HA_READ_BEFORE_KEY; } break; case 1899: -#line 9072 "sql_yacc.yy" +#line 9074 "sql_yacc.yy" {} break; case 1900: -#line 9077 "sql_yacc.yy" +#line 9079 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_REVOKE; @@ -26849,7 +27184,7 @@ break; case 1901: -#line 9084 "sql_yacc.yy" +#line 9086 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -26864,7 +27199,7 @@ break; case 1902: -#line 9097 "sql_yacc.yy" +#line 9099 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -26878,19 +27213,19 @@ break; case 1903: -#line 9109 "sql_yacc.yy" +#line 9111 "sql_yacc.yy" { Lex->sql_command = SQLCOM_REVOKE_ALL; } break; case 1904: -#line 9116 "sql_yacc.yy" +#line 9118 "sql_yacc.yy" {} break; case 1905: -#line 9122 "sql_yacc.yy" +#line 9124 "sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_GRANT; @@ -26899,7 +27234,7 @@ break; case 1906: -#line 9130 "sql_yacc.yy" +#line 9132 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -26913,7 +27248,7 @@ break; case 1907: -#line 9143 "sql_yacc.yy" +#line 9145 "sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -26927,12 +27262,12 @@ break; case 1910: -#line 9160 "sql_yacc.yy" +#line 9162 "sql_yacc.yy" { } break; case 1911: -#line 9162 "sql_yacc.yy" +#line 9164 "sql_yacc.yy" { Lex->all_privileges= 1; Lex->grant= GLOBAL_ACLS; @@ -26940,172 +27275,172 @@ break; case 1916: -#line 9178 "sql_yacc.yy" +#line 9180 "sql_yacc.yy" { Lex->which_columns = SELECT_ACL;} break; case 1917: -#line 9178 "sql_yacc.yy" +#line 9180 "sql_yacc.yy" {} break; case 1918: -#line 9179 "sql_yacc.yy" +#line 9181 "sql_yacc.yy" { Lex->which_columns = INSERT_ACL;} break; case 1919: -#line 9179 "sql_yacc.yy" +#line 9181 "sql_yacc.yy" {} break; case 1920: -#line 9180 "sql_yacc.yy" +#line 9182 "sql_yacc.yy" { Lex->which_columns = UPDATE_ACL; } break; case 1921: -#line 9180 "sql_yacc.yy" +#line 9182 "sql_yacc.yy" {} break; case 1922: -#line 9181 "sql_yacc.yy" +#line 9183 "sql_yacc.yy" { Lex->which_columns = REFERENCES_ACL;} break; case 1923: -#line 9181 "sql_yacc.yy" +#line 9183 "sql_yacc.yy" {} break; case 1924: -#line 9182 "sql_yacc.yy" +#line 9184 "sql_yacc.yy" { Lex->grant |= DELETE_ACL;} break; case 1925: -#line 9183 "sql_yacc.yy" +#line 9185 "sql_yacc.yy" {} break; case 1926: -#line 9184 "sql_yacc.yy" +#line 9186 "sql_yacc.yy" { Lex->grant |= INDEX_ACL;} break; case 1927: -#line 9185 "sql_yacc.yy" +#line 9187 "sql_yacc.yy" { Lex->grant |= ALTER_ACL;} break; case 1928: -#line 9186 "sql_yacc.yy" +#line 9188 "sql_yacc.yy" { Lex->grant |= CREATE_ACL;} break; case 1929: -#line 9187 "sql_yacc.yy" +#line 9189 "sql_yacc.yy" { Lex->grant |= DROP_ACL;} break; case 1930: -#line 9188 "sql_yacc.yy" +#line 9190 "sql_yacc.yy" { Lex->grant |= EXECUTE_ACL;} break; case 1931: -#line 9189 "sql_yacc.yy" +#line 9191 "sql_yacc.yy" { Lex->grant |= RELOAD_ACL;} break; case 1932: -#line 9190 "sql_yacc.yy" +#line 9192 "sql_yacc.yy" { Lex->grant |= SHUTDOWN_ACL;} break; case 1933: -#line 9191 "sql_yacc.yy" +#line 9193 "sql_yacc.yy" { Lex->grant |= PROCESS_ACL;} break; case 1934: -#line 9192 "sql_yacc.yy" +#line 9194 "sql_yacc.yy" { Lex->grant |= FILE_ACL;} break; case 1935: -#line 9193 "sql_yacc.yy" +#line 9195 "sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 1936: -#line 9194 "sql_yacc.yy" +#line 9196 "sql_yacc.yy" { Lex->grant |= SHOW_DB_ACL;} break; case 1937: -#line 9195 "sql_yacc.yy" +#line 9197 "sql_yacc.yy" { Lex->grant |= SUPER_ACL;} break; case 1938: -#line 9196 "sql_yacc.yy" +#line 9198 "sql_yacc.yy" { Lex->grant |= CREATE_TMP_ACL;} break; case 1939: -#line 9197 "sql_yacc.yy" +#line 9199 "sql_yacc.yy" { Lex->grant |= LOCK_TABLES_ACL; } break; case 1940: -#line 9198 "sql_yacc.yy" +#line 9200 "sql_yacc.yy" { Lex->grant |= REPL_SLAVE_ACL; } break; case 1941: -#line 9199 "sql_yacc.yy" +#line 9201 "sql_yacc.yy" { Lex->grant |= REPL_CLIENT_ACL; } break; case 1942: -#line 9200 "sql_yacc.yy" +#line 9202 "sql_yacc.yy" { Lex->grant |= CREATE_VIEW_ACL; } break; case 1943: -#line 9201 "sql_yacc.yy" +#line 9203 "sql_yacc.yy" { Lex->grant |= SHOW_VIEW_ACL; } break; case 1944: -#line 9202 "sql_yacc.yy" +#line 9204 "sql_yacc.yy" { Lex->grant |= CREATE_PROC_ACL; } break; case 1945: -#line 9203 "sql_yacc.yy" +#line 9205 "sql_yacc.yy" { Lex->grant |= ALTER_PROC_ACL; } break; case 1946: -#line 9204 "sql_yacc.yy" +#line 9206 "sql_yacc.yy" { Lex->grant |= CREATE_USER_ACL; } break; case 1947: -#line 9209 "sql_yacc.yy" +#line 9211 "sql_yacc.yy" {} break; case 1948: -#line 9210 "sql_yacc.yy" +#line 9212 "sql_yacc.yy" {} break; case 1951: -#line 9220 "sql_yacc.yy" +#line 9222 "sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_subject) @@ -27113,12 +27448,12 @@ my_error(ER_DUP_ARGUMENT, MYF(0), "SUBJECT"); MYSQL_YYABORT; } - lex->x509_subject=yyvsp[0].lex_str.str; + lex->x509_subject=(yyvsp[(2) - (2)].lex_str).str; } break; case 1952: -#line 9230 "sql_yacc.yy" +#line 9232 "sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_issuer) @@ -27126,12 +27461,12 @@ my_error(ER_DUP_ARGUMENT, MYF(0), "ISSUER"); MYSQL_YYABORT; } - lex->x509_issuer=yyvsp[0].lex_str.str; + lex->x509_issuer=(yyvsp[(2) - (2)].lex_str).str; } break; case 1953: -#line 9240 "sql_yacc.yy" +#line 9242 "sql_yacc.yy" { LEX *lex=Lex; if (lex->ssl_cipher) @@ -27139,12 +27474,12 @@ my_error(ER_DUP_ARGUMENT, MYF(0), "CIPHER"); MYSQL_YYABORT; } - lex->ssl_cipher=yyvsp[0].lex_str.str; + lex->ssl_cipher=(yyvsp[(2) - (2)].lex_str).str; } break; case 1954: -#line 9253 "sql_yacc.yy" +#line 9255 "sql_yacc.yy" { LEX *lex= Lex; THD *thd= lex->thd; @@ -27162,10 +27497,10 @@ break; case 1955: -#line 9268 "sql_yacc.yy" +#line 9270 "sql_yacc.yy" { LEX *lex= Lex; - lex->current_select->db = yyvsp[-2].lex_str.str; + lex->current_select->db = (yyvsp[(1) - (3)].lex_str).str; if (lex->grant == GLOBAL_ACLS) lex->grant = DB_ACLS & ~GRANT_ACL; else if (lex->columns.elements) @@ -27178,7 +27513,7 @@ break; case 1956: -#line 9281 "sql_yacc.yy" +#line 9283 "sql_yacc.yy" { LEX *lex= Lex; lex->current_select->db = NULL; @@ -27194,10 +27529,10 @@ break; case 1957: -#line 9294 "sql_yacc.yy" +#line 9296 "sql_yacc.yy" { LEX *lex=Lex; - if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[0].table,NULL, + if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(1) - (1)].table),NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; if (lex->grant == GLOBAL_ACLS) @@ -27206,71 +27541,71 @@ break; case 1958: -#line 9306 "sql_yacc.yy" - { if (Lex->users_list.push_back(yyvsp[0].lex_user)) MYSQL_YYABORT;} +#line 9308 "sql_yacc.yy" + { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT;} break; case 1959: -#line 9308 "sql_yacc.yy" +#line 9310 "sql_yacc.yy" { - if (Lex->users_list.push_back(yyvsp[0].lex_user)) + if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; } break; case 1960: -#line 9316 "sql_yacc.yy" - { if (Lex->users_list.push_back(yyvsp[0].lex_user)) MYSQL_YYABORT;} +#line 9318 "sql_yacc.yy" + { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT;} break; case 1961: -#line 9318 "sql_yacc.yy" +#line 9320 "sql_yacc.yy" { - if (Lex->users_list.push_back(yyvsp[0].lex_user)) + if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; } break; case 1962: -#line 9327 "sql_yacc.yy" +#line 9329 "sql_yacc.yy" { - yyval.lex_user=yyvsp[-3].lex_user; yyvsp[-3].lex_user->password=yyvsp[0].lex_str; - if (yyvsp[0].lex_str.length) + (yyval.lex_user)=(yyvsp[(1) - (4)].lex_user); (yyvsp[(1) - (4)].lex_user)->password=(yyvsp[(4) - (4)].lex_str); + if ((yyvsp[(4) - (4)].lex_str).length) { if (YYTHD->variables.old_passwords) { char *buff= (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1); if (buff) - make_scrambled_password_323(buff, yyvsp[0].lex_str.str); - yyvsp[-3].lex_user->password.str= buff; - yyvsp[-3].lex_user->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; + make_scrambled_password_323(buff, (yyvsp[(4) - (4)].lex_str).str); + (yyvsp[(1) - (4)].lex_user)->password.str= buff; + (yyvsp[(1) - (4)].lex_user)->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; } else { char *buff= (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1); if (buff) - make_scrambled_password(buff, yyvsp[0].lex_str.str); - yyvsp[-3].lex_user->password.str= buff; - yyvsp[-3].lex_user->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH; + make_scrambled_password(buff, (yyvsp[(4) - (4)].lex_str).str); + (yyvsp[(1) - (4)].lex_user)->password.str= buff; + (yyvsp[(1) - (4)].lex_user)->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH; } } } break; case 1963: -#line 9352 "sql_yacc.yy" - { yyval.lex_user= yyvsp[-4].lex_user; yyvsp[-4].lex_user->password= yyvsp[0].lex_str; } +#line 9354 "sql_yacc.yy" + { (yyval.lex_user)= (yyvsp[(1) - (5)].lex_user); (yyvsp[(1) - (5)].lex_user)->password= (yyvsp[(5) - (5)].lex_str); } break; case 1964: -#line 9354 "sql_yacc.yy" - { yyval.lex_user= yyvsp[0].lex_user; yyvsp[0].lex_user->password= null_lex_str; } +#line 9356 "sql_yacc.yy" + { (yyval.lex_user)= (yyvsp[(1) - (1)].lex_user); (yyvsp[(1) - (1)].lex_user)->password= null_lex_str; } break; case 1965: -#line 9360 "sql_yacc.yy" +#line 9362 "sql_yacc.yy" { LEX *lex=Lex; lex->grant |= lex->which_columns; @@ -27278,9 +27613,9 @@ break; case 1969: -#line 9372 "sql_yacc.yy" +#line 9374 "sql_yacc.yy" { - String *new_str = new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,system_charset_info); + String *new_str = new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); List_iterator iter(Lex->columns); class LEX_COLUMN *point; LEX *lex=Lex; @@ -27299,91 +27634,91 @@ break; case 1971: -#line 9394 "sql_yacc.yy" +#line 9396 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_SPECIFIED; } break; case 1972: -#line 9398 "sql_yacc.yy" +#line 9400 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_ANY; } break; case 1973: -#line 9402 "sql_yacc.yy" +#line 9404 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_X509; } break; case 1974: -#line 9406 "sql_yacc.yy" +#line 9408 "sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_NONE; } break; case 1975: -#line 9412 "sql_yacc.yy" +#line 9414 "sql_yacc.yy" {} break; case 1977: -#line 9416 "sql_yacc.yy" +#line 9418 "sql_yacc.yy" {} break; case 1978: -#line 9417 "sql_yacc.yy" +#line 9419 "sql_yacc.yy" {} break; case 1979: -#line 9421 "sql_yacc.yy" +#line 9423 "sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 1980: -#line 9423 "sql_yacc.yy" +#line 9425 "sql_yacc.yy" { LEX *lex=Lex; - lex->mqh.questions=yyvsp[0].ulong_num; + lex->mqh.questions=(yyvsp[(2) - (2)].ulong_num); lex->mqh.specified_limits|= USER_RESOURCES::QUERIES_PER_HOUR; } break; case 1981: -#line 9429 "sql_yacc.yy" +#line 9431 "sql_yacc.yy" { LEX *lex=Lex; - lex->mqh.updates=yyvsp[0].ulong_num; + lex->mqh.updates=(yyvsp[(2) - (2)].ulong_num); lex->mqh.specified_limits|= USER_RESOURCES::UPDATES_PER_HOUR; } break; case 1982: -#line 9435 "sql_yacc.yy" +#line 9437 "sql_yacc.yy" { LEX *lex=Lex; - lex->mqh.conn_per_hour= yyvsp[0].ulong_num; + lex->mqh.conn_per_hour= (yyvsp[(2) - (2)].ulong_num); lex->mqh.specified_limits|= USER_RESOURCES::CONNECTIONS_PER_HOUR; } break; case 1983: -#line 9441 "sql_yacc.yy" +#line 9443 "sql_yacc.yy" { LEX *lex=Lex; - lex->mqh.user_conn= yyvsp[0].ulong_num; + lex->mqh.user_conn= (yyvsp[(2) - (2)].ulong_num); lex->mqh.specified_limits|= USER_RESOURCES::USER_CONNECTIONS; } break; case 1984: -#line 9450 "sql_yacc.yy" +#line 9452 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_BEGIN; @@ -27392,114 +27727,114 @@ break; case 1985: -#line 9455 "sql_yacc.yy" +#line 9457 "sql_yacc.yy" {} break; case 1986: -#line 9459 "sql_yacc.yy" +#line 9461 "sql_yacc.yy" {} break; case 1987: -#line 9460 "sql_yacc.yy" +#line 9462 "sql_yacc.yy" {} break; case 1988: -#line 9464 "sql_yacc.yy" - { yyval.num= (YYTHD->variables.completion_type == 1); } +#line 9466 "sql_yacc.yy" + { (yyval.num)= (YYTHD->variables.completion_type == 1); } break; case 1989: -#line 9465 "sql_yacc.yy" - { yyval.num=0; } +#line 9467 "sql_yacc.yy" + { (yyval.num)=0; } break; case 1990: -#line 9466 "sql_yacc.yy" - { yyval.num=1; } +#line 9468 "sql_yacc.yy" + { (yyval.num)=1; } break; case 1991: -#line 9470 "sql_yacc.yy" - { yyval.num= (YYTHD->variables.completion_type == 2); } +#line 9472 "sql_yacc.yy" + { (yyval.num)= (YYTHD->variables.completion_type == 2); } break; case 1992: -#line 9471 "sql_yacc.yy" - { yyval.num=1; } +#line 9473 "sql_yacc.yy" + { (yyval.num)=1; } break; case 1993: -#line 9472 "sql_yacc.yy" - { yyval.num=0; } +#line 9474 "sql_yacc.yy" + { (yyval.num)=0; } break; case 1994: -#line 9476 "sql_yacc.yy" +#line 9478 "sql_yacc.yy" {} break; case 1995: -#line 9477 "sql_yacc.yy" +#line 9479 "sql_yacc.yy" {} break; case 1996: -#line 9482 "sql_yacc.yy" +#line 9484 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_COMMIT; - lex->tx_chain= yyvsp[-1].num; - lex->tx_release= yyvsp[0].num; + lex->tx_chain= (yyvsp[(3) - (4)].num); + lex->tx_release= (yyvsp[(4) - (4)].num); } break; case 1997: -#line 9492 "sql_yacc.yy" +#line 9494 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK; - lex->tx_chain= yyvsp[-1].num; - lex->tx_release= yyvsp[0].num; + lex->tx_chain= (yyvsp[(3) - (4)].num); + lex->tx_release= (yyvsp[(4) - (4)].num); } break; case 1998: -#line 9500 "sql_yacc.yy" +#line 9502 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT; - lex->ident= yyvsp[0].lex_str; + lex->ident= (yyvsp[(5) - (5)].lex_str); } break; case 1999: -#line 9509 "sql_yacc.yy" +#line 9511 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SAVEPOINT; - lex->ident= yyvsp[0].lex_str; + lex->ident= (yyvsp[(2) - (2)].lex_str); } break; case 2000: -#line 9518 "sql_yacc.yy" +#line 9520 "sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RELEASE_SAVEPOINT; - lex->ident= yyvsp[0].lex_str; + lex->ident= (yyvsp[(3) - (3)].lex_str); } break; case 2001: -#line 9531 "sql_yacc.yy" +#line 9533 "sql_yacc.yy" {} break; case 2003: -#line 9537 "sql_yacc.yy" +#line 9539 "sql_yacc.yy" { LEX *lex=Lex; if (lex->result) @@ -27519,14 +27854,14 @@ MYSQL_YYABORT; mysql_init_select(lex); lex->current_select->linkage=UNION_TYPE; - if (yyvsp[0].num) /* UNION DISTINCT - remember position */ + if ((yyvsp[(2) - (2)].num)) /* UNION DISTINCT - remember position */ lex->current_select->master_unit()->union_distinct= lex->current_select; } break; case 2004: -#line 9561 "sql_yacc.yy" +#line 9563 "sql_yacc.yy" { /* Remove from the name resolution context stack the context of the @@ -27537,22 +27872,22 @@ break; case 2005: -#line 9571 "sql_yacc.yy" - { yyval.num= 0; } +#line 9573 "sql_yacc.yy" + { (yyval.num)= 0; } break; case 2006: -#line 9572 "sql_yacc.yy" - { yyval.num= 1; } +#line 9574 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 2007: -#line 9573 "sql_yacc.yy" - { yyval.num= 1; } +#line 9575 "sql_yacc.yy" + { (yyval.num)= 1; } break; case 2008: -#line 9577 "sql_yacc.yy" +#line 9579 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27571,7 +27906,7 @@ break; case 2009: -#line 9593 "sql_yacc.yy" +#line 9595 "sql_yacc.yy" { THD *thd= YYTHD; thd->lex->current_select->no_table_names_allowed= 0; @@ -27580,29 +27915,29 @@ break; case 2012: -#line 9606 "sql_yacc.yy" - { yyval.num=1; } +#line 9608 "sql_yacc.yy" + { (yyval.num)=1; } break; case 2013: -#line 9607 "sql_yacc.yy" - { yyval.num=1; } +#line 9609 "sql_yacc.yy" + { (yyval.num)=1; } break; case 2014: -#line 9608 "sql_yacc.yy" - { yyval.num=0; } +#line 9610 "sql_yacc.yy" + { (yyval.num)=0; } break; case 2015: -#line 9613 "sql_yacc.yy" +#line 9615 "sql_yacc.yy" { - yyval.select_lex= yyvsp[-1].select_lex; + (yyval.select_lex)= (yyvsp[(3) - (4)].select_lex); } break; case 2016: -#line 9617 "sql_yacc.yy" +#line 9619 "sql_yacc.yy" { THD *thd= YYTHD; /* @@ -27611,7 +27946,7 @@ and some compilers can't guarnatee the order in which the local variables are initialized. */ - List_iterator it(yyvsp[-1].select_lex->item_list); + List_iterator it((yyvsp[(3) - (4)].select_lex)->item_list); Item *item; /* we must fill the items list for the "derived table". @@ -27622,19 +27957,19 @@ break; case 2017: -#line 9633 "sql_yacc.yy" - { yyval.select_lex= yyvsp[-4].select_lex; } +#line 9635 "sql_yacc.yy" + { (yyval.select_lex)= (yyvsp[(3) - (7)].select_lex); } break; case 2018: -#line 9637 "sql_yacc.yy" +#line 9639 "sql_yacc.yy" { - yyval.select_lex= Lex->current_select->master_unit()->first_select(); + (yyval.select_lex)= Lex->current_select->master_unit()->first_select(); } break; case 2019: -#line 9642 "sql_yacc.yy" +#line 9644 "sql_yacc.yy" { LEX *lex=Lex; if (lex->sql_command == (int)SQLCOM_HA_READ || @@ -27657,7 +27992,7 @@ break; case 2020: -#line 9663 "sql_yacc.yy" +#line 9665 "sql_yacc.yy" { LEX *lex=Lex; lex->pop_context(); @@ -27675,32 +28010,32 @@ break; case 2021: -#line 9686 "sql_yacc.yy" +#line 9688 "sql_yacc.yy" {} break; case 2022: -#line 9688 "sql_yacc.yy" +#line 9690 "sql_yacc.yy" {} break; case 2023: -#line 9693 "sql_yacc.yy" +#line 9695 "sql_yacc.yy" {} break; case 2024: -#line 9695 "sql_yacc.yy" +#line 9697 "sql_yacc.yy" {} break; case 2025: -#line 9697 "sql_yacc.yy" +#line 9699 "sql_yacc.yy" {} break; case 2026: -#line 9708 "sql_yacc.yy" +#line 9710 "sql_yacc.yy" { /* We have to distinguish missing DEFINER-clause from case when @@ -27714,112 +28049,112 @@ break; case 2027: -#line 9719 "sql_yacc.yy" +#line 9721 "sql_yacc.yy" { - YYTHD->lex->definer= get_current_user(YYTHD, yyvsp[0].lex_user); + YYTHD->lex->definer= get_current_user(YYTHD, (yyvsp[(3) - (3)].lex_user)); } break; case 2028: -#line 9732 "sql_yacc.yy" +#line 9734 "sql_yacc.yy" {} break; case 2029: -#line 9734 "sql_yacc.yy" +#line 9736 "sql_yacc.yy" {} break; case 2030: -#line 9736 "sql_yacc.yy" +#line 9738 "sql_yacc.yy" {} break; case 2031: -#line 9741 "sql_yacc.yy" +#line 9743 "sql_yacc.yy" { Lex->create_view_mode= VIEW_CREATE_OR_REPLACE; } break; case 2032: -#line 9746 "sql_yacc.yy" +#line 9748 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2033: -#line 9748 "sql_yacc.yy" +#line 9750 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; } break; case 2034: -#line 9750 "sql_yacc.yy" +#line 9752 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; } break; case 2035: -#line 9755 "sql_yacc.yy" +#line 9757 "sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2036: -#line 9757 "sql_yacc.yy" +#line 9759 "sql_yacc.yy" {} break; case 2037: -#line 9762 "sql_yacc.yy" +#line 9764 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFAULT; } break; case 2038: -#line 9764 "sql_yacc.yy" +#line 9766 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFINER; } break; case 2039: -#line 9766 "sql_yacc.yy" +#line 9768 "sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_INVOKER; } break; case 2040: -#line 9771 "sql_yacc.yy" +#line 9773 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; lex->sql_command= SQLCOM_CREATE_VIEW; /* first table in list is target VIEW name */ - if (!lex->select_lex.add_table_to_list(thd, yyvsp[0].table, NULL, TL_OPTION_UPDATING)) + if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(3) - (3)].table), NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; } break; case 2041: -#line 9780 "sql_yacc.yy" +#line 9782 "sql_yacc.yy" {} break; case 2042: -#line 9785 "sql_yacc.yy" +#line 9787 "sql_yacc.yy" {} break; case 2044: -#line 9791 "sql_yacc.yy" +#line 9793 "sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) - sql_memdup(&yyvsp[0].lex_str, sizeof(LEX_STRING))); + sql_memdup(&(yyvsp[(1) - (1)].lex_str), sizeof(LEX_STRING))); } break; case 2045: -#line 9796 "sql_yacc.yy" +#line 9798 "sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) - sql_memdup(&yyvsp[0].lex_str, sizeof(LEX_STRING))); + sql_memdup(&(yyvsp[(3) - (3)].lex_str), sizeof(LEX_STRING))); } break; case 2046: -#line 9803 "sql_yacc.yy" +#line 9805 "sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= FALSE; @@ -27830,7 +28165,7 @@ break; case 2047: -#line 9811 "sql_yacc.yy" +#line 9813 "sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= TRUE; @@ -27841,51 +28176,51 @@ break; case 2048: -#line 9822 "sql_yacc.yy" +#line 9824 "sql_yacc.yy" { THD *thd=YYTHD; LEX *lex= thd->lex; char *stmt_beg= (lex->sphead ? (char *)lex->sphead->m_tmp_query : thd->query); - lex->create_view_select_start= yyvsp[-1].simple_string - stmt_beg; + lex->create_view_select_start= (yyvsp[(2) - (3)].simple_string) - stmt_beg; } break; case 2049: -#line 9831 "sql_yacc.yy" +#line 9833 "sql_yacc.yy" { THD *thd=YYTHD; LEX *lex= thd->lex; char *stmt_beg= (lex->sphead ? (char *)lex->sphead->m_tmp_query : thd->query); - lex->create_view_select_start= yyvsp[-3].simple_string - stmt_beg; + lex->create_view_select_start= (yyvsp[(2) - (5)].simple_string) - stmt_beg; } break; case 2050: -#line 9843 "sql_yacc.yy" +#line 9845 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_NONE; } break; case 2051: -#line 9845 "sql_yacc.yy" +#line 9847 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2052: -#line 9847 "sql_yacc.yy" +#line 9849 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2053: -#line 9849 "sql_yacc.yy" +#line 9851 "sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_LOCAL; } break; case 2054: -#line 9861 "sql_yacc.yy" +#line 9863 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27902,15 +28237,15 @@ MYSQL_YYABORT; sp->reset_thd_mem_root(thd); sp->init(lex); - sp->init_sp_name(thd, yyvsp[-9].spname); + sp->init_sp_name(thd, (yyvsp[(3) - (12)].spname)); - lex->stmt_definition_begin= yyvsp[-10].simple_string; - lex->ident.str= yyvsp[-5].simple_string; - lex->ident.length= yyvsp[-2].simple_string - yyvsp[-5].simple_string; + lex->stmt_definition_begin= (yyvsp[(2) - (12)].simple_string); + lex->ident.str= (yyvsp[(7) - (12)].simple_string); + lex->ident.length= (yyvsp[(10) - (12)].simple_string) - (yyvsp[(7) - (12)].simple_string); sp->m_type= TYPE_ENUM_TRIGGER; lex->sphead= sp; - lex->spname= yyvsp[-9].spname; + lex->spname= (yyvsp[(3) - (12)].spname); /* We have to turn of CLIENT_MULTI_QUERIES while parsing a stored procedure, otherwise yylex will chop it into pieces @@ -27928,7 +28263,7 @@ break; case 2055: -#line 9901 "sql_yacc.yy" +#line 9903 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -27948,7 +28283,7 @@ sp_proc_stmt alternatives are not saving/restoring LEX, so lex->query_tables can be wiped out. */ - if (!lex->select_lex.add_table_to_list(YYTHD, yyvsp[-6].table, + if (!lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(8) - (14)].table), (LEX_STRING*) 0, TL_OPTION_UPDATING, TL_IGNORE)) @@ -27957,22 +28292,22 @@ break; case 2056: -#line 9936 "sql_yacc.yy" +#line 9938 "sql_yacc.yy" { LEX *lex=Lex; - lex->udf.type= yyvsp[-3].udf_type; - lex->stmt_definition_begin= yyvsp[-2].simple_string; - lex->spname= yyvsp[0].spname; + lex->udf.type= (yyvsp[(1) - (4)].udf_type); + lex->stmt_definition_begin= (yyvsp[(2) - (4)].simple_string); + lex->spname= (yyvsp[(4) - (4)].spname); } break; case 2057: -#line 9943 "sql_yacc.yy" +#line 9945 "sql_yacc.yy" {} break; case 2058: -#line 9945 "sql_yacc.yy" +#line 9947 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp; @@ -27983,13 +28318,13 @@ MYSQL_YYABORT; } - lex->stmt_definition_begin= yyvsp[-1].simple_string; + lex->stmt_definition_begin= (yyvsp[(2) - (3)].simple_string); /* Order is important here: new - reset - init */ sp= new sp_head(); sp->reset_thd_mem_root(YYTHD); sp->init(lex); - sp->init_sp_name(YYTHD, yyvsp[0].spname); + sp->init_sp_name(YYTHD, (yyvsp[(3) - (3)].spname)); sp->m_type= TYPE_ENUM_PROCEDURE; lex->sphead= sp; @@ -28004,7 +28339,7 @@ break; case 2059: -#line 9974 "sql_yacc.yy" +#line 9976 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28015,7 +28350,7 @@ break; case 2060: -#line 9983 "sql_yacc.yy" +#line 9985 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28027,7 +28362,7 @@ break; case 2061: -#line 9992 "sql_yacc.yy" +#line 9994 "sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -28039,7 +28374,7 @@ break; case 2062: -#line 10001 "sql_yacc.yy" +#line 10003 "sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -28054,142 +28389,141 @@ break; case 2063: -#line 10017 "sql_yacc.yy" +#line 10019 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_START; } break; case 2064: -#line 10021 "sql_yacc.yy" +#line 10023 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_END; } break; case 2065: -#line 10025 "sql_yacc.yy" +#line 10027 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_PREPARE; } break; case 2066: -#line 10029 "sql_yacc.yy" +#line 10031 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_COMMIT; } break; case 2067: -#line 10033 "sql_yacc.yy" +#line 10035 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_ROLLBACK; } break; case 2068: -#line 10037 "sql_yacc.yy" +#line 10039 "sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_RECOVER; } break; case 2069: -#line 10043 "sql_yacc.yy" +#line 10045 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[0].string->length() <= MAXGTRIDSIZE); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (1)].string)->length() <= MAXGTRIDSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) MYSQL_YYABORT; - Lex->xid->set(1L, yyvsp[0].string->ptr(), yyvsp[0].string->length(), 0, 0); + Lex->xid->set(1L, (yyvsp[(1) - (1)].string)->ptr(), (yyvsp[(1) - (1)].string)->length(), 0, 0); } break; case 2070: -#line 10050 "sql_yacc.yy" +#line 10052 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-2].string->length() <= MAXGTRIDSIZE && yyvsp[0].string->length() <= MAXBQUALSIZE); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (3)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) MYSQL_YYABORT; - Lex->xid->set(1L, yyvsp[-2].string->ptr(), yyvsp[-2].string->length(), yyvsp[0].string->ptr(), yyvsp[0].string->length()); + Lex->xid->set(1L, (yyvsp[(1) - (3)].string)->ptr(), (yyvsp[(1) - (3)].string)->length(), (yyvsp[(3) - (3)].string)->ptr(), (yyvsp[(3) - (3)].string)->length()); } break; case 2071: -#line 10057 "sql_yacc.yy" +#line 10059 "sql_yacc.yy" { - MYSQL_YYABORT_UNLESS(yyvsp[-4].string->length() <= MAXGTRIDSIZE && yyvsp[-2].string->length() <= MAXBQUALSIZE); + MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (5)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) MYSQL_YYABORT; - Lex->xid->set(yyvsp[0].ulong_num, yyvsp[-4].string->ptr(), yyvsp[-4].string->length(), yyvsp[-2].string->ptr(), yyvsp[-2].string->length()); + Lex->xid->set((yyvsp[(5) - (5)].ulong_num), (yyvsp[(1) - (5)].string)->ptr(), (yyvsp[(1) - (5)].string)->length(), (yyvsp[(3) - (5)].string)->ptr(), (yyvsp[(3) - (5)].string)->length()); } break; case 2072: -#line 10065 "sql_yacc.yy" +#line 10067 "sql_yacc.yy" {} break; case 2073: -#line 10066 "sql_yacc.yy" +#line 10068 "sql_yacc.yy" {} break; case 2074: -#line 10070 "sql_yacc.yy" +#line 10072 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2075: -#line 10071 "sql_yacc.yy" +#line 10073 "sql_yacc.yy" { Lex->xa_opt=XA_JOIN; } break; case 2076: -#line 10072 "sql_yacc.yy" +#line 10074 "sql_yacc.yy" { Lex->xa_opt=XA_RESUME; } break; case 2077: -#line 10076 "sql_yacc.yy" +#line 10078 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2078: -#line 10077 "sql_yacc.yy" +#line 10079 "sql_yacc.yy" { Lex->xa_opt=XA_ONE_PHASE; } break; case 2079: -#line 10081 "sql_yacc.yy" +#line 10083 "sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2080: -#line 10082 "sql_yacc.yy" +#line 10084 "sql_yacc.yy" { Lex->xa_opt=XA_SUSPEND; } break; case 2082: -#line 10087 "sql_yacc.yy" +#line 10089 "sql_yacc.yy" { } break; case 2083: -#line 10088 "sql_yacc.yy" +#line 10090 "sql_yacc.yy" { Lex->xa_opt=XA_FOR_MIGRATE; } break; +/* Line 1267 of yacc.c. */ +#line 28521 "sql_yacc.cc" + default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 1000 of yacc.c. */ -#line 28188 "sql_yacc.cc" - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -28218,99 +28552,65 @@ if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); + } - if (yycount < 5) - { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) - { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ + { + /* Return failure if at end of input. */ if (yychar == YYEOF) - for (;;) - { - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - } - } + YYABORT; + } else { - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); + yydestruct ("Error: discarding", + yytoken, &yylval); yychar = YYEMPTY; - } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -28320,15 +28620,17 @@ `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) goto yyerrorlab; -#endif - yyvsp -= yylen; - yyssp -= yylen; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; @@ -28357,9 +28659,10 @@ if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - YYPOPSTACK; + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -28367,11 +28670,12 @@ if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -28391,21 +28695,39 @@ goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } Modified: mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.h =================================================================== --- mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.h 2007-12-11 04:26:30 UTC (rev 53) +++ mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.h 2007-12-11 04:47:24 UTC (rev 54) @@ -1,8 +1,10 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Skeleton interface for Bison's Yacc-like parsers in C + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -15,14 +17,22 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ +/* 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. */ + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -602,6 +612,7 @@ NEG = 828 }; #endif +/* Tokens. */ #define END_OF_INPUT 258 #define ABORT_SYM 259 #define ACTION 260 @@ -1177,9 +1188,10 @@ -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE #line 415 "sql_yacc.yy" -typedef union YYSTYPE { +{ int num; ulong ulong_num; ulonglong ulonglong_number; @@ -1217,9 +1229,10 @@ struct { int vars, conds, hndlrs, curs; } spblock; sp_name *spname; struct st_lex *lex; -} YYSTYPE; -/* Line 1275 of yacc.c. */ -#line 1223 "sql_yacc.h" +} +/* Line 1529 of yacc.c. */ +#line 1235 "sql_yacc.h" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1227,5 +1240,3 @@ - - Modified: mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.yy =================================================================== --- mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.yy 2007-12-11 04:26:30 UTC (rev 53) +++ mysql-5.0.45-tritonn-1.1.0/sql/sql_yacc.yy 2007-12-11 04:47:24 UTC (rev 54) @@ -3661,11 +3661,13 @@ } | SENNA_DELIMITED_SYM { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_NGRAM; Lex->senna_flags |= SEN_INDEX_DELIMITED; #endif /* ENABLE_SENNA */ } | SENNA_MECAB_SYM { #ifdef ENABLE_SENNA + Lex->senna_flags &= ~SEN_INDEX_DELIMITED; Lex->senna_flags &= ~SEN_INDEX_NGRAM; #endif /* ENABLE_SENNA */ } From svnnotify ¡÷ sourceforge.jp Wed Dec 12 11:30:23 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 12 Dec 2007 11:30:23 +0900 Subject: [Tritonn-commit 45] [svn] [55] bugfix: SHOW CREATE TABLE and mysqldump don' t return senna_flags and initial_n_segments information. Message-ID: <1197426623.688693.938.nullmailer@users.sourceforge.jp> Revision: 55 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=55 Author: mir Date: 2007-12-12 11:30:23 +0900 (Wed, 12 Dec 2007) Log Message: ----------- bugfix: SHOW CREATE TABLE and mysqldump don't return senna_flags and initial_n_segments information. Modified Paths: -------------- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test mysql-5.0.51-tritonn-1.0.8/sql/ha_myisam.cc mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc mysql-5.0.51-tritonn-1.0.8/sql/structs.h Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result 2007-12-11 04:47:24 UTC (rev 54) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result 2007-12-12 02:30:23 UTC (rev 55) @@ -213,3 +213,31 @@ Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size t1 ft c1 utf8 DELIMITED OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 DROP TABLE t1; +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, c3 INT, c4 TEXT, c5 TEXT) DEFAULT CHARSET utf8; +CREATE INDEX c2 ON t1(c2); +CREATE FULLTEXT INDEX ft1 ON t1(c4); +CREATE FULLTEXT INDEX ft2 USING NGRAM, SECTIONALIZE, 64 ON t1(c5); +CREATE FULLTEXT INDEX ft3 USING DELIMITED, NO NORMALIZE, 128 ON t1(c5); +CREATE FULLTEXT INDEX ft4 USING SPLIT_ALPHA, SPLIT_DIGIT, SPLIT_SYMBOL, 48 ON t1(c5); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` int(11) default NULL, + `c3` int(11) default NULL, + `c4` text, + `c5` text, + PRIMARY KEY (`c1`), + KEY `c2` (`c2`), + FULLTEXT KEY `ft1` USING NGRAM, NORMALIZE, 512 (`c4`), + FULLTEXT KEY `ft2` USING NGRAM, NORMALIZE, SECTIONALIZE, 64 (`c5`), + FULLTEXT KEY `ft3` USING DELIMITED, NO NORMALIZE, 128 (`c5`), + FULLTEXT KEY `ft4` USING NGRAM, NORMALIZE, SPLIT_ALPHA, SPLIT_DIGIT, SPLIT_SYMBOL, 48 (`c5`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW SENNA STATUS; +Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size +t1 ft1 c4 utf8 NGRAM OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 +t1 ft2 c5 utf8 NGRAM ON ON OFF OFF OFF 64 0 4268032 0 4268032 139264 20480 +t1 ft3 c5 utf8 DELIMITED OFF OFF OFF OFF OFF 128 0 4268032 0 4268032 143360 36864 +t1 ft4 c5 utf8 NGRAM OFF ON ON ON ON 48 0 4268032 0 4268032 135168 16384 +DROP TABLE t1; Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test 2007-12-11 04:47:24 UTC (rev 54) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test 2007-12-12 02:30:23 UTC (rev 55) @@ -218,3 +218,16 @@ CREATE TABLE t1 (c1 TEXT, FULLTEXT INDEX ft USING DELIMITED (c1)) DEFAULT CHARSET utf8; SHOW SENNA STATUS; DROP TABLE t1; + +# bugfix: show create table doesn't return senna_flags and ins +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, c3 INT, c4 TEXT, c5 TEXT) DEFAULT CHARSET utf8; +CREATE INDEX c2 ON t1(c2); +CREATE FULLTEXT INDEX ft1 ON t1(c4); +CREATE FULLTEXT INDEX ft2 USING NGRAM, SECTIONALIZE, 64 ON t1(c5); +CREATE FULLTEXT INDEX ft3 USING DELIMITED, NO NORMALIZE, 128 ON t1(c5); +CREATE FULLTEXT INDEX ft4 USING SPLIT_ALPHA, SPLIT_DIGIT, SPLIT_SYMBOL, 48 ON t1(c5); +SHOW CREATE TABLE t1; +SHOW SENNA STATUS; +DROP TABLE t1; + + Modified: mysql-5.0.51-tritonn-1.0.8/sql/ha_myisam.cc =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/ha_myisam.cc 2007-12-11 04:47:24 UTC (rev 54) +++ mysql-5.0.51-tritonn-1.0.8/sql/ha_myisam.cc 2007-12-12 02:30:23 UTC (rev 55) @@ -1723,6 +1723,7 @@ MI_KEYDEF *mi_keydef = &file->s->keyinfo[i]; sen_index *senna = mi_keydef->senna; if (senna) { + key->is_senna = true; key->senna_flags = mi_keydef->senna_flags; key->senna_initial_n_segments = mi_keydef->senna_initial_n_segments; key->senna_keys_size = mi_keydef->senna_keys_size; @@ -1733,7 +1734,8 @@ key->senna_inv_chunk_size = mi_keydef->senna_inv_chunk_size; key->senna_encoding = senna_enc_mysql(mi_keydef->senna_encoding); - } + } else + key->senna_flags = false; } } #endif /* ENABLE_SENNA */ @@ -1833,7 +1835,12 @@ void ha_myisam::update_create_info(HA_CREATE_INFO *create_info) { +#ifdef ENABLE_SENNA + ha_myisam::info(HA_STATUS_AUTO | HA_STATUS_CONST | + HA_STATUS_VARIABLE | HA_STATUS_SENNA); +#else ha_myisam::info(HA_STATUS_AUTO | HA_STATUS_CONST); +#endif if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) { create_info->auto_increment_value=auto_increment_value; Modified: mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc 2007-12-11 04:47:24 UTC (rev 54) +++ mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc 2007-12-12 02:30:23 UTC (rev 55) @@ -29,6 +29,7 @@ #endif #ifdef ENABLE_SENNA +#define SECTIONALIZE 0x00080000 #ifdef HAVE_ISAM #include "ha_myisam.h" // For isam #endif @@ -1005,6 +1006,45 @@ !(key_info->flags & HA_SPATIAL)) packet->append(STRING_WITH_LEN(" USING RTREE")); +#ifdef ENABLE_SENNA + { + char ins[32]; + char *insp; + int inslen; + if (key_info->is_senna) + { + if (key_info->senna_flags & SEN_INDEX_NGRAM) + packet->append(STRING_WITH_LEN(" USING NGRAM")); + else if (key_info->senna_flags & SEN_INDEX_DELIMITED) + packet->append(STRING_WITH_LEN(" USING DELIMITED")); + else + packet->append(STRING_WITH_LEN(" USING MECAB")); + + if (key_info->senna_flags & SEN_INDEX_NORMALIZE) + packet->append(STRING_WITH_LEN(", NORMALIZE")); + else + packet->append(STRING_WITH_LEN(", NO NORMALIZE")); + + if (key_info->senna_flags & SECTIONALIZE) + packet->append(STRING_WITH_LEN(", SECTIONALIZE")); + + if (key_info->senna_flags & SEN_INDEX_SPLIT_ALPHA) + packet->append(STRING_WITH_LEN(", SPLIT_ALPHA")); + if (key_info->senna_flags & SEN_INDEX_SPLIT_DIGIT) + packet->append(STRING_WITH_LEN(", SPLIT_DIGIT")); + if (key_info->senna_flags & SEN_INDEX_SPLIT_SYMBOL) + packet->append(STRING_WITH_LEN(", SPLIT_SYMBOL")); + + /* TODO: initial_n_segments support */ + my_snprintf(ins, sizeof(ins), ", %d",key_info->senna_initial_n_segments); + inslen = strlen(ins); + insp = sql_alloc(inslen); + memcpy(insp, ins, inslen); + packet->append(insp, inslen); + } + } +#endif + // No need to send USING FULLTEXT, it is sent as FULLTEXT KEY } packet->append(STRING_WITH_LEN(" (")); @@ -4452,7 +4492,6 @@ #endif #ifdef ENABLE_SENNA -#define SECTIONALIZE 0x00080000 bool senna_show_status(THD *thd, LEX *lex) { List files; Modified: mysql-5.0.51-tritonn-1.0.8/sql/structs.h =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/structs.h 2007-12-11 04:47:24 UTC (rev 54) +++ mysql-5.0.51-tritonn-1.0.8/sql/structs.h 2007-12-12 02:30:23 UTC (rev 55) @@ -105,6 +105,7 @@ } handler; struct st_table *table; #ifdef ENABLE_SENNA + bool is_senna; /* this is set to true by ha_myisam::info */ int senna_flags; int senna_initial_n_segments; uint senna_keys_size; From svnnotify ¡÷ sourceforge.jp Wed Dec 12 16:04:18 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 12 Dec 2007 16:04:18 +0900 Subject: [Tritonn-commit 46] [svn] [56] bugfix: SHOW CREATE TABLE and mysqldump don' t return senna_flags and initial_n_segments information. Message-ID: <1197443058.128924.21450.nullmailer@users.sourceforge.jp> Revision: 56 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=56 Author: mir Date: 2007-12-12 16:04:17 +0900 (Wed, 12 Dec 2007) Log Message: ----------- bugfix: SHOW CREATE TABLE and mysqldump don't return senna_flags and initial_n_segments information. Modified Paths: -------------- mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/r/senna_create.result mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/t/senna_create.test mysql-5.0.45-tritonn-1.1.0/sql/ha_myisam.cc mysql-5.0.45-tritonn-1.1.0/sql/sql_show.cc mysql-5.0.45-tritonn-1.1.0/sql/structs.h Modified: mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/r/senna_create.result =================================================================== --- mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/r/senna_create.result 2007-12-12 02:30:23 UTC (rev 55) +++ mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/r/senna_create.result 2007-12-12 07:04:17 UTC (rev 56) @@ -213,3 +213,31 @@ Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size t1 ft c1 utf8 DELIMITED OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 DROP TABLE t1; +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, c3 INT, c4 TEXT, c5 TEXT) DEFAULT CHARSET utf8; +CREATE INDEX c2 ON t1(c2); +CREATE FULLTEXT INDEX ft1 ON t1(c4); +CREATE FULLTEXT INDEX ft2 USING NGRAM, SECTIONALIZE, 64 ON t1(c5); +CREATE FULLTEXT INDEX ft3 USING DELIMITED, NO NORMALIZE, 128 ON t1(c5); +CREATE FULLTEXT INDEX ft4 USING SPLIT_ALPHA, SPLIT_DIGIT, SPLIT_SYMBOL, 48 ON t1(c5); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` int(11) default NULL, + `c3` int(11) default NULL, + `c4` text, + `c5` text, + PRIMARY KEY (`c1`), + KEY `c2` (`c2`), + FULLTEXT KEY `ft1` USING NGRAM, NORMALIZE, 512 (`c4`), + FULLTEXT KEY `ft2` USING NGRAM, NORMALIZE, SECTIONALIZE, 64 (`c5`), + FULLTEXT KEY `ft3` USING DELIMITED, NO NORMALIZE, 128 (`c5`), + FULLTEXT KEY `ft4` USING NGRAM, NORMALIZE, SPLIT_ALPHA, SPLIT_DIGIT, SPLIT_SYMBOL, 48 (`c5`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW SENNA STATUS; +Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size +t1 ft1 c4 utf8 NGRAM OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 +t1 ft2 c5 utf8 NGRAM ON ON OFF OFF OFF 64 0 4268032 0 4268032 139264 20480 +t1 ft3 c5 utf8 DELIMITED OFF OFF OFF OFF OFF 128 0 4268032 0 4268032 143360 36864 +t1 ft4 c5 utf8 NGRAM OFF ON ON ON ON 48 0 4268032 0 4268032 135168 16384 +DROP TABLE t1; Modified: mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/t/senna_create.test =================================================================== --- mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/t/senna_create.test 2007-12-12 02:30:23 UTC (rev 55) +++ mysql-5.0.45-tritonn-1.1.0/mysql-test/suite/senna/t/senna_create.test 2007-12-12 07:04:17 UTC (rev 56) @@ -218,3 +218,16 @@ CREATE TABLE t1 (c1 TEXT, FULLTEXT INDEX ft USING DELIMITED (c1)) DEFAULT CHARSET utf8; SHOW SENNA STATUS; DROP TABLE t1; + +# bugfix: show create table doesn't return senna_flags and ins +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, c3 INT, c4 TEXT, c5 TEXT) DEFAULT CHARSET utf8; +CREATE INDEX c2 ON t1(c2); +CREATE FULLTEXT INDEX ft1 ON t1(c4); +CREATE FULLTEXT INDEX ft2 USING NGRAM, SECTIONALIZE, 64 ON t1(c5); +CREATE FULLTEXT INDEX ft3 USING DELIMITED, NO NORMALIZE, 128 ON t1(c5); +CREATE FULLTEXT INDEX ft4 USING SPLIT_ALPHA, SPLIT_DIGIT, SPLIT_SYMBOL, 48 ON t1(c5); +SHOW CREATE TABLE t1; +SHOW SENNA STATUS; +DROP TABLE t1; + + Modified: mysql-5.0.45-tritonn-1.1.0/sql/ha_myisam.cc =================================================================== --- mysql-5.0.45-tritonn-1.1.0/sql/ha_myisam.cc 2007-12-12 02:30:23 UTC (rev 55) +++ mysql-5.0.45-tritonn-1.1.0/sql/ha_myisam.cc 2007-12-12 07:04:17 UTC (rev 56) @@ -1724,6 +1724,7 @@ MI_KEYDEF *mi_keydef = &file->s->keyinfo[i]; sen_index *senna = mi_keydef->senna; if (senna) { + key->is_senna = true; key->senna_flags = mi_keydef->senna_flags; key->senna_initial_n_segments = mi_keydef->senna_initial_n_segments; key->senna_keys_size = mi_keydef->senna_keys_size; @@ -1734,7 +1735,8 @@ key->senna_inv_chunk_size = mi_keydef->senna_inv_chunk_size; key->senna_encoding = senna_enc_mysql(mi_keydef->senna_encoding); - } + } else + key->senna_flags = false; } } #endif /* ENABLE_SENNA */ @@ -1834,7 +1836,12 @@ void ha_myisam::update_create_info(HA_CREATE_INFO *create_info) { +#ifdef ENABLE_SENNA + ha_myisam::info(HA_STATUS_AUTO | HA_STATUS_CONST | + HA_STATUS_VARIABLE | HA_STATUS_SENNA); +#else ha_myisam::info(HA_STATUS_AUTO | HA_STATUS_CONST); +#endif if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) { create_info->auto_increment_value=auto_increment_value; Modified: mysql-5.0.45-tritonn-1.1.0/sql/sql_show.cc =================================================================== --- mysql-5.0.45-tritonn-1.1.0/sql/sql_show.cc 2007-12-12 02:30:23 UTC (rev 55) +++ mysql-5.0.45-tritonn-1.1.0/sql/sql_show.cc 2007-12-12 07:04:17 UTC (rev 56) @@ -29,6 +29,7 @@ #endif #ifdef ENABLE_SENNA +#define SECTIONALIZE 0x00080000 #ifdef HAVE_ISAM #include "ha_myisam.h" // For isam #endif @@ -984,6 +985,45 @@ !(key_info->flags & HA_SPATIAL)) packet->append(STRING_WITH_LEN(" USING RTREE")); +#ifdef ENABLE_SENNA + { + char ins[32]; + char *insp; + int inslen; + if (key_info->is_senna) + { + if (key_info->senna_flags & SEN_INDEX_NGRAM) + packet->append(STRING_WITH_LEN(" USING NGRAM")); + else if (key_info->senna_flags & SEN_INDEX_DELIMITED) + packet->append(STRING_WITH_LEN(" USING DELIMITED")); + else + packet->append(STRING_WITH_LEN(" USING MECAB")); + + if (key_info->senna_flags & SEN_INDEX_NORMALIZE) + packet->append(STRING_WITH_LEN(", NORMALIZE")); + else + packet->append(STRING_WITH_LEN(", NO NORMALIZE")); + + if (key_info->senna_flags & SECTIONALIZE) + packet->append(STRING_WITH_LEN(", SECTIONALIZE")); + + if (key_info->senna_flags & SEN_INDEX_SPLIT_ALPHA) + packet->append(STRING_WITH_LEN(", SPLIT_ALPHA")); + if (key_info->senna_flags & SEN_INDEX_SPLIT_DIGIT) + packet->append(STRING_WITH_LEN(", SPLIT_DIGIT")); + if (key_info->senna_flags & SEN_INDEX_SPLIT_SYMBOL) + packet->append(STRING_WITH_LEN(", SPLIT_SYMBOL")); + + /* TODO: initial_n_segments support */ + my_snprintf(ins, sizeof(ins), ", %d",key_info->senna_initial_n_segments); + inslen = strlen(ins); + insp = sql_alloc(inslen); + memcpy(insp, ins, inslen); + packet->append(insp, inslen); + } + } +#endif + // No need to send USING FULLTEXT, it is sent as FULLTEXT KEY } packet->append(STRING_WITH_LEN(" (")); @@ -4443,7 +4483,6 @@ #endif #ifdef ENABLE_SENNA -#define SECTIONALIZE 0x00080000 bool senna_show_status(THD *thd, LEX *lex) { List files; Modified: mysql-5.0.45-tritonn-1.1.0/sql/structs.h =================================================================== --- mysql-5.0.45-tritonn-1.1.0/sql/structs.h 2007-12-12 02:30:23 UTC (rev 55) +++ mysql-5.0.45-tritonn-1.1.0/sql/structs.h 2007-12-12 07:04:17 UTC (rev 56) @@ -105,6 +105,7 @@ } handler; struct st_table *table; #ifdef ENABLE_SENNA + bool is_senna; /* this is set to true by ha_myisam::info */ int senna_flags; int senna_initial_n_segments; uint senna_keys_size; From svnnotify ¡÷ sourceforge.jp Fri Dec 14 17:22:47 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Fri, 14 Dec 2007 17:22:47 +0900 Subject: [Tritonn-commit 47] [svn] [57] bugfix: mysqld got sig11 while show senna status handled views. Message-ID: <1197620567.715223.4268.nullmailer@users.sourceforge.jp> Revision: 57 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=57 Author: mir Date: 2007-12-14 17:22:47 +0900 (Fri, 14 Dec 2007) Log Message: ----------- bugfix: mysqld got sig11 while show senna status handled views. Modified Paths: -------------- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc mysql-5.0.51-tritonn-1.0.8/sql/table.cc mysql-5.0.51-tritonn-1.0.8/sql/unireg.h Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result 2007-12-12 07:04:17 UTC (rev 56) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result 2007-12-14 08:22:47 UTC (rev 57) @@ -241,3 +241,10 @@ t1 ft3 c5 utf8 DELIMITED OFF OFF OFF OFF OFF 128 0 4268032 0 4268032 143360 36864 t1 ft4 c5 utf8 NGRAM OFF ON ON ON ON 48 0 4268032 0 4268032 135168 16384 DROP TABLE t1; +CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 TEXT, FULLTEXT INDEX ft (c2)); +CREATE VIEW v1 AS SELECT * FROM t1; +SHOW SENNA STATUS; +Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size +t1 ft c2 latin1 NGRAM OFF ON OFF OFF OFF 512 0 4268032 0 4268032 167936 135168 +DROP VIEW v1; +DROP TABLE t1; Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test 2007-12-12 07:04:17 UTC (rev 56) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test 2007-12-14 08:22:47 UTC (rev 57) @@ -230,4 +230,9 @@ SHOW SENNA STATUS; DROP TABLE t1; - +# bugfix: got sig11 when show senna status with view +CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 TEXT, FULLTEXT INDEX ft (c2)); +CREATE VIEW v1 AS SELECT * FROM t1; +SHOW SENNA STATUS; +DROP VIEW v1; +DROP TABLE t1; Modified: mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc 2007-12-12 07:04:17 UTC (rev 56) +++ mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc 2007-12-14 08:22:47 UTC (rev 57) @@ -4537,7 +4537,15 @@ List_iterator_fast it(files); while (file_name = it++) { + TABLE tmp_table; TABLE_LIST table_list; + + /* to skip views */ + (void) my_snprintf(path, FN_LEN, "%s/%s", db, file_name); + openfrm(thd, path, "", 0, SENNA_CHECK_VIEW, 0, &tmp_table); + if(!(tmp_table.file)) continue; + closefrm(&tmp_table); + bzero((char*) &table_list, sizeof(table_list)); table_list.db = db; table_list.table_name = file_name; Modified: mysql-5.0.51-tritonn-1.0.8/sql/table.cc =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/table.cc 2007-12-12 07:04:17 UTC (rev 56) +++ mysql-5.0.51-tritonn-1.0.8/sql/table.cc 2007-12-14 08:22:47 UTC (rev 57) @@ -109,6 +109,18 @@ if (my_read(file,(byte*) head,64,MYF(MY_NABP))) goto err; +#ifdef ENABLE_SENNA + if (prgflag & SENNA_CHECK_VIEW) + { + if (memcmp(head, STRING_WITH_LEN("TYPE=VIEW")) == 0) + { + error_reported = TRUE; + error = 0; + goto err; + } + } +#endif + if (memcmp(head, STRING_WITH_LEN("TYPE=")) == 0) { // new .frm Modified: mysql-5.0.51-tritonn-1.0.8/sql/unireg.h =================================================================== --- mysql-5.0.51-tritonn-1.0.8/sql/unireg.h 2007-12-12 07:04:17 UTC (rev 56) +++ mysql-5.0.51-tritonn-1.0.8/sql/unireg.h 2007-12-14 08:22:47 UTC (rev 57) @@ -151,6 +151,10 @@ #define NO_ERR_ON_NEW_FRM 8192 /* stop error sending on new format */ #define OPEN_VIEW_NO_PARSE 16384 /* Open frm only if it's a view, but do not parse view itself */ +#ifdef ENABLE_SENNA +#define SENNA_CHECK_VIEW 32768 +#endif + #define SC_INFO_LENGTH 4 /* Form format constant */ #define TE_INFO_LENGTH 3 #define MTYP_NOEMPTY_BIT 128 From svnnotify ¡÷ sourceforge.jp Fri Dec 14 17:44:13 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Fri, 14 Dec 2007 17:44:13 +0900 Subject: [Tritonn-commit 48] [svn] [58] changed sen_log level for some mass logging functions. Message-ID: <1197621853.244650.18371.nullmailer@users.sourceforge.jp> Revision: 58 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=58 Author: mir Date: 2007-12-14 17:44:12 +0900 (Fri, 14 Dec 2007) Log Message: ----------- changed sen_log level for some mass logging functions. Modified Paths: -------------- mysql-5.0.51-tritonn-1.0.8/myisam/ft_boolean_search.c mysql-5.0.51-tritonn-1.0.8/myisam/ft_nlq_search.c Modified: mysql-5.0.51-tritonn-1.0.8/myisam/ft_boolean_search.c =================================================================== --- mysql-5.0.51-tritonn-1.0.8/myisam/ft_boolean_search.c 2007-12-14 08:22:47 UTC (rev 57) +++ mysql-5.0.51-tritonn-1.0.8/myisam/ft_boolean_search.c 2007-12-14 08:44:12 UTC (rev 58) @@ -613,7 +613,7 @@ info->lastpos=pos; if (!(my_thread_var->sen_flags & (SENNA_USE_2IND | SENNA_IF_READ_RECORD | SENNA_FILESORT))) { - SEN_LOG(sen_log_debug, "ft_boolean_read_next: 2ind return 0"); + SEN_LOG(sen_log_dump, "ft_boolean_read_next: 2ind return 0"); return 0; } if (!(*info->read_record)(info,info->lastpos,record)) { @@ -707,7 +707,7 @@ if (!ftb->sir) { return 0.0; } if (docid == HA_OFFSET_ERROR) return -2.0; - SEN_LOG(sen_log_debug, "ft_boolean_find_relevance => sen_records_find: records=%p, key=%p", + SEN_LOG(sen_log_dump, "ft_boolean_find_relevance => sen_records_find: records=%p, key=%p", ftb->sir, &docid); return 1.0 * sen_records_find(ftb->sir, &docid); } @@ -822,7 +822,7 @@ if ((ftb->keynr != NO_SUCH_KEY) && ftb->info->s->keyinfo[ftb->keynr].senna) { if (!ftb->sir) { return 0.0; } - SEN_LOG(sen_log_debug, "ft_boolean_get_relevance => sen_records_curr_score: r=%p", ftb->sir); + SEN_LOG(sen_log_dump, "ft_boolean_get_relevance => sen_records_curr_score: r=%p", ftb->sir); return 1.0 * sen_records_curr_score(ftb->sir); } #endif /* ENABLE_SENNA */ Modified: mysql-5.0.51-tritonn-1.0.8/myisam/ft_nlq_search.c =================================================================== --- mysql-5.0.51-tritonn-1.0.8/myisam/ft_nlq_search.c 2007-12-14 08:22:47 UTC (rev 57) +++ mysql-5.0.51-tritonn-1.0.8/myisam/ft_nlq_search.c 2007-12-14 08:44:12 UTC (rev 58) @@ -319,13 +319,13 @@ { my_off_t pos; info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); - SEN_LOG(sen_log_debug, "ft_nlq_read_next => sen_records_next in while loop"); + SEN_LOG(sen_log_dump, "ft_nlq_read_next => sen_records_next in while loop"); while (sen_records_next(handler->sir, &pos, sizeof(my_off_t), NULL)) { info->lastpos=pos; if (!(my_thread_var->sen_flags & (SENNA_USE_2IND | SENNA_IF_READ_RECORD | SENNA_FILESORT))) { - SEN_LOG(sen_log_debug, "ft_nlq_read_next => 2ind return 0"); + SEN_LOG(sen_log_dump, "ft_nlq_read_next => 2ind return 0"); return 0; } if (!(*info->read_record)(info,info->lastpos,record)) @@ -372,7 +372,7 @@ #ifdef ENABLE_SENNA if (handler->sir) { - SEN_LOG(sen_log_debug, "ft_nlq_find_relevance => sen_records_find: records=%p, key=%p", + SEN_LOG(sen_log_dump, "ft_nlq_find_relevance => sen_records_find: records=%p, key=%p", handler->sir, &docid); return 1.0 * sen_records_find(handler->sir, &docid); } @@ -418,7 +418,7 @@ } return 0.0; } - SEN_LOG(sen_log_debug, "ft_nlq_get_relevance => sen_records_curr_score: r=%p", + SEN_LOG(sen_log_dump, "ft_nlq_get_relevance => sen_records_curr_score: r=%p", handler->sir); return 1.0 * sen_records_curr_score(handler->sir); #else /* ENABLE_SENNA */ From svnnotify ¡÷ sourceforge.jp Tue Dec 18 13:39:58 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 18 Dec 2007 13:39:58 +0900 Subject: [Tritonn-commit 49] [svn] [59] modified testcase results regarding to show create table. Message-ID: <1197952798.786452.20169.nullmailer@users.sourceforge.jp> Revision: 59 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=59 Author: mir Date: 2007-12-18 13:39:58 +0900 (Tue, 18 Dec 2007) Log Message: ----------- modified testcase results regarding to show create table. Modified Paths: -------------- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/mecab/r/mecab_utf8.result mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_cp932.result mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_eucjpms.result mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_sjis.result mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_utf8.result Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/mecab/r/mecab_utf8.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/mecab/r/mecab_utf8.result 2007-12-14 08:44:12 UTC (rev 58) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/mecab/r/mecab_utf8.result 2007-12-18 04:39:58 UTC (rev 59) @@ -17,7 +17,7 @@ `c1` int(11) NOT NULL auto_increment, `c2` text, PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) + FULLTEXT KEY `ft` USING MECAB, NORMALIZE, 512 (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 SHOW SENNA STATUS; Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size @@ -411,7 +411,7 @@ `c1` int(11) NOT NULL auto_increment, `c2` text, PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) + FULLTEXT KEY `ft` USING NGRAM, NORMALIZE, 512 (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 SHOW SENNA STATUS; Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_cp932.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_cp932.result 2007-12-14 08:44:12 UTC (rev 58) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_cp932.result 2007-12-18 04:39:58 UTC (rev 59) @@ -17,7 +17,7 @@ `c1` int(11) NOT NULL auto_increment, `c2` text, PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) + FULLTEXT KEY `ft` USING NGRAM, NORMALIZE, 512 (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=cp932 SHOW SENNA STATUS; Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_eucjpms.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_eucjpms.result 2007-12-14 08:44:12 UTC (rev 58) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_eucjpms.result 2007-12-18 04:39:58 UTC (rev 59) @@ -17,7 +17,7 @@ `c1` int(11) NOT NULL auto_increment, `c2` text, PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) + FULLTEXT KEY `ft` USING NGRAM, NORMALIZE, 512 (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=eucjpms SHOW SENNA STATUS; Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_sjis.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_sjis.result 2007-12-14 08:44:12 UTC (rev 58) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_sjis.result 2007-12-18 04:39:58 UTC (rev 59) @@ -17,7 +17,7 @@ `c1` int(11) NOT NULL auto_increment, `c2` text, PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) + FULLTEXT KEY `ft` USING NGRAM, NORMALIZE, 512 (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=sjis SHOW SENNA STATUS; Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_utf8.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_utf8.result 2007-12-14 08:44:12 UTC (rev 58) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_utf8.result 2007-12-18 04:39:58 UTC (rev 59) @@ -17,7 +17,7 @@ `c1` int(11) NOT NULL auto_increment, `c2` text, PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) + FULLTEXT KEY `ft` USING NGRAM, NORMALIZE, 512 (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 SHOW SENNA STATUS; Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size From svnnotify ¡÷ sourceforge.jp Tue Dec 18 14:26:51 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 18 Dec 2007 14:26:51 +0900 Subject: [Tritonn-commit 50] [svn] [60] modified testcase results regarding to show create table. Message-ID: <1197955611.562405.17076.nullmailer@users.sourceforge.jp> Revision: 60 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=60 Author: mir Date: 2007-12-18 14:26:51 +0900 (Tue, 18 Dec 2007) Log Message: ----------- modified testcase results regarding to show create table. Modified Paths: -------------- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_ujis.result Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_ujis.result =================================================================== --- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_ujis.result 2007-12-18 04:39:58 UTC (rev 59) +++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_ujis.result 2007-12-18 05:26:51 UTC (rev 60) @@ -17,7 +17,7 @@ `c1` int(11) NOT NULL auto_increment, `c2` text, PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) + FULLTEXT KEY `ft` USING NGRAM, NORMALIZE, 512 (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=ujis SHOW SENNA STATUS; Table Key_name Column_name Encoding Index_type Sectionalize Normalize Split_alpha Split_digit Split_symbol Initial_n_segments Senna_keys_size Senna_keys_file_size Senna_lexicon_size Senna_lexicon_file_size Senna_inv_seg_size Senna_inv_chunk_size From svnnotify ¡÷ sourceforge.jp Wed Dec 19 14:19:42 2007 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 19 Dec 2007 14:19:42 +0900 Subject: [Tritonn-commit 51] [svn] [61] upgraded spec files for tritonn-1.0.8. Message-ID: <1198041582.962632.1192.nullmailer@users.sourceforge.jp> Revision: 61 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=61 Author: mir Date: 2007-12-19 14:19:42 +0900 (Wed, 19 Dec 2007) Log Message: ----------- upgraded spec files for tritonn-1.0.8. Modified Paths: -------------- build/SPECS/mecab-ipadic.spec build/SPECS/mecab.spec build/SPECS/mysql.spec build/SPECS/senna.spec Modified: build/SPECS/mecab-ipadic.spec =================================================================== --- build/SPECS/mecab-ipadic.spec 2007-12-18 05:26:51 UTC (rev 60) +++ build/SPECS/mecab-ipadic.spec 2007-12-19 05:19:42 UTC (rev 61) @@ -2,7 +2,7 @@ %define prefix /usr %define config --with-charset=utf8 %define version 2.7.0.20070801 -%define release tritonn.1.0.7a +%define release tritonn.1.0.8 %define file_suffix 2.7.0-20070801 %define mecab-version 0.96 @@ -49,6 +49,9 @@ %{prefix}/lib/mecab/dic/ipadic/unk.dic %changelog +* Tue Dec 18 2007 Tetsuro IKEDA - 2.7.0.20070801-tritonn.1.0.8 +- Tritonn 1.0.8 + * Tue Nov 06 2007 Tetsuro IKEDA - 2.7.0.20070801-tritonn.1.0.7a - added "defattr" to files section. Modified: build/SPECS/mecab.spec =================================================================== --- build/SPECS/mecab.spec 2007-12-18 05:26:51 UTC (rev 60) +++ build/SPECS/mecab.spec 2007-12-19 05:19:42 UTC (rev 61) @@ -1,7 +1,7 @@ %define name mecab %define prefix /usr %define version 0.96 -%define release tritonn.1.0.7a +%define release tritonn.1.0.8 Name: %{name} Version: %{version} @@ -59,6 +59,9 @@ %{prefix}/bin/mecab %changelog +* Tue Dec 18 2007 Tetsuro IKEDA - 0.96-tritonn.1.0.8 +- Tritonn 1.0.8 + * Tue Nov 06 2007 Tetsuro IKEDA - 0.96-tritonn.1.0.7a - added "defattr" to files section. Modified: build/SPECS/mysql.spec =================================================================== --- build/SPECS/mysql.spec 2007-12-18 05:26:51 UTC (rev 60) +++ build/SPECS/mysql.spec 2007-12-19 05:19:42 UTC (rev 61) @@ -14,7 +14,7 @@ # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston # MA 02110-1301 USA. -%define mysql_version 5.0.45-tritonn-1.0.7 +%define mysql_version 5.0.51-tritonn-1.0.8 # use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x) # to enable static linking (off by default) @@ -29,7 +29,7 @@ %if %{STATIC_BUILD} %define release 0 %else -%define release tritonn.1.0.7 +%define release tritonn.1.0.8 %endif %define license GPL %define mysqld_user mysql @@ -63,7 +63,7 @@ Name: MySQL Summary: MySQL with Senna (Tritonn Project) Group: Applications/Databases -Version: 5.0.45 +Version: 5.0.51 Release: %{release} License: %{license} Source: mysql-%{mysql_version}.tar.gz @@ -726,6 +726,9 @@ # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Tue Dec 18 2007 Tetsuro IKEDA +- Modified this spec file for Tritonn ver 1.0.8 and MySQL 5.0.51 + * Tue Oct 29 2007 Tetsuro IKEDA - Modified this spec file for Tritonn ver 1.0.7 Modified: build/SPECS/senna.spec =================================================================== --- build/SPECS/senna.spec 2007-12-18 05:26:51 UTC (rev 60) +++ build/SPECS/senna.spec 2007-12-19 05:19:42 UTC (rev 61) @@ -1,7 +1,7 @@ %define name senna %define prefix /usr %define version 1.0.9 -%define release tritonn.1.0.7a +%define release tritonn.1.0.8 Name: %{name} Version: %{version} @@ -51,6 +51,9 @@ %changelog +* Tue Dec 18 2007 Tetsuro IKEDA - 1.0.9-tritonn.1.0.8 +- Tritonn 1.0.8 + * Tue Nov 06 2007 Tetsuro IKEDA - 1.0.9-tritonn.1.0.7a - added "defattr" to files section.