From 56f23460837efc9efb577a8007518d0da11cd898 Mon Sep 17 00:00:00 2001 From: Leonid Fedorov Date: Thu, 2 Mar 2023 15:59:42 +0000 Subject: [PATCH] Remove windows ifdefs --- datatypes/mcs_datatype.cpp | 8 - datatypes/mcs_datatype.h | 7 - dbcon/ddlpackage/ddl-gram-win.cpp | 3584 ----------------- dbcon/ddlpackage/ddl-gram-win.h | 163 - dbcon/ddlpackage/ddl-scan-win.cpp | 2274 ----------- dbcon/ddlpackage/ddl.l | 5 - dbcon/ddlpackage/ddl.y | 4 - dbcon/ddlpackage/ddlpkg.h | 4 - dbcon/ddlpackage/scanner.bat | 6 - dbcon/ddlpackage/sqlparser.cpp | 4 - dbcon/ddlpackage/sqlparser.h | 4 - dbcon/ddlpackageproc/altertableprocessor.cpp | 4 - dbcon/ddlpackageproc/altertableprocessor.h | 4 - dbcon/ddlpackageproc/createtableprocessor.cpp | 20 - dbcon/ddlpackageproc/createtableprocessor.h | 4 - dbcon/ddlpackageproc/ddlpackageprocessor.h | 4 - .../ddlpackageproc/droppartitionprocessor.cpp | 4 - dbcon/ddlpackageproc/droppartitionprocessor.h | 4 - dbcon/ddlpackageproc/droptableprocessor.cpp | 16 - dbcon/ddlpackageproc/droptableprocessor.h | 4 - .../ddlpackageproc/markpartitionprocessor.cpp | 4 - dbcon/ddlpackageproc/markpartitionprocessor.h | 4 - .../restorepartitionprocessor.cpp | 4 - .../restorepartitionprocessor.h | 4 - dbcon/dmlpackage/calpontdmlfactory.cpp | 4 - dbcon/dmlpackage/calpontdmlfactory.h | 4 - dbcon/dmlpackage/commanddmlpackage.h | 4 - dbcon/dmlpackage/deletedmlpackage.h | 4 - dbcon/dmlpackage/dml-gram-win.cpp | 2964 -------------- dbcon/dmlpackage/dml-gram-win.h | 172 - dbcon/dmlpackage/dml-scan-win.cpp | 2089 ---------- dbcon/dmlpackage/dml.l | 9 - dbcon/dmlpackage/dml.y | 4 - dbcon/dmlpackage/dmlcolumn.cpp | 3 - dbcon/dmlpackage/dmlcolumn.h | 4 - dbcon/dmlpackage/dmlparser.cpp | 4 - dbcon/dmlpackage/insertdmlpackage.cpp | 3 - dbcon/dmlpackage/insertdmlpackage.h | 4 - dbcon/dmlpackage/row.h | 4 - dbcon/dmlpackage/scanner.bat | 6 - dbcon/dmlpackage/updatedmlpackage.h | 4 - dbcon/dmlpackage/vendordmlstatement.h | 4 - .../dmlpackageproc/commandpackageprocessor.h | 4 - .../dmlpackageproc/deletepackageprocessor.cpp | 4 - dbcon/dmlpackageproc/deletepackageprocessor.h | 4 - dbcon/dmlpackageproc/dmlpackageprocessor.h | 4 - .../dmlpackageprocessorfactory.h | 4 - .../dmlpackageproc/insertpackageprocessor.cpp | 4 - dbcon/dmlpackageproc/insertpackageprocessor.h | 4 - dbcon/dmlpackageproc/tablelockdata.h | 4 - .../dmlpackageproc/updatepackageprocessor.cpp | 4 - dbcon/dmlpackageproc/updatepackageprocessor.h | 4 - dbcon/execplan/calpontsystemcatalog.cpp | 16 - dbcon/execplan/exp_templates.h | 6 - dbcon/execplan/functioncolumn.cpp | 3 - dbcon/execplan/intervalcolumn.cpp | 3 - dbcon/execplan/predicateoperator.h | 4 +- dbcon/execplan/windowfunctioncolumn.cpp | 3 - dbcon/joblist/crossenginestep.cpp | 13 - dbcon/joblist/distributedenginecomm.h | 4 - dbcon/joblist/groupconcat.h | 4 - dbcon/joblist/jlf_execplantojoblist.cpp | 13 - dbcon/joblist/joblist.h | 4 - dbcon/joblist/joblistfactory.cpp | 19 - dbcon/joblist/joblistfactory.h | 4 - dbcon/joblist/jsonarrayagg.h | 4 - dbcon/joblist/largehashjoin.h | 4 - dbcon/joblist/lbidlist.h | 4 - dbcon/joblist/primitivemsg.h | 7 - dbcon/joblist/primitivestep.h | 4 - dbcon/joblist/resourcemanager.h | 4 - dbcon/joblist/tablecolumn.h | 4 - dbcon/joblist/threadsafequeue.h | 10 - dbcon/joblist/timeset.h | 39 - dbcon/joblist/timestamp.cpp | 18 - dbcon/joblist/tuple-bps.cpp | 4 - dbcon/joblist/tupleannexstep.cpp | 4 - dbcon/joblist/tupleunion.h | 4 - dbcon/joblist/windowfunctionstep.h | 4 - dbcon/mysql/ha_mcs.cpp | 6 - dbcon/mysql/ha_mcs_client_udfs.cpp | 225 -- dbcon/mysql/ha_mcs_ddl.cpp | 9 - dbcon/mysql/ha_mcs_dml.cpp | 5 - dbcon/mysql/ha_mcs_execplan.cpp | 10 - dbcon/mysql/ha_mcs_impl.cpp | 221 - dbcon/mysql/ha_mcs_impl_if.h | 12 - dbcon/mysql/ha_mcs_partition.cpp | 72 - dbcon/mysql/ha_mcs_udf.cpp | 4 - dbcon/mysql/ha_pseudocolumn.cpp | 99 - dbcon/mysql/idb_mysql.h | 16 - dbcon/mysql/sm.cpp | 8 - dbcon/mysql/sm.h | 4 - ddlproc/ddlproc.cpp | 7 - ddlproc/ddlprocessor.cpp | 4 - dmlproc/batchinsertprocessor.cpp | 4 - dmlproc/dmlproc.cpp | 7 - dmlproc/dmlprocessor.cpp | 6 - oam/oamcpp/liboamcpp.cpp | 14 - oam/oamcpp/liboamcpp.h | 6 - oam/oamcpp/oamcache.cpp | 5 - oam/oamcpp/oamcache.h | 4 - oamapps/columnstoreSupport/calpontSupport.bat | 227 -- .../blockcache/blockrequestprocessor.cpp | 8 - primitives/blockcache/filebuffermgr.cpp | 63 - primitives/blockcache/filebuffermgr.h | 4 - primitives/blockcache/fsutils.cpp | 4 - primitives/blockcache/iomanager.cpp | 24 - primitives/blockcache/stats.cpp | 14 - primitives/blockcache/stats.h | 5 - primitives/linux-port/column.cpp | 3 - primitives/linux-port/primitiveprocessor.h | 6 - primitives/primproc/batchprimitiveprocessor.h | 4 - primitives/primproc/bppseeder.cpp | 14 - primitives/primproc/bppseeder.h | 4 - primitives/primproc/columncommand.cpp | 3 - primitives/primproc/primitiveserver.cpp | 31 - primitives/primproc/primitiveserver.h | 5 - primitives/primproc/primproc.cpp | 40 - primitives/primproc/udf.cpp | 4 - primitives/primproc/umsocketselector.cpp | 11 - primitives/primproc/umsocketselector.h | 11 - tools/bincvt/li2bin.cpp | 22 - tools/clearShm/main.cpp | 12 - tools/dbbuilder/dbbuilder.cpp | 7 - tools/idbmeminfo/idbmeminfo.cpp | 29 +- tools/qfe/bison-win.cpp | 2032 ---------- tools/qfe/bison-win.h | 76 - tools/qfe/cli.cpp | 33 - tools/qfe/lex-win.cpp | 1712 -------- tools/qfe/returnedrows.cpp | 2 - tools/qfe/scanner.bat | 6 - tools/qfe/server.cpp | 86 - tools/qfe/socketio.cpp | 86 - tools/qfe/socketio.h | 11 - tools/qfe/socktype.h | 11 - utils/common/MonitorProcMem.cpp | 27 +- utils/common/atomicops.h | 90 - utils/common/cgroupconfigurator.cpp | 42 +- utils/common/fixedallocator.cpp | 1 - utils/common/fixedallocator.h | 4 - utils/common/robin_hood.h | 38 - utils/common/simpleallocator.h | 8 - utils/common/utils_utf8.h | 22 +- utils/compress/idbcompress.h | 6 - utils/configcpp/configcpp.cpp | 33 - utils/configcpp/configcpp.h | 4 - utils/configcpp/writeonce.h | 4 - utils/dataconvert/dataconvert.cpp | 32 - utils/dataconvert/dataconvert.h | 16 - utils/funcexp/func_crc32.cpp | 2 - utils/funcexp/func_hex.cpp | 5 - utils/funcexp/func_inet_ntoa.cpp | 6 - utils/funcexp/func_math.cpp | 6 - utils/funcexp/func_pow.cpp | 4 - utils/funcexp/func_sha.cpp | 6 - utils/funcexp/funcexp.h | 4 - utils/funcexp/funchelpers.h | 10 - utils/funcexp/functor.cpp | 2 - utils/idbdatafile/BufferedFile.cpp | 26 - utils/idbdatafile/BufferedFile.h | 3 - utils/idbdatafile/IDBDataFile.h | 4 - utils/idbdatafile/IDBFactory.cpp | 8 - utils/idbdatafile/IDBLogger.cpp | 15 - utils/idbdatafile/IDBPolicy.cpp | 10 - utils/idbdatafile/PosixFileSystem.cpp | 17 - utils/idbdatafile/UnbufferedFile.cpp | 115 - utils/idbdatafile/UnbufferedFile.h | 4 - utils/idbdatafile/largefile64.h | 10 - utils/idbdatafile/tdriver.cpp | 2 - utils/idbdatafile/utility.h | 45 - utils/joiner/joinpartition.cpp | 13 - utils/joiner/tuplejoiner.cpp | 4 - utils/joiner/tuplejoiner.h | 4 - utils/json/json.hpp | 20 +- utils/loggingcpp/messagelog.cpp | 10 - utils/messageqcpp/bytestream.cpp | 24 - utils/messageqcpp/bytestream.h | 21 - utils/messageqcpp/compressed_iss.cpp | 11 - utils/messageqcpp/compressed_iss.h | 2 - utils/messageqcpp/inetstreamsocket.cpp | 143 - utils/messageqcpp/inetstreamsocket.h | 6 - utils/messageqcpp/iosocket.cpp | 8 - utils/messageqcpp/iosocket.h | 10 - utils/messageqcpp/messagequeue.cpp | 6 - utils/messageqcpp/messagequeue.h | 10 - utils/messageqcpp/serversocket.h | 6 - utils/querytele/queryteleclient.h | 4 - utils/querytele/queryteleprotoimpl.cpp | 4 - utils/regr/corr.h | 8 - utils/regr/covar_pop.h | 8 - utils/regr/covar_samp.h | 8 - utils/regr/moda.h | 4 - utils/regr/modamysql.cpp | 22 - utils/regr/regr_avgx.h | 8 - utils/regr/regr_avgy.h | 8 - utils/regr/regr_count.h | 8 - utils/regr/regr_intercept.h | 8 - utils/regr/regr_r2.h | 8 - utils/regr/regr_slope.h | 8 - utils/regr/regr_sxx.h | 8 - utils/regr/regr_sxy.h | 8 - utils/regr/regr_syy.h | 8 - utils/regr/regrmysql.cpp | 184 - utils/rowgroup/rowaggregation.cpp | 12 - utils/rowgroup/rowaggregation.h | 5 - utils/rowgroup/rowgroup.h | 12 - utils/rwlock/rwlock.cpp | 20 - utils/rwlock/rwlock.h | 12 - utils/rwlock/rwlock_local.h | 4 - utils/startup/installdir.cpp | 14 - utils/threadpool/threadpool.h | 4 - utils/threadpool/tp.cpp | 4 - utils/udfsdk/allnull.h | 8 - utils/udfsdk/avg_mode.h | 8 - utils/udfsdk/avgx.h | 8 - utils/udfsdk/distinct_count.h | 4 - utils/udfsdk/docs/make.bat | 281 -- .../docs/source/reference/MariaDBUDAF.rst | 15 - utils/udfsdk/mcsv1_udaf.h | 8 - utils/udfsdk/median.h | 8 - utils/udfsdk/ssq.h | 8 - utils/udfsdk/udfmysql.cpp | 108 - utils/udfsdk/udfsdk.h | 4 - utils/windowfunction/idborderby.h | 4 - utils/windowfunction/wf_udaf.h | 4 - versioning/BRM/autoincrementmanager.h | 4 - versioning/BRM/blockresolutionmanager.h | 4 - versioning/BRM/brmshmimpl.cpp | 12 - versioning/BRM/brmtypes.h | 8 - versioning/BRM/copylocks.cpp | 3 - versioning/BRM/copylocks.h | 4 - versioning/BRM/dbrm.h | 4 - versioning/BRM/extentmap.cpp | 4 - versioning/BRM/extentmap.h | 4 - versioning/BRM/lbidresourcegraph.h | 8 - versioning/BRM/masternode.cpp | 2 - versioning/BRM/mastersegmenttable.cpp | 12 - versioning/BRM/mastersegmenttable.h | 4 - versioning/BRM/oidserver.cpp | 4 - versioning/BRM/oidserver.h | 4 - versioning/BRM/reset_locks.cpp | 12 - versioning/BRM/resourcenode.h | 4 - versioning/BRM/rgnode.h | 4 - versioning/BRM/rwlockmonitor.h | 4 - versioning/BRM/save_brm.cpp | 2 - versioning/BRM/sessionmanagerserver.cpp | 4 - versioning/BRM/sessionmanagerserver.h | 11 - versioning/BRM/shmkeys.h | 6 - versioning/BRM/slavecomm.cpp | 84 - versioning/BRM/slavecomm.h | 9 - versioning/BRM/slavedbrmnode.h | 4 - versioning/BRM/slavenode.cpp | 4 - versioning/BRM/tablelockserver.h | 4 - versioning/BRM/tracer.cpp | 4 - versioning/BRM/tracer.h | 4 - versioning/BRM/transactionnode.h | 4 - versioning/BRM/undoable.h | 4 - versioning/BRM/vbbm.cpp | 6 - versioning/BRM/vbbm.h | 4 - versioning/BRM/vss.cpp | 3 - versioning/BRM/vss.h | 4 - writeengine/bulk/cpimport.cpp | 27 - writeengine/bulk/we_bulkload.cpp | 9 - writeengine/bulk/we_bulkload.h | 2 - writeengine/bulk/we_bulkloadbuffer.cpp | 41 - writeengine/bulk/we_colextinf.h | 4 - writeengine/bulk/we_extentstripealloc.h | 4 - writeengine/bulk/we_tableinfo.cpp | 50 - writeengine/bulk/we_tableinfo.h | 7 - writeengine/bulk/we_workers.cpp | 12 - writeengine/client/we_clients.cpp | 2 - writeengine/client/we_clients.h | 4 - writeengine/client/we_ddlcommandclient.h | 4 - writeengine/client/we_dmlcommandclient.h | 4 - writeengine/dictionary/we_dctnry.h | 4 - writeengine/dictionary/we_dctnrystore.cpp | 2 - writeengine/dictionary/we_dctnrystore.h | 4 - writeengine/index/we_indexlist.cpp | 2 - writeengine/index/we_indexlist_common.cpp | 2 - .../index/we_indexlist_find_delete.cpp | 2 - .../index/we_indexlist_multiple_narray.cpp | 2 - writeengine/index/we_indexlist_narray.cpp | 2 - .../index/we_indexlist_update_hdr_sub.cpp | 2 - writeengine/index/we_indextree.h | 4 - .../we_redistributeworkerthread.cpp | 4 - writeengine/server/we_dataloader.cpp | 10 - writeengine/server/we_ddlcommandproc.h | 4 - writeengine/server/we_ddlcommon.h | 4 - writeengine/server/we_dmlcommandproc.h | 4 - writeengine/server/we_getfilesizes.cpp | 4 - writeengine/server/we_server.cpp | 13 - writeengine/shared/we_blockop.h | 4 - writeengine/shared/we_brm.cpp | 3 - writeengine/shared/we_brm.h | 7 - writeengine/shared/we_bulkrollbackmgr.h | 10 - writeengine/shared/we_cache.cpp | 3 - writeengine/shared/we_cache.h | 11 - writeengine/shared/we_chunkmanager.cpp | 8 - writeengine/shared/we_chunkmanager.h | 10 - writeengine/shared/we_config.cpp | 2 - writeengine/shared/we_config.h | 4 - writeengine/shared/we_confirmhdfsdbfile.h | 4 - writeengine/shared/we_convertor.cpp | 3 - writeengine/shared/we_convertor.h | 4 - writeengine/shared/we_dbfileop.h | 4 - writeengine/shared/we_dbrootextenttracker.h | 4 - writeengine/shared/we_define.h | 4 - writeengine/shared/we_fileop.cpp | 34 +- writeengine/shared/we_fileop.h | 13 - writeengine/shared/we_log.cpp | 17 - writeengine/shared/we_log.h | 4 - writeengine/shared/we_rbmetawriter.cpp | 7 - writeengine/shared/we_rbmetawriter.h | 4 - writeengine/shared/we_simplesyslog.h | 4 - writeengine/splitter/we_filereadthread.cpp | 16 - writeengine/splitter/we_splitterapp.cpp | 4 - writeengine/wrapper/we_colop.h | 4 - writeengine/wrapper/we_colopcompress.h | 4 - writeengine/wrapper/we_dctnrycompress.h | 4 - writeengine/wrapper/we_tablemetadata.h | 4 - writeengine/wrapper/writeengine.cpp | 3 - writeengine/wrapper/writeengine.h | 8 - writeengine/xml/we_xmlgendata.cpp | 18 - writeengine/xml/we_xmlgendata.h | 16 - writeengine/xml/we_xmlgenproc.cpp | 6 - writeengine/xml/we_xmlgenproc.h | 4 - writeengine/xml/we_xmljob.cpp | 4 - writeengine/xml/we_xmljob.h | 4 - 328 files changed, 9 insertions(+), 19602 deletions(-) delete mode 100644 dbcon/ddlpackage/ddl-gram-win.cpp delete mode 100644 dbcon/ddlpackage/ddl-gram-win.h delete mode 100644 dbcon/ddlpackage/ddl-scan-win.cpp delete mode 100644 dbcon/ddlpackage/scanner.bat delete mode 100644 dbcon/dmlpackage/dml-gram-win.cpp delete mode 100644 dbcon/dmlpackage/dml-gram-win.h delete mode 100644 dbcon/dmlpackage/dml-scan-win.cpp delete mode 100644 dbcon/dmlpackage/scanner.bat delete mode 100644 oamapps/columnstoreSupport/calpontSupport.bat delete mode 100644 tools/qfe/bison-win.cpp delete mode 100644 tools/qfe/bison-win.h delete mode 100644 tools/qfe/lex-win.cpp delete mode 100644 tools/qfe/scanner.bat delete mode 100644 utils/udfsdk/docs/make.bat diff --git a/datatypes/mcs_datatype.cpp b/datatypes/mcs_datatype.cpp index 5eef21c7fc..9dc2864e30 100644 --- a/datatypes/mcs_datatype.cpp +++ b/datatypes/mcs_datatype.cpp @@ -19,20 +19,12 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include #include using namespace std; diff --git a/datatypes/mcs_datatype.h b/datatypes/mcs_datatype.h index 7ab9e5faca..fd40505053 100644 --- a/datatypes/mcs_datatype.h +++ b/datatypes/mcs_datatype.h @@ -27,19 +27,12 @@ #include "mcs_double.h" #include "mcs_longdouble.h" -#ifdef _MSC_VER -typedef int mcs_sint32_t; -#else typedef int32_t mcs_sint32_t; -#endif // Because including my_sys.h in a Columnstore header causes too many conflicts struct charset_info_st; typedef const struct charset_info_st CHARSET_INFO; -#ifdef _MSC_VER -#define __attribute__(x) -#endif namespace { diff --git a/dbcon/ddlpackage/ddl-gram-win.cpp b/dbcon/ddlpackage/ddl-gram-win.cpp deleted file mode 100644 index e66b2d7245..0000000000 --- a/dbcon/ddlpackage/ddl-gram-win.cpp +++ /dev/null @@ -1,3584 +0,0 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ -#define yyparse ddlparse -#define yylex ddllex -#define yyerror ddlerror -#define yylval ddllval -#define yychar ddlchar -#define yydebug ddldebug -#define yynerrs ddlnerrs - -/* Copy the first part of user declarations. */ - -#include "sqlparser.h" - -#ifdef _MSC_VER -#include "ddl-gram-win.h" -#else -#include "ddl-gram.h" -#endif - -using namespace std; -using namespace ddlpackage; - -/* The user is expect to pass a ParseTree* to grammar_init */ -static ParseTree* parseTree; -static std::string db_schema; -int ddllex(); -void ddlerror(char const* error); -char* copy_string(const char* str); - -/* Enabling traces. */ -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -#undef YYERROR_VERBOSE -#define YYERROR_VERBOSE 1 -#else -#define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -#define YYTOKEN_TABLE 0 -#endif - -/* Tokens. */ -#ifndef YYTOKENTYPE -#define YYTOKENTYPE -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype -{ - ACTION = 258, - ADD = 259, - ALTER = 260, - AUTO_INCREMENT = 261, - BIGINT = 262, - BIT = 263, - IDB_BLOB = 264, - CASCADE = 265, - IDB_CHAR = 266, - CHARACTER = 267, - CHECK = 268, - CLOB = 269, - COLUMN = 270, - COLUMNS = 271, - COMMENT = 272, - CONSTRAINT = 273, - CONSTRAINTS = 274, - CREATE = 275, - CURRENT_USER = 276, - DATETIME = 277, - DEC = 278, - DECIMAL = 279, - DEFAULT = 280, - DEFERRABLE = 281, - DEFERRED = 282, - IDB_DELETE = 283, - DROP = 284, - ENGINE = 285, - FOREIGN = 286, - FULL = 287, - IMMEDIATE = 288, - INDEX = 289, - INITIALLY = 290, - IDB_INT = 291, - INTEGER = 292, - KEY = 293, - MATCH = 294, - MAX_ROWS = 295, - MIN_ROWS = 296, - MODIFY = 297, - NO = 298, - NOT = 299, - NULL_TOK = 300, - NUMBER = 301, - NUMERIC = 302, - ON = 303, - PARTIAL = 304, - PRECISION = 305, - PRIMARY = 306, - REFERENCES = 307, - RENAME = 308, - RESTRICT = 309, - SET = 310, - SMALLINT = 311, - TABLE = 312, - TIME = 313, - TINYINT = 314, - TO = 315, - UNIQUE = 316, - UNSIGNED = 317, - UPDATE = 318, - USER = 319, - SESSION_USER = 320, - SYSTEM_USER = 321, - VARCHAR = 322, - VARBINARY = 323, - VARYING = 324, - WITH = 325, - ZONE = 326, - DOUBLE = 327, - IDB_FLOAT = 328, - REAL = 329, - CHARSET = 330, - IDB_IF = 331, - EXISTS = 332, - CHANGE = 333, - TRUNCATE = 334, - IDENT = 335, - FCONST = 336, - SCONST = 337, - CP_SEARCH_CONDITION_TEXT = 338, - ICONST = 339, - DATE = 340 -}; -#endif - -#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - ddlpackage::AlterTableStatement* alterTableStmt; - ddlpackage::AlterTableAction* ata; - ddlpackage::AlterTableActionList* ataList; - ddlpackage::DDL_CONSTRAINT_ATTRIBUTES cattr; - std::pair* tableOption; - const char* columnOption; - ddlpackage::ColumnConstraintDef* columnConstraintDef; - ddlpackage::ColumnNameList* columnNameList; - ddlpackage::ColumnType* columnType; - ddlpackage::ConstraintAttributes* constraintAttributes; - ddlpackage::ColumnConstraintList* constraintList; - ddlpackage::DDL_CONSTRAINTS constraintType; - double dval; - bool flag; - int ival; - ddlpackage::QualifiedName* qualifiedName; - ddlpackage::SchemaObject* schemaObject; - ddlpackage::SqlStatement* sqlStmt; - ddlpackage::SqlStatementList* sqlStmtList; - const char* str; - ddlpackage::TableConstraintDef* tableConstraint; - ddlpackage::TableElementList* tableElementList; - ddlpackage::TableOptionMap* tableOptionMap; - ddlpackage::ColumnDefaultValue* colDefault; - ddlpackage::DDL_MATCH_TYPE matchType; - ddlpackage::DDL_REFERENTIAL_ACTION refActionCode; - ddlpackage::ReferentialAction* refAction; - -} YYSTYPE; -#define YYSTYPE_IS_TRIVIAL 1 -#define yystype YYSTYPE /* obsolescent; will be withdrawn */ -#define YYSTYPE_IS_DECLARED 1 -#endif - -/* Copy the second part of user declarations. */ - -#ifdef short -#undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#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 -#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 yyi) -#else -static int YYID(yyi) int yyi; -#endif -{ - return yyi; -} -#endif - -#if !defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -#ifdef YYSTACK_USE_ALLOCA -#if YYSTACK_USE_ALLOCA -#ifdef __GNUC__ -#define YYSTACK_ALLOC __builtin_alloca -#elif defined __BUILTIN_VA_ARG_INCR -#include /* INFRINGES ON USER NAME SPACE */ -#elif defined _AIX -#define YYSTACK_ALLOC __alloca -#elif defined _MSC_VER -#include /* INFRINGES ON USER NAME SPACE */ -#define alloca _alloca -#else -#define YYSTACK_ALLOC alloca -#if !defined _ALLOCA_H && !defined _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 (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 -#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 */ -#ifndef _STDLIB_H -#define _STDLIB_H 1 -#endif -#endif -#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 */ - -#if (!defined yyoverflow && (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -#define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -#define YYSTACK_BYTES(N) ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -#ifndef YYCOPY -#if defined __GNUC__ && 1 < __GNUC__ -#define YYCOPY(To, From, Count) __builtin_memcpy(To, From, (Count) * sizeof(*(From))) -#else -#define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } while (YYID(0)) -#endif -#endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -#define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof(*yyptr); \ - } while (YYID(0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 23 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 387 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 93 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 76 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 229 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 396 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 340 - -#define YYTRANSLATE(YYX) ((unsigned int)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 92, 87, 88, 2, 2, 89, 2, 91, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 86, 2, 90, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = { - 0, 0, 3, 5, 9, 11, 13, 15, 17, 19, 21, 23, 24, 29, 36, 39, 40, 44, 54, 65, 67, - 68, 77, 85, 89, 90, 94, 97, 99, 103, 105, 107, 112, 116, 118, 119, 121, 123, 125, 130, 132, 136, - 139, 141, 154, 156, 157, 160, 162, 164, 166, 167, 170, 173, 175, 176, 178, 179, 183, 187, 189, 192, 195, - 198, 200, 202, 205, 209, 213, 217, 221, 224, 228, 233, 239, 244, 251, 253, 257, 260, 262, 264, 266, 268, - 270, 272, 274, 276, 280, 285, 290, 296, 302, 309, 315, 322, 329, 337, 343, 350, 357, 365, 372, 380, 387, - 395, 403, 412, 420, 429, 434, 437, 440, 444, 446, 450, 452, 455, 459, 464, 470, 472, 474, 476, 479, 483, - 488, 494, 499, 504, 510, 517, 523, 530, 536, 537, 539, 542, 545, 548, 551, 554, 557, 559, 561, 563, 565, - 567, 569, 571, 574, 577, 582, 584, 585, 588, 591, 593, 594, 596, 599, 602, 605, 607, 610, 612, 614, 619, - 623, 625, 627, 632, 637, 643, 649, 654, 659, 661, 663, 666, 670, 673, 677, 680, 684, 687, 690, 693, 696, - 699, 703, 707, 711, 715, 719, 723, 729, 730, 734, 735, 738, 742, 745, 749, 752, 756, 760, 766, 767, 769, - 771, 773, 775, 777, 781, 785, 786, 790, 791, 795, 800, 806, 811, 817, 819, 821, 822, 828, 834, 836}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = { - 94, 0, -1, 95, -1, 95, 86, 96, -1, 96, -1, 125, -1, 102, -1, 99, -1, 97, -1, 100, -1, - 104, -1, -1, 29, 57, 98, 134, -1, 29, 57, 98, 134, 10, 19, -1, 76, 77, -1, -1, 29, 34, - 134, -1, 20, 34, 134, 48, 134, 87, 111, 88, 101, -1, 20, 61, 34, 134, 48, 134, 87, 111, 88, - 101, -1, 123, -1, -1, 20, 57, 103, 133, 87, 105, 88, 123, -1, 20, 57, 103, 133, 87, 105, 88, - -1, 76, 44, 77, -1, -1, 79, 57, 134, -1, 79, 134, -1, 106, -1, 105, 89, 106, -1, 139, -1, - 107, -1, 18, 108, 109, 145, -1, 108, 109, 145, -1, 137, -1, -1, 110, -1, 113, -1, 151, -1, 112, - 87, 111, 88, -1, 136, -1, 111, 89, 136, -1, 51, 38, -1, 61, -1, 31, 38, 87, 111, 88, 52, - 133, 87, 111, 88, 114, 116, -1, 115, -1, -1, 39, 115, -1, 32, -1, 49, -1, 117, -1, -1, 120, - 118, -1, 121, 119, -1, 121, -1, -1, 120, -1, -1, 48, 63, 122, -1, 48, 28, 122, -1, 10, -1, - 55, 45, -1, 55, 25, -1, 43, 3, -1, 54, -1, 124, -1, 123, 124, -1, 30, 90, 80, -1, 40, - 90, 84, -1, 41, 90, 84, -1, 17, 90, 152, -1, 17, 152, -1, 6, 90, 84, -1, 25, 75, 90, - 80, -1, 25, 11, 55, 90, 80, -1, 5, 57, 133, 126, -1, 5, 57, 133, 126, 17, 152, -1, 127, - -1, 126, 89, 127, -1, 126, 127, -1, 135, -1, 165, -1, 167, -1, 131, -1, 130, -1, 132, -1, 128, - -1, 129, -1, 42, 136, 142, -1, 42, 15, 136, 142, -1, 78, 136, 136, 142, -1, 78, 136, 136, 142, - 138, -1, 78, 15, 136, 136, 142, -1, 78, 15, 136, 136, 142, 138, -1, 78, 136, 136, 142, 143, -1, - 78, 15, 136, 136, 142, 143, -1, 78, 136, 136, 142, 143, 138, -1, 78, 15, 136, 136, 142, 143, 138, - -1, 78, 136, 136, 142, 141, -1, 78, 15, 136, 136, 142, 141, -1, 78, 136, 136, 142, 141, 138, -1, - 78, 15, 136, 136, 142, 141, 138, -1, 78, 136, 136, 142, 143, 141, -1, 78, 15, 136, 136, 142, 143, - 141, -1, 78, 136, 136, 142, 141, 143, -1, 78, 15, 136, 136, 142, 141, 143, -1, 78, 136, 136, 142, - 143, 141, 138, -1, 78, 15, 136, 136, 142, 143, 141, 138, -1, 78, 136, 136, 142, 141, 143, 138, -1, - 78, 15, 136, 136, 142, 141, 143, 138, -1, 29, 18, 137, 166, -1, 4, 107, -1, 53, 133, -1, 53, - 60, 133, -1, 134, -1, 80, 91, 80, -1, 80, -1, 4, 139, -1, 4, 15, 139, -1, 4, 87, 105, - 88, -1, 4, 15, 87, 105, 88, -1, 85, -1, 80, -1, 80, -1, 17, 152, -1, 136, 142, 140, -1, - 136, 142, 140, 143, -1, 136, 142, 140, 141, 143, -1, 136, 142, 140, 141, -1, 136, 142, 140, 138, -1, - 136, 142, 140, 143, 138, -1, 136, 142, 140, 141, 143, 138, -1, 136, 142, 140, 143, 141, -1, 136, 142, - 140, 143, 141, 138, -1, 136, 142, 140, 141, 138, -1, -1, 45, -1, 25, 161, -1, 25, 45, -1, 25, - 64, -1, 25, 21, -1, 25, 65, -1, 25, 66, -1, 153, -1, 154, -1, 155, -1, 162, -1, 9, -1, - 14, -1, 144, -1, 143, 144, -1, 150, 145, -1, 18, 137, 150, 145, -1, 146, -1, -1, 149, 147, -1, - 26, 149, -1, 148, -1, -1, 26, -1, 35, 27, -1, 35, 33, -1, 44, 45, -1, 61, -1, 51, 38, - -1, 6, -1, 151, -1, 13, 87, 83, 88, -1, 92, 82, 92, -1, 12, -1, 11, -1, 12, 87, 84, - 88, -1, 11, 87, 84, 88, -1, 12, 69, 87, 84, 88, -1, 11, 69, 87, 84, 88, -1, 67, 87, - 84, 88, -1, 68, 87, 84, 88, -1, 156, -1, 159, -1, 47, 157, -1, 47, 157, 62, -1, 24, 157, - -1, 24, 157, 62, -1, 46, 157, -1, 46, 157, 62, -1, 37, 158, -1, 36, 158, -1, 56, 158, -1, - 59, 158, -1, 7, 158, -1, 37, 158, 62, -1, 36, 158, 62, -1, 56, 158, 62, -1, 59, 158, 62, - -1, 7, 158, 62, -1, 87, 84, 88, -1, 87, 84, 89, 84, 88, -1, -1, 87, 84, 88, -1, -1, - 72, 160, -1, 72, 160, 62, -1, 74, 160, -1, 74, 160, 62, -1, 73, 160, -1, 73, 160, 62, -1, - 87, 84, 88, -1, 87, 84, 89, 84, 88, -1, -1, 84, -1, 152, -1, 81, -1, 22, -1, 85, -1, - 58, 163, 164, -1, 87, 84, 88, -1, -1, 70, 58, 71, -1, -1, 29, 136, 166, -1, 29, 15, 136, - 166, -1, 29, 15, 87, 111, 88, -1, 29, 87, 111, 88, -1, 29, 16, 87, 111, 88, -1, 10, -1, - 54, -1, -1, 5, 168, 136, 55, 141, -1, 5, 168, 136, 29, 25, -1, 15, -1, -1}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = { - 0, 202, 202, 207, 217, 234, 235, 236, 237, 238, 239, 240, 244, 245, 252, 253, 257, - 263, 268, 276, 277, 281, 286, 293, 294, 298, 299, 303, 309, 317, 318, 322, 328, 336, - 337, 341, 342, 343, 347, 357, 362, 370, 371, 375, 382, 383, 387, 391, 392, 396, 397, - 401, 407, 416, 417, 421, 422, 426, 430, 434, 435, 436, 437, 438, 442, 448, 457, 459, - 461, 463, 465, 467, 472, 474, 478, 482, 489, 501, 506, 514, 515, 516, 517, 518, 519, - 520, 521, 526, 529, 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, - 561, 563, 565, 567, 569, 571, 573, 578, 585, 589, 590, 594, 598, 599, 611, 612, 613, - 614, 618, 619, 623, 627, 630, 634, 638, 642, 646, 650, 654, 658, 662, 666, 672, 675, - 679, 683, 684, 685, 686, 687, 691, 692, 693, 694, 695, 700, 709, 714, 722, 733, 748, - 749, 753, 758, 772, 773, 777, 788, 789, 793, 794, 795, 796, 797, 801, 805, 809, 814, - 819, 824, 829, 835, 841, 849, 857, 858, 862, 868, 874, 880, 886, 892, 898, 903, 908, - 913, 918, 923, 928, 933, 938, 943, 951, 952, 953, 957, 958, 962, 967, 972, 977, 982, - 987, 995, 997, 998, 1002, 1003, 1004, 1008, 1014, 1020, 1029, 1030, 1034, 1035, 1039, 1040, 1041, - 1042, 1043, 1047, 1048, 1049, 1053, 1054, 1058, 1059}; -#endif - -#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", - "ACTION", - "ADD", - "ALTER", - "AUTO_INCREMENT", - "BIGINT", - "BIT", - "IDB_BLOB", - "CASCADE", - "IDB_CHAR", - "CHARACTER", - "CHECK", - "CLOB", - "COLUMN", - "COLUMNS", - "COMMENT", - "CONSTRAINT", - "CONSTRAINTS", - "CREATE", - "CURRENT_USER", - "DATETIME", - "DEC", - "DECIMAL", - "DEFAULT", - "DEFERRABLE", - "DEFERRED", - "IDB_DELETE", - "DROP", - "ENGINE", - "FOREIGN", - "FULL", - "IMMEDIATE", - "INDEX", - "INITIALLY", - "IDB_INT", - "INTEGER", - "KEY", - "MATCH", - "MAX_ROWS", - "MIN_ROWS", - "MODIFY", - "NO", - "NOT", - "NULL_TOK", - "NUMBER", - "NUMERIC", - "ON", - "PARTIAL", - "PRECISION", - "PRIMARY", - "REFERENCES", - "RENAME", - "RESTRICT", - "SET", - "SMALLINT", - "TABLE", - "TIME", - "TINYINT", - "TO", - "UNIQUE", - "UNSIGNED", - "UPDATE", - "USER", - "SESSION_USER", - "SYSTEM_USER", - "VARCHAR", - "VARBINARY", - "VARYING", - "WITH", - "ZONE", - "DOUBLE", - "IDB_FLOAT", - "REAL", - "CHARSET", - "IDB_IF", - "EXISTS", - "CHANGE", - "TRUNCATE", - "IDENT", - "FCONST", - "SCONST", - "CP_SEARCH_CONDITION_TEXT", - "ICONST", - "DATE", - "';'", - "'('", - "')'", - "','", - "'='", - "'.'", - "'\\''", - "$accept", - "stmtblock", - "stmtmulti", - "stmt", - "drop_table_statement", - "opt_if_exists", - "drop_index_statement", - "create_index_statement", - "opt_table_options", - "create_table_statement", - "opt_if_not_exists", - "trunc_table_statement", - "table_element_list", - "table_element", - "table_constraint_def", - "opt_constraint_name", - "table_constraint", - "unique_constraint_def", - "column_name_list", - "unique_specifier", - "referential_constraint_def", - "opt_match_type", - "match_type", - "opt_referential_triggered_action", - "referential_triggered_action", - "opt_delete_rule", - "opt_update_rule", - "update_rule", - "delete_rule", - "referential_action", - "table_options", - "table_option", - "alter_table_statement", - "alter_table_actions", - "alter_table_action", - "modify_column", - "rename_column", - "drop_table_constraint_def", - "add_table_constraint_def", - "ata_rename_table", - "table_name", - "qualified_name", - "ata_add_column", - "column_name", - "constraint_name", - "column_option", - "column_def", - "opt_null_tok", - "default_clause", - "data_type", - "column_qualifier_list", - "column_constraint_def", - "opt_constraint_attributes", - "constraint_attributes", - "opt_deferrability_clause", - "deferrability_clause", - "constraint_check_time", - "column_constraint", - "check_constraint_def", - "string_literal", - "character_string_type", - "binary_string_type", - "numeric_type", - "exact_numeric_type", - "opt_precision_scale", - "opt_display_width", - "approximate_numeric_type", - "opt_display_precision_scale_null", - "literal", - "datetime_type", - "opt_time_precision", - "opt_with_time_zone", - "drop_column_def", - "drop_behavior", - "alter_column_def", - "opt_column", - 0}; -#endif - -#ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 59, 40, 41, 44, 61, 46, 39}; -#endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = { - 0, 93, 94, 95, 95, 96, 96, 96, 96, 96, 96, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, - 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 109, 110, 111, 111, 112, - 112, 113, 114, 114, 115, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 121, 122, 122, 122, 122, - 122, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 125, 125, 126, 126, 126, 127, 127, 127, 127, 127, - 127, 127, 127, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 130, 131, 132, 132, 133, 134, 134, 135, 135, 135, 135, 136, 136, 137, 138, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 140, 140, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 142, - 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, 147, 148, 149, 149, 150, 150, 150, 150, 150, 151, 152, - 153, 153, 153, 153, 153, 153, 153, 154, 155, 155, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 157, 157, 157, 158, 158, 159, 159, 159, 159, 159, 159, 160, 160, 160, 161, 161, - 161, 162, 162, 162, 163, 163, 164, 164, 165, 165, 165, 165, 165, 166, 166, 166, 167, 167, 168, 168}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = { - 0, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 0, 4, 6, 2, 0, 3, 9, 10, 1, 0, 8, 7, 3, 0, 3, 2, 1, 3, 1, 1, 4, 3, - 1, 0, 1, 1, 1, 4, 1, 3, 2, 1, 12, 1, 0, 2, 1, 1, 1, 0, 2, 2, 1, 0, 1, 0, 3, 3, 1, 2, 2, 2, 1, 1, 2, - 3, 3, 3, 3, 2, 3, 4, 5, 4, 6, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, - 6, 7, 6, 7, 6, 7, 7, 8, 7, 8, 4, 2, 2, 3, 1, 3, 1, 2, 3, 4, 5, 1, 1, 1, 2, 3, 4, 5, 4, 4, 5, 6, 5, - 6, 5, 0, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 1, 0, 2, 2, 1, 0, 1, 2, 2, 2, 1, 2, 1, - 1, 4, 3, 1, 1, 4, 4, 5, 5, 4, 4, 1, 1, 2, 3, 2, 3, 2, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 5, 0, 3, - 0, 2, 3, 2, 3, 2, 3, 3, 5, 0, 1, 1, 1, 1, 1, 3, 3, 0, 3, 0, 3, 4, 5, 4, 5, 1, 1, 0, 5, 5, 1, 0}; - -/* 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 yytype_uint8 yydefact[] = { - 11, 0, 0, 0, 0, 0, 2, 4, 8, 7, 9, 6, 10, 5, 0, 0, 24, 0, 0, 15, 0, - 115, 26, 1, 11, 0, 113, 0, 0, 0, 0, 16, 0, 0, 25, 0, 3, 34, 229, 0, 0, 0, - 0, 74, 76, 85, 86, 83, 82, 84, 79, 80, 81, 0, 0, 0, 0, 14, 12, 114, 0, 34, 121, - 120, 34, 110, 0, 0, 33, 116, 228, 0, 0, 0, 0, 121, 0, 225, 0, 0, 0, 111, 0, 0, - 0, 0, 78, 0, 23, 34, 0, 0, 34, 117, 122, 0, 0, 27, 30, 29, 0, 0, 0, 42, 153, - 35, 0, 36, 37, 198, 146, 169, 168, 147, 211, 196, 198, 198, 196, 196, 198, 215, 198, 0, 0, 207, - 207, 207, 212, 134, 142, 143, 144, 176, 177, 145, 0, 0, 225, 0, 225, 0, 39, 223, 224, 218, 0, - 87, 112, 0, 0, 0, 75, 77, 0, 0, 0, 13, 0, 153, 118, 34, 0, 0, 41, 0, 0, 32, - 152, 157, 0, 0, 188, 0, 0, 0, 0, 0, 180, 185, 184, 182, 178, 186, 0, 217, 187, 0, 0, - 0, 199, 203, 201, 135, 124, 0, 0, 0, 219, 0, 109, 221, 0, 88, 0, 89, 0, 0, 22, 0, - 119, 31, 28, 0, 0, 155, 159, 160, 158, 154, 156, 0, 0, 193, 0, 0, 0, 0, 0, 181, 190, - 189, 183, 179, 191, 0, 0, 213, 192, 0, 0, 0, 200, 204, 202, 164, 0, 0, 0, 0, 0, 162, - 128, 127, 125, 148, 153, 165, 227, 226, 220, 222, 40, 91, 90, 97, 93, 167, 20, 0, 0, 0, 0, - 0, 0, 21, 64, 0, 166, 0, 38, 197, 0, 171, 0, 170, 194, 0, 214, 0, 174, 175, 205, 0, - 123, 0, 139, 137, 138, 140, 141, 210, 208, 209, 136, 161, 163, 133, 126, 129, 131, 149, 150, 92, 98, - 94, 99, 103, 95, 101, 17, 19, 0, 0, 70, 0, 0, 0, 0, 0, 65, 20, 0, 173, 172, 0, - 216, 0, 153, 130, 132, 100, 104, 96, 102, 107, 105, 71, 69, 0, 0, 66, 67, 68, 18, 0, 195, - 206, 151, 108, 106, 0, 72, 0, 73, 0, 0, 45, 47, 0, 48, 50, 44, 46, 0, 43, 49, 54, - 56, 0, 0, 0, 51, 53, 0, 52, 55, 59, 0, 63, 0, 58, 57, 62, 61, 60}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = { - -1, 5, 6, 7, 8, 33, 9, 10, 320, 11, 29, 12, 96, 97, 98, 66, 104, 105, 141, - 106, 107, 371, 372, 375, 376, 382, 385, 377, 378, 391, 321, 276, 13, 43, 44, 45, 46, 47, - 48, 49, 25, 26, 50, 142, 68, 252, 99, 194, 253, 129, 254, 255, 167, 168, 219, 220, 169, - 256, 257, 152, 130, 131, 132, 133, 178, 172, 134, 190, 304, 135, 185, 237, 51, 145, 52, 71}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -270 -static const yytype_int16 yypact[] = { - 34, -44, 107, 30, 53, 40, -21, -270, -270, -270, -270, -270, -270, -270, 9, 9, 20, - 74, 9, 42, 9, 58, -270, -270, 34, 3, -270, 117, 127, 9, 9, -270, 97, 9, - -270, 104, -270, 35, 172, 82, 21, 43, 27, 100, -270, -270, -270, -270, -270, -270, -270, - -270, -270, 9, 114, 109, 174, -270, 210, -270, 168, 145, 115, -270, 29, -270, 124, 136, - -270, -270, -270, -56, 178, 141, 145, -270, -56, 23, -56, 136, 9, -270, -56, -56, 162, - 3, -270, 150, -270, 29, 9, 237, 29, -270, -270, 124, 123, -270, -270, -270, 173, 226, - 228, -270, 76, -270, 207, -270, -270, 208, -270, -59, 83, -270, -270, 211, 208, 208, 211, - 211, 208, 212, 208, 213, 214, 215, 215, 215, -270, 244, -270, -270, -270, -270, -270, -270, - 38, -56, 23, -56, 23, 154, -270, -270, -270, -270, 136, -270, -270, -56, 136, 221, -270, - -270, -56, 179, 217, -270, 181, 76, -270, 29, 222, 219, -270, 261, 130, -270, -270, 271, - -56, 223, 246, 224, 225, 227, 229, 231, 248, 250, 254, 255, 256, 257, 236, 251, 260, - 239, 240, 241, 265, 266, 267, -270, 180, 305, 306, 183, -270, 185, -270, -270, -56, -270, - 136, 180, 242, 187, 209, -56, -270, -270, -270, 245, -56, -270, -270, -270, -270, -270, -270, - 189, 247, -270, 252, 249, 258, 253, 193, -270, -270, -270, -270, -270, -270, 259, 274, -270, - -270, 262, 263, 195, -270, -270, -270, -270, 162, 145, 135, 293, 301, -270, -270, 200, 180, - -270, 76, -270, -270, -270, -270, -270, -270, 180, -270, 200, 180, -270, 209, 264, 98, 0, - 268, 269, 270, 209, -270, 197, -270, 199, -270, -270, 273, -270, 275, -270, -270, 272, -270, - 277, -270, -270, -270, 278, -270, 201, -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, - -270, -270, 200, -270, 323, -270, -270, -270, 200, 180, -270, 200, -270, 323, -270, 209, 280, - 162, -270, 288, 276, 285, 283, 284, -270, 209, 292, -270, -270, 281, -270, 282, 76, -270, - -270, -270, 200, -270, 323, -270, -270, -270, -270, 286, 291, -270, -270, -270, -270, 9, -270, - -270, -270, -270, -270, 294, -270, 290, -270, -56, 202, 191, -270, 191, -270, 297, -270, -270, - -1, -270, -270, 298, 304, 192, 192, 321, -270, -270, 309, -270, -270, -270, 350, -270, 99, - -270, -270, -270, -270, -270}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = { - -270, -270, -270, 331, -270, -270, -270, -270, 26, -270, -270, -270, 62, 218, 336, 314, - 287, -270, -136, -270, -270, -270, 11, -270, -270, -270, -270, 6, 1, 7, 175, -269, - -270, -270, -28, -270, -270, -270, -270, -270, -29, 5, -270, -23, -70, -183, 79, -270, - -175, -74, -179, -223, -157, -270, -270, -270, 216, 90, -5, -202, -270, -270, -270, -270, - 161, 116, -270, 166, -270, -270, -270, -270, -270, 119, -270, -270}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -123 -static const yytype_int16 yytable[] = { - 55, 197, 211, 199, 140, 147, 330, 37, 38, 22, 173, 325, 81, 14, 67, 86, 77, 79, 207, 83, - 27, 259, 264, 31, 75, 34, 266, 379, 174, 63, 265, 311, 39, 143, 221, 56, 78, 67, 58, 1, - 23, 67, 82, 311, 294, 40, 303, 61, 136, 138, 60, 148, 330, 61, 2, 146, 41, 153, 87, 149, - 150, 108, 380, 3, 18, 24, 67, 195, 324, 67, 307, 309, 203, 277, 308, 326, 205, 144, 279, 310, - 313, 42, 316, 318, 315, 311, 317, 19, 314, 21, 108, 319, 311, 196, 311, 156, 28, 72, 73, 312, - 74, 75, 165, 80, 37, 38, 63, 75, 30, 62, 20, 166, 63, 4, 63, 62, 69, 84, 32, 311, - 63, 348, 64, 21, 394, 339, 204, 340, -122, 39, 263, 341, 343, 21, 345, 342, 346, 100, 67, 93, - 344, 15, 40, 109, 395, 110, -122, 111, 112, 35, 113, 155, 175, 41, 158, 101, 296, 216, 114, 359, - 115, 360, 75, 217, 16, 53, -122, 63, 17, 76, 176, 54, 116, 117, 57, 102, -122, 295, 42, 262, - 297, 358, 118, 119, 59, 103, 245, 70, 323, 85, 151, 88, 120, 100, 121, 122, 89, 246, 247, 298, - 299, 300, 387, 123, 124, 248, 245, 245, 125, 126, 127, 160, 161, 100, 100, 269, 301, 246, 247, 302, - 91, 128, 90, 368, 249, 94, 270, 151, 139, 366, 369, 250, 179, 180, 271, 388, 183, 154, 186, 272, - 370, 251, 201, 202, 249, 249, 389, 390, 75, 273, 274, 250, 250, 63, 151, 92, 157, 198, 75, 200, - 162, 251, 251, 63, 163, 137, 164, 208, 161, 210, 161, 260, 202, 261, 202, 268, 202, 280, 202, 181, - 182, 286, 287, 292, 293, 331, 202, 332, 202, 193, 367, 202, 191, 192, 170, 171, 166, 218, 177, 184, - 187, 188, 189, 206, 209, 213, 214, 222, 223, 225, 229, 224, 230, 227, 226, 228, 231, 232, 233, 234, - 235, 236, 238, 239, 240, 241, 363, 242, 243, 244, 258, 248, 289, 278, 267, 281, 282, 283, 305, 306, - 246, 285, 284, 349, 355, 374, 381, 288, 336, 379, 290, 291, 384, 393, 322, 36, 335, 354, 327, 328, - 329, 333, 337, 334, 347, 351, 350, 352, 353, 356, 357, 362, 380, 65, 364, 95, 361, 365, 383, 212, - 373, 215, 159, 275, 386, 338, 0, 392}; - -static const yytype_int16 yycheck[] = { - 29, 137, 159, 139, 74, 79, 275, 4, 5, 4, 69, 11, 41, 57, 37, 43, 39, 40, 154, 42, 15, - 196, 205, 18, 80, 20, 205, 28, 87, 85, 205, 254, 29, 10, 170, 30, 15, 60, 33, 5, 0, 64, - 15, 266, 246, 42, 248, 18, 71, 72, 15, 80, 321, 18, 20, 78, 53, 85, 53, 82, 83, 66, 63, - 29, 34, 86, 89, 29, 270, 92, 253, 254, 146, 209, 253, 75, 150, 54, 214, 254, 263, 78, 265, 266, - 263, 308, 265, 57, 263, 80, 95, 266, 315, 55, 317, 90, 76, 15, 16, 256, 18, 80, 26, 60, 4, - 5, 85, 80, 34, 80, 57, 35, 85, 79, 85, 80, 37, 17, 76, 342, 85, 323, 87, 80, 25, 308, - 149, 310, 13, 29, 204, 314, 315, 80, 317, 314, 319, 13, 161, 60, 315, 34, 42, 7, 45, 9, 31, - 11, 12, 91, 14, 89, 69, 53, 92, 31, 21, 27, 22, 342, 24, 344, 80, 33, 57, 48, 51, 85, - 61, 87, 87, 44, 36, 37, 77, 51, 61, 247, 78, 202, 45, 338, 46, 47, 80, 61, 6, 15, 90, - 89, 92, 77, 56, 13, 58, 59, 87, 17, 18, 64, 65, 66, 10, 67, 68, 25, 6, 6, 72, 73, - 74, 88, 89, 13, 13, 6, 81, 17, 18, 84, 10, 85, 48, 32, 44, 80, 17, 92, 87, 365, 39, - 51, 116, 117, 25, 43, 120, 87, 122, 30, 49, 61, 88, 89, 44, 44, 54, 55, 80, 40, 41, 51, - 51, 85, 92, 87, 19, 138, 80, 140, 87, 61, 61, 85, 38, 87, 38, 88, 89, 88, 89, 88, 89, - 88, 89, 88, 89, 88, 89, 118, 119, 88, 89, 88, 89, 88, 89, 88, 89, 45, 88, 89, 126, 127, - 87, 87, 35, 26, 87, 87, 87, 87, 87, 82, 87, 83, 87, 84, 62, 84, 62, 87, 62, 84, 87, - 84, 62, 62, 62, 62, 84, 70, 62, 84, 84, 84, 355, 62, 62, 62, 25, 25, 58, 88, 92, 88, - 84, 88, 45, 38, 17, 88, 84, 55, 52, 48, 48, 88, 71, 28, 88, 88, 48, 3, 90, 24, 84, - 331, 90, 90, 90, 88, 84, 88, 84, 80, 90, 84, 84, 88, 88, 80, 63, 37, 80, 61, 90, 87, - 377, 161, 369, 165, 95, 208, 378, 295, -1, 380}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = { - 0, 5, 20, 29, 79, 94, 95, 96, 97, 99, 100, 102, 104, 125, 57, 34, 57, 61, 34, 57, 57, - 80, 134, 0, 86, 133, 134, 134, 76, 103, 34, 134, 76, 98, 134, 91, 96, 4, 5, 29, 42, 53, - 78, 126, 127, 128, 129, 130, 131, 132, 135, 165, 167, 48, 44, 133, 134, 77, 134, 80, 15, 18, 80, - 85, 87, 107, 108, 136, 137, 139, 15, 168, 15, 16, 18, 80, 87, 136, 15, 136, 60, 133, 15, 136, - 17, 89, 127, 134, 77, 87, 48, 10, 87, 139, 80, 108, 105, 106, 107, 139, 13, 31, 51, 61, 109, - 110, 112, 113, 151, 7, 9, 11, 12, 14, 22, 24, 36, 37, 46, 47, 56, 58, 59, 67, 68, 72, - 73, 74, 85, 142, 153, 154, 155, 156, 159, 162, 136, 87, 136, 87, 137, 111, 136, 10, 54, 166, 136, - 142, 133, 136, 136, 92, 152, 127, 87, 105, 134, 19, 105, 109, 88, 89, 87, 38, 38, 26, 35, 145, - 146, 149, 87, 87, 158, 69, 87, 69, 87, 87, 157, 158, 158, 157, 157, 158, 87, 163, 158, 87, 87, - 87, 160, 160, 160, 45, 140, 29, 55, 111, 166, 111, 166, 88, 89, 142, 136, 142, 82, 111, 88, 87, - 88, 145, 106, 83, 87, 149, 27, 33, 26, 147, 148, 111, 84, 62, 87, 84, 87, 84, 84, 62, 62, - 62, 62, 62, 62, 84, 70, 164, 62, 84, 84, 84, 62, 62, 62, 6, 17, 18, 25, 44, 51, 61, - 138, 141, 143, 144, 150, 151, 25, 141, 88, 88, 136, 142, 138, 141, 143, 92, 88, 6, 17, 25, 30, - 40, 41, 123, 124, 111, 88, 111, 88, 88, 84, 88, 84, 88, 88, 89, 88, 58, 88, 88, 88, 89, - 152, 137, 21, 45, 64, 65, 66, 81, 84, 152, 161, 45, 38, 138, 143, 138, 141, 144, 145, 138, 141, - 143, 138, 143, 138, 141, 101, 123, 90, 90, 152, 11, 75, 90, 90, 90, 124, 88, 88, 88, 88, 84, - 71, 84, 150, 138, 138, 138, 143, 138, 141, 138, 138, 84, 152, 55, 90, 80, 84, 84, 101, 52, 88, - 88, 145, 138, 138, 90, 80, 133, 80, 87, 111, 88, 32, 39, 49, 114, 115, 115, 48, 116, 117, 120, - 121, 28, 63, 48, 118, 121, 48, 119, 120, 10, 43, 54, 55, 122, 122, 3, 25, 45}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE(yychar); \ - YYPOPSTACK(1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror(YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (YYID(0)) - -#define YYTERROR 1 -#define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -#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 -#define YYLEX yylex(YYLEX_PARAM) -#else -#define YYLEX yylex() -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -#ifndef YYFPRINTF -#include /* INFRINGES ON USER NAME SPACE */ -#define YYFPRINTF fprintf -#endif - -#define YYDPRINTF(Args) \ - do \ - { \ - if (yydebug) \ - YYFPRINTF Args; \ - } while (YYID(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)) - -/*--------------------------------. -| 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 __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yy_stack_print(yytype_int16* yybottom, yytype_int16* yytop) -#else -static void yy_stack_print(yybottom, yytop) yytype_int16* yybottom; -yytype_int16* yytop; -#endif -{ - YYFPRINTF(stderr, "Stack now"); - - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF(stderr, " %d", yybot); - } - - YYFPRINTF(stderr, "\n"); -} - -#define YY_STACK_PRINT(Bottom, Top) \ - do \ - { \ - if (yydebug) \ - yy_stack_print((Bottom), (Top)); \ - } while (YYID(0)) - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yy_reduce_print(YYSTYPE* yyvsp, int yyrule) -#else -static void yy_reduce_print(yyvsp, yyrule) YYSTYPE* yyvsp; -int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - 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++) - { - YYFPRINTF(stderr, " $%d = ", yyi + 1); - yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)])); - YYFPRINTF(stderr, "\n"); - } -} - -#define YY_REDUCE_PRINT(Rule) \ - do \ - { \ - if (yydebug) \ - 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 YY_SYMBOL_PRINT(Title, Type, Value, Location) -#define YY_STACK_PRINT(Bottom, Top) -#define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -#if YYERROR_VERBOSE - -#ifndef yystrlen -#if defined __GLIBC__ && defined _STRING_H -#define yystrlen strlen -#else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T yystrlen(const char* yystr) -#else -static YYSIZE_T yystrlen(yystr) const char* yystr; -#endif -{ - YYSIZE_T yylen; - - for (yylen = 0; yystr[yylen]; yylen++) - continue; - - return yylen; -} -#endif -#endif - -#ifndef yystpcpy -#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -#define yystpcpy stpcpy -#else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static char* yystpcpy(char* yydest, const char* yysrc) -#else -static char* yystpcpy(yydest, yysrc) char* yydest; -const char* yysrc; -#endif -{ - char* yyd = yydest; - const char* yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -#endif -#endif - -#ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T yytnamerr(char* yyres, const char* yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const* yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - - return yyn; - } - - do_not_strip_quotes:; - } - - if (!yyres) - return yystrlen(yystr); - - return yystpcpy(yyres, yystr) - yyres; -} -#endif - -/* Copy into 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) -{ - int yyn = yypact[yystate]; - - if (!(YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - 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 - 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; - - /* 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; - } -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yydestruct(const char* yymsg, int yytype, YYSTYPE* yyvaluep) -#else -static void yydestruct(yymsg, yytype, yyvaluep) const char* yymsg; -int yytype; -YYSTYPE* yyvaluep; -#endif -{ - YYUSE(yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - - YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - default: break; - } -} - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse(void* YYPARSE_PARAM); -#else -int yyparse(); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse(void); -#else -int yyparse(); -#endif -#endif /* ! YYPARSE_PARAM */ - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - -#ifdef YYPARSE_PARAM -#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 __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -int yyparse(void) -#else -int yyparse() - -#endif -#endif -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16* yyss; - yytype_int16* yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE* yyvs; - YYSTYPE* yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char* yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - - /*------------------------------------------------------------. - | yynewstate -- Push a new state, which is found in yystate. | - `------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - -yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE* yyvs1 = yyvs; - yytype_int16* yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow(YY_("memory exhausted"), &yyss1, yysize * sizeof(*yyssp), &yyvs1, yysize * sizeof(*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -#ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - - yystacksize *= 2; - - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16* yyss1 = yyss; - union yyalloc* yyptr = (union yyalloc*)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize)); - - if (!yyptr) - goto yyexhaustedlab; - - YYSTACK_RELOCATE(yyss_alloc, yyss); - YYSTACK_RELOCATE(yyvs_alloc, yyvs); -#undef YYSTACK_RELOCATE - - if (yyss1 != yyssa) - YYSTACK_FREE(yyss1); - } -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF((stderr, "Stack size increased to %lu\n", (unsigned long int)yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - /*-----------. - | yybackup. | - `-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE(yychar); - YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - - yyn = yytable[yyn]; - - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - - if (yyn == 0) - goto yyerrlab; - - goto yyreduce; - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1 - yylen]; - - YY_REDUCE_PRINT(yyn); - - switch (yyn) - { - case 2: - - { - parseTree = (yyvsp[(1) - (1)].sqlStmtList); - ; - } - break; - - case 3: - - { - if ((yyvsp[(3) - (3)].sqlStmt) != NULL) - { - (yyvsp[(1) - (3)].sqlStmtList)->push_back((yyvsp[(3) - (3)].sqlStmt)); - (yyval.sqlStmtList) = (yyvsp[(1) - (3)].sqlStmtList); - } - else - { - (yyval.sqlStmtList) = (yyvsp[(1) - (3)].sqlStmtList); - } - - ; - } - break; - - case 4: - - { - /* The user is supposed to supply a ParseTree* via grammar_init. - So, it is already there. */ - if ((yyvsp[(1) - (1)].sqlStmt) != NULL) - { - (yyval.sqlStmtList) = parseTree; - (yyval.sqlStmtList)->push_back((yyvsp[(1) - (1)].sqlStmt)); - } - else - { - (yyval.sqlStmtList) = NULL; - } - - ; - } - break; - - case 11: - - { - (yyval.sqlStmt) = NULL; - ; - } - break; - - case 12: - - { - (yyval.sqlStmt) = new DropTableStatement((yyvsp[(4) - (4)].qualifiedName), false); - ; - } - break; - - case 13: - - { - { - (yyval.sqlStmt) = new DropTableStatement((yyvsp[(4) - (6)].qualifiedName), true); - }; - } - break; - - case 14: - - { - (yyval.str) = NULL; - ; - } - break; - - case 15: - - { - (yyval.str) = NULL; - ; - } - break; - - case 16: - - { - (yyval.sqlStmt) = new DropIndexStatement((yyvsp[(3) - (3)].qualifiedName)); - ; - } - break; - - case 17: - - { - (yyval.sqlStmt) = - new CreateIndexStatement((yyvsp[(3) - (9)].qualifiedName), (yyvsp[(5) - (9)].qualifiedName), - (yyvsp[(7) - (9)].columnNameList), false); - delete (yyvsp[(9) - (9)].tableOptionMap); - ; - } - break; - - case 18: - - { - (yyval.sqlStmt) = - new CreateIndexStatement((yyvsp[(4) - (10)].qualifiedName), (yyvsp[(6) - (10)].qualifiedName), - (yyvsp[(8) - (10)].columnNameList), true); - delete (yyvsp[(10) - (10)].tableOptionMap); - ; - } - break; - - case 20: - - { - (yyval.tableOptionMap) = NULL; - ; - } - break; - - case 21: - - { - (yyval.sqlStmt) = new CreateTableStatement(new TableDef((yyvsp[(4) - (8)].qualifiedName), - (yyvsp[(6) - (8)].tableElementList), - (yyvsp[(8) - (8)].tableOptionMap))); - ; - } - break; - - case 22: - - { - (yyval.sqlStmt) = new CreateTableStatement( - new TableDef((yyvsp[(4) - (7)].qualifiedName), (yyvsp[(6) - (7)].tableElementList), NULL)); - ; - } - break; - - case 23: - - { - (yyval.str) = NULL; - ; - } - break; - - case 24: - - { - (yyval.str) = NULL; - ; - } - break; - - case 25: - - { - (yyval.sqlStmt) = new TruncTableStatement((yyvsp[(3) - (3)].qualifiedName)); - ; - } - break; - - case 26: - - { - { - (yyval.sqlStmt) = new TruncTableStatement((yyvsp[(2) - (2)].qualifiedName)); - }; - } - break; - - case 27: - - { - (yyval.tableElementList) = new TableElementList(); - (yyval.tableElementList)->push_back((yyvsp[(1) - (1)].schemaObject)); - ; - } - break; - - case 28: - - { - (yyval.tableElementList) = (yyvsp[(1) - (3)].tableElementList); - (yyval.tableElementList)->push_back((yyvsp[(3) - (3)].schemaObject)); - ; - } - break; - - case 31: - - { - (yyval.schemaObject) = (yyvsp[(3) - (4)].schemaObject); - (yyvsp[(3) - (4)].schemaObject)->fName = (yyvsp[(2) - (4)].str); - ; - } - break; - - case 32: - - { - (yyval.schemaObject) = (yyvsp[(2) - (3)].schemaObject); - (yyvsp[(2) - (3)].schemaObject)->fName = (yyvsp[(1) - (3)].str); - ; - } - break; - - case 33: - - { - (yyval.str) = (yyvsp[(1) - (1)].str); - ; - } - break; - - case 34: - - { - (yyval.str) = "noname"; - ; - } - break; - - case 37: - - { - (yyval.schemaObject) = new TableCheckConstraintDef((yyvsp[(1) - (1)].str)); - ; - } - break; - - case 38: - - { - if ((yyvsp[(1) - (4)].constraintType) == DDL_UNIQUE) - (yyval.schemaObject) = new TableUniqueConstraintDef((yyvsp[(3) - (4)].columnNameList)); - else if ((yyvsp[(1) - (4)].constraintType) == DDL_PRIMARY_KEY) - (yyval.schemaObject) = new TablePrimaryKeyConstraintDef((yyvsp[(3) - (4)].columnNameList)); - - ; - } - break; - - case 39: - - { - (yyval.columnNameList) = new vector; - (yyval.columnNameList)->push_back((yyvsp[(1) - (1)].str)); - ; - } - break; - - case 40: - - { - (yyval.columnNameList) = (yyvsp[(1) - (3)].columnNameList); - (yyval.columnNameList)->push_back((yyvsp[(3) - (3)].str)); - ; - } - break; - - case 41: - - { - (yyval.constraintType) = DDL_PRIMARY_KEY; - ; - } - break; - - case 42: - - { - (yyval.constraintType) = DDL_UNIQUE; - ; - } - break; - - case 43: - - { - (yyval.schemaObject) = new TableReferencesConstraintDef( - (yyvsp[(4) - (12)].columnNameList), (yyvsp[(7) - (12)].qualifiedName), - (yyvsp[(9) - (12)].columnNameList), (yyvsp[(11) - (12)].matchType), (yyvsp[(12) - (12)].refAction)); - ; - } - break; - - case 45: - - { - (yyval.matchType) = DDL_FULL; - ; - } - break; - - case 46: - - { - (yyval.matchType) = (yyvsp[(2) - (2)].matchType); - ; - } - break; - - case 47: - - { - (yyval.matchType) = DDL_FULL; - ; - } - break; - - case 48: - - { - (yyval.matchType) = DDL_PARTIAL; - ; - } - break; - - case 50: - - { - (yyval.refAction) = NULL; - ; - } - break; - - case 51: - - { - (yyval.refAction) = new ReferentialAction(); - (yyval.refAction)->fOnUpdate = (yyvsp[(1) - (2)].refActionCode); - (yyval.refAction)->fOnDelete = (yyvsp[(2) - (2)].refActionCode); - ; - } - break; - - case 52: - - { - (yyval.refAction) = new ReferentialAction(); - (yyval.refAction)->fOnUpdate = (yyvsp[(2) - (2)].refActionCode); - (yyval.refAction)->fOnDelete = (yyvsp[(1) - (2)].refActionCode); - ; - } - break; - - case 54: - - { - (yyval.refActionCode) = DDL_NO_ACTION; - ; - } - break; - - case 56: - - { - (yyval.refActionCode) = DDL_NO_ACTION; - ; - } - break; - - case 57: - - { - (yyval.refActionCode) = (yyvsp[(3) - (3)].refActionCode); - ; - } - break; - - case 58: - - { - (yyval.refActionCode) = (yyvsp[(3) - (3)].refActionCode); - ; - } - break; - - case 59: - - { - (yyval.refActionCode) = DDL_CASCADE; - ; - } - break; - - case 60: - - { - (yyval.refActionCode) = DDL_SET_NULL; - ; - } - break; - - case 61: - - { - (yyval.refActionCode) = DDL_SET_DEFAULT; - ; - } - break; - - case 62: - - { - (yyval.refActionCode) = DDL_NO_ACTION; - ; - } - break; - - case 63: - - { - (yyval.refActionCode) = DDL_RESTRICT; - ; - } - break; - - case 64: - - { - (yyval.tableOptionMap) = new TableOptionMap(); - (*(yyval.tableOptionMap))[(yyvsp[(1) - (1)].tableOption)->first] = - (yyvsp[(1) - (1)].tableOption)->second; - delete (yyvsp[(1) - (1)].tableOption); - ; - } - break; - - case 65: - - { - (yyval.tableOptionMap) = (yyvsp[(1) - (2)].tableOptionMap); - (*(yyval.tableOptionMap))[(yyvsp[(2) - (2)].tableOption)->first] = - (yyvsp[(2) - (2)].tableOption)->second; - delete (yyvsp[(2) - (2)].tableOption); - ; - } - break; - - case 66: - - { - (yyval.tableOption) = new pair("engine", (yyvsp[(3) - (3)].str)); - ; - } - break; - - case 67: - - { - (yyval.tableOption) = new pair("max_rows", (yyvsp[(3) - (3)].str)); - ; - } - break; - - case 68: - - { - (yyval.tableOption) = new pair("min_rows", (yyvsp[(3) - (3)].str)); - ; - } - break; - - case 69: - - { - (yyval.tableOption) = new pair("comment", (yyvsp[(3) - (3)].str)); - ; - } - break; - - case 70: - - { - (yyval.tableOption) = new pair("comment", (yyvsp[(2) - (2)].str)); - ; - } - break; - - case 71: - - { - (yyval.tableOption) = new pair("auto_increment", (yyvsp[(3) - (3)].str)); - ; - } - break; - - case 72: - - { - (yyval.tableOption) = new pair("default charset", (yyvsp[(4) - (4)].str)); - ; - } - break; - - case 73: - - { - (yyval.tableOption) = new pair("default charset", (yyvsp[(5) - (5)].str)); - ; - } - break; - - case 74: - - { - (yyval.sqlStmt) = new AlterTableStatement((yyvsp[(3) - (4)].qualifiedName), (yyvsp[(4) - (4)].ataList)); - ; - } - break; - - case 75: - - { - (yyval.sqlStmt) = new AlterTableStatement((yyvsp[(3) - (6)].qualifiedName), (yyvsp[(4) - (6)].ataList)); - ; - } - break; - - case 76: - - { - if ((yyvsp[(1) - (1)].ata) != NULL) - { - (yyval.ataList) = new AlterTableActionList(); - (yyval.ataList)->push_back((yyvsp[(1) - (1)].ata)); - } - else - { - /* An alter_table_statement requires at least one action. - So, this shouldn't happen. */ - (yyval.ataList) = NULL; - } - - ; - } - break; - - case 77: - - { - (yyval.ataList) = (yyvsp[(1) - (3)].ataList); - (yyval.ataList)->push_back((yyvsp[(3) - (3)].ata)); - ; - } - break; - - case 78: - - { - (yyval.ataList) = (yyvsp[(1) - (2)].ataList); - (yyval.ataList)->push_back((yyvsp[(2) - (2)].ata)); - ; - } - break; - - case 87: - - { - (yyval.ata) = new AtaModifyColumnType((yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].columnType)); - ; - } - break; - - case 88: - - { - (yyval.ata) = new AtaModifyColumnType((yyvsp[(3) - (4)].str), (yyvsp[(4) - (4)].columnType)); - ; - } - break; - - case 89: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(2) - (4)].str), (yyvsp[(3) - (4)].str), - (yyvsp[(4) - (4)].columnType), NULL); - ; - } - break; - - case 90: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(2) - (5)].str), (yyvsp[(3) - (5)].str), - (yyvsp[(4) - (5)].columnType), (yyvsp[(5) - (5)].columnOption)); - ; - } - break; - - case 91: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(3) - (5)].str), (yyvsp[(4) - (5)].str), - (yyvsp[(5) - (5)].columnType), NULL); - ; - } - break; - - case 92: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(3) - (6)].str), (yyvsp[(4) - (6)].str), - (yyvsp[(5) - (6)].columnType), (yyvsp[(6) - (6)].columnOption)); - ; - } - break; - - case 93: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(2) - (5)].str), (yyvsp[(3) - (5)].str), (yyvsp[(4) - (5)].columnType), - (yyvsp[(5) - (5)].constraintList), NULL); - ; - } - break; - - case 94: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(3) - (6)].str), (yyvsp[(4) - (6)].str), (yyvsp[(5) - (6)].columnType), - (yyvsp[(6) - (6)].constraintList), NULL); - ; - } - break; - - case 95: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(2) - (6)].str), (yyvsp[(3) - (6)].str), (yyvsp[(4) - (6)].columnType), - (yyvsp[(5) - (6)].constraintList), NULL, (yyvsp[(6) - (6)].columnOption)); - ; - } - break; - - case 96: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(3) - (7)].str), (yyvsp[(4) - (7)].str), (yyvsp[(5) - (7)].columnType), - (yyvsp[(6) - (7)].constraintList), NULL, (yyvsp[(7) - (7)].columnOption)); - ; - } - break; - - case 97: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(2) - (5)].str), (yyvsp[(3) - (5)].str), - (yyvsp[(4) - (5)].columnType), NULL, (yyvsp[(5) - (5)].colDefault)); - ; - } - break; - - case 98: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(3) - (6)].str), (yyvsp[(4) - (6)].str), - (yyvsp[(5) - (6)].columnType), NULL, (yyvsp[(6) - (6)].colDefault)); - ; - } - break; - - case 99: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(2) - (6)].str), (yyvsp[(3) - (6)].str), (yyvsp[(4) - (6)].columnType), - NULL, (yyvsp[(5) - (6)].colDefault), (yyvsp[(6) - (6)].columnOption)); - ; - } - break; - - case 100: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(3) - (7)].str), (yyvsp[(4) - (7)].str), (yyvsp[(5) - (7)].columnType), - NULL, (yyvsp[(6) - (7)].colDefault), (yyvsp[(7) - (7)].columnOption)); - ; - } - break; - - case 101: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(2) - (6)].str), (yyvsp[(3) - (6)].str), (yyvsp[(4) - (6)].columnType), - (yyvsp[(5) - (6)].constraintList), (yyvsp[(6) - (6)].colDefault)); - ; - } - break; - - case 102: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(3) - (7)].str), (yyvsp[(4) - (7)].str), (yyvsp[(5) - (7)].columnType), - (yyvsp[(6) - (7)].constraintList), (yyvsp[(7) - (7)].colDefault)); - ; - } - break; - - case 103: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(2) - (6)].str), (yyvsp[(3) - (6)].str), (yyvsp[(4) - (6)].columnType), - (yyvsp[(6) - (6)].constraintList), (yyvsp[(5) - (6)].colDefault)); - ; - } - break; - - case 104: - - { - (yyval.ata) = - new AtaRenameColumn((yyvsp[(3) - (7)].str), (yyvsp[(4) - (7)].str), (yyvsp[(5) - (7)].columnType), - (yyvsp[(7) - (7)].constraintList), (yyvsp[(6) - (7)].colDefault)); - ; - } - break; - - case 105: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(2) - (7)].str), (yyvsp[(3) - (7)].str), - (yyvsp[(4) - (7)].columnType), (yyvsp[(5) - (7)].constraintList), - (yyvsp[(6) - (7)].colDefault), (yyvsp[(7) - (7)].columnOption)); - ; - } - break; - - case 106: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(3) - (8)].str), (yyvsp[(4) - (8)].str), - (yyvsp[(5) - (8)].columnType), (yyvsp[(6) - (8)].constraintList), - (yyvsp[(7) - (8)].colDefault), (yyvsp[(8) - (8)].columnOption)); - ; - } - break; - - case 107: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(2) - (7)].str), (yyvsp[(3) - (7)].str), - (yyvsp[(4) - (7)].columnType), (yyvsp[(6) - (7)].constraintList), - (yyvsp[(5) - (7)].colDefault), (yyvsp[(7) - (7)].columnOption)); - ; - } - break; - - case 108: - - { - (yyval.ata) = new AtaRenameColumn((yyvsp[(3) - (8)].str), (yyvsp[(4) - (8)].str), - (yyvsp[(5) - (8)].columnType), (yyvsp[(7) - (8)].constraintList), - (yyvsp[(6) - (8)].colDefault), (yyvsp[(8) - (8)].columnOption)); - ; - } - break; - - case 109: - - { - (yyval.ata) = new AtaDropTableConstraint((yyvsp[(3) - (4)].str), (yyvsp[(4) - (4)].refActionCode)); - ; - } - break; - - case 110: - - { - (yyval.ata) = - new AtaAddTableConstraint(dynamic_cast((yyvsp[(2) - (2)].schemaObject))); - ; - } - break; - - case 111: - - { - (yyval.ata) = new AtaRenameTable((yyvsp[(2) - (2)].qualifiedName)); - ; - } - break; - - case 112: - - { - (yyval.ata) = new AtaRenameTable((yyvsp[(3) - (3)].qualifiedName)); - ; - } - break; - - case 114: - - { - (yyval.qualifiedName) = new QualifiedName((yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)); - ; - } - break; - - case 115: - - { - if (db_schema.size()) - (yyval.qualifiedName) = new QualifiedName((char*)db_schema.c_str(), (yyvsp[(1) - (1)].str)); - else - (yyval.qualifiedName) = new QualifiedName((yyvsp[(1) - (1)].str)); - - ; - } - break; - - case 116: - - { - (yyval.ata) = new AtaAddColumn(dynamic_cast((yyvsp[(2) - (2)].schemaObject))); - ; - } - break; - - case 117: - - { - (yyval.ata) = new AtaAddColumn(dynamic_cast((yyvsp[(3) - (3)].schemaObject))); - ; - } - break; - - case 118: - - { - (yyval.ata) = new AtaAddColumns((yyvsp[(3) - (4)].tableElementList)); - ; - } - break; - - case 119: - - { - (yyval.ata) = new AtaAddColumns((yyvsp[(4) - (5)].tableElementList)); - ; - } - break; - - case 123: - - { - (yyval.columnOption) = (yyvsp[(2) - (2)].str); - ; - } - break; - - case 124: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (3)].str), (yyvsp[(2) - (3)].columnType), NULL, NULL); - ; - } - break; - - case 125: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (4)].str), (yyvsp[(2) - (4)].columnType), - (yyvsp[(4) - (4)].constraintList), NULL); - ; - } - break; - - case 126: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (5)].str), (yyvsp[(2) - (5)].columnType), - (yyvsp[(5) - (5)].constraintList), (yyvsp[(4) - (5)].colDefault)); - ; - } - break; - - case 127: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (4)].str), (yyvsp[(2) - (4)].columnType), NULL, - (yyvsp[(4) - (4)].colDefault), NULL); - ; - } - break; - - case 128: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (4)].str), (yyvsp[(2) - (4)].columnType), NULL, NULL, - (yyvsp[(4) - (4)].columnOption)); - ; - } - break; - - case 129: - - { - (yyval.schemaObject) = - new ColumnDef((yyvsp[(1) - (5)].str), (yyvsp[(2) - (5)].columnType), - (yyvsp[(4) - (5)].constraintList), NULL, (yyvsp[(5) - (5)].columnOption)); - ; - } - break; - - case 130: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (6)].str), (yyvsp[(2) - (6)].columnType), - (yyvsp[(5) - (6)].constraintList), (yyvsp[(4) - (6)].colDefault), - (yyvsp[(6) - (6)].columnOption)); - ; - } - break; - - case 131: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (5)].str), (yyvsp[(2) - (5)].columnType), - (yyvsp[(4) - (5)].constraintList), (yyvsp[(5) - (5)].colDefault)); - ; - } - break; - - case 132: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (6)].str), (yyvsp[(2) - (6)].columnType), - (yyvsp[(4) - (6)].constraintList), (yyvsp[(5) - (6)].colDefault), - (yyvsp[(6) - (6)].columnOption)); - ; - } - break; - - case 133: - - { - (yyval.schemaObject) = new ColumnDef((yyvsp[(1) - (5)].str), (yyvsp[(2) - (5)].columnType), NULL, - (yyvsp[(4) - (5)].colDefault), (yyvsp[(5) - (5)].columnOption)); - ; - } - break; - - case 136: - - { - (yyval.colDefault) = new ColumnDefaultValue((yyvsp[(2) - (2)].str)); - ; - } - break; - - case 137: - - { - (yyval.colDefault) = new ColumnDefaultValue(NULL); - ; - } - break; - - case 138: - - { - (yyval.colDefault) = new ColumnDefaultValue("$USER"); - ; - } - break; - - case 139: - - { - (yyval.colDefault) = new ColumnDefaultValue("$CURRENT_USER"); - ; - } - break; - - case 140: - - { - (yyval.colDefault) = new ColumnDefaultValue("$SESSION_USER"); - ; - } - break; - - case 141: - - { - (yyval.colDefault) = new ColumnDefaultValue("$SYSTEM_USER"); - ; - } - break; - - case 146: - - { - (yyval.columnType) = new ColumnType(DDL_BLOB); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_BLOB]; - ; - } - break; - - case 147: - - { - (yyval.columnType) = new ColumnType(DDL_CLOB); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_CLOB]; - ; - } - break; - - case 148: - - { - (yyval.constraintList) = new ColumnConstraintList(); - (yyval.constraintList)->push_back((yyvsp[(1) - (1)].columnConstraintDef)); - ; - } - break; - - case 149: - - { - (yyval.constraintList) = (yyvsp[(1) - (2)].constraintList); - (yyval.constraintList)->push_back((yyvsp[(2) - (2)].columnConstraintDef)); - ; - } - break; - - case 150: - - { - (yyval.columnConstraintDef) = (yyvsp[(1) - (2)].columnConstraintDef); - - if ((yyvsp[(2) - (2)].constraintAttributes) != NULL) - { - (yyvsp[(1) - (2)].columnConstraintDef)->fDeferrable = - (yyvsp[(2) - (2)].constraintAttributes)->fDeferrable; - (yyvsp[(1) - (2)].columnConstraintDef)->fCheckTime = - (yyvsp[(2) - (2)].constraintAttributes)->fCheckTime; - } - - ; - } - break; - - case 151: - - { - (yyval.columnConstraintDef) = (yyvsp[(3) - (4)].columnConstraintDef); - (yyvsp[(3) - (4)].columnConstraintDef)->fName = (yyvsp[(2) - (4)].str); - - if ((yyvsp[(4) - (4)].constraintAttributes) != NULL) - { - (yyvsp[(3) - (4)].columnConstraintDef)->fDeferrable = - (yyvsp[(4) - (4)].constraintAttributes)->fDeferrable; - (yyvsp[(3) - (4)].columnConstraintDef)->fCheckTime = - (yyvsp[(4) - (4)].constraintAttributes)->fCheckTime; - } - - ; - } - break; - - case 152: - - { - (yyval.constraintAttributes) = (yyvsp[(1) - (1)].constraintAttributes); - ; - } - break; - - case 153: - - { - (yyval.constraintAttributes) = NULL; - ; - } - break; - - case 154: - - { - (yyval.constraintAttributes) = - new ConstraintAttributes((yyvsp[(1) - (2)].cattr), ((yyvsp[(2) - (2)].cattr) != 0)); - ; - } - break; - - case 155: - - { - (yyval.constraintAttributes) = new ConstraintAttributes((yyvsp[(2) - (2)].cattr), true); - ; - } - break; - - case 157: - - { - (yyval.cattr) = DDL_NON_DEFERRABLE; - ; - } - break; - - case 158: - - { - (yyval.cattr) = DDL_DEFERRABLE; - ; - } - break; - - case 159: - - { - (yyval.cattr) = DDL_INITIALLY_DEFERRED; - ; - } - break; - - case 160: - - { - (yyval.cattr) = DDL_INITIALLY_IMMEDIATE; - ; - } - break; - - case 161: - - { - (yyval.columnConstraintDef) = new ColumnConstraintDef(DDL_NOT_NULL); - ; - } - break; - - case 162: - - { - (yyval.columnConstraintDef) = new ColumnConstraintDef(DDL_UNIQUE); - ; - } - break; - - case 163: - - { - (yyval.columnConstraintDef) = new ColumnConstraintDef(DDL_PRIMARY_KEY); - ; - } - break; - - case 164: - - { - (yyval.columnConstraintDef) = new ColumnConstraintDef(DDL_AUTO_INCREMENT); - ; - } - break; - - case 165: - - { - (yyval.columnConstraintDef) = new ColumnConstraintDef((yyvsp[(1) - (1)].str)); - ; - } - break; - - case 166: - - { - (yyval.str) = (yyvsp[(3) - (4)].str); - ; - } - break; - - case 167: - - { - (yyval.str) = (yyvsp[(2) - (3)].str); - ; - } - break; - - case 168: - - { - (yyval.columnType) = new ColumnType(DDL_CHAR); - (yyval.columnType)->fLength = 1; - ; - } - break; - - case 169: - - { - (yyval.columnType) = new ColumnType(DDL_CHAR); - (yyval.columnType)->fLength = 1; - ; - } - break; - - case 170: - - { - (yyval.columnType) = new ColumnType(DDL_CHAR); - (yyval.columnType)->fLength = atoi((yyvsp[(3) - (4)].str)); - ; - } - break; - - case 171: - - { - (yyval.columnType) = new ColumnType(DDL_CHAR); - (yyval.columnType)->fLength = atoi((yyvsp[(3) - (4)].str)); - ; - } - break; - - case 172: - - { - (yyval.columnType) = new ColumnType(DDL_VARCHAR); - (yyval.columnType)->fLength = atoi((yyvsp[(4) - (5)].str)); - ; - } - break; - - case 173: - - { - (yyval.columnType) = new ColumnType(DDL_VARCHAR); - (yyval.columnType)->fLength = atoi((yyvsp[(4) - (5)].str)); - ; - } - break; - - case 174: - - { - (yyval.columnType) = new ColumnType(DDL_VARCHAR); - (yyval.columnType)->fLength = atoi((yyvsp[(3) - (4)].str)); - ; - } - break; - - case 175: - - { - (yyval.columnType) = new ColumnType(DDL_VARBINARY); - (yyval.columnType)->fLength = atoi((yyvsp[(3) - (4)].str)); - ; - } - break; - - case 178: - - { - (yyvsp[(2) - (2)].columnType)->fType = DDL_NUMERIC; - (yyvsp[(2) - (2)].columnType)->fLength = DDLDatatypeLength[DDL_NUMERIC]; - (yyval.columnType) = (yyvsp[(2) - (2)].columnType); - ; - } - break; - - case 179: - - { - (yyvsp[(2) - (3)].columnType)->fType = DDL_UNSIGNED_NUMERIC; - (yyvsp[(2) - (3)].columnType)->fLength = DDLDatatypeLength[DDL_UNSIGNED_NUMERIC]; - (yyval.columnType) = (yyvsp[(2) - (3)].columnType); - ; - } - break; - - case 180: - - { - (yyvsp[(2) - (2)].columnType)->fType = DDL_DECIMAL; - /* $2->fLength = DDLDatatypeLength[DDL_DECIMAL]; */ - (yyval.columnType) = (yyvsp[(2) - (2)].columnType); - ; - } - break; - - case 181: - - { - (yyvsp[(2) - (3)].columnType)->fType = DDL_UNSIGNED_DECIMAL; - /* $3->fLength = DDLDatatypeLength[DDL_DECIMAL]; */ - (yyval.columnType) = (yyvsp[(2) - (3)].columnType); - ; - } - break; - - case 182: - - { - (yyvsp[(2) - (2)].columnType)->fType = DDL_DECIMAL; - (yyvsp[(2) - (2)].columnType)->fLength = DDLDatatypeLength[DDL_DECIMAL]; - (yyval.columnType) = (yyvsp[(2) - (2)].columnType); - ; - } - break; - - case 183: - - { - (yyvsp[(2) - (3)].columnType)->fType = DDL_UNSIGNED_DECIMAL; - (yyvsp[(2) - (3)].columnType)->fLength = DDLDatatypeLength[DDL_UNSIGNED_DECIMAL]; - (yyval.columnType) = (yyvsp[(2) - (3)].columnType); - ; - } - break; - - case 184: - - { - (yyval.columnType) = new ColumnType(DDL_INT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_INT]; - ; - } - break; - - case 185: - - { - (yyval.columnType) = new ColumnType(DDL_INT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_INT]; - ; - } - break; - - case 186: - - { - (yyval.columnType) = new ColumnType(DDL_SMALLINT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_SMALLINT]; - ; - } - break; - - case 187: - - { - (yyval.columnType) = new ColumnType(DDL_TINYINT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_TINYINT]; - ; - } - break; - - case 188: - - { - (yyval.columnType) = new ColumnType(DDL_BIGINT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_BIGINT]; - ; - } - break; - - case 189: - - { - (yyval.columnType) = new ColumnType(DDL_UNSIGNED_INT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_INT]; - ; - } - break; - - case 190: - - { - (yyval.columnType) = new ColumnType(DDL_UNSIGNED_INT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_INT]; - ; - } - break; - - case 191: - - { - (yyval.columnType) = new ColumnType(DDL_UNSIGNED_SMALLINT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_SMALLINT]; - ; - } - break; - - case 192: - - { - (yyval.columnType) = new ColumnType(DDL_UNSIGNED_TINYINT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_TINYINT]; - ; - } - break; - - case 193: - - { - (yyval.columnType) = new ColumnType(DDL_UNSIGNED_BIGINT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_BIGINT]; - ; - } - break; - - case 194: - - { - (yyval.columnType) = new ColumnType(atoi((yyvsp[(2) - (3)].str)), 0); - ; - } - break; - - case 195: - - { - (yyval.columnType) = new ColumnType(atoi((yyvsp[(2) - (5)].str)), atoi((yyvsp[(4) - (5)].str))); - ; - } - break; - - case 196: - - { - (yyval.columnType) = new ColumnType(10, 0); - ; - } - break; - - case 197: - - { - (yyval.str) = NULL; - ; - } - break; - - case 198: - - { - (yyval.str) = NULL; - ; - } - break; - - case 199: - - { - (yyval.columnType) = new ColumnType(DDL_DOUBLE); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_DOUBLE]; - ; - } - break; - - case 200: - - { - (yyval.columnType) = new ColumnType(DDL_UNSIGNED_DOUBLE); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_DOUBLE]; - ; - } - break; - - case 201: - - { - (yyval.columnType) = new ColumnType(DDL_DOUBLE); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_DOUBLE]; - ; - } - break; - - case 202: - - { - (yyval.columnType) = new ColumnType(DDL_UNSIGNED_DOUBLE); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_DOUBLE]; - ; - } - break; - - case 203: - - { - (yyval.columnType) = new ColumnType(DDL_FLOAT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_FLOAT]; - ; - } - break; - - case 204: - - { - (yyval.columnType) = new ColumnType(DDL_UNSIGNED_FLOAT); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_FLOAT]; - ; - } - break; - - case 205: - - { - (yyval.str) = NULL; - ; - } - break; - - case 206: - - { - (yyval.str) = NULL; - ; - } - break; - - case 207: - - { - (yyval.str) = NULL; - ; - } - break; - - case 211: - - { - (yyval.columnType) = new ColumnType(DDL_DATETIME); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_DATETIME]; - ; - } - break; - - case 212: - - { - (yyval.columnType) = new ColumnType(DDL_DATE); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_DATE]; - ; - } - break; - - case 213: - - { - (yyval.columnType) = new ColumnType(DDL_DATETIME); - (yyval.columnType)->fLength = DDLDatatypeLength[DDL_DATETIME]; - (yyval.columnType)->fPrecision = (yyvsp[(2) - (3)].ival); - (yyval.columnType)->fWithTimezone = (yyvsp[(3) - (3)].flag); - ; - } - break; - - case 214: - - { - (yyval.ival) = atoi((yyvsp[(2) - (3)].str)); - ; - } - break; - - case 215: - - { - (yyval.ival) = -1; - ; - } - break; - - case 216: - - { - (yyval.flag) = true; - ; - } - break; - - case 217: - - { - (yyval.flag) = false; - ; - } - break; - - case 218: - - { - (yyval.ata) = new AtaDropColumn((yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].refActionCode)); - ; - } - break; - - case 219: - - { - (yyval.ata) = new AtaDropColumn((yyvsp[(3) - (4)].str), (yyvsp[(4) - (4)].refActionCode)); - ; - } - break; - - case 220: - - { - (yyval.ata) = new AtaDropColumns((yyvsp[(4) - (5)].columnNameList)); - ; - } - break; - - case 221: - - { - (yyval.ata) = new AtaDropColumns((yyvsp[(3) - (4)].columnNameList)); - ; - } - break; - - case 222: - - { - (yyval.ata) = new AtaDropColumns((yyvsp[(4) - (5)].columnNameList)); - ; - } - break; - - case 223: - - { - (yyval.refActionCode) = DDL_CASCADE; - ; - } - break; - - case 224: - - { - (yyval.refActionCode) = DDL_RESTRICT; - ; - } - break; - - case 225: - - { - (yyval.refActionCode) = DDL_NO_ACTION; - ; - } - break; - - case 226: - - { - (yyval.ata) = new AtaSetColumnDefault((yyvsp[(3) - (5)].str), (yyvsp[(5) - (5)].colDefault)); - ; - } - break; - - case 227: - - { - (yyval.ata) = new AtaDropColumnDefault((yyvsp[(3) - (5)].str)); - ; - } - break; - - default: break; - } - - YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK(yylen); - yylen = 0; - YY_STACK_PRINT(yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ -yyerrlab: - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#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 - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - 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 - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* 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; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yydestruct("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK(1); - yystate = *yyssp; - YY_STACK_PRINT(yyss, yyssp); - } - - *++yyvsp = yylval; - - /* Shift the error token. */ - YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE - /*-------------------------------------------------. - | yyexhaustedlab -- memory exhaustion comes here. | - `-------------------------------------------------*/ -yyexhaustedlab: - yyerror(YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - - if (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 -#if YYERROR_VERBOSE - - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); - -#endif - /* Make sure YYID is used. */ - return YYID(yyresult); -} - -void grammar_init(ParseTree* _parseTree, bool debug) -{ - parseTree = _parseTree; - - if (debug) - yydebug = 1; -} - -void set_schema(std::string schema) -{ - db_schema = schema; -} diff --git a/dbcon/ddlpackage/ddl-gram-win.h b/dbcon/ddlpackage/ddl-gram-win.h deleted file mode 100644 index fd0fa377fe..0000000000 --- a/dbcon/ddlpackage/ddl-gram-win.h +++ /dev/null @@ -1,163 +0,0 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#pragma once -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype -{ - ACTION = 258, - ADD = 259, - ALTER = 260, - AUTO_INCREMENT = 261, - BIGINT = 262, - BIT = 263, - IDB_BLOB = 264, - CASCADE = 265, - IDB_CHAR = 266, - CHARACTER = 267, - CHECK = 268, - CLOB = 269, - COLUMN = 270, - COLUMNS = 271, - COMMENT = 272, - CONSTRAINT = 273, - CONSTRAINTS = 274, - CREATE = 275, - CURRENT_USER = 276, - DATETIME = 277, - DEC = 278, - DECIMAL = 279, - DEFAULT = 280, - DEFERRABLE = 281, - DEFERRED = 282, - IDB_DELETE = 283, - DROP = 284, - ENGINE = 285, - FOREIGN = 286, - FULL = 287, - IMMEDIATE = 288, - INDEX = 289, - INITIALLY = 290, - IDB_INT = 291, - INTEGER = 292, - KEY = 293, - MATCH = 294, - MAX_ROWS = 295, - MIN_ROWS = 296, - MODIFY = 297, - NO = 298, - NOT = 299, - NULL_TOK = 300, - NUMBER = 301, - NUMERIC = 302, - ON = 303, - PARTIAL = 304, - PRECISION = 305, - PRIMARY = 306, - REFERENCES = 307, - RENAME = 308, - RESTRICT = 309, - SET = 310, - SMALLINT = 311, - TABLE = 312, - TIME = 313, - TINYINT = 314, - TO = 315, - UNIQUE = 316, - UNSIGNED = 317, - UPDATE = 318, - USER = 319, - SESSION_USER = 320, - SYSTEM_USER = 321, - VARCHAR = 322, - VARBINARY = 323, - VARYING = 324, - WITH = 325, - ZONE = 326, - DOUBLE = 327, - IDB_FLOAT = 328, - REAL = 329, - CHARSET = 330, - IDB_IF = 331, - EXISTS = 332, - CHANGE = 333, - TRUNCATE = 334, - IDENT = 335, - FCONST = 336, - SCONST = 337, - CP_SEARCH_CONDITION_TEXT = 338, - ICONST = 339, - DATE = 340 -}; -#endif - -#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - ddlpackage::AlterTableStatement* alterTableStmt; - ddlpackage::AlterTableAction* ata; - ddlpackage::AlterTableActionList* ataList; - ddlpackage::DDL_CONSTRAINT_ATTRIBUTES cattr; - std::pair* tableOption; - const char* columnOption; - ddlpackage::ColumnConstraintDef* columnConstraintDef; - ddlpackage::ColumnNameList* columnNameList; - ddlpackage::ColumnType* columnType; - ddlpackage::ConstraintAttributes* constraintAttributes; - ddlpackage::ColumnConstraintList* constraintList; - ddlpackage::DDL_CONSTRAINTS constraintType; - double dval; - bool flag; - int ival; - ddlpackage::QualifiedName* qualifiedName; - ddlpackage::SchemaObject* schemaObject; - ddlpackage::SqlStatement* sqlStmt; - ddlpackage::SqlStatementList* sqlStmtList; - const char* str; - ddlpackage::TableConstraintDef* tableConstraint; - ddlpackage::TableElementList* tableElementList; - ddlpackage::TableOptionMap* tableOptionMap; - ddlpackage::ColumnDefaultValue* colDefault; - ddlpackage::DDL_MATCH_TYPE matchType; - ddlpackage::DDL_REFERENTIAL_ACTION refActionCode; - ddlpackage::ReferentialAction* refAction; - -} YYSTYPE; -#define YYSTYPE_IS_TRIVIAL 1 -#define yystype YYSTYPE /* obsolescent; will be withdrawn */ -#define YYSTYPE_IS_DECLARED 1 - -extern YYSTYPE ddllval; diff --git a/dbcon/ddlpackage/ddl-scan-win.cpp b/dbcon/ddlpackage/ddl-scan-win.cpp deleted file mode 100644 index 11e0fbb003..0000000000 --- a/dbcon/ddlpackage/ddl-scan-win.cpp +++ /dev/null @@ -1,2274 +0,0 @@ -#define yy_create_buffer ddl_create_buffer -#define yy_delete_buffer ddl_delete_buffer -#define yy_scan_buffer ddl_scan_buffer -#define yy_scan_string ddl_scan_string -#define yy_scan_bytes ddl_scan_bytes -#define yy_flex_debug ddl_flex_debug -#define yy_init_buffer ddl_init_buffer -#define yy_flush_buffer ddl_flush_buffer -#define yy_load_buffer_state ddl_load_buffer_state -#define yy_switch_to_buffer ddl_switch_to_buffer -#define yyin ddlin -#define yyleng ddlleng -#define yylex ddllex -#define yyout ddlout -#define yyrestart ddlrestart -#define yytext ddltext - -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ -#pragma warn - rch -#pragma warn - use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int)(unsigned char)c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state* YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } while (0) - -#define unput(c) yyunput(c, yytext_ptr) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - -struct yy_buffer_state -{ - FILE* yy_input_file; - - char* yy_ch_buf; /* input buffer */ - char* yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 -}; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - -int yyleng; - -/* Points to current character in buffer. */ -static char* yy_c_buf_p = (char*)0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO((FILE * input_file)); - -void yy_switch_to_buffer YY_PROTO((YY_BUFFER_STATE new_buffer)); -void yy_load_buffer_state YY_PROTO((void)); -YY_BUFFER_STATE yy_create_buffer YY_PROTO((FILE * file, int size)); -void yy_delete_buffer YY_PROTO((YY_BUFFER_STATE b)); -void yy_init_buffer YY_PROTO((YY_BUFFER_STATE b, FILE* file)); -void yy_flush_buffer YY_PROTO((YY_BUFFER_STATE b)); -#define YY_FLUSH_BUFFER yy_flush_buffer(yy_current_buffer) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO((char* base, yy_size_t size)); -YY_BUFFER_STATE yy_scan_string YY_PROTO((yyconst char* yy_str)); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO((yyconst char* bytes, int len)); - -static void* yy_flex_alloc YY_PROTO((yy_size_t)); -static void* yy_flex_realloc YY_PROTO((void*, yy_size_t)); -static void yy_flex_free YY_PROTO((void*)); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if (!yy_current_buffer) \ - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if (!yy_current_buffer) \ - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -#define yywrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE*)0, *yyout = (FILE*)0; -typedef int yy_state_type; -extern char* yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO((void)); -static yy_state_type yy_try_NUL_trans YY_PROTO((yy_state_type current_state)); -static int yy_get_next_buffer YY_PROTO((void)); -static void yy_fatal_error YY_PROTO((yyconst char msg[])); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int)(yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 85 -#define YY_END_OF_BUFFER 86 -static yyconst short int yy_accept[393] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 85, 81, 80, 83, 13, 83, 83, 83, 16, 82, 84, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 10, 12, 85, 11, 85, 14, 15, 81, 0, 16, 81, 17, - 17, 16, 0, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 75, 82, 82, - 82, 82, 82, 82, 48, 82, 52, 82, 82, 82, 82, 82, 82, 82, 82, 65, 82, 82, 82, 82, 82, 0, 11, - - 0, 14, 81, 17, 0, 18, 82, 2, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 29, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 41, 43, 82, 82, 82, 82, 49, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 61, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 6, 82, 82, 82, 82, 82, 82, 26, 82, 82, 82, - 82, 82, 34, 82, 82, 82, 82, 37, 82, 82, 82, 82, 82, 82, 82, 82, 50, 82, 82, 82, 82, 73, - - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 69, 82, 82, 82, 3, 82, 82, 82, 82, 82, 82, 9, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 71, 82, 82, 39, 82, 82, 44, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 63, 82, 82, 82, 82, 82, 82, 82, 1, 82, 8, 82, 77, 82, 82, 20, 82, 82, 24, 82, 82, - 82, 82, 82, 33, 72, 35, 76, 82, 82, 82, 82, 82, 82, 47, 82, 82, 82, 82, 82, 57, 82, 82, - - 82, 82, 82, 82, 66, 82, 68, 82, 82, 82, 5, 82, 74, 21, 19, 82, 82, 82, 28, 30, 82, 82, 36, 82, 82, 42, - 82, 82, 51, 53, 82, 55, 82, 82, 82, 82, 82, 64, 82, 82, 82, 70, 82, 82, 82, 82, 27, 82, 32, 82, 82, 45, - 46, 82, 82, 58, 82, 62, 82, 78, 67, 82, 82, 7, 82, 82, 82, 38, 40, 54, 82, 82, 82, 79, 82, 22, 82, 31, - 56, 82, 82, 82, 23, 82, 82, 60, 82, 25, 59, 82, 4, 0 - -}; - -static yyconst int yy_ec[256] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 5, 6, 1, 7, 8, 9, 6, 10, 6, 11, 12, 6, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 6, 6, 6, 6, 6, 1, 1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 25, 6, 1, 6, 6, 14, 15, 16, 17, 18, 19, - - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 25, 1, 1, 1, 1, - 1, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25}; - -static yyconst int yy_meta[41] = {0, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}; - -static yyconst short int yy_base[400] = { - 0, 0, 0, 33, 35, 428, 427, 428, 427, 426, 425, 431, 438, 43, 46, 438, 438, 39, 42, 417, 44, - 0, 438, 40, 405, 45, 49, 31, 36, 56, 408, 64, 53, 398, 57, 406, 67, 75, 67, 409, 438, 438, - 415, 438, 416, 438, 438, 100, 409, 80, 0, 93, 96, 98, 104, 0, 386, 401, 384, 383, 395, 382, 103, - 93, 395, 381, 378, 106, 376, 381, 388, 385, 378, 374, 379, 0, 377, 106, 364, 93, 374, 383, 366, 107, - 0, 367, 116, 110, 103, 383, 364, 380, 367, 0, 359, 118, 375, 373, 359, 382, 438, - - 383, 438, 0, 130, 376, 375, 363, 0, 366, 355, 360, 365, 116, 364, 345, 352, 345, 362, 344, 356, 351, - 131, 354, 356, 341, 347, 336, 353, 348, 340, 346, 345, 329, 343, 0, 344, 347, 346, 335, 0, 331, 337, - 321, 337, 326, 326, 332, 335, 315, 315, 0, 321, 312, 319, 305, 315, 311, 318, 325, 307, 136, 309, 305, - 323, 307, 319, 312, 130, 307, 304, 311, 295, 294, 308, 292, 298, 289, 291, 288, 295, 0, 292, 285, 284, - 294, 0, 298, 277, 291, 292, 290, 279, 278, 289, 0, 276, 284, 283, 290, 0, - - 272, 276, 270, 278, 274, 280, 279, 274, 279, 260, 273, 259, 0, 269, 269, 262, 0, 266, 254, 269, 267, - 268, 265, 0, 255, 254, 249, 261, 251, 255, 262, 250, 243, 255, 254, 253, 238, 0, 249, 246, 0, 253, - 248, 0, 237, 236, 225, 240, 247, 228, 228, 240, 239, 234, 227, 232, 227, 0, 225, 237, 232, 222, 230, - 220, 232, 0, 218, 0, 226, 0, 210, 209, 209, 207, 225, 0, 205, 211, 211, 202, 139, 0, 0, 0, - 0, 207, 219, 207, 200, 194, 193, 0, 212, 202, 204, 187, 197, 0, 207, 195, - - 194, 208, 186, 185, 0, 199, 0, 202, 184, 198, 0, 195, 0, 0, 0, 190, 199, 192, 0, 0, 194, - 191, 0, 174, 181, 0, 173, 172, 0, 0, 175, 0, 186, 168, 188, 166, 164, 0, 179, 179, 164, 0, - 163, 162, 165, 157, 0, 165, 0, 171, 150, 0, 0, 160, 168, 0, 151, 0, 152, 0, 0, 145, 164, - 0, 148, 147, 143, 0, 0, 0, 128, 127, 140, 0, 130, 123, 136, 0, 0, 128, 96, 92, 0, 64, - 53, 0, 45, 0, 0, 36, 0, 438, 164, 167, 170, 59, 173, 176, 179 - -}; - -static yyconst short int yy_def[400] = { - 0, 392, 1, 393, 393, 394, 394, 395, 395, 393, 393, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, - 396, 392, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 392, 392, - 397, 392, 398, 392, 392, 392, 392, 392, 399, 392, 392, 392, 392, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 397, 392, - - 398, 392, 399, 392, 392, 392, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 0, 392, 392, 392, 392, 392, 392, 392 - -}; - -static yyconst short int yy_nxt[479] = { - 0, 12, 13, 14, 13, 12, 15, 16, 15, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 21, 21, 29, 21, 30, 21, 31, 32, 33, 34, 21, 35, 36, 37, 38, 39, 21, 21, 21, 40, - 41, 40, 41, 47, 47, 47, 47, 47, 47, 48, 49, 50, 48, 49, 52, 53, 56, 57, 70, 61, 55, - 72, 54, 66, 73, 58, 62, 67, 71, 391, 74, 85, 390, 63, 59, 75, 64, 68, 79, 65, 69, 82, - 76, 77, 389, 88, 80, 83, 86, 91, 48, 49, 81, 89, 95, 388, 96, 92, 54, - - 97, 47, 47, 47, 93, 51, 90, 94, 104, 52, 53, 387, 54, 105, 105, 54, 106, 54, 113, 115, 116, - 117, 114, 121, 132, 146, 122, 136, 386, 133, 147, 137, 123, 141, 142, 144, 150, 151, 148, 145, 134, 157, - 104, 149, 167, 222, 177, 385, 168, 54, 178, 158, 214, 215, 321, 384, 383, 382, 322, 381, 380, 379, 378, - 223, 12, 12, 12, 42, 42, 42, 44, 44, 44, 99, 99, 99, 101, 101, 101, 103, 377, 103, 376, 375, - 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, 360, 359, - - 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, - 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 320, 319, 318, 317, 316, 315, - 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, - 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, - 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, - - 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, - 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 221, 220, 219, 218, 217, 216, 213, 212, 211, - 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, - 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 176, 175, 174, 173, 172, 171, 170, 169, 166, 165, - 164, 163, 162, 106, 106, 102, 100, 161, 160, 159, 156, 155, 154, 153, 152, 143, - - 140, 139, 138, 135, 131, 130, 129, 128, 127, 126, 125, 124, 120, 119, 118, 112, 111, 110, 109, 108, 107, - 51, 102, 100, 98, 87, 84, 78, 60, 51, 392, 46, 46, 45, 45, 43, 43, 11, 392, 392, 392, 392, - 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, - 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392}; - -static yyconst short int yy_chk[479] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 3, 4, 4, 13, 13, 13, 14, 14, 14, 17, 17, 18, 18, 18, 20, 20, 23, 23, 27, 25, 396, - 28, 20, 26, 28, 23, 25, 26, 27, 390, 28, 34, 387, 25, 23, 29, 25, 26, 31, 25, 26, 32, - 29, 29, 385, 36, 31, 32, 34, 37, 49, 49, 31, 36, 38, 384, 38, 37, 49, - - 38, 47, 47, 47, 37, 51, 36, 37, 52, 53, 53, 382, 51, 54, 54, 52, 54, 53, 62, 63, 63, - 63, 62, 67, 77, 87, 67, 79, 381, 77, 87, 79, 67, 83, 83, 86, 88, 88, 87, 86, 77, 95, - 104, 87, 113, 168, 122, 380, 113, 104, 122, 95, 161, 161, 281, 377, 376, 375, 281, 373, 372, 371, 367, - 168, 393, 393, 393, 394, 394, 394, 395, 395, 395, 397, 397, 397, 398, 398, 398, 399, 366, 399, 365, 363, - 362, 359, 357, 355, 354, 351, 350, 348, 346, 345, 344, 343, 341, 340, 339, 337, - - 336, 335, 334, 333, 331, 328, 327, 325, 324, 322, 321, 318, 317, 316, 312, 310, 309, 308, 306, 304, 303, - 302, 301, 300, 299, 297, 296, 295, 294, 293, 291, 290, 289, 288, 287, 286, 280, 279, 278, 277, 275, 274, - 273, 272, 271, 269, 267, 265, 264, 263, 262, 261, 260, 259, 257, 256, 255, 254, 253, 252, 251, 250, 249, - 248, 247, 246, 245, 243, 242, 240, 239, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, - 223, 222, 221, 220, 219, 218, 216, 215, 214, 212, 211, 210, 209, 208, 207, 206, - - 205, 204, 203, 202, 201, 199, 198, 197, 196, 194, 193, 192, 191, 190, 189, 188, 187, 185, 184, 183, 182, - 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 167, 166, 165, 164, 163, 162, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 139, 138, 137, 136, 134, - 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 121, 120, 119, 118, 117, 116, 115, 114, 112, 111, - 110, 109, 107, 106, 105, 101, 99, 98, 97, 96, 94, 92, 91, 90, 89, 85, - - 82, 81, 80, 78, 76, 74, 73, 72, 71, 70, 69, 68, 66, 65, 64, 61, 60, 59, 58, 57, 56, - 48, 44, 42, 39, 35, 33, 30, 24, 19, 11, 10, 9, 8, 7, 6, 5, 392, 392, 392, 392, 392, - 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, - 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392}; - -static yy_state_type yy_last_accepting_state; -static char* yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char* yytext; -#define INITIAL 0 -/* Copyright (C) 2014 InfiniDB, 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; 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 Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ -/* $Id: ddl.l 9341 2013-03-27 14:10:35Z chao $ */ -#include -#include -#include -#include "ddlpkg.h" - -#ifdef _MSC_VER -#include "ddl-gram-win.h" -#else -#include "ddl-gram.h" -#endif - -int lineno = 1; -void ddlerror(char* s); - -/* Handles to the buffer that the lexer uses internally */ -static YY_BUFFER_STATE scanbufhandle; -static char* scanbuf; - -static char* scanner_copy(char* str); - -#define YY_NO_UNPUT 1 -/* %option header-file="ddl-scan.h" */ -#define check1 1 - -#define check2 2 - -#define inquote 3 - -#define endquote 4 - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO((void)); -#else -extern int yywrap YY_PROTO((void)); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO((int c, char* buf_ptr)); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO((char*, yyconst char*, int)); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO((yyconst char*)); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO((void)); -#else -static int input YY_PROTO((void)); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int* yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO((int new_state)); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO((void)); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO((void)); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void)fwrite(yytext, yyleng, 1, yyout) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf, result, max_size) \ - if (yy_current_buffer->yy_is_interactive) \ - { \ - int c = '*', n; \ - for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \ - buf[n] = (char)c; \ - if (c == '\n') \ - buf[n++] = (char)c; \ - if (c == EOF && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - result = n; \ - } \ - else if (((result = fread(buf, 1, max_size, yyin)) == 0) && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error(msg) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO((void)) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP YY_USER_ACTION - -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - - if (yy_init) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if (!yy_start) - yy_start = 1; /* first start state */ - - if (!yyin) - yyin = stdin; - - if (!yyout) - yyout = stdout; - - if (!yy_current_buffer) - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); - - yy_load_buffer_state(); - } - - while (1) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_match: - - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 393) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - ++yy_cp; - } while (yy_base[yy_current_state] != 438); - - yy_find_action: - yy_act = yy_accept[yy_current_state]; - - if (yy_act == 0) - { - /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - do_action: /* This label is used only to access EOF actions. */ - - switch (yy_act) - { - /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - - case 1: - YY_RULE_SETUP - { - return ACTION; - } - YY_BREAK - - case 2: - YY_RULE_SETUP - { - return ADD; - } - YY_BREAK - - case 3: - YY_RULE_SETUP - { - return ALTER; - } - YY_BREAK - - case 4: - YY_RULE_SETUP - { - return AUTO_INCREMENT; - } - YY_BREAK - - case 5: - YY_RULE_SETUP - { - return CASCADE; - } - YY_BREAK - - case 6: - YY_RULE_SETUP - { - return IDB_CHAR; - } - YY_BREAK - - case 7: - YY_RULE_SETUP - { - return IDB_CHAR; - } - YY_BREAK - - case 8: - YY_RULE_SETUP - { - return BIGINT; - } - YY_BREAK - - case 9: - YY_RULE_SETUP - { - BEGIN(check1); - return CHECK; - } - YY_BREAK - - case 10: - YY_RULE_SETUP - { - BEGIN(check2); - return '('; - } - YY_BREAK - - case 11: - *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ - yy_c_buf_p = yy_cp -= 1; - YY_DO_BEFORE_ACTION; /* set up yytext again */ - YY_RULE_SETUP - { - BEGIN(check1); - ddllval.str = scanner_copy(ddltext); - return CP_SEARCH_CONDITION_TEXT; - } - YY_BREAK - - case 12: - YY_RULE_SETUP - { - BEGIN(0); - return ')'; - } - YY_BREAK - - case 13: - YY_RULE_SETUP - { - BEGIN(inquote); - return yytext[0]; - } - YY_BREAK - - case 14: - *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ - yy_c_buf_p = yy_cp -= 1; - YY_DO_BEFORE_ACTION; /* set up yytext again */ - YY_RULE_SETUP - { - BEGIN(endquote); - ddllval.str = scanner_copy(ddltext); - return SCONST; - } - YY_BREAK - - case 15: - YY_RULE_SETUP - { - BEGIN(0); - return yytext[0]; - } - YY_BREAK - - case 16: - YY_RULE_SETUP - { - ddllval.str = scanner_copy(ddltext); - return ICONST; - } - YY_BREAK - - case 17: - YY_RULE_SETUP - { - ddllval.str = scanner_copy(ddltext); - return FCONST; - } - YY_BREAK - - case 18: - YY_RULE_SETUP - { - ddllval.str = scanner_copy(ddltext); - return FCONST; - } - YY_BREAK - - case 19: - YY_RULE_SETUP - { - return COMMENT; - } - YY_BREAK - - case 20: - YY_RULE_SETUP - { - return COLUMN; - } - YY_BREAK - - case 21: - YY_RULE_SETUP - { - return COLUMNS; - } - YY_BREAK - - case 22: - YY_RULE_SETUP - { - return CONSTRAINT; - } - YY_BREAK - - case 23: - YY_RULE_SETUP - { - return CONSTRAINTS; - } - YY_BREAK - - case 24: - YY_RULE_SETUP - { - return CREATE; - } - YY_BREAK - - case 25: - YY_RULE_SETUP - { - return CURRENT_USER; - } - YY_BREAK - - case 26: - YY_RULE_SETUP - { - ddllval.str = strdup("date"); - return DATE; - } - YY_BREAK - - case 27: - YY_RULE_SETUP - { - return DATETIME; - } - YY_BREAK - - case 28: - YY_RULE_SETUP - { - return DECIMAL; - } - YY_BREAK - - case 29: - YY_RULE_SETUP - { - return DECIMAL; - } - YY_BREAK - - case 30: - YY_RULE_SETUP - { - return DEFAULT; - } - YY_BREAK - - case 31: - YY_RULE_SETUP - { - return DEFERRABLE; - } - YY_BREAK - - case 32: - YY_RULE_SETUP - { - return DEFERRED; - } - YY_BREAK - - case 33: - YY_RULE_SETUP - { - return IDB_DELETE; - } - YY_BREAK - - case 34: - YY_RULE_SETUP - { - return DROP; - } - YY_BREAK - - case 35: - YY_RULE_SETUP - { - return ENGINE; - } - YY_BREAK - - case 36: - YY_RULE_SETUP - { - return FOREIGN; - } - YY_BREAK - - case 37: - YY_RULE_SETUP - { - return FULL; - } - YY_BREAK - - case 38: - YY_RULE_SETUP - { - return IMMEDIATE; - } - YY_BREAK - - case 39: - YY_RULE_SETUP - { - return INDEX; - } - YY_BREAK - - case 40: - YY_RULE_SETUP - { - return INITIALLY; - } - YY_BREAK - - case 41: - YY_RULE_SETUP - { - return IDB_INT; - } - YY_BREAK - - case 42: - YY_RULE_SETUP - { - return INTEGER; - } - YY_BREAK - - case 43: - YY_RULE_SETUP - { - return KEY; - } - YY_BREAK - - case 44: - YY_RULE_SETUP - { - return MATCH; - } - YY_BREAK - - case 45: - YY_RULE_SETUP - { - return MAX_ROWS; - } - YY_BREAK - - case 46: - YY_RULE_SETUP - { - return MIN_ROWS; - } - YY_BREAK - - case 47: - YY_RULE_SETUP - { - return MODIFY; - } - YY_BREAK - - case 48: - YY_RULE_SETUP - { - return NO; - } - YY_BREAK - - case 49: - YY_RULE_SETUP - { - return NOT; - } - YY_BREAK - - case 50: - YY_RULE_SETUP - { - return NULL_TOK; - } - YY_BREAK - - case 51: - YY_RULE_SETUP - { - return NUMERIC; - } - YY_BREAK - - case 52: - YY_RULE_SETUP - { - return ON; - } - YY_BREAK - - case 53: - YY_RULE_SETUP - { - return PARTIAL; - } - YY_BREAK - - case 54: - YY_RULE_SETUP - { - return PRECISION; - } - YY_BREAK - - case 55: - YY_RULE_SETUP - { - return PRIMARY; - } - YY_BREAK - - case 56: - YY_RULE_SETUP - { - return REFERENCES; - } - YY_BREAK - - case 57: - YY_RULE_SETUP - { - return RENAME; - } - YY_BREAK - - case 58: - YY_RULE_SETUP - { - return RESTRICT; - } - YY_BREAK - - case 59: - YY_RULE_SETUP - { - return SESSION_USER; - } - YY_BREAK - - case 60: - YY_RULE_SETUP - { - return SYSTEM_USER; - } - YY_BREAK - - case 61: - YY_RULE_SETUP - { - return SET; - } - YY_BREAK - - case 62: - YY_RULE_SETUP - { - return SMALLINT; - } - YY_BREAK - - case 63: - YY_RULE_SETUP - { - return TABLE; - } - YY_BREAK - - case 64: - YY_RULE_SETUP - { - return TINYINT; - } - YY_BREAK - - case 65: - YY_RULE_SETUP - { - return TO; - } - YY_BREAK - - case 66: - YY_RULE_SETUP - { - return UNIQUE; - } - YY_BREAK - - case 67: - YY_RULE_SETUP - { - return UNSIGNED; - } - YY_BREAK - - case 68: - YY_RULE_SETUP - { - return UPDATE; - } - YY_BREAK - - case 69: - YY_RULE_SETUP - { - return USER; - } - YY_BREAK - - case 70: - YY_RULE_SETUP - { - return VARCHAR; - } - YY_BREAK - - case 71: - YY_RULE_SETUP - { - return IDB_FLOAT; - } - YY_BREAK - - case 72: - YY_RULE_SETUP - { - return DOUBLE; - } - YY_BREAK - - case 73: - YY_RULE_SETUP - { - return REAL; - } - YY_BREAK - - case 74: - YY_RULE_SETUP - { - return CHARSET; - } - YY_BREAK - - case 75: - YY_RULE_SETUP - { - return IDB_IF; - } - YY_BREAK - - case 76: - YY_RULE_SETUP - { - return EXISTS; - } - YY_BREAK - - case 77: - YY_RULE_SETUP - { - return CHANGE; - } - YY_BREAK - - case 78: - YY_RULE_SETUP - { - return TRUNCATE; - } - YY_BREAK - - case 79: - YY_RULE_SETUP - { - return VARBINARY; - } - YY_BREAK - - case 80: - YY_RULE_SETUP - { - lineno++; - } - YY_BREAK - - case 81: - YY_RULE_SETUP - { - /* ignore */ - } - YY_BREAK - - case 82: - YY_RULE_SETUP - { - ddllval.str = scanner_copy(ddltext); - return IDENT; - } - YY_BREAK - - case 83: - YY_RULE_SETUP - { - return ddltext[0]; - } - YY_BREAK - - case 84: - YY_RULE_SETUP - { - /* ignore */ - } - YY_BREAK - - case 85: - YY_RULE_SETUP - ECHO; - YY_BREAK - - case YY_STATE_EOF(INITIAL): - case YY_STATE_EOF(check1): - case YY_STATE_EOF(check2): - case YY_STATE_EOF(inquote): - case YY_STATE_EOF(endquote): yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if (yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if (yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars]) - { - /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans(yy_current_state); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if (yy_next_state) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else - switch (yy_get_next_buffer()) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if (yywrap()) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if (!yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - } - - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - - break; - } - - default: YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() -{ - register char* dest = yy_current_buffer->yy_ch_buf; - register char* source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if (yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1]) - YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - - if (yy_current_buffer->yy_fill_buffer == 0) - { - /* Don't try to fill the buffer, so this is an EOF. */ - if (yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int)(yy_c_buf_p - yytext_ptr) - 1; - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; - - while (num_to_read <= 0) - { - /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR("input buffer overflow, can't enlarge buffer because scanner uses REJECT"); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = (int)(yy_c_buf_p - b->yy_ch_buf); - - if (b->yy_is_our_buffer) - { - int new_size = b->yy_buf_size * 2; - - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char*) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc((void*)b->yy_ch_buf, b->yy_buf_size + 2); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; -#endif - } - - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if (yy_n_chars == 0) - { - if (number_to_move == YY_MORE_ADJ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() -{ - register yy_state_type yy_current_state; - register char* yy_cp; - - yy_current_state = yy_start; - - for (yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 393) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) -#else -static yy_state_type yy_try_NUL_trans(yy_current_state) yy_state_type yy_current_state; -#endif -{ - register int yy_is_jam; - register char* yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 393) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - yy_is_jam = (yy_current_state == 392); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput(int c, register char* yy_bp) -#else -static void yyunput(c, yy_bp) int c; -register char* yy_bp; -#endif -{ - register char* yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if (yy_cp < yy_current_buffer->yy_ch_buf + 2) - { - /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char* dest = &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2]; - register char* source = &yy_current_buffer->yy_ch_buf[number_to_move]; - - while (source > yy_current_buffer->yy_ch_buf) - *--dest = *--source; - - yy_cp += (int)(dest - source); - yy_bp += (int)(dest - source); - yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; - - if (yy_cp < yy_current_buffer->yy_ch_buf + 2) - YY_FATAL_ERROR("flex scanner push-back overflow"); - } - - *--yy_cp = (char)c; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; -} -#endif /* ifndef YY_NO_UNPUT */ - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif -{ - int c; - - *yy_c_buf_p = yy_hold_char; - - if (*yy_c_buf_p == YY_END_OF_BUFFER_CHAR) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if (yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars]) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { - /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch (yy_get_next_buffer()) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if (yywrap()) - return EOF; - - if (!yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; - } - } - } - - c = *(unsigned char*)yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - return c; -} - -#ifdef YY_USE_PROTOS -void yyrestart(FILE* input_file) -#else -void yyrestart(input_file) FILE* input_file; -#endif -{ - if (!yy_current_buffer) - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); - - yy_init_buffer(yy_current_buffer, input_file); - yy_load_buffer_state(); -} - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) -#else -void yy_switch_to_buffer(new_buffer) YY_BUFFER_STATE new_buffer; -#endif -{ - if (yy_current_buffer == new_buffer) - return; - - if (yy_current_buffer) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; -} - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state(void) -#else -void yy_load_buffer_state() -#endif -{ - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; -} - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer(FILE* file, int size) -#else -YY_BUFFER_STATE yy_create_buffer(file, size) FILE* file; -int size; -#endif -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE)yy_flex_alloc(sizeof(struct yy_buffer_state)); - - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char*)yy_flex_alloc(b->yy_buf_size + 2); - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b, file); - - return b; -} - -#ifdef YY_USE_PROTOS -void yy_delete_buffer(YY_BUFFER_STATE b) -#else -void yy_delete_buffer(b) YY_BUFFER_STATE b; -#endif -{ - if (!b) - return; - - if (b == yy_current_buffer) - yy_current_buffer = (YY_BUFFER_STATE)0; - - if (b->yy_is_our_buffer) - yy_flex_free((void*)b->yy_ch_buf); - - yy_flex_free((void*)b); -} - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO((int)); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer(YY_BUFFER_STATE b, FILE* file) -#else -void yy_init_buffer(b, file) YY_BUFFER_STATE b; -FILE* file; -#endif - -{ - yy_flush_buffer(b); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0; -#endif -#endif -} - -#ifdef YY_USE_PROTOS -void yy_flush_buffer(YY_BUFFER_STATE b) -#else -void yy_flush_buffer(b) YY_BUFFER_STATE b; -#endif - -{ - if (!b) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if (b == yy_current_buffer) - yy_load_buffer_state(); -} - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer(char* base, yy_size_t size) -#else -YY_BUFFER_STATE yy_scan_buffer(base, size) char* base; -yy_size_t size; -#endif -{ - YY_BUFFER_STATE b; - - if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR || base[size - 1] != YY_END_OF_BUFFER_CHAR) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE)yy_flex_alloc(sizeof(struct yy_buffer_state)); - - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b); - - return b; -} -#endif - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string(yyconst char* yy_str) -#else -YY_BUFFER_STATE yy_scan_string(yy_str) yyconst char* yy_str; -#endif -{ - int len; - - for (len = 0; yy_str[len]; ++len) - ; - - return yy_scan_bytes(yy_str, len); -} -#endif - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes(yyconst char* bytes, int len) -#else -YY_BUFFER_STATE yy_scan_bytes(bytes, len) yyconst char* bytes; -int len; -#endif -{ - YY_BUFFER_STATE b; - char* buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char*)yy_flex_alloc(n); - - if (!buf) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); - - for (i = 0; i < len; ++i) - buf[i] = bytes[i]; - - buf[len] = buf[len + 1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf, n); - - if (!b) - YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} -#endif - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state(int new_state) -#else -static void yy_push_state(new_state) int new_state; -#endif -{ - if (yy_start_stack_ptr >= yy_start_stack_depth) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof(int); - - if (!yy_start_stack) - yy_start_stack = (int*)yy_flex_alloc(new_size); - - else - yy_start_stack = (int*)yy_flex_realloc((void*)yy_start_stack, new_size); - - if (!yy_start_stack) - YY_FATAL_ERROR("out of memory expanding start-condition stack"); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); -} -#endif - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() -{ - if (--yy_start_stack_ptr < 0) - YY_FATAL_ERROR("start-condition stack underflow"); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); -} -#endif - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() -{ - return yy_start_stack[yy_start_stack_ptr - 1]; -} -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error(yyconst char msg[]) -#else -static void yy_fatal_error(msg) char msg[]; -#endif -{ - (void)fprintf(stderr, "%s\n", msg); - exit(YY_EXIT_FAILURE); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } while (0) - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy(char* s1, yyconst char* s2, int n) -#else -static void yy_flex_strncpy(s1, s2, n) char* s1; -yyconst char* s2; -int n; -#endif -{ - register int i; - - for (i = 0; i < n; ++i) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen(yyconst char* s) -#else -static int yy_flex_strlen(s) yyconst char* s; -#endif -{ - register int n; - - for (n = 0; s[n]; ++n) - ; - - return n; -} -#endif - -#ifdef YY_USE_PROTOS -static void* yy_flex_alloc(yy_size_t size) -#else -static void* yy_flex_alloc(size) yy_size_t size; -#endif -{ - return (void*)malloc(size); -} - -#ifdef YY_USE_PROTOS -static void* yy_flex_realloc(void* ptr, yy_size_t size) -#else -static void* yy_flex_realloc(ptr, size) void* ptr; -yy_size_t size; -#endif -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void*)realloc((char*)ptr, size); -} - -#ifdef YY_USE_PROTOS -static void yy_flex_free(void* ptr) -#else -static void yy_flex_free(ptr) void* ptr; -#endif -{ - free(ptr); -} - -#if YY_MAIN -int main() -{ - yylex(); - return 0; -} -#endif - -void ddlerror(char const* s) -{ - printf("yyerror: %d: %s at %s\n", lineno, s, yytext); -} - -typedef std::vector valbuf_t; - -static valbuf_t valbuf; - -/* - * Called before any actual parsing is done - */ -void scanner_init(const char* str) -{ - size_t slen = strlen(str); - - /* - * Might be left over after ereport() - */ - if (YY_CURRENT_BUFFER) - yy_delete_buffer(YY_CURRENT_BUFFER); - - /* - * Make a scan buffer with special termination needed by flex. - */ - scanbuf = (char*)malloc(slen + 2); - memcpy(scanbuf, str, slen); - scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR; - scanbufhandle = yy_scan_buffer(scanbuf, slen + 2); - - BEGIN(INITIAL); - - valbuf.clear(); -} - -/* - * Called after parsing is done to clean up after scanner_init() - */ - -void scanner_finish(void) -{ - char* str; - - yy_delete_buffer(scanbufhandle); - free(scanbuf); - unsigned int i; - - for (i = 0; i < valbuf.size(); i++) - { - str = valbuf[i]; - - if (str) - { - // std::cout << "valbuf:(" << str << ")" << std::endl; - free(valbuf[i]); - } - } - - valbuf.clear(); -} - -char* scanner_copy(char* str) -{ - char* nv = strdup(str); - - if (nv) - valbuf.push_back(nv); - - return nv; -} diff --git a/dbcon/ddlpackage/ddl.l b/dbcon/ddlpackage/ddl.l index 87739ba217..c0aec2a941 100644 --- a/dbcon/ddlpackage/ddl.l +++ b/dbcon/ddlpackage/ddl.l @@ -24,12 +24,7 @@ #include #include "sqlparser.h" #include "ddlpkg.h" - -#ifdef _MSC_VER -#include "ddl-gram-win.h" -#else #include "ddl-gram.h" -#endif using namespace ddlpackage; typedef enum { NOOP, STRIP_QUOTES } copy_action_t; diff --git a/dbcon/ddlpackage/ddl.y b/dbcon/ddlpackage/ddl.y index c8d36b3798..5c487a1ace 100644 --- a/dbcon/ddlpackage/ddl.y +++ b/dbcon/ddlpackage/ddl.y @@ -43,11 +43,7 @@ %{ #include "sqlparser.h" -#ifdef _MSC_VER -#include "ddl-gram-win.h" -#else #include "ddl-gram.h" -#endif #include "mariadb_my_sys.h" // CHARSET_INFO diff --git a/dbcon/ddlpackage/ddlpkg.h b/dbcon/ddlpackage/ddlpkg.h index 7ad8f273c4..c775a6dbbe 100644 --- a/dbcon/ddlpackage/ddlpkg.h +++ b/dbcon/ddlpackage/ddlpkg.h @@ -46,11 +46,7 @@ #include "bytestream.h" #include "logicalpartition.h" -#if defined(_MSC_VER) && defined(xxxDDLPKG_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace ddlpackage { diff --git a/dbcon/ddlpackage/scanner.bat b/dbcon/ddlpackage/scanner.bat deleted file mode 100644 index b3f0b5e806..0000000000 --- a/dbcon/ddlpackage/scanner.bat +++ /dev/null @@ -1,6 +0,0 @@ -PATH=C:\PROGRA~2\GNUWIN32\BIN;%PATH% - -del ddl-gram-win.h >nul 2>&1 -bison -l -v -d -p ddl -o ddl-gram-win.cpp ddl.y -ren ddl-gram-win.hpp ddl-gram-win.h -flex -i -L -Pddl -oddl-scan-win.cpp ddl.l diff --git a/dbcon/ddlpackage/sqlparser.cpp b/dbcon/ddlpackage/sqlparser.cpp index 81a8367cea..4a2f0c191a 100644 --- a/dbcon/ddlpackage/sqlparser.cpp +++ b/dbcon/ddlpackage/sqlparser.cpp @@ -29,11 +29,7 @@ #include "sqlparser.h" #undef DDLPKGSQLPARSER_DLLEXPORT -#ifdef _MSC_VER -#include "ddl-gram-win.h" -#else #include "ddl-gram.h" -#endif void scanner_finish(void* yyscanner); void scanner_init(const char* str, void* yyscanner); diff --git a/dbcon/ddlpackage/sqlparser.h b/dbcon/ddlpackage/sqlparser.h index 6e477a4492..fe5838ff66 100644 --- a/dbcon/ddlpackage/sqlparser.h +++ b/dbcon/ddlpackage/sqlparser.h @@ -30,11 +30,7 @@ #include "collation.h" // CHARSET_INFO #include "ddlpkg.h" -#if defined(_MSC_VER) && defined(xxxDDLPKGSQLPARSER_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace ddlpackage { diff --git a/dbcon/ddlpackageproc/altertableprocessor.cpp b/dbcon/ddlpackageproc/altertableprocessor.cpp index 86457fb570..d97fcc909e 100644 --- a/dbcon/ddlpackageproc/altertableprocessor.cpp +++ b/dbcon/ddlpackageproc/altertableprocessor.cpp @@ -416,9 +416,6 @@ AlterTableProcessor::DDLResult AlterTableProcessor::processPackage( for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -427,7 +424,6 @@ AlterTableProcessor::DDLResult AlterTableProcessor::processPackage( abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif try { diff --git a/dbcon/ddlpackageproc/altertableprocessor.h b/dbcon/ddlpackageproc/altertableprocessor.h index 7a7f708ad8..48a01a8a6e 100644 --- a/dbcon/ddlpackageproc/altertableprocessor.h +++ b/dbcon/ddlpackageproc/altertableprocessor.h @@ -25,11 +25,7 @@ #include "ddlpackageprocessor.h" -#if defined(_MSC_VER) && defined(DDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace ddlpackageprocessor { diff --git a/dbcon/ddlpackageproc/createtableprocessor.cpp b/dbcon/ddlpackageproc/createtableprocessor.cpp index aebfb094b2..c11230eeeb 100644 --- a/dbcon/ddlpackageproc/createtableprocessor.cpp +++ b/dbcon/ddlpackageproc/createtableprocessor.cpp @@ -167,23 +167,6 @@ CreateTableProcessor::DDLResult CreateTableProcessor::processPackage( // This is a current db bug, it should not turn OID is it cannot find if (roPair.objnum >= 3000) { -#ifdef _MSC_VER - // FIXME: Why do we need to do this??? - systemCatalogPtr->flushCache(); - - try - { - roPair = systemCatalogPtr->tableRID(tableName); - } - catch (...) - { - roPair.objnum = 0; - } - - if (roPair.objnum < 3000) - goto keepGoing; - -#endif Message::Args args; Message message(9); args.add("Internal create table error for"); @@ -199,9 +182,6 @@ CreateTableProcessor::DDLResult CreateTableProcessor::processPackage( return result; } -#ifdef _MSC_VER -keepGoing: -#endif // Start a new transaction VERBOSE_INFO("Starting a new transaction"); diff --git a/dbcon/ddlpackageproc/createtableprocessor.h b/dbcon/ddlpackageproc/createtableprocessor.h index eb4e507022..09b3682a06 100644 --- a/dbcon/ddlpackageproc/createtableprocessor.h +++ b/dbcon/ddlpackageproc/createtableprocessor.h @@ -25,11 +25,7 @@ #include "ddlpackageprocessor.h" -#if defined(_MSC_VER) && defined(DDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace ddlpackageprocessor { diff --git a/dbcon/ddlpackageproc/ddlpackageprocessor.h b/dbcon/ddlpackageproc/ddlpackageprocessor.h index 047b99d95c..83fb33b43a 100644 --- a/dbcon/ddlpackageproc/ddlpackageprocessor.h +++ b/dbcon/ddlpackageproc/ddlpackageprocessor.h @@ -47,11 +47,7 @@ #include "../../writeengine/client/we_clients.h" #include "liboamcpp.h" -#if defined(_MSC_VER) && defined(DDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif //#define IDB_DDL_DEBUG namespace ddlpackageprocessor diff --git a/dbcon/ddlpackageproc/droppartitionprocessor.cpp b/dbcon/ddlpackageproc/droppartitionprocessor.cpp index 6daa1960d6..db7242820c 100644 --- a/dbcon/ddlpackageproc/droppartitionprocessor.cpp +++ b/dbcon/ddlpackageproc/droppartitionprocessor.cpp @@ -168,9 +168,6 @@ DropPartitionProcessor::DDLResult DropPartitionProcessor::processPackage( for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -179,7 +176,6 @@ DropPartitionProcessor::DDLResult DropPartitionProcessor::processPackage( abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif // reset sessionID = dropPartitionStmt.fSessionID; txnID.id = fTxnid.id; diff --git a/dbcon/ddlpackageproc/droppartitionprocessor.h b/dbcon/ddlpackageproc/droppartitionprocessor.h index 9245dca5ac..2c23fbd317 100644 --- a/dbcon/ddlpackageproc/droppartitionprocessor.h +++ b/dbcon/ddlpackageproc/droppartitionprocessor.h @@ -25,11 +25,7 @@ #include "ddlpackageprocessor.h" -#if defined(_MSC_VER) && defined(DDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace ddlpackageprocessor { diff --git a/dbcon/ddlpackageproc/droptableprocessor.cpp b/dbcon/ddlpackageproc/droptableprocessor.cpp index e627fc8d49..8912a2f354 100644 --- a/dbcon/ddlpackageproc/droptableprocessor.cpp +++ b/dbcon/ddlpackageproc/droptableprocessor.cpp @@ -220,9 +220,6 @@ DropTableProcessor::DDLResult DropTableProcessor::processPackage( for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -231,7 +228,6 @@ DropTableProcessor::DDLResult DropTableProcessor::processPackage( abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif try { @@ -882,9 +878,6 @@ TruncTableProcessor::DDLResult TruncTableProcessor::processPackage( for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -893,7 +886,6 @@ TruncTableProcessor::DDLResult TruncTableProcessor::processPackage( abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif try { @@ -1299,13 +1291,6 @@ TruncTableProcessor::DDLResult TruncTableProcessor::processPackage( } } -#ifdef _MSC_VER - catch (std::exception&) - { - // FIXME: Windows can't delete a file that's still open by another process - } - -#else catch (std::exception& ex) { Message::Args args; @@ -1323,7 +1308,6 @@ TruncTableProcessor::DDLResult TruncTableProcessor::processPackage( return result; } -#endif catch (...) { Message::Args args; diff --git a/dbcon/ddlpackageproc/droptableprocessor.h b/dbcon/ddlpackageproc/droptableprocessor.h index 4556b84bc8..90ab26173c 100644 --- a/dbcon/ddlpackageproc/droptableprocessor.h +++ b/dbcon/ddlpackageproc/droptableprocessor.h @@ -25,11 +25,7 @@ #include "ddlpackageprocessor.h" -#if defined(_MSC_VER) && defined(DDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace ddlpackageprocessor { diff --git a/dbcon/ddlpackageproc/markpartitionprocessor.cpp b/dbcon/ddlpackageproc/markpartitionprocessor.cpp index 1e90aaf0d1..6e5f5eb119 100644 --- a/dbcon/ddlpackageproc/markpartitionprocessor.cpp +++ b/dbcon/ddlpackageproc/markpartitionprocessor.cpp @@ -133,9 +133,6 @@ MarkPartitionProcessor::DDLResult MarkPartitionProcessor::processPackage( for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -144,7 +141,6 @@ MarkPartitionProcessor::DDLResult MarkPartitionProcessor::processPackage( abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif // reset sessionID = markPartitionStmt.fSessionID; txnID.id = fTxnid.id; diff --git a/dbcon/ddlpackageproc/markpartitionprocessor.h b/dbcon/ddlpackageproc/markpartitionprocessor.h index 9b5d24123f..4f706bd0a0 100644 --- a/dbcon/ddlpackageproc/markpartitionprocessor.h +++ b/dbcon/ddlpackageproc/markpartitionprocessor.h @@ -25,11 +25,7 @@ #include "ddlpackageprocessor.h" -#if defined(_MSC_VER) && defined(DDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace ddlpackageprocessor { diff --git a/dbcon/ddlpackageproc/restorepartitionprocessor.cpp b/dbcon/ddlpackageproc/restorepartitionprocessor.cpp index 3eea6ae7dd..fea8f7b544 100644 --- a/dbcon/ddlpackageproc/restorepartitionprocessor.cpp +++ b/dbcon/ddlpackageproc/restorepartitionprocessor.cpp @@ -133,9 +133,6 @@ RestorePartitionProcessor::DDLResult RestorePartitionProcessor::processPackage( for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -144,7 +141,6 @@ RestorePartitionProcessor::DDLResult RestorePartitionProcessor::processPackage( abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif // reset sessionID = restorePartitionStmt.fSessionID; txnID.id = fTxnid.id; diff --git a/dbcon/ddlpackageproc/restorepartitionprocessor.h b/dbcon/ddlpackageproc/restorepartitionprocessor.h index 424eafcc91..760d6433cb 100644 --- a/dbcon/ddlpackageproc/restorepartitionprocessor.h +++ b/dbcon/ddlpackageproc/restorepartitionprocessor.h @@ -25,11 +25,7 @@ #include "ddlpackageprocessor.h" -#if defined(_MSC_VER) && defined(DDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace ddlpackageprocessor { diff --git a/dbcon/dmlpackage/calpontdmlfactory.cpp b/dbcon/dmlpackage/calpontdmlfactory.cpp index ab45312066..4817d936d2 100644 --- a/dbcon/dmlpackage/calpontdmlfactory.cpp +++ b/dbcon/dmlpackage/calpontdmlfactory.cpp @@ -33,11 +33,7 @@ #undef DECIMAL #undef DELETE #undef IN -#ifdef _MSC_VER -#include "dml-gram-win.h" -#else #include "dml-gram.h" -#endif #include #include diff --git a/dbcon/dmlpackage/calpontdmlfactory.h b/dbcon/dmlpackage/calpontdmlfactory.h index f53bbf1fec..19f6e34520 100644 --- a/dbcon/dmlpackage/calpontdmlfactory.h +++ b/dbcon/dmlpackage/calpontdmlfactory.h @@ -28,11 +28,7 @@ #include "vendordmlstatement.h" #include -#if defined(_MSC_VER) && defined(xxxCALPONTDMLFACTORY_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackage { class CalpontDMLFactory diff --git a/dbcon/dmlpackage/commanddmlpackage.h b/dbcon/dmlpackage/commanddmlpackage.h index fdc2bf6b47..bd2af3c5f0 100644 --- a/dbcon/dmlpackage/commanddmlpackage.h +++ b/dbcon/dmlpackage/commanddmlpackage.h @@ -27,11 +27,7 @@ #include "calpontdmlpackage.h" #include "bytestream.h" -#if defined(_MSC_VER) && defined(xxxCOMMANDDMLPKG_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackage { diff --git a/dbcon/dmlpackage/deletedmlpackage.h b/dbcon/dmlpackage/deletedmlpackage.h index 1f5070a548..3d2615592d 100644 --- a/dbcon/dmlpackage/deletedmlpackage.h +++ b/dbcon/dmlpackage/deletedmlpackage.h @@ -27,11 +27,7 @@ #include "calpontdmlpackage.h" #include "bytestream.h" -#if defined(_MSC_VER) && defined(xxxDELETEDMLPKG_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackage { diff --git a/dbcon/dmlpackage/dml-gram-win.cpp b/dbcon/dmlpackage/dml-gram-win.cpp deleted file mode 100644 index 0cdd2d9f95..0000000000 --- a/dbcon/dmlpackage/dml-gram-win.cpp +++ /dev/null @@ -1,2964 +0,0 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ -#define yyparse dmlparse -#define yylex dmllex -#define yyerror dmlerror -#define yylval dmllval -#define yychar dmlchar -#define yydebug dmldebug -#define yynerrs dmlnerrs - -/* Copy the first part of user declarations. */ - -#include -#include "dmlparser.h" - -#undef DECIMAL -#undef DELETE -#undef IN -#ifdef _MSC_VER -#include "dml-gram-win.h" -#else -#include "dml-gram.h" -#endif - -using namespace std; -using namespace dmlpackage; - -int dmllex(); - -void dmlerror(char const* error); - -namespace dmlpackage -{ -/* The user is expect to pass a ParseTree* to grammar_init */ -static ParseTree* parseTree; -typedef std::vector copybuf_t; -static copybuf_t copy_buffer; -static std::string default_schema; -char* copy_string(const char* str); - -} // namespace dmlpackage - -/* Enabling traces. */ -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -#undef YYERROR_VERBOSE -#define YYERROR_VERBOSE 1 -#else -#define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -#define YYTOKEN_TABLE 0 -#endif - -/* Tokens. */ -#ifndef YYTOKENTYPE -#define YYTOKENTYPE -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype -{ - NAME = 258, - STRING = 259, - INTNUM = 260, - APPROXNUM = 261, - SELECT = 262, - ALL = 263, - DISTINCT = 264, - NULLX = 265, - USER = 266, - INDICATOR = 267, - AMMSC = 268, - PARAMETER = 269, - ANY = 270, - SOME = 271, - OR = 272, - AND = 273, - NOT = 274, - COMPARISON = 275, - UMINUS = 276, - AS = 277, - ASC = 278, - AUTHORIZATION = 279, - BETWEEN = 280, - BY = 281, - CHARACTER = 282, - CHECK = 283, - CLOSE = 284, - COMMIT = 285, - CONTINUE = 286, - CREATE = 287, - CURRENT = 288, - CURSOR = 289, - IDB_DECIMAL = 290, - DECLARE = 291, - DEFAULT = 292, - DELETE = 293, - DESC = 294, - IDB_DOUBLE = 295, - ESCAPE = 296, - EXISTS = 297, - FETCH = 298, - IDB_FLOAT = 299, - FOR = 300, - FOREIGN = 301, - FOUND = 302, - FROM = 303, - GOTO = 304, - GRANT = 305, - IDB_GROUP = 306, - HAVING = 307, - IN = 308, - INSERT = 309, - INTEGER = 310, - INTO = 311, - IS = 312, - KEY = 313, - LANGUAGE = 314, - LIKE = 315, - NUMERIC = 316, - OF = 317, - ON = 318, - OPEN = 319, - OPTION = 320, - ORDER = 321, - PRECISION = 322, - PRIMARY = 323, - PRIVILEGES = 324, - PROCEDURE = 325, - PUBLIC = 326, - REAL = 327, - REFERENCES = 328, - ROLLBACK = 329, - SCHEMA = 330, - SET = 331, - SMALLINT = 332, - SQLCODE = 333, - SQLERROR = 334, - TABLE = 335, - TO = 336, - UNION = 337, - UNIQUE = 338, - UPDATE = 339, - VALUES = 340, - VIEW = 341, - WHENEVER = 342, - WHERE = 343, - WITH = 344, - WORK = 345 -}; -#endif - -#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - int intval; - double floatval; - char* strval; - int subtok; - dmlpackage::SqlStatementList* sqlStmtList; - dmlpackage::SqlStatement* sqlStmt; - dmlpackage::TableName* tblName; - dmlpackage::ColumnNameList* colNameList; - dmlpackage::ValuesOrQuery* valsOrQuery; - dmlpackage::ValuesList* valsList; - dmlpackage::QuerySpec* querySpec; - dmlpackage::TableNameList* tableNameList; - dmlpackage::TableExpression* tableExpression; - dmlpackage::WhereClause* whereClause; - dmlpackage::SearchCondition* searchCondition; - dmlpackage::ExistanceTestPredicate* existPredicate; - dmlpackage::AllOrAnyPredicate* allOrAnyPredicate; - dmlpackage::InPredicate* inPredicate; - dmlpackage::NullTestPredicate* nullTestPredicate; - dmlpackage::LikePredicate* likePredicate; - dmlpackage::BetweenPredicate* betweenPredicate; - dmlpackage::ComparisonPredicate* comparisonPredicate; - dmlpackage::Predicate* predicate; - dmlpackage::FromClause* fromClause; - dmlpackage::SelectFilter* selectFilter; - dmlpackage::GroupByClause* groupByClause; - dmlpackage::HavingClause* havingClause; - dmlpackage::Escape* escape; - dmlpackage::AtomList* atomList; - dmlpackage::ColumnAssignment* colAssignment; - dmlpackage::ColumnAssignmentList* colAssignmentList; - -} YYSTYPE; -#define YYSTYPE_IS_TRIVIAL 1 -#define yystype YYSTYPE /* obsolescent; will be withdrawn */ -#define YYSTYPE_IS_DECLARED 1 -#endif - -/* Copy the second part of user declarations. */ - -#ifdef short -#undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#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 -#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 yyi) -#else -static int YYID(yyi) int yyi; -#endif -{ - return yyi; -} -#endif - -#if !defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -#ifdef YYSTACK_USE_ALLOCA -#if YYSTACK_USE_ALLOCA -#ifdef __GNUC__ -#define YYSTACK_ALLOC __builtin_alloca -#elif defined __BUILTIN_VA_ARG_INCR -#include /* INFRINGES ON USER NAME SPACE */ -#elif defined _AIX -#define YYSTACK_ALLOC __alloca -#elif defined _MSC_VER -#include /* INFRINGES ON USER NAME SPACE */ -#define alloca _alloca -#else -#define YYSTACK_ALLOC alloca -#if !defined _ALLOCA_H && !defined _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 (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 -#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 */ -#ifndef _STDLIB_H -#define _STDLIB_H 1 -#endif -#endif -#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 */ - -#if (!defined yyoverflow && (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -#define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -#define YYSTACK_BYTES(N) ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -#ifndef YYCOPY -#if defined __GNUC__ && 1 < __GNUC__ -#define YYCOPY(To, From, Count) __builtin_memcpy(To, From, (Count) * sizeof(*(From))) -#else -#define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } while (YYID(0)) -#endif -#endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -#define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof(*yyptr); \ - } while (YYID(0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 47 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 523 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 100 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 92 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 221 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 415 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 345 - -#define YYTRANSLATE(YYX) ((unsigned int)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 96, 97, 23, 21, 98, 22, 99, 24, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 95, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = { - 0, 0, 3, 6, 10, 12, 18, 19, 21, 23, 26, 28, 30, 32, 39, 41, 45, 47, 49, 53, 54, - 57, 60, 64, 69, 72, 75, 78, 83, 86, 92, 97, 103, 111, 122, 127, 129, 133, 141, 142, 146, 147, - 151, 159, 160, 164, 167, 169, 171, 173, 177, 179, 181, 183, 186, 189, 191, 195, 197, 199, 201, 208, 209, - 213, 215, 219, 222, 225, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 257, - 260, 262, 270, 275, 280, 286, 291, 293, 295, 299, 301, 303, 306, 309, 311, 318, 319, 321, 323, 332, 334, - 338, 342, 346, 352, 354, 358, 360, 361, 363, 365, 369, 374, 376, 380, 385, 387, 389, 394, 397, 399, 403, - 405, 408, 411, 412, 416, 418, 422, 423, 426, 430, 434, 437, 441, 443, 445, 447, 449, 451, 453, 455, 457, - 461, 465, 472, 478, 484, 489, 490, 493, 498, 502, 509, 515, 522, 528, 530, 534, 539, 541, 543, 545, 548, - 555, 559, 563, 567, 571, 574, 577, 579, 581, 583, 587, 589, 593, 595, 597, 599, 601, 604, 608, 613, 619, - 625, 630, 632, 634, 636, 638, 642, 644, 646, 650, 656, 658, 663, 665, 670, 677, 679, 684, 691, 693, 695, - 697, 702, 704, 707, 709, 711, 713, 715, 717, 722, 726, 729}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = { - 101, 0, -1, 102, 95, -1, 101, 102, 95, -1, 103, -1, 36, 79, 28, 190, 104, -1, -1, 105, -1, - 106, -1, 105, 106, -1, 107, -1, 115, -1, 118, -1, 36, 84, 182, 96, 108, 97, -1, 109, -1, 108, - 98, 109, -1, 110, -1, 113, -1, 186, 185, 111, -1, -1, 111, 112, -1, 19, 10, -1, 19, 10, 87, - -1, 19, 10, 72, 62, -1, 41, 181, -1, 41, 10, -1, 41, 11, -1, 32, 96, 163, 97, -1, 77, - 182, -1, 77, 182, 96, 114, 97, -1, 87, 96, 114, 97, -1, 72, 62, 96, 114, 97, -1, 50, 62, - 96, 114, 97, 77, 182, -1, 50, 62, 96, 114, 97, 77, 182, 96, 114, 97, -1, 32, 96, 163, 97, - -1, 186, -1, 114, 98, 186, -1, 36, 90, 182, 117, 26, 153, 116, -1, -1, 93, 32, 69, -1, -1, - 96, 114, 97, -1, 54, 120, 67, 182, 85, 123, 119, -1, -1, 93, 54, 69, -1, 8, 73, -1, 8, - -1, 121, -1, 122, -1, 121, 98, 122, -1, 7, -1, 58, -1, 42, -1, 88, 117, -1, 77, 117, -1, - 124, -1, 123, 98, 124, -1, 75, -1, 190, -1, 125, -1, 40, 187, 38, 49, 151, 126, -1, -1, 70, - 30, 127, -1, 128, -1, 127, 98, 128, -1, 5, 129, -1, 184, 129, -1, -1, 27, -1, 43, -1, 130, - -1, 131, -1, 132, -1, 133, -1, 134, -1, 135, -1, 136, -1, 140, -1, 141, -1, 142, -1, 144, -1, - 147, -1, 33, 187, -1, 34, 94, -1, 34, -1, 42, 52, 182, 92, 37, 66, 187, -1, 42, 52, 182, - 150, -1, 47, 187, 60, 148, -1, 58, 60, 183, 117, 137, -1, 89, 96, 138, 97, -1, 153, -1, 139, - -1, 138, 98, 139, -1, 178, -1, 10, -1, 68, 187, -1, 78, 94, -1, 78, -1, 7, 143, 154, 60, - 148, 155, -1, -1, 8, -1, 9, -1, 88, 182, 80, 145, 92, 37, 66, 187, -1, 146, -1, 145, 98, - 146, -1, 186, 20, 176, -1, 186, 20, 10, -1, 88, 182, 80, 145, 150, -1, 149, -1, 148, 98, 149, - -1, 179, -1, -1, 159, -1, 152, -1, 151, 86, 152, -1, 151, 86, 8, 152, -1, 153, -1, 96, 151, - 97, -1, 7, 143, 154, 155, -1, 177, -1, 23, -1, 156, 150, 160, 162, -1, 52, 157, -1, 158, -1, - 157, 98, 158, -1, 182, -1, 182, 189, -1, 92, 163, -1, -1, 55, 30, 161, -1, 184, -1, 161, 98, - 184, -1, -1, 56, 163, -1, 163, 17, 163, -1, 163, 18, 163, -1, 19, 163, -1, 96, 163, 97, -1, - 164, -1, 165, -1, 166, -1, 167, -1, 169, -1, 170, -1, 172, -1, 174, -1, 176, 20, 176, -1, 176, - 20, 175, -1, 176, 19, 29, 176, 18, 176, -1, 176, 29, 176, 18, 176, -1, 176, 19, 64, 178, 168, - -1, 176, 64, 178, 168, -1, -1, 45, 178, -1, 184, 61, 19, 10, -1, 184, 61, 10, -1, 176, 19, - 57, 96, 175, 97, -1, 176, 57, 96, 175, 97, -1, 176, 19, 57, 96, 171, 97, -1, 176, 57, 96, - 171, 97, -1, 178, -1, 171, 98, 178, -1, 176, 20, 173, 175, -1, 15, -1, 8, -1, 16, -1, 46, - 175, -1, 96, 7, 143, 154, 155, 97, -1, 176, 21, 176, -1, 176, 22, 176, -1, 176, 23, 176, -1, - 176, 24, 176, -1, 21, 176, -1, 22, 176, -1, 178, -1, 184, -1, 180, -1, 96, 176, 97, -1, 176, - -1, 177, 98, 176, -1, 179, -1, 181, -1, 11, -1, 188, -1, 188, 188, -1, 188, 12, 188, -1, 13, - 96, 23, 97, -1, 13, 96, 9, 184, 97, -1, 13, 96, 8, 176, 97, -1, 13, 96, 176, 97, -1, - 4, -1, 5, -1, 6, -1, 183, -1, 3, 99, 3, -1, 3, -1, 3, -1, 3, 99, 3, -1, 3, - 99, 3, 99, 3, -1, 31, -1, 31, 96, 5, 97, -1, 65, -1, 65, 96, 5, 97, -1, 65, 96, - 5, 98, 5, 97, -1, 39, -1, 39, 96, 5, 97, -1, 39, 96, 5, 98, 5, 97, -1, 59, -1, - 81, -1, 48, -1, 48, 96, 5, 97, -1, 76, -1, 44, 71, -1, 3, -1, 3, -1, 14, -1, 3, - -1, 3, -1, 91, 19, 51, 191, -1, 91, 83, 191, -1, 53, 3, -1, 35, -1}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = { - 0, 244, 244, 256, 267, 271, 274, 276, 280, 281, 285, 286, 287, 291, 295, 296, - 300, 301, 305, 308, 310, 314, 315, 316, 317, 318, 319, 320, 321, 322, 326, 327, - 328, 330, 332, 336, 341, 349, 353, 355, 359, 360, 364, 368, 370, 374, 375, 376, - 380, 381, 385, 386, 387, 388, 389, 394, 395, 399, 400, 405, 410, 413, 415, 419, - 420, 424, 425, 428, 430, 431, 436, 440, 441, 442, 443, 444, 445, 446, 447, 448, - 449, 450, 454, 458, 462, 470, 478, 485, 489, 499, 503, 510, 515, 523, 524, 528, - 532, 536, 543, 549, 550, 551, 555, 563, 568, 576, 583, 593, 600, 601, 605, 609, - 610, 616, 617, 618, 622, 623, 627, 639, 640, 644, 658, 666, 671, 679, 680, 684, - 692, 693, 701, 706, 714, 715, 725, 732, 739, 745, 749, 758, 762, 766, 770, 774, - 778, 782, 789, 796, 806, 815, 827, 835, 846, 847, 855, 861, 870, 877, 884, 892, - 903, 908, 916, 928, 929, 930, 934, 942, 956, 963, 970, 977, 984, 990, 996, 997, - 998, 999, 1003, 1009, 1017, 1018, 1019, 1023, 1024, 1031, 1043, 1051, 1062, 1072, 1083, 1084, - 1085, 1091, 1095, 1096, 1107, 1108, 1115, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, - 1138, 1139, 1140, 1141, 1142, 1149, 1152, 1156, 1159, 1162, 1166, 1167, 1170, 1171}; -#endif - -#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", - "NAME", - "STRING", - "INTNUM", - "APPROXNUM", - "SELECT", - "ALL", - "DISTINCT", - "NULLX", - "USER", - "INDICATOR", - "AMMSC", - "PARAMETER", - "ANY", - "SOME", - "OR", - "AND", - "NOT", - "COMPARISON", - "'+'", - "'-'", - "'*'", - "'/'", - "UMINUS", - "AS", - "ASC", - "AUTHORIZATION", - "BETWEEN", - "BY", - "CHARACTER", - "CHECK", - "CLOSE", - "COMMIT", - "CONTINUE", - "CREATE", - "CURRENT", - "CURSOR", - "IDB_DECIMAL", - "DECLARE", - "DEFAULT", - "DELETE", - "DESC", - "IDB_DOUBLE", - "ESCAPE", - "EXISTS", - "FETCH", - "IDB_FLOAT", - "FOR", - "FOREIGN", - "FOUND", - "FROM", - "GOTO", - "GRANT", - "IDB_GROUP", - "HAVING", - "IN", - "INSERT", - "INTEGER", - "INTO", - "IS", - "KEY", - "LANGUAGE", - "LIKE", - "NUMERIC", - "OF", - "ON", - "OPEN", - "OPTION", - "ORDER", - "PRECISION", - "PRIMARY", - "PRIVILEGES", - "PROCEDURE", - "PUBLIC", - "REAL", - "REFERENCES", - "ROLLBACK", - "SCHEMA", - "SET", - "SMALLINT", - "SQLCODE", - "SQLERROR", - "TABLE", - "TO", - "UNION", - "UNIQUE", - "UPDATE", - "VALUES", - "VIEW", - "WHENEVER", - "WHERE", - "WITH", - "WORK", - "';'", - "'('", - "')'", - "','", - "'.'", - "$accept", - "sql_list", - "sql", - "schema", - "opt_schema_element_list", - "schema_element_list", - "schema_element", - "base_table_def", - "base_table_element_commalist", - "base_table_element", - "column_def", - "column_def_opt_list", - "column_def_opt", - "table_constraint_def", - "column_commalist", - "view_def", - "opt_with_check_option", - "opt_column_commalist", - "privilege_def", - "opt_with_grant_option", - "privileges", - "operation_commalist", - "operation", - "grantee_commalist", - "grantee", - "cursor_def", - "opt_order_by_clause", - "ordering_spec_commalist", - "ordering_spec", - "opt_asc_desc", - "manipulative_statement", - "close_statement", - "commit_statement", - "delete_statement_positioned", - "delete_statement_searched", - "fetch_statement", - "insert_statement", - "values_or_query_spec", - "insert_atom_commalist", - "insert_atom", - "open_statement", - "rollback_statement", - "select_statement", - "opt_all_distinct", - "update_statement_positioned", - "assignment_commalist", - "assignment", - "update_statement_searched", - "target_commalist", - "target", - "opt_where_clause", - "query_exp", - "query_term", - "query_spec", - "selection", - "table_exp", - "from_clause", - "table_ref_commalist", - "table_ref", - "where_clause", - "opt_group_by_clause", - "column_ref_commalist", - "opt_having_clause", - "search_condition", - "predicate", - "comparison_predicate", - "between_predicate", - "like_predicate", - "opt_escape", - "test_for_null", - "in_predicate", - "atom_commalist", - "all_or_any_predicate", - "any_all_some", - "existence_test", - "subquery", - "scalar_exp", - "scalar_exp_commalist", - "atom", - "parameter_ref", - "function_ref", - "literal", - "table", - "table_name", - "column_ref", - "data_type", - "column", - "cursor", - "parameter", - "range_variable", - "user", - "when_action", - 0}; -#endif - -#ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 43, 45, 42, 47, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 59, 40, 41, 44, 46}; -#endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = { - 0, 100, 101, 101, 102, 103, 104, 104, 105, 105, 106, 106, 106, 107, 108, 108, 109, 109, 110, 111, 111, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 114, 114, 115, 116, 116, 117, 117, - 118, 119, 119, 120, 120, 120, 121, 121, 122, 122, 122, 122, 122, 123, 123, 124, 124, 102, 125, 126, 126, - 127, 127, 128, 128, 129, 129, 129, 102, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, 132, - 132, 133, 134, 135, 136, 137, 137, 138, 138, 139, 139, 140, 141, 141, 142, 143, 143, 143, 144, 145, 145, - 146, 146, 147, 148, 148, 149, 150, 150, 151, 151, 151, 152, 152, 153, 154, 154, 155, 156, 157, 157, 158, - 158, 159, 160, 160, 161, 161, 162, 162, 163, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, 164, 165, - 165, 166, 166, 167, 167, 168, 168, 169, 169, 170, 170, 170, 170, 171, 171, 172, 173, 173, 173, 174, 175, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, 178, 178, 178, 179, 179, 179, 180, 180, 180, - 180, 181, 181, 181, 182, 183, 183, 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 186, 187, 188, 189, 190, 102, 102, 191, 191}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = { - 0, 2, 2, 3, 1, 5, 0, 1, 1, 2, 1, 1, 1, 6, 1, 3, 1, 1, 3, 0, 2, 2, 3, 4, 2, 2, 2, 4, 2, 5, 4, 5, - 7, 10, 4, 1, 3, 7, 0, 3, 0, 3, 7, 0, 3, 2, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 3, 1, 1, 1, 6, 0, 3, 1, - 3, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 7, 4, 4, 5, 4, 1, 1, 3, 1, 1, 2, - 2, 1, 6, 0, 1, 1, 8, 1, 3, 3, 3, 5, 1, 3, 1, 0, 1, 1, 3, 4, 1, 3, 4, 1, 1, 4, 2, 1, 3, 1, 2, 2, - 0, 3, 1, 3, 0, 2, 3, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 6, 5, 5, 4, 0, 2, 4, 3, 6, 5, 6, 5, - 1, 3, 4, 1, 1, 1, 2, 6, 3, 3, 3, 3, 2, 2, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 2, 3, 4, 5, 5, 4, 1, 1, - 1, 1, 3, 1, 1, 3, 5, 1, 4, 1, 4, 6, 1, 4, 6, 1, 1, 1, 4, 1, 2, 1, 1, 1, 1, 1, 4, 3, 2, 1}; - -/* 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 yytype_uint8 yydefact[] = { - 0, 99, 0, 84, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, 4, 59, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 100, 101, 0, 214, 82, 83, 0, 0, 0, 0, 0, 95, 96, - 195, 0, 193, 0, 0, 1, 0, 2, 196, 190, 191, 192, 182, 0, 215, 0, 0, 120, 0, 0, 178, - 119, 174, 180, 176, 181, 175, 183, 0, 0, 111, 0, 40, 0, 0, 0, 221, 0, 219, 3, 0, 0, - 172, 173, 0, 0, 0, 0, 0, 0, 0, 0, 184, 217, 6, 0, 0, 86, 112, 87, 108, 110, 0, - 0, 194, 213, 111, 103, 0, 218, 220, 197, 0, 0, 0, 0, 177, 0, 168, 169, 170, 171, 179, 185, - 0, 0, 5, 7, 8, 10, 11, 12, 99, 0, 61, 113, 116, 0, 0, 0, 0, 127, 138, 139, 140, - 141, 142, 143, 144, 145, 0, 175, 0, 0, 35, 0, 88, 90, 0, 0, 107, 0, 0, 0, 0, 186, - 189, 0, 98, 111, 0, 0, 50, 46, 52, 51, 40, 40, 0, 47, 48, 9, 0, 0, 0, 0, 60, - 136, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 41, 0, 0, 0, 104, 106, - 105, 198, 188, 187, 122, 123, 125, 0, 128, 0, 40, 45, 54, 53, 0, 0, 0, 117, 0, 0, 114, - 85, 99, 137, 134, 135, 0, 0, 0, 164, 163, 165, 0, 0, 147, 146, 0, 0, 152, 155, 0, 36, - 94, 0, 91, 93, 0, 0, 216, 126, 0, 132, 0, 0, 0, 49, 118, 67, 62, 63, 67, 115, 0, - 0, 0, 152, 162, 0, 0, 0, 160, 0, 151, 154, 89, 0, 102, 124, 0, 0, 121, 0, 0, 0, - 0, 0, 14, 16, 17, 0, 0, 0, 68, 69, 65, 0, 66, 0, 0, 0, 0, 150, 149, 159, 0, - 157, 153, 92, 129, 130, 133, 0, 0, 0, 0, 13, 0, 199, 204, 0, 209, 207, 201, 211, 208, 19, - 38, 57, 43, 55, 58, 64, 0, 148, 158, 156, 161, 0, 0, 0, 0, 0, 15, 0, 0, 212, 0, - 0, 18, 0, 37, 0, 0, 42, 167, 131, 34, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 0, 0, 56, 0, 31, 200, 205, 0, 210, 202, 0, 21, 0, 25, 26, 24, 28, 39, 44, 0, - 0, 0, 0, 22, 0, 0, 32, 206, 203, 23, 27, 0, 0, 29, 0, 33}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = { - -1, 13, 14, 15, 128, 129, 130, 131, 295, 296, 297, 358, 378, 298, 155, 132, 360, 105, 133, - 363, 180, 181, 182, 338, 339, 16, 188, 268, 269, 304, 17, 18, 19, 20, 21, 22, 23, 158, - 253, 254, 24, 25, 26, 31, 27, 108, 109, 28, 101, 102, 99, 136, 137, 138, 61, 170, 171, - 214, 215, 100, 261, 318, 290, 143, 144, 145, 146, 147, 282, 148, 149, 278, 150, 243, 151, 192, - 152, 63, 64, 65, 66, 67, 216, 44, 68, 335, 156, 33, 69, 259, 340, 80}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -270 -static const yytype_int16 yypact[] = { - 352, 101, 20, -63, -25, 20, 30, 20, 90, 20, 59, 185, 81, 337, 104, -270, -270, - -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, 286, -270, -270, - -270, 191, 202, 185, 156, 185, -270, -270, 138, 162, -270, 196, -3, -270, 154, -270, 168, - -270, -270, -270, -270, 160, -270, 320, 320, -270, 320, 192, 341, 172, -270, -270, -270, -270, - -270, 153, 274, 232, 206, 269, 214, 299, 317, -3, -270, 324, -270, -270, 340, 16, -270, - -270, 135, 269, 320, 320, 320, 320, 320, 269, -270, -270, 91, 21, 100, -270, -270, 234, - -270, -270, 317, -1, -270, -270, 97, -270, 336, -270, -270, 261, 320, 366, 243, 149, -270, - 78, 199, 199, -270, -270, 341, -270, 127, 66, -270, 91, -270, -270, -270, -270, 101, 21, - 82, -270, -270, 282, 306, 295, 282, 213, -270, -270, -270, -270, -270, -270, -270, -270, 326, - 332, 269, 178, -270, 300, -270, -270, 222, 317, -270, 73, 395, 161, 312, -270, -270, 185, - -270, 311, 185, 185, -270, 346, -270, -270, 214, 214, 357, 316, -270, -270, 286, 50, 392, - 33, -270, -270, 20, 422, -270, 26, 181, 282, 282, 157, 258, 320, 335, 407, 122, -270, - -270, 317, 347, 367, -270, -270, 341, -270, -270, -270, 344, -270, 451, 282, 400, 360, 214, - -270, -270, -270, 185, 121, 405, -270, 175, 21, -270, -270, 101, -270, 440, -270, 320, 363, - 407, -270, -270, -270, 308, 295, -270, 341, 414, 42, 415, -270, 452, -270, -270, 208, -270, - -270, 20, 185, -270, -270, 431, 408, 94, 437, 380, -270, -270, 150, 368, -270, 150, -270, - 286, 423, 42, 415, -270, 320, 219, 371, -270, 407, -270, -270, -270, 347, -270, -270, 366, - 282, -270, 373, 409, 410, 374, 238, -270, -270, -270, 358, 460, 32, -270, -270, -270, 175, - -270, 405, 320, 241, 376, -270, 341, -270, 407, -270, -270, -270, 377, -270, 213, 282, 378, - 381, 317, -270, 94, 382, 383, 411, 384, -270, 385, -270, -270, -270, 390, -270, 141, -270, - -270, -270, 379, 341, -270, -270, -270, 366, 52, 317, 317, 270, -270, 479, 480, -270, 481, - 482, 188, 456, -270, 435, 32, -270, -270, -270, -270, 303, 310, -270, 393, 329, 394, 351, - 483, 396, 370, 185, -270, 425, 426, -270, 419, -270, -270, -270, 492, -270, -270, 493, -12, - 282, -270, -270, -270, 403, -270, -270, 185, 404, 406, 438, -270, 54, 317, 412, -270, -270, - -270, -270, 353, 317, -270, 355, -270}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = { - -270, -270, 489, -270, -270, -270, 375, -270, -270, 179, -270, -270, -270, -270, -269, -270, - -270, -163, -270, -270, -270, -270, 281, -270, 145, -270, -270, -270, 204, 240, -270, -270, - -270, -270, -270, -270, -270, -270, -270, 226, -270, -270, -270, -131, -270, -270, 354, -270, - 427, 359, -56, 386, -136, -103, -170, -216, -270, -270, 255, -270, -270, -270, -270, -134, - -270, -270, -270, -270, 242, -270, -270, 244, -270, -270, -270, 8, -24, -270, -189, 61, - -270, 140, -11, 484, -97, -270, -72, 4, 47, -270, 449, 443}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint16 yytable[] = { - 43, 153, 159, 184, 110, 189, 134, 62, 193, 36, 266, 38, 248, 40, 226, 222, 223, 255, 166, 50, 51, - 52, 53, 32, 114, 115, 72, 54, 134, 55, 56, 34, 78, 84, 85, 95, 86, 57, 58, 116, 134, 229, - 153, 195, 196, 153, 51, 52, 53, 275, 79, 230, 162, 54, 35, 351, 56, 263, 280, 117, 401, 234, 235, - 153, 120, 121, 122, 123, 124, 195, 196, 195, 196, 174, 175, 402, 50, 51, 52, 53, 367, 368, 37, 209, - 54, 280, 55, 56, 157, 110, 165, 342, 316, 271, 57, 58, 255, 107, 153, 153, 45, 272, 307, 50, 51, - 52, 53, 337, 176, 29, 30, 54, 60, 55, 56, 218, 94, 135, 194, 139, 153, 57, 58, 233, 177, 346, - 291, 126, 174, 135, 169, 270, 249, 251, 103, 410, 187, 140, 191, 210, 125, 250, 413, 178, 292, 127, 141, - 227, 103, 366, 39, 409, 186, 41, 179, 320, 88, 89, 90, 91, 62, 219, 220, 176, 46, 93, 293, 56, - 187, 60, 88, 89, 90, 91, 245, 246, 154, 302, 50, 177, 267, 294, 88, 89, 90, 91, 236, 348, 42, - 160, 299, 319, 153, 303, 231, 161, 142, 336, 178, 49, 197, 198, 88, 89, 90, 91, 244, 374, 270, 179, - 199, 172, 273, 264, 237, 103, 73, 173, 86, 70, 375, 238, 90, 91, 153, 50, 51, 52, 53, 376, 195, - 196, 118, 54, 361, 55, 56, 75, 200, 362, 71, 139, 76, 57, 58, 201, 168, 77, 62, 81, 365, 276, - 87, 312, 299, 279, 83, 403, 212, 207, 286, 50, 51, 52, 53, 377, 239, 82, 141, 54, 92, 55, 56, - 240, 241, 204, 205, 95, 118, 57, 58, 97, 310, 56, 343, 50, 51, 52, 53, 50, 51, 52, 53, 54, - 153, 55, 56, 54, 98, 55, 56, 139, 106, 57, 58, 284, 285, 57, 58, 59, 104, 50, 51, 52, 53, - 232, 313, 314, 142, 54, 107, 55, 56, 50, 51, 52, 53, 112, 141, 57, 58, 54, 154, 55, 56, 325, - 326, 47, 344, 314, 167, 57, 58, 113, 1, 197, 198, 88, 89, 90, 91, 51, 52, 53, 242, 199, 163, - 252, 54, 1, 164, 56, 88, 89, 90, 91, 395, 369, 205, 50, 2, 3, 190, 4, 51, 52, 53, 5, - 142, 6, 392, 393, 60, 200, 7, 2, 3, 405, 4, 327, 201, 191, 5, 202, 6, 8, 206, 328, 211, - 7, 382, 205, 329, 217, 60, 9, 330, 383, 205, 213, 8, 51, 52, 53, 225, 10, 60, 331, 54, 221, - 9, 56, 228, 332, 224, 11, 385, 386, 12, 232, 10, 247, 277, 256, 333, 88, 89, 90, 91, 334, 11, - 308, 257, 12, 88, 89, 90, 91, 388, 389, 412, 205, 414, 205, 258, 260, 262, 169, 196, 274, 281, 288, - 283, 300, 289, 301, 305, 134, 315, 321, 324, 322, 323, 345, 349, 347, 364, 350, 353, 354, 356, 357, 355, - 359, 370, 371, 372, 373, 379, 380, 384, 387, 391, 390, 396, 397, 398, 399, 400, 404, 408, 406, 48, 407, - 183, 352, 265, 381, 411, 341, 306, 317, 287, 203, 119, 208, 394, 311, 309, 96, 111, 185, 0, 74}; - -static const yytype_int16 yycheck[] = { - 11, 98, 105, 134, 76, 139, 7, 31, 142, 5, 226, 7, 201, 9, 184, 178, 179, 206, 115, 3, 4, - 5, 6, 3, 8, 9, 37, 11, 7, 13, 14, 94, 35, 57, 58, 3, 60, 21, 22, 23, 7, 8, - 139, 17, 18, 142, 4, 5, 6, 238, 53, 187, 108, 11, 79, 324, 14, 220, 247, 83, 72, 195, 196, - 160, 88, 89, 90, 91, 92, 17, 18, 17, 18, 7, 8, 87, 3, 4, 5, 6, 349, 350, 52, 10, - 11, 274, 13, 14, 89, 161, 114, 307, 281, 229, 21, 22, 285, 3, 195, 196, 19, 232, 272, 3, 4, - 5, 6, 75, 42, 8, 9, 11, 96, 13, 14, 171, 69, 96, 142, 19, 217, 21, 22, 97, 58, 314, - 32, 36, 7, 96, 52, 228, 10, 205, 73, 404, 86, 37, 96, 163, 93, 19, 411, 77, 50, 54, 46, - 97, 87, 97, 60, 97, 70, 94, 88, 289, 21, 22, 23, 24, 184, 172, 173, 42, 83, 12, 72, 14, - 86, 96, 21, 22, 23, 24, 198, 199, 98, 27, 3, 58, 5, 87, 21, 22, 23, 24, 29, 321, 3, - 92, 262, 288, 289, 43, 190, 98, 96, 300, 77, 95, 19, 20, 21, 22, 23, 24, 198, 19, 305, 88, - 29, 84, 236, 224, 57, 154, 60, 90, 242, 28, 32, 64, 23, 24, 321, 3, 4, 5, 6, 41, 17, - 18, 97, 11, 93, 13, 14, 99, 57, 98, 38, 19, 80, 21, 22, 64, 97, 51, 272, 95, 347, 243, - 60, 277, 326, 247, 96, 391, 97, 37, 256, 3, 4, 5, 6, 77, 8, 99, 46, 11, 98, 13, 14, - 15, 16, 97, 98, 3, 97, 21, 22, 49, 274, 14, 308, 3, 4, 5, 6, 3, 4, 5, 6, 11, - 391, 13, 14, 11, 92, 13, 14, 19, 3, 21, 22, 97, 98, 21, 22, 23, 96, 3, 4, 5, 6, - 7, 97, 98, 96, 11, 3, 13, 14, 3, 4, 5, 6, 3, 46, 21, 22, 11, 98, 13, 14, 97, - 98, 0, 97, 98, 97, 21, 22, 3, 7, 19, 20, 21, 22, 23, 24, 4, 5, 6, 96, 29, 20, - 10, 11, 7, 99, 14, 21, 22, 23, 24, 377, 97, 98, 3, 33, 34, 66, 36, 4, 5, 6, 40, - 96, 42, 10, 11, 96, 57, 47, 33, 34, 398, 36, 31, 64, 96, 40, 61, 42, 58, 96, 39, 3, - 47, 97, 98, 44, 92, 96, 68, 48, 97, 98, 97, 58, 4, 5, 6, 98, 78, 96, 59, 11, 73, - 68, 14, 30, 65, 67, 88, 97, 98, 91, 7, 78, 96, 18, 66, 76, 21, 22, 23, 24, 81, 88, - 18, 98, 91, 21, 22, 23, 24, 97, 98, 97, 98, 97, 98, 3, 55, 96, 52, 18, 96, 45, 30, - 10, 26, 56, 85, 98, 7, 97, 96, 96, 62, 62, 97, 96, 98, 97, 96, 96, 96, 96, 96, 71, - 93, 5, 5, 5, 5, 32, 54, 97, 97, 96, 10, 69, 69, 77, 5, 5, 96, 62, 97, 13, 97, - 129, 326, 225, 362, 96, 305, 270, 285, 257, 154, 87, 161, 376, 275, 274, 70, 77, 135, -1, 39}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = { - 0, 7, 33, 34, 36, 40, 42, 47, 58, 68, 78, 88, 91, 101, 102, 103, 125, 130, 131, 132, 133, - 134, 135, 136, 140, 141, 142, 144, 147, 8, 9, 143, 3, 187, 94, 79, 187, 52, 187, 60, 187, 94, - 3, 182, 183, 19, 83, 0, 102, 95, 3, 4, 5, 6, 11, 13, 14, 21, 22, 23, 96, 154, 176, - 177, 178, 179, 180, 181, 184, 188, 28, 38, 182, 60, 183, 99, 80, 51, 35, 53, 191, 95, 99, 96, - 176, 176, 176, 60, 21, 22, 23, 24, 98, 12, 188, 3, 190, 49, 92, 150, 159, 148, 149, 179, 96, - 117, 3, 3, 145, 146, 186, 191, 3, 3, 8, 9, 23, 176, 97, 148, 176, 176, 176, 176, 176, 188, - 36, 54, 104, 105, 106, 107, 115, 118, 7, 96, 151, 152, 153, 19, 37, 46, 96, 163, 164, 165, 166, - 167, 169, 170, 172, 174, 176, 184, 98, 114, 186, 89, 137, 153, 92, 98, 150, 20, 99, 176, 184, 97, - 97, 52, 155, 156, 84, 90, 7, 8, 42, 58, 77, 88, 120, 121, 122, 106, 143, 151, 70, 86, 126, - 163, 66, 96, 175, 163, 176, 17, 18, 19, 20, 29, 57, 64, 61, 149, 97, 98, 96, 37, 146, 10, - 176, 3, 97, 97, 157, 158, 182, 92, 150, 182, 182, 73, 117, 117, 67, 98, 154, 97, 30, 8, 152, - 187, 7, 97, 163, 163, 29, 57, 64, 8, 15, 16, 96, 173, 175, 176, 176, 96, 178, 10, 19, 186, - 10, 138, 139, 178, 66, 98, 3, 189, 55, 160, 96, 117, 182, 122, 155, 5, 127, 128, 184, 152, 143, - 176, 96, 178, 175, 18, 171, 175, 178, 45, 168, 10, 97, 98, 187, 158, 30, 56, 162, 32, 50, 72, - 87, 108, 109, 110, 113, 186, 26, 85, 27, 43, 129, 98, 129, 154, 18, 171, 175, 168, 176, 97, 98, - 97, 178, 139, 161, 184, 163, 96, 62, 62, 96, 97, 98, 31, 39, 44, 48, 59, 65, 76, 81, 185, - 153, 75, 123, 124, 190, 128, 155, 176, 97, 97, 178, 98, 163, 96, 96, 114, 109, 96, 96, 71, 96, - 96, 111, 93, 116, 93, 98, 119, 97, 184, 97, 114, 114, 97, 5, 5, 5, 5, 19, 32, 41, 77, - 112, 32, 54, 124, 97, 97, 97, 97, 98, 97, 97, 98, 10, 96, 10, 11, 181, 182, 69, 69, 77, - 5, 5, 72, 87, 163, 96, 182, 97, 97, 62, 97, 114, 96, 97, 114, 97}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE(yychar); \ - YYPOPSTACK(1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror(YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (YYID(0)) - -#define YYTERROR 1 -#define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -#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 -#define YYLEX yylex(YYLEX_PARAM) -#else -#define YYLEX yylex() -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -#ifndef YYFPRINTF -#include /* INFRINGES ON USER NAME SPACE */ -#define YYFPRINTF fprintf -#endif - -#define YYDPRINTF(Args) \ - do \ - { \ - if (yydebug) \ - YYFPRINTF Args; \ - } while (YYID(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)) - -/*--------------------------------. -| 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 __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yy_stack_print(yytype_int16* yybottom, yytype_int16* yytop) -#else -static void yy_stack_print(yybottom, yytop) yytype_int16* yybottom; -yytype_int16* yytop; -#endif -{ - YYFPRINTF(stderr, "Stack now"); - - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF(stderr, " %d", yybot); - } - - YYFPRINTF(stderr, "\n"); -} - -#define YY_STACK_PRINT(Bottom, Top) \ - do \ - { \ - if (yydebug) \ - yy_stack_print((Bottom), (Top)); \ - } while (YYID(0)) - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yy_reduce_print(YYSTYPE* yyvsp, int yyrule) -#else -static void yy_reduce_print(yyvsp, yyrule) YYSTYPE* yyvsp; -int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - 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++) - { - YYFPRINTF(stderr, " $%d = ", yyi + 1); - yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)])); - YYFPRINTF(stderr, "\n"); - } -} - -#define YY_REDUCE_PRINT(Rule) \ - do \ - { \ - if (yydebug) \ - 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 YY_SYMBOL_PRINT(Title, Type, Value, Location) -#define YY_STACK_PRINT(Bottom, Top) -#define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -#if YYERROR_VERBOSE - -#ifndef yystrlen -#if defined __GLIBC__ && defined _STRING_H -#define yystrlen strlen -#else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T yystrlen(const char* yystr) -#else -static YYSIZE_T yystrlen(yystr) const char* yystr; -#endif -{ - YYSIZE_T yylen; - - for (yylen = 0; yystr[yylen]; yylen++) - continue; - - return yylen; -} -#endif -#endif - -#ifndef yystpcpy -#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -#define yystpcpy stpcpy -#else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static char* yystpcpy(char* yydest, const char* yysrc) -#else -static char* yystpcpy(yydest, yysrc) char* yydest; -const char* yysrc; -#endif -{ - char* yyd = yydest; - const char* yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -#endif -#endif - -#ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T yytnamerr(char* yyres, const char* yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const* yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - - return yyn; - } - - do_not_strip_quotes:; - } - - if (!yyres) - return yystrlen(yystr); - - return yystpcpy(yyres, yystr) - yyres; -} -#endif - -/* Copy into 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) -{ - int yyn = yypact[yystate]; - - if (!(YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - 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 - 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; - - /* 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; - } -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yydestruct(const char* yymsg, int yytype, YYSTYPE* yyvaluep) -#else -static void yydestruct(yymsg, yytype, yyvaluep) const char* yymsg; -int yytype; -YYSTYPE* yyvaluep; -#endif -{ - YYUSE(yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - - YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - default: break; - } -} - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse(void* YYPARSE_PARAM); -#else -int yyparse(); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse(void); -#else -int yyparse(); -#endif -#endif /* ! YYPARSE_PARAM */ - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - -#ifdef YYPARSE_PARAM -#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 __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -int yyparse(void) -#else -int yyparse() - -#endif -#endif -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16* yyss; - yytype_int16* yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE* yyvs; - YYSTYPE* yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char* yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - - /*------------------------------------------------------------. - | yynewstate -- Push a new state, which is found in yystate. | - `------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - -yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE* yyvs1 = yyvs; - yytype_int16* yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow(YY_("memory exhausted"), &yyss1, yysize * sizeof(*yyssp), &yyvs1, yysize * sizeof(*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -#ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - - yystacksize *= 2; - - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16* yyss1 = yyss; - union yyalloc* yyptr = (union yyalloc*)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize)); - - if (!yyptr) - goto yyexhaustedlab; - - YYSTACK_RELOCATE(yyss_alloc, yyss); - YYSTACK_RELOCATE(yyvs_alloc, yyvs); -#undef YYSTACK_RELOCATE - - if (yyss1 != yyssa) - YYSTACK_FREE(yyss1); - } -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF((stderr, "Stack size increased to %lu\n", (unsigned long int)yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - /*-----------. - | yybackup. | - `-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE(yychar); - YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - - yyn = yytable[yyn]; - - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - - if (yyn == 0) - goto yyerrlab; - - goto yyreduce; - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1 - yylen]; - - YY_REDUCE_PRINT(yyn); - - switch (yyn) - { - case 2: - - { - if ((yyvsp[(1) - (2)].sqlStmt) != NULL) - { - (yyval.sqlStmtList) = parseTree; - (yyval.sqlStmtList)->push_back((yyvsp[(1) - (2)].sqlStmt)); - } - else - { - (yyval.sqlStmtList) = NULL; - } - - ; - } - break; - - case 3: - - { - if ((yyvsp[(1) - (3)].sqlStmtList) != NULL) - { - parseTree = (yyvsp[(1) - (3)].sqlStmtList); - } - - ; - } - break; - - case 4: - - { - (yyval.sqlStmt) = NULL; - ; - } - break; - - case 35: - - { - (yyval.colNameList) = new ColumnNameList; - (yyval.colNameList)->push_back((yyvsp[(1) - (1)].strval)); - ; - } - break; - - case 36: - - { - (yyval.colNameList) = (yyvsp[(1) - (3)].colNameList); - (yyval.colNameList)->push_back((yyvsp[(3) - (3)].strval)); - ; - } - break; - - case 40: - - { - (yyval.colNameList) = NULL; - ; - } - break; - - case 41: - - { - (yyval.colNameList) = (yyvsp[(2) - (3)].colNameList); - ; - } - break; - - case 59: - - { - (yyval.sqlStmt) = NULL; - ; - } - break; - - case 82: - - { - ; - } - break; - - case 83: - - { - (yyval.sqlStmt) = new CommandSqlStatement("COMMIT"); - ; - } - break; - - case 84: - - { - (yyval.sqlStmt) = new CommandSqlStatement("COMMIT"); - ; - } - break; - - case 85: - - { - (yyval.sqlStmt) = new DeleteSqlStatement((yyvsp[(3) - (7)].tblName)); - - ; - } - break; - - case 86: - - { - (yyval.sqlStmt) = new DeleteSqlStatement((yyvsp[(3) - (4)].tblName), (yyvsp[(4) - (4)].whereClause)); - ; - } - break; - - case 87: - - { - ; - } - break; - - case 88: - - { - if (NULL == (yyvsp[(4) - (5)].colNameList)) - (yyval.sqlStmt) = new InsertSqlStatement((yyvsp[(3) - (5)].tblName), (yyvsp[(5) - (5)].valsOrQuery)); - else - (yyval.sqlStmt) = new InsertSqlStatement((yyvsp[(3) - (5)].tblName), (yyvsp[(4) - (5)].colNameList), - (yyvsp[(5) - (5)].valsOrQuery)); - - ; - } - break; - - case 89: - - { - (yyval.valsOrQuery) = new ValuesOrQuery((yyvsp[(3) - (4)].valsList)); - ; - } - break; - - case 90: - - { - (yyval.valsOrQuery) = new ValuesOrQuery((yyvsp[(1) - (1)].querySpec)); - ; - } - break; - - case 91: - - { - (yyval.valsList) = new ValuesList; - (yyval.valsList)->push_back((yyvsp[(1) - (1)].strval)); - ; - } - break; - - case 92: - - { - (yyval.valsList) = (yyvsp[(1) - (3)].valsList); - (yyval.valsList)->push_back((yyvsp[(3) - (3)].strval)); - ; - } - break; - - case 95: - - { - ; - } - break; - - case 96: - - { - (yyval.sqlStmt) = new CommandSqlStatement("ROLLBACK"); - ; - } - break; - - case 97: - - { - (yyval.sqlStmt) = new CommandSqlStatement("ROLLBACK"); - ; - } - break; - - case 98: - - { - ; - } - break; - - case 99: - - { - (yyval.strval) = NULL; - ; - } - break; - - case 100: - - { - (yyval.strval) = (yyvsp[(1) - (1)].strval); - ; - } - break; - - case 101: - - { - (yyval.strval) = (yyvsp[(1) - (1)].strval); - ; - } - break; - - case 102: - - { - (yyval.sqlStmt) = - new UpdateSqlStatement((yyvsp[(2) - (8)].tblName), (yyvsp[(4) - (8)].colAssignmentList)); - ; - } - break; - - case 103: - - { - (yyval.colAssignmentList) = new ColumnAssignmentList(); - (yyval.colAssignmentList)->push_back((yyvsp[(1) - (1)].colAssignment)); - ; - } - break; - - case 104: - - { - (yyval.colAssignmentList) = (yyvsp[(1) - (3)].colAssignmentList); - (yyval.colAssignmentList)->push_back((yyvsp[(3) - (3)].colAssignment)); - ; - } - break; - - case 105: - - { - (yyval.colAssignment) = new ColumnAssignment(); - (yyval.colAssignment)->fColumn = (yyvsp[(1) - (3)].strval); - (yyval.colAssignment)->fOperator = (yyvsp[(2) - (3)].strval); - (yyval.colAssignment)->fScalarExpression = (yyvsp[(3) - (3)].strval); - ; - } - break; - - case 106: - - { - (yyval.colAssignment) = new ColumnAssignment(); - (yyval.colAssignment)->fColumn = (yyvsp[(1) - (3)].strval); - (yyval.colAssignment)->fOperator = (yyvsp[(2) - (3)].strval); - (yyval.colAssignment)->fScalarExpression = (yyvsp[(3) - (3)].strval); - ; - } - break; - - case 107: - - { - (yyval.sqlStmt) = new UpdateSqlStatement( - (yyvsp[(2) - (5)].tblName), (yyvsp[(4) - (5)].colAssignmentList), (yyvsp[(5) - (5)].whereClause)); - ; - } - break; - - case 111: - - { - (yyval.whereClause) = NULL; - ; - } - break; - - case 112: - - { - (yyval.whereClause) = (yyvsp[(1) - (1)].whereClause); - ; - } - break; - - case 118: - - { - (yyval.querySpec) = new QuerySpec(); - - if (NULL != (yyvsp[(2) - (4)].strval)) - (yyval.querySpec)->fOptionAllOrDistinct = (yyvsp[(2) - (4)].strval); - - (yyval.querySpec)->fSelectFilterPtr = (yyvsp[(3) - (4)].selectFilter); - (yyval.querySpec)->fTableExpressionPtr = (yyvsp[(4) - (4)].tableExpression); - - ; - } - break; - - case 119: - - { - (yyval.selectFilter) = new SelectFilter((yyvsp[(1) - (1)].colNameList)); - ; - } - break; - - case 120: - - { - (yyval.selectFilter) = new SelectFilter(); - ; - } - break; - - case 121: - - { - (yyval.tableExpression) = new TableExpression(); - (yyval.tableExpression)->fFromClausePtr = (yyvsp[(1) - (4)].fromClause); - (yyval.tableExpression)->fWhereClausePtr = (yyvsp[(2) - (4)].whereClause); - (yyval.tableExpression)->fGroupByPtr = (yyvsp[(3) - (4)].groupByClause); - (yyval.tableExpression)->fHavingPtr = (yyvsp[(4) - (4)].havingClause); - ; - } - break; - - case 122: - - { - (yyval.fromClause) = new FromClause(); - (yyval.fromClause)->fTableListPtr = (yyvsp[(2) - (2)].tableNameList); - ; - } - break; - - case 123: - - { - (yyval.tableNameList) = new TableNameList(); - (yyval.tableNameList)->push_back((yyvsp[(1) - (1)].tblName)); - ; - } - break; - - case 124: - - { - (yyval.tableNameList) = (yyvsp[(1) - (3)].tableNameList); - (yyval.tableNameList)->push_back((yyvsp[(3) - (3)].tblName)); - ; - } - break; - - case 127: - - { - (yyval.whereClause) = new WhereClause(); - (yyval.whereClause)->fSearchConditionPtr = (yyvsp[(2) - (2)].searchCondition); - ; - } - break; - - case 128: - - { - (yyval.groupByClause) = NULL; - ; - } - break; - - case 129: - - { - (yyval.groupByClause) = new GroupByClause(); - (yyval.groupByClause)->fColumnNamesListPtr = (yyvsp[(3) - (3)].colNameList); - ; - } - break; - - case 130: - - { - (yyval.colNameList) = new ColumnNameList(); - (yyval.colNameList)->push_back((yyvsp[(1) - (1)].strval)); - ; - } - break; - - case 131: - - { - (yyval.colNameList) = (yyvsp[(1) - (3)].colNameList); - (yyval.colNameList)->push_back((yyvsp[(3) - (3)].strval)); - ; - } - break; - - case 132: - - { - (yyval.havingClause) = NULL; - ; - } - break; - - case 133: - - { - (yyval.havingClause) = new HavingClause(); - (yyval.havingClause)->fSearchConditionPtr = (yyvsp[(2) - (2)].searchCondition); - ; - } - break; - - case 134: - - { - (yyval.searchCondition) = new SearchCondition; - (yyval.searchCondition)->fLHSearchConditionPtr = (yyvsp[(1) - (3)].searchCondition); - (yyval.searchCondition)->fOperator = "OR"; - (yyval.searchCondition)->fRHSearchConditionPtr = (yyvsp[(3) - (3)].searchCondition); - ; - } - break; - - case 135: - - { - (yyval.searchCondition) = new SearchCondition; - (yyval.searchCondition)->fLHSearchConditionPtr = (yyvsp[(1) - (3)].searchCondition); - (yyval.searchCondition)->fOperator = "AND"; - (yyval.searchCondition)->fRHSearchConditionPtr = (yyvsp[(3) - (3)].searchCondition); - ; - } - break; - - case 136: - - { - (yyval.searchCondition) = new SearchCondition; - (yyval.searchCondition)->fOperator = "NOT"; - (yyval.searchCondition)->fRHSearchConditionPtr = (yyvsp[(2) - (2)].searchCondition); - ; - } - break; - - case 137: - - { - (yyval.searchCondition) = new SearchCondition; - ; - } - break; - - case 138: - - { - (yyval.searchCondition) = new SearchCondition; - (yyval.searchCondition)->fPredicatePtr = (yyvsp[(1) - (1)].predicate); - ; - } - break; - - case 139: - - { - (yyval.predicate) = (yyvsp[(1) - (1)].comparisonPredicate); - ; - } - break; - - case 140: - - { - (yyval.predicate) = (yyvsp[(1) - (1)].betweenPredicate); - ; - } - break; - - case 141: - - { - (yyval.predicate) = (yyvsp[(1) - (1)].likePredicate); - ; - } - break; - - case 142: - - { - (yyval.predicate) = (yyvsp[(1) - (1)].nullTestPredicate); - ; - } - break; - - case 143: - - { - (yyval.predicate) = (yyvsp[(1) - (1)].inPredicate); - ; - } - break; - - case 144: - - { - (yyval.predicate) = (yyvsp[(1) - (1)].allOrAnyPredicate); - ; - } - break; - - case 145: - - { - (yyval.predicate) = (yyvsp[(1) - (1)].existPredicate); - ; - } - break; - - case 146: - - { - (yyval.comparisonPredicate) = new ComparisonPredicate(); - (yyval.comparisonPredicate)->fLHScalarExpression = (yyvsp[(1) - (3)].strval); - (yyval.comparisonPredicate)->fOperator = (yyvsp[(2) - (3)].strval); - (yyval.comparisonPredicate)->fRHScalarExpression = (yyvsp[(3) - (3)].strval); - ; - } - break; - - case 147: - - { - (yyval.comparisonPredicate) = new ComparisonPredicate(); - (yyval.comparisonPredicate)->fLHScalarExpression = (yyvsp[(1) - (3)].strval); - (yyval.comparisonPredicate)->fOperator = (yyvsp[(2) - (3)].strval); - (yyval.comparisonPredicate)->fSubQuerySpec = (yyvsp[(3) - (3)].querySpec); - ; - } - break; - - case 148: - - { - (yyval.betweenPredicate) = new BetweenPredicate(); - (yyval.betweenPredicate)->fLHScalarExpression = (yyvsp[(1) - (6)].strval); - (yyval.betweenPredicate)->fOperator1 = "NOT BETWEEN"; - (yyval.betweenPredicate)->fRH1ScalarExpression = (yyvsp[(4) - (6)].strval); - (yyval.betweenPredicate)->fOperator2 = "AND"; - (yyval.betweenPredicate)->fRH2ScalarExpression = (yyvsp[(6) - (6)].strval); - ; - } - break; - - case 149: - - { - (yyval.betweenPredicate) = new BetweenPredicate(); - (yyval.betweenPredicate)->fLHScalarExpression = (yyvsp[(1) - (5)].strval); - (yyval.betweenPredicate)->fOperator1 = "BETWEEN"; - (yyval.betweenPredicate)->fRH1ScalarExpression = (yyvsp[(3) - (5)].strval); - (yyval.betweenPredicate)->fOperator2 = "AND"; - (yyval.betweenPredicate)->fRH2ScalarExpression = (yyvsp[(5) - (5)].strval); - ; - } - break; - - case 150: - - { - (yyval.likePredicate) = new LikePredicate(); - (yyval.likePredicate)->fLHScalarExpression = (yyvsp[(1) - (5)].strval); - (yyval.likePredicate)->fOperator = "NOT LIKE"; - (yyval.likePredicate)->fAtom = (yyvsp[(4) - (5)].strval); - (yyval.likePredicate)->fOptionalEscapePtr = (yyvsp[(5) - (5)].escape); - ; - } - break; - - case 151: - - { - (yyval.likePredicate) = new LikePredicate(); - (yyval.likePredicate)->fLHScalarExpression = (yyvsp[(1) - (4)].strval); - (yyval.likePredicate)->fOperator = "LIKE"; - (yyval.likePredicate)->fAtom = (yyvsp[(3) - (4)].strval); - (yyval.likePredicate)->fOptionalEscapePtr = (yyvsp[(4) - (4)].escape); - ; - } - break; - - case 152: - - { - (yyval.escape) = NULL; - ; - } - break; - - case 153: - - { - (yyval.escape) = new Escape(); - (yyval.escape)->fEscapeChar = (yyvsp[(2) - (2)].strval); - ; - } - break; - - case 154: - - { - (yyval.nullTestPredicate) = new NullTestPredicate(); - (yyval.nullTestPredicate)->fOperator = "IS NOT NULL"; - (yyval.nullTestPredicate)->fColumnRef = (yyvsp[(1) - (4)].strval); - ; - } - break; - - case 155: - - { - (yyval.nullTestPredicate) = new NullTestPredicate(); - (yyval.nullTestPredicate)->fOperator = "IS NULL"; - (yyval.nullTestPredicate)->fColumnRef = (yyvsp[(1) - (3)].strval); - ; - } - break; - - case 156: - - { - (yyval.inPredicate) = new InPredicate(); - (yyval.inPredicate)->fScalarExpression = (yyvsp[(1) - (6)].strval); - (yyval.inPredicate)->fOperator = "NOT IN"; - (yyval.inPredicate)->fSubQuerySpecPtr = (yyvsp[(5) - (6)].querySpec); - ; - } - break; - - case 157: - - { - (yyval.inPredicate) = new InPredicate(); - (yyval.inPredicate)->fScalarExpression = (yyvsp[(1) - (5)].strval); - (yyval.inPredicate)->fOperator = "IN"; - (yyval.inPredicate)->fSubQuerySpecPtr = (yyvsp[(4) - (5)].querySpec); - ; - } - break; - - case 158: - - { - (yyval.inPredicate) = new InPredicate(); - (yyval.inPredicate)->fScalarExpression = (yyvsp[(1) - (6)].strval); - (yyval.inPredicate)->fOperator = "NOT IN"; - (yyval.inPredicate)->fAtomList = *(yyvsp[(5) - (6)].atomList); - delete (yyvsp[(5) - (6)].atomList); - ; - } - break; - - case 159: - - { - (yyval.inPredicate) = new InPredicate(); - (yyval.inPredicate)->fScalarExpression = (yyvsp[(1) - (5)].strval); - (yyval.inPredicate)->fOperator = "IN"; - (yyval.inPredicate)->fAtomList = *(yyvsp[(4) - (5)].atomList); - delete (yyvsp[(4) - (5)].atomList); - ; - } - break; - - case 160: - - { - (yyval.atomList) = new AtomList(); - (yyval.atomList)->push_back((yyvsp[(1) - (1)].strval)); - ; - } - break; - - case 161: - - { - (yyval.atomList) = (yyvsp[(1) - (3)].atomList); - (yyval.atomList)->push_back((yyvsp[(3) - (3)].strval)); - ; - } - break; - - case 162: - - { - (yyval.allOrAnyPredicate) = new AllOrAnyPredicate(); - (yyval.allOrAnyPredicate)->fScalarExpression = (yyvsp[(1) - (4)].strval); - (yyval.allOrAnyPredicate)->fOperator = (yyvsp[(2) - (4)].strval); - (yyval.allOrAnyPredicate)->fAnyAllSome = (yyvsp[(3) - (4)].strval); - (yyval.allOrAnyPredicate)->fSubQuerySpecPtr = (yyvsp[(4) - (4)].querySpec); - - ; - } - break; - - case 166: - - { - (yyval.existPredicate) = new ExistanceTestPredicate(); - (yyval.existPredicate)->fSubQuerySpecPtr = (yyvsp[(2) - (2)].querySpec); - ; - } - break; - - case 167: - - { - (yyval.querySpec) = new QuerySpec(); - - if (NULL != (yyvsp[(3) - (6)].strval)) - (yyval.querySpec)->fOptionAllOrDistinct = (yyvsp[(3) - (6)].strval); - - (yyval.querySpec)->fSelectFilterPtr = (yyvsp[(4) - (6)].selectFilter); - (yyval.querySpec)->fTableExpressionPtr = (yyvsp[(5) - (6)].tableExpression); - ; - } - break; - - case 168: - - { - std::string str = (yyvsp[(1) - (3)].strval); - str += " + "; - str += (yyvsp[(3) - (3)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 169: - - { - std::string str = (yyvsp[(1) - (3)].strval); - str += " - "; - str += (yyvsp[(3) - (3)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 170: - - { - std::string str = (yyvsp[(1) - (3)].strval); - str += " * "; - str += (yyvsp[(3) - (3)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 171: - - { - std::string str = (yyvsp[(1) - (3)].strval); - str += " / "; - str += (yyvsp[(3) - (3)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 172: - - { - std::string str = "+ "; - str += (yyvsp[(2) - (2)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 173: - - { - std::string str = "- "; - str += (yyvsp[(2) - (2)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 177: - - { - (yyval.strval) = (yyvsp[(2) - (3)].strval); - ; - } - break; - - case 178: - - { - (yyval.colNameList) = new ColumnNameList; - (yyval.colNameList)->push_back((yyvsp[(1) - (1)].strval)); - - ; - } - break; - - case 179: - - { - (yyval.colNameList) = (yyvsp[(1) - (3)].colNameList); - (yyval.colNameList)->push_back((yyvsp[(3) - (3)].strval)); - ; - } - break; - - case 184: - - { - std::string str = (yyvsp[(1) - (2)].strval); - str += " "; - str += (yyvsp[(2) - (2)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 185: - - { - std::string str = (yyvsp[(1) - (3)].strval); - str += " "; - str += (yyvsp[(2) - (3)].strval); - str += " "; - str += (yyvsp[(3) - (3)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 186: - - { - std::string str = (yyvsp[(1) - (4)].strval); - str += "("; - str += "*"; - str += ")"; - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 187: - - { - std::string str = (yyvsp[(1) - (5)].strval); - str += "("; - str += (yyvsp[(3) - (5)].strval); - str += " "; - str += (yyvsp[(4) - (5)].strval); - str += ")"; - (yyval.strval) = copy_string(str.c_str()); - - ; - } - break; - - case 188: - - { - std::string str = (yyvsp[(1) - (5)].strval); - str += "("; - str += (yyvsp[(3) - (5)].strval); - str += " "; - str += (yyvsp[(4) - (5)].strval); - str += ")"; - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 189: - - { - std::string str = (yyvsp[(1) - (4)].strval); - str += "("; - str += (yyvsp[(3) - (4)].strval); - str += ")"; - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 194: - - { - (yyval.tblName) = new TableName((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)); - ; - } - break; - - case 195: - - { - if (default_schema.size()) - (yyval.tblName) = new TableName((char*)default_schema.c_str(), (yyvsp[(1) - (1)].strval)); - else - (yyval.tblName) = new TableName((yyvsp[(1) - (1)].strval)); - - ; - } - break; - - case 197: - - { - std::string str = (yyvsp[(1) - (3)].strval); - str += "."; - str += (yyvsp[(3) - (3)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 198: - - { - std::string str = (yyvsp[(1) - (5)].strval); - str += "."; - str += (yyvsp[(3) - (5)].strval); - str += "."; - str += (yyvsp[(5) - (5)].strval); - (yyval.strval) = copy_string(str.c_str()); - ; - } - break; - - case 218: - - { - (yyval.sqlStmt) = NULL; - ; - } - break; - - case 219: - - { - (yyval.sqlStmt) = NULL; - ; - } - break; - - default: break; - } - - YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK(yylen); - yylen = 0; - YY_STACK_PRINT(yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ -yyerrlab: - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#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 - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - 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 - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* 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; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yydestruct("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK(1); - yystate = *yyssp; - YY_STACK_PRINT(yyss, yyssp); - } - - *++yyvsp = yylval; - - /* Shift the error token. */ - YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE - /*-------------------------------------------------. - | yyexhaustedlab -- memory exhaustion comes here. | - `-------------------------------------------------*/ -yyexhaustedlab: - yyerror(YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - - if (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 -#if YYERROR_VERBOSE - - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); - -#endif - /* Make sure YYID is used. */ - return YYID(yyresult); -} - -using namespace dmlpackage; - -namespace dmlpackage -{ -void grammar_init(ParseTree* _parseTree, bool debug) -{ - parseTree = _parseTree; - - if (debug) - yydebug = 1; -} - -void free_copybuffer() -{ - unsigned int i; - - for (i = 0; i < copy_buffer.size(); i++) - { - if (copy_buffer[i]) - free(copy_buffer[i]); - } - - copy_buffer.clear(); -} - -char* copy_string(const char* str) -{ - char* nv = strdup(str); - - if (nv) - copy_buffer.push_back(nv); - - return nv; -} - -void set_defaultSchema(std::string schema) -{ - default_schema = schema; -} - -} // namespace dmlpackage diff --git a/dbcon/dmlpackage/dml-gram-win.h b/dbcon/dmlpackage/dml-gram-win.h deleted file mode 100644 index 6523633d31..0000000000 --- a/dbcon/dmlpackage/dml-gram-win.h +++ /dev/null @@ -1,172 +0,0 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#pragma once -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype -{ - NAME = 258, - STRING = 259, - INTNUM = 260, - APPROXNUM = 261, - SELECT = 262, - ALL = 263, - DISTINCT = 264, - NULLX = 265, - USER = 266, - INDICATOR = 267, - AMMSC = 268, - PARAMETER = 269, - ANY = 270, - SOME = 271, - OR = 272, - AND = 273, - NOT = 274, - COMPARISON = 275, - UMINUS = 276, - AS = 277, - ASC = 278, - AUTHORIZATION = 279, - BETWEEN = 280, - BY = 281, - CHARACTER = 282, - CHECK = 283, - CLOSE = 284, - COMMIT = 285, - CONTINUE = 286, - CREATE = 287, - CURRENT = 288, - CURSOR = 289, - IDB_DECIMAL = 290, - DECLARE = 291, - DEFAULT = 292, - DELETE = 293, - DESC = 294, - IDB_DOUBLE = 295, - ESCAPE = 296, - EXISTS = 297, - FETCH = 298, - IDB_FLOAT = 299, - FOR = 300, - FOREIGN = 301, - FOUND = 302, - FROM = 303, - GOTO = 304, - GRANT = 305, - IDB_GROUP = 306, - HAVING = 307, - IN = 308, - INSERT = 309, - INTEGER = 310, - INTO = 311, - IS = 312, - KEY = 313, - LANGUAGE = 314, - LIKE = 315, - NUMERIC = 316, - OF = 317, - ON = 318, - OPEN = 319, - OPTION = 320, - ORDER = 321, - PRECISION = 322, - PRIMARY = 323, - PRIVILEGES = 324, - PROCEDURE = 325, - PUBLIC = 326, - REAL = 327, - REFERENCES = 328, - ROLLBACK = 329, - SCHEMA = 330, - SET = 331, - SMALLINT = 332, - SQLCODE = 333, - SQLERROR = 334, - TABLE = 335, - TO = 336, - UNION = 337, - UNIQUE = 338, - UPDATE = 339, - VALUES = 340, - VIEW = 341, - WHENEVER = 342, - WHERE = 343, - WITH = 344, - WORK = 345 -}; -#endif - -#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - int intval; - double floatval; - char* strval; - int subtok; - dmlpackage::SqlStatementList* sqlStmtList; - dmlpackage::SqlStatement* sqlStmt; - dmlpackage::TableName* tblName; - dmlpackage::ColumnNameList* colNameList; - dmlpackage::ValuesOrQuery* valsOrQuery; - dmlpackage::ValuesList* valsList; - dmlpackage::QuerySpec* querySpec; - dmlpackage::TableNameList* tableNameList; - dmlpackage::TableExpression* tableExpression; - dmlpackage::WhereClause* whereClause; - dmlpackage::SearchCondition* searchCondition; - dmlpackage::ExistanceTestPredicate* existPredicate; - dmlpackage::AllOrAnyPredicate* allOrAnyPredicate; - dmlpackage::InPredicate* inPredicate; - dmlpackage::NullTestPredicate* nullTestPredicate; - dmlpackage::LikePredicate* likePredicate; - dmlpackage::BetweenPredicate* betweenPredicate; - dmlpackage::ComparisonPredicate* comparisonPredicate; - dmlpackage::Predicate* predicate; - dmlpackage::FromClause* fromClause; - dmlpackage::SelectFilter* selectFilter; - dmlpackage::GroupByClause* groupByClause; - dmlpackage::HavingClause* havingClause; - dmlpackage::Escape* escape; - dmlpackage::AtomList* atomList; - dmlpackage::ColumnAssignment* colAssignment; - dmlpackage::ColumnAssignmentList* colAssignmentList; - -} YYSTYPE; -#define YYSTYPE_IS_TRIVIAL 1 -#define yystype YYSTYPE /* obsolescent; will be withdrawn */ -#define YYSTYPE_IS_DECLARED 1 - -extern YYSTYPE dmllval; diff --git a/dbcon/dmlpackage/dml-scan-win.cpp b/dbcon/dmlpackage/dml-scan-win.cpp deleted file mode 100644 index 6953573450..0000000000 --- a/dbcon/dmlpackage/dml-scan-win.cpp +++ /dev/null @@ -1,2089 +0,0 @@ -#define yy_create_buffer dml_create_buffer -#define yy_delete_buffer dml_delete_buffer -#define yy_scan_buffer dml_scan_buffer -#define yy_scan_string dml_scan_string -#define yy_scan_bytes dml_scan_bytes -#define yy_flex_debug dml_flex_debug -#define yy_init_buffer dml_init_buffer -#define yy_flush_buffer dml_flush_buffer -#define yy_load_buffer_state dml_load_buffer_state -#define yy_switch_to_buffer dml_switch_to_buffer -#define yyin dmlin -#define yyleng dmlleng -#define yylex dmllex -#define yyout dmlout -#define yyrestart dmlrestart -#define yytext dmltext - -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ -#pragma warn - rch -#pragma warn - use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int)(unsigned char)c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state* YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } while (0) - -#define unput(c) yyunput(c, yytext_ptr) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - -struct yy_buffer_state -{ - FILE* yy_input_file; - - char* yy_ch_buf; /* input buffer */ - char* yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 -}; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - -int yyleng; - -/* Points to current character in buffer. */ -static char* yy_c_buf_p = (char*)0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO((FILE * input_file)); - -void yy_switch_to_buffer YY_PROTO((YY_BUFFER_STATE new_buffer)); -void yy_load_buffer_state YY_PROTO((void)); -YY_BUFFER_STATE yy_create_buffer YY_PROTO((FILE * file, int size)); -void yy_delete_buffer YY_PROTO((YY_BUFFER_STATE b)); -void yy_init_buffer YY_PROTO((YY_BUFFER_STATE b, FILE* file)); -void yy_flush_buffer YY_PROTO((YY_BUFFER_STATE b)); -#define YY_FLUSH_BUFFER yy_flush_buffer(yy_current_buffer) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO((char* base, yy_size_t size)); -YY_BUFFER_STATE yy_scan_string YY_PROTO((yyconst char* yy_str)); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO((yyconst char* bytes, int len)); - -static void* yy_flex_alloc YY_PROTO((yy_size_t)); -static void* yy_flex_realloc YY_PROTO((void*, yy_size_t)); -static void yy_flex_free YY_PROTO((void*)); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if (!yy_current_buffer) \ - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if (!yy_current_buffer) \ - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -#define yywrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE*)0, *yyout = (FILE*)0; -typedef int yy_state_type; -extern char* yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO((void)); -static yy_state_type yy_try_NUL_trans YY_PROTO((yy_state_type current_state)); -static int yy_get_next_buffer YY_PROTO((void)); -static void yy_fatal_error YY_PROTO((yyconst char msg[])); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int)(yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 103 -#define YY_END_OF_BUFFER 104 -static yyconst short int yy_accept[394] = { - 0, 0, 0, 0, 0, 0, 0, 104, 103, 101, 100, 97, 90, 90, 90, 90, 93, 103, 86, 84, 87, 91, 91, 91, - 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 103, 98, 99, 101, 95, - 93, 102, 95, 94, 93, 0, 92, 88, 85, 89, 91, 91, 91, 9, 91, 91, 91, 13, 91, 91, 91, 91, 91, 91, - 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 41, 46, 91, 91, 91, 91, 91, 91, 91, 53, 54, 91, 57, - 91, 91, 91, 91, 91, - - 91, 91, 91, 91, 91, 73, 91, 91, 91, 91, 91, 91, 91, 91, 0, 98, 102, 94, 0, 96, 92, 1, 2, 8, - 10, 91, 3, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 33, 91, - 91, 0, 91, 91, 91, 91, 91, 91, 44, 47, 91, 91, 5, 4, 50, 91, 91, 91, 91, 91, 91, 91, 91, 91, - 91, 91, 91, 91, 68, 91, 91, 91, 6, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 14, 91, 91, 91, - 91, 91, 91, 91, - - 91, 91, 91, 91, 91, 26, 91, 91, 91, 91, 91, 91, 91, 91, 36, 0, 37, 91, 91, 91, 91, 91, 91, 45, - 91, 49, 51, 91, 55, 91, 91, 91, 91, 91, 91, 91, 64, 91, 91, 91, 91, 70, 91, 91, 91, 91, 91, 77, - 91, 79, 91, 91, 82, 83, 91, 91, 91, 15, 16, 91, 91, 7, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, - 91, 31, 32, 91, 35, 37, 38, 39, 91, 91, 91, 91, 91, 91, 91, 58, 91, 91, 91, 91, 91, 91, 91, 91, - 91, 91, 72, 74, - - 91, 91, 91, 91, 81, 91, 91, 91, 17, 91, 19, 91, 21, 91, 91, 91, 25, 91, 28, 29, 30, 91, 40, 91, - 43, 91, 91, 91, 56, 91, 91, 91, 91, 63, 91, 91, 67, 91, 91, 75, 76, 78, 91, 91, 12, 91, 91, 20, - 22, 23, 24, 91, 34, 91, 44, 91, 52, 91, 60, 91, 91, 91, 91, 91, 71, 91, 91, 91, 18, 27, 91, 48, - 91, 91, 91, 91, 66, 69, 80, 91, 14, 42, 59, 91, 62, 91, 91, 61, 65, 91, 91, 11, 0 - -}; - -static yyconst int yy_ec[256] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 5, 6, 6, 6, 7, 6, 8, 9, 6, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 11, 6, 12, 13, 14, 1, 1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 1, 1, 1, 1, 15, 1, 16, 17, 18, 19, - - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1}; - -static yyconst int yy_meta[42] = {0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}; - -static yyconst short int yy_base[401] = { - 0, 0, 0, 425, 424, 423, 422, 426, 431, 40, 431, 431, 431, 36, 39, 415, 41, 0, 39, 431, 411, - 28, 23, 43, 47, 20, 48, 39, 407, 51, 0, 402, 58, 67, 54, 65, 56, 67, 73, 72, 77, 83, - 89, 416, 431, 431, 54, 410, 105, 0, 90, 106, 108, 113, 0, 431, 431, 431, 0, 392, 103, 400, 382, - 394, 380, 0, 111, 384, 101, 393, 379, 114, 377, 374, 391, 384, 372, 376, 100, 375, 122, 122, 367, 115, - 0, 363, 373, 375, 361, 370, 363, 112, 0, 0, 124, 378, 131, 379, 126, 368, 118, - - 378, 365, 365, 363, 373, 0, 365, 369, 367, 359, 365, 364, 348, 349, 376, 431, 0, 136, 370, 369, 0, - 0, 0, 0, 0, 355, 0, 339, 343, 357, 340, 345, 337, 342, 354, 129, 140, 353, 348, 349, 331, 348, - 348, 329, 344, 345, 340, 330, 330, 152, 327, 327, 319, 330, 329, 332, 138, 0, 329, 330, 0, 0, 0, - 322, 328, 318, 322, 325, 326, 67, 325, 315, 314, 320, 312, 318, 0, 310, 316, 317, 0, 307, 139, 317, - 299, 295, 292, 137, 306, 302, 297, 306, 309, 298, 303, 298, 297, 285, 284, 298, - - 287, 288, 299, 278, 278, 0, 288, 284, 279, 274, 285, 272, 282, 286, 0, 274, 0, 268, 271, 272, 282, - 266, 276, 0, 261, 0, 0, 263, 0, 265, 261, 269, 276, 267, 270, 265, 0, 255, 270, 268, 258, 0, - 254, 263, 253, 245, 245, 0, 259, 0, 258, 257, 0, 0, 243, 255, 256, 0, 0, 238, 243, 0, 251, - 241, 236, 252, 234, 239, 245, 235, 243, 242, 227, 0, 0, 238, 0, 431, 0, 0, 237, 242, 222, 236, - 239, 230, 224, 0, 218, 218, 223, 230, 230, 227, 230, 210, 220, 224, 0, 0, - - 222, 221, 206, 202, 0, 214, 208, 201, 0, 199, 0, 199, 0, 206, 212, 196, 0, 212, 0, 0, 0, - 200, 0, 193, 0, 194, 204, 207, 0, 200, 183, 202, 185, 0, 191, 201, 0, 189, 197, 0, 0, 0, - 196, 174, 0, 194, 193, 0, 0, 0, 0, 177, 0, 181, 0, 190, 0, 179, 0, 186, 170, 168, 159, - 149, 0, 150, 166, 148, 0, 0, 147, 0, 150, 158, 157, 156, 0, 0, 0, 140, 0, 0, 0, 140, - 0, 139, 148, 0, 0, 135, 131, 0, 431, 187, 191, 56, 193, 197, 201, 203 - -}; - -static yyconst short int yy_def[401] = { - 0, 393, 1, 394, 394, 395, 395, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 396, 393, 393, 393, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 398, 393, 393, 393, 393, 393, 399, 393, 393, 393, 393, 400, 393, 393, 393, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 398, 393, 399, 393, 393, 393, 400, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 393, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 393, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 393, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 0, 393, 393, 393, 393, 393, 393, 393 - -}; - -static yyconst short int yy_nxt[473] = { - 0, 8, 9, 10, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 8, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 30, 37, 38, 39, 40, 41, 42, 30, 30, 30, - 46, 64, 46, 47, 48, 49, 47, 48, 51, 52, 55, 56, 74, 59, 46, 60, 46, 75, 54, 53, 61, - 65, 62, 63, 66, 71, 76, 80, 67, 72, 81, 68, 86, 77, 69, 73, 78, 70, 83, 79, 87, 88, - 90, 84, 92, 98, 105, 96, 91, 89, 97, 100, 93, 233, 94, 99, 95, 110, 50, - - 101, 106, 102, 234, 103, 107, 111, 108, 104, 53, 109, 112, 113, 51, 52, 118, 51, 52, 114, 119, 119, - 123, 120, 150, 53, 53, 129, 53, 132, 133, 130, 137, 147, 155, 138, 148, 134, 152, 164, 165, 139, 173, - 124, 166, 176, 118, 174, 140, 156, 157, 169, 153, 177, 150, 170, 53, 151, 223, 167, 392, 171, 200, 201, - 202, 391, 251, 203, 224, 245, 252, 246, 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 216, 43, 43, 43, 43, 8, 8, 8, 8, 58, 58, 115, 115, 115, - - 115, 117, 375, 117, 117, 121, 121, 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, - 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, - 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, - 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, 282, - - 281, 280, 279, 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, 261, - 260, 259, 258, 257, 256, 255, 254, 253, 250, 249, 248, 247, 244, 243, 242, 241, 240, 239, 238, 237, 236, - 235, 232, 231, 230, 229, 228, 227, 226, 225, 222, 221, 220, 219, 218, 217, 215, 214, 213, 212, 211, 210, - 209, 208, 207, 206, 205, 204, 199, 198, 197, 196, 195, 194, 193, 192, 191, 120, 120, 116, 190, 189, 188, - 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 175, 172, 168, 163, 162, 161, - - 160, 159, 158, 154, 149, 146, 145, 144, 143, 142, 141, 136, 135, 131, 128, 127, 126, 125, 122, 50, 116, - 85, 82, 57, 50, 393, 45, 45, 44, 44, 7, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, - 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, - 393, 393, 393, 393, 393, 393, 393, 393, 393}; - -static yyconst short int yy_chk[473] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 9, 22, 9, 13, 13, 14, 14, 14, 16, 16, 18, 18, 25, 21, 46, 21, 46, 25, 396, 16, 21, - 22, 21, 21, 23, 24, 26, 27, 23, 24, 27, 23, 32, 26, 23, 24, 26, 23, 29, 26, 32, 33, - 34, 29, 35, 37, 39, 36, 34, 33, 36, 38, 35, 170, 35, 37, 35, 41, 50, - - 38, 39, 38, 170, 38, 40, 41, 40, 38, 50, 40, 42, 42, 48, 48, 51, 52, 52, 42, 53, 53, - 60, 53, 80, 48, 51, 66, 52, 68, 68, 66, 71, 78, 83, 71, 78, 68, 81, 91, 91, 71, 98, - 60, 94, 100, 118, 98, 71, 83, 83, 96, 81, 100, 150, 96, 118, 80, 157, 94, 391, 96, 136, 136, - 137, 390, 188, 137, 157, 183, 188, 183, 387, 386, 384, 380, 376, 375, 374, 373, 371, 368, 367, 366, 364, - 363, 362, 150, 394, 394, 394, 394, 395, 395, 395, 395, 397, 397, 398, 398, 398, - - 398, 399, 361, 399, 399, 400, 400, 360, 358, 356, 354, 352, 347, 346, 344, 343, 339, 338, 336, 335, 333, - 332, 331, 330, 328, 327, 326, 324, 322, 318, 316, 315, 314, 312, 310, 308, 307, 306, 304, 303, 302, 301, - 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, 287, 286, 285, 284, 283, 282, 281, 276, 273, 272, 271, - 270, 269, 268, 267, 266, 265, 264, 263, 261, 260, 257, 256, 255, 252, 251, 249, 247, 246, 245, 244, 243, - 241, 240, 239, 238, 236, 235, 234, 233, 232, 231, 230, 228, 225, 223, 222, 221, - - 220, 219, 218, 216, 214, 213, 212, 211, 210, 209, 208, 207, 205, 204, 203, 202, 201, 200, 199, 198, 197, - 196, 195, 194, 193, 192, 191, 190, 189, 187, 186, 185, 184, 182, 180, 179, 178, 176, 175, 174, 173, 172, - 171, 169, 168, 167, 166, 165, 164, 160, 159, 156, 155, 154, 153, 152, 151, 149, 148, 147, 146, 145, 144, - 143, 142, 141, 140, 139, 138, 135, 134, 133, 132, 131, 130, 129, 128, 126, 120, 119, 115, 114, 113, 112, - 111, 110, 109, 108, 107, 105, 104, 103, 102, 101, 99, 97, 95, 90, 89, 88, - - 87, 86, 85, 82, 79, 77, 76, 75, 74, 73, 72, 70, 69, 67, 64, 63, 62, 61, 59, 47, 43, - 31, 28, 20, 15, 7, 6, 5, 4, 3, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, - 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, - 393, 393, 393, 393, 393, 393, 393, 393, 393}; - -static yy_state_type yy_last_accepting_state; -static char* yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char* yytext; -#define INITIAL 0 - -/* $Id: dml.l 8707 2012-07-13 19:08:12Z rdempsey $ */ -#include -#include -#include -#include -#include "dmlparser.h" - -#undef DECIMAL -#undef DELETE -#undef IN -#ifdef _MSC_VER -#include "dml-gram-win.h" -#else -#include "dml-gram.h" -#endif -#ifdef _MSC_VER -#define YY_NO_UNISTD_H -extern "C" int _isatty(int); -#define isatty _isatty -#endif - -/* These don't seem to be covered by the prefix option of flex 2.5.4 - * Bison 2.0 puts extern dml_yylval in dml-gram.h. */ - -/*#define yylval dml_yylval -#define yyerror dml_yyerror*/ -using namespace dmlpackage; - -void dmlerror(char const* s); - -namespace dmlpackage -{ -int lineno = 1; - -/* Handles to the buffer that the lexer uses internally */ -static YY_BUFFER_STATE scanbufhandle; -static char* scanbuf; - -static char* scanner_copy(char* str); - -/* macro to save the text and return a token */ -#define TOK(name) \ - { \ - dmllval.strval = scanner_copy(dmltext); \ - return name; \ - } -} // namespace dmlpackage - -#define YY_NO_UNPUT 1 -#define inquote 1 - -#define endquote 2 - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO((void)); -#else -extern int yywrap YY_PROTO((void)); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO((int c, char* buf_ptr)); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO((char*, yyconst char*, int)); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO((yyconst char*)); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO((void)); -#else -static int input YY_PROTO((void)); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int* yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO((int new_state)); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO((void)); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO((void)); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void)fwrite(yytext, yyleng, 1, yyout) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf, result, max_size) \ - if (yy_current_buffer->yy_is_interactive) \ - { \ - int c = '*', n; \ - for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \ - buf[n] = (char)c; \ - if (c == '\n') \ - buf[n++] = (char)c; \ - if (c == EOF && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - result = n; \ - } \ - else if (((result = fread(buf, 1, max_size, yyin)) == 0) && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error(msg) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO((void)) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP YY_USER_ACTION - -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - - if (yy_init) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if (!yy_start) - yy_start = 1; /* first start state */ - - if (!yyin) - yyin = stdin; - - if (!yyout) - yyout = stdout; - - if (!yy_current_buffer) - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); - - yy_load_buffer_state(); - } - - while (1) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_match: - - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 394) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - ++yy_cp; - } while (yy_base[yy_current_state] != 431); - - yy_find_action: - yy_act = yy_accept[yy_current_state]; - - if (yy_act == 0) - { - /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - do_action: /* This label is used only to access EOF actions. */ - - switch (yy_act) - { - /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - - case 1: - YY_RULE_SETUP - TOK(ALL) - YY_BREAK - case 2: - YY_RULE_SETUP - TOK(AND) - YY_BREAK - case 3: - YY_RULE_SETUP - TOK(AMMSC) - YY_BREAK - case 4: - YY_RULE_SETUP - TOK(AMMSC) - YY_BREAK - case 5: - YY_RULE_SETUP - TOK(AMMSC) - YY_BREAK - case 6: - YY_RULE_SETUP - TOK(AMMSC) - YY_BREAK - case 7: - YY_RULE_SETUP - TOK(AMMSC) - YY_BREAK - case 8: - YY_RULE_SETUP - TOK(ANY) - YY_BREAK - case 9: - YY_RULE_SETUP - TOK(AS) - YY_BREAK - case 10: - YY_RULE_SETUP - TOK(ASC) - YY_BREAK - case 11: - YY_RULE_SETUP - TOK(AUTHORIZATION) - YY_BREAK - case 12: - YY_RULE_SETUP - TOK(BETWEEN) - YY_BREAK - case 13: - YY_RULE_SETUP - TOK(BY) - YY_BREAK - case 14: - YY_RULE_SETUP - TOK(CHARACTER) - YY_BREAK - case 15: - YY_RULE_SETUP - TOK(CHECK) - YY_BREAK - case 16: - YY_RULE_SETUP - TOK(CLOSE) - YY_BREAK - case 17: - YY_RULE_SETUP - TOK(COMMIT) - YY_BREAK - case 18: - YY_RULE_SETUP - TOK(CONTINUE) - YY_BREAK - case 19: - YY_RULE_SETUP - TOK(CREATE) - YY_BREAK - case 20: - YY_RULE_SETUP - TOK(CURRENT) - YY_BREAK - case 21: - YY_RULE_SETUP - TOK(CURSOR) - YY_BREAK - case 22: - YY_RULE_SETUP - TOK(IDB_DECIMAL) - YY_BREAK - case 23: - YY_RULE_SETUP - TOK(DECLARE) - YY_BREAK - case 24: - YY_RULE_SETUP - TOK(DEFAULT) - YY_BREAK - case 25: - YY_RULE_SETUP - TOK(DELETE) - YY_BREAK - case 26: - YY_RULE_SETUP - TOK(DESC) - YY_BREAK - case 27: - YY_RULE_SETUP - TOK(ALL) - YY_BREAK - case 28: - YY_RULE_SETUP - TOK(IDB_DOUBLE) - YY_BREAK - case 29: - YY_RULE_SETUP - TOK(ESCAPE) - YY_BREAK - case 30: - YY_RULE_SETUP - TOK(EXISTS) - YY_BREAK - case 31: - YY_RULE_SETUP - TOK(FETCH) - YY_BREAK - case 32: - YY_RULE_SETUP - TOK(IDB_FLOAT) - YY_BREAK - case 33: - YY_RULE_SETUP - TOK(FOR) - YY_BREAK - case 34: - YY_RULE_SETUP - TOK(FOREIGN) - YY_BREAK - case 35: - YY_RULE_SETUP - TOK(FOUND) - YY_BREAK - case 36: - YY_RULE_SETUP - TOK(FROM) - YY_BREAK - case 37: - YY_RULE_SETUP - TOK(GOTO) - YY_BREAK - case 38: - YY_RULE_SETUP - TOK(GRANT) - YY_BREAK - case 39: - YY_RULE_SETUP - TOK(IDB_GROUP) - YY_BREAK - case 40: - YY_RULE_SETUP - TOK(HAVING) - YY_BREAK - case 41: - YY_RULE_SETUP - TOK(IN) - YY_BREAK - case 42: - YY_RULE_SETUP - TOK(INDICATOR) - YY_BREAK - case 43: - YY_RULE_SETUP - TOK(INSERT) - YY_BREAK - case 44: - YY_RULE_SETUP - TOK(INTEGER) - YY_BREAK - case 45: - YY_RULE_SETUP - TOK(INTO) - YY_BREAK - case 46: - YY_RULE_SETUP - TOK(IS) - YY_BREAK - case 47: - YY_RULE_SETUP - TOK(KEY) - YY_BREAK - case 48: - YY_RULE_SETUP - TOK(LANGUAGE) - YY_BREAK - case 49: - YY_RULE_SETUP - TOK(LIKE) - YY_BREAK - case 50: - YY_RULE_SETUP - TOK(NOT) - YY_BREAK - case 51: - YY_RULE_SETUP - TOK(NULLX) - YY_BREAK - case 52: - YY_RULE_SETUP - TOK(NUMERIC) - YY_BREAK - case 53: - YY_RULE_SETUP - TOK(OF) - YY_BREAK - case 54: - YY_RULE_SETUP - TOK(ON) - YY_BREAK - case 55: - YY_RULE_SETUP - TOK(OPEN) - YY_BREAK - case 56: - YY_RULE_SETUP - TOK(OPTION) - YY_BREAK - case 57: - YY_RULE_SETUP - TOK(OR) - YY_BREAK - case 58: - YY_RULE_SETUP - TOK(ORDER) - YY_BREAK - case 59: - YY_RULE_SETUP - TOK(PRECISION) - YY_BREAK - case 60: - YY_RULE_SETUP - TOK(PRIMARY) - YY_BREAK - case 61: - YY_RULE_SETUP - TOK(PRIVILEGES) - YY_BREAK - case 62: - YY_RULE_SETUP - TOK(PROCEDURE) - YY_BREAK - case 63: - YY_RULE_SETUP - TOK(PUBLIC) - YY_BREAK - case 64: - YY_RULE_SETUP - TOK(REAL) - YY_BREAK - case 65: - YY_RULE_SETUP - TOK(REFERENCES) - YY_BREAK - case 66: - YY_RULE_SETUP - TOK(ROLLBACK) - YY_BREAK - case 67: - YY_RULE_SETUP - TOK(SELECT) - YY_BREAK - case 68: - YY_RULE_SETUP - TOK(SET) - YY_BREAK - case 69: - YY_RULE_SETUP - TOK(SMALLINT) - YY_BREAK - case 70: - YY_RULE_SETUP - TOK(SOME) - YY_BREAK - case 71: - YY_RULE_SETUP - TOK(SQLCODE) - YY_BREAK - case 72: - YY_RULE_SETUP - TOK(TABLE) - YY_BREAK - case 73: - YY_RULE_SETUP - TOK(TO) - YY_BREAK - case 74: - YY_RULE_SETUP - TOK(UNION) - YY_BREAK - case 75: - YY_RULE_SETUP - TOK(UNIQUE) - YY_BREAK - case 76: - YY_RULE_SETUP - TOK(UPDATE) - YY_BREAK - case 77: - YY_RULE_SETUP - TOK(USER) - YY_BREAK - case 78: - YY_RULE_SETUP - TOK(VALUES) - YY_BREAK - case 79: - YY_RULE_SETUP - TOK(VIEW) - YY_BREAK - case 80: - YY_RULE_SETUP - TOK(WHENEVER) - YY_BREAK - case 81: - YY_RULE_SETUP - TOK(WHERE) - YY_BREAK - case 82: - YY_RULE_SETUP - TOK(WITH) - YY_BREAK - case 83: - YY_RULE_SETUP - TOK(WORK) - YY_BREAK - - /* punctuation */ - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - YY_RULE_SETUP - TOK(COMPARISON) - YY_BREAK - case 90: - YY_RULE_SETUP{TOK(yytext[0])} YY_BREAK - - /* names */ - case 91 : YY_RULE_SETUP{TOK(NAME)} YY_BREAK - - /* parameters */ - case 92 : YY_RULE_SETUP - { - return PARAMETER; - } - YY_BREAK - - /* numbers */ - case 93: - case 94: - case 95: - YY_RULE_SETUP{TOK(INTNUM)} YY_BREAK - - case 96 : YY_RULE_SETUP{TOK(APPROXNUM)} YY_BREAK - - case 97 : YY_RULE_SETUP - { - BEGIN(inquote); - } - YY_BREAK - - case 98: - *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ - yy_c_buf_p = yy_cp -= 1; - YY_DO_BEFORE_ACTION; /* set up yytext again */ - YY_RULE_SETUP - { - BEGIN(endquote); - TOK(STRING) - } - YY_BREAK - - case 99: - YY_RULE_SETUP - { - BEGIN(0); - } - YY_BREAK - - /* @bug 1870. Since MySQL parser will error out all the unterminated string, we don't actually need it - * here. */ - /* '[^'\n]*$ { dmlerror("Unterminated string"); } */ - case 100: - YY_RULE_SETUP - { - lineno++; - } - YY_BREAK - - case 101: - YY_RULE_SETUP; /* white space */ - YY_BREAK - - case 102: - YY_RULE_SETUP; /* comment */ - YY_BREAK - - case 103: - YY_RULE_SETUP - ECHO; - YY_BREAK - - case YY_STATE_EOF(INITIAL): - case YY_STATE_EOF(inquote): - case YY_STATE_EOF(endquote): yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if (yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if (yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars]) - { - /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans(yy_current_state); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if (yy_next_state) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else - switch (yy_get_next_buffer()) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if (yywrap()) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if (!yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - } - - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - - break; - } - - default: YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() -{ - register char* dest = yy_current_buffer->yy_ch_buf; - register char* source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if (yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1]) - YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - - if (yy_current_buffer->yy_fill_buffer == 0) - { - /* Don't try to fill the buffer, so this is an EOF. */ - if (yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int)(yy_c_buf_p - yytext_ptr) - 1; - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; - - while (num_to_read <= 0) - { - /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR("input buffer overflow, can't enlarge buffer because scanner uses REJECT"); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = (int)(yy_c_buf_p - b->yy_ch_buf); - - if (b->yy_is_our_buffer) - { - int new_size = b->yy_buf_size * 2; - - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char*) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc((void*)b->yy_ch_buf, b->yy_buf_size + 2); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; -#endif - } - - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if (yy_n_chars == 0) - { - if (number_to_move == YY_MORE_ADJ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() -{ - register yy_state_type yy_current_state; - register char* yy_cp; - - yy_current_state = yy_start; - - for (yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 394) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) -#else -static yy_state_type yy_try_NUL_trans(yy_current_state) yy_state_type yy_current_state; -#endif -{ - register int yy_is_jam; - register char* yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 394) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - yy_is_jam = (yy_current_state == 393); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput(int c, register char* yy_bp) -#else -static void yyunput(c, yy_bp) int c; -register char* yy_bp; -#endif -{ - register char* yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if (yy_cp < yy_current_buffer->yy_ch_buf + 2) - { - /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char* dest = &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2]; - register char* source = &yy_current_buffer->yy_ch_buf[number_to_move]; - - while (source > yy_current_buffer->yy_ch_buf) - *--dest = *--source; - - yy_cp += (int)(dest - source); - yy_bp += (int)(dest - source); - yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; - - if (yy_cp < yy_current_buffer->yy_ch_buf + 2) - YY_FATAL_ERROR("flex scanner push-back overflow"); - } - - *--yy_cp = (char)c; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; -} -#endif /* ifndef YY_NO_UNPUT */ - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif -{ - int c; - - *yy_c_buf_p = yy_hold_char; - - if (*yy_c_buf_p == YY_END_OF_BUFFER_CHAR) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if (yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars]) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { - /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch (yy_get_next_buffer()) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if (yywrap()) - return EOF; - - if (!yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; - } - } - } - - c = *(unsigned char*)yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - return c; -} - -#ifdef YY_USE_PROTOS -void yyrestart(FILE* input_file) -#else -void yyrestart(input_file) FILE* input_file; -#endif -{ - if (!yy_current_buffer) - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); - - yy_init_buffer(yy_current_buffer, input_file); - yy_load_buffer_state(); -} - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) -#else -void yy_switch_to_buffer(new_buffer) YY_BUFFER_STATE new_buffer; -#endif -{ - if (yy_current_buffer == new_buffer) - return; - - if (yy_current_buffer) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; -} - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state(void) -#else -void yy_load_buffer_state() -#endif -{ - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; -} - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer(FILE* file, int size) -#else -YY_BUFFER_STATE yy_create_buffer(file, size) FILE* file; -int size; -#endif -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE)yy_flex_alloc(sizeof(struct yy_buffer_state)); - - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char*)yy_flex_alloc(b->yy_buf_size + 2); - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b, file); - - return b; -} - -#ifdef YY_USE_PROTOS -void yy_delete_buffer(YY_BUFFER_STATE b) -#else -void yy_delete_buffer(b) YY_BUFFER_STATE b; -#endif -{ - if (!b) - return; - - if (b == yy_current_buffer) - yy_current_buffer = (YY_BUFFER_STATE)0; - - if (b->yy_is_our_buffer) - yy_flex_free((void*)b->yy_ch_buf); - - yy_flex_free((void*)b); -} - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO((int)); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer(YY_BUFFER_STATE b, FILE* file) -#else -void yy_init_buffer(b, file) YY_BUFFER_STATE b; -FILE* file; -#endif - -{ - yy_flush_buffer(b); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0; -#endif -#endif -} - -#ifdef YY_USE_PROTOS -void yy_flush_buffer(YY_BUFFER_STATE b) -#else -void yy_flush_buffer(b) YY_BUFFER_STATE b; -#endif - -{ - if (!b) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if (b == yy_current_buffer) - yy_load_buffer_state(); -} - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer(char* base, yy_size_t size) -#else -YY_BUFFER_STATE yy_scan_buffer(base, size) char* base; -yy_size_t size; -#endif -{ - YY_BUFFER_STATE b; - - if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR || base[size - 1] != YY_END_OF_BUFFER_CHAR) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE)yy_flex_alloc(sizeof(struct yy_buffer_state)); - - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b); - - return b; -} -#endif - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string(yyconst char* yy_str) -#else -YY_BUFFER_STATE yy_scan_string(yy_str) yyconst char* yy_str; -#endif -{ - int len; - - for (len = 0; yy_str[len]; ++len) - ; - - return yy_scan_bytes(yy_str, len); -} -#endif - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes(yyconst char* bytes, int len) -#else -YY_BUFFER_STATE yy_scan_bytes(bytes, len) yyconst char* bytes; -int len; -#endif -{ - YY_BUFFER_STATE b; - char* buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char*)yy_flex_alloc(n); - - if (!buf) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); - - for (i = 0; i < len; ++i) - buf[i] = bytes[i]; - - buf[len] = buf[len + 1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf, n); - - if (!b) - YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} -#endif - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state(int new_state) -#else -static void yy_push_state(new_state) int new_state; -#endif -{ - if (yy_start_stack_ptr >= yy_start_stack_depth) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof(int); - - if (!yy_start_stack) - yy_start_stack = (int*)yy_flex_alloc(new_size); - - else - yy_start_stack = (int*)yy_flex_realloc((void*)yy_start_stack, new_size); - - if (!yy_start_stack) - YY_FATAL_ERROR("out of memory expanding start-condition stack"); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); -} -#endif - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() -{ - if (--yy_start_stack_ptr < 0) - YY_FATAL_ERROR("start-condition stack underflow"); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); -} -#endif - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() -{ - return yy_start_stack[yy_start_stack_ptr - 1]; -} -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error(yyconst char msg[]) -#else -static void yy_fatal_error(msg) char msg[]; -#endif -{ - (void)fprintf(stderr, "%s\n", msg); - exit(YY_EXIT_FAILURE); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } while (0) - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy(char* s1, yyconst char* s2, int n) -#else -static void yy_flex_strncpy(s1, s2, n) char* s1; -yyconst char* s2; -int n; -#endif -{ - register int i; - - for (i = 0; i < n; ++i) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen(yyconst char* s) -#else -static int yy_flex_strlen(s) yyconst char* s; -#endif -{ - register int n; - - for (n = 0; s[n]; ++n) - ; - - return n; -} -#endif - -#ifdef YY_USE_PROTOS -static void* yy_flex_alloc(yy_size_t size) -#else -static void* yy_flex_alloc(size) yy_size_t size; -#endif -{ - return (void*)malloc(size); -} - -#ifdef YY_USE_PROTOS -static void* yy_flex_realloc(void* ptr, yy_size_t size) -#else -static void* yy_flex_realloc(ptr, size) void* ptr; -yy_size_t size; -#endif -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void*)realloc((char*)ptr, size); -} - -#ifdef YY_USE_PROTOS -static void yy_flex_free(void* ptr) -#else -static void yy_flex_free(ptr) void* ptr; -#endif -{ - free(ptr); -} - -#if YY_MAIN -int main() -{ - yylex(); - return 0; -} -#endif - -using namespace dmlpackage; - -void dmlerror(char const* s) -{ - printf("yyerror: %d: %s at %s\n", lineno, s, yytext); -} - -namespace dmlpackage -{ -static valbuf_t valbuf; - -valbuf_t get_valbuffer(void) -{ - return valbuf; -} - -/* - * Called before any actual parsing is done - */ -void scanner_init(const char* str) -{ - size_t slen = strlen(str); - - /* - * Might be left over after ereport() - */ - if (YY_CURRENT_BUFFER) - yy_delete_buffer(YY_CURRENT_BUFFER); - - /* - * Make a scan buffer with special termination needed by flex. - */ - scanbuf = (char*)malloc(slen + 2); - memcpy(scanbuf, str, slen); - scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR; - scanbufhandle = yy_scan_buffer(scanbuf, slen + 2); - - BEGIN(INITIAL); - - valbuf.clear(); -} - -/* - * Called after parsing is done to clean up after scanner_init() - */ - -void scanner_finish(void) -{ - char* str; - - yy_delete_buffer(scanbufhandle); - free(scanbuf); - unsigned int i; - - for (i = 0; i < valbuf.size(); i++) - { - str = valbuf[i]; - - if (str) - { - // std::cout << "valbuf:(" << str << ")" << std::endl; - free(valbuf[i]); - } - } - - valbuf.clear(); -} - -char* scanner_copy(char* str) -{ - char* nv = strdup(str); - - if (nv) - valbuf.push_back(nv); - - return nv; -} - -} // namespace dmlpackage diff --git a/dbcon/dmlpackage/dml.l b/dbcon/dmlpackage/dml.l index 2ae7e0d70d..fca2d3f25f 100644 --- a/dbcon/dmlpackage/dml.l +++ b/dbcon/dmlpackage/dml.l @@ -27,16 +27,7 @@ #undef DECIMAL #undef DELETE #undef IN -#ifdef _MSC_VER -#include "dml-gram-win.h" -#else #include "dml-gram.h" -#endif -#ifdef _MSC_VER -#define YY_NO_UNISTD_H -extern "C" int _isatty(int); -#define isatty _isatty -#endif /* These don't seem to be covered by the prefix option of flex 2.5.4 * Bison 2.0 puts extern dml_yylval in dml-gram.h. */ diff --git a/dbcon/dmlpackage/dml.y b/dbcon/dmlpackage/dml.y index 3bc62ecb80..8652789543 100644 --- a/dbcon/dmlpackage/dml.y +++ b/dbcon/dmlpackage/dml.y @@ -65,11 +65,7 @@ #undef DECIMAL #undef DELETE #undef IN -#ifdef _MSC_VER -#include "dml-gram-win.h" -#else #include "dml-gram.h" -#endif using namespace std; using namespace dmlpackage; diff --git a/dbcon/dmlpackage/dmlcolumn.cpp b/dbcon/dmlpackage/dmlcolumn.cpp index 417c218f2a..76426ab1d2 100644 --- a/dbcon/dmlpackage/dmlcolumn.cpp +++ b/dbcon/dmlpackage/dmlcolumn.cpp @@ -25,9 +25,6 @@ #include "dmlcolumn.h" #undef DMLPKGCOLUMN_DLLEXPORT -#ifdef _MSC_VER -#define strcasecmp stricmp -#endif namespace dmlpackage { diff --git a/dbcon/dmlpackage/dmlcolumn.h b/dbcon/dmlpackage/dmlcolumn.h index c83705af2d..236154285e 100644 --- a/dbcon/dmlpackage/dmlcolumn.h +++ b/dbcon/dmlpackage/dmlcolumn.h @@ -29,11 +29,7 @@ #include "bytestream.h" #include -#if defined(_MSC_VER) && defined(xxxDMLPKGCOLUMN_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackage { diff --git a/dbcon/dmlpackage/dmlparser.cpp b/dbcon/dmlpackage/dmlparser.cpp index 236444796a..1e189e9a9b 100644 --- a/dbcon/dmlpackage/dmlparser.cpp +++ b/dbcon/dmlpackage/dmlparser.cpp @@ -29,11 +29,7 @@ #undef DECIMAL #undef DELETE #undef IN -#ifdef _MSC_VER -#include "dml-gram-win.h" -#else #include "dml-gram.h" -#endif #include #include diff --git a/dbcon/dmlpackage/insertdmlpackage.cpp b/dbcon/dmlpackage/insertdmlpackage.cpp index ef80245903..57f953c964 100644 --- a/dbcon/dmlpackage/insertdmlpackage.cpp +++ b/dbcon/dmlpackage/insertdmlpackage.cpp @@ -29,9 +29,6 @@ using namespace std; #include "insertdmlpackage.h" #undef INSERTDMLPKG_DLLEXPORT -#ifdef _MSC_VER -#define strcasecmp stricmp -#endif namespace dmlpackage { diff --git a/dbcon/dmlpackage/insertdmlpackage.h b/dbcon/dmlpackage/insertdmlpackage.h index d171f2cce1..f5216696d0 100644 --- a/dbcon/dmlpackage/insertdmlpackage.h +++ b/dbcon/dmlpackage/insertdmlpackage.h @@ -27,11 +27,7 @@ #include "calpontdmlpackage.h" #include "bytestream.h" -#if defined(_MSC_VER) && defined(xxxINSERTDMLPKG_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackage { diff --git a/dbcon/dmlpackage/row.h b/dbcon/dmlpackage/row.h index 4f31a1eaf4..d115299d4b 100644 --- a/dbcon/dmlpackage/row.h +++ b/dbcon/dmlpackage/row.h @@ -29,11 +29,7 @@ #include "dmlcolumn.h" #include "we_typeext.h" -#if defined(_MSC_VER) && defined(xxxDMLPKGROW_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackage { diff --git a/dbcon/dmlpackage/scanner.bat b/dbcon/dmlpackage/scanner.bat deleted file mode 100644 index 2f55002731..0000000000 --- a/dbcon/dmlpackage/scanner.bat +++ /dev/null @@ -1,6 +0,0 @@ -PATH=C:\PROGRA~2\GNUWIN32\BIN;%PATH% - -del dml-gram-win.h >nul 2>&1 -bison -l -v -d -p dml -o dml-gram-win.cpp dml.y -ren dml-gram-win.hpp dml-gram-win.h -flex -i -L -Pdml -odml-scan-win.cpp dml.l diff --git a/dbcon/dmlpackage/updatedmlpackage.h b/dbcon/dmlpackage/updatedmlpackage.h index 99c53e1680..5e5eacba62 100644 --- a/dbcon/dmlpackage/updatedmlpackage.h +++ b/dbcon/dmlpackage/updatedmlpackage.h @@ -27,11 +27,7 @@ #include "calpontdmlpackage.h" #include "bytestream.h" -#if defined(_MSC_VER) && defined(xxxUPDATEDMLPKG_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackage { diff --git a/dbcon/dmlpackage/vendordmlstatement.h b/dbcon/dmlpackage/vendordmlstatement.h index 930df9412a..115e236da6 100644 --- a/dbcon/dmlpackage/vendordmlstatement.h +++ b/dbcon/dmlpackage/vendordmlstatement.h @@ -28,11 +28,7 @@ #include #include -#if defined(_MSC_VER) && defined(xxxVENDORDMLSTATEMENT_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackage { typedef std::vector ColValuesList; diff --git a/dbcon/dmlpackageproc/commandpackageprocessor.h b/dbcon/dmlpackageproc/commandpackageprocessor.h index 43866f2616..b0d9a67a6c 100644 --- a/dbcon/dmlpackageproc/commandpackageprocessor.h +++ b/dbcon/dmlpackageproc/commandpackageprocessor.h @@ -33,11 +33,7 @@ #include #include -#if defined(_MSC_VER) && defined(DMLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackageprocessor { diff --git a/dbcon/dmlpackageproc/deletepackageprocessor.cpp b/dbcon/dmlpackageproc/deletepackageprocessor.cpp index 92295cec71..7e907a97fe 100644 --- a/dbcon/dmlpackageproc/deletepackageprocessor.cpp +++ b/dbcon/dmlpackageproc/deletepackageprocessor.cpp @@ -166,9 +166,6 @@ DMLPackageProcessor::DMLResult DeletePackageProcessor::processPackage(dmlpackage for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -177,7 +174,6 @@ DMLPackageProcessor::DMLResult DeletePackageProcessor::processPackage(dmlpackage abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif try { diff --git a/dbcon/dmlpackageproc/deletepackageprocessor.h b/dbcon/dmlpackageproc/deletepackageprocessor.h index 0d09baba12..bf487b41cc 100644 --- a/dbcon/dmlpackageproc/deletepackageprocessor.h +++ b/dbcon/dmlpackageproc/deletepackageprocessor.h @@ -31,11 +31,7 @@ #include #include "joblist.h" -#if defined(_MSC_VER) && defined(DMLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackageprocessor { diff --git a/dbcon/dmlpackageproc/dmlpackageprocessor.h b/dbcon/dmlpackageproc/dmlpackageprocessor.h index 07180ac8b9..a3744db51f 100644 --- a/dbcon/dmlpackageproc/dmlpackageprocessor.h +++ b/dbcon/dmlpackageproc/dmlpackageprocessor.h @@ -43,11 +43,7 @@ #include "querystats.h" #include "clientrotator.h" -#if defined(_MSC_VER) && defined(DMLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif //#define IDB_DML_DEBUG namespace dmlpackageprocessor diff --git a/dbcon/dmlpackageproc/dmlpackageprocessorfactory.h b/dbcon/dmlpackageproc/dmlpackageprocessorfactory.h index 6d2d21cb35..f166440287 100644 --- a/dbcon/dmlpackageproc/dmlpackageprocessorfactory.h +++ b/dbcon/dmlpackageproc/dmlpackageprocessorfactory.h @@ -26,11 +26,7 @@ #include "calpontdmlpackage.h" #include "dmlpackageprocessor.h" -#if defined(_MSC_VER) && defined(DMLPKGPROCFACTORY_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackageprocessor { diff --git a/dbcon/dmlpackageproc/insertpackageprocessor.cpp b/dbcon/dmlpackageproc/insertpackageprocessor.cpp index 3fd6b7ae06..e015544cc7 100644 --- a/dbcon/dmlpackageproc/insertpackageprocessor.cpp +++ b/dbcon/dmlpackageproc/insertpackageprocessor.cpp @@ -176,9 +176,6 @@ DMLPackageProcessor::DMLResult InsertPackageProcessor::processPackage(dmlpackage for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -187,7 +184,6 @@ DMLPackageProcessor::DMLResult InsertPackageProcessor::processPackage(dmlpackage abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif try { diff --git a/dbcon/dmlpackageproc/insertpackageprocessor.h b/dbcon/dmlpackageproc/insertpackageprocessor.h index 6a91520f78..a868bccfd9 100644 --- a/dbcon/dmlpackageproc/insertpackageprocessor.h +++ b/dbcon/dmlpackageproc/insertpackageprocessor.h @@ -31,11 +31,7 @@ #include "dataconvert.h" #include "we_chunkmanager.h" -#if defined(_MSC_VER) && defined(DMLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackageprocessor { diff --git a/dbcon/dmlpackageproc/tablelockdata.h b/dbcon/dmlpackageproc/tablelockdata.h index 82dd94a552..32502febcb 100644 --- a/dbcon/dmlpackageproc/tablelockdata.h +++ b/dbcon/dmlpackageproc/tablelockdata.h @@ -26,11 +26,7 @@ #include #include -#if defined(_MSC_VER) && defined(DMLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackageprocessor { diff --git a/dbcon/dmlpackageproc/updatepackageprocessor.cpp b/dbcon/dmlpackageproc/updatepackageprocessor.cpp index 344796ce67..9eb8fb64cb 100644 --- a/dbcon/dmlpackageproc/updatepackageprocessor.cpp +++ b/dbcon/dmlpackageproc/updatepackageprocessor.cpp @@ -193,9 +193,6 @@ DMLPackageProcessor::DMLResult UpdatePackageProcessor::processPackage(dmlpackage for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -204,7 +201,6 @@ DMLPackageProcessor::DMLResult UpdatePackageProcessor::processPackage(dmlpackage abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif try { diff --git a/dbcon/dmlpackageproc/updatepackageprocessor.h b/dbcon/dmlpackageproc/updatepackageprocessor.h index 56d9775155..42ad8abcb0 100644 --- a/dbcon/dmlpackageproc/updatepackageprocessor.h +++ b/dbcon/dmlpackageproc/updatepackageprocessor.h @@ -28,11 +28,7 @@ #include #include "joblist.h" -#if defined(_MSC_VER) && defined(DMLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace dmlpackageprocessor { diff --git a/dbcon/execplan/calpontsystemcatalog.cpp b/dbcon/execplan/calpontsystemcatalog.cpp index b7ecfc09a1..0c5d76ec41 100644 --- a/dbcon/execplan/calpontsystemcatalog.cpp +++ b/dbcon/execplan/calpontsystemcatalog.cpp @@ -74,9 +74,6 @@ using namespace rowgroup; #include #include -#ifdef _MSC_VER -#include "idbregistry.h" -#endif #undef BAIL_IF_0 #if 1 @@ -861,11 +858,7 @@ void CalpontSystemCatalog::getSysData_EC(CalpontSelectExecutionPlan& csep, NJLSy if (retryNum >= 6) throw runtime_error("Error occured when calling makeJobList"); -#ifdef _MSC_VER - Sleep(1 * 1000); -#else sleep(1); -#endif jl = JobListFactory::makeJobList(&csep, rm, dummyPrimitiveServerThreadPools, true); retryNum++; } @@ -1948,16 +1941,7 @@ CalpontSystemCatalog::CalpontSystemCatalog() : fExeMgr(new ClientRotator(0, "Exe string localModuleType; const char* p = 0; // see if env is set to override identity lookup -#ifdef _MSC_VER - p = "EC"; - string cfStr = IDBreadRegistry("SyscatIdent"); - - if (!cfStr.empty()) - p = cfStr.c_str(); - -#else p = getenv("CALPONT_CSC_IDENT"); -#endif if (p && *p) { diff --git a/dbcon/execplan/exp_templates.h b/dbcon/execplan/exp_templates.h index 71c777db49..5b91bc6298 100644 --- a/dbcon/execplan/exp_templates.h +++ b/dbcon/execplan/exp_templates.h @@ -617,14 +617,8 @@ class expression_parser { try { -#if _MSC_VER > 1600 - return std::_Copy_impl(first, last, start()); - } - -#else return std::copy(first, last, start()); } -#endif catch (const std::runtime_error&) { m_policy.cleanup(operandStack, operatorStack); diff --git a/dbcon/execplan/functioncolumn.cpp b/dbcon/execplan/functioncolumn.cpp index 855b58aa79..e90f631f07 100644 --- a/dbcon/execplan/functioncolumn.cpp +++ b/dbcon/execplan/functioncolumn.cpp @@ -46,9 +46,6 @@ using namespace boost; #include "functor_str.h" using namespace funcexp; -#ifdef _MSC_VER -#define strcasecmp stricmp -#endif namespace execplan { diff --git a/dbcon/execplan/intervalcolumn.cpp b/dbcon/execplan/intervalcolumn.cpp index c3fcec936d..8e5435124a 100644 --- a/dbcon/execplan/intervalcolumn.cpp +++ b/dbcon/execplan/intervalcolumn.cpp @@ -33,9 +33,6 @@ using namespace boost; #include "intervalcolumn.h" using namespace funcexp; -#ifdef _MSC_VER -#define strcasecmp stricmp -#endif namespace execplan { diff --git a/dbcon/execplan/predicateoperator.h b/dbcon/execplan/predicateoperator.h index b732a28256..45ace1a04c 100644 --- a/dbcon/execplan/predicateoperator.h +++ b/dbcon/execplan/predicateoperator.h @@ -27,9 +27,7 @@ #include #include -#if defined(_MSC_VER) -#include -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) #include #else #include diff --git a/dbcon/execplan/windowfunctioncolumn.cpp b/dbcon/execplan/windowfunctioncolumn.cpp index dc39677d88..91f13e82fd 100644 --- a/dbcon/execplan/windowfunctioncolumn.cpp +++ b/dbcon/execplan/windowfunctioncolumn.cpp @@ -52,9 +52,6 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; -#ifdef _MSC_VER -#define strcasecmp stricmp -#endif namespace execplan { diff --git a/dbcon/joblist/crossenginestep.cpp b/dbcon/joblist/crossenginestep.cpp index d03f21e0d0..5f2fa3f5ee 100644 --- a/dbcon/joblist/crossenginestep.cpp +++ b/dbcon/joblist/crossenginestep.cpp @@ -252,20 +252,12 @@ T CrossEngineStep::convertValueNum(const char* str, const CalpontSystemCatalog:: case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::INT: -#ifdef _MSC_VER - rv = boost::any_cast(anyVal); -#else rv = boost::any_cast(anyVal); -#endif break; case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UINT: -#ifdef _MSC_VER - rv = boost::any_cast(anyVal); -#else rv = boost::any_cast(anyVal); -#endif break; case CalpontSystemCatalog::BIGINT: rv = boost::any_cast(anyVal); break; @@ -332,12 +324,7 @@ T CrossEngineStep::convertValueNum(const char* str, const CalpontSystemCatalog:: else if (ct.colWidth == execplan::CalpontSystemCatalog::EIGHT_BYTE) rv = boost::any_cast(anyVal); else if (ct.colWidth == execplan::CalpontSystemCatalog::FOUR_BYTE) -#ifdef _MSC_VER - rv = boost::any_cast(anyVal); - -#else rv = boost::any_cast(anyVal); -#endif else if (ct.colWidth == execplan::CalpontSystemCatalog::TWO_BYTE) rv = boost::any_cast(anyVal); else if (ct.colWidth == execplan::CalpontSystemCatalog::ONE_BYTE) diff --git a/dbcon/joblist/distributedenginecomm.h b/dbcon/joblist/distributedenginecomm.h index 26b5869b7d..6c3d453930 100644 --- a/dbcon/joblist/distributedenginecomm.h +++ b/dbcon/joblist/distributedenginecomm.h @@ -53,11 +53,7 @@ class TestDistributedEngineComm; -#if defined(_MSC_VER) && defined(JOBLIST_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace messageqcpp { diff --git a/dbcon/joblist/groupconcat.h b/dbcon/joblist/groupconcat.h index 6c1341a75f..d6a9724700 100644 --- a/dbcon/joblist/groupconcat.h +++ b/dbcon/joblist/groupconcat.h @@ -32,11 +32,7 @@ #include "rowaggregation.h" // SP_GroupConcat #include "limitedorderby.h" // IdbOrderBy -#if defined(_MSC_VER) && defined(JOBLIST_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace joblist { diff --git a/dbcon/joblist/jlf_execplantojoblist.cpp b/dbcon/joblist/jlf_execplantojoblist.cpp index 64f752807b..58b70f5ea9 100644 --- a/dbcon/joblist/jlf_execplantojoblist.cpp +++ b/dbcon/joblist/jlf_execplantojoblist.cpp @@ -307,20 +307,12 @@ void convertValueNum(const string& str, const CalpontSystemCatalog::ColType& ct, case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::INT: -#ifdef _MSC_VER - v = boost::any_cast(anyVal); -#else v = boost::any_cast(anyVal); -#endif break; case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UINT: -#ifdef _MSC_VER - v = boost::any_cast(anyVal); -#else v = boost::any_cast(anyVal); -#endif break; case CalpontSystemCatalog::BIGINT: v = boost::any_cast(anyVal); break; @@ -390,12 +382,7 @@ void convertValueNum(const string& str, const CalpontSystemCatalog::ColType& ct, else if (ct.colWidth == execplan::CalpontSystemCatalog::EIGHT_BYTE) v = boost::any_cast(anyVal); else if (ct.colWidth == execplan::CalpontSystemCatalog::FOUR_BYTE) -#ifdef _MSC_VER - v = boost::any_cast(anyVal); - -#else v = boost::any_cast(anyVal); -#endif else if (ct.colWidth == execplan::CalpontSystemCatalog::TWO_BYTE) v = boost::any_cast(anyVal); else if (ct.colWidth == execplan::CalpontSystemCatalog::ONE_BYTE) diff --git a/dbcon/joblist/joblist.h b/dbcon/joblist/joblist.h index 24df23beb0..e20b34a4f8 100644 --- a/dbcon/joblist/joblist.h +++ b/dbcon/joblist/joblist.h @@ -39,11 +39,7 @@ #endif #endif -#if defined(_MSC_VER) && defined(JOBLIST_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace joblist { diff --git a/dbcon/joblist/joblistfactory.cpp b/dbcon/joblist/joblistfactory.cpp index ca0dce1fd9..11308612ea 100644 --- a/dbcon/joblist/joblistfactory.cpp +++ b/dbcon/joblist/joblistfactory.cpp @@ -2121,17 +2121,7 @@ SJLP makeJobList_(CalpontExecutionPlan* cplan, ResourceManager* rm, gettimeofday(&stTime, 0); struct tm tmbuf; -#ifdef _MSC_VER - errno_t p = 0; - time_t t = stTime.tv_sec; - p = localtime_s(&tmbuf, &t); - - if (p != 0) - memset(&tmbuf, 0, sizeof(tmbuf)); - -#else localtime_r(&stTime.tv_sec, &tmbuf); -#endif ostringstream tms; tms << setfill('0') << setw(4) << (tmbuf.tm_year + 1900) << setw(2) << (tmbuf.tm_mon + 1) << setw(2) << (tmbuf.tm_mday) << setw(2) << (tmbuf.tm_hour) << setw(2) << (tmbuf.tm_min) << setw(2) @@ -2142,16 +2132,7 @@ SJLP makeJobList_(CalpontExecutionPlan* cplan, ResourceManager* rm, jlf_graphics::writeDotCmds(dotFile, querySteps, projectSteps); char timestamp[80]; -#ifdef _MSC_VER - t = stTime.tv_sec; - p = ctime_s(timestamp, 80, &t); - - if (p != 0) - strcpy(timestamp, "UNKNOWN"); - -#else ctime_r((const time_t*)&stTime.tv_sec, timestamp); -#endif oss << "runtime updates: start at " << timestamp; cout << oss.str(); Message::Args args; diff --git a/dbcon/joblist/joblistfactory.h b/dbcon/joblist/joblistfactory.h index fe3c14bebe..9f04035d7e 100644 --- a/dbcon/joblist/joblistfactory.h +++ b/dbcon/joblist/joblistfactory.h @@ -29,11 +29,7 @@ #include "joblist.h" #include "../../primitives/primproc/primitiveserverthreadpools.h" -#if defined(_MSC_VER) && defined(JOBLIST_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace execplan { diff --git a/dbcon/joblist/jsonarrayagg.h b/dbcon/joblist/jsonarrayagg.h index 83c02f5c34..d3fefb972a 100644 --- a/dbcon/joblist/jsonarrayagg.h +++ b/dbcon/joblist/jsonarrayagg.h @@ -27,11 +27,7 @@ #include "groupconcat.h" -#if defined(_MSC_VER) && defined(JOBLIST_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace joblist { diff --git a/dbcon/joblist/largehashjoin.h b/dbcon/joblist/largehashjoin.h index 0e4bed5177..a61faf879f 100644 --- a/dbcon/joblist/largehashjoin.h +++ b/dbcon/joblist/largehashjoin.h @@ -32,11 +32,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include #include diff --git a/dbcon/joblist/lbidlist.h b/dbcon/joblist/lbidlist.h index bf7c6310b3..4e294341d4 100644 --- a/dbcon/joblist/lbidlist.h +++ b/dbcon/joblist/lbidlist.h @@ -31,11 +31,7 @@ #include "bytestream.h" #include #include "brm.h" -#ifdef _MSC_VER -#include -#else #include -#endif namespace joblist { diff --git a/dbcon/joblist/primitivemsg.h b/dbcon/joblist/primitivemsg.h index 916e4e6ce6..1aeac576e9 100644 --- a/dbcon/joblist/primitivemsg.h +++ b/dbcon/joblist/primitivemsg.h @@ -34,10 +34,6 @@ #pragma pack(push, 1) -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4200) -#endif // from blocksize.h const int32_t DATA_BLOCK_SIZE = BLOCK_SIZE; @@ -880,8 +876,5 @@ struct LbidAtVer uint32_t Ver; }; -#ifdef _MSC_VER -#pragma warning(pop) -#endif #pragma pack(pop) diff --git a/dbcon/joblist/primitivestep.h b/dbcon/joblist/primitivestep.h index 570a93b3a8..6f2d1a9b19 100644 --- a/dbcon/joblist/primitivestep.h +++ b/dbcon/joblist/primitivestep.h @@ -33,11 +33,7 @@ #include #include #include -#ifndef _MSC_VER #include -#else -#include -#endif #include #include diff --git a/dbcon/joblist/resourcemanager.h b/dbcon/joblist/resourcemanager.h index 72f32dfb7a..959201ae7b 100644 --- a/dbcon/joblist/resourcemanager.h +++ b/dbcon/joblist/resourcemanager.h @@ -39,11 +39,7 @@ #include "atomicops.h" -#if defined(_MSC_VER) && defined(JOBLIST_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace joblist { diff --git a/dbcon/joblist/tablecolumn.h b/dbcon/joblist/tablecolumn.h index 087b325bf0..8b052d7a3a 100644 --- a/dbcon/joblist/tablecolumn.h +++ b/dbcon/joblist/tablecolumn.h @@ -34,11 +34,7 @@ //#define TC_CHECK_RIDS 1 -#if defined(_MSC_VER) && defined(JOBLIST_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace joblist { diff --git a/dbcon/joblist/threadsafequeue.h b/dbcon/joblist/threadsafequeue.h index 41ee73bc6d..7a45b0690d 100644 --- a/dbcon/joblist/threadsafequeue.h +++ b/dbcon/joblist/threadsafequeue.h @@ -29,12 +29,6 @@ #include #include -#if defined(_MSC_VER) && !defined(_WIN64) -#ifndef InterlockedAdd -#define InterlockedAdd64 InterlockedAdd -#define InterlockedAdd(x, y) ((x) + (y)) -#endif -#endif namespace joblist { @@ -338,11 +332,7 @@ class ThreadSafeQueue SPBC fPimplCond; volatile bool fShutdown; T fBs0; -#ifdef _MSC_VER - volatile LONG bytes; -#else size_t bytes; -#endif uint32_t zeroCount; // counts the # of times read_some returned 0 }; diff --git a/dbcon/joblist/timeset.h b/dbcon/joblist/timeset.h index 4ed15ce6ea..9cde03c335 100644 --- a/dbcon/joblist/timeset.h +++ b/dbcon/joblist/timeset.h @@ -86,12 +86,7 @@ inline void TimeSet::displayAll() const for (ElapsedMap::const_iterator it = fElapsed.begin(); it != itend; ++it) { double t; -#if defined(_MSC_VER) && defined(_my_pthread_h) - // FIXME - t = 0.0; -#else t = (double)it->second.tv_sec + (double)it->second.tv_nsec / 1000000000.0; -#endif std::cout << "TimeSet " << it->first << ": " << t << "s\n"; } @@ -112,11 +107,7 @@ inline void TimeSet::display(const std::string& key) const if (fElapsed.end() != em) { double t; -#if defined(_MSC_VER) && defined(_my_pthread_h) - t = 0.0; -#else t = (double)em->second.tv_sec + (double)em->second.tv_nsec / 1000000000.0; -#endif std::cout << "TimeSet elapse " << em->first << ": " << t << "s\n"; } else @@ -126,11 +117,7 @@ inline void TimeSet::display(const std::string& key) const if (fTimer.end() != tm) { double t; -#if defined(_MSC_VER) && defined(_my_pthread_h) - t = 0.0; -#else t = (double)tm->second.tv_sec + (double)tm->second.tv_nsec / 1000000000.0; -#endif std::cout << "TimeSet start " << tm->first << ": " << t << "s\n"; } } @@ -148,18 +135,10 @@ inline double TimeSet::totalTime() const for (ElapsedMap::const_iterator it = fElapsed.begin(); it != itend; ++it) { -#if defined(_MSC_VER) && !defined(_my_pthread_h) - tSum.tv_sec += it->second.tv_sec; - tSum.tv_nsec += it->second.tv_nsec; -#endif } double totSeconds; -#if defined(_MSC_VER) && defined(_my_pthread_h) - totSeconds = 0.0; -#else totSeconds = (double)tSum.tv_sec + (double)tSum.tv_nsec / 1000000000.0; -#endif return totSeconds; } @@ -175,11 +154,7 @@ inline double TimeSet::totalTime(const std::string& key) const if (fElapsed.end() != el) { double totSeconds; -#if defined(_MSC_VER) && defined(_my_pthread_h) - totSeconds = 0.0; -#else totSeconds = (double)el->second.tv_sec + (double)el->second.tv_nsec / 1000000000.0; -#endif return totSeconds; } else @@ -206,8 +181,6 @@ inline void TimeSet::holdTimer(const std::string& key) struct timespec tDiff; #if defined(CLOCK_REALTIME) clock_gettime(CLOCK_REALTIME, &tEnd); -#elif defined(_MSC_VER) && defined(_my_pthread_h) - tEnd.tv.i64 = tEnd.max_timeout_msec = 0; #else tEnd.tv_sec = tEnd.tv_nsec = 0; #endif @@ -227,8 +200,6 @@ inline void TimeSet::startTimer(const std::string& key) struct timespec ts; #if defined(CLOCK_REALTIME) clock_gettime(CLOCK_REALTIME, &ts); -#elif defined(_MSC_VER) && defined(_my_pthread_h) - ts.tv.i64 = ts.max_timeout_msec = 0; #else ts.tv_sec = ts.tv_nsec = 0; #endif @@ -250,8 +221,6 @@ inline void TimeSet::stopTimer(const std::string& key) struct timespec tDiff; #if defined(CLOCK_REALTIME) clock_gettime(CLOCK_REALTIME, &tEnd); -#elif defined(_MSC_VER) && defined(_my_pthread_h) - tEnd.tv.i64 = tEnd.max_timeout_msec = 0; #else tEnd.tv_sec = tEnd.tv_nsec = 0; #endif @@ -301,9 +270,6 @@ inline void TimeSet::timespec_sub(const struct timespec& tv1, // start time const struct timespec& tv2, // end time struct timespec& diff) const { -#if defined(_MSC_VER) && defined(_my_pthread_h) - diff.tv.i64 = diff.max_timeout_msec = 0; -#else if (tv2.tv_nsec < tv1.tv_nsec) { @@ -316,7 +282,6 @@ inline void TimeSet::timespec_sub(const struct timespec& tv1, // start time diff.tv_nsec = tv2.tv_nsec - tv1.tv_nsec; } -#endif } //------------------------------------------------------------------------------ @@ -329,9 +294,6 @@ inline void TimeSet::timespec_add(const struct timespec& tv1, // start time const struct timespec& tv2, // end time struct timespec& sum) const { -#if defined(_MSC_VER) && defined(_my_pthread_h) - sum.tv.i64 = sum.max_timeout_msec = 0; -#else sum.tv_sec = tv1.tv_sec + tv2.tv_sec; sum.tv_nsec = tv1.tv_nsec + tv2.tv_nsec; @@ -341,7 +303,6 @@ inline void TimeSet::timespec_add(const struct timespec& tv1, // start time sum.tv_nsec -= 1000000000; } -#endif } }; // namespace joblist diff --git a/dbcon/joblist/timestamp.cpp b/dbcon/joblist/timestamp.cpp index ecb5316341..a230855c14 100644 --- a/dbcon/joblist/timestamp.cpp +++ b/dbcon/joblist/timestamp.cpp @@ -51,26 +51,8 @@ const string JSTimeStamp::format(const struct timeval& tvbuf) string res; char timeString[50]; struct tm tmbuf; -#ifdef _MSC_VER - errno_t p = 0; - time_t t = tvbuf.tv_sec; - p = localtime_s(&tmbuf, &t); - - if (p != 0) - { - memset(&tmbuf, 0, sizeof(tmbuf)); - strcpy(timeString, "UNKNOWN"); - } - else - { - if (strftime(timeString, 50, "%Y-%m-%d %H:%M:%S", &tmbuf) == 0) - strcpy(timeString, "UNKNOWN"); - } - -#else localtime_r(&tvbuf.tv_sec, &tmbuf); strftime(timeString, 50, "%F %T", &tmbuf); -#endif const int len = strlen(timeString); snprintf(&timeString[len], (50 - len), ".%06lu", tvbuf.tv_usec); res = timeString; diff --git a/dbcon/joblist/tuple-bps.cpp b/dbcon/joblist/tuple-bps.cpp index ab96a2cdc1..6803cb8907 100644 --- a/dbcon/joblist/tuple-bps.cpp +++ b/dbcon/joblist/tuple-bps.cpp @@ -2097,11 +2097,7 @@ void TupleBPS::makeJobs(vector* jobs) totalMsgs += blocksToScan; // how many logical blocks to process with a single job (& single thread on the PM) -#if defined(_MSC_VER) && BOOST_VERSION < 105200 - blocksPerJob = max(blocksToScan / fProcessorThreadsPerScan, 16UL); -#else blocksPerJob = max(blocksToScan / fProcessorThreadsPerScan, 16U); -#endif startingLBID = scannedExtents[i].range.start; bool isExeMgrDEC = fDec->isExeMgrDEC(); diff --git a/dbcon/joblist/tupleannexstep.cpp b/dbcon/joblist/tupleannexstep.cpp index b93e413784..b95d90f161 100644 --- a/dbcon/joblist/tupleannexstep.cpp +++ b/dbcon/joblist/tupleannexstep.cpp @@ -22,11 +22,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif using namespace std; #include diff --git a/dbcon/joblist/tupleunion.h b/dbcon/joblist/tupleunion.h index 0d13700513..9b9a0d75f8 100644 --- a/dbcon/joblist/tupleunion.h +++ b/dbcon/joblist/tupleunion.h @@ -28,11 +28,7 @@ // #include "jobstep.h" -#ifndef _MSC_VER #include -#else -#include -#endif #include "stlpoolallocator.h" #include "threadnaming.h" diff --git a/dbcon/joblist/windowfunctionstep.h b/dbcon/joblist/windowfunctionstep.h index d1da2aafde..1f70fae279 100644 --- a/dbcon/joblist/windowfunctionstep.h +++ b/dbcon/joblist/windowfunctionstep.h @@ -204,11 +204,7 @@ class WindowFunctionStep : public JobStep, public TupleDeliveryStep std::vector > fFunctions; uint64_t fFunctionCount; uint64_t fTotalThreads; -#ifdef _MSC_VER - volatile LONG fNextIndex; -#else int fNextIndex; -#endif // query order by boost::shared_ptr fQueryOrderBy; diff --git a/dbcon/mysql/ha_mcs.cpp b/dbcon/mysql/ha_mcs.cpp index 7b8e9f76ae..2ce38f2d32 100644 --- a/dbcon/mysql/ha_mcs.cpp +++ b/dbcon/mysql/ha_mcs.cpp @@ -56,10 +56,8 @@ select_handler* create_columnstore_unit_handler(THD* thd, SELECT_LEX_UNIT* sel_u */ static HASH mcs_open_tables; -#ifndef _MSC_VER /* The mutex used to init the hash; variable for example share methods */ pthread_mutex_t mcs_mutex; -#endif #ifdef DEBUG_ENTER #undef DEBUG_ENTER @@ -1819,9 +1817,7 @@ static int columnstore_init_func(void* p) mcs_hton = (handlerton*)p; -#ifndef _MSC_VER (void)pthread_mutex_init(&mcs_mutex, MY_MUTEX_INIT_FAST); -#endif (void)my_hash_init(PSI_NOT_INSTRUMENTED, &mcs_open_tables, system_charset_info, 32, 0, 0, (my_hash_get_key)mcs_get_key, 0, 0); @@ -1856,9 +1852,7 @@ static int columnstore_done_func(void* p) config::Config::deleteInstanceMap(); my_hash_free(&mcs_open_tables); -#ifndef _MSC_VER pthread_mutex_destroy(&mcs_mutex); -#endif if (plugin_maria) { diff --git a/dbcon/mysql/ha_mcs_client_udfs.cpp b/dbcon/mysql/ha_mcs_client_udfs.cpp index 28edcaf2e4..99f56f1a5c 100644 --- a/dbcon/mysql/ha_mcs_client_udfs.cpp +++ b/dbcon/mysql/ha_mcs_client_udfs.cpp @@ -111,9 +111,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* mcssetparms(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -184,42 +181,27 @@ extern "C" } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcssetparms_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return setparms_init(initid, args, message, "MCSSETPARMS"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcssetparms_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calsetparms(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { return mcssetparms(initid, args, result, length, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calsetparms_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return setparms_init(initid, args, message, "CALSETPARMS"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calsetparms_deinit(UDF_INIT* initid) { } @@ -238,9 +220,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* mcsgetstats(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -269,41 +248,26 @@ extern "C" } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcsgetstats_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return getstats_init(initid, args, message, "MCSGETSTATS"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcsgetstats_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calgetstats(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { return mcsgetstats(initid, args, result, length, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calgetstats_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return getstats_init(initid, args, message, "CALGETSTATS"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calgetstats_deinit(UDF_INIT* initid) { } @@ -319,9 +283,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long mcssettrace(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { if (get_fe_conn_info_ptr() == NULL) @@ -340,47 +301,29 @@ extern "C" return oldTrace; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcssettrace_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return settrace_init(initid, args, message, "MCSSETTRACE"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcssettrace_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long calsettrace(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { return mcssettrace(initid, args, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calsettrace_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return settrace_init(initid, args, message, "CALSETTRACE"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calsettrace_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif // Return 1 if system is ready for reads or 0 if not. long long mcssystemready(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { @@ -403,24 +346,15 @@ extern "C" return rtn; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcssystemready_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcssystemready_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif // Return non-zero if system is read only; 0 if writeable long long mcssystemreadonly(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { @@ -448,24 +382,15 @@ extern "C" return rtn; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcssystemreadonly_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcssystemreadonly_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif // Return non-zero if this is the primary UM; 0 if not primary long long mcssystemprimary(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { @@ -499,17 +424,11 @@ extern "C" return rtn; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcssystemprimary_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcssystemprimary_deinit(UDF_INIT* initid) { } @@ -543,17 +462,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcsviewtablelock_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return viewtablelock_init(initid, args, message, "MCSVIEWTABLELOCK"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* mcsviewtablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -609,33 +522,21 @@ extern "C" return result; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcsviewtablelock_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calviewtablelock_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return viewtablelock_init(initid, args, message, "CALVIEWTABLELOCK"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calviewtablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { return mcsviewtablelock(initid, args, result, length, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calviewtablelock_deinit(UDF_INIT* initid) { } @@ -655,17 +556,11 @@ extern "C" } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcscleartablelock_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return cleartablelock_init(initid, args, message, "MCSCLEARTABLELOCK"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* mcscleartablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -693,33 +588,21 @@ extern "C" return result; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcscleartablelock_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calcleartablelock_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return cleartablelock_init(initid, args, message, "CALCLEARTABLELOCK"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calcleartablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { return mcscleartablelock(initid, args, result, length, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calcleartablelock_deinit(UDF_INIT* initid) { } @@ -754,17 +637,11 @@ extern "C" } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcslastinsertid_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return lastinsertid_init(initid, args, message, "MCSLASTINSERTID"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long mcslastinsertid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { THD* thd = current_thd; @@ -825,32 +702,20 @@ extern "C" return (nextVal - 1); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcslastinsertid_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool callastinsertid_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return lastinsertid_init(initid, args, message, "CALLASTINSERTID"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long callastinsertid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { return mcslastinsertid(initid, args, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void callastinsertid_deinit(UDF_INIT* initid) { } @@ -866,47 +731,29 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcsflushcache_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long mcsflushcache(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { return static_cast(cacheutils::flushPrimProcCache()); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcsflushcache_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return flushcache_init(initid, args, message, "MCSFLUSHCACHE"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calflushcache_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long calflushcache(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { return mcsflushcache(initid, args, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calflushcache_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return flushcache_init(initid, args, message, "CALFLUSHCACHE"); @@ -917,9 +764,6 @@ extern "C" // mysqld will call this with only 766 bytes available in result no matter what we asked for in // calgettrace_init() // if we return a pointer that is not result, mysqld will take our pointer and use it, freeing up result -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* mcsgettrace(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -981,41 +825,26 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcsgettrace_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return gettrace_init(initid, args, message, "MCSGETTRACE"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcsgettrace_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calgettrace(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { return mcsgettrace(initid, args, result, length, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calgettrace_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return gettrace_init(initid, args, message, "CALGETTRACE"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calgettrace_deinit(UDF_INIT* initid) { } @@ -1031,9 +860,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* mcsgetversion(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -1043,41 +869,26 @@ extern "C" return result; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcsgetversion_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return getversion_init(initid, args, message, "MCSGETVERSION"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcsgetversion_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calgetversion(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { return mcsgetversion(initid, args, result, length, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calgetversion_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return getversion_init(initid, args, message, "CALGETVERSION"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calgetversion_deinit(UDF_INIT* initid) { } @@ -1093,9 +904,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* mcsgetsqlcount(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -1138,57 +946,36 @@ extern "C" return result; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcsgetsqlcount_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return getstats_init(initid, args, message, "MCSGETSQLCOUNT"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcsgetsqlcount_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calgetsqlcount(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { return mcsgetsqlcount(initid, args, result, length, is_null, error); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calgetsqlcount_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { return getstats_init(initid, args, message, "CALGETSQLCOUNT"); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calgetsqlcount_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long mcs_emindex_size(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { DBRM dbrm; return dbrm.EMIndexShmemSize(); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcs_emindex_size_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 0) @@ -1200,25 +987,16 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcs_emindex_size_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long mcs_emindex_free(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { DBRM dbrm; return dbrm.EMIndexShmemFree(); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcs_emindex_free_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 0) @@ -1230,9 +1008,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcs_emindex_free_deinit(UDF_INIT* initid) { } diff --git a/dbcon/mysql/ha_mcs_ddl.cpp b/dbcon/mysql/ha_mcs_ddl.cpp index 3720d9b533..e6d8e58a7b 100644 --- a/dbcon/mysql/ha_mcs_ddl.cpp +++ b/dbcon/mysql/ha_mcs_ddl.cpp @@ -2739,9 +2739,6 @@ int ha_mcs_impl_rename_table_(const char* from, const char* to, cal_connection_i extern "C" { -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long calonlinealter(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { string stmt(args->args[0], args->lengths[0]); @@ -2780,9 +2777,6 @@ extern "C" return rc; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calonlinealter_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1 || args->arg_type[0] != STRING_RESULT) @@ -2794,9 +2788,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calonlinealter_deinit(UDF_INIT* initid) { } diff --git a/dbcon/mysql/ha_mcs_dml.cpp b/dbcon/mysql/ha_mcs_dml.cpp index a3f97db70c..a23e96d488 100644 --- a/dbcon/mysql/ha_mcs_dml.cpp +++ b/dbcon/mysql/ha_mcs_dml.cpp @@ -25,13 +25,8 @@ #include #include #include -#ifdef _MSC_VER -#include -#include -#else #include #include -#endif #include #include #include diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 88ebe08307..d50c475496 100644 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -21,13 +21,8 @@ #include #include #include -#ifdef _MSC_VER -#include -#include -#else #include #include -#endif #include #include #include @@ -4212,15 +4207,10 @@ ReturnedColumn* buildFunctionColumn(Item_func* ifp, gp_walk_info& gwi, bool& non // add my_time_zone if (funcName == "unix_timestamp") { -#ifndef _MSC_VER time_t tmp_t = 1; struct tm tmp; localtime_r(&tmp_t, &tmp); sptp.reset(new ParseTree(new ConstantColumn(static_cast(tmp.tm_gmtoff), ConstantColumn::NUM))); -#else - // FIXME: Get GMT offset (in seconds east of GMT) in Windows... - sptp.reset(new ParseTree(new ConstantColumn(static_cast(0), ConstantColumn::NUM))); -#endif (dynamic_cast(sptp->data()))->timeZone(gwi.timeZone); funcParms.push_back(sptp); } diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index eb5829434a..846b87cfe1 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -18,20 +18,12 @@ #define PREFER_MY_CONFIG_H #include -#ifndef _MSC_VER #include -#endif #include #include #include -#ifdef _MSC_VER -#include -#include -#include -#else #include #include -#endif #include #include #include @@ -41,15 +33,7 @@ #include #include #include -#if defined(__linux__) #include //wait() -#elif defined(__FreeBSD__) -#include -#include // For stat(). -#include -#include -#include -#endif using namespace std; #include @@ -1602,25 +1586,10 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector& c try { timespec* tsp = 0; -#ifndef _MSC_VER timespec ts; ts.tv_sec = 3L; ts.tv_nsec = 0L; tsp = &ts; -#else - // FIXME: @#$%^&! mysql has buggered up timespec! - // The definition in my_pthread.h isn't the same as in winport/unistd.h... - struct timespec_foo - { - long tv_sec; - long tv_nsec; - } ts_foo; - ts_foo.tv_sec = 3; - ts_foo.tv_nsec = 0; - // This is only to get the compiler to not carp below at the read() call. - // The messagequeue lib uses the correct struct - tsp = reinterpret_cast(&ts_foo); -#endif bool isTimeOut = true; int maxRetries = 2; std::string exMsg; @@ -2215,7 +2184,6 @@ int ha_mcs::impl_rnd_init(TABLE* table, const std::vector& condStack) return 0; // check whether the system is ready to process statement. -#ifndef _MSC_VER static DBRM dbrm(true); int bSystemQueryReady = dbrm.getSystemQueryReady(); @@ -2231,7 +2199,6 @@ int ha_mcs::impl_rnd_init(TABLE* table, const std::vector& condStack) setError(thd, ER_INTERNAL_ERROR, "DBRM is not responding. Cannot accept queries"); return ER_INTERNAL_ERROR; } -#endif // Set this to close all outstanding FEP connections on // client disconnect in handlerton::closecon_handlerton(). @@ -3206,25 +3173,15 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins } else { -#ifdef _MSC_VER - aCmdLine = "cpimport.exe -N -P " + to_string(localModuleId) + " -s " + ci->delimiter + " -e 0" + - " -E " + escapechar + ci->enclosed_by + " "; -#else aCmdLine = "cpimport -m 1 -N -P " + boost::to_string(localModuleId) + " -s " + ci->delimiter + " -e 0" + " -T " + thd->variables.time_zone->get_name()->ptr() + " -E " + escapechar + ci->enclosed_by + " "; -#endif } } else { -#ifdef _MSC_VER - aCmdLine = - "cpimport.exe -N -s " + ci->delimiter + " -e 0" + " -E " + escapechar + ci->enclosed_by + " "; -#else aCmdLine = std::string("cpimport -m 1 -N -s ") + ci->delimiter + " -e 0" + " -T " + thd->variables.time_zone->get_name()->ptr() + " -E " + escapechar + ci->enclosed_by + " "; -#endif } aCmdLine = aCmdLine + table->s->db.str + " " + table->s->table_name.str; @@ -3246,130 +3203,6 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins Cmds.push_back(0); // null terminate -#ifdef _MSC_VER - BOOL bSuccess = false; - BOOL bInitialized = false; - SECURITY_ATTRIBUTES saAttr; - saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); - saAttr.bInheritHandle = TRUE; - saAttr.lpSecurityDescriptor = nullptr; - HANDLE handleList[2]; - const char* pSectionMsg; - bSuccess = true; - - // Create a pipe for the child process's STDIN. - if (bSuccess) - { - pSectionMsg = "Create Stdin"; - bSuccess = CreatePipe(&ci->cpimport_stdin_Rd, &ci->cpimport_stdin_Wr, &saAttr, 65536); - - // Ensure the write handle to the pipe for STDIN is not inherited. - if (bSuccess) - { - pSectionMsg = "SetHandleInformation(stdin)"; - bSuccess = SetHandleInformation(ci->cpimport_stdin_Wr, HANDLE_FLAG_INHERIT, 0); - } - } - - // Launch cpimport - LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList = nullptr; - SIZE_T attrSize = 0; - STARTUPINFOEX siStartInfo; - - // To ensure the child only inherits the STDIN and STDOUT Handles, we add a list of - // Handles that can be inherited to the call to CreateProcess - if (bSuccess) - { - pSectionMsg = "InitializeProcThreadAttributeList(NULL)"; - bSuccess = InitializeProcThreadAttributeList(NULL, 1, 0, &attrSize) || - GetLastError() == ERROR_INSUFFICIENT_BUFFER; // Asks how much buffer to alloc - } - - if (bSuccess) - { - pSectionMsg = "HeapAlloc for AttrList"; - lpAttributeList = - reinterpret_cast(HeapAlloc(GetProcessHeap(), 0, attrSize)); - bSuccess = lpAttributeList != nullptr; - } - - if (bSuccess) - { - pSectionMsg = "InitializeProcThreadAttributeList"; - bSuccess = InitializeProcThreadAttributeList(lpAttributeList, 1, 0, &attrSize); - } - - if (bSuccess) - { - pSectionMsg = "UpdateProcThreadAttribute"; - bInitialized = true; - handleList[0] = ci->cpimport_stdin_Rd; - bSuccess = UpdateProcThreadAttribute(lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_HANDLE_LIST, - handleList, sizeof(HANDLE), NULL, NULL); - } - - if (bSuccess) - { - pSectionMsg = "CreateProcess"; - // In order for GenerateConsoleCtrlEvent (used when job is canceled) to work, - // this process must have a Console, which Services don't have. We create this - // when we create the child process. Once created, we leave it around for next time. - // AllocConsole will silently fail if it already exists, so no pain. - AllocConsole(); - // Set up members of the PROCESS_INFORMATION structure. - memset(&ci->cpimportProcInfo, 0, sizeof(PROCESS_INFORMATION)); - - // Set up members of the STARTUPINFOEX structure. - // This structure specifies the STDIN and STDOUT handles for redirection. - memset(&siStartInfo, 0, sizeof(STARTUPINFOEX)); - siStartInfo.StartupInfo.cb = sizeof(STARTUPINFOEX); - siStartInfo.lpAttributeList = lpAttributeList; - siStartInfo.StartupInfo.hStdError = nullptr; - siStartInfo.StartupInfo.hStdOutput = nullptr; - siStartInfo.StartupInfo.hStdInput = ci->cpimport_stdin_Rd; - siStartInfo.StartupInfo.dwFlags |= STARTF_USESTDHANDLES; - // Create the child process. - bSuccess = CreateProcess(NULL, // program. NULL means use command line - const_cast(aCmdLine.c_str()), // command line - NULL, // process security attributes - NULL, // primary thread security attributes - TRUE, // handles are inherited - EXTENDED_STARTUPINFO_PRESENT | CREATE_NEW_PROCESS_GROUP, // creation flags - NULL, // use parent's environment - NULL, // use parent's current directory - &siStartInfo.StartupInfo, // STARTUPINFO pointer - &ci->cpimportProcInfo); // receives PROCESS_INFORMATION - } - - // We need to clean up the memory created by InitializeProcThreadAttributeList - // and HeapAlloc - if (bInitialized) - DeleteProcThreadAttributeList(lpAttributeList); - - if (lpAttributeList) - HeapFree(GetProcessHeap(), 0, lpAttributeList); - - if (!bSuccess) - { - // If an error occurs, Log and return. - int errnum = GetLastError(); - char errmsg[512]; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errnum, 0, errmsg, 512, NULL); - ostringstream oss; - oss << " : Error in " << pSectionMsg << " (errno-" << errnum << "); " << errmsg; - setError(current_thd, ER_INTERNAL_ERROR, oss.str()); - ci->singleInsert = true; - ha_mcs_impl::log_this(thd, oss.str(), logging::LOG_TYPE_ERROR, tid2sid(thd->thread_id)); - ha_mcs_impl::log_this(thd, "End SQL statement", logging::LOG_TYPE_DEBUG, tid2sid(thd->thread_id)); - return; - } - - // Close the read handle that the child is using. We won't be needing this. - CloseHandle(ci->cpimport_stdin_Rd); - // The write functions all want a FILE* - ci->fdt[1] = _open_osfhandle((intptr_t)ci->cpimport_stdin_Wr, _O_APPEND); - ci->filePtr = _fdopen(ci->fdt[1], "w"); -#else long maxFD = -1; maxFD = sysconf(_SC_OPEN_MAX); @@ -3447,7 +3280,6 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins // from Field_blob|Field_varstring. Used in ColWriteBatchString() bitmap_set_all(table->read_set); -#endif } else { @@ -3589,34 +3421,6 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table) ((thd->lex)->sql_command == SQLCOM_LOAD) || ((thd->lex)->sql_command == SQLCOM_INSERT_SELECT) || ci->isCacheInsert)) { -#ifdef _MSC_VER - - if (thd->killed > 0) - { - errno = 0; - // GenerateConsoleCtrlEvent sends a signal to cpimport - BOOL brtn = GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, ci->cpimportProcInfo.dwProcessId); - - if (!brtn) - { - int errnum = GetLastError(); - char errmsg[512]; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errnum, 0, errmsg, 512, NULL); - ostringstream oss; - oss << "GenerateConsoleCtrlEvent: (errno-" << errnum << "); " << errmsg; - ha_mcs_impl::log_this(thd, oss.str(), logging::LOG_TYPE_DEBUG, 0); - } - - // Close handles to the cpimport process and its primary thread. - fclose(ci->filePtr); - ci->filePtr = 0; - ci->fdt[1] = -1; - CloseHandle(ci->cpimportProcInfo.hProcess); - CloseHandle(ci->cpimportProcInfo.hThread); - WaitForSingleObject(ci->cpimportProcInfo.hProcess, INFINITE); - } - -#else if ((thd->killed > 0) && (ci->cpimport_pid > 0)) // handle CTRL-C { @@ -3630,29 +3434,9 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table) waitpid(ci->cpimport_pid, &aStatus, 0); // wait until cpimport finishs } -#endif else { // tear down cpimport -#ifdef _MSC_VER - fclose(ci->filePtr); - ci->filePtr = 0; - ci->fdt[1] = -1; - DWORD exitCode; - WaitForSingleObject(ci->cpimportProcInfo.hProcess, INFINITE); - GetExitCodeProcess(ci->cpimportProcInfo.hProcess, &exitCode); - - if (exitCode != 0) - { - rc = 1; - setError(thd, ER_INTERNAL_ERROR, - "load failed. The detailed error information is listed in InfiniDBLog.txt."); - } - - // Close handles to the cpimport process and its primary thread. - CloseHandle(ci->cpimportProcInfo.hProcess); - CloseHandle(ci->cpimportProcInfo.hThread); -#else fclose(ci->filePtr); ci->filePtr = 0; ci->fdt[1] = -1; @@ -3709,7 +3493,6 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table) } } -#endif if (rc == 0) { ha_mcs_impl::log_this(thd, "End SQL statement", logging::LOG_TYPE_DEBUG, tid2sid(thd->thread_id)); @@ -4212,7 +3995,6 @@ int ha_mcs_impl_group_by_init(mcs_handler_info* handler_info, TABLE* table) THD* thd = current_thd; // check whether the system is ready to process statement. -#ifndef _MSC_VER static DBRM dbrm(true); int bSystemQueryReady = dbrm.getSystemQueryReady(); @@ -4229,7 +4011,6 @@ int ha_mcs_impl_group_by_init(mcs_handler_info* handler_info, TABLE* table) return ER_INTERNAL_ERROR; } -#endif uint32_t sessionID = tid2sid(thd->thread_id); boost::shared_ptr csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); @@ -4902,7 +4683,6 @@ int ha_mcs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table, bool bool err = false; // check whether the system is ready to process statement. -#ifndef _MSC_VER static DBRM dbrm(true); int bSystemQueryReady = dbrm.getSystemQueryReady(); @@ -4918,7 +4698,6 @@ int ha_mcs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table, bool setError(thd, ER_INTERNAL_ERROR, "DBRM is not responding. Cannot accept queries"); return ER_INTERNAL_ERROR; } -#endif // Set this to close all outstanding FEP connections on // client disconnect in handlerton::closecon_handlerton(). diff --git a/dbcon/mysql/ha_mcs_impl_if.h b/dbcon/mysql/ha_mcs_impl_if.h index 470f98d87a..fa47159b6b 100644 --- a/dbcon/mysql/ha_mcs_impl_if.h +++ b/dbcon/mysql/ha_mcs_impl_if.h @@ -21,11 +21,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include #include #include @@ -366,14 +362,6 @@ struct cal_connection_info pid_t mysqld_pid; pid_t cpimport_pid; int fdt[2]; -#ifdef _MSC_VER - // Used for launching cpimport for Load Data Infile - HANDLE cpimport_stdin_Rd; - HANDLE cpimport_stdin_Wr; - HANDLE cpimport_stdout_Rd; - HANDLE cpimport_stdout_Wr; - PROCESS_INFORMATION cpimportProcInfo; -#endif FILE* filePtr; uint8_t headerLength; bool useXbit; diff --git a/dbcon/mysql/ha_mcs_partition.cpp b/dbcon/mysql/ha_mcs_partition.cpp index 963064ed66..2c1efadc46 100644 --- a/dbcon/mysql/ha_mcs_partition.cpp +++ b/dbcon/mysql/ha_mcs_partition.cpp @@ -546,9 +546,6 @@ extern "C" * CalShowPartitions */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calshowpartitions_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count < 2 || args->arg_count > 3 || args->arg_type[0] != STRING_RESULT || @@ -570,17 +567,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calshowpartitions_deinit(UDF_INIT* initid) { delete initid->ptr; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calshowpartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -710,9 +701,6 @@ extern "C" * CalDisablePartitions */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool caldisablepartitions_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { bool err = false; @@ -747,9 +735,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* caldisablepartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -787,9 +772,6 @@ extern "C" return result; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void caldisablepartitions_deinit(UDF_INIT* initid) { } @@ -798,9 +780,6 @@ extern "C" * CalEnablePartitions */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calenablepartitions_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { bool err = false; @@ -835,9 +814,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calenablepartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -875,9 +851,6 @@ extern "C" return result; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calenablepartitions_deinit(UDF_INIT* initid) { } @@ -886,9 +859,6 @@ extern "C" * CalDropPartitions */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool caldroppartitions_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { bool err = false; @@ -923,9 +893,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* caldroppartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -963,9 +930,6 @@ extern "C" return result; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void caldroppartitions_deinit(UDF_INIT* initid) { } @@ -974,16 +938,10 @@ extern "C" * CalDropPartitionsByValue */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif void caldroppartitionsbyvalue_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool caldroppartitionsbyvalue_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { bool err = false; @@ -1021,9 +979,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* caldroppartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -1050,16 +1005,10 @@ extern "C" * CalDisablePartitionsByValue */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif void caldisablepartitionsbyvalue_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool caldisablepartitionsbyvalue_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { bool err = false; @@ -1093,9 +1042,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* caldisablepartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -1121,16 +1067,10 @@ extern "C" /** * CalEnablePartitionsByValue */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calenablepartitionsbyvalue_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calenablepartitionsbyvalue_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { bool err = false; @@ -1164,9 +1104,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calenablepartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -1192,9 +1129,6 @@ extern "C" /** * CalShowPartitionsByValue */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool calshowpartitionsbyvalue_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { bool err = false; @@ -1228,17 +1162,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void calshowpartitionsbyvalue_deinit(UDF_INIT* initid) { delete initid->ptr; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* calshowpartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { diff --git a/dbcon/mysql/ha_mcs_udf.cpp b/dbcon/mysql/ha_mcs_udf.cpp index d28fd7cbd2..737d93df4e 100644 --- a/dbcon/mysql/ha_mcs_udf.cpp +++ b/dbcon/mysql/ha_mcs_udf.cpp @@ -21,11 +21,7 @@ */ #include -#ifdef _MSC_VER -#include -#else #include -#endif using namespace std; #include "idb_mysql.h" diff --git a/dbcon/mysql/ha_pseudocolumn.cpp b/dbcon/mysql/ha_pseudocolumn.cpp index 488113289a..04afbd39c1 100644 --- a/dbcon/mysql/ha_pseudocolumn.cpp +++ b/dbcon/mysql/ha_pseudocolumn.cpp @@ -79,9 +79,6 @@ extern "C" /** * IDBDBROOT */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbdbroot_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -93,16 +90,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbdbroot_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long idbdbroot(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { bailout(error, "idbdbroot"); @@ -113,9 +104,6 @@ extern "C" * IDBPM */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbpm_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -127,16 +115,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbpm_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long idbpm(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { bailout(error, "idbpm"); @@ -147,9 +129,6 @@ extern "C" * IDBEXTENTRELATIVERID */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbextentrelativerid_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -161,16 +140,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbextentrelativerid_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long idbextentrelativerid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { bailout(error, "idbextentrelativerid"); @@ -181,9 +154,6 @@ extern "C" * IDBBLOCKID */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbblockid_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -195,16 +165,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbblockid_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long idbblockid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { bailout(error, "idbblockid"); @@ -215,9 +179,6 @@ extern "C" * IDBEXTENTID */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbextentid_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -229,16 +190,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbextentid_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long idbextentid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { bailout(error, "idbextentid"); @@ -249,9 +204,6 @@ extern "C" * IDBSEGMENT */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbsegment_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -263,16 +215,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbsegment_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long idbsegment(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { bailout(error, "idbsegment"); @@ -283,9 +229,6 @@ extern "C" * IDBSEGMENTDIR */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbsegmentdir_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -297,16 +240,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbsegmentdir_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long idbsegmentdir(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { bailout(error, "idbsegmentdir"); @@ -317,9 +254,6 @@ extern "C" * IDBPARTITION */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbpartition_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -331,16 +265,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbpartition_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* idbpartition(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -352,9 +280,6 @@ extern "C" * IDBEXTENTMIN */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbextentmin_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -367,16 +292,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbextentmin_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* idbextentmin(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -388,9 +307,6 @@ extern "C" * IDBEXTENTMAX */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idbextentmax_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -403,16 +319,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idbextentmax_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif const char* idbextentmax(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length, char* is_null, char* error) { @@ -424,9 +334,6 @@ extern "C" * IDBLOCALPM */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool idblocalpm_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 0) @@ -439,16 +346,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void idblocalpm_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long idblocalpm(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { longlong localpm = idblocalpm(); diff --git a/dbcon/mysql/idb_mysql.h b/dbcon/mysql/idb_mysql.h index 6798e6fca9..812c049b06 100644 --- a/dbcon/mysql/idb_mysql.h +++ b/dbcon/mysql/idb_mysql.h @@ -24,13 +24,6 @@ #error mcsconfig.h was included before idb_mysql.h #endif -#ifdef _MSC_VER -#include -#if _MSC_VER >= 1800 -template -bool isnan(T); -#endif -#endif //#define INFINIDB_DEBUG //#define DEBUG_WALK_COND @@ -41,14 +34,12 @@ bool isnan(T); #undef LOG_INFO #ifdef _DEBUG -#ifndef _MSC_VER #ifndef SAFE_MUTEX #define SAFE_MUTEX #endif #ifndef SAFEMALLOC #define SAFEMALLOC #endif -#endif #ifndef ENABLED_DEBUG_SYNC #define ENABLED_DEBUG_SYNC #endif @@ -62,13 +53,6 @@ bool isnan(T); #undef DBUG_ON #define DBUG_OFF 1 #endif -#ifdef _MSC_VER -#define MYSQL_DYNAMIC_PLUGIN -#define DONT_DEFINE_VOID -#ifdef ETIMEDOUT -#undef ETIMEDOUT -#endif -#endif #include "sql_plugin.h" #include "sql_table.h" diff --git a/dbcon/mysql/sm.cpp b/dbcon/mysql/sm.cpp index a7a3bfa0c8..098b2a655a 100644 --- a/dbcon/mysql/sm.cpp +++ b/dbcon/mysql/sm.cpp @@ -278,11 +278,7 @@ void sighandler(int sig_num) namespace sm { -#ifdef _MSC_VER -const std::string DEFAULT_SAVE_PATH = "C:\\Calpont\\tmp"; -#else const std::string DEFAULT_SAVE_PATH = "/var/tmp"; -#endif status_t tpl_open(tableid_t tableid, cpsm_tplh_t* ntplh, cpsm_conhdl_t* conn_hdl) { @@ -492,9 +488,6 @@ status_t sm_cleanup(cpsm_conhdl_t* conn_hdl) void cpsm_conhdl_t::write(ByteStream bs) { -#ifdef _MSC_VER - exeMgr->write(bs); -#else sighandler_t old_handler = signal(SIGPIPE, sighandler); sigFlag = false; exeMgr->write(bs); @@ -503,7 +496,6 @@ void cpsm_conhdl_t::write(ByteStream bs) if (sigFlag) throw runtime_error("Broken Pipe Error"); -#endif } } diff --git a/dbcon/mysql/sm.h b/dbcon/mysql/sm.h index d483650d9e..06ad59ba26 100644 --- a/dbcon/mysql/sm.h +++ b/dbcon/mysql/sm.h @@ -39,11 +39,7 @@ #define IDB_SM_DEBUG 0 #define IDB_SM_PROFILE 0 -#if defined(_MSC_VER) && defined(xxxDLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif #if IDB_SM_PROFILE #include diff --git a/ddlproc/ddlproc.cpp b/ddlproc/ddlproc.cpp index 288fd29848..4284bf43ca 100644 --- a/ddlproc/ddlproc.cpp +++ b/ddlproc/ddlproc.cpp @@ -155,7 +155,6 @@ void added_a_pm(int) void ServiceDDLProc::setupChildSignalHandlers() { -#ifndef _MSC_VER /* set up some signal handlers */ struct sigaction ign; memset(&ign, 0, sizeof(ign)); @@ -168,7 +167,6 @@ void ServiceDDLProc::setupChildSignalHandlers() sigaction(SIGSEGV, &ign, 0); sigaction(SIGABRT, &ign, 0); sigaction(SIGFPE, &ign, 0); -#endif } int ServiceDDLProc::Child() @@ -187,11 +185,6 @@ int ServiceDDLProc::Child() } WriteEngine::WriteEngineWrapper::init(WriteEngine::SUBSYSTEM_ID_DDLPROC); -#ifdef _MSC_VER - // In windows, initializing the wrapper (A dll) does not set the static variables - // in the main program - idbdatafile::IDBPolicy::configIDBPolicy(); -#endif ResourceManager* rm = ResourceManager::instance(); Dec = DistributedEngineComm::instance(rm); diff --git a/ddlproc/ddlprocessor.cpp b/ddlproc/ddlprocessor.cpp index cca42af18b..292e7e87a7 100644 --- a/ddlproc/ddlprocessor.cpp +++ b/ddlproc/ddlprocessor.cpp @@ -185,9 +185,6 @@ class PackageHandler { for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; // cout << "session " << fSessionID << " nanosleep on package type " << (int)packageType << @@ -198,7 +195,6 @@ class PackageHandler abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif anyOtherActiveTransaction = sessionManager.checkActiveTransaction(fSessionID, bIsDbrmUp, blockingsid); diff --git a/dmlproc/batchinsertprocessor.cpp b/dmlproc/batchinsertprocessor.cpp index 4830741791..785a31225a 100644 --- a/dmlproc/batchinsertprocessor.cpp +++ b/dmlproc/batchinsertprocessor.cpp @@ -129,9 +129,6 @@ uint64_t BatchInsertProc::grabTableLock(int32_t sessionId) for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; do @@ -140,7 +137,6 @@ uint64_t BatchInsertProc::grabTableLock(int32_t sessionId) abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif try { diff --git a/dmlproc/dmlproc.cpp b/dmlproc/dmlproc.cpp index fb79ae59fe..407eba0f97 100644 --- a/dmlproc/dmlproc.cpp +++ b/dmlproc/dmlproc.cpp @@ -551,7 +551,6 @@ int8_t setupCwd() void ServiceDMLProc::setupChildSignalHandlers() { -#ifndef _MSC_VER /* set up some signal handlers */ struct sigaction ign; memset(&ign, 0, sizeof(ign)); @@ -565,7 +564,6 @@ void ServiceDMLProc::setupChildSignalHandlers() sigaction(SIGSEGV, &ign, 0); sigaction(SIGABRT, &ign, 0); sigaction(SIGFPE, &ign, 0); -#endif } int ServiceDMLProc::Child() @@ -589,11 +587,6 @@ int ServiceDMLProc::Child() } WriteEngine::WriteEngineWrapper::init(WriteEngine::SUBSYSTEM_ID_DMLPROC); -#ifdef _MSC_VER - // In windows, initializing the wrapper (A dll) does not set the static variables - // in the main program - idbdatafile::IDBPolicy::configIDBPolicy(); -#endif //@Bug 1627 try diff --git a/dmlproc/dmlprocessor.cpp b/dmlproc/dmlprocessor.cpp index 0cc5337a5f..36b16a94c7 100644 --- a/dmlproc/dmlprocessor.cpp +++ b/dmlproc/dmlprocessor.cpp @@ -1340,12 +1340,10 @@ void DMLProcessor::operator()() fConcurrentSupport = false; } -#ifndef _MSC_VER struct sigaction ign; memset(&ign, 0, sizeof(ign)); ign.sa_handler = added_a_pm; sigaction(SIGHUP, &ign, 0); -#endif fEC->Open(); for (;;) @@ -1626,9 +1624,6 @@ void DMLProcessor::operator()() { for (; i < numTries; i++) { -#ifdef _MSC_VER - Sleep(rm_ts.tv_sec * 1000); -#else struct timespec abs_ts; // cout << "session " << sessionID << " nanosleep on package type " << (int)packageType << endl; @@ -1638,7 +1633,6 @@ void DMLProcessor::operator()() abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif anyOtherActiveTransaction = sessionManager.checkActiveTransaction(sessionID, bIsDbrmUp, blockingsid); diff --git a/oam/oamcpp/liboamcpp.cpp b/oam/oamcpp/liboamcpp.cpp index 471535848e..2c9bb395e6 100644 --- a/oam/oamcpp/liboamcpp.cpp +++ b/oam/oamcpp/liboamcpp.cpp @@ -26,23 +26,12 @@ #include #include #include -#if defined(__linux__) #include #include #include #include #include -#elif defined(_MSC_VER) -#elif defined(__FreeBSD__) -#include -#include -#include -#include -#include -#include -#include -#endif #include #include #include @@ -54,9 +43,6 @@ #include "liboamcpp.h" #undef LIBOAM_DLLEXPORT -#ifdef _MSC_VER -#include "idbregistry.h" -#endif #include "mcsconfig.h" #include "installdir.h" #include "dbrm.h" diff --git a/oam/oamcpp/liboamcpp.h b/oam/oamcpp/liboamcpp.h index b4fbd207ba..8ab935b8ea 100644 --- a/oam/oamcpp/liboamcpp.h +++ b/oam/oamcpp/liboamcpp.h @@ -33,10 +33,8 @@ #include #include #include -#ifdef __linux__ #include #include -#endif #include #include @@ -47,11 +45,7 @@ #include "messagequeue.h" -#if defined(_MSC_VER) && defined(xxxLIBOAM_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace oam { diff --git a/oam/oamcpp/oamcache.cpp b/oam/oamcpp/oamcache.cpp index c54b4e0b57..75e80c3432 100644 --- a/oam/oamcpp/oamcache.cpp +++ b/oam/oamcpp/oamcache.cpp @@ -115,10 +115,6 @@ void OamCache::checkReload() moduleIds.clear(); uint32_t i = 0; map pmToConnectionMap; -#ifdef _MSC_VER - moduleIds.push_back(*it); - pmToConnectionMap[*it] = i++; -#else // Restore for Windows when we support multiple PMs while (it != uniquePids.end()) @@ -128,7 +124,6 @@ void OamCache::checkReload() it++; } -#endif dbRootConnectionMap.reset(new map()); for (i = 0; i < dbroots.size(); i++) diff --git a/oam/oamcpp/oamcache.h b/oam/oamcpp/oamcache.h index f98706f9a9..6fe980f99d 100644 --- a/oam/oamcpp/oamcache.h +++ b/oam/oamcpp/oamcache.h @@ -25,11 +25,7 @@ #include "liboamcpp.h" -#if defined(_MSC_VER) && defined(xxxOAMCACHE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace oam { diff --git a/oamapps/columnstoreSupport/calpontSupport.bat b/oamapps/columnstoreSupport/calpontSupport.bat deleted file mode 100644 index bdab6d727d..0000000000 --- a/oamapps/columnstoreSupport/calpontSupport.bat +++ /dev/null @@ -1,227 +0,0 @@ -@echo off -pushd . -set help= -if "%1" == "-h" (set help=true) -if "%1" == "/h" (set help=true) -if "%1" == "--help" (set help=true) -if "%help%"=="true" ( - echo The Columnstore Support Report creates a report that can be sent to Columnstore - echo for help with field support. There are no options to this command. - set help= - exit /B 0 -) - -echo. -echo Running the Columnstore Support Report, outputting to ColumnstoreSupportReport.txt - -call :func > ColumnstoreSupportReport.txt 2>&1 - -echo. -echo Report finished - -popd -exit /B 0 - -:ErrorExit - -echo. -echo Error - Failed to find Columnstore Install Directory in Windows Registry, Exiting -popd -exit /B 1 - -:func - - setlocal - set key="HKLM\SOFTWARE\Columnstore\Columnstore" - set homeValue=ColumnstoreHome - set configValue=ConfigFile - - for /f "tokens=3,*" %%a in ('reg query %key% /ve 2^>NUL ^| findstr REG_SZ') do ( - set ColumnstoreInstall=%%b - ) - - if "%ColumnstoreInstall%" == "" ( - for /f "tokens=2,*" %%a in ('reg query %key% /ve 2^>NUL ^| findstr REG_SZ') do ( - set ColumnstoreInstall=%%b - ) - ) - - ::error out if can't locate Install Directory - if "%ColumnstoreInstall%" == "" GOTO ErrorExit - -echo ####################################################################### -echo # # -echo # Columnstore Support Report - %date% %time% -echo # # -echo ####################################################################### -echo. -echo. -echo ======================================================================= -echo = Software/Version Report = -echo ======================================================================= -echo. -echo. -echo -- Columnstore Software Version -- -type %ColumnstoreInstall%\etc\ColumnstoreVersion.txt -echo. -echo -- mysql Software Version -- -mysql --user=root -e status -echo. -echo -- Windows Version -- -ver -echo. -echo. -echo ======================================================================= -echo = Status Report = -echo ======================================================================= -echo. -echo. -echo -- Columnstore Process Status -- -echo. - -tasklist /FI "Imagename eq mysqld.exe" -tasklist /FI "Imagename eq controllernode.exe" -tasklist /FI "Imagename eq workernode.exe" -tasklist /FI "Imagename eq PrimProc.exe" -tasklist /FI "Imagename eq ExeMgr.exe" -tasklist /FI "Imagename eq DDLProc.exe" -tasklist /FI "Imagename eq DMLProc.exe" -tasklist /FI "Imagename eq WriteEngineServer.exe" - -echo. -echo. -echo ======================================================================= -echo = Configuration Report = -echo ======================================================================= -echo. -echo -- Windows Columnstore Registry Values -- -echo. - - echo ColumnstoreInstall = %ColumnstoreInstall% - - for /f "tokens=2,*" %%a in ('reg query %key% /v %homeValue% 2^>NUL ^| findstr %homeValue%') do ( - set ColumnstoreHome=%%b - ) - echo ColumnstoreHome = %ColumnstoreHome% - - for /f "tokens=2,*" %%a in ('reg query %key% /v %configValue% 2^>NUL ^| findstr %configValue%') do ( - set ConfigFile=%%b - ) - echo ConfigFile = %ConfigFile% -echo. -echo. -echo -- Columnstore System Configuration Information -- -echo. -cd %ColumnstoreInstall%\bin -for /f "delims=" %%a in ('getConfig.exe DBBC NumBlocksPct') do @echo NumBlocksPct = %%a -for /f "delims=" %%a in ('getConfig.exe HashJoin TotalUmMemory') do @echo TotalUmMemory = %%a -for /f "delims=" %%a in ('getConfig.exe VersionBuffer VersionBufferFileSize') do @echo VersionBufferFileSize = %%a -for /f "delims=" %%a in ('getConfig.exe ExtentMap FilesPerColumnPartition') do @echo FilesPerColumnPartition = %%a -for /f "delims=" %%a in ('getConfig.exe ExtentMap ExtentsPerSegmentFile') do @echo ExtentsPerSegmentFile = %%a -echo. -echo. -echo -- Columnstore System Configuration File -- -echo. -type "%ConfigFile%" -echo. -echo. -echo -- System Process Status -- -echo. -tasklist /v -echo. -echo ======================================================================= -echo = Resource Usage Report = -echo ======================================================================= -echo. -echo -- System Information-- -echo. -systeminfo -echo. -echo -- IP Configuration Information -- -echo. -ipconfig -echo. -echo -- Disk BRM Data files -- -echo. -dir "%ColumnstoreInstall%\dbrm\" -echo. -echo -- View Table Locks -- -echo. -cd %ColumnstoreInstall%\bin\ -viewtablelock.exe -echo. -echo. -echo -- BRM Extent Map -- -echo. -cd %ColumnstoreInstall%\bin\ -editem.exe -i -echo. -echo. -echo ======================================================================= -echo = Log Report = -echo ======================================================================= -echo. -echo -- Columnstore Platform Logs -- -echo. -type "%ColumnstoreInstall%\log\ColumnstoreLog.txt" -echo. -echo. -echo -- Columnstore MySQl log -- -echo. -type "%ColumnstoreInstall%\mysqldb\*.err" -echo. -echo. -echo -- Columnstore Bulk Load Logs -- -echo. -dir "%ColumnstoreInstall%\bulk\data" -echo. -dir "%ColumnstoreInstall%\bulk\log" -echo. -dir "%ColumnstoreInstall%\bulk\job" -echo. -echo -- Check for Errors in Bulk Logs -- -echo. -cd "%ColumnstoreInstall%\bulk\log" -findstr /spin /c:"error" * -findstr /spin /c:"failed" * -cd "%ColumnstoreInstall%\bulk\job" -findstr /spin /c:"error" * -findstr /spin /c:"failed" * -echo. -echo ======================================================================= -echo = DBMS Report = -echo ======================================================================= -echo. -echo -- DBMS Columnstore Mysql Version -- -echo. -mysql --user=root -e status -echo. -echo -- DBMS Mysql Columnstore System Column -- -echo. -mysql --user=root -e "desc columnstoresys.syscolumn" -echo. -echo -- DBMS Mysql Columnstore System Table -- -echo. -mysql --user=root -e "desc columnstoresys.systable" -echo. -echo -- DBMS Mysql Columnstore System Table Data -- -echo. -mysql --user=root -e "select * from columnstoresys.systable" -echo. -echo -- DBMS Mysql Columnstore Databases -- -echo. -mysql --user=root -e "show databases" -echo. -echo -- DBMS Mysql Columnstore variables -- -echo. -mysql --user=root -e "show variables" -echo. -echo -- DBMS Mysql Columnstore config file -- -echo. -type "%ColumnstoreInstall%\my.ini" -echo. -echo -- Active Queries -- - -::cd \Columnstore\genii\oamapps\columnstoreSupport - - diff --git a/primitives/blockcache/blockrequestprocessor.cpp b/primitives/blockcache/blockrequestprocessor.cpp index 573dcf6c21..50b412401e 100644 --- a/primitives/blockcache/blockrequestprocessor.cpp +++ b/primitives/blockcache/blockrequestprocessor.cpp @@ -46,11 +46,7 @@ BlockRequestProcessor::BlockRequestProcessor(uint32_t numBlcks, int thrCount, in config::Config* fConfig = config::Config::makeConfig(); string val = fConfig->getConfig("DBBC", "BRPTracing"); int temp = 0; -#ifdef _MSC_VER - int tid = GetCurrentThreadId(); -#else pthread_t tid = pthread_self(); -#endif if (val.length() > 0) temp = static_cast(config::Config::fromText(val)); @@ -63,11 +59,7 @@ BlockRequestProcessor::BlockRequestProcessor(uint32_t numBlcks, int thrCount, in if (fTrace) { ostringstream brpLogFileName; -#ifdef _MSC_VER - brpLogFileName << "C:/Calpont/log/trace/brp." << tid; -#else brpLogFileName << MCSLOGDIR << "/trace/brp." << tid; -#endif fLogFile.open(brpLogFileName.str().c_str(), ios_base::app | ios_base::ate); } } diff --git a/primitives/blockcache/filebuffermgr.cpp b/primitives/blockcache/filebuffermgr.cpp index fa50a850fd..8ddc3d3f31 100644 --- a/primitives/blockcache/filebuffermgr.cpp +++ b/primitives/blockcache/filebuffermgr.cpp @@ -34,9 +34,7 @@ #include #include -#ifndef _MSC_VER #include -#endif #include "stats.h" #include "configcpp.h" @@ -71,11 +69,7 @@ FileBufferMgr::FileBufferMgr(const uint32_t numBlcks, const uint32_t blkSz, cons fFBPool.reserve(numBlcks); fConfig = Config::makeConfig(); setReportingFrequency(0); -#ifdef _MSC_VER - fLog.open("C:/Calpont/log/trace/bc", ios_base::app | ios_base::ate); -#else fLog.open(string(MCSLOGDIR) + "/trace/bc", ios_base::app | ios_base::ate); -#endif } FileBufferMgr::~FileBufferMgr() @@ -433,21 +427,11 @@ bool FileBufferMgr::find(const HashObject_t& keyFb, void* bufferPtr) bool ret = false; if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(keyFb.lbid, GetCurrentThreadId(), gSession, 'L'); - -#else gPMStatsPtr->markEvent(keyFb.lbid, pthread_self(), gSession, 'L'); -#endif boost::mutex::scoped_lock lk(fWLock); if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(keyFb.lbid, GetCurrentThreadId(), gSession, 'M'); - -#else gPMStatsPtr->markEvent(keyFb.lbid, pthread_self(), gSession, 'M'); -#endif filebuffer_uset_iter_t it = fbSet.find(keyFb); if (fbSet.end() != it) @@ -461,12 +445,7 @@ bool FileBufferMgr::find(const HashObject_t& keyFb, void* bufferPtr) memcpy(bufferPtr, (fFBPool[idx]).getData(), 8192); if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(keyFb.lbid, GetCurrentThreadId(), gSession, 'U'); - -#else gPMStatsPtr->markEvent(keyFb.lbid, pthread_self(), gSession, 'U'); -#endif ret = true; } @@ -484,11 +463,7 @@ uint32_t FileBufferMgr::bulkFind(const BRM::LBID_t* lbids, const BRM::VER_t* ver { for (i = 0; i < count; i++) { -#ifdef _MSC_VER - gPMStatsPtr->markEvent(lbids[i], GetCurrentThreadId(), gSession, 'L'); -#else gPMStatsPtr->markEvent(lbids[i], pthread_self(), gSession, 'L'); -#endif } } @@ -498,11 +473,7 @@ uint32_t FileBufferMgr::bulkFind(const BRM::LBID_t* lbids, const BRM::VER_t* ver { for (i = 0; i < count; i++) { -#ifdef _MSC_VER - gPMStatsPtr->markEvent(lbids[i], GetCurrentThreadId(), gSession, 'M'); -#else gPMStatsPtr->markEvent(lbids[i], pthread_self(), gSession, 'M'); -#endif } } @@ -536,11 +507,7 @@ uint32_t FileBufferMgr::bulkFind(const BRM::LBID_t* lbids, const BRM::VER_t* ver if (gPMProfOn && gPMStatsPtr) { -#ifdef _MSC_VER - gPMStatsPtr->markEvent(lbids[i], GetCurrentThreadId(), gSession, 'U'); -#else gPMStatsPtr->markEvent(lbids[i], pthread_self(), gSession, 'U'); -#endif } } @@ -578,12 +545,7 @@ int FileBufferMgr::insert(const BRM::LBID_t lbid, const BRM::VER_t ver, const ui int ret = 0; if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(lbid, GetCurrentThreadId(), gSession, 'I'); - -#else gPMStatsPtr->markEvent(lbid, pthread_self(), gSession, 'I'); -#endif boost::mutex::scoped_lock lk(fWLock); @@ -612,12 +574,7 @@ int FileBufferMgr::insert(const BRM::LBID_t lbid, const BRM::VER_t ver, const ui { // if it's a duplicate there's nothing to do if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(lbid, GetCurrentThreadId(), gSession, 'D'); - -#else gPMStatsPtr->markEvent(lbid, pthread_self(), gSession, 'D'); -#endif return ret; } @@ -683,12 +640,7 @@ int FileBufferMgr::insert(const BRM::LBID_t lbid, const BRM::VER_t ver, const ui fFBPool[pi].listLoc(fbList.begin()); if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(lbid, GetCurrentThreadId(), gSession, 'J'); - -#else gPMStatsPtr->markEvent(lbid, pthread_self(), gSession, 'J'); -#endif idbassert(fCacheSize <= maxCacheSize()); // idbassert(fCacheSize == fbSet.size()); @@ -800,12 +752,7 @@ int FileBufferMgr::bulkInsert(const vector& ops) const CacheInsert_t& op = ops[i]; if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(op.lbid, GetCurrentThreadId(), gSession, 'I'); - -#else gPMStatsPtr->markEvent(op.lbid, pthread_self(), gSession, 'I'); -#endif HashObject_t fbIndex(op.lbid, op.ver, 0); filebuffer_pair_t pr = fbSet.insert(fbIndex); @@ -813,12 +760,7 @@ int FileBufferMgr::bulkInsert(const vector& ops) if (!pr.second) { if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(op.lbid, GetCurrentThreadId(), gSession, 'D'); - -#else gPMStatsPtr->markEvent(op.lbid, pthread_self(), gSession, 'D'); -#endif continue; } @@ -837,12 +779,7 @@ int FileBufferMgr::bulkInsert(const vector& ops) fFBPool[pi].listLoc(fbList.begin()); if (gPMProfOn && gPMStatsPtr) -#ifdef _MSC_VER - gPMStatsPtr->markEvent(op.lbid, GetCurrentThreadId(), gSession, 'J'); - -#else gPMStatsPtr->markEvent(op.lbid, pthread_self(), gSession, 'J'); -#endif ret++; } if (fReportFrequency) diff --git a/primitives/blockcache/filebuffermgr.h b/primitives/blockcache/filebuffermgr.h index 8af306a5df..20cac5857c 100644 --- a/primitives/blockcache/filebuffermgr.h +++ b/primitives/blockcache/filebuffermgr.h @@ -26,11 +26,7 @@ #include #include #include -#ifndef _MSC_VER #include -#else -#include -#endif #include #include diff --git a/primitives/blockcache/fsutils.cpp b/primitives/blockcache/fsutils.cpp index 5fc3b8052b..940924c6d4 100644 --- a/primitives/blockcache/fsutils.cpp +++ b/primitives/blockcache/fsutils.cpp @@ -48,7 +48,6 @@ const string resolveInDir(const string& dir, const string& name) return ret; idbassert(fs::exists(path)); -#ifndef _MSC_VER if (!fs::is_symlink(path)) return ret; @@ -65,7 +64,6 @@ const string resolveInDir(const string& dir, const string& name) fs::path realpath("/dev"); realpath /= linkname.filename(); ret = realpath.string(); -#endif return ret; } @@ -86,7 +84,6 @@ namespace fsutils const string symname2devname(const string& sympath) { string ret; -#ifndef _MSC_VER typedef boost::tokenizer > tokenizer; boost::char_separator sep("="); tokenizer tokens(sympath, sep); @@ -112,7 +109,6 @@ const string symname2devname(const string& sympath) else if (symtype == "UUID") ret = uuid2dev(symname); -#endif return ret; } diff --git a/primitives/blockcache/iomanager.cpp b/primitives/blockcache/iomanager.cpp index 6dbf314469..4456bc1715 100644 --- a/primitives/blockcache/iomanager.cpp +++ b/primitives/blockcache/iomanager.cpp @@ -32,10 +32,8 @@ #define _FILE_OFFSET_BITS 64 #define _LARGEFILE64_SOURCE -#ifdef __linux__ #include #include -#endif #ifdef BLOCK_SIZE #undef BLOCK_SIZE #endif @@ -50,13 +48,8 @@ #include #include #include -#ifdef _MSC_VER -#include -#include -#else #include #include -#endif #include #include #include @@ -67,11 +60,7 @@ #include #include #include -#ifdef _MSC_VER -typedef int pthread_t; -#else #include -#endif //#define NDEBUG #include @@ -431,13 +420,8 @@ void* thr_popper(ioManager* arg) if (iom->IOTrace()) { -#ifdef _MSC_VER - threadId = GetCurrentThreadId(); - iomLogFileName << "C:/Calpont/log/trace/iom." << threadId; -#else threadId = pthread_self(); iomLogFileName << MCSLOGDIR << "/trace/iom." << threadId; -#endif lFile.open(iomLogFileName.str().c_str(), ios_base::app | ios_base::ate); } @@ -1005,11 +989,7 @@ void* thr_popper(ioManager* arg) if (blocksThisRead > 0 && fdit->second->isCompressed()) { -#ifdef _MSC_VER - unsigned int blen = 4 * 1024 * 1024 + 4; -#else size_t blen = 4 * 1024 * 1024 + 4; -#endif #ifdef IDB_COMP_POC_DEBUG { boost::mutex::scoped_lock lk(primitiveprocessor::compDebugMutex); @@ -1308,11 +1288,7 @@ ioManager::ioManager(FileBufferMgr& fbm, fileBlockRequestQueue& fbrq, int thrCou if (temp > 0) { fFDCacheTrace = true; -#ifdef _MSC_VER - FDTraceFile().open("C:/Calpont/log/trace/fdcache", ios_base::ate | ios_base::app); -#else FDTraceFile().open(string(MCSLOGDIR) + "/trace/fdcache", ios_base::ate | ios_base::app); -#endif } fThreadCount = thrCount; diff --git a/primitives/blockcache/stats.cpp b/primitives/blockcache/stats.cpp index ad5c3a6ed8..22721cf2c7 100644 --- a/primitives/blockcache/stats.cpp +++ b/primitives/blockcache/stats.cpp @@ -22,11 +22,7 @@ #include #include -#ifndef _MSC_VER #include -#else -typedef int pthread_t; -#endif #include #include // #define NDEBUG @@ -58,9 +54,6 @@ void pause_(unsigned delay) rem.tv_sec = 0; rem.tv_nsec = 0; -#ifdef _MSC_VER - Sleep(req.tv_sec * 1000); -#else again: if (nanosleep(&req, &rem) != 0) @@ -70,7 +63,6 @@ void pause_(unsigned delay) goto again; } -#endif } const string timestr() @@ -104,11 +96,7 @@ class TraceFile outName = name; ostringstream oss; -#ifdef _MSC_VER - oss << "C:/Calpont/log/trace/" << outName << '.' << sessionID; -#else oss << MCSLOGDIR << "/trace/" << outName << '.' << sessionID; -#endif oFile.reset(new ofstream()); oFile->open(oss.str().c_str(), ios_base::out | ios_base::ate | ios_base::app); } @@ -185,14 +173,12 @@ class StatMon public: StatMon() { -#ifndef _MSC_VER sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, SIGPIPE); sigaddset(&sigset, SIGUSR1); sigaddset(&sigset, SIGUSR2); pthread_sigmask(SIG_BLOCK, &sigset, 0); -#endif } void operator()() const { diff --git a/primitives/blockcache/stats.h b/primitives/blockcache/stats.h index 61387d73fb..a008521f82 100644 --- a/primitives/blockcache/stats.h +++ b/primitives/blockcache/stats.h @@ -23,12 +23,7 @@ #pragma once -#ifndef _MSC_VER #include -#else -// FIXME: find a portable solution -typedef int pthread_t; -#endif #include #include #include diff --git a/primitives/linux-port/column.cpp b/primitives/linux-port/column.cpp index 83e93fcb77..da4ae6aec9 100644 --- a/primitives/linux-port/column.cpp +++ b/primitives/linux-port/column.cpp @@ -23,10 +23,7 @@ #include #include #include -#ifndef _MSC_VER #include -#else -#endif using namespace std; #include diff --git a/primitives/linux-port/primitiveprocessor.h b/primitives/linux-port/primitiveprocessor.h index 22cb8a1551..062e301b14 100644 --- a/primitives/linux-port/primitiveprocessor.h +++ b/primitives/linux-port/primitiveprocessor.h @@ -27,15 +27,9 @@ #include #include -#ifndef _MSC_VER #include -#else -#include -#endif -#ifdef __linux__ #define POSIX_REGEX -#endif #ifdef POSIX_REGEX #include diff --git a/primitives/primproc/batchprimitiveprocessor.h b/primitives/primproc/batchprimitiveprocessor.h index 59b54818ca..d7c6f1230f 100644 --- a/primitives/primproc/batchprimitiveprocessor.h +++ b/primitives/primproc/batchprimitiveprocessor.h @@ -33,11 +33,7 @@ #include #include #include -#ifndef _MSC_VER #include -#else -#include -#endif #include #include "errorcodes.h" diff --git a/primitives/primproc/bppseeder.cpp b/primitives/primproc/bppseeder.cpp index bdda816f43..48f821c070 100644 --- a/primitives/primproc/bppseeder.cpp +++ b/primitives/primproc/bppseeder.cpp @@ -31,12 +31,8 @@ #include #include -#ifndef _MSC_VER #include #include -#else -typedef int pthread_t; -#endif #include #include "bppseeder.h" @@ -177,7 +173,6 @@ int BPPSeeder::operator()() if (boost::posix_time::second_clock::universal_time() > dieTime) { #if 0 // for debugging -#ifndef _MSC_VER boost::posix_time::ptime pt = boost::posix_time::microsec_clock::local_time(); if (sessionID & 0x80000000) @@ -187,7 +182,6 @@ int BPPSeeder::operator()() cout << "BPPSeeder couldn't find the sessionID/stepID pair. sessionID=" << sessionID << " stepID=" << stepID << pt << endl; -#endif throw logic_error("BPPSeeder couldn't find the sessionID/stepID pair"); #endif return 0; @@ -226,11 +220,7 @@ int BPPSeeder::operator()() if (fTrace) { PTLogsMap_t::iterator it; -#ifdef _MSC_VER - tid = GetCurrentThreadId(); -#else tid = pthread_self(); -#endif // only lock map while inserted objects // once there is an object for each thread @@ -247,11 +237,7 @@ int BPPSeeder::operator()() { ostringstream LogFileName; SPPTLogs_t spof; -#ifdef _MSC_VER - LogFileName << "C:/Calpont/log/trace/pt." << tid; -#else LogFileName << MCSLOGDIR << "/trace/pt." << tid; -#endif spof.reset(new PTLogs_t(gThdCnt, LogFileName.str().c_str())); gThdCnt++; diff --git a/primitives/primproc/bppseeder.h b/primitives/primproc/bppseeder.h index adda29b6a9..f4c35b2c87 100644 --- a/primitives/primproc/bppseeder.h +++ b/primitives/primproc/bppseeder.h @@ -34,11 +34,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include #include "batchprimitiveprocessor.h" diff --git a/primitives/primproc/columncommand.cpp b/primitives/primproc/columncommand.cpp index b922ef1919..fa2a880a7d 100644 --- a/primitives/primproc/columncommand.cpp +++ b/primitives/primproc/columncommand.cpp @@ -49,9 +49,6 @@ using namespace rowgroup; #include "messageids.h" using namespace logging; -#ifdef _MSC_VER -#define llabs labs -#endif namespace primitiveprocessor { diff --git a/primitives/primproc/primitiveserver.cpp b/primitives/primproc/primitiveserver.cpp index 064d326f4b..41730fc250 100644 --- a/primitives/primproc/primitiveserver.cpp +++ b/primitives/primproc/primitiveserver.cpp @@ -36,14 +36,9 @@ #include #include #include -#ifdef _MSC_VER -#include -typedef int pthread_t; -#else #include #include #include -#endif #include using namespace std; @@ -119,9 +114,7 @@ static const char* statsName = {"pm"}; dbbc::Stats* gPMStatsPtr = 0; bool gPMProfOn = false; uint32_t gSession = 0; -#ifndef _MSC_VER dbbc::Stats pmstats(statsName); -#endif oam::OamCache* oamCache = oam::OamCache::makeOamCache(); @@ -130,9 +123,7 @@ namespace primitiveprocessor { BlockRequestProcessor** BRPp; -#ifndef _MSC_VER dbbc::Stats stats; -#endif extern DebugLevel gDebugLevel; BRM::DBRM* brm; int fCacheCount; @@ -214,11 +205,7 @@ void waitForRetry(long count) timespec ts; ts.tv_sec = 5L * count / 10L; ts.tv_nsec = (5L * count % 10L) * 100000000L; -#ifdef _MSC_VER - Sleep(ts.tv_sec * 1000 + ts.tv_nsec / 1000 / 1000); -#else nanosleep(&ts, 0); -#endif } void prefetchBlocks(const uint64_t lbid, const int compType, uint32_t* rCount) @@ -363,7 +350,6 @@ uint32_t loadBlocks(LBID_t* lbids, QueryContext qc, VER_t txn, int compType, uin *blocksWereVersioned = false; -#ifndef _MSC_VER if (LBIDTrace) { @@ -373,7 +359,6 @@ uint32_t loadBlocks(LBID_t* lbids, QueryContext qc, VER_t txn, int compType, uin } } -#endif VER_t* vers = (VER_t*)alloca(blockCount * sizeof(VER_t)); vbFlags = (bool*)alloca(blockCount); vssRCs = (int*)alloca(blockCount * sizeof(int)); @@ -427,12 +412,10 @@ uint32_t loadBlocks(LBID_t* lbids, QueryContext qc, VER_t txn, int compType, uin { prefetchBlocks(lbids[0], compType, &blksRead); -#ifndef _MSC_VER if (fPMProfOn) pmstats.markEvent(lbids[0], (pthread_t)-1, sessionID, 'M'); -#endif /* After the prefetch they're all cached if they are in the same range, so * prune the block list and try getCachedBlocks again first, then fall back * to single-block IO requests if for some reason they aren't. */ @@ -513,12 +496,10 @@ void loadBlock(uint64_t lbid, QueryContext v, uint32_t t, int compType, void* bu uint32_t blksRead = 0; VSSCache::iterator it; -#ifndef _MSC_VER if (LBIDTrace) stats.touchedLBID(lbid, pthread_self(), sessionID); -#endif if (vssCache) { @@ -575,22 +556,13 @@ void loadBlock(uint64_t lbid, QueryContext v, uint32_t t, int compType, void* bu SUMMARY_INFO2("open failed: ", fileNamePtr); char errbuf[80]; string errMsg; -#ifdef __linux__ //#if STRERROR_R_CHAR_P const char* p; if ((p = strerror_r(errCode, errbuf, 80)) != 0) errMsg = p; -#else - int p; - - if ((p = strerror_r(errCode, errbuf, 80)) == 0) - errMsg = errbuf; - -#endif -#ifndef _MSC_VER if (errCode == EINVAL) { @@ -598,7 +570,6 @@ void loadBlock(uint64_t lbid, QueryContext v, uint32_t t, int compType, void* bu logging::ERR_O_DIRECT); } -#endif string errStr(fileNamePtr); errStr += ": open: "; errStr += errMsg; @@ -840,12 +811,10 @@ void loadBlock(uint64_t lbid, QueryContext v, uint32_t t, int compType, void* bu { prefetchBlocks(lbid, compType, &blksRead); -#ifndef _MSC_VER if (fPMProfOn) pmstats.markEvent(lbid, (pthread_t)-1, sessionID, 'M'); -#endif bc.getBlock(lbid, v, txn, compType, (uint8_t*)bufferPtr, flg, wasBlockInCache); if (!wasBlockInCache) diff --git a/primitives/primproc/primitiveserver.h b/primitives/primproc/primitiveserver.h index 79c1e20ef0..1e9980a804 100644 --- a/primitives/primproc/primitiveserver.h +++ b/primitives/primproc/primitiveserver.h @@ -25,14 +25,9 @@ #pragma once #include -#ifdef _MSC_VER -#include -#include -#else #include #include #include -#endif #include #include "threadpool.h" diff --git a/primitives/primproc/primproc.cpp b/primitives/primproc/primproc.cpp index b736f75451..d60564f8aa 100644 --- a/primitives/primproc/primproc.cpp +++ b/primitives/primproc/primproc.cpp @@ -113,7 +113,6 @@ int toInt(const string& val) void setupSignalHandlers() { -#ifndef _MSC_VER struct sigaction ign; memset(&ign, 0, sizeof(ign)); ign.sa_handler = SIG_IGN; @@ -126,7 +125,6 @@ void setupSignalHandlers() sigaddset(&sigset, SIGUSR2); sigprocmask(SIG_BLOCK, &sigset, 0); -#endif } int8_t setupCwd(Config* cf) @@ -146,7 +144,6 @@ int8_t setupCwd(Config* cf) int setupResources() { -#ifndef _MSC_VER struct rlimit rlim; if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) @@ -171,7 +168,6 @@ int setupResources() return -4; } -#endif return 0; } @@ -225,9 +221,7 @@ class QszMonThd }; #endif -#ifndef _MSC_VER #define DUMP_CACHE_CONTENTS -#endif #ifdef DUMP_CACHE_CONTENTS void* waitForSIGUSR1(void* p) { @@ -238,7 +232,6 @@ void* waitForSIGUSR1(void* p) #else int cacheCount = reinterpret_cast(p); #endif -#ifndef _MSC_VER sigset_t oset; int rec_sig; int32_t rpt_state = 0; @@ -250,7 +243,6 @@ void* waitForSIGUSR1(void* p) sigemptyset(&oset); sigaddset(&oset, SIGUSR1); sigaddset(&oset, SIGUSR2); -#endif for (;;) { @@ -467,27 +459,6 @@ int ServicePrimProc::Child() string strBlockPct = cf->getConfig(dbbc, "NumBlocksPct"); temp = atoi(strBlockPct.c_str()); -#ifdef _MSC_VER - /* TODO: implement handling for the 'm' or 'g' chars in NumBlocksPct */ - if (temp > 0) - BRPBlocksPct = temp; - - MEMORYSTATUSEX memStat; - memStat.dwLength = sizeof(memStat); - - if (GlobalMemoryStatusEx(&memStat) == 0) - // FIXME: Assume 2GB? - BRPBlocks = 2621 * BRPBlocksPct; - else - { -#ifndef _WIN64 - memStat.ullTotalPhys = std::min(memStat.ullTotalVirtual, memStat.ullTotalPhys); -#endif - // We now have the total phys mem in bytes - BRPBlocks = memStat.ullTotalPhys / (8 * 1024) / 100 * BRPBlocksPct; - } - -#else bool absCache = false; if (temp > 0) { @@ -505,7 +476,6 @@ int ServicePrimProc::Child() BRPBlocks = BRPBlocksPct / 8192; else BRPBlocks = ((BRPBlocksPct / 100.0) * (double)cg.getTotalMemory()) / 8192; -#endif #if 0 temp = toInt(cf->getConfig(dbbc, "NumThreads")); @@ -591,11 +561,7 @@ int ServicePrimProc::Child() if (priority < -20) priority = -20; -#ifdef _MSC_VER - // FIXME: -#else setpriority(PRIO_PROCESS, 0, priority); -#endif //..Instantiate UmSocketSelector singleton. Disable rotating destination //..selection if no UM IP addresses are in the Calpo67108864LLnt.xml file. UmSocketSelector* pUmSocketSelector = UmSocketSelector::instance(); @@ -667,7 +633,6 @@ int ServicePrimProc::Child() if (temp > 0) BRPThreads = temp; -#ifndef _MSC_VER // @bug4598, switch for O_DIRECT to support gluster fs. // directIOFlag == O_DIRECT, by default strVal = cf->getConfig(primitiveServers, "DirectIO"); @@ -675,7 +640,6 @@ int ServicePrimProc::Child() if ((strVal == "n") || (strVal == "N")) directIOFlag = 0; -#endif IDBPolicy::configIDBPolicy(); @@ -698,11 +662,7 @@ int ServicePrimProc::Child() if (gDebugLevel >= STATS) { -#ifdef _MSC_VER - ofstream* qszLog = new ofstream("C:/Calpont/log/trace/ppqsz.dat"); -#else ofstream* qszLog = new ofstream("/var/log/mariadb/columnstore/trace/ppqsz.dat"); -#endif if (!qszLog->good()) { diff --git a/primitives/primproc/udf.cpp b/primitives/primproc/udf.cpp index 188e5128ab..af017404a3 100644 --- a/primitives/primproc/udf.cpp +++ b/primitives/primproc/udf.cpp @@ -17,9 +17,7 @@ // $Id: udf.cpp 2035 2013-01-21 14:12:19Z rdempsey $ -#ifndef _MSC_VER #include -#endif #include #include #include @@ -37,7 +35,6 @@ namespace primitiveprocessor { void loadUDFs() { -#ifndef _MSC_VER int flags = RTLD_NOW; void* libPtr = 0; @@ -65,7 +62,6 @@ void loadUDFs() } cout << "loaded " << UDFFcnMap.size() << " UDF's" << endl; -#endif } } // namespace primitiveprocessor diff --git a/primitives/primproc/umsocketselector.cpp b/primitives/primproc/umsocketselector.cpp index 5cdd5f3830..023836e141 100644 --- a/primitives/primproc/umsocketselector.cpp +++ b/primitives/primproc/umsocketselector.cpp @@ -26,17 +26,8 @@ */ #include "umsocketselector.h" -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#include -#include -#else #include #include -#endif #include #include #include @@ -582,10 +573,8 @@ void UmIPSocketConns::nextIOSocket(SP_UM_IOSOCK& outIos, SP_UM_MUTEX& writeLock) /* static */ char* UmIPSocketConns::nwToString(in_addr_t addr, char* ipString) { in_addr addrStruct = {addr}; -#ifndef _MSC_VER if (!inet_ntop(AF_INET, &addrStruct, ipString, INET_ADDRSTRLEN)) -#endif strcpy(ipString, "unknown"); return ipString; diff --git a/primitives/primproc/umsocketselector.h b/primitives/primproc/umsocketselector.h index e7bb47faeb..63b042b73f 100644 --- a/primitives/primproc/umsocketselector.h +++ b/primitives/primproc/umsocketselector.h @@ -29,18 +29,7 @@ #pragma once -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#include -#include -#include -typedef uint32_t in_addr_t; -#else #include -#endif #include #include #include diff --git a/tools/bincvt/li2bin.cpp b/tools/bincvt/li2bin.cpp index 91bf9c4c02..0cf52e33d0 100644 --- a/tools/bincvt/li2bin.cpp +++ b/tools/bincvt/li2bin.cpp @@ -1,11 +1,5 @@ #include -#ifdef _MSC_VER -#include -#include -#include -#else #include -#endif #include #include #include @@ -17,19 +11,6 @@ using namespace std; #include using namespace boost; -#ifdef _MSC_VER -namespace -{ -inline long long atoll(const char* s) -{ - return _strtoi64(s, 0, 10); -} -inline uint64_t strtoull(const char* s, char** a, int b) -{ - return _strtoi64(s, a, b); -} -} // namespace -#endif // 1|155190|7706|1|17|21168.23|0.04|0.02|N|O|1996-03-13|1996-02-12|1996-03-22|DELIVER IN PERSON|TRUCK|egular // courts above the| @@ -245,9 +226,6 @@ int main(int argc, char** argv) string input; -#ifdef _MSC_VER - _setmode(1, _O_BINARY); -#endif getline(cin, input); diff --git a/tools/clearShm/main.cpp b/tools/clearShm/main.cpp index d31f9a75ef..a056437d66 100644 --- a/tools/clearShm/main.cpp +++ b/tools/clearShm/main.cpp @@ -133,18 +133,6 @@ class ThdFunc int main(int argc, char** argv) { -#ifdef _MSC_VER - const char* envp = getenv("SystemRoot"); - string SystemRoot; - - if (envp && *envp) - SystemRoot = envp; - else - SystemRoot = "C:\\WINDOWS"; - - string tmpEnv = "TMP=" + SystemRoot + "\\Temp"; - _putenv(tmpEnv.c_str()); -#endif int c; opterr = 0; diff --git a/tools/dbbuilder/dbbuilder.cpp b/tools/dbbuilder/dbbuilder.cpp index 36557db2e3..17d3da59e3 100644 --- a/tools/dbbuilder/dbbuilder.cpp +++ b/tools/dbbuilder/dbbuilder.cpp @@ -57,12 +57,10 @@ namespace { int setUp() { -#ifndef _MSC_VER string cmd = "/bin/rm -f " + logFile + " >/dev/null 2>&1"; int rc = system(cmd.c_str()); cmd = "/bin/touch -f " + logFile + " >/dev/null 2>&1"; rc = system(cmd.c_str()); -#endif return rc; } @@ -310,12 +308,7 @@ int main(int argc, char* argv[]) if (canWrite) rc = system(cmd.c_str()); else -#ifdef _MSC_VER - (void)0; - -#else cerr << cmd << endl; -#endif cmd = "save_brm"; diff --git a/tools/idbmeminfo/idbmeminfo.cpp b/tools/idbmeminfo/idbmeminfo.cpp index 03f6c031e2..23e098bc9f 100644 --- a/tools/idbmeminfo/idbmeminfo.cpp +++ b/tools/idbmeminfo/idbmeminfo.cpp @@ -15,12 +15,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#endif #include #include #include @@ -43,24 +37,7 @@ memInfo getMemInfo() size_t memTot; size_t memFree; -#if defined(_MSC_VER) - MEMORYSTATUSEX memStat; - memStat.dwLength = sizeof(memStat); - - if (GlobalMemoryStatusEx(&memStat) == 0) - { - // FIXME: Assume 2GB? - memTot = 2 * 1024 * 1024; - memFree = 0; - } - else - { - // We now have the total phys mem in bytes - memTot = memStat.ullTotalPhys / 1024; - memFree = memStat.ullAvailPhys / 1024; - } - -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) string cmd("sysctl -a | awk '/realmem/ {print int(($2+1023)/1024);} /Free Memory Pages/ {print $NF;}'"); FILE* cmdPipe; char input[80]; @@ -74,7 +51,7 @@ memInfo getMemInfo() input[79] = '\0'; memTot = atoi(input); pclose(cmdPipe); -#elif defined(__linux__) +#else ifstream in("/proc/meminfo"); string input; string x; @@ -92,8 +69,6 @@ memInfo getMemInfo() ss >> x; ss >> memFree; } -#else -#error O/S not supported! #endif // memTot is now in KB, convert to MB diff --git a/tools/qfe/bison-win.cpp b/tools/qfe/bison-win.cpp deleted file mode 100644 index 6e33a83782..0000000000 --- a/tools/qfe/bison-win.cpp +++ /dev/null @@ -1,2032 +0,0 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ -#define yyparse qfeparse -#define yylex qfelex -#define yyerror qfeerror -#define yylval qfelval -#define yychar qfechar -#define yydebug qfedebug -#define yynerrs qfenerrs - -/* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ -#line 1 "qfeparser.ypp" - -#include -#include -#include -using namespace std; - -namespace qfe -{ -extern string DefaultSchema; -} - -int qfeerror(const char* s); -int qfelex(void); - -#include "calpontselectexecutionplan.h" -#include "simplecolumn.h" -#include "calpontsystemcatalog.h" -#include "aggregatecolumn.h" -execplan::CalpontSelectExecutionPlan* ParserCSEP; -boost::shared_ptr ParserCSC; -namespace execplan -{ -class ReturnedColumn; -} - -#include "cseputils.h" - -/* Line 189 of yacc.c */ -#line 111 "bison-win.cpp" - -/* Enabling traces. */ -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -#undef YYERROR_VERBOSE -#define YYERROR_VERBOSE 1 -#else -#define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -#define YYTOKEN_TABLE 0 -#endif - -/* Tokens. */ -#ifndef YYTOKENTYPE -#define YYTOKENTYPE -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype -{ - CHAR_CONST = 258, - RELOP = 259, - LOGICOP = 260, - QFEP_SELECT = 261, - QFEP_FROM = 262, - QFEP_WHERE = 263, - GROUPBY = 264, - OBJNAME = 265, - INT_CONST = 266, - LIMIT = 267, - ORDERBY = 268, - ASC = 269, - DESC = 270, - AS = 271, - FUNC = 272 -}; -#endif - -#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - /* Line 214 of yacc.c */ -#line 31 "qfeparser.ypp" - - execplan::ReturnedColumn* rcp; - std::string* cp; - std::pair* cvp; - - /* Line 214 of yacc.c */ -#line 172 "bison-win.cpp" -} YYSTYPE; -#define YYSTYPE_IS_TRIVIAL 1 -#define yystype YYSTYPE /* obsolescent; will be withdrawn */ -#define YYSTYPE_IS_DECLARED 1 -#endif - -/* Copy the second part of user declarations. */ - -/* Line 264 of yacc.c */ -#line 184 "bison-win.cpp" - -#ifdef short -#undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#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 -#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 yyi) -#else -static int YYID(yyi) int yyi; -#endif -{ - return yyi; -} -#endif - -#if !defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -#ifdef YYSTACK_USE_ALLOCA -#if YYSTACK_USE_ALLOCA -#ifdef __GNUC__ -#define YYSTACK_ALLOC __builtin_alloca -#elif defined __BUILTIN_VA_ARG_INCR -#include /* INFRINGES ON USER NAME SPACE */ -#elif defined _AIX -#define YYSTACK_ALLOC __alloca -#elif defined _MSC_VER -#include /* INFRINGES ON USER NAME SPACE */ -#define alloca _alloca -#else -#define YYSTACK_ALLOC alloca -#if !defined _ALLOCA_H && !defined _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 (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 -#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 */ -#ifndef _STDLIB_H -#define _STDLIB_H 1 -#endif -#endif -#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 */ - -#if (!defined yyoverflow && (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -#define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -#define YYSTACK_BYTES(N) ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -#ifndef YYCOPY -#if defined __GNUC__ && 1 < __GNUC__ -#define YYCOPY(To, From, Count) __builtin_memcpy(To, From, (Count) * sizeof(*(From))) -#else -#define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } while (YYID(0)) -#endif -#endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -#define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof(*yyptr); \ - } while (YYID(0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 12 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 60 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 24 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 22 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 41 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 67 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 272 - -#define YYTRANSLATE(YYX) ((unsigned int)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 20, 21, 2, 2, 19, 2, 22, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 23, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = {0, 0, 3, 13, 15, 19, 21, 23, 28, 31, 32, 35, 38, 39, - 41, 43, 45, 48, 49, 52, 56, 62, 64, 68, 74, 76, 80, 82, - 84, 85, 88, 90, 94, 96, 98, 99, 103, 104, 106, 108, 109, 112}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = { - 25, 0, -1, 6, 26, 7, 32, 35, 40, 43, 45, 18, -1, 29, -1, 26, 19, 29, -1, 37, -1, 28, -1, 17, - 20, 27, 21, -1, 27, 30, -1, -1, 31, 10, -1, 31, 3, -1, -1, 16, -1, 34, -1, 37, -1, 33, 30, -1, - -1, 8, 36, -1, 37, 4, 39, -1, 36, 5, 37, 4, 39, -1, 38, -1, 38, 22, 38, -1, 38, 22, 38, 22, - 38, -1, 10, -1, 23, 10, 23, -1, 3, -1, 11, -1, -1, 9, 41, -1, 42, -1, 41, 19, 42, -1, 37, -1, - 11, -1, -1, 13, 41, 44, -1, -1, 14, -1, 15, -1, -1, 12, 11, -1, 12, 11, 19, 11, -1}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = {0, 55, 55, 63, 69, 77, 87, 90, 98, 102, 103, 108, 116, 117, - 120, 124, 144, 147, 148, 151, 163, 179, 190, 202, 217, 218, 224, 230, - 238, 239, 243, 244, 248, 249, 256, 257, 261, 262, 263, 267, 268, 274}; -#endif - -#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", - "CHAR_CONST", - "RELOP", - "LOGICOP", - "QFEP_SELECT", - "QFEP_FROM", - "QFEP_WHERE", - "GROUPBY", - "OBJNAME", - "INT_CONST", - "LIMIT", - "ORDERBY", - "ASC", - "DESC", - "AS", - "FUNC", - "';'", - "','", - "'('", - "')'", - "'.'", - "'`'", - "$accept", - "statement", - "select_column_list", - "select_column_name", - "func_col", - "aliased_column_name", - "opt_alias", - "opt_as", - "table_spec", - "table_name", - "aliased_table_name", - "opt_where_clause", - "filter_predicate_list", - "obj_name", - "obj_name_aux", - "constant", - "opt_groupby_clause", - "groupby_items_list", - "groupby_item", - "opt_orderby_clause", - "opt_direction", - "opt_limit_clause", - 0}; -#endif - -#ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = {0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 59, 44, 40, 41, 46, 96}; -#endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = {0, 24, 25, 26, 26, 27, 27, 28, 29, 30, 30, 30, 31, 31, - 32, 33, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, - 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 44, 45, 45, 45}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = {0, 2, 9, 1, 3, 1, 1, 4, 2, 0, 2, 2, 0, 1, 1, 1, 2, 0, 2, 3, 5, - 1, 3, 5, 1, 3, 1, 1, 0, 2, 1, 3, 1, 1, 0, 3, 0, 1, 1, 0, 2, 4}; - -/* 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 yytype_uint8 yydefact[] = {0, 0, 0, 24, 0, 0, 0, 9, 6, 3, 5, 21, 1, 0, 0, 0, 0, - 13, 8, 0, 0, 0, 25, 17, 9, 14, 15, 4, 11, 10, 22, 7, 0, 28, - 16, 0, 18, 0, 0, 34, 23, 0, 0, 33, 32, 29, 30, 0, 39, 0, 26, - 27, 19, 0, 36, 0, 0, 0, 31, 37, 38, 35, 40, 2, 20, 0, 41}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = {-1, 2, 6, 7, 8, 9, 18, 19, 23, 24, 25, - 33, 36, 10, 11, 52, 39, 45, 46, 48, 61, 56}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -20 -static const yytype_int8 yypact[] = {8, -8, 4, -20, 5, 17, 3, 2, -20, -20, -20, 9, -20, -8, - 1, -2, -8, -20, -20, 10, -2, 13, -20, 22, 2, -20, -20, -20, - -20, -20, 15, -20, -2, 26, -20, -2, 31, 35, -4, 27, -20, -2, - 0, -20, -20, 23, -20, -4, 29, 39, -20, -20, -20, -4, 14, 33, - 28, 0, -20, -20, -20, -20, 30, -20, -20, 34, -20}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = {-20, -20, -20, 37, -20, 32, 36, -20, -20, -20, -20, - -20, -20, -15, -19, -10, -20, 6, -1, -20, -20, -20}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -13 -static const yytype_int8 yytable[] = {26, 30, 3, 50, 12, -12, 3, 43, 3, 4, 15, 51, -12, 28, 1, 5, - 40, 37, 17, 5, 29, 5, 16, 44, 22, 13, 49, 14, 59, 60, 32, 20, - 44, 53, 31, 38, 41, 35, 44, 42, 47, 55, 53, 57, 62, 66, 63, 64, - 27, 65, 21, 0, 58, 54, 0, 0, 0, 0, 0, 0, 34}; - -static const yytype_int8 yycheck[] = {15, 20, 10, 3, 0, 3, 10, 11, 10, 17, 7, 11, 10, 3, 6, 23, - 35, 32, 16, 23, 10, 23, 19, 38, 23, 20, 41, 10, 14, 15, 8, 22, - 47, 19, 21, 9, 5, 22, 53, 4, 13, 12, 19, 4, 11, 11, 18, 57, - 16, 19, 13, -1, 53, 47, -1, -1, -1, -1, -1, -1, 24}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = {0, 6, 25, 10, 17, 23, 26, 27, 28, 29, 37, 38, 0, 20, 10, 7, 19, - 16, 30, 31, 22, 27, 23, 32, 33, 34, 37, 29, 3, 10, 38, 21, 8, 35, - 30, 22, 36, 37, 9, 40, 38, 5, 4, 11, 37, 41, 42, 13, 43, 37, 3, - 11, 39, 19, 41, 12, 45, 4, 42, 14, 15, 44, 11, 18, 39, 19, 11}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE(yychar); \ - YYPOPSTACK(1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror(YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (YYID(0)) - -#define YYTERROR 1 -#define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -#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 -#define YYLEX yylex(YYLEX_PARAM) -#else -#define YYLEX yylex() -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -#ifndef YYFPRINTF -#include /* INFRINGES ON USER NAME SPACE */ -#define YYFPRINTF fprintf -#endif - -#define YYDPRINTF(Args) \ - do \ - { \ - if (yydebug) \ - YYFPRINTF Args; \ - } while (YYID(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)) - -/*--------------------------------. -| 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 __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yy_stack_print(yytype_int16* yybottom, yytype_int16* yytop) -#else -static void yy_stack_print(yybottom, yytop) yytype_int16* yybottom; -yytype_int16* yytop; -#endif -{ - YYFPRINTF(stderr, "Stack now"); - - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF(stderr, " %d", yybot); - } - - YYFPRINTF(stderr, "\n"); -} - -#define YY_STACK_PRINT(Bottom, Top) \ - do \ - { \ - if (yydebug) \ - yy_stack_print((Bottom), (Top)); \ - } while (YYID(0)) - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yy_reduce_print(YYSTYPE* yyvsp, int yyrule) -#else -static void yy_reduce_print(yyvsp, yyrule) YYSTYPE* yyvsp; -int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - 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++) - { - YYFPRINTF(stderr, " $%d = ", yyi + 1); - yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)])); - YYFPRINTF(stderr, "\n"); - } -} - -#define YY_REDUCE_PRINT(Rule) \ - do \ - { \ - if (yydebug) \ - 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 YY_SYMBOL_PRINT(Title, Type, Value, Location) -#define YY_STACK_PRINT(Bottom, Top) -#define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -#if YYERROR_VERBOSE - -#ifndef yystrlen -#if defined __GLIBC__ && defined _STRING_H -#define yystrlen strlen -#else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T yystrlen(const char* yystr) -#else -static YYSIZE_T yystrlen(yystr) const char* yystr; -#endif -{ - YYSIZE_T yylen; - - for (yylen = 0; yystr[yylen]; yylen++) - continue; - - return yylen; -} -#endif -#endif - -#ifndef yystpcpy -#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -#define yystpcpy stpcpy -#else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static char* yystpcpy(char* yydest, const char* yysrc) -#else -static char* yystpcpy(yydest, yysrc) char* yydest; -const char* yysrc; -#endif -{ - char* yyd = yydest; - const char* yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -#endif -#endif - -#ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T yytnamerr(char* yyres, const char* yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const* yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - - return yyn; - } - - do_not_strip_quotes:; - } - - if (!yyres) - return yystrlen(yystr); - - return yystpcpy(yyres, yystr) - yyres; -} -#endif - -/* Copy into 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) -{ - int yyn = yypact[yystate]; - - if (!(YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - 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 - 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; - - /* 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; - } -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void yydestruct(const char* yymsg, int yytype, YYSTYPE* yyvaluep) -#else -static void yydestruct(yymsg, yytype, yyvaluep) const char* yymsg; -int yytype; -YYSTYPE* yyvaluep; -#endif -{ - YYUSE(yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - - YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - case 3: /* "CHAR_CONST" */ - - /* Line 1000 of yacc.c */ -#line 49 "qfeparser.ypp" - { - delete (yyvaluep->cp); - }; - - /* Line 1000 of yacc.c */ -#line 1138 "bison-win.cpp" - break; - case 4: /* "RELOP" */ - - /* Line 1000 of yacc.c */ -#line 49 "qfeparser.ypp" - { - delete (yyvaluep->cp); - }; - - /* Line 1000 of yacc.c */ -#line 1147 "bison-win.cpp" - break; - case 5: /* "LOGICOP" */ - - /* Line 1000 of yacc.c */ -#line 49 "qfeparser.ypp" - { - delete (yyvaluep->cp); - }; - - /* Line 1000 of yacc.c */ -#line 1156 "bison-win.cpp" - break; - case 10: /* "OBJNAME" */ - - /* Line 1000 of yacc.c */ -#line 49 "qfeparser.ypp" - { - delete (yyvaluep->cp); - }; - - /* Line 1000 of yacc.c */ -#line 1165 "bison-win.cpp" - break; - case 11: /* "INT_CONST" */ - - /* Line 1000 of yacc.c */ -#line 49 "qfeparser.ypp" - { - delete (yyvaluep->cp); - }; - - /* Line 1000 of yacc.c */ -#line 1174 "bison-win.cpp" - break; - case 16: /* "AS" */ - - /* Line 1000 of yacc.c */ -#line 49 "qfeparser.ypp" - { - delete (yyvaluep->cp); - }; - - /* Line 1000 of yacc.c */ -#line 1183 "bison-win.cpp" - break; - case 17: /* "FUNC" */ - - /* Line 1000 of yacc.c */ -#line 49 "qfeparser.ypp" - { - delete (yyvaluep->cp); - }; - - /* Line 1000 of yacc.c */ -#line 1192 "bison-win.cpp" - break; - case 27: /* "select_column_name" */ - - /* Line 1000 of yacc.c */ -#line 50 "qfeparser.ypp" - { - delete (yyvaluep->rcp); - }; - - /* Line 1000 of yacc.c */ -#line 1201 "bison-win.cpp" - break; - case 28: /* "func_col" */ - - /* Line 1000 of yacc.c */ -#line 50 "qfeparser.ypp" - { - delete (yyvaluep->rcp); - }; - - /* Line 1000 of yacc.c */ -#line 1210 "bison-win.cpp" - break; - case 29: /* "aliased_column_name" */ - - /* Line 1000 of yacc.c */ -#line 50 "qfeparser.ypp" - { - delete (yyvaluep->rcp); - }; - - /* Line 1000 of yacc.c */ -#line 1219 "bison-win.cpp" - break; - case 37: /* "obj_name" */ - - /* Line 1000 of yacc.c */ -#line 50 "qfeparser.ypp" - { - delete (yyvaluep->rcp); - }; - - /* Line 1000 of yacc.c */ -#line 1228 "bison-win.cpp" - break; - case 39: /* "constant" */ - - /* Line 1000 of yacc.c */ -#line 51 "qfeparser.ypp" - { - delete (yyvaluep->cvp); - }; - - /* Line 1000 of yacc.c */ -#line 1237 "bison-win.cpp" - break; - case 42: /* "groupby_item" */ - - /* Line 1000 of yacc.c */ -#line 50 "qfeparser.ypp" - { - delete (yyvaluep->rcp); - }; - - /* Line 1000 of yacc.c */ -#line 1246 "bison-win.cpp" - break; - - default: break; - } -} - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse(void* YYPARSE_PARAM); -#else -int yyparse(); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse(void); -#else -int yyparse(); -#endif -#endif /* ! YYPARSE_PARAM */ - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - -#ifdef YYPARSE_PARAM -#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 __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -int yyparse(void) -#else -int yyparse() - -#endif -#endif -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16* yyss; - yytype_int16* yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE* yyvs; - YYSTYPE* yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char* yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - - /*------------------------------------------------------------. - | yynewstate -- Push a new state, which is found in yystate. | - `------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - -yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE* yyvs1 = yyvs; - yytype_int16* yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow(YY_("memory exhausted"), &yyss1, yysize * sizeof(*yyssp), &yyvs1, yysize * sizeof(*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -#ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - - yystacksize *= 2; - - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16* yyss1 = yyss; - union yyalloc* yyptr = (union yyalloc*)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize)); - - if (!yyptr) - goto yyexhaustedlab; - - YYSTACK_RELOCATE(yyss_alloc, yyss); - YYSTACK_RELOCATE(yyvs_alloc, yyvs); -#undef YYSTACK_RELOCATE - - if (yyss1 != yyssa) - YYSTACK_FREE(yyss1); - } -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF((stderr, "Stack size increased to %lu\n", (unsigned long int)yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - /*-----------. - | yybackup. | - `-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE(yychar); - YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - - yyn = yytable[yyn]; - - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - - if (yyn == 0) - goto yyerrlab; - - goto yyreduce; - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1 - yylen]; - - YY_REDUCE_PRINT(yyn); - - switch (yyn) - { - case 3: - - /* Line 1455 of yacc.c */ -#line 64 "qfeparser.ypp" - { - execplan::SRCP rcp((yyvsp[(1) - (1)].rcp)); - ParserCSEP->returnedCols().push_back(rcp); - (yyval.cp) = 0; - ; - } - break; - - case 4: - - /* Line 1455 of yacc.c */ -#line 70 "qfeparser.ypp" - { - execplan::SRCP rcp((yyvsp[(3) - (3)].rcp)); - ParserCSEP->returnedCols().push_back(rcp); - (yyval.cp) = 0; - ; - } - break; - - case 5: - - /* Line 1455 of yacc.c */ -#line 78 "qfeparser.ypp" - { - execplan::SimpleColumn* sc = dynamic_cast((yyvsp[(1) - (1)].rcp)); - - if (sc->schemaName() == "infinidb_unknown" && !qfe::DefaultSchema.empty()) - sc->schemaName(qfe::DefaultSchema); - - sc->setOID(); - sc->tableAlias(sc->tableName()); - sc->alias(execplan::make_tcn(sc->schemaName(), sc->tableName(), sc->columnName()).toString()); - (yyval.rcp) = (yyvsp[(1) - (1)].rcp); - ; - } - break; - - case 7: - - /* Line 1455 of yacc.c */ -#line 91 "qfeparser.ypp" - { - execplan::AggregateColumn* ag = new execplan::AggregateColumn( - execplan::AggregateColumn::agname2num(*((yyvsp[(1) - (4)].cp))), (yyvsp[(3) - (4)].rcp)); - delete (yyvsp[(1) - (4)].cp); - (yyval.rcp) = ag; - ; - } - break; - - case 9: - - /* Line 1455 of yacc.c */ -#line 102 "qfeparser.ypp" - { - (yyval.cp) = 0; - ; - } - break; - - case 10: - - /* Line 1455 of yacc.c */ -#line 104 "qfeparser.ypp" - { - delete (yyvsp[(2) - (2)].cp); - (yyval.cp) = (yyvsp[(1) - (2)].cp); - ; - } - break; - - case 11: - - /* Line 1455 of yacc.c */ -#line 109 "qfeparser.ypp" - { - delete (yyvsp[(2) - (2)].cp); - (yyval.cp) = (yyvsp[(1) - (2)].cp); - ; - } - break; - - case 12: - - /* Line 1455 of yacc.c */ -#line 116 "qfeparser.ypp" - { - (yyval.cp) = 0; - ; - } - break; - - case 15: - - /* Line 1455 of yacc.c */ -#line 125 "qfeparser.ypp" - { - execplan::SimpleColumn* sc = 0; - sc = dynamic_cast((yyvsp[(1) - (1)].rcp)); - execplan::CalpontSystemCatalog::TableAliasName tan; - tan.schema = sc->tableName(); - - if (tan.schema == "infinidb_unknown" && !qfe::DefaultSchema.empty()) - tan.schema = qfe::DefaultSchema; - - if (qfe::DefaultSchema.empty()) - qfe::DefaultSchema = tan.schema; - - tan.table = sc->columnName(); - tan.alias = tan.table; - execplan::CalpontSelectExecutionPlan::TableList tl; - tl.push_back(tan); - ParserCSEP->tableList(tl); - delete sc; - (yyval.cp) = 0; - ; - } - break; - - case 19: - - /* Line 1455 of yacc.c */ -#line 152 "qfeparser.ypp" - { - pair cval = *((yyvsp[(3) - (3)].cvp)); - delete (yyvsp[(3) - (3)].cvp); - execplan::SimpleColumn* sc = 0; - sc = dynamic_cast((yyvsp[(1) - (3)].rcp)); - qfe::utils::updateParseTree(ParserCSC, ParserCSEP, sc, *((yyvsp[(2) - (3)].cp)), cval); - delete sc; - delete (yyvsp[(2) - (3)].cp); - (yyval.cp) = 0; - ; - } - break; - - case 20: - - /* Line 1455 of yacc.c */ -#line 164 "qfeparser.ypp" - { - // string logicop = *($2); - delete (yyvsp[(2) - (5)].cp); - pair cval = *((yyvsp[(5) - (5)].cvp)); - delete (yyvsp[(5) - (5)].cvp); - execplan::SimpleColumn* sc = 0; - sc = dynamic_cast((yyvsp[(3) - (5)].rcp)); - qfe::utils::updateParseTree(ParserCSC, ParserCSEP, sc, *((yyvsp[(4) - (5)].cp)), cval); - delete sc; - delete (yyvsp[(4) - (5)].cp); - (yyval.cp) = 0; - ; - } - break; - - case 21: - - /* Line 1455 of yacc.c */ -#line 180 "qfeparser.ypp" - { - // This is possibly a table name, but we shove it into a SimpleColumn. We'll - // fix this in the table_spec production - execplan::SimpleColumn* sc = - new execplan::SimpleColumn("infinidb_unknown", "infinidb_unknown", *((yyvsp[(1) - (1)].cp))); - sc->tableAlias("infinidb_unknown"); - sc->alias( - execplan::make_tcn("infinidb_unknown", "infinidb_unknown", *((yyvsp[(1) - (1)].cp))).toString()); - // cerr << "inside parser: " << *sc << endl; - delete (yyvsp[(1) - (1)].cp); - (yyval.rcp) = sc; - ; - } - break; - - case 22: - - /* Line 1455 of yacc.c */ -#line 191 "qfeparser.ypp" - { - // This is possibly a table name, but we shove it into a SimpleColumn. We'll - // fix this in the table_spec production - execplan::SimpleColumn* sc = - new execplan::SimpleColumn("infinidb_unknown", *((yyvsp[(1) - (3)].cp)), *((yyvsp[(3) - (3)].cp))); - sc->tableAlias(*((yyvsp[(1) - (3)].cp))); - sc->alias(execplan::make_tcn("infinidb_unknown", *((yyvsp[(1) - (3)].cp)), *((yyvsp[(3) - (3)].cp))) - .toString()); - // cerr << "inside parser: " << *sc << endl; - delete (yyvsp[(1) - (3)].cp); - delete (yyvsp[(3) - (3)].cp); - (yyval.rcp) = sc; - ; - } - break; - - case 23: - - /* Line 1455 of yacc.c */ -#line 203 "qfeparser.ypp" - { - if (qfe::DefaultSchema.empty()) - qfe::DefaultSchema = *((yyvsp[(1) - (5)].cp)); - - execplan::SimpleColumn* sc = new execplan::SimpleColumn( - *((yyvsp[(1) - (5)].cp)), *((yyvsp[(3) - (5)].cp)), *((yyvsp[(5) - (5)].cp))); - sc->tableAlias(*((yyvsp[(3) - (5)].cp))); - sc->alias( - execplan::make_tcn(*((yyvsp[(1) - (5)].cp)), *((yyvsp[(3) - (5)].cp)), *((yyvsp[(5) - (5)].cp))) - .toString()); - // cerr << "inside parser: " << *sc << endl; - delete (yyvsp[(1) - (5)].cp); - delete (yyvsp[(3) - (5)].cp); - delete (yyvsp[(5) - (5)].cp); - (yyval.rcp) = sc; - ; - } - break; - - case 25: - - /* Line 1455 of yacc.c */ -#line 219 "qfeparser.ypp" - { - (yyval.cp) = (yyvsp[(2) - (3)].cp); - ; - } - break; - - case 26: - - /* Line 1455 of yacc.c */ -#line 225 "qfeparser.ypp" - { - pair* p = new pair(1, *((yyvsp[(1) - (1)].cp))); - delete (yyvsp[(1) - (1)].cp); - (yyval.cvp) = p; - ; - } - break; - - case 27: - - /* Line 1455 of yacc.c */ -#line 231 "qfeparser.ypp" - { - pair* p = new pair(0, *((yyvsp[(1) - (1)].cp))); - delete (yyvsp[(1) - (1)].cp); - (yyval.cvp) = p; - ; - } - break; - - case 29: - - /* Line 1455 of yacc.c */ -#line 240 "qfeparser.ypp" - { - YYERROR; - ; - } - break; - - case 31: - - /* Line 1455 of yacc.c */ -#line 245 "qfeparser.ypp" - { - delete (yyvsp[(3) - (3)].rcp); - ; - } - break; - - case 33: - - /* Line 1455 of yacc.c */ -#line 250 "qfeparser.ypp" - { - delete (yyvsp[(1) - (1)].cp); - (yyval.rcp) = 0; - ; - } - break; - - case 35: - - /* Line 1455 of yacc.c */ -#line 258 "qfeparser.ypp" - { - YYERROR; - ; - } - break; - - case 39: - - /* Line 1455 of yacc.c */ -#line 267 "qfeparser.ypp" - { - (yyval.cp) = 0; - ; - } - break; - - case 40: - - /* Line 1455 of yacc.c */ -#line 269 "qfeparser.ypp" - { - delete (yyvsp[(2) - (2)].cp); - YYERROR; - (yyval.cp) = 0; - ; - } - break; - - case 41: - - /* Line 1455 of yacc.c */ -#line 275 "qfeparser.ypp" - { - delete (yyvsp[(2) - (4)].cp); - delete (yyvsp[(4) - (4)].cp); - YYERROR; - (yyval.cp) = 0; - ; - } - break; - - /* Line 1455 of yacc.c */ -#line 1835 "bison-win.cpp" - - default: break; - } - - YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK(yylen); - yylen = 0; - YY_STACK_PRINT(yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ -yyerrlab: - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#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 - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - 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 - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* 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; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yydestruct("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK(1); - yystate = *yyssp; - YY_STACK_PRINT(yyss, yyssp); - } - - *++yyvsp = yylval; - - /* Shift the error token. */ - YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE - /*-------------------------------------------------. - | yyexhaustedlab -- memory exhaustion comes here. | - `-------------------------------------------------*/ -yyexhaustedlab: - yyerror(YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - - if (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 -#if YYERROR_VERBOSE - - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); - -#endif - /* Make sure YYID is used. */ - return YYID(yyresult); -} - -/* Line 1675 of yacc.c */ -#line 283 "qfeparser.ypp" - -int qfeerror(const string& s) -{ - extern int qfelineno; // defined and maintained in lex.c - extern char* qfetext; // defined and maintained in lex.c - - cerr << "ERROR: " << s << " at symbol \"" << qfetext; - cerr << "\" on line " << qfelineno << endl; - return -1; -} - -int qfeerror(const char* s) -{ - return qfeerror(string(s)); -} - -string* newstr(const char* cp) -{ - string* strp; - strp = new string(cp); - return strp; -} diff --git a/tools/qfe/bison-win.h b/tools/qfe/bison-win.h deleted file mode 100644 index a0cea349d5..0000000000 --- a/tools/qfe/bison-win.h +++ /dev/null @@ -1,76 +0,0 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#pragma once -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype -{ - CHAR_CONST = 258, - RELOP = 259, - LOGICOP = 260, - QFEP_SELECT = 261, - QFEP_FROM = 262, - QFEP_WHERE = 263, - GROUPBY = 264, - OBJNAME = 265, - INT_CONST = 266, - LIMIT = 267, - ORDERBY = 268, - ASC = 269, - DESC = 270, - AS = 271, - FUNC = 272 -}; -#endif - -#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - /* Line 1676 of yacc.c */ -#line 31 "qfeparser.ypp" - - execplan::ReturnedColumn* rcp; - std::string* cp; - std::pair* cvp; - - /* Line 1676 of yacc.c */ -#line 77 "bison-win.hpp" -} YYSTYPE; -#define YYSTYPE_IS_TRIVIAL 1 -#define yystype YYSTYPE /* obsolescent; will be withdrawn */ -#define YYSTYPE_IS_DECLARED 1 - -extern YYSTYPE qfelval; diff --git a/tools/qfe/cli.cpp b/tools/qfe/cli.cpp index 13ea438c43..032a44b93f 100644 --- a/tools/qfe/cli.cpp +++ b/tools/qfe/cli.cpp @@ -1,19 +1,8 @@ -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#include -#include -#include -#include -#else #include #include #include #include #include -#endif #include #include #include @@ -87,23 +76,11 @@ int main(int argc, char** argv) SockType fd = -1; -#ifdef _MSC_VER - WSAData wsadata; - const WORD minVersion = MAKEWORD(2, 2); - - if (WSAStartup(minVersion, &wsadata) != 0) - cerr << "networking startup error: " << IDBSysErrorStr(WSAGetLastError()) << endl; - -#endif fd = ::socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd < 0) { -#ifdef _MSC_VER - cerr << "socket create error: " << IDBSysErrorStr(WSAGetLastError()) << endl; -#else cerr << "socket create error: " << strerror(errno) << endl; -#endif return 1; } @@ -135,12 +112,7 @@ int main(int argc, char** argv) if (rc < 0) { -#ifdef _MSC_VER - cerr << "socket connect error: " << IDBSysErrorStr(WSAGetLastError()) << endl; - WSACleanup(); -#else cerr << "socket connect error: " << strerror(errno) << endl; -#endif return 1; } @@ -169,12 +141,7 @@ int main(int argc, char** argv) SockWriteFcn(fd, &flag, 4); bailout: ::shutdown(fd, SHUT_RDWR); -#ifdef _MSC_VER - ::closesocket(fd); - WSACleanup(); -#else ::close(fd); -#endif fd = -1; return 0; diff --git a/tools/qfe/lex-win.cpp b/tools/qfe/lex-win.cpp deleted file mode 100644 index 9d9f209011..0000000000 --- a/tools/qfe/lex-win.cpp +++ /dev/null @@ -1,1712 +0,0 @@ -#define yy_create_buffer qfe_create_buffer -#define yy_delete_buffer qfe_delete_buffer -#define yy_scan_buffer qfe_scan_buffer -#define yy_scan_string qfe_scan_string -#define yy_scan_bytes qfe_scan_bytes -#define yy_flex_debug qfe_flex_debug -#define yy_init_buffer qfe_init_buffer -#define yy_flush_buffer qfe_flush_buffer -#define yy_load_buffer_state qfe_load_buffer_state -#define yy_switch_to_buffer qfe_switch_to_buffer -#define yyin qfein -#define yyleng qfeleng -#define yylex qfelex -#define yyout qfeout -#define yyrestart qferestart -#define yytext qfetext -#define yylineno qfelineno - -#line 20 "lex-win.cpp" -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ -#pragma warn - rch -#pragma warn - use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int)(unsigned char)c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state* YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } while (0) - -#define unput(c) yyunput(c, yytext_ptr) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - -struct yy_buffer_state -{ - FILE* yy_input_file; - - char* yy_ch_buf; /* input buffer */ - char* yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 -}; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - -int yyleng; - -/* Points to current character in buffer. */ -static char* yy_c_buf_p = (char*)0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO((FILE * input_file)); - -void yy_switch_to_buffer YY_PROTO((YY_BUFFER_STATE new_buffer)); -void yy_load_buffer_state YY_PROTO((void)); -YY_BUFFER_STATE yy_create_buffer YY_PROTO((FILE * file, int size)); -void yy_delete_buffer YY_PROTO((YY_BUFFER_STATE b)); -void yy_init_buffer YY_PROTO((YY_BUFFER_STATE b, FILE* file)); -void yy_flush_buffer YY_PROTO((YY_BUFFER_STATE b)); -#define YY_FLUSH_BUFFER yy_flush_buffer(yy_current_buffer) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO((char* base, yy_size_t size)); -YY_BUFFER_STATE yy_scan_string YY_PROTO((yyconst char* yy_str)); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO((yyconst char* bytes, int len)); - -static void* yy_flex_alloc YY_PROTO((yy_size_t)); -static void* yy_flex_realloc YY_PROTO((void*, yy_size_t)); -static void yy_flex_free YY_PROTO((void*)); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if (!yy_current_buffer) \ - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if (!yy_current_buffer) \ - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -#define YY_USES_REJECT - -#define yywrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE*)0, *yyout = (FILE*)0; -typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; -extern char* yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO((void)); -static yy_state_type yy_try_NUL_trans YY_PROTO((yy_state_type current_state)); -static int yy_get_next_buffer YY_PROTO((void)); -static void yy_fatal_error YY_PROTO((yyconst char msg[])); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int)(yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 30 -#define YY_END_OF_BUFFER 31 -static yyconst short int yy_acclist[125] = { - 0, 27, 27, 18, 18, 31, 29, 30, 27, 29, 30, 28, 30, 17, 29, 30, 29, 30, 20, 29, 30, 23, 29, 30, 26, 29, - 30, 21, 29, 30, 16, 29, 30, 16, 29, 30, 16, 29, 30, 16, 29, 30, 16, 29, 30, 16, 29, 30, 16, 29, 30, 16, - 29, 30, 16, 29, 30, 16, 29, 30, 18, 30, 19, 30, 27, 20, 24, 25, 22, 16, 16, 11, 16, 16, 16, 16, 16, 16, - 16, 16, 6, 16, 16, 16, 16, 18, 5, 16, 9, 16, 15, 16, 16, 16, 16, 16, 14, 16, 13, 16, 16, - - 16, 12, 16, 16, 10, 16, 2, 16, 16, 16, 16, 16, 16, 16, 7, 16, 16, 16, 3, 16, 1, 16, 4, 8}; - -static yyconst short int yy_accept[81] = { - 0, 1, 2, 3, 4, 5, 6, 8, 11, 13, 16, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, - 48, 51, 54, 57, 60, 62, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, - 80, 82, 83, 84, 85, 86, 88, 90, 92, 93, 94, 95, 96, 98, 100, 101, 102, 104, 105, 107, 109, - 110, 111, 112, 113, 114, 115, 117, 118, 119, 121, 121, 121, 123, 123, 123, 124, 125, 125}; - -static yyconst int yy_ec[256] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 6, 1, 6, 1, 1, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 1, 1, 8, 9, 10, 1, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 11, 11, 21, 22, - 23, 24, 25, 11, 26, 27, 28, 29, 30, 31, 32, 33, 11, 1, 1, 1, 1, 11, 1, 12, 13, 14, 15, - - 16, 17, 18, 19, 20, 11, 11, 21, 22, 23, 24, 25, 11, 26, 27, 28, 29, 30, 31, 32, 33, 11, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1}; - -static yyconst int yy_meta[34] = {0, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}; - -static yyconst short int yy_base[83] = {0, 0, 0, 92, 91, 95, 98, 32, 98, 98, 87, 86, 28, 98, 83, 0, 12, - 75, 64, 63, 68, 28, 61, 25, 67, 0, 98, 41, 78, 98, 98, 98, 0, 69, - 69, 64, 54, 56, 55, 56, 45, 53, 60, 53, 51, 56, 0, 0, 0, 0, 57, - 48, 40, 48, 0, 0, 51, 50, 0, 39, 0, 0, 39, 35, 36, 47, 43, 49, - 0, 48, 23, 0, 37, 36, 0, 14, 13, 98, 98, 98, 54, 41, 57}; - -static yyconst short int yy_def[83] = {0, 79, 1, 80, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 82, 79, 79, 79, 79, 79, 79, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 79, 79, 81, 79, 79, 79, 79, 0, 79, 79, 79}; - -static yyconst short int yy_nxt[132] = { - 0, 6, 7, 8, 7, 9, 10, 11, 12, 13, 14, 15, 16, 15, 15, 17, 15, 18, 19, 15, 15, 20, 21, 15, 22, 15, - 15, 23, 15, 15, 15, 24, 15, 15, 27, 33, 27, 29, 30, 34, 40, 43, 35, 27, 32, 27, 78, 77, 41, 76, 75, 74, - 73, 72, 44, 25, 25, 25, 46, 71, 46, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, - 53, 52, 51, 50, 49, 48, 47, 28, 45, 42, 39, 38, 37, 36, 31, 28, 28, 79, 26, 26, 5, 79, 79, - - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79}; - -static yyconst short int yy_chk[132] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 7, 16, 7, 12, 12, 16, 21, 23, 16, 27, 81, 27, 76, 75, 21, 73, 72, 70, - 69, 67, 23, 80, 80, 80, 82, 66, 82, 65, 64, 63, 62, 59, 57, 56, 53, 52, 51, 50, 45, 44, 43, 42, 41, 40, - 39, 38, 37, 36, 35, 34, 33, 28, 24, 22, 20, 19, 18, 17, 14, 11, 10, 5, 4, 3, 79, 79, 79, - - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79}; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char* yy_full_match; -static int yy_lp; -#define REJECT \ - { \ - *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ - yy_cp = yy_full_match; /* restore poss. backed-over text */ \ - ++yy_lp; \ - goto find_rule; \ - } -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char* yytext; -#line 1 "qfelexer.lpp" -#define INITIAL 0 -#line 2 "qfelexer.lpp" -#include -#include -#include "returnedcolumn.h" -#ifndef _MSC_VER -#include "qfeparser.h" -#else -#include "bison-win.h" -#endif - -extern int qfeerror(const char* s); - -extern std::string* newstr(const char* cp); - -#define YY_NO_UNPUT 1 -#define CCONST 1 - -#line 481 "lex-win.cpp" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO((void)); -#else -extern int yywrap YY_PROTO((void)); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO((int c, char* buf_ptr)); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO((char*, yyconst char*, int)); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO((yyconst char*)); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO((void)); -#else -static int input YY_PROTO((void)); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int* yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO((int new_state)); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO((void)); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO((void)); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void)fwrite(yytext, yyleng, 1, yyout) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf, result, max_size) \ - if (yy_current_buffer->yy_is_interactive) \ - { \ - int c = '*', n; \ - for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \ - buf[n] = (char)c; \ - if (c == '\n') \ - buf[n++] = (char)c; \ - if (c == EOF && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - result = n; \ - } \ - else if (((result = fread(buf, 1, max_size, yyin)) == 0) && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error(msg) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO((void)) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP YY_USER_ACTION - -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 28 "qfelexer.lpp" - -#line 635 "lex-win.cpp" - - if (yy_init) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if (!yy_start) - yy_start = 1; /* first start state */ - - if (!yyin) - yyin = stdin; - - if (!yyout) - yyout = stdout; - - if (!yy_current_buffer) - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); - - yy_load_buffer_state(); - } - - while (1) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - yy_match: - - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 80) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } while (yy_base[yy_current_state] != 98); - - yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - find_rule: /* we branch to this label when backing up */ - - for (;;) /* until we find what rule we matched */ - { - if (yy_lp && yy_lp < yy_accept[yy_current_state + 1]) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if (yy_act != YY_END_OF_BUFFER) - { - int yyl; - - for (yyl = 0; yyl < yyleng; ++yyl) - if (yytext[yyl] == '\n') - ++yylineno; - } - - do_action: /* This label is used only to access EOF actions. */ - - switch (yy_act) - { - /* beginning of action switch */ - case 1: YY_RULE_SETUP -#line 30 "qfelexer.lpp" - { - return QFEP_SELECT; - } - YY_BREAK - - case 2: YY_RULE_SETUP -#line 31 "qfelexer.lpp" - { - return QFEP_FROM; - } - YY_BREAK - - case 3: YY_RULE_SETUP -#line 32 "qfelexer.lpp" - { - return QFEP_WHERE; - } - YY_BREAK - - case 4: YY_RULE_SETUP -#line 33 "qfelexer.lpp" - { - return GROUPBY; - } - YY_BREAK - - case 5: YY_RULE_SETUP -#line 34 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return LOGICOP; - } - YY_BREAK - - case 6: YY_RULE_SETUP -#line 35 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return LOGICOP; - } - YY_BREAK - - case 7: YY_RULE_SETUP -#line 36 "qfelexer.lpp" - { - return LIMIT; - } - YY_BREAK - - case 8: YY_RULE_SETUP -#line 37 "qfelexer.lpp" - { - return ORDERBY; - } - YY_BREAK - - case 9: YY_RULE_SETUP -#line 38 "qfelexer.lpp" - { - return ASC; - } - YY_BREAK - - case 10: YY_RULE_SETUP -#line 39 "qfelexer.lpp" - { - return DESC; - } - YY_BREAK - - case 11: YY_RULE_SETUP -#line 40 "qfelexer.lpp" - { - return AS; - } - YY_BREAK - - case 12: YY_RULE_SETUP -#line 41 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return FUNC; - } - YY_BREAK - - case 13: YY_RULE_SETUP -#line 42 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return FUNC; - } - YY_BREAK - - case 14: YY_RULE_SETUP -#line 43 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return FUNC; - } - YY_BREAK - - case 15: YY_RULE_SETUP -#line 44 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return FUNC; - } - YY_BREAK - - case 16: YY_RULE_SETUP -#line 46 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return OBJNAME; - } - YY_BREAK - - case 17: YY_RULE_SETUP -#line 48 "qfelexer.lpp" - { - BEGIN(CCONST); - } - YY_BREAK - - case 18: YY_RULE_SETUP -#line 49 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return CHAR_CONST; - } - YY_BREAK - - case 19: YY_RULE_SETUP -#line 50 "qfelexer.lpp" - { - BEGIN(INITIAL); - } - YY_BREAK - - case 20: YY_RULE_SETUP -#line 52 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return INT_CONST; - } - YY_BREAK - - case 21: YY_RULE_SETUP -#line 54 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return RELOP; - } - YY_BREAK - - case 22: YY_RULE_SETUP -#line 55 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return RELOP; - } - YY_BREAK - - case 23: YY_RULE_SETUP -#line 56 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return RELOP; - } - YY_BREAK - - case 24: YY_RULE_SETUP -#line 57 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return RELOP; - } - YY_BREAK - - case 25: YY_RULE_SETUP -#line 58 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return RELOP; - } - YY_BREAK - - case 26: YY_RULE_SETUP -#line 59 "qfelexer.lpp" - { - qfelval.cp = newstr(qfetext); - return RELOP; - } - YY_BREAK - - case 27: YY_RULE_SETUP -#line 61 "qfelexer.lpp" - { - } - YY_BREAK - - case 28: YY_RULE_SETUP -#line 62 "qfelexer.lpp" - { - qfelineno++; - } - YY_BREAK - - case 29: YY_RULE_SETUP -#line 64 "qfelexer.lpp" - { - return qfetext[0]; - } - YY_BREAK - - case 30: YY_RULE_SETUP -#line 66 "qfelexer.lpp" - ECHO; - YY_BREAK -#line 876 "lex-win.cpp" - - case YY_STATE_EOF(INITIAL): - case YY_STATE_EOF(CCONST): yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if (yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if (yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars]) - { - /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans(yy_current_state); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if (yy_next_state) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else - switch (yy_get_next_buffer()) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if (yywrap()) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if (!yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - } - - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - - break; - } - - default: YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() -{ - register char* dest = yy_current_buffer->yy_ch_buf; - register char* source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if (yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1]) - YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - - if (yy_current_buffer->yy_fill_buffer == 0) - { - /* Don't try to fill the buffer, so this is an EOF. */ - if (yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int)(yy_c_buf_p - yytext_ptr) - 1; - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; - - while (num_to_read <= 0) - { - /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR("input buffer overflow, can't enlarge buffer because scanner uses REJECT"); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = (int)(yy_c_buf_p - b->yy_ch_buf); - - if (b->yy_is_our_buffer) - { - int new_size = b->yy_buf_size * 2; - - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char*) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc((void*)b->yy_ch_buf, b->yy_buf_size + 2); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; -#endif - } - - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if (yy_n_chars == 0) - { - if (number_to_move == YY_MORE_ADJ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() -{ - register yy_state_type yy_current_state; - register char* yy_cp; - - yy_current_state = yy_start; - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for (yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 80) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) -#else -static yy_state_type yy_try_NUL_trans(yy_current_state) yy_state_type yy_current_state; -#endif -{ - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - - if (yy_current_state >= 80) - yy_c = yy_meta[(unsigned int)yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - yy_is_jam = (yy_current_state == 79); - - if (!yy_is_jam) - *yy_state_ptr++ = yy_current_state; - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput(int c, register char* yy_bp) -#else -static void yyunput(c, yy_bp) int c; -register char* yy_bp; -#endif -{ - register char* yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if (yy_cp < yy_current_buffer->yy_ch_buf + 2) - { - /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char* dest = &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2]; - register char* source = &yy_current_buffer->yy_ch_buf[number_to_move]; - - while (source > yy_current_buffer->yy_ch_buf) - *--dest = *--source; - - yy_cp += (int)(dest - source); - yy_bp += (int)(dest - source); - yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; - - if (yy_cp < yy_current_buffer->yy_ch_buf + 2) - YY_FATAL_ERROR("flex scanner push-back overflow"); - } - - *--yy_cp = (char)c; - - if (c == '\n') - --yylineno; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; -} -#endif /* ifndef YY_NO_UNPUT */ - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif -{ - int c; - - *yy_c_buf_p = yy_hold_char; - - if (*yy_c_buf_p == YY_END_OF_BUFFER_CHAR) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if (yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars]) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { - /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch (yy_get_next_buffer()) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if (yywrap()) - return EOF; - - if (!yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; - } - } - } - - c = *(unsigned char*)yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - if (c == '\n') - ++yylineno; - - return c; -} - -#ifdef YY_USE_PROTOS -void yyrestart(FILE* input_file) -#else -void yyrestart(input_file) FILE* input_file; -#endif -{ - if (!yy_current_buffer) - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); - - yy_init_buffer(yy_current_buffer, input_file); - yy_load_buffer_state(); -} - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) -#else -void yy_switch_to_buffer(new_buffer) YY_BUFFER_STATE new_buffer; -#endif -{ - if (yy_current_buffer == new_buffer) - return; - - if (yy_current_buffer) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; -} - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state(void) -#else -void yy_load_buffer_state() -#endif -{ - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; -} - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer(FILE* file, int size) -#else -YY_BUFFER_STATE yy_create_buffer(file, size) FILE* file; -int size; -#endif -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE)yy_flex_alloc(sizeof(struct yy_buffer_state)); - - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char*)yy_flex_alloc(b->yy_buf_size + 2); - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b, file); - - return b; -} - -#ifdef YY_USE_PROTOS -void yy_delete_buffer(YY_BUFFER_STATE b) -#else -void yy_delete_buffer(b) YY_BUFFER_STATE b; -#endif -{ - if (!b) - return; - - if (b == yy_current_buffer) - yy_current_buffer = (YY_BUFFER_STATE)0; - - if (b->yy_is_our_buffer) - yy_flex_free((void*)b->yy_ch_buf); - - yy_flex_free((void*)b); -} - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO((int)); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer(YY_BUFFER_STATE b, FILE* file) -#else -void yy_init_buffer(b, file) YY_BUFFER_STATE b; -FILE* file; -#endif - -{ - yy_flush_buffer(b); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0; -#endif -#endif -} - -#ifdef YY_USE_PROTOS -void yy_flush_buffer(YY_BUFFER_STATE b) -#else -void yy_flush_buffer(b) YY_BUFFER_STATE b; -#endif - -{ - if (!b) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if (b == yy_current_buffer) - yy_load_buffer_state(); -} - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer(char* base, yy_size_t size) -#else -YY_BUFFER_STATE yy_scan_buffer(base, size) char* base; -yy_size_t size; -#endif -{ - YY_BUFFER_STATE b; - - if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR || base[size - 1] != YY_END_OF_BUFFER_CHAR) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE)yy_flex_alloc(sizeof(struct yy_buffer_state)); - - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b); - - return b; -} -#endif - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string(yyconst char* yy_str) -#else -YY_BUFFER_STATE yy_scan_string(yy_str) yyconst char* yy_str; -#endif -{ - int len; - - for (len = 0; yy_str[len]; ++len) - ; - - return yy_scan_bytes(yy_str, len); -} -#endif - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes(yyconst char* bytes, int len) -#else -YY_BUFFER_STATE yy_scan_bytes(bytes, len) yyconst char* bytes; -int len; -#endif -{ - YY_BUFFER_STATE b; - char* buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char*)yy_flex_alloc(n); - - if (!buf) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); - - for (i = 0; i < len; ++i) - buf[i] = bytes[i]; - - buf[len] = buf[len + 1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf, n); - - if (!b) - YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} -#endif - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state(int new_state) -#else -static void yy_push_state(new_state) int new_state; -#endif -{ - if (yy_start_stack_ptr >= yy_start_stack_depth) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof(int); - - if (!yy_start_stack) - yy_start_stack = (int*)yy_flex_alloc(new_size); - - else - yy_start_stack = (int*)yy_flex_realloc((void*)yy_start_stack, new_size); - - if (!yy_start_stack) - YY_FATAL_ERROR("out of memory expanding start-condition stack"); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); -} -#endif - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() -{ - if (--yy_start_stack_ptr < 0) - YY_FATAL_ERROR("start-condition stack underflow"); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); -} -#endif - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() -{ - return yy_start_stack[yy_start_stack_ptr - 1]; -} -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error(yyconst char msg[]) -#else -static void yy_fatal_error(msg) char msg[]; -#endif -{ - (void)fprintf(stderr, "%s\n", msg); - exit(YY_EXIT_FAILURE); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } while (0) - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy(char* s1, yyconst char* s2, int n) -#else -static void yy_flex_strncpy(s1, s2, n) char* s1; -yyconst char* s2; -int n; -#endif -{ - register int i; - - for (i = 0; i < n; ++i) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen(yyconst char* s) -#else -static int yy_flex_strlen(s) yyconst char* s; -#endif -{ - register int n; - - for (n = 0; s[n]; ++n) - ; - - return n; -} -#endif - -#ifdef YY_USE_PROTOS -static void* yy_flex_alloc(yy_size_t size) -#else -static void* yy_flex_alloc(size) yy_size_t size; -#endif -{ - return (void*)malloc(size); -} - -#ifdef YY_USE_PROTOS -static void* yy_flex_realloc(void* ptr, yy_size_t size) -#else -static void* yy_flex_realloc(ptr, size) void* ptr; -yy_size_t size; -#endif -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void*)realloc((char*)ptr, size); -} - -#ifdef YY_USE_PROTOS -static void yy_flex_free(void* ptr) -#else -static void yy_flex_free(ptr) void* ptr; -#endif -{ - free(ptr); -} - -#if YY_MAIN -int main() -{ - yylex(); - return 0; -} -#endif -#line 66 "qfelexer.lpp" diff --git a/tools/qfe/returnedrows.cpp b/tools/qfe/returnedrows.cpp index d833830a71..f84b0a1434 100644 --- a/tools/qfe/returnedrows.cpp +++ b/tools/qfe/returnedrows.cpp @@ -8,9 +8,7 @@ using namespace std; #include using namespace boost; -#ifndef _MSC_VER #include "mcsconfig.h" -#endif #include "socktype.h" diff --git a/tools/qfe/scanner.bat b/tools/qfe/scanner.bat deleted file mode 100644 index 31d4b79f82..0000000000 --- a/tools/qfe/scanner.bat +++ /dev/null @@ -1,6 +0,0 @@ -PATH=C:\PROGRA~2\GNUWIN32\BIN;%PATH% - -del bison-win.h >nul 2>&1 -bison -d -p qfe -o bison-win.cpp qfeparser.ypp -ren bison-win.hpp bison-win.h -flex -i -Pqfe -olex-win.cpp qfelexer.lpp diff --git a/tools/qfe/server.cpp b/tools/qfe/server.cpp index 7b3276dede..db96e19c67 100644 --- a/tools/qfe/server.cpp +++ b/tools/qfe/server.cpp @@ -19,21 +19,10 @@ Protocol definition: */ -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#include -#include -#include -#include -#else #include #include #include #include -#endif #include #include #include @@ -54,9 +43,7 @@ using namespace std; #include using namespace boost; -#ifndef _MSC_VER #include "mcsconfig.h" -#endif #include "socktype.h" #include "parsequery.h" @@ -160,7 +147,6 @@ class ThreadFunc bool serverInit() { -#ifndef _MSC_VER setsid(); @@ -193,7 +179,6 @@ bool serverInit() close(fd); } -#endif #endif return true; } @@ -201,18 +186,11 @@ bool serverInit() SockType initListenSock(short portNo) { SockType listenSock = -1; -#ifdef _MSC_VER - WSAData wsadata; - const WORD minVersion = MAKEWORD(2, 2); - WSAStartup(minVersion, &wsadata); -#endif listenSock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); idbassert_s(listenSock >= 0, string("socket create error: ") + strerror(errno)); // if (listenSock < 0) throw runtime_error(string("socket create error: ") + strerror(errno)); -#ifndef _MSC_VER int optval = 1; setsockopt(listenSock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast(&optval), sizeof(optval)); -#endif int rc = 0; struct sockaddr_in serv_addr; memset(&serv_addr, 0, sizeof(serv_addr)); @@ -226,13 +204,7 @@ SockType initListenSock(short portNo) if (rc < 0) { -#ifdef _MSC_VER - int x = WSAGetLastError(); - - if (x == WSAEADDRINUSE) -#else if (errno == EADDRINUSE) -#endif { // cerr << "Addr in use..." << endl; if (++tries >= MaxTries) @@ -311,15 +283,6 @@ struct ScopedCleaner ScopedCleaner(SockType fd = -1) : fFd(fd) { } -#ifdef _MSC_VER - ~ScopedCleaner() - { - if (fFd >= 0) - shutdown(fFd, SHUT_RDWR); - - closesocket(fFd); - } -#else ~ScopedCleaner() { if (fFd >= 0) @@ -328,7 +291,6 @@ struct ScopedCleaner close(fFd); } -#endif SockType fFd; }; @@ -411,11 +373,7 @@ int main(int argc, char** argv) if (portNo <= 0) portNo = 9198; -#ifdef _MSC_VER - listenSock = INVALID_SOCKET; -#else listenSock = -1; -#endif opterr = 0; while ((c = getopt(argc, argv, "p:")) != -1) @@ -440,53 +398,9 @@ int main(int argc, char** argv) for (;;) { -#ifdef _MSC_VER - SOCKET querySock = INVALID_SOCKET; - querySock = accept(listenSock, 0, 0); - idbassert_s(querySock != INVALID_SOCKET, string("socket accept error: ") + strerror(errno)); -#if 0 - uint32_t sndbufsize; - int sndbufsizelen = 4; - int rc; - rc = getsockopt(querySock, SOL_SOCKET, SO_SNDBUF, (char*)&sndbufsize, &sndbufsizelen); - - if (rc != SOCKET_ERROR) - { - if (sndbufsizelen == 4) - { - cerr << "getsockopt(): current SO_SNDBUF = " << sndbufsize << endl; - sndbufsize = atoi(getenv("SO_SNDBUF")); - cerr << "setsockopt(): setting SO_SNDBUF = " << sndbufsize << endl; - rc = setsockopt(querySock, SOL_SOCKET, SO_SNDBUF, (const char*)&sndbufsize, sndbufsizelen); - - if (rc != SOCKET_ERROR) - { - getsockopt(querySock, SOL_SOCKET, SO_SNDBUF, (char*)&sndbufsize, &sndbufsizelen); - cerr << "getsockopt(): new SO_SNDBUF = " << sndbufsize << endl; - } - else - { - cerr << "setsockopt(): " << WSAGetLastError() << endl; - } - } - else - { - cerr << "getsockopt(): expecting 4 bytes, got " << sndbufsizelen << endl; - } - } - else - { - cerr << "getsockopt(): " << WSAGetLastError() << endl; - } - -#endif - uint32_t sndbufsize = 512 * 1024; - setsockopt(querySock, SOL_SOCKET, SO_SNDBUF, (const char*)&sndbufsize, 4); -#else int querySock = -1; querySock = accept(listenSock, 0, 0); idbassert_s(querySock >= 0, string("socket accept error: ") + strerror(errno)); -#endif // ThreadFunc now owns querySock and is responsible for cleaning it up ThreadFunc tf(querySock); diff --git a/tools/qfe/socketio.cpp b/tools/qfe/socketio.cpp index 654d5c283e..15cc2d2280 100644 --- a/tools/qfe/socketio.cpp +++ b/tools/qfe/socketio.cpp @@ -1,19 +1,8 @@ #include -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#include -#include -#include -#include -#else #include #include #include #include -#endif #include #include using namespace std; @@ -21,9 +10,7 @@ using namespace std; #include using namespace boost; -#ifndef _MSC_VER #include "mcsconfig.h" -#endif #include "exceptclasses.h" @@ -33,7 +20,6 @@ namespace qfe { namespace socketio { -#ifndef _MSC_VER void readn(int fd, void* buf, const size_t wanted) { size_t needed = wanted; @@ -112,78 +98,6 @@ size_t writen(int fd, const void* data, const size_t nbytes) return nbytes; } -#else -const size_t MAX_RECV_BYTES = 64 * 1024; -void reads(SOCKET fd, void* buf, const size_t wanted) -{ - size_t needed = wanted; - size_t sofar = 0; - char* p = reinterpret_cast(buf); - ssize_t rrc = -1; - pollfd fds[1]; - int en = 0; - - fds[0].fd = fd; - fds[0].events = POLLIN; - - while (wanted > sofar) - { - fds[0].revents = 0; - poll(fds, 1, -1); - errno = 0; - // Windows recv() can only read so much at a time... - int thisrecv = static_cast(std::min(needed, MAX_RECV_BYTES)); - rrc = ::recv(fd, (p + sofar), thisrecv, 0); - en = errno; - - if (rrc < 0) - { - if (en == EAGAIN || en == EINTR) - continue; - - ostringstream oss; - oss << "qfe: reads: read() returned " << rrc << " (" << strerror(en) << ")"; - idbassert_s(0, oss.str()); - } - - needed -= rrc; - sofar += rrc; - } -} -size_t writes(SOCKET fd, const void* data, const size_t nbytes) -{ - size_t nleft; - ssize_t nwritten; - const char* bufp = static_cast(data); - nleft = nbytes; - - while (nleft > 0) - { - int thissend = static_cast(std::min(nleft, MAX_RECV_BYTES)); - nwritten = ::send(fd, bufp, thissend, 0); - int en = errno; - - if (nwritten == SOCKET_ERROR) - { - int wsaerrno = WSAGetLastError(); - - if (en == EINTR) - nwritten = 0; - else - { - ostringstream oss; - oss << "qfe: writes: send() returned " << nwritten << " (WSA: " << wsaerrno << ")"; - idbassert_s(0, oss.str()); - } - } - - nleft -= nwritten; - bufp += nwritten; - } - - return nbytes; -} -#endif uint32_t readNumber32(SockType fd) { diff --git a/tools/qfe/socketio.h b/tools/qfe/socketio.h index 563b915729..81beb3e3f1 100644 --- a/tools/qfe/socketio.h +++ b/tools/qfe/socketio.h @@ -1,12 +1,6 @@ #pragma once -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#else #include -#endif #include #include @@ -16,13 +10,8 @@ namespace qfe { namespace socketio { -#ifndef _MSC_VER void readn(int fd, void* buf, const size_t wanted); size_t writen(int fd, const void* data, const size_t nbytes); -#else -void reads(SOCKET fd, void* buf, const size_t wanted); -size_t writes(SOCKET fd, const void* buf, const size_t len); -#endif uint32_t readNumber32(SockType); std::string readString(SockType); void writeString(SockType, const std::string&); diff --git a/tools/qfe/socktype.h b/tools/qfe/socktype.h index bc0c97529e..0e48ad7196 100644 --- a/tools/qfe/socktype.h +++ b/tools/qfe/socktype.h @@ -1,17 +1,6 @@ #pragma once -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#endif -#ifdef _MSC_VER -typedef SOCKET SockType; -#define SockReadFcn qfe::socketio::reads -#define SockWriteFcn qfe::socketio::writes -#else typedef int SockType; #define SockReadFcn qfe::socketio::readn #define SockWriteFcn qfe::socketio::writen -#endif diff --git a/utils/common/MonitorProcMem.cpp b/utils/common/MonitorProcMem.cpp index 1341dabbee..697df67bbb 100644 --- a/utils/common/MonitorProcMem.cpp +++ b/utils/common/MonitorProcMem.cpp @@ -20,13 +20,6 @@ * *****************************************************************************/ -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#include -#endif #include #include #include @@ -101,21 +94,7 @@ size_t MonitorProcMem::rss() const { uint64_t rss; -#if defined(_MSC_VER) - HANDLE hProcess; - PROCESS_MEMORY_COUNTERS pmc; - hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, fPid); - - if (NULL == hProcess) - return 0; - - if (GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc))) - rss = pmc.WorkingSetSize; - else - rss = 0; - - CloseHandle(hProcess); -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) ostringstream cmd; cmd << "ps -a -o rss -p " << getpid() << " | tail +2"; FILE* cmdPipe; @@ -158,9 +137,6 @@ void MonitorProcMem::pause_() const while (1) { -#ifdef _MSC_VER - Sleep(req.tv_sec * 1000); -#else if (nanosleep(&req, &rem) != 0) { @@ -171,7 +147,6 @@ void MonitorProcMem::pause_() const } } -#endif break; } } diff --git a/utils/common/atomicops.h b/utils/common/atomicops.h index ee096cd0c0..94e3e32011 100644 --- a/utils/common/atomicops.h +++ b/utils/common/atomicops.h @@ -20,12 +20,8 @@ #pragma once #include -#if defined(__linux__) #include -#endif -#if !defined(_MSC_VER) #include -#endif /* This is an attempt to wrap the differneces between Windows and Linux around atomic ops. @@ -38,90 +34,34 @@ namespace atomicops template inline T atomicInc(volatile T* mem) { -#ifdef _MSC_VER - - switch (sizeof(T)) - { - case 4: - default: return InterlockedIncrement(reinterpret_cast(mem)); - - case 8: return InterlockedIncrement64(reinterpret_cast(mem)); - } - -#else return __sync_add_and_fetch(mem, 1); -#endif } // decrements, but returns the pre-decrement value template inline T atomicDec(volatile T* mem) { -#ifdef _MSC_VER - - switch (sizeof(T)) - { - case 4: - default: return InterlockedDecrement(reinterpret_cast(mem)) + 1; - - case 8: return InterlockedDecrement64(reinterpret_cast(mem)) + 1; - } - -#else return __sync_fetch_and_add(mem, -1); -#endif } // Returns the resulting value (but doesn't need to yet) template inline T atomicAdd(volatile T* mem, T val) { -#ifdef _MSC_VER - - switch (sizeof(T)) - { - case 4: - default: InterlockedExchangeAdd(reinterpret_cast(mem), val); break; - - case 8: InterlockedExchangeAdd64(reinterpret_cast(mem), val); break; - } - - return *mem; -#else return __sync_add_and_fetch(mem, val); -#endif } // Returns the resulting value template inline T atomicSub(volatile T* mem, T val) { -#ifdef _MSC_VER - - switch (sizeof(T)) - { - case 4: - default: InterlockedExchangeAdd(reinterpret_cast(mem), -(static_cast(val))); break; - - case 8: - InterlockedExchangeAdd64(reinterpret_cast(mem), -(static_cast(val))); - break; - } - - return *mem; -#else return __sync_sub_and_fetch(mem, val); -#endif } // Implements a memory barrier inline void atomicMb() { -#ifdef _MSC_VER - MemoryBarrier(); -#else __sync_synchronize(); -#endif } // Returns true iff the CAS took place, that is @@ -134,52 +74,22 @@ inline void atomicMb() template inline bool atomicCAS(volatile T* mem, T comp, T swap) { -#ifdef _MSC_VER - - switch (sizeof(T)) - { - case 4: - default: - // The function returns the initial value of the mem parameter - return (InterlockedCompareExchange(reinterpret_cast(mem), swap, comp) == comp); - - case 8: - return (InterlockedCompareExchange64(reinterpret_cast(mem), swap, comp) == comp); - } - -#else // If the current value of *mem is comp, then write swap into *comp. Return true if the comparison is // successful and swap was written. return __sync_bool_compare_and_swap(mem, comp, swap); -#endif } // implements a zero out of a variable template inline void atomicZero(volatile T* mem) { -#ifdef _MSC_VER - - switch (sizeof(T)) - { - case 4: - default: InterlockedXor(reinterpret_cast(mem), (static_cast(*mem))); break; - - case 8: InterlockedXor64(reinterpret_cast(mem), (static_cast(*mem))); break; - } -#else __sync_xor_and_fetch(mem, *mem); -#endif } // Implements a scheduler yield inline void atomicYield() { -#ifdef _MSC_VER - SwitchToThread(); -#else sched_yield(); -#endif } } // namespace atomicops diff --git a/utils/common/cgroupconfigurator.cpp b/utils/common/cgroupconfigurator.cpp index 45dcc1e26a..00710a883e 100644 --- a/utils/common/cgroupconfigurator.cpp +++ b/utils/common/cgroupconfigurator.cpp @@ -147,15 +147,9 @@ uint32_t CGroupConfigurator::getNumCoresFromCGroup() uint32_t CGroupConfigurator::getNumCoresFromProc() { -#ifdef _MSC_VER - SYSTEM_INFO siSysInfo; - GetSystemInfo(&siSysInfo); - return siSysInfo.dwNumberOfProcessors; -#else uint32_t nc = sysconf(_SC_NPROCESSORS_ONLN); return nc; -#endif } uint32_t CGroupConfigurator::getNumCores() @@ -207,23 +201,7 @@ uint64_t CGroupConfigurator::getTotalMemoryFromProc() { size_t memTot; -#if defined(_MSC_VER) - MEMORYSTATUSEX memStat; - memStat.dwLength = sizeof(memStat); - - if (GlobalMemoryStatusEx(&memStat) == 0) - // FIXME: Assume 2GB? - memTot = 2 * 1024 * 1024; - else - { -#ifndef _WIN64 - memStat.ullTotalPhys = std::min(memStat.ullTotalVirtual, memStat.ullTotalPhys); -#endif - // We now have the total phys mem in bytes - memTot = memStat.ullTotalPhys / 1024; - } - -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) string cmd("sysctl -a | awk '/realmem/ {print int(($2+1023)/1024);}'"); FILE* cmdPipe; char input[80]; @@ -342,23 +320,7 @@ uint64_t CGroupConfigurator::getFreeMemoryFromProc() uint64_t memTotal = 0; uint64_t memAvailable = 0; -#if defined(_MSC_VER) - MEMORYSTATUSEX memStat; - memStat.dwLength = sizeof(memStat); - - if (GlobalMemoryStatusEx(&memStat)) - { - memAvailable = memStat.ullAvailPhys; -#ifndef _WIN64 - uint64_t tmp = getTotalMemoryFromProc(); - - if (memFree > tmp) - memAvailable = tmp; - -#endif - } - -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) // FreeBSD is not supported, no optimization. memAvailable = 0; #else diff --git a/utils/common/fixedallocator.cpp b/utils/common/fixedallocator.cpp index 2799acdb0a..62a15b2353 100644 --- a/utils/common/fixedallocator.cpp +++ b/utils/common/fixedallocator.cpp @@ -25,7 +25,6 @@ #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1) #error "This is a very old GCC, and it's probably not going to work." #endif -#elif defined(_MSC_VER) #else #error "This compiler is not known and it's probably not going to work." #endif diff --git a/utils/common/fixedallocator.h b/utils/common/fixedallocator.h index 78e1630701..b24f8ce98b 100644 --- a/utils/common/fixedallocator.h +++ b/utils/common/fixedallocator.h @@ -40,11 +40,7 @@ #include #include "spinlock.h" -#if defined(_MSC_VER) && defined(xxxFIXEDALLOCATOR_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace utils { diff --git a/utils/common/robin_hood.h b/utils/common/robin_hood.h index 8c46943457..deac71ca8c 100644 --- a/utils/common/robin_hood.h +++ b/utils/common/robin_hood.h @@ -110,20 +110,11 @@ static Counts& counts() #endif // endianess -#ifdef _MSC_VER -#define ROBIN_HOOD_PRIVATE_DEFINITION_LITTLE_ENDIAN() 1 -#define ROBIN_HOOD_PRIVATE_DEFINITION_BIG_ENDIAN() 0 -#else #define ROBIN_HOOD_PRIVATE_DEFINITION_LITTLE_ENDIAN() (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) #define ROBIN_HOOD_PRIVATE_DEFINITION_BIG_ENDIAN() (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) -#endif // inline -#ifdef _MSC_VER -#define ROBIN_HOOD_PRIVATE_DEFINITION_NOINLINE() __declspec(noinline) -#else #define ROBIN_HOOD_PRIVATE_DEFINITION_NOINLINE() __attribute__((noinline)) -#endif // exceptions #if !defined(__cpp_exceptions) && !defined(__EXCEPTIONS) && !defined(_CPPUNWIND) @@ -134,21 +125,6 @@ static Counts& counts() // count leading/trailing bits #if !defined(ROBIN_HOOD_DISABLE_INTRINSICS) -#ifdef _MSC_VER -#if ROBIN_HOOD(BITNESS) == 32 -#define ROBIN_HOOD_PRIVATE_DEFINITION_BITSCANFORWARD() _BitScanForward -#else -#define ROBIN_HOOD_PRIVATE_DEFINITION_BITSCANFORWARD() _BitScanForward64 -#endif -#include -#pragma intrinsic(ROBIN_HOOD(BITSCANFORWARD)) -#define ROBIN_HOOD_COUNT_TRAILING_ZEROES(x) \ - [](size_t mask) noexcept -> int \ - { \ - unsigned long index; \ - return ROBIN_HOOD(BITSCANFORWARD)(&index, mask) ? static_cast(index) : ROBIN_HOOD(BITNESS); \ - }(x) -#else #if ROBIN_HOOD(BITNESS) == 32 #define ROBIN_HOOD_PRIVATE_DEFINITION_CTZ() __builtin_ctzl #define ROBIN_HOOD_PRIVATE_DEFINITION_CLZ() __builtin_clzl @@ -159,7 +135,6 @@ static Counts& counts() #define ROBIN_HOOD_COUNT_LEADING_ZEROES(x) ((x) ? ROBIN_HOOD(CLZ)(x) : ROBIN_HOOD(BITNESS)) #define ROBIN_HOOD_COUNT_TRAILING_ZEROES(x) ((x) ? ROBIN_HOOD(CTZ)(x) : ROBIN_HOOD(BITNESS)) #endif -#endif // fallthrough #ifndef __has_cpp_attribute // For backwards compatibility @@ -174,24 +149,11 @@ static Counts& counts() #endif // likely/unlikely -#ifdef _MSC_VER -#define ROBIN_HOOD_LIKELY(condition) condition -#define ROBIN_HOOD_UNLIKELY(condition) condition -#else #define ROBIN_HOOD_LIKELY(condition) __builtin_expect(condition, 1) #define ROBIN_HOOD_UNLIKELY(condition) __builtin_expect(condition, 0) -#endif // detect if native wchar_t type is availiable in MSVC -#ifdef _MSC_VER -#ifdef _NATIVE_WCHAR_T_DEFINED -#define ROBIN_HOOD_PRIVATE_DEFINITION_HAS_NATIVE_WCHART() 1 -#else -#define ROBIN_HOOD_PRIVATE_DEFINITION_HAS_NATIVE_WCHART() 0 -#endif -#else #define ROBIN_HOOD_PRIVATE_DEFINITION_HAS_NATIVE_WCHART() 1 -#endif #define ROBIN_HOOD_IS_TRIVIALLY_COPYABLE(...) std::is_trivially_copyable<__VA_ARGS__>::value diff --git a/utils/common/simpleallocator.h b/utils/common/simpleallocator.h index b432003d97..e7a1ccb9da 100644 --- a/utils/common/simpleallocator.h +++ b/utils/common/simpleallocator.h @@ -142,18 +142,10 @@ class SimpleAllocator fPool->deallocate(p, n * sizeof(T)); } -#ifdef _MSC_VER - // The MSVC STL library really needs this to return a big number... - size_type max_size() const throw() - { - return std::numeric_limits::max(); - } -#else inline size_type max_size() const throw() { return fPool->max_size() / sizeof(T); } -#endif inline void construct(pointer ptr, const T& val) { new ((void*)ptr) T(val); diff --git a/utils/common/utils_utf8.h b/utils/common/utils_utf8.h index 011f7f5b7c..352bbb4f7b 100644 --- a/utils/common/utils_utf8.h +++ b/utils/common/utils_utf8.h @@ -21,10 +21,7 @@ #pragma once #include -#if defined(_MSC_VER) -#include -#include -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) //#include #else #include @@ -44,16 +41,7 @@ const int MAX_UTF8_BYTES_PER_CHAR = 4; // Params dest and max should have enough length to accomodate NULL inline size_t idb_mbstowcs(wchar_t* dest, const char* src, size_t max) { -#ifdef _MSC_VER - // 4th param (-1) denotes to convert till hit NULL char - // if 6th param max = 0, will return the required buffer size - size_t strwclen = MultiByteToWideChar(CP_UTF8, 0, src, -1, dest, (int)max); - // decrement the count of NULL; will become -1 on failure - return --strwclen; - -#else return mbstowcs(dest, src, max); -#endif } // BUG 5241 @@ -61,15 +49,7 @@ inline size_t idb_mbstowcs(wchar_t* dest, const char* src, size_t max) // Params dest and max should have enough length to accomodate NULL inline size_t idb_wcstombs(char* dest, const wchar_t* src, size_t max) { -#ifdef _MSC_VER - // 4th param (-1) denotes to convert till hit NULL char - // if 6th param max = 0, will return the required buffer size - size_t strmblen = WideCharToMultiByte(CP_UTF8, 0, src, -1, dest, (int)max, NULL, NULL); - // decrement the count of NULL; will become -1 on failure - return --strmblen; -#else return wcstombs(dest, src, max); -#endif } // convert UTF-8 string to wstring diff --git a/utils/compress/idbcompress.h b/utils/compress/idbcompress.h index 4b57e4eb0e..c6a1a9016e 100644 --- a/utils/compress/idbcompress.h +++ b/utils/compress/idbcompress.h @@ -20,20 +20,14 @@ #pragma once #include -#ifdef __linux__ #include -#endif #include #include #include #include "calpontsystemcatalog.h" -#if defined(_MSC_VER) && defined(xxxIDBCOMP_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace compress { diff --git a/utils/configcpp/configcpp.cpp b/utils/configcpp/configcpp.cpp index 6d453306e5..df77f86007 100644 --- a/utils/configcpp/configcpp.cpp +++ b/utils/configcpp/configcpp.cpp @@ -57,12 +57,7 @@ namespace fs = boost::filesystem; #include "exceptclasses.h" #include "installdir.h" -#ifdef _MSC_VER -#include "idbregistry.h" -#include -#else #include -#endif #include "bytestream.h" @@ -349,29 +344,6 @@ void Config::writeConfig(const string& configFile) const if (fDoc == 0) throw runtime_error("Config::writeConfig: no XML document!"); -#ifdef _MSC_VER - fs::path configFilePth(configFile); - fs::path outFilePth(configFilePth); - outFilePth.replace_extension("temp"); - - if ((fi = fopen(outFilePth.string().c_str(), "wt")) == NULL) - throw runtime_error("Config::writeConfig: error opening config file for write " + outFilePth.string()); - - int rc = -1; - rc = xmlDocDump(fi, fDoc); - - if (rc < 0) - { - throw runtime_error("Config::writeConfig: error writing config file " + outFilePth.string()); - } - - fclose(fi); - - if (fs::exists(configFilePth)) - fs::remove(configFilePth); - - fs::rename(outFilePth, configFilePth); -#else const fs::path defaultConfigFilePathTemp("Columnstore.xml.temp"); const fs::path saveCalpontConfigFileTemp("Columnstore.xml.columnstoreSave"); @@ -460,18 +432,13 @@ void Config::writeConfig(const string& configFile) const fclose(fi); } -#endif return; } void Config::write(void) const { boost::mutex::scoped_lock lk(fWriteXmlLock); -#ifdef _MSC_VER - writeConfig(fConfigFile); -#else write(fConfigFile); -#endif } void Config::write(const string& configFile) const diff --git a/utils/configcpp/configcpp.h b/utils/configcpp/configcpp.h index a2258691fd..10ce3cfffe 100644 --- a/utils/configcpp/configcpp.h +++ b/utils/configcpp/configcpp.h @@ -42,11 +42,7 @@ class ByteStream; } -#if defined(_MSC_VER) && defined(LIBCONFIG_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace config { diff --git a/utils/configcpp/writeonce.h b/utils/configcpp/writeonce.h index 3e98036b4d..7a145dacac 100644 --- a/utils/configcpp/writeonce.h +++ b/utils/configcpp/writeonce.h @@ -25,11 +25,7 @@ #pragma once #include -#ifndef _MSC_VER #include -#else -#include -#endif #include diff --git a/utils/dataconvert/dataconvert.cpp b/utils/dataconvert/dataconvert.cpp index c439a2cbce..93533601b8 100644 --- a/utils/dataconvert/dataconvert.cpp +++ b/utils/dataconvert/dataconvert.cpp @@ -43,9 +43,6 @@ using namespace boost::algorithm; #include "dataconvert.h" #undef DATACONVERT_DLLEXPORT -#ifndef __linux__ -typedef uint32_t ulong; -#endif using namespace logging; @@ -1452,36 +1449,12 @@ boost::any DataConvert::StringToFloat(cscDataType typeCode, const std::string& d { float floatvalue; errno = 0; -#ifdef _MSC_VER - double dval = strtod(data.c_str(), 0); - - if (dval > MAX_FLOAT) - { - pushWarning = true; - floatvalue = MAX_FLOAT; - } - else if (dval < MIN_FLOAT) - { - pushWarning = true; - floatvalue = MIN_FLOAT; - } - else - { - floatvalue = (float)dval; - } -#else floatvalue = strtof(data.c_str(), 0); -#endif if (errno == ERANGE) { pushWarning = true; -#ifdef _MSC_VER - - if (abs(floatvalue) == HUGE_VAL) -#else if (abs(floatvalue) == HUGE_VALF) -#endif { if (floatvalue > 0) floatvalue = MAX_FLOAT; @@ -1531,12 +1504,7 @@ boost::any DataConvert::StringToDouble(cscDataType typeCode, const std::string& if (errno == ERANGE) { pushWarning = true; -#ifdef _MSC_VER - - if (abs(doublevalue) == HUGE_VAL) -#else if (abs(doublevalue) == HUGE_VALL) -#endif { if (doublevalue > 0) value = MAX_DOUBLE; diff --git a/utils/dataconvert/dataconvert.h b/utils/dataconvert/dataconvert.h index d77ec57d7c..e3dfb9a9a5 100644 --- a/utils/dataconvert/dataconvert.h +++ b/utils/dataconvert/dataconvert.h @@ -31,9 +31,7 @@ #include -#ifdef __linux__ #define POSIX_REGEX -#endif #ifdef POSIX_REGEX #include @@ -50,7 +48,6 @@ #include "errorids.h" // remove this block if the htonll is defined in library -#ifdef __linux__ #include #if __BYTE_ORDER == __BIG_ENDIAN // 4312 inline uint64_t htonll(uint64_t n) @@ -66,15 +63,6 @@ inline uint64_t htonll(uint64_t n) inline uint64_t htonll(uint64_t n); // don't know 34127856 or 78563412, hope never be required to support this byte order. #endif -#else //!__linux__ -#if _MSC_VER < 1600 -// Assume we're on little-endian -inline uint64_t htonll(uint64_t n) -{ - return ((((uint64_t)htonl(n & 0xFFFFFFFFULL)) << 32) | (htonl((n & 0xFFFFFFFF00000000ULL) >> 32))); -} -#endif //_MSC_VER -#endif //__linux__ #define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400) #define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) @@ -87,11 +75,7 @@ inline uint64_t uint64ToStr(uint64_t n) using cscDataType = datatypes::SystemCatalog::ColDataType; -#if defined(_MSC_VER) && defined(xxxDATACONVERT_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif const int64_t IDB_pow[19] = {1, 10, diff --git a/utils/funcexp/func_crc32.cpp b/utils/funcexp/func_crc32.cpp index 786c3f33ec..57bb7ceffa 100644 --- a/utils/funcexp/func_crc32.cpp +++ b/utils/funcexp/func_crc32.cpp @@ -32,9 +32,7 @@ using namespace std; #include "rowgroup.h" using namespace execplan; -#ifndef _MSC_VER #include "zlib.h" -#endif namespace funcexp { diff --git a/utils/funcexp/func_hex.cpp b/utils/funcexp/func_hex.cpp index c1a111cb7e..6b7705af26 100644 --- a/utils/funcexp/func_hex.cpp +++ b/utils/funcexp/func_hex.cpp @@ -106,12 +106,7 @@ string Func_hex::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, char buf[256]; long double val = parm[0]->data()->getLongDoubleVal(row, isNull); -#ifdef _MSC_VER - sprintf(buf, "%llA", val); - -#else sprintf(buf, "%LA", val); -#endif retval = buf; break; } diff --git a/utils/funcexp/func_inet_ntoa.cpp b/utils/funcexp/func_inet_ntoa.cpp index d3ac55dd9c..8ef517abff 100644 --- a/utils/funcexp/func_inet_ntoa.cpp +++ b/utils/funcexp/func_inet_ntoa.cpp @@ -21,10 +21,8 @@ * ****************************************************************************/ -#ifndef _MSC_VER #include #include -#endif #include // included when debugging #include #include @@ -270,12 +268,8 @@ void Func_inet_ntoa::convertNtoa(int64_t ipNum, std::string& ipString) sa.sin_addr.s_addr = htonl(ipNum); // now get it back and print it -#ifdef _MSC_VER - ipString = inet_ntoa(sa.sin_addr); -#else char str[INET_ADDRSTRLEN]; ipString = inet_ntop(AF_INET, &(sa.sin_addr), str, INET_ADDRSTRLEN); -#endif } } // namespace funcexp diff --git a/utils/funcexp/func_math.cpp b/utils/funcexp/func_math.cpp index 74a12aa7d8..7ef56be706 100644 --- a/utils/funcexp/func_math.cpp +++ b/utils/funcexp/func_math.cpp @@ -65,12 +65,6 @@ inline double radians(double degree) return (degree * M_PI / 180.0); } -#if defined(_MSC_VER) && MSC_VER < 1800 -inline double log2(double x) -{ - return (log(x) / M_LN2); -} -#endif } // namespace namespace funcexp diff --git a/utils/funcexp/func_pow.cpp b/utils/funcexp/func_pow.cpp index 236e7e2c55..c77412c46f 100644 --- a/utils/funcexp/func_pow.cpp +++ b/utils/funcexp/func_pow.cpp @@ -25,10 +25,6 @@ #include #include #include -#if defined(_MSC_VER) && !defined(isfinite) -#include -#define isfinite _finite -#endif using namespace std; #include "functor_real.h" diff --git a/utils/funcexp/func_sha.cpp b/utils/funcexp/func_sha.cpp index ec3fac1f43..944551eb50 100644 --- a/utils/funcexp/func_sha.cpp +++ b/utils/funcexp/func_sha.cpp @@ -631,13 +631,7 @@ string Func_sha::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, sha << parm[0]->data()->getStrVal(row, isNull).c_str(); // can not compute -#ifdef _MSC_VER - - // This cast is probably portable, but we'll leave it for Windows only for now... - if (!sha.Result(reinterpret_cast(message_digest))) -#else if (!sha.Result(message_digest)) -#endif { isNull = true; return ""; diff --git a/utils/funcexp/funcexp.h b/utils/funcexp/funcexp.h index a5c6ed3a58..7fb10f6bdc 100644 --- a/utils/funcexp/funcexp.h +++ b/utils/funcexp/funcexp.h @@ -26,11 +26,7 @@ #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include #include "rowgroup.h" diff --git a/utils/funcexp/funchelpers.h b/utils/funcexp/funchelpers.h index ec0e6f22cb..4c5bd3263e 100644 --- a/utils/funcexp/funchelpers.h +++ b/utils/funcexp/funchelpers.h @@ -24,11 +24,9 @@ #include -#ifndef _MSC_VER #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif -#endif #include #include @@ -654,22 +652,14 @@ inline int dayOfWeek(std::string day) // Sunday = 0 inline string intToString(int64_t i) { char buf[32]; -#ifndef _MSC_VER snprintf(buf, 32, "%" PRId64 "", i); -#else - snprintf(buf, 32, "%lld", i); -#endif return buf; } inline string uintToString(uint64_t i) { char buf[32]; -#ifndef _MSC_VER snprintf(buf, 32, "%" PRIu64 "", i); -#else - snprintf(buf, 32, "%llu", i); -#endif return buf; } diff --git a/utils/funcexp/functor.cpp b/utils/funcexp/functor.cpp index 3da34944c1..c5c8d95330 100644 --- a/utils/funcexp/functor.cpp +++ b/utils/funcexp/functor.cpp @@ -21,11 +21,9 @@ * * ****************************************************************************/ -#ifndef _MSC_VER #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif -#endif #include #include #include diff --git a/utils/idbdatafile/BufferedFile.cpp b/utils/idbdatafile/BufferedFile.cpp index 6d7c58347e..1aee18c87f 100644 --- a/utils/idbdatafile/BufferedFile.cpp +++ b/utils/idbdatafile/BufferedFile.cpp @@ -20,12 +20,6 @@ #include #include #include -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#endif #include "utility.h" #include "BufferedFile.h" #include "IDBLogger.h" @@ -154,11 +148,7 @@ int BufferedFile::seek(off64_t offset, int whence) { int ret = 0; int savedErrno; -#ifdef _MSC_VER - ret = _fseeki64(m_fp, offset, whence); -#else ret = fseek(m_fp, offset, whence); -#endif savedErrno = errno; if (IDBLogger::isEnabled()) @@ -173,11 +163,7 @@ int BufferedFile::truncate(off64_t length) int ret = 0; int savedErrno; -#ifdef _MSC_VER - ret = _chsize_s(_fileno(m_fp), length); -#else ret = ftruncate(fileno(m_fp), length); -#endif savedErrno = errno; if (IDBLogger::isEnabled()) @@ -189,9 +175,6 @@ int BufferedFile::truncate(off64_t length) off64_t BufferedFile::size() { -#ifdef _MSC_VER - return _filelengthi64(fileno(m_fp)); // Interestingly, implemented as fseek/ftell in the windows crt -#else // going to calculate size 2 ways - first, via seek off64_t length = -1; off64_t here; @@ -217,16 +200,11 @@ off64_t BufferedFile::size() } return length; -#endif } off64_t BufferedFile::tell() { -#ifdef _MSC_VER - return _ftelli64(m_fp); -#else return ftell(m_fp); -#endif } int BufferedFile::flush() @@ -236,11 +214,7 @@ int BufferedFile::flush() if (rc == 0) { -#ifdef _MSC_VER - rc = _commit(_fileno(m_fp)); -#else rc = fsync(fileno(m_fp)); -#endif savedErrno = errno; } diff --git a/utils/idbdatafile/BufferedFile.h b/utils/idbdatafile/BufferedFile.h index c55b84731c..e153c524bc 100644 --- a/utils/idbdatafile/BufferedFile.h +++ b/utils/idbdatafile/BufferedFile.h @@ -22,9 +22,6 @@ #include "IDBDataFile.h" #include -#ifdef _MSC_VER -typedef void* HANDLE; -#endif namespace idbdatafile { diff --git a/utils/idbdatafile/IDBDataFile.h b/utils/idbdatafile/IDBDataFile.h index c754605baa..c8cd4a2101 100644 --- a/utils/idbdatafile/IDBDataFile.h +++ b/utils/idbdatafile/IDBDataFile.h @@ -23,11 +23,7 @@ #include #include "stdint.h" #include -#ifdef _MSC_VER -#undef tell -#else #define INVALID_HANDLE_VALUE 0 // Defined already in MSC -#endif namespace idbdatafile { diff --git a/utils/idbdatafile/IDBFactory.cpp b/utils/idbdatafile/IDBFactory.cpp index 873c7eaa5d..b3d2e0feb9 100644 --- a/utils/idbdatafile/IDBFactory.cpp +++ b/utils/idbdatafile/IDBFactory.cpp @@ -19,9 +19,7 @@ #include #include -#ifndef _MSC_VER #include -#endif #include #include #include @@ -64,11 +62,6 @@ bool IDBFactory::installDefaultPlugins() bool IDBFactory::installPlugin(const std::string& plugin) { -#ifdef _MSC_VER - ostringstream oss; - oss << "InfiniDB for Windows does not support plugins: plugin = " << plugin; - throw std::runtime_error(oss.str()); -#else // protect these methods since we are changing our static data structure boost::mutex::scoped_lock lock(fac_guard); @@ -99,7 +92,6 @@ bool IDBFactory::installPlugin(const std::string& plugin) oss << "IDBFactory::installPlugin: installed filesystem plugin " << plugin; IDBLogger::syslog(oss.str(), logging::LOG_TYPE_DEBUG); return true; -#endif } vector IDBFactory::listPlugins() diff --git a/utils/idbdatafile/IDBLogger.cpp b/utils/idbdatafile/IDBLogger.cpp index 37d4cb3c4e..17241ed9e3 100644 --- a/utils/idbdatafile/IDBLogger.cpp +++ b/utils/idbdatafile/IDBLogger.cpp @@ -49,13 +49,8 @@ bool IDBLogger::s_enabled = false; */ void IDBLogger::writeLog(const std::string& logmsg) { -#ifdef _MSC_VER - DWORD pid = GetCurrentProcessId(); - DWORD threadid = GetCurrentThreadId(); -#else pid_t pid = getpid(); pthread_t threadid = pthread_self(); -#endif ostringstream fname; string tmpDir = startup::StartUp::tmpDir(); @@ -70,17 +65,7 @@ void IDBLogger::writeLog(const std::string& logmsg) struct tm tm; gettimeofday(&tv, NULL); -#ifdef _MSC_VER - errno_t p = 0; - time_t t = (time_t)tv.tv_sec; - p = localtime_s(&tm, &t); - - if (p != 0) - memset(&tm, 0, sizeof(tm)); - -#else localtime_r(&tv.tv_sec, &tm); -#endif strftime(fmt, sizeof fmt, "\'%Y-%m-%d %H:%M:%S.%%06u", &tm); snprintf(buf, sizeof buf, fmt, tv.tv_usec); diff --git a/utils/idbdatafile/IDBPolicy.cpp b/utils/idbdatafile/IDBPolicy.cpp index 01d3f65f0e..f90f0c256f 100644 --- a/utils/idbdatafile/IDBPolicy.cpp +++ b/utils/idbdatafile/IDBPolicy.cpp @@ -31,9 +31,6 @@ //#include "HdfsFsCache.h" #include "IDBLogger.h" #include "IDBFactory.h" -#ifdef _MSC_VER -#include "utils_utf8.h" // idb_wcstombs() -#endif #include "installdir.h" #include "vlarray.h" @@ -122,14 +119,7 @@ bool IDBPolicy::installPlugin(const std::string& plugin) bool IDBPolicy::isLocalFile(const std::string& path) { boost::filesystem::path filepath(path); -#ifdef _MSC_VER - size_t strmblen = utf8::idb_wcstombs(0, filepath.extension().c_str(), 0) + 1; - char* outbuf = (char*)alloca(strmblen * sizeof(char)); - strmblen = utf8::idb_wcstombs(outbuf, filepath.extension().c_str(), strmblen); - string fileExt(outbuf, strmblen); -#else // string fileExt = filepath.extension().c_str(); -#endif bool isXml = filepath.extension() == ".xml"; // bool isDbrm = path.find("dbrm") != string::npos; // StorageManager: debatable whether dbrm files should // go in the cloud diff --git a/utils/idbdatafile/PosixFileSystem.cpp b/utils/idbdatafile/PosixFileSystem.cpp index bd3e1c4b26..cb58dd0994 100644 --- a/utils/idbdatafile/PosixFileSystem.cpp +++ b/utils/idbdatafile/PosixFileSystem.cpp @@ -29,9 +29,6 @@ using namespace std; -#ifdef _MSC_VER -#include "utils_utf8.h" -#endif namespace idbdatafile { @@ -76,20 +73,6 @@ int PosixFileSystem::remove(const char* pathname) boost::filesystem::remove_all(dirPath); } -#ifdef _MSC_VER - catch (std::exception& ex) - { - // FIXME: alas, Windows cannot delete a file that is in use :-( - std::string reason(ex.what()); - std::string ignore("The directory is not empty"); - - if (reason.find(ignore) != std::string::npos) - (void)0; - else - ret = -1; - } - -#endif catch (...) { // TODO Log this diff --git a/utils/idbdatafile/UnbufferedFile.cpp b/utils/idbdatafile/UnbufferedFile.cpp index 07a7630bdb..83251ffe4d 100644 --- a/utils/idbdatafile/UnbufferedFile.cpp +++ b/utils/idbdatafile/UnbufferedFile.cpp @@ -30,18 +30,6 @@ namespace idbdatafile { UnbufferedFile::UnbufferedFile(const char* fname, const char* mode, unsigned opts) : IDBDataFile(fname) { -#ifdef _MSC_VER - int createFlags; - int flags = modeStrToFlags(mode, createFlags); - m_fd = CreateFile(fname, flags, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, createFlags, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING, 0); - - if (m_fd == INVALID_HANDLE_VALUE) - { - throw std::runtime_error("unable to open Unbuffered file "); - } - -#else int flags = modeStrToFlags(mode); if (flags == -1) @@ -67,7 +55,6 @@ UnbufferedFile::UnbufferedFile(const char* fname, const char* mode, unsigned opt throw std::runtime_error("unable to open Unbuffered file "); } -#endif } UnbufferedFile::~UnbufferedFile() @@ -83,24 +70,8 @@ ssize_t UnbufferedFile::pread(void* ptr, off64_t offset, size_t count) if (m_fd == INVALID_HANDLE_VALUE) return -1; -#ifdef _MSC_VER - OVERLAPPED ovl; - memset(&ovl, 0, sizeof(ovl)); - DWORD mtest = (DWORD)offset; - ovl.Offset = (DWORD)(offset & 0x00000000FFFFFFFF); - ovl.OffsetHigh = (DWORD)(offset >> 32); - DWORD bytesRead; - - if (ReadFile(m_fd, ptr, (DWORD)count, &bytesRead, &ovl)) - ret = bytesRead; - else - ret = -1; - - savedErrno = errno; -#else ret = ::pread(m_fd, ptr, count, offset); savedErrno = errno; -#endif if (IDBLogger::isEnabled()) IDBLogger::logRW("pread", m_fname, this, offset, count, ret); @@ -115,17 +86,7 @@ ssize_t UnbufferedFile::read(void* ptr, size_t count) ssize_t offset = tell(); int savedErrno; -#ifdef _MSC_VER - DWORD bytesRead; - - if (ReadFile(m_fd, ptr, (DWORD)count, &bytesRead, NULL)) - ret = bytesRead; - else - ret = -1; - -#else ret = ::read(m_fd, ptr, count); -#endif savedErrno = errno; if (IDBLogger::isEnabled()) @@ -141,17 +102,7 @@ ssize_t UnbufferedFile::write(const void* ptr, size_t count) ssize_t offset = tell(); int savedErrno; -#ifdef _MSC_VER - DWORD bytesWritten; - - if (WriteFile(m_fd, ptr, (DWORD)count, &bytesWritten, NULL)) - ret = bytesWritten; - else - ret = -1; - -#else ret = ::write(m_fd, ptr, count); -#endif savedErrno = errno; if (IDBLogger::isEnabled()) @@ -166,13 +117,7 @@ int UnbufferedFile::seek(off64_t offset, int whence) int ret; int savedErrno; -#ifdef _MSC_VER - LONG lDistanceToMove = LONG(offset & 0x00000000FFFFFFFF); - LONG lDistanceToMoveHigh = LONG(offset >> 32); - ret = SetFilePointer(m_fd, lDistanceToMove, &lDistanceToMoveHigh, whence); -#else ret = (lseek(m_fd, offset, whence) >= 0) ? 0 : -1; -#endif savedErrno = errno; if (IDBLogger::isEnabled()) @@ -187,17 +132,7 @@ int UnbufferedFile::truncate(off64_t length) int ret; int savedErrno; -#ifdef _MSC_VER - LONG lDistanceToMove = LONG(length & 0x00000000FFFFFFFF); - LONG lDistanceToMoveHigh = LONG(length >> 32); - ret = SetFilePointer(m_fd, lDistanceToMove, &lDistanceToMoveHigh, SEEK_SET); - - if (ret > 0) - ret = SetEndOfFile(m_fd); - -#else ret = ftruncate(m_fd, length); -#endif savedErrno = errno; if (IDBLogger::isEnabled()) @@ -212,15 +147,9 @@ off64_t UnbufferedFile::size() off64_t ret = 0; int savedErrno; -#ifdef _MSC_VER - DWORD hi = 0; - DWORD lo = GetFileSize(m_fd, &hi); - ret = off64_t(((uint64_t)hi) << 32) | lo; -#else struct stat statBuf; int rc = ::fstat(m_fd, &statBuf); ret = ((rc == 0) ? statBuf.st_size : -1); -#endif savedErrno = errno; if (IDBLogger::isEnabled()) @@ -233,15 +162,7 @@ off64_t UnbufferedFile::size() off64_t UnbufferedFile::tell() { off64_t ret; -#ifdef _MSC_VER - LARGE_INTEGER wRet; - LARGE_INTEGER dist; - dist.QuadPart = 0; - SetFilePointerEx(m_fd, dist, &wRet, FILE_CURRENT); - ret = wRet.QuadPart; -#else ret = lseek(m_fd, 0, SEEK_CUR); -#endif return ret; } @@ -250,18 +171,7 @@ int UnbufferedFile::flush() int ret; int savedErrno; -#ifdef _MSC_VER - ret = FlushFileBuffers(m_fd); - - // In this case for Windows, ret is the reverse of Linux - if (ret == 0) - ret = -1; - else - ret = 0; - -#else ret = fsync(m_fd); -#endif savedErrno = errno; if (IDBLogger::isEnabled()) @@ -274,19 +184,6 @@ int UnbufferedFile::flush() time_t UnbufferedFile::mtime() { time_t ret = 0; -#ifdef _MSC_VER - BY_HANDLE_FILE_INFORMATION info; - - if (GetFileInformationByHandle(m_fd, &info)) - { - ret = time_t((uint64_t)info.ftLastAccessTime.dwHighDateTime << 32) | info.ftLastAccessTime.dwLowDateTime; - } - else - { - ret = (time_t)-1; - } - -#else struct stat statbuf; if (::fstat(m_fd, &statbuf) == 0) @@ -294,7 +191,6 @@ time_t UnbufferedFile::mtime() else ret = (time_t)-1; -#endif return ret; } @@ -305,18 +201,7 @@ int UnbufferedFile::close() if (m_fd != INVALID_HANDLE_VALUE) { -#ifdef _MSC_VER - ret = CloseHandle(m_fd); - - // In this case for Windows, ret is the reverse of Linux - if (ret == 0) - ret = -1; - else - ret = 0; - -#else ret = ::close(m_fd); -#endif savedErrno = errno; } diff --git a/utils/idbdatafile/UnbufferedFile.h b/utils/idbdatafile/UnbufferedFile.h index ee60f40cd3..cd100c95b9 100644 --- a/utils/idbdatafile/UnbufferedFile.h +++ b/utils/idbdatafile/UnbufferedFile.h @@ -52,11 +52,7 @@ class UnbufferedFile : public IDBDataFile, boost::noncopyable int close(); private: -#ifdef _MSC_VER - HANDLE m_fd; -#else int m_fd; -#endif }; } // namespace idbdatafile diff --git a/utils/idbdatafile/largefile64.h b/utils/idbdatafile/largefile64.h index 712727149a..a3abfdbdef 100644 --- a/utils/idbdatafile/largefile64.h +++ b/utils/idbdatafile/largefile64.h @@ -21,16 +21,6 @@ #define _LARGEFILE64_SOURCE #endif -#ifdef _MSC_VER -#ifndef off64_t -#define off64_t __int64 -#endif -#define fseek64 _fseeki64 -#define lseek64 _lseeki64 -#define fstat64 _fstati64 -#define ftell64 _ftelli64 -#define stat64 _stati64 -#endif #ifdef __FreeBSD__ typedef int64_t off64_t; diff --git a/utils/idbdatafile/tdriver.cpp b/utils/idbdatafile/tdriver.cpp index 42b468737e..185d06bdfe 100644 --- a/utils/idbdatafile/tdriver.cpp +++ b/utils/idbdatafile/tdriver.cpp @@ -16,9 +16,7 @@ MA 02110-1301, USA. */ #include -#ifndef _MSC_VER #include -#endif #include #include #include diff --git a/utils/idbdatafile/utility.h b/utils/idbdatafile/utility.h index 90dd745ab3..18dae9005d 100644 --- a/utils/idbdatafile/utility.h +++ b/utils/idbdatafile/utility.h @@ -65,50 +65,5 @@ inline int modeStrToFlags(const char* mode) } } -#ifdef _MSC_VER -inline int modeStrToFlags(const char* mode, int& createflags) -{ - std::string modestr = mode; - createflags = 0; - - // this could easily be migrated to a lookup table if performance - // ever became a concern, but for now this is fine. - if (modestr == "r" || modestr == "rb") - { - createflags = OPEN_EXISTING; - return GENERIC_READ; - } - else if (modestr == "r+" || modestr == "r+b") - { - createflags = OPEN_EXISTING; - return GENERIC_READ | GENERIC_WRITE; - } - else if (modestr == "w" || modestr == "wb") - { - createflags = CREATE_ALWAYS; - return GENERIC_WRITE; - } - else if (modestr == "w+" || modestr == "w+b") - { - createflags = CREATE_ALWAYS; - return GENERIC_READ | GENERIC_WRITE; - } - else if (modestr == "a" || modestr == "ab") - { - createflags = OPEN_ALWAYS; - return FILE_APPEND_DATA; - } - else if (modestr == "a+" || modestr == "a+b") - { - createflags = OPEN_ALWAYS; - return GENERIC_READ | FILE_APPEND_DATA; - } - else - { - // error - return -1; - } -} -#endif } // namespace idbdatafile diff --git a/utils/joiner/joinpartition.cpp b/utils/joiner/joinpartition.cpp index 75680ca88c..1b9d414a4f 100644 --- a/utils/joiner/joinpartition.cpp +++ b/utils/joiner/joinpartition.cpp @@ -31,19 +31,6 @@ using namespace rowgroup; using namespace messageqcpp; using namespace logging; -#ifdef _MSC_VER -namespace -{ -// returns a value between 0 and RAND_MAX (on Linux this is the max signed int) -int rand_r(unsigned int* seedp) -{ - unsigned int randval = 0; - rand_s(&randval); // returns 0 if okay, 0<=randval #include #include -#ifndef _MSC_VER #include -#else -#include -#endif #include "hasher.h" #include "lbidlist.h" diff --git a/utils/joiner/tuplejoiner.h b/utils/joiner/tuplejoiner.h index 61567dd38d..dd05fe2773 100644 --- a/utils/joiner/tuplejoiner.h +++ b/utils/joiner/tuplejoiner.h @@ -24,11 +24,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "rowgroup.h" #include "joiner.h" diff --git a/utils/json/json.hpp b/utils/json/json.hpp index e40e3b05bd..c6e0993206 100644 --- a/utils/json/json.hpp +++ b/utils/json/json.hpp @@ -273,8 +273,6 @@ inline bool operator<(const value_t lhs, const value_t rhs) noexcept #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) #elif defined(_MSC_FULL_VER) && !defined(__ICL) #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) -#elif defined(_MSC_VER) && !defined(__ICL) - #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) #endif #if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) @@ -282,10 +280,6 @@ inline bool operator<(const value_t lhs, const value_t rhs) noexcept #endif #if !defined(JSON_HEDLEY_MSVC_VERSION) #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) -#elif defined(_MSC_VER) && (_MSC_VER >= 1400) - #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) -#elif defined(_MSC_VER) && (_MSC_VER >= 1200) - #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) #else #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) #endif @@ -2367,10 +2361,6 @@ using is_detected_convertible = #endif // no filesystem support before MSVC 19.14: https://en.cppreference.com/w/cpp/compiler_support - #if defined(_MSC_VER) && _MSC_VER < 1914 - #undef JSON_HAS_FILESYSTEM - #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM - #endif // no filesystem support before iOS 13 #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000 @@ -17460,14 +17450,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec #ifdef _WIN32 result["platform"] = "win32"; -#elif defined __linux__ - result["platform"] = "linux"; -#elif defined __APPLE__ - result["platform"] = "apple"; -#elif defined __unix__ - result["platform"] = "unix"; #else - result["platform"] = "unknown"; + result["platform"] = "linux"; #endif #if defined(__ICC) || defined(__INTEL_COMPILER) @@ -17480,8 +17464,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec result["compiler"] = "hp" #elif defined(__IBMCPP__) result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}}; -#elif defined(_MSC_VER) - result["compiler"] = {{"family", "msvc"}, {"version", _MSC_VER}}; #elif defined(__PGI) result["compiler"] = {{"family", "pgcpp"}, {"version", __PGI}}; #elif defined(__SUNPRO_CC) diff --git a/utils/loggingcpp/messagelog.cpp b/utils/loggingcpp/messagelog.cpp index b5ffed3e31..7c0efd21d0 100644 --- a/utils/loggingcpp/messagelog.cpp +++ b/utils/loggingcpp/messagelog.cpp @@ -89,17 +89,7 @@ string timestr() struct tm tm; struct timeval tv; gettimeofday(&tv, 0); -#ifdef _MSC_VER - errno_t p = 0; - time_t t = (time_t)tv.tv_sec; - p = localtime_s(&tm, &t); - - if (p != 0) - memset(&tm, 0, sizeof(tm)); - -#else localtime_r(&tv.tv_sec, &tm); -#endif ostringstream oss; oss << setfill('0') << setw(2) << tm.tm_sec << '.' << setw(6) << tv.tv_usec; diff --git a/utils/messageqcpp/bytestream.cpp b/utils/messageqcpp/bytestream.cpp index e65102df37..828c92969f 100644 --- a/utils/messageqcpp/bytestream.cpp +++ b/utils/messageqcpp/bytestream.cpp @@ -625,30 +625,6 @@ void ByteStream::needAtLeast(size_t amount) growBuf(fMaxLen + amount); } -#ifdef _MSC_VER -#if BOOST_VERSION < 104500 -ByteStream& ByteStream::operator<<(const uint32_t ui) -{ - if (fBuf == 0 || (fCurInPtr - fBuf + 4U > fMaxLen + ISSOverhead)) - growBuf(fMaxLen + BlockSize); - - uint32_t q = ui; - *((uint32_t*)fCurInPtr) = q; - fCurInPtr += 4; - - return *this; -} - -ByteStream& ByteStream::operator>>(uint32_t& ui) -{ - uint32_t q; - peek(q); - fCurOutPtr += 4; - ui = q; - return *this; -} -#endif -#endif ByteStream& ByteStream::operator<<(const ByteStream& bs) { diff --git a/utils/messageqcpp/bytestream.h b/utils/messageqcpp/bytestream.h index 3fd0ede49f..02a4cd645e 100644 --- a/utils/messageqcpp/bytestream.h +++ b/utils/messageqcpp/bytestream.h @@ -39,11 +39,7 @@ class ByteStreamTestSuite; -#if defined(_MSC_VER) && defined(xxxBYTESTREAM_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace messageqcpp { @@ -126,15 +122,6 @@ class ByteStream : public Serializeable * push a uint32_t onto the end of the stream. The byte order is whatever the native byte order is. */ EXPORT ByteStream& operator<<(const uint32_t q); -#ifdef _MSC_VER -#if BOOST_VERSION < 104500 - // These 2 are to make MS VC++ w/ boost < 1.45 happy - // TODO: Do we still need these? - EXPORT ByteStream& operator<<(const uint32_t ui); - - EXPORT ByteStream& operator>>(uint32_t& ui); -#endif -#endif /** * push an int64_t onto the end of the stream. The byte order is whatever the native byte order is. */ @@ -673,11 +660,6 @@ void deserializeVector(ByteStream& bs, std::vector& v) } } -#ifdef _MSC_VER -// Until the API is fixed to be 64-bit clean... -#pragma warning(push) -#pragma warning(disable : 4267) -#endif template void serializeInlineVector(ByteStream& bs, const std::vector& v) @@ -712,9 +694,6 @@ void deserializeInlineVector(ByteStream& bs, std::vector& v) } } -#ifdef _MSC_VER -#pragma warning(pop) -#endif inline void deserializeVector(ByteStream& bs, std::vector& v) { diff --git a/utils/messageqcpp/compressed_iss.cpp b/utils/messageqcpp/compressed_iss.cpp index 4eba6405f6..82fdf05148 100644 --- a/utils/messageqcpp/compressed_iss.cpp +++ b/utils/messageqcpp/compressed_iss.cpp @@ -25,16 +25,6 @@ #include #include #include -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#include -#include -#include -#include -#else #if __FreeBSD__ #include #include @@ -47,7 +37,6 @@ #include #include #include -#endif #include "compressed_iss.h" #include "iosocket.h" diff --git a/utils/messageqcpp/compressed_iss.h b/utils/messageqcpp/compressed_iss.h index ea1fea1414..e862914148 100644 --- a/utils/messageqcpp/compressed_iss.h +++ b/utils/messageqcpp/compressed_iss.h @@ -24,9 +24,7 @@ #pragma once #include -#ifndef _MSC_VER #include -#endif #include "socket.h" #include "iosocket.h" diff --git a/utils/messageqcpp/inetstreamsocket.cpp b/utils/messageqcpp/inetstreamsocket.cpp index 686b5e8bd8..61ec082d1f 100644 --- a/utils/messageqcpp/inetstreamsocket.cpp +++ b/utils/messageqcpp/inetstreamsocket.cpp @@ -48,16 +48,6 @@ either expressed or implied, of the FreeBSD Project. #include #include -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#include -#include -#include -#include -#else #if __FreeBSD__ #include #include @@ -71,7 +61,6 @@ either expressed or implied, of the FreeBSD Project. #include #include #include -#endif #include #include #include @@ -108,9 +97,6 @@ namespace // read(), so adding logic to retry after ERESTARTSYS the way we do for EINTR. // const int KERR_ERESTARTSYS = 512; -#ifdef _MSC_VER -const int MaxSendPacketSize = 64 * 1024; -#endif int in_cksum(unsigned short* buf, int sz) { @@ -168,32 +154,6 @@ void InetStreamSocket::open() if (sd < 0) { -#ifdef _MSC_VER - int wsaError = WSAGetLastError(); - - if (wsaError == WSANOTINITIALISED) - { - WSAData wsadata; - const WORD minVersion = MAKEWORD(2, 2); - - if (WSAStartup(minVersion, &wsadata) == 0) - { - if (wsadata.wVersion == minVersion) - { - sd = ::socket(fSocketParms.domain(), fSocketParms.type(), fSocketParms.protocol()); - e = errno; - - if (sd >= 0) - goto setopts; - } - - // Didn't get the required min version, error out - } - - // WSAStartup failed, continue to report error - } - -#endif string msg = "InetStreamSocket::open: socket() error: "; scoped_array buf(new char[80]); #if STRERROR_R_CHAR_P @@ -212,9 +172,6 @@ void InetStreamSocket::open() throw runtime_error(msg); } -#ifdef _MSC_VER -setopts: -#endif /* XXXPAT: If we have latency problems again, try these... bufferSizeSize = 4; @@ -253,11 +210,7 @@ void InetStreamSocket::close() if (isOpen()) { ::shutdown(fSocketParms.sd(), SHUT_RDWR); -#ifdef _MSC_VER - ::closesocket(fSocketParms.sd()); -#else ::close(fSocketParms.sd()); -#endif fSocketParms.sd(-1); } } @@ -408,27 +361,11 @@ bool InetStreamSocket::readToMagic(long msecs, bool* isTimeOut, Stats* stats) co fMagicBuffer = fMagicBuffer >> 8; retry: -#ifdef _MSC_VER - err = ::recv(fSocketParms.sd(), (char*)&magicBuffer8[3], 1, 0); -#else err = ::read(fSocketParms.sd(), &magicBuffer8[3], 1); -#endif if (err < 0) { int e = errno; -#ifdef _MSC_VER - - if (WSAGetLastError() == WSAECONNRESET) - { - // throw runtime_error("connection reset by peer"); - if (msecs < 0) - return false; - else - throw SocketClosed("InetStreamSocket::readToMagic: Remote is closed"); - } - -#endif if (e == EINTR) { @@ -444,9 +381,6 @@ bool InetStreamSocket::readToMagic(long msecs, bool* isTimeOut, Stats* stats) co ostringstream oss; oss << "InetStreamSocket::readToMagic(): I/O error2.1: " << "err = " << err << " e = " << e << -#ifdef _MSC_VER - " WSA error = " << WSAGetLastError() << -#endif ": " << strerror(e); throw runtime_error(oss.str()); } @@ -500,14 +434,7 @@ bool InetStreamSocket::readFixedSizeData(struct pollfd* pfd, uint8_t* buffer, co } } -#ifdef _MSC_VER - currentBytesRead = - ::recv(fSocketParms.sd(), (char*)(buffer + bytesRead), - std::min(numberOfBytes - bytesRead, reinterpret_cast(MaxSendPacketSize)); - readAmoumt, 0); -#else currentBytesRead = ::read(fSocketParms.sd(), buffer + bytesRead, numberOfBytes - bytesRead); -#endif if (currentBytesRead == 0) { @@ -742,9 +669,7 @@ void InetStreamSocket::bind(const sockaddr* serv_addr) void InetStreamSocket::listen(int backlog) { -#ifndef _MSC_VER fcntl(socketParms().sd(), F_SETFD, fcntl(socketParms().sd(), F_GETFD) | FD_CLOEXEC); -#endif if (::listen(socketParms().sd(), backlog) != 0) { @@ -879,17 +804,6 @@ void InetStreamSocket::connect(const sockaddr* serv_addr) { int e = errno; string msg = "InetStreamSocket::connect: connect() error: "; -#ifdef _MSC_VER - char m[80]; - int x = WSAGetLastError(); - - if (x == WSAECONNREFUSED) - strcpy(m, "connection refused"); - else - sprintf(m, "%d 0x%x", x, x); - - msg += m; -#else scoped_array buf(new char[80]); #if STRERROR_R_CHAR_P const char* p; @@ -903,7 +817,6 @@ void InetStreamSocket::connect(const sockaddr* serv_addr) if ((p = strerror_r(e, buf.get(), 80)) == 0) msg += buf.get(); -#endif #endif msg += " to: " + toString(); throw runtime_error(msg); @@ -931,13 +844,8 @@ void InetStreamSocket::connect(const sockaddr* serv_addr) // success if (ret == 1) { -#ifdef _MSC_VER - char buf = '\0'; - (void)::recv(socketParms().sd(), &buf, 1, 0); -#else char buf = '\0'; std::ignore = ::read(socketParms().sd(), &buf, 1); // we know 1 byte is in the recv buffer -#endif return; } @@ -973,9 +881,7 @@ const string InetStreamSocket::toString() const char buf[INET_ADDRSTRLEN]; const SocketParms& sp = fSocketParms; oss << "InetStreamSocket: sd: " << sp.sd() << -#ifndef _MSC_VER " inet: " << inet_ntop(AF_INET, &fSa.sin_addr, buf, INET_ADDRSTRLEN) << -#endif " port: " << ntohs(fSa.sin_port); return oss.str(); } @@ -1013,13 +919,7 @@ ssize_t InetStreamSocket::written(int fd, const uint8_t* ptr, size_t nbytes) con while (nleft > 0) { // the O_NONBLOCK flag is not set, this is a blocking I/O. -#ifdef _MSC_VER - int writeAmount = std::min((int)nleft, MaxSendPacketSize); - - if ((nwritten = ::send(fd, bufp, writeAmount, 0)) < 0) -#else if ((nwritten = ::write(fd, bufp, nleft)) < 0) -#endif { if (errno == EINTR) nwritten = 0; @@ -1056,13 +956,8 @@ ssize_t InetStreamSocket::written(int fd, const uint8_t* ptr, size_t nbytes) con const string InetStreamSocket::addr2String() const { string s; -#ifdef _MSC_VER - // This is documented to be thread-safe in Windows - s = inet_ntoa(fSa.sin_addr); -#else char dst[INET_ADDRSTRLEN]; s = inet_ntop(AF_INET, &fSa.sin_addr, dst, INET_ADDRSTRLEN); -#endif return s; } @@ -1094,7 +989,6 @@ int InetStreamSocket::ping(const std::string& ipaddr, const struct timespec* tim if (timeout) msecs = timeout->tv_sec * 1000 + timeout->tv_nsec / 1000000; -#ifndef _MSC_VER int pingsock; pingsock = ::socket(PF_INET, SOCK_RAW, IPPROTO_ICMP); @@ -1153,43 +1047,6 @@ int InetStreamSocket::ping(const std::string& ipaddr, const struct timespec* tim ::close(pingsock); -#else // Windows version - HANDLE icmpFile; - icmpFile = IcmpCreateFile(); - - if (icmpFile == INVALID_HANDLE_VALUE) - return -1; - - DWORD ret; - const size_t PingPktSize = 1024; - char rqd[PingPktSize]; - WORD rqs = PingPktSize; - char rpd[PingPktSize]; - DWORD rps = PingPktSize; - - ZeroMemory(rqd, PingPktSize); - ZeroMemory(rpd, PingPktSize); - - rqs = 64; - - ret = IcmpSendEcho(icmpFile, pingaddr.sin_addr.s_addr, rqd, rqs, 0, rpd, rps, msecs); - - if (ret <= 0) - { - IcmpCloseHandle(icmpFile); - return -1; - } - - PICMP_ECHO_REPLY echoReply = (PICMP_ECHO_REPLY)rpd; - - if (echoReply->Status != IP_SUCCESS) - { - IcmpCloseHandle(icmpFile); - return -1; - } - - IcmpCloseHandle(icmpFile); -#endif return 0; } diff --git a/utils/messageqcpp/inetstreamsocket.h b/utils/messageqcpp/inetstreamsocket.h index 1e69ee670b..fa9a949155 100644 --- a/utils/messageqcpp/inetstreamsocket.h +++ b/utils/messageqcpp/inetstreamsocket.h @@ -25,20 +25,14 @@ #include #include -#ifndef _MSC_VER #include -#endif #include #include "socket.h" #include "socketparms.h" #include "bytestream.h" -#if defined(_MSC_VER) && defined(xxxINETSTREAMSOCKET_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif class MessageQTestSuite; diff --git a/utils/messageqcpp/iosocket.cpp b/utils/messageqcpp/iosocket.cpp index 16bedf54f5..581ba93bf5 100644 --- a/utils/messageqcpp/iosocket.cpp +++ b/utils/messageqcpp/iosocket.cpp @@ -27,14 +27,8 @@ using namespace std; #include -#ifdef _MSC_VER -#include -#include -#include -#else #include #include -#endif #define IOSOCKET_DLLEXPORT #include "iosocket.h" @@ -85,9 +79,7 @@ const string IOSocket::toString() const SocketParms sp = fSocket->socketParms(); const sockaddr_in* sinp = reinterpret_cast(&fSa); oss << "IOSocket: sd: " << sp.sd() << -#ifndef _MSC_VER " inet: " << inet_ntop(AF_INET, &sinp->sin_addr, buf, INET_ADDRSTRLEN) << -#endif " port: " << ntohs(sinp->sin_port); return oss.str(); #endif diff --git a/utils/messageqcpp/iosocket.h b/utils/messageqcpp/iosocket.h index 965caae1aa..d1cc3ef499 100644 --- a/utils/messageqcpp/iosocket.h +++ b/utils/messageqcpp/iosocket.h @@ -27,13 +27,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#include -#include -#else #include -#endif #if __FreeBSD__ #include #endif @@ -45,11 +39,7 @@ class MessageQTestSuite; -#if defined(_MSC_VER) && defined(xxxIOSOCKET_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace messageqcpp { diff --git a/utils/messageqcpp/messagequeue.cpp b/utils/messageqcpp/messagequeue.cpp index 73ba6d09e6..564c90b54d 100644 --- a/utils/messageqcpp/messagequeue.cpp +++ b/utils/messageqcpp/messagequeue.cpp @@ -28,15 +28,9 @@ using namespace std; #include #include -#ifdef _MSC_VER -#include -#include -#include -#else #include #include #include -#endif #include "configcpp.h" using namespace config; diff --git a/utils/messageqcpp/messagequeue.h b/utils/messageqcpp/messagequeue.h index f721745e65..197a27e3b4 100644 --- a/utils/messageqcpp/messagequeue.h +++ b/utils/messageqcpp/messagequeue.h @@ -26,14 +26,8 @@ #include #include -#ifdef _MSC_VER -#include -#include -#include -#else #include #include -#endif #include "serversocket.h" #include "iosocket.h" @@ -46,11 +40,7 @@ class Config; class MessageQTestSuite; -#if defined(_MSC_VER) && defined(xxxMESSAGEQUEUE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace messageqcpp { diff --git a/utils/messageqcpp/serversocket.h b/utils/messageqcpp/serversocket.h index 322ad38718..e658d5be13 100644 --- a/utils/messageqcpp/serversocket.h +++ b/utils/messageqcpp/serversocket.h @@ -24,13 +24,7 @@ #pragma once #include -#ifdef _MSC_VER -#include -#include -#include -#else #include -#endif class MessageQTestSuite; diff --git a/utils/querytele/queryteleclient.h b/utils/querytele/queryteleclient.h index dd9b7f2636..c2d0fa9d5d 100644 --- a/utils/querytele/queryteleclient.h +++ b/utils/querytele/queryteleclient.h @@ -26,11 +26,7 @@ #include "queryteleserverparms.h" #include "querystepparms.h" -#if defined(_MSC_VER) && defined(LIBQUERYTELE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace querytele { diff --git a/utils/querytele/queryteleprotoimpl.cpp b/utils/querytele/queryteleprotoimpl.cpp index e16417e159..0ced86620a 100644 --- a/utils/querytele/queryteleprotoimpl.cpp +++ b/utils/querytele/queryteleprotoimpl.cpp @@ -83,11 +83,7 @@ string get_trace_file() { ostringstream oss; pid_t pid = getpid(); -#ifdef _MSC_VER - DWORD threadid = GetCurrentThreadId(); -#else pthread_t threadid = pthread_self(); -#endif oss << "/tmp/qt-consumer-" << pid << "-" << threadid; return oss.str(); diff --git a/utils/regr/corr.h b/utils/regr/corr.h index 50e4f91f93..7a8bba0832 100644 --- a/utils/regr/corr.h +++ b/utils/regr/corr.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/covar_pop.h b/utils/regr/covar_pop.h index 3bbcf59c9e..43a9daeccb 100644 --- a/utils/regr/covar_pop.h +++ b/utils/regr/covar_pop.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/covar_samp.h b/utils/regr/covar_samp.h index add6e1755e..0da83f2e29 100644 --- a/utils/regr/covar_samp.h +++ b/utils/regr/covar_samp.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/moda.h b/utils/regr/moda.h index 2d3d9fb99d..6d5916ac0a 100644 --- a/utils/regr/moda.h +++ b/utils/regr/moda.h @@ -47,11 +47,7 @@ #include "hasher.h" #include "collation.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/modamysql.cpp b/utils/regr/modamysql.cpp index 487740c526..c16a210087 100644 --- a/utils/regr/modamysql.cpp +++ b/utils/regr/modamysql.cpp @@ -19,11 +19,7 @@ inline bool isNumeric(int type, const char* attr) { return true; } -#if _MSC_VER - if (_strnicmp("NULL", attr, 4) == 0)) -#else if (strncasecmp("NULL", attr, 4) == 0) -#endif { return true; } @@ -80,9 +76,6 @@ void moda(CONTAINER& container, struct moda_data* data) extern "C" { -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool moda_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct moda_data* data; @@ -109,9 +102,6 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void moda_deinit(UDF_INIT* initid) { struct moda_data* data = (struct moda_data*)initid->ptr; @@ -119,9 +109,6 @@ extern "C" delete data; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void moda_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -129,9 +116,6 @@ extern "C" data->clear(); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void moda_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { // Test for NULL @@ -171,9 +155,6 @@ extern "C" } } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void moda_remove(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { // Test for NULL @@ -212,9 +193,6 @@ extern "C" } } -#ifdef _MSC_VER - __declspec(dllexport) -#endif //char* moda(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error __attribute__((unused))) char* moda(UDF_INIT * initid, UDF_ARGS * args, char* result, ulong* res_length, char* is_null, char* error __attribute__((unused))) { diff --git a/utils/regr/regr_avgx.h b/utils/regr/regr_avgx.h index c358b34057..6dd8e268d2 100644 --- a/utils/regr/regr_avgx.h +++ b/utils/regr/regr_avgx.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regr_avgy.h b/utils/regr/regr_avgy.h index 4ae9b3feaa..483b0f2dbb 100644 --- a/utils/regr/regr_avgy.h +++ b/utils/regr/regr_avgy.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regr_count.h b/utils/regr/regr_count.h index 0f587ee996..1286a5c11b 100644 --- a/utils/regr/regr_count.h +++ b/utils/regr/regr_count.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regr_intercept.h b/utils/regr/regr_intercept.h index 3457743842..ffbc555349 100644 --- a/utils/regr/regr_intercept.h +++ b/utils/regr/regr_intercept.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regr_r2.h b/utils/regr/regr_r2.h index e50c133832..23f3d2fd5f 100644 --- a/utils/regr/regr_r2.h +++ b/utils/regr/regr_r2.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regr_slope.h b/utils/regr/regr_slope.h index 95beb898ad..1a69f99ef2 100644 --- a/utils/regr/regr_slope.h +++ b/utils/regr/regr_slope.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regr_sxx.h b/utils/regr/regr_sxx.h index 04ca933ec1..96f14a250a 100644 --- a/utils/regr/regr_sxx.h +++ b/utils/regr/regr_sxx.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regr_sxy.h b/utils/regr/regr_sxy.h index bdfffc14a9..91418bec59 100644 --- a/utils/regr/regr_sxy.h +++ b/utils/regr/regr_sxy.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regr_syy.h b/utils/regr/regr_syy.h index b8e5d89199..7e017c6377 100644 --- a/utils/regr/regr_syy.h +++ b/utils/regr/regr_syy.h @@ -33,21 +33,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/regr/regrmysql.cpp b/utils/regr/regrmysql.cpp index d9e9a51b6c..8700e9952f 100644 --- a/utils/regr/regrmysql.cpp +++ b/utils/regr/regrmysql.cpp @@ -15,11 +15,7 @@ inline bool isNumeric(int type, const char* attr) { return true; } -#if _MSC_VER - if (_strnicmp("NULL", attr, 4) == 0)) -#else if (strncasecmp("NULL", attr, 4) == 0) -#endif { return true; } @@ -81,9 +77,6 @@ extern "C" int64_t cnt; }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_avgx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_avgx_data* data; @@ -114,17 +107,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_avgx_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_avgx_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -133,9 +120,6 @@ extern "C" data->cnt = 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_avgx_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -150,9 +134,6 @@ extern "C" data->sumx += xval; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double regr_avgx(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -181,9 +162,6 @@ extern "C" int64_t cnt; }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_avgy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_avgy_data* data; @@ -215,17 +193,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_avgy_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_avgy_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -234,9 +206,6 @@ extern "C" data->cnt = 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_avgy_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -251,9 +220,6 @@ extern "C" data->sumy += yval; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double regr_avgy(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -280,9 +246,6 @@ extern "C" int64_t cnt; }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_count_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_count_data* data; @@ -303,17 +266,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_count_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_count_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -321,9 +278,6 @@ extern "C" data->cnt = 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_count_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -336,9 +290,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long regr_count(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -360,9 +311,6 @@ extern "C" long double sumxy; // sum of (x*y) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_slope_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_slope_data* data; @@ -395,17 +343,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_slope_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_slope_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -417,9 +359,6 @@ extern "C" data->sumxy = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_slope_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -438,9 +377,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double regr_slope(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -479,9 +415,6 @@ extern "C" long double sumxy; // sum of (x*y) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_intercept_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_intercept_data* data; @@ -513,17 +446,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_intercept_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_intercept_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -535,9 +462,6 @@ extern "C" data->sumxy = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_intercept_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -556,9 +480,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double regr_intercept(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -598,9 +519,6 @@ extern "C" long double sumxy; // sum of (x*y) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_r2_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_r2_data* data; @@ -634,17 +552,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_r2_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_r2_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -657,9 +569,6 @@ extern "C" data->sumxy = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_r2_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { // Test for NULL in x and y @@ -678,9 +587,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double regr_r2(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -735,9 +641,6 @@ extern "C" long double sumxy; // sum of (x*y) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool corr_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct corr_data* data; @@ -771,17 +674,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void corr_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void corr_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -794,9 +691,6 @@ extern "C" data->sumxy = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void corr_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { // Test for NULL in x and y @@ -815,9 +709,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double corr(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -869,9 +760,6 @@ extern "C" long double sumx2; // sum of (x squared) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_sxx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_sxx_data* data; @@ -901,17 +789,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_sxx_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_sxx_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -921,9 +803,6 @@ extern "C" data->sumx2 = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_sxx_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -939,9 +818,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double regr_sxx(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -975,9 +851,6 @@ extern "C" long double sumy2; // sum of (y squared) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_syy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_syy_data* data; @@ -1007,17 +880,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_syy_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_syy_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -1027,9 +894,6 @@ extern "C" data->sumy2 = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_syy_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -1045,9 +909,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double regr_syy(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -1083,9 +944,6 @@ extern "C" long double sumxy; // sum of (x*y) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool regr_sxy_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct regr_sxy_data* data; @@ -1117,17 +975,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_sxy_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_sxy_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -1138,9 +990,6 @@ extern "C" data->sumxy = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void regr_sxy_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -1158,9 +1007,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double regr_sxy(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -1195,9 +1041,6 @@ extern "C" long double sumxy; // sum of (x*y) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool covar_pop_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct covar_pop_data* data; @@ -1229,17 +1072,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void covar_pop_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void covar_pop_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -1250,9 +1087,6 @@ extern "C" data->sumxy = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void covar_pop_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -1270,9 +1104,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double covar_pop(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -1306,9 +1137,6 @@ extern "C" long double sumxy; // sum of (x*y) }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool covar_samp_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct covar_samp_data* data; @@ -1340,17 +1168,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void covar_samp_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void covar_samp_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -1361,9 +1183,6 @@ extern "C" data->sumxy = 0.0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void covar_samp_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -1381,9 +1200,6 @@ extern "C" ++data->cnt; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double covar_samp(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { diff --git a/utils/rowgroup/rowaggregation.cpp b/utils/rowgroup/rowaggregation.cpp index c637ef1682..b66c403c36 100644 --- a/utils/rowgroup/rowaggregation.cpp +++ b/utils/rowgroup/rowaggregation.cpp @@ -3574,11 +3574,7 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData case execplan::CalpontSystemCatalog::FLOAT: case execplan::CalpontSystemCatalog::UFLOAT: { -#ifdef _MSC_VER - fRow.setFloatField(strtod(aggData.fConstValue.c_str(), 0), colOut); -#else fRow.setFloatField(strtof(aggData.fConstValue.c_str(), nullptr), colOut); -#endif } break; @@ -3714,11 +3710,7 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData case execplan::CalpontSystemCatalog::UFLOAT: { double flt; -#ifdef _MSC_VER - flt = strtod(aggData.fConstValue.c_str(), 0) * rowCnt; -#else flt = strtof(aggData.fConstValue.c_str(), nullptr) * rowCnt; -#endif fRow.setFloatField(flt, colOut); } break; @@ -3916,11 +3908,7 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData case execplan::CalpontSystemCatalog::FLOAT: case execplan::CalpontSystemCatalog::UFLOAT: { -#ifdef _MSC_VER - datum.columnData = strtod(aggData.fConstValue.c_str(), 0); -#else datum.columnData = strtof(aggData.fConstValue.c_str(), nullptr); -#endif } break; diff --git a/utils/rowgroup/rowaggregation.h b/utils/rowgroup/rowaggregation.h index 185e6c101b..901c8eb3dd 100644 --- a/utils/rowgroup/rowaggregation.h +++ b/utils/rowgroup/rowaggregation.h @@ -32,13 +32,8 @@ #include #include #include -#ifdef _MSC_VER -#include -#include -#else #include #include -#endif #include #include #include diff --git a/utils/rowgroup/rowgroup.h b/utils/rowgroup/rowgroup.h index a2e21ff4e0..8ccf367452 100644 --- a/utils/rowgroup/rowgroup.h +++ b/utils/rowgroup/rowgroup.h @@ -37,13 +37,8 @@ #include #include #include -#ifdef __linux__ #include -#endif -#if defined(_MSC_VER) && !defined(isnan) -#define isnan _isnan -#endif #include "hasher.h" @@ -122,10 +117,6 @@ const int16_t rgCommonSize = 8192; // VS'08 carps that struct MemChunk is not default copyable because of the zero-length array. // This may be so, and we'll get link errors if someone trys, but so far no one has. -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4200) -#endif // Helper to get a value from nested vector pointers. template @@ -249,9 +240,6 @@ class UserDataStore boost::mutex fMutex; }; -#ifdef _MSC_VER -#pragma warning(pop) -#endif class RowGroup; class Row; diff --git a/utils/rwlock/rwlock.cpp b/utils/rwlock/rwlock.cpp index ca7b82e9dd..fde95640cb 100644 --- a/utils/rwlock/rwlock.cpp +++ b/utils/rwlock/rwlock.cpp @@ -26,11 +26,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #ifndef NDEBUG #define NDEBUG @@ -244,22 +240,14 @@ void RWLock::down(int num, bool block) catch (std::exception& ex) { cerr << -#ifdef _MSC_VER - __FUNCTION__ << -#else __PRETTY_FUNCTION__ << -#endif ":" << __LINE__ << ": caught an exception: " << ex.what() << endl; throw; } catch (...) { cerr << -#ifdef _MSC_VER - __FUNCTION__ << -#else __PRETTY_FUNCTION__ << -#endif ":" << __LINE__ << ": caught an exception" << endl; throw runtime_error("RWLock::down(): caught an exception"); } @@ -306,22 +294,14 @@ bool RWLock::timed_down(int num, const ptime& delay) catch (std::exception& ex) { cerr << -#ifdef _MSC_VER - __FUNCTION__ << -#else __PRETTY_FUNCTION__ << -#endif ":" << __LINE__ << ": caught an exception: " << ex.what() << endl; throw; } catch (...) { cerr << -#ifdef _MSC_VER - __FUNCTION__ << -#else __PRETTY_FUNCTION__ << -#endif ":" << __LINE__ << ": caught an exception" << endl; throw runtime_error("RWLock::timed_down(): caught an exception"); } diff --git a/utils/rwlock/rwlock.h b/utils/rwlock/rwlock.h index f5be4e170f..575c8854fc 100644 --- a/utils/rwlock/rwlock.h +++ b/utils/rwlock/rwlock.h @@ -37,11 +37,7 @@ #include #include -#if defined(_MSC_VER) && defined(xxxRWLOCK_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace rwlock { @@ -64,19 +60,11 @@ class RWLockMonitor */ struct LockState { -#ifdef _MSC_VER - LONG writerswaiting; - LONG writing; - LONG readerswaiting; - LONG reading; - bool mutexLocked; -#else int writerswaiting; int writing; int readerswaiting; int reading; bool mutexLocked; -#endif }; class RWLockShmImpl diff --git a/utils/rwlock/rwlock_local.h b/utils/rwlock/rwlock_local.h index 12a0fcf791..bce1b7c882 100644 --- a/utils/rwlock/rwlock_local.h +++ b/utils/rwlock/rwlock_local.h @@ -29,11 +29,7 @@ #include #include -#if defined(_MSC_VER) && defined(xxxRWLOCK_LOCAL_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace rwlock { diff --git a/utils/startup/installdir.cpp b/utils/startup/installdir.cpp index 2db2128dbb..b1fd1ffdd2 100644 --- a/utils/startup/installdir.cpp +++ b/utils/startup/installdir.cpp @@ -27,9 +27,6 @@ using namespace std; #include using namespace boost; -#ifdef _MSC_VER -#include "idbregistry.h" -#endif #include "installdir.h" #include "configcpp.h" @@ -54,16 +51,6 @@ const string StartUp::tmpDir() if (fTmpDirp) return *fTmpDirp; -#ifdef _MSC_VER - fTmpDirp = new string("C:\\Calpont\Tmp"); - string cfStr = IDBreadRegistry(""); - - if (!cfStr.empty()) - *fTmpDirp = cfStr; - - return *fTmpDirp; - -#else // check for non-root user /* const char* p = getenv("HOME"); @@ -108,7 +95,6 @@ const string StartUp::tmpDir() return TempFileDir; -#endif } } // namespace startup diff --git a/utils/threadpool/threadpool.h b/utils/threadpool/threadpool.h index adf9ee0300..d12d15390b 100644 --- a/utils/threadpool/threadpool.h +++ b/utils/threadpool/threadpool.h @@ -47,11 +47,7 @@ #include -#if defined(_MSC_VER) && defined(xxxTHREADPOOL_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace threadpool { diff --git a/utils/threadpool/tp.cpp b/utils/threadpool/tp.cpp index e626504a93..941aed8ec6 100644 --- a/utils/threadpool/tp.cpp +++ b/utils/threadpool/tp.cpp @@ -38,11 +38,7 @@ const string timeNow() struct tm ltm; char buf[32]; // ctime(3) says at least 26 size_t len = 0; -#ifdef _MSC_VER - asctime_s(buf, 32, localtime_r(&outputTime, <m)); -#else asctime_r(localtime_r(&outputTime, <m), buf); -#endif len = strlen(buf); if (len > 0) diff --git a/utils/udfsdk/allnull.h b/utils/udfsdk/allnull.h index 6df619c8bb..497cf985a1 100644 --- a/utils/udfsdk/allnull.h +++ b/utils/udfsdk/allnull.h @@ -47,21 +47,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/udfsdk/avg_mode.h b/utils/udfsdk/avg_mode.h index 93442815a8..023522bbde 100644 --- a/utils/udfsdk/avg_mode.h +++ b/utils/udfsdk/avg_mode.h @@ -55,21 +55,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/udfsdk/avgx.h b/utils/udfsdk/avgx.h index 80687ccef7..7b2129c1fc 100644 --- a/utils/udfsdk/avgx.h +++ b/utils/udfsdk/avgx.h @@ -34,21 +34,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/udfsdk/distinct_count.h b/utils/udfsdk/distinct_count.h index 071cf52f41..695d99ff02 100644 --- a/utils/udfsdk/distinct_count.h +++ b/utils/udfsdk/distinct_count.h @@ -52,11 +52,7 @@ #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/udfsdk/docs/make.bat b/utils/udfsdk/docs/make.bat deleted file mode 100644 index 423c8b2c56..0000000000 --- a/utils/udfsdk/docs/make.bat +++ /dev/null @@ -1,281 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source -set I18NSPHINXOPTS=%SPHINXOPTS% source -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. epub3 to make an epub3 - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - echo. coverage to run coverage check of the documentation if enabled - echo. dummy to check syntax errors of document sources - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -REM Check if sphinx-build is available and fallback to Python version if any -%SPHINXBUILD% 1>NUL 2>NUL -if errorlevel 9009 goto sphinx_python -goto sphinx_ok - -:sphinx_python - -set SPHINXBUILD=python -m sphinx.__init__ -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -:sphinx_ok - - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\UDAF.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\UDAF.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "epub3" ( - %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "coverage" ( - %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage - if errorlevel 1 exit /b 1 - echo. - echo.Testing of coverage in the sources finished, look at the ^ -results in %BUILDDIR%/coverage/python.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -if "%1" == "dummy" ( - %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. Dummy builder generates no files. - goto end -) - -:end diff --git a/utils/udfsdk/docs/source/reference/MariaDBUDAF.rst b/utils/udfsdk/docs/source/reference/MariaDBUDAF.rst index d031705d88..5628d5b7a8 100644 --- a/utils/udfsdk/docs/source/reference/MariaDBUDAF.rst +++ b/utils/udfsdk/docs/source/reference/MariaDBUDAF.rst @@ -46,9 +46,6 @@ function_init() :: - #ifdef _MSC_VER - __declspec(dllexport) - #endif my_bool ssq_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct ssq_data* data; @@ -85,9 +82,6 @@ function_deinit() :: - #ifdef _MSC_VER - __declspec(dllexport) - #endif void ssq_deinit(UDF_INIT* initid) { free(initid->ptr); @@ -112,9 +106,6 @@ function_clear() :: - #ifdef _MSC_VER - __declspec(dllexport) - #endif void ssq_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) @@ -144,9 +135,6 @@ function_add() :: - #ifdef _MSC_VER - __declspec(dllexport) - #endif void ssq_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) @@ -177,9 +165,6 @@ function :: - #ifdef _MSC_VER - __declspec(dllexport) - #endif long long ssq(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { diff --git a/utils/udfsdk/mcsv1_udaf.h b/utils/udfsdk/mcsv1_udaf.h index 25dd8319fd..6f9392fa41 100644 --- a/utils/udfsdk/mcsv1_udaf.h +++ b/utils/udfsdk/mcsv1_udaf.h @@ -67,21 +67,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "any.hpp" #include "calpontsystemcatalog.h" #include "wf_frame.h" #include "my_decimal_limits.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/udfsdk/median.h b/utils/udfsdk/median.h index 827a70e6af..710411f95e 100644 --- a/utils/udfsdk/median.h +++ b/utils/udfsdk/median.h @@ -55,21 +55,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/udfsdk/ssq.h b/utils/udfsdk/ssq.h index 6279ba9b59..de6327edcd 100644 --- a/utils/udfsdk/ssq.h +++ b/utils/udfsdk/ssq.h @@ -55,21 +55,13 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "mcsv1_udaf.h" #include "calpontsystemcatalog.h" #include "windowfunctioncolumn.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace mcsv1sdk { diff --git a/utils/udfsdk/udfmysql.cpp b/utils/udfsdk/udfmysql.cpp index f32fc6b3af..5b25170c9e 100644 --- a/utils/udfsdk/udfmysql.cpp +++ b/utils/udfsdk/udfmysql.cpp @@ -55,9 +55,6 @@ extern "C" /** * MCS_ADD connector stub */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcs_add_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 2) @@ -69,16 +66,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcs_add_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif double mcs_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { double op1, op2; @@ -93,9 +84,6 @@ extern "C" * MCS_ISNULL connector stub */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool mcs_isnull_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -107,16 +95,10 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void mcs_isnull_deinit(UDF_INIT* initid) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long mcs_isnull(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error) { return 0; @@ -131,9 +113,6 @@ extern "C" ulonglong totalNulls; }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool allnull_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct allnull_data* data; @@ -157,17 +136,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void allnull_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long allnull(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -175,9 +148,6 @@ extern "C" return data->totalQuantity > 0 && data->totalNulls == data->totalQuantity; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void allnull_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -186,9 +156,6 @@ extern "C" data->totalNulls = 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void allnull_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { struct allnull_data* data = (struct allnull_data*)initid->ptr; @@ -209,9 +176,6 @@ extern "C" double sumsq; }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool ssq_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct ssq_data* data; @@ -234,17 +198,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void ssq_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void ssq_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -252,9 +210,6 @@ extern "C" data->sumsq = 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void ssq_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { struct ssq_data* data = (struct ssq_data*)initid->ptr; @@ -262,9 +217,6 @@ extern "C" data->sumsq = val * val; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long ssq(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -277,9 +229,6 @@ extern "C" /** * MEDIAN connector stub */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool median_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -301,17 +250,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void median_deinit(UDF_INIT* initid) { // free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void median_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -319,9 +262,6 @@ extern "C" // data->sumsq = 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void median_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { // struct ssq_data* data = (struct ssq_data*)initid->ptr; @@ -329,9 +269,6 @@ extern "C" // data->sumsq = val*val; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long median(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -343,9 +280,6 @@ extern "C" /** * avg_mode connector stub */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool avg_mode_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -367,17 +301,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void avg_mode_deinit(UDF_INIT* initid) { // free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void avg_mode_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -385,9 +313,6 @@ extern "C" // data->sumsq = 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void avg_mode_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { @@ -396,9 +321,6 @@ extern "C" // data->sumsq = val*val; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long avg_mode(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -420,9 +342,6 @@ extern "C" int64_t cnt; }; -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool avgx_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { struct avgx_data* data; @@ -444,17 +363,11 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void avgx_deinit(UDF_INIT* initid) { free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void avgx_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { @@ -463,9 +376,6 @@ extern "C" data->cnt = 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void avgx_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { // TODO test for NULL in x and y @@ -475,9 +385,6 @@ extern "C" data->sumx += xval; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long avgx(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { @@ -488,9 +395,6 @@ extern "C" /** * distinct_count connector stub */ -#ifdef _MSC_VER - __declspec(dllexport) -#endif my_bool distinct_count_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count != 1) @@ -502,33 +406,21 @@ extern "C" return 0; } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void distinct_count_deinit(UDF_INIT* initid) { // free(initid->ptr); } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void distinct_count_clear(UDF_INIT* initid, char* is_null __attribute__((unused)), char* message __attribute__((unused))) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif void distinct_count_add(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message __attribute__((unused))) { } -#ifdef _MSC_VER - __declspec(dllexport) -#endif long long distinct_count(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)), char* is_null, char* error __attribute__((unused))) { diff --git a/utils/udfsdk/udfsdk.h b/utils/udfsdk/udfsdk.h index 6c0ee013b5..131b9459ad 100644 --- a/utils/udfsdk/udfsdk.h +++ b/utils/udfsdk/udfsdk.h @@ -47,11 +47,7 @@ #include "funcexp.h" #include "functor.h" -#if defined(_MSC_VER) && defined(UDFSDK_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace udfsdk { diff --git a/utils/windowfunction/idborderby.h b/utils/windowfunction/idborderby.h index 7483c7cfbf..dee63bd038 100644 --- a/utils/windowfunction/idborderby.h +++ b/utils/windowfunction/idborderby.h @@ -29,11 +29,7 @@ #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "rowgroup.h" #include "hasher.h" diff --git a/utils/windowfunction/wf_udaf.h b/utils/windowfunction/wf_udaf.h index 54b2085ebd..81cdee4814 100644 --- a/utils/windowfunction/wf_udaf.h +++ b/utils/windowfunction/wf_udaf.h @@ -19,11 +19,7 @@ #pragma once -#ifndef _MSC_VER #include -#else -#include -#endif #include "windowfunctiontype.h" #include "mcsv1_udaf.h" diff --git a/versioning/BRM/autoincrementmanager.h b/versioning/BRM/autoincrementmanager.h index 3715552366..ff801bf681 100644 --- a/versioning/BRM/autoincrementmanager.h +++ b/versioning/BRM/autoincrementmanager.h @@ -29,11 +29,7 @@ #pragma once -#if defined(_MSC_VER) && defined(xxxBRMAUTOINCMGR_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/blockresolutionmanager.h b/versioning/BRM/blockresolutionmanager.h index d8bb6d7614..a098acdbab 100644 --- a/versioning/BRM/blockresolutionmanager.h +++ b/versioning/BRM/blockresolutionmanager.h @@ -37,11 +37,7 @@ #include "vss.h" #include "copylocks.h" -#if defined(_MSC_VER) && defined(xxxBLOCKRESOLUTIONMANAGER_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/brmshmimpl.cpp b/versioning/BRM/brmshmimpl.cpp index 681a7b0f78..82bef3b7c0 100644 --- a/versioning/BRM/brmshmimpl.cpp +++ b/versioning/BRM/brmshmimpl.cpp @@ -61,13 +61,7 @@ BRMShmImpl::BRMShmImpl(unsigned key, off_t size, bool readOnly) : BRMShmImplPare { bi::shared_memory_object shm(bi::open_only, keyName.c_str(), bi::read_write); off_t curSize = 0; -#ifdef _MSC_VER - bi::offset_t tmp = 0; - shm.get_size(tmp); - curSize = static_cast(tmp); -#else shm.get_size(curSize); -#endif if (curSize == 0) throw bi::interprocess_exception("shm size is zero"); @@ -117,13 +111,7 @@ BRMShmImpl::BRMShmImpl(unsigned key, off_t size, bool readOnly) : BRMShmImplPare throw; } off_t curSize = 0; -#ifdef _MSC_VER - bi::offset_t tmp = 0; - shm->get_size(tmp); - curSize = static_cast(tmp); -#else shm->get_size(curSize); -#endif idbassert(curSize > 0); idbassert(curSize >= fSize); fShmobj.swap(*shm); diff --git a/versioning/BRM/brmtypes.h b/versioning/BRM/brmtypes.h index a462cf79af..1e7ce71099 100644 --- a/versioning/BRM/brmtypes.h +++ b/versioning/BRM/brmtypes.h @@ -33,14 +33,10 @@ #include "mcs_basic_types.h" #include "logicalpartition.h" -#ifndef _MSC_VER #include #ifndef _UNORDERED_MAP_FIX_ #define _UNORDERED_MAP_FIX_ #endif //_UNORDERED_MAP_FIX_ -#else -#include -#endif //_MSC_VER #include "calpontsystemcatalog.h" #include "bytestream.h" @@ -48,11 +44,7 @@ #include "messagelog.h" #include "loggingid.h" -#if defined(_MSC_VER) && defined(xxxBRMTYPES_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace idbdatafile { diff --git a/versioning/BRM/copylocks.cpp b/versioning/BRM/copylocks.cpp index 172dac4d76..23328cb0ce 100644 --- a/versioning/BRM/copylocks.cpp +++ b/versioning/BRM/copylocks.cpp @@ -29,9 +29,6 @@ #include #include #include -#ifdef _MSC_VER -#include -#endif #include #include diff --git a/versioning/BRM/copylocks.h b/versioning/BRM/copylocks.h index 5a23f10080..977a4f8894 100644 --- a/versioning/BRM/copylocks.h +++ b/versioning/BRM/copylocks.h @@ -47,11 +47,7 @@ #define CL_INITIAL_SIZE (50 * sizeof(CopyLockEntry)) #define CL_INCREMENT (50 * sizeof(CopyLockEntry)) -#if defined(_MSC_VER) && defined(xxxCOPYLOCKS_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace idbdatafile { diff --git a/versioning/BRM/dbrm.h b/versioning/BRM/dbrm.h index 9b04711e3b..b7fe432785 100644 --- a/versioning/BRM/dbrm.h +++ b/versioning/BRM/dbrm.h @@ -47,11 +47,7 @@ #include "configcpp.h" #include "mastersegmenttable.h" -#if defined(_MSC_VER) && defined(xxxDBRM_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif #ifdef BRM_DEBUG #define DBRM_THROW diff --git a/versioning/BRM/extentmap.cpp b/versioning/BRM/extentmap.cpp index 65078ca6a5..29cb9fcb35 100644 --- a/versioning/BRM/extentmap.cpp +++ b/versioning/BRM/extentmap.cpp @@ -38,11 +38,7 @@ #include #include #include -#ifndef _MSC_VER #include -#else -#include -#endif #include #include diff --git a/versioning/BRM/extentmap.h b/versioning/BRM/extentmap.h index e161a42b19..5fc5d8cb91 100644 --- a/versioning/BRM/extentmap.h +++ b/versioning/BRM/extentmap.h @@ -63,11 +63,7 @@ #undef WRITE #endif -#if defined(_MSC_VER) && defined(xxxEXTENTMAP_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace bi = boost::interprocess; diff --git a/versioning/BRM/lbidresourcegraph.h b/versioning/BRM/lbidresourcegraph.h index 10ab3f9070..1b54b36bea 100644 --- a/versioning/BRM/lbidresourcegraph.h +++ b/versioning/BRM/lbidresourcegraph.h @@ -28,22 +28,14 @@ #include #include -#ifndef _MSC_VER #include -#else -#include -#endif #include #include "brmtypes.h" #include "transactionnode.h" #include "resourcenode.h" -#if defined(_MSC_VER) && defined(xxxLBIDRESOURCEGRAPH_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/masternode.cpp b/versioning/BRM/masternode.cpp index 9a00f15220..af5929757c 100644 --- a/versioning/BRM/masternode.cpp +++ b/versioning/BRM/masternode.cpp @@ -129,11 +129,9 @@ void ServiceControllerNode::setupChildSignalHandlers() signal(SIGINT, stop); signal(SIGTERM, stop); -#ifndef _MSC_VER signal(SIGHUP, SIG_IGN); signal(SIGUSR1, restart); signal(SIGPIPE, SIG_IGN); -#endif struct sigaction ign; memset(&ign, 0, sizeof(ign)); diff --git a/versioning/BRM/mastersegmenttable.cpp b/versioning/BRM/mastersegmenttable.cpp index 31b2da6f72..dac35cf42c 100644 --- a/versioning/BRM/mastersegmenttable.cpp +++ b/versioning/BRM/mastersegmenttable.cpp @@ -117,18 +117,6 @@ MSTEntry::MSTEntry() : tableShmkey(-1), allocdSize(0), currentSize(0) MasterSegmentTable::MasterSegmentTable() { -#ifdef _MSC_VER - const char* envp = getenv("SystemRoot"); - string SystemRoot; - - if (envp && *envp) - SystemRoot = envp; - else - SystemRoot = "C:\\WINDOWS"; - - string tmpEnv = "TMP=" + SystemRoot + "\\Temp"; - _putenv(tmpEnv.c_str()); -#endif int i; bool initializer = false; diff --git a/versioning/BRM/mastersegmenttable.h b/versioning/BRM/mastersegmenttable.h index be7b966395..2644a81b84 100644 --- a/versioning/BRM/mastersegmenttable.h +++ b/versioning/BRM/mastersegmenttable.h @@ -43,11 +43,7 @@ #include "rwlock.h" #include "shmkeys.h" -#if defined(_MSC_VER) && defined(xxxMASTERSEGMENTTABLE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/oidserver.cpp b/versioning/BRM/oidserver.cpp index 39125416fd..3fdd709dd6 100644 --- a/versioning/BRM/oidserver.cpp +++ b/versioning/BRM/oidserver.cpp @@ -74,10 +74,8 @@ #include #include #include -#if __linux__ #include #include -#endif #include //#define NDEBUG #include @@ -310,10 +308,8 @@ OIDServer::OIDServer() : fFp(NULL), fFd(-1) throw ios_base::failure(os.str()); } -#ifndef _MSC_VER if (fFp) chmod(fFilename.c_str(), 0664); // XXXPAT: override umask at least for testing -#endif try { diff --git a/versioning/BRM/oidserver.h b/versioning/BRM/oidserver.h index 93ff4ccd7c..f34566ddb8 100644 --- a/versioning/BRM/oidserver.h +++ b/versioning/BRM/oidserver.h @@ -33,11 +33,7 @@ #include -#if defined(_MSC_VER) && defined(xxxBRMOIDSVR_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace idbdatafile { diff --git a/versioning/BRM/reset_locks.cpp b/versioning/BRM/reset_locks.cpp index 82f7acee97..4cc2232f76 100644 --- a/versioning/BRM/reset_locks.cpp +++ b/versioning/BRM/reset_locks.cpp @@ -68,18 +68,6 @@ void usage() int main(int argc, char** argv) { -#ifdef _MSC_VER - const char* envp = getenv("SystemRoot"); - string SystemRoot; - - if (envp && *envp) - SystemRoot = envp; - else - SystemRoot = "C:\\WINDOWS"; - - string tmpEnv = "TMP=" + SystemRoot + "\\Temp"; - _putenv(tmpEnv.c_str()); -#endif BRM::DBRM dbrm; diff --git a/versioning/BRM/resourcenode.h b/versioning/BRM/resourcenode.h index a1d5aa9a65..42b0a0ccba 100644 --- a/versioning/BRM/resourcenode.h +++ b/versioning/BRM/resourcenode.h @@ -28,11 +28,7 @@ #include "rgnode.h" -#if defined(_MSC_VER) && defined(xxxRESOURCENODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/rgnode.h b/versioning/BRM/rgnode.h index 13a80d8234..367f65284e 100644 --- a/versioning/BRM/rgnode.h +++ b/versioning/BRM/rgnode.h @@ -30,11 +30,7 @@ #include "brmtypes.h" -#if defined(_MSC_VER) && defined(xxxRGNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/rwlockmonitor.h b/versioning/BRM/rwlockmonitor.h index cd7a271129..142a959c19 100644 --- a/versioning/BRM/rwlockmonitor.h +++ b/versioning/BRM/rwlockmonitor.h @@ -29,11 +29,7 @@ #include "rwlock.h" -#if defined(_MSC_VER) && defined(xxxRWLOCKMONITOR_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/save_brm.cpp b/versioning/BRM/save_brm.cpp index aae9e94fde..f474e04075 100644 --- a/versioning/BRM/save_brm.cpp +++ b/versioning/BRM/save_brm.cpp @@ -94,9 +94,7 @@ int main(int argc, char** argv) try { -#ifndef _MSC_VER prefix += '\n'; -#endif // for MCOL-1558. Make the _current file relative to DBRMRoot string relative = prefix.substr(prefix.find_last_of('/') + 1); currentFile->write(relative.c_str(), relative.length()); diff --git a/versioning/BRM/sessionmanagerserver.cpp b/versioning/BRM/sessionmanagerserver.cpp index 1e7cc0d158..fcdbb893f0 100644 --- a/versioning/BRM/sessionmanagerserver.cpp +++ b/versioning/BRM/sessionmanagerserver.cpp @@ -34,10 +34,6 @@ #include #include #include -#ifdef _MSC_VER -#include -#include -#endif using namespace std; #include diff --git a/versioning/BRM/sessionmanagerserver.h b/versioning/BRM/sessionmanagerserver.h index 2b023ead19..3c068127fb 100644 --- a/versioning/BRM/sessionmanagerserver.h +++ b/versioning/BRM/sessionmanagerserver.h @@ -37,16 +37,8 @@ #include "atomicops.h" -#if defined(_MSC_VER) && defined(xxxSESSIONMANAGERSERVER_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4200) -#endif namespace BRM { @@ -289,8 +281,5 @@ class SessionManagerServer } // namespace BRM -#ifdef _MSC_VER -#pragma warning(pop) -#endif #undef EXPORT diff --git a/versioning/BRM/shmkeys.h b/versioning/BRM/shmkeys.h index ce7f00d1ac..7dcee9fd21 100644 --- a/versioning/BRM/shmkeys.h +++ b/versioning/BRM/shmkeys.h @@ -22,11 +22,7 @@ #include #include -#if defined(_MSC_VER) && defined(xxxSHMKEYS_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { @@ -45,8 +41,6 @@ struct ShmKeys /******** The shmseg/sem key range assigments *******/ #if defined(COMMUNITY_KEYRANGE) const static uint32_t KEYRANGE_SIZE = 0x1000; -#elif defined(_MSC_VER) - const static uint32_t KEYRANGE_SIZE = 0x3800; #else const static uint32_t KEYRANGE_SIZE = 0x10000; #endif diff --git a/versioning/BRM/slavecomm.cpp b/versioning/BRM/slavecomm.cpp index 1f490dd8c5..180b09f315 100644 --- a/versioning/BRM/slavecomm.cpp +++ b/versioning/BRM/slavecomm.cpp @@ -27,10 +27,6 @@ #include #include #include -#ifdef _MSC_VER -#include -#include -#endif #include "messagequeue.h" #include "bytestream.h" @@ -65,10 +61,6 @@ SlaveComm::SlaveComm(string hostname, SlaveDBRMNode* s) : slave(s) , currentSaveFile(NULL) , journalh(NULL) -#ifdef _MSC_VER - , fPids(0) - , fMaxPids(64) -#endif { config::Config* config = config::Config::makeConfig(); string tmp; @@ -172,10 +164,6 @@ SlaveComm::SlaveComm(string hostname, SlaveDBRMNode* s) SlaveComm::SlaveComm() : currentSaveFile(NULL) , journalh(NULL) -#ifdef _MSC_VER - , fPids(0) - , fMaxPids(64) -#endif { config::Config* config = config::Config::makeConfig(); @@ -1972,9 +1960,7 @@ void SlaveComm::do_confirm() tmp = savefile + (saveFileToggle ? 'A' : 'B'); slave->saveState(tmp); -#ifndef _MSC_VER tmp += '\n'; -#endif int err = 0; // MCOL-1558. Make the _current file relative to DBRMRoot. @@ -2024,7 +2010,6 @@ void SlaveComm::do_flushInodeCache() return; } -#ifdef __linux__ #ifdef USE_VERY_COMPLEX_DROP_CACHES double elapsedTime = 0.0; char msgChString[100]; @@ -2083,7 +2068,6 @@ void SlaveComm::do_flushInodeCache() } } -#endif #endif reply << (uint8_t)ERR_OK; @@ -2144,11 +2128,6 @@ int SlaveComm::replayJournal(string prefix) fName = prefix.substr(0, prefix.length() - 1) + "_journal"; } -#ifdef _MSC_VER - else if (tmp == "a" || tmp == "b") - fName = prefix.substr(0, prefix.length() - 1) + "_journal"; - -#endif else { fName = prefix + "_journal"; @@ -2267,7 +2246,6 @@ void SlaveComm::do_ownerCheck(ByteStream& msg) } // FIXME: needs to be refactored along with SessionManagerServer::lookupProcessStatus() -#if defined(__linux__) bool SlaveComm::processExists(const uint32_t pid, const string& pname) { string stat; @@ -2300,68 +2278,6 @@ bool SlaveComm::processExists(const uint32_t pid, const string& pname) return true; } -#elif defined(_MSC_VER) -// FIXME -bool SlaveComm::processExists(const uint32_t pid, const string& pname) -{ - boost::mutex::scoped_lock lk(fPidMemLock); - - if (!fPids) - fPids = (DWORD*)malloc(fMaxPids * sizeof(DWORD)); - - DWORD needed = 0; - - if (EnumProcesses(fPids, fMaxPids * sizeof(DWORD), &needed) == 0) - return false; - - while (needed == fMaxPids * sizeof(DWORD)) - { - fMaxPids *= 2; - fPids = (DWORD*)realloc(fPids, fMaxPids * sizeof(DWORD)); - - if (EnumProcesses(fPids, fMaxPids * sizeof(DWORD), &needed) == 0) - return false; - } - - DWORD numPids = needed / sizeof(DWORD); - - for (DWORD i = 0; i < numPids; i++) - { - if (fPids[i] == pid) - { - TCHAR szProcessName[MAX_PATH] = TEXT(""); - - // Get a handle to the process. - HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, fPids[i]); - - // Get the process name. - if (hProcess != NULL) - { - HMODULE hMod; - DWORD cbNeeded; - - if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) - GetModuleBaseName(hProcess, hMod, szProcessName, sizeof(szProcessName) / sizeof(TCHAR)); - - CloseHandle(hProcess); - - if (pname == szProcessName) - return true; - } - } - } - - return false; -} -#elif defined(__FreeBSD__) -// FIXME -bool SlaveComm::processExists(const uint32_t pid, const string& pname) -{ - return false; -} -#else -#error Need to port processExists() -#endif void SlaveComm::do_dmlLockLBIDRanges(ByteStream& msg) { diff --git a/versioning/BRM/slavecomm.h b/versioning/BRM/slavecomm.h index fb00659683..48a2f5b542 100644 --- a/versioning/BRM/slavecomm.h +++ b/versioning/BRM/slavecomm.h @@ -36,11 +36,7 @@ #include "messagequeue.h" #include "bytestream.h" -#if defined(_MSC_VER) && defined(xxxSLAVECOMM_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif // forward reference namespace idbdatafile @@ -127,11 +123,6 @@ class SlaveComm idbdatafile::IDBDataFile* journalh; int64_t snapshotInterval, journalCount; struct timespec MSG_TIMEOUT; -#ifdef _MSC_VER - boost::mutex fPidMemLock; - DWORD* fPids; - DWORD fMaxPids; -#endif }; } // namespace BRM diff --git a/versioning/BRM/slavedbrmnode.h b/versioning/BRM/slavedbrmnode.h index e53eb49369..bedb6d57f8 100644 --- a/versioning/BRM/slavedbrmnode.h +++ b/versioning/BRM/slavedbrmnode.h @@ -39,11 +39,7 @@ #include "vbbm.h" #include "copylocks.h" -#if defined(_MSC_VER) && defined(xxxSLAVEDBRMNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/slavenode.cpp b/versioning/BRM/slavenode.cpp index 667feaa08a..071132a308 100644 --- a/versioning/BRM/slavenode.cpp +++ b/versioning/BRM/slavenode.cpp @@ -24,10 +24,6 @@ #include #include #include -#ifdef _MSC_VER -#include -#include -#endif #include "slavedbrmnode.h" #include "slavecomm.h" #include "liboamcpp.h" diff --git a/versioning/BRM/tablelockserver.h b/versioning/BRM/tablelockserver.h index 95c98e3d05..64a08c9489 100644 --- a/versioning/BRM/tablelockserver.h +++ b/versioning/BRM/tablelockserver.h @@ -27,11 +27,7 @@ #pragma once -#if defined(_MSC_VER) && defined(xxxBRMTBLLOCKSVR_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/tracer.cpp b/versioning/BRM/tracer.cpp index 9fa3b0ee19..c5ea98d758 100644 --- a/versioning/BRM/tracer.cpp +++ b/versioning/BRM/tracer.cpp @@ -25,10 +25,6 @@ #include #include -#ifdef _MSC_VER -#include -#include -#endif #include diff --git a/versioning/BRM/tracer.h b/versioning/BRM/tracer.h index 1d73283b54..2fe1fa4a01 100644 --- a/versioning/BRM/tracer.h +++ b/versioning/BRM/tracer.h @@ -31,11 +31,7 @@ #include #include -#if defined(_MSC_VER) && defined(xxxTRACER_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/transactionnode.h b/versioning/BRM/transactionnode.h index 6052ab26d5..2fc5fd9239 100644 --- a/versioning/BRM/transactionnode.h +++ b/versioning/BRM/transactionnode.h @@ -32,11 +32,7 @@ #include "brmtypes.h" #include "rgnode.h" -#if defined(_MSC_VER) && defined(xxxTRANSACTIONNODE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/undoable.h b/versioning/BRM/undoable.h index c883b9617c..c2311ff653 100644 --- a/versioning/BRM/undoable.h +++ b/versioning/BRM/undoable.h @@ -31,11 +31,7 @@ #include "brmtypes.h" -#if defined(_MSC_VER) && defined(xxxUNDOABLE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/versioning/BRM/vbbm.cpp b/versioning/BRM/vbbm.cpp index 2ed2454d14..52af60cbda 100644 --- a/versioning/BRM/vbbm.cpp +++ b/versioning/BRM/vbbm.cpp @@ -26,17 +26,11 @@ #include #include -#if __linux__ #include -#endif #include #include #include -#ifndef _MSC_VER #include -#else -#include -#endif #include #include diff --git a/versioning/BRM/vbbm.h b/versioning/BRM/vbbm.h index 457911192b..1d4d45fe7b 100644 --- a/versioning/BRM/vbbm.h +++ b/versioning/BRM/vbbm.h @@ -56,11 +56,7 @@ ((entries * sizeof(VBBMEntry)) + (entries / 4 * sizeof(int)) + (files * sizeof(VBFileMetadata)) + \ sizeof(VBShmsegHeader)) -#if defined(_MSC_VER) && defined(xxxVBBM_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace idbdatafile { diff --git a/versioning/BRM/vss.cpp b/versioning/BRM/vss.cpp index 3b8cfcc046..0a515e30e8 100644 --- a/versioning/BRM/vss.cpp +++ b/versioning/BRM/vss.cpp @@ -32,9 +32,6 @@ #include #include -#ifdef _MSC_VER -#include -#endif #include "rwlock.h" #include "brmtypes.h" diff --git a/versioning/BRM/vss.h b/versioning/BRM/vss.h index 9278643e2b..927e6c20fa 100644 --- a/versioning/BRM/vss.h +++ b/versioning/BRM/vss.h @@ -68,11 +68,7 @@ #define VSS_SIZE(entries) \ ((entries * sizeof(VSSEntry)) + (entries / 4 * sizeof(int)) + sizeof(VSSShmsegHeader)) -#if defined(_MSC_VER) && defined(xxxVSS_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace BRM { diff --git a/writeengine/bulk/cpimport.cpp b/writeengine/bulk/cpimport.cpp index cf22e9590b..0e0b6dbd63 100644 --- a/writeengine/bulk/cpimport.cpp +++ b/writeengine/bulk/cpimport.cpp @@ -33,11 +33,7 @@ #include #include #include -#ifndef _MSC_VER #include -#else -#include -#endif #include #include "idberrorinfo.h" #include "we_simplesyslog.h" @@ -210,18 +206,6 @@ void handleControlC(int i) BulkStatus::setJobStatus(EXIT_FAILURE); } -#ifdef _MSC_VER -BOOL WINAPI HandlerCtrlCRoutine(_In_ DWORD dwCtrlType) -{ - // Log to syslog - logging::Message::Args errMsgArgs; - errMsgArgs.add("Received Break to terminate the process"); - SimpleSysLog::instance()->logMsg(errMsgArgs, logging::LOG_TYPE_DEBUG, logging::M0087); - - handleControlC(dwCtrlType); - return true; -} -#endif //------------------------------------------------------------------------------ // If error occurs during startup, this function is called to log the specified @@ -261,9 +245,6 @@ void startupError(const std::string& errMsg, bool showHint) //------------------------------------------------------------------------------ void setupSignalHandlers() { -#ifdef _MSC_VER - BOOL brtn = SetConsoleCtrlHandler(HandlerCtrlCRoutine, true); -#else struct sigaction ign; // Ignore SIGPIPE signal @@ -293,7 +274,6 @@ void setupSignalHandlers() memset(&act, 0, sizeof(act)); act.sa_handler = handleSigTerm; sigaction(SIGTERM, &act, 0); -#endif } //------------------------------------------------------------------------------ @@ -1020,9 +1000,6 @@ void logInitiateMsg(const char* initText) //------------------------------------------------------------------------------ int main(int argc, char** argv) { -#ifdef _MSC_VER - _setmaxstdio(2048); -#endif setupSignalHandlers(); // Set locale language @@ -1132,11 +1109,7 @@ int main(int argc, char** argv) //-------------------------------------------------------------------------- // Set scheduling priority for this cpimport.bin process //-------------------------------------------------------------------------- -#ifdef _MSC_VER - // FIXME -#else setpriority(PRIO_PROCESS, 0, Config::getBulkProcessPriority()); -#endif if (bDebug) logInitiateMsg("Config cache initialized"); diff --git a/writeengine/bulk/we_bulkload.cpp b/writeengine/bulk/we_bulkload.cpp index a152ae1370..4ddbd7e4af 100644 --- a/writeengine/bulk/we_bulkload.cpp +++ b/writeengine/bulk/we_bulkload.cpp @@ -1364,12 +1364,7 @@ int BulkLoad::buildImportDataFileList(const std::string& location, const std::st for (str = filenames;; str = NULL) { -#ifdef _MSC_VER - // On Windows, only comma and vertbar can separate input files - token = strtok(str, ",|"); -#else token = strtok(str, ", |"); -#endif if (token == NULL) break; @@ -1389,9 +1384,6 @@ int BulkLoad::buildImportDataFileList(const std::string& location, const std::st fullPath += token; } -#ifdef _MSC_VER - loadFiles.push_back(fullPath); -#else // If running mode2, then support a filename with wildcards if (fBulkMode == BULK_MODE_REMOTE_MULTIPLE_SRC) @@ -1476,7 +1468,6 @@ int BulkLoad::buildImportDataFileList(const std::string& location, const std::st loadFiles.push_back(fullPath); } // not mode2 -#endif } // loop through filename tokens delete[] filenames; diff --git a/writeengine/bulk/we_bulkload.h b/writeengine/bulk/we_bulkload.h index ccc362ca47..39841b23af 100644 --- a/writeengine/bulk/we_bulkload.h +++ b/writeengine/bulk/we_bulkload.h @@ -22,9 +22,7 @@ /** @file */ #pragma once -#ifndef _MSC_VER #include -#endif #include #include #include diff --git a/writeengine/bulk/we_bulkloadbuffer.cpp b/writeengine/bulk/we_bulkloadbuffer.cpp index 106689eafe..9af6e8e236 100644 --- a/writeengine/bulk/we_bulkloadbuffer.cpp +++ b/writeengine/bulk/we_bulkloadbuffer.cpp @@ -49,33 +49,6 @@ using namespace std; using namespace boost; using namespace execplan; -#if defined(_MSC_VER) && !defined(isnan) -#define isnan _isnan -namespace -{ -inline int __signbitf(float __x) -{ - union - { - float __f; - int __i; - } __u; - __u.__f = __x; - return __u.__i < 0; -} -inline int __signbit(double __x) -{ - union - { - double __d; - int __i[2]; - } __u; - __u.__d = __x; - return __u.__i[1] < 0; -} -} // namespace -#define signbit(x) (sizeof(x) == sizeof(float) ? __signbitf(x) : __signbit(x)) -#endif namespace { @@ -368,20 +341,11 @@ void BulkLoadBuffer::convert(char* field, int fieldLength, bool nullFlag, unsign { errno = 0; -#ifdef _MSC_VER - fVal = (float)strtod(field, 0); -#else fVal = strtof(field, 0); -#endif if (errno == ERANGE) { -#ifdef _MSC_VER - - if (abs(fVal) == HUGE_VAL) -#else if (abs(fVal) == HUGE_VALF) -#endif { if (fVal > 0) fVal = maxFltSat; @@ -473,12 +437,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength, bool nullFlag, unsign if (errno == ERANGE) { -#ifdef _MSC_VER - - if (abs(dVal) == HUGE_VAL) -#else if (abs(dVal) == HUGE_VALL) -#endif { if (dVal > 0) dVal = column.fMaxDblSat; diff --git a/writeengine/bulk/we_colextinf.h b/writeengine/bulk/we_colextinf.h index c2ea108a57..bba0094ff7 100644 --- a/writeengine/bulk/we_colextinf.h +++ b/writeengine/bulk/we_colextinf.h @@ -30,11 +30,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include #include "brmtypes.h" diff --git a/writeengine/bulk/we_extentstripealloc.h b/writeengine/bulk/we_extentstripealloc.h index 6d491dfaa4..ecfa72db0b 100644 --- a/writeengine/bulk/we_extentstripealloc.h +++ b/writeengine/bulk/we_extentstripealloc.h @@ -29,11 +29,7 @@ #include #include -#ifdef _MSC_VER -#include -#else #include -#endif #include #include "we_type.h" diff --git a/writeengine/bulk/we_tableinfo.cpp b/writeengine/bulk/we_tableinfo.cpp index cdda59c179..8e861b7b07 100644 --- a/writeengine/bulk/we_tableinfo.cpp +++ b/writeengine/bulk/we_tableinfo.cpp @@ -37,11 +37,7 @@ // @bug 2099+ #include #include -#ifdef _MSC_VER -#include -#else #include -#endif using namespace std; // @bug 2099- @@ -101,9 +97,6 @@ void TableInfo::sleepMS(long ms) rm_ts.tv_sec = ms / 1000; rm_ts.tv_nsec = ms % 1000 * 1000000; -#ifdef _MSC_VER - Sleep(ms); -#else struct timespec abs_ts; do @@ -112,7 +105,6 @@ void TableInfo::sleepMS(long ms) abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif } //------------------------------------------------------------------------------ @@ -1115,11 +1107,7 @@ int TableInfo::getColumnForParse(const int& id, const int& bufferId, bool report if (report) { -#ifdef _MSC_VER - oss << " ----- " << GetCurrentThreadId() << ":fBuffers[" << bufferId << -#else oss << " ----- " << pthread_self() << ":fBuffers[" << bufferId << -#endif "]: (colLocker,status,lasttime)- "; } @@ -1204,11 +1192,7 @@ bool TableInfo::bufferReadyForParse(const int& bufferId, bool report) const ostringstream oss; string bufStatusStr; ColumnInfo::convertStatusToString(stat, bufStatusStr); -#ifdef _MSC_VER - oss << " --- " << GetCurrentThreadId() << -#else oss << " --- " << pthread_self() << -#endif ":fBuffers[" << bufferId << "]=" << bufStatusStr << " (" << stat << ")" << std::endl; cout << oss.str(); } @@ -1225,17 +1209,6 @@ bool TableInfo::bufferReadyForParse(const int& bufferId, bool report) const int TableInfo::initializeBuffers(int noOfBuffers, const JobFieldRefList& jobFieldRefList, unsigned int fixedBinaryRecLen) { -#ifdef _MSC_VER - - //@bug 3751 - // When reading from STDIN, Windows doesn't like the huge default buffer of - // 1M, so turn it down. - if (fReadFromStdin) - { - fBufferSize = std::min(10240, fBufferSize); - } - -#endif fReadBufCount = noOfBuffers; @@ -1293,19 +1266,10 @@ int TableInfo::openTableFile() { fHandle = stdin; -#ifdef _MSC_VER - - // If this is a binary import from STDIN, then set stdin to binary - if (fImportDataMode != IMPORT_DATA_TEXT) - _setmode(_fileno(stdin), _O_BINARY); - - fFileBuffer = 0; -#else // Not 100% sure that calling setvbuf on stdin does much, but in // some tests, it made a slight difference. fFileBuffer = new char[fFileBufSize]; setvbuf(fHandle, fFileBuffer, _IOFBF, fFileBufSize); -#endif ostringstream oss; oss << BOLD_START << "Reading input from STDIN to import into table " << fTableName << "..." << BOLD_STOP; fLog->logMsg(oss.str(), MSGLVL_INFO1); @@ -1441,14 +1405,7 @@ void TableInfo::writeBadRows(const std::vector* errorDatRows, bool if (fErrorDir.size() > 0) { -#ifdef _MSC_VER - char filename[_MAX_FNAME]; - char ext[_MAX_EXT]; - _splitpath(const_cast(getFileName().c_str()), NULL, NULL, filename, ext); - rejectFileName << fErrorDir << "\\" << filename << ext; -#else rejectFileName << fErrorDir << basename(getFileName().c_str()); -#endif } else { @@ -1547,14 +1504,7 @@ void TableInfo::writeErrReason(const std::vector >* error if (fErrorDir.size() > 0) { -#ifdef _MSC_VER - char filename[_MAX_FNAME]; - char ext[_MAX_EXT]; - _splitpath(const_cast(getFileName().c_str()), NULL, NULL, filename, ext); - errFileName << fErrorDir << "\\" << filename << ext; -#else errFileName << fErrorDir << basename(getFileName().c_str()); -#endif } else { diff --git a/writeengine/bulk/we_tableinfo.h b/writeengine/bulk/we_tableinfo.h index 6fbca9fc7a..f5a09ec901 100644 --- a/writeengine/bulk/we_tableinfo.h +++ b/writeengine/bulk/we_tableinfo.h @@ -642,15 +642,8 @@ inline void TableInfo::setJobUUID(const boost::uuids::uuid& jobUUID) inline void TableInfo::setErrorDir(const std::string& errorDir) { fErrorDir = errorDir; -#ifdef _MSC_VER - - if (fErrorDir.length() > 0 && *(--(fErrorDir.end())) != '/' && *(--(fErrorDir.end())) != '\\') - fErrorDir.push_back('\\'); -} -#else if (fErrorDir.length() > 0 && *(--(fErrorDir.end())) != '/') fErrorDir.push_back('/'); } -#endif } // namespace WriteEngine diff --git a/writeengine/bulk/we_workers.cpp b/writeengine/bulk/we_workers.cpp index 7a2cb186b4..dcd4f1d54c 100644 --- a/writeengine/bulk/we_workers.cpp +++ b/writeengine/bulk/we_workers.cpp @@ -41,9 +41,6 @@ void BulkLoad::sleepMS(long ms) rm_ts.tv_sec = ms / 1000; rm_ts.tv_nsec = ms % 1000 * 1000000; -#ifdef _MSC_VER - Sleep(ms); -#else struct timespec abs_ts; do @@ -52,7 +49,6 @@ void BulkLoad::sleepMS(long ms) abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif } //------------------------------------------------------------------------------ @@ -274,11 +270,7 @@ void BulkLoad::parse(int id) << endl << timeString << ": BulkLoad::parse(" << id << "); " << -#ifdef _MSC_VER - " Worker Thread " << GetCurrentThreadId() << -#else " Worker Thread " << pthread_self() << -#endif ":" << endl << "---------------------------------------" "-------------------" @@ -444,11 +436,7 @@ bool BulkLoad::lockColumnForParse(int thrdId, int& tableId, int& columnId, int& std::string bufStatusStr; Status stat = fTableInfo[i].getStatusTI(); ColumnInfo::convertStatusToString(stat, bufStatusStr); -#ifdef _MSC_VER - oss << " - " << GetCurrentThreadId() << -#else oss << " - " << pthread_self() << -#endif ":fTableInfo[" << i << "]" << bufStatusStr << " (" << stat << ")"; if (stat != WriteEngine::PARSE_COMPLETE) diff --git a/writeengine/client/we_clients.cpp b/writeengine/client/we_clients.cpp index e64ebd3210..80370dcb52 100644 --- a/writeengine/client/we_clients.cpp +++ b/writeengine/client/we_clients.cpp @@ -26,12 +26,10 @@ #include #include #include -#ifndef _MSC_VER #include #if __FreeBSD__ #include #endif -#endif using namespace std; #include diff --git a/writeengine/client/we_clients.h b/writeengine/client/we_clients.h index 6b1a59d7f1..8a512f7323 100644 --- a/writeengine/client/we_clients.h +++ b/writeengine/client/we_clients.h @@ -36,11 +36,7 @@ #include "rwlock_local.h" #include "resourcemanager.h" -#if defined(_MSC_VER) && defined(xxxWECLIENTS_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { diff --git a/writeengine/client/we_ddlcommandclient.h b/writeengine/client/we_ddlcommandclient.h index b52698ca8a..b4ef7ce4d9 100644 --- a/writeengine/client/we_ddlcommandclient.h +++ b/writeengine/client/we_ddlcommandclient.h @@ -27,11 +27,7 @@ #include "liboamcpp.h" #include "writeengine.h" -#if defined(_MSC_VER) && defined(xxxWE_DDLCOMMANDCLIENT_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif #include "dataconvert.h" diff --git a/writeengine/client/we_dmlcommandclient.h b/writeengine/client/we_dmlcommandclient.h index a73bfe4434..8b1ad4dcfb 100644 --- a/writeengine/client/we_dmlcommandclient.h +++ b/writeengine/client/we_dmlcommandclient.h @@ -27,11 +27,7 @@ #include "liboamcpp.h" #include "writeengine.h" -#if defined(_MSC_VER) && defined(xxxWE_DDLCOMMANDCLIENT_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif #include "dataconvert.h" diff --git a/writeengine/dictionary/we_dctnry.h b/writeengine/dictionary/we_dctnry.h index 000e83b519..7d41e5d03c 100644 --- a/writeengine/dictionary/we_dctnry.h +++ b/writeengine/dictionary/we_dctnry.h @@ -36,11 +36,7 @@ #include "we_brm.h" #include "bytestream.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/dictionary/we_dctnrystore.cpp b/writeengine/dictionary/we_dctnrystore.cpp index 4cdf927ca2..ee6a7eb04d 100644 --- a/writeengine/dictionary/we_dctnrystore.cpp +++ b/writeengine/dictionary/we_dctnrystore.cpp @@ -20,9 +20,7 @@ * *******************************************************************************/ #include -#ifndef _MSC_VER #include -#endif #define WRITEENGINEDCTSTORE_DLLEXPORT #include "we_dctnrystore.h" #undef WRITEENGINEDCTSTORE_DLLEXPORT diff --git a/writeengine/dictionary/we_dctnrystore.h b/writeengine/dictionary/we_dctnrystore.h index cf407694c8..693be2177b 100644 --- a/writeengine/dictionary/we_dctnrystore.h +++ b/writeengine/dictionary/we_dctnrystore.h @@ -41,11 +41,7 @@ #include "we_type.h" #include "we_dctnry.h" -#if defined(_MSC_VER) && defined(WRITEENGINEDCTSTORE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /**@brief Namespace WriteEngine */ diff --git a/writeengine/index/we_indexlist.cpp b/writeengine/index/we_indexlist.cpp index ddf813e63c..30d7c015fd 100644 --- a/writeengine/index/we_indexlist.cpp +++ b/writeengine/index/we_indexlist.cpp @@ -25,9 +25,7 @@ /* ========================================================================== */ #include #include -#ifndef _MSC_VER #include -#endif #include "we_indexlist.h" using namespace std; diff --git a/writeengine/index/we_indexlist_common.cpp b/writeengine/index/we_indexlist_common.cpp index 55fc38e72f..8d2cd87faa 100644 --- a/writeengine/index/we_indexlist_common.cpp +++ b/writeengine/index/we_indexlist_common.cpp @@ -25,9 +25,7 @@ /* ========================================================================== */ #include #include -#ifndef _MSC_VER #include -#endif #include "we_indexlist.h" using namespace std; diff --git a/writeengine/index/we_indexlist_find_delete.cpp b/writeengine/index/we_indexlist_find_delete.cpp index e90bf02d1a..c125f4a5ee 100644 --- a/writeengine/index/we_indexlist_find_delete.cpp +++ b/writeengine/index/we_indexlist_find_delete.cpp @@ -25,9 +25,7 @@ /* ========================================================================== */ #include #include -#ifndef _MSC_VER #include -#endif #include "we_indextree.h" #include "we_indexlist.h" diff --git a/writeengine/index/we_indexlist_multiple_narray.cpp b/writeengine/index/we_indexlist_multiple_narray.cpp index 3c6b063421..6465dad44e 100644 --- a/writeengine/index/we_indexlist_multiple_narray.cpp +++ b/writeengine/index/we_indexlist_multiple_narray.cpp @@ -25,9 +25,7 @@ /* ========================================================================== */ #include #include -#ifndef _MSC_VER #include -#endif #include "we_indexlist.h" using namespace std; diff --git a/writeengine/index/we_indexlist_narray.cpp b/writeengine/index/we_indexlist_narray.cpp index a40ed5ca11..ad5ee66a60 100644 --- a/writeengine/index/we_indexlist_narray.cpp +++ b/writeengine/index/we_indexlist_narray.cpp @@ -26,9 +26,7 @@ #include //#include #include -#ifndef _MSC_VER #include -#endif #include #include "we_indextree.h" #include "we_indexlist.h" diff --git a/writeengine/index/we_indexlist_update_hdr_sub.cpp b/writeengine/index/we_indexlist_update_hdr_sub.cpp index 932a20a693..ec35fa840c 100644 --- a/writeengine/index/we_indexlist_update_hdr_sub.cpp +++ b/writeengine/index/we_indexlist_update_hdr_sub.cpp @@ -25,9 +25,7 @@ /************************************************************************** */ #include #include -#ifndef _MSC_VER #include -#endif #include "we_indexlist.h" using namespace std; diff --git a/writeengine/index/we_indextree.h b/writeengine/index/we_indextree.h index e8efd964dc..b81827ddf8 100644 --- a/writeengine/index/we_indextree.h +++ b/writeengine/index/we_indextree.h @@ -30,11 +30,7 @@ #include #include -#if defined(_MSC_VER) && defined(WRITEENGINEINDEXTREE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/redistribute/we_redistributeworkerthread.cpp b/writeengine/redistribute/we_redistributeworkerthread.cpp index da3199ed9a..545223e86c 100644 --- a/writeengine/redistribute/we_redistributeworkerthread.cpp +++ b/writeengine/redistribute/we_redistributeworkerthread.cpp @@ -246,16 +246,12 @@ int RedistributeWorkerThread::grabTableLock() // always wait long enough for ddl/dml/cpimport to get table lock // for now, triple the ddl/dml/cpimport retry interval: 3 * 100ms -#ifdef _MSC_VER - Sleep(ts.tv_nsec * 1000); -#else struct timespec tmp = ts; while (nanosleep(&tmp, &ts) < 0) ; tmp = ts; -#endif try { diff --git a/writeengine/server/we_dataloader.cpp b/writeengine/server/we_dataloader.cpp index 1e9984c8d3..396a1fefac 100644 --- a/writeengine/server/we_dataloader.cpp +++ b/writeengine/server/we_dataloader.cpp @@ -33,15 +33,7 @@ #include #include //pipe() && fork() -#if defined(__linux__) #include //wait() -#elif defined(__FreeBSD__) -#include -#include // For stat(). -#include -#include -#include -#endif #include #include #include @@ -168,10 +160,8 @@ WEDataLoader::~WEDataLoader() void WEDataLoader::setupSignalHandlers() { -#ifndef _MSC_VER signal(SIGPIPE, SIG_IGN); signal(SIGCHLD, WEDataLoader::onSigChild); -#endif } //------------------------------------------------------------------------------ // handles on signal Terminate diff --git a/writeengine/server/we_ddlcommandproc.h b/writeengine/server/we_ddlcommandproc.h index e6cf63e7d8..c42edad30c 100644 --- a/writeengine/server/we_ddlcommandproc.h +++ b/writeengine/server/we_ddlcommandproc.h @@ -30,11 +30,7 @@ #include "dataconvert.h" #include "writeengine.h" -#if defined(_MSC_VER) && defined(xxxDDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { diff --git a/writeengine/server/we_ddlcommon.h b/writeengine/server/we_ddlcommon.h index 85250f9034..c3091dab3a 100644 --- a/writeengine/server/we_ddlcommon.h +++ b/writeengine/server/we_ddlcommon.h @@ -43,11 +43,7 @@ #include "brmtypes.h" #include "joblist.h" -#if defined(_MSC_VER) && defined(xxxDDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif #include diff --git a/writeengine/server/we_dmlcommandproc.h b/writeengine/server/we_dmlcommandproc.h index c80be75ba5..c931f126f5 100644 --- a/writeengine/server/we_dmlcommandproc.h +++ b/writeengine/server/we_dmlcommandproc.h @@ -40,11 +40,7 @@ #include "rowgroup.h" #include "we_log.h" -#if defined(_MSC_VER) && defined(xxxDDLPKGPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { diff --git a/writeengine/server/we_getfilesizes.cpp b/writeengine/server/we_getfilesizes.cpp index 194b260e3c..20080cffcc 100644 --- a/writeengine/server/we_getfilesizes.cpp +++ b/writeengine/server/we_getfilesizes.cpp @@ -357,9 +357,6 @@ int WE_GetFileSizes::processTable(messageqcpp::ByteStream& bs, std::string& errM while (currentActiveThreads > 0) { -#ifdef _MSC_VER - Sleep(sleepTime); -#else struct timespec abs_ts; do @@ -368,7 +365,6 @@ int WE_GetFileSizes::processTable(messageqcpp::ByteStream& bs, std::string& errM abs_ts.tv_nsec = rm_ts.tv_nsec; } while (nanosleep(&abs_ts, &rm_ts) < 0); -#endif currentActiveThreads = activeThreadCounter->cur(); } } diff --git a/writeengine/server/we_server.cpp b/writeengine/server/we_server.cpp index 1e04973197..1f239920fe 100644 --- a/writeengine/server/we_server.cpp +++ b/writeengine/server/we_server.cpp @@ -24,14 +24,10 @@ #include #include #include -#ifndef _MSC_VER #include #include #include "logger.h" -#endif -#ifndef _MSC_VER #include -#endif using namespace std; #include "messagequeue.h" @@ -129,7 +125,6 @@ void added_a_pm(int) int ServiceWriteEngine::setupResources() { -#ifndef _MSC_VER struct rlimit rlim; if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) @@ -153,13 +148,11 @@ int ServiceWriteEngine::setupResources() { return -4; } -#endif return 0; } void ServiceWriteEngine::setupChildSignalHandlers() { -#ifndef _MSC_VER struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = added_a_pm; @@ -172,7 +165,6 @@ void ServiceWriteEngine::setupChildSignalHandlers() sigaction(SIGSEGV, &sa, 0); sigaction(SIGABRT, &sa, 0); sigaction(SIGFPE, &sa, 0); -#endif } int ServiceWriteEngine::Child() @@ -182,11 +174,6 @@ int ServiceWriteEngine::Child() // Init WriteEngine Wrapper (including Config Columnstore.xml cache) WriteEngine::WriteEngineWrapper::init(WriteEngine::SUBSYSTEM_ID_WE_SRV); -#ifdef _MSC_VER - // In windows, initializing the wrapper (A dll) does not set the static variables - // in the main program - idbdatafile::IDBPolicy::configIDBPolicy(); -#endif Config weConfig; ostringstream serverParms; diff --git a/writeengine/shared/we_blockop.h b/writeengine/shared/we_blockop.h index 14723c2e18..3bfa236660 100644 --- a/writeengine/shared/we_blockop.h +++ b/writeengine/shared/we_blockop.h @@ -25,11 +25,7 @@ #include -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/shared/we_brm.cpp b/writeengine/shared/we_brm.cpp index 4f1697352c..ccd116e0b3 100644 --- a/writeengine/shared/we_brm.cpp +++ b/writeengine/shared/we_brm.cpp @@ -60,9 +60,6 @@ BRMWrapper* volatile BRMWrapper::m_instance = NULL; boost::thread_specific_ptr BRMWrapper::m_ThreadDataPtr; boost::mutex BRMWrapper::m_instanceCreateMutex; -#ifdef _MSC_VER -__declspec(dllexport) -#endif bool BRMWrapper::m_useVb = true; OID BRMWrapper::m_curVBOid = INVALID_NUM; diff --git a/writeengine/shared/we_brm.h b/writeengine/shared/we_brm.h index 27a7e2a931..30d1eb7743 100644 --- a/writeengine/shared/we_brm.h +++ b/writeengine/shared/we_brm.h @@ -38,11 +38,7 @@ #include "IDBDataFile.h" #include "IDBPolicy.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine @@ -470,9 +466,6 @@ class BRMWrapper : public WEObj static boost::thread_specific_ptr m_ThreadDataPtr; static boost::mutex m_instanceCreateMutex; -#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT) - __declspec(dllimport) -#endif EXPORT static bool m_useVb; static OID m_curVBOid; diff --git a/writeengine/shared/we_bulkrollbackmgr.h b/writeengine/shared/we_bulkrollbackmgr.h index 41bd15b684..b7c0bafbad 100644 --- a/writeengine/shared/we_bulkrollbackmgr.h +++ b/writeengine/shared/we_bulkrollbackmgr.h @@ -26,12 +26,6 @@ #pragma once -#ifdef _MSC_VER -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#include -#endif #include #include #include @@ -41,11 +35,7 @@ #include "messagelog.h" #include "messageobj.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { diff --git a/writeengine/shared/we_cache.cpp b/writeengine/shared/we_cache.cpp index b82a7a45c7..317ca80094 100644 --- a/writeengine/shared/we_cache.cpp +++ b/writeengine/shared/we_cache.cpp @@ -31,9 +31,6 @@ CacheControl* Cache::m_cacheParam = NULL; FreeBufList* Cache::m_freeList = NULL; CacheMap* Cache::m_lruList = NULL; CacheMap* Cache::m_writeList = NULL; -#ifdef _MSC_VER -__declspec(dllexport) -#endif bool Cache::m_useCache = false; /*********************************************************** * DESCRIPTION: diff --git a/writeengine/shared/we_cache.h b/writeengine/shared/we_cache.h index 362ec6b832..1367a97084 100644 --- a/writeengine/shared/we_cache.h +++ b/writeengine/shared/we_cache.h @@ -23,25 +23,17 @@ #pragma once #include -#ifdef _MSC_VER -#include -#else #if __GNUC__ == 4 && __GNUC_MINOR__ < 2 #include #else #include #endif -#endif #include #include #include -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine { @@ -223,9 +215,6 @@ class Cache static CacheMap* m_lruList; // LRU buffer list static CacheMap* m_writeList; // Write buffer list -#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT) - __declspec(dllimport) -#endif EXPORT static bool m_useCache; // Use cache flag private: }; diff --git a/writeengine/shared/we_chunkmanager.cpp b/writeengine/shared/we_chunkmanager.cpp index 82de777771..839b598fbf 100644 --- a/writeengine/shared/we_chunkmanager.cpp +++ b/writeengine/shared/we_chunkmanager.cpp @@ -2018,14 +2018,6 @@ int ChunkManager::reallocateChunks(CompFileData* fileData) if (rc == NO_ERROR) { -#ifdef _MSC_VER - // We need to do this early on so the ::rename() call below will work on Windows - // we'll do it again later on, but that's life... - // FIXME: there's a race here that a query will re-open the files before we can jigger - // them around. We need to make sure PP is opening these files with the right perms - // to allow another process to delete them. - cacheutils::dropPrimProcFdCache(); -#endif // @bug3913, keep the original file until the new file is properly renamed. // 1. check the new file size is NOT 0, matching ptr[k]. diff --git a/writeengine/shared/we_chunkmanager.h b/writeengine/shared/we_chunkmanager.h index 957fc726fb..2cec57dff8 100644 --- a/writeengine/shared/we_chunkmanager.h +++ b/writeengine/shared/we_chunkmanager.h @@ -33,17 +33,8 @@ #include "idbcompress.h" #include "IDBFileSystem.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif -#ifdef _MSC_VER -#define WE_COMP_DBG(x) \ - { \ - } -#else //#define IDB_COMP_DEBUG #ifdef IDB_COMP_DEBUG #define WE_COMP_DBG(x) \ @@ -55,7 +46,6 @@ { \ } #endif -#endif namespace logging { diff --git a/writeengine/shared/we_config.cpp b/writeengine/shared/we_config.cpp index 47c0f8644e..ce69d8f6e0 100644 --- a/writeengine/shared/we_config.cpp +++ b/writeengine/shared/we_config.cpp @@ -119,9 +119,7 @@ void Config::checkReload() if (m_bulkRoot.length() == 0) { m_bulkRoot = "/var/log/mariadb/columnstore"; -#ifndef _MSC_VER m_bulkRoot += "/data"; -#endif m_bulkRoot += "/bulk"; } diff --git a/writeengine/shared/we_config.h b/writeengine/shared/we_config.h index e68e21cd38..3620619b56 100644 --- a/writeengine/shared/we_config.h +++ b/writeengine/shared/we_config.h @@ -32,11 +32,7 @@ //#define SHARED_NOTHING_DEMO_2 -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/shared/we_confirmhdfsdbfile.h b/writeengine/shared/we_confirmhdfsdbfile.h index 2571fe327c..49cb200c48 100644 --- a/writeengine/shared/we_confirmhdfsdbfile.h +++ b/writeengine/shared/we_confirmhdfsdbfile.h @@ -24,11 +24,7 @@ #include "IDBFileSystem.h" #include "we_type.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { diff --git a/writeengine/shared/we_convertor.cpp b/writeengine/shared/we_convertor.cpp index 65633ac3e3..2bda33251c 100644 --- a/writeengine/shared/we_convertor.cpp +++ b/writeengine/shared/we_convertor.cpp @@ -26,9 +26,6 @@ #include #include #include -#ifdef _MSC_VER -#include -#endif #include "mcsconfig.h" #include "we_convertor.h" diff --git a/writeengine/shared/we_convertor.h b/writeengine/shared/we_convertor.h index f9636f0adc..43bec7492e 100644 --- a/writeengine/shared/we_convertor.h +++ b/writeengine/shared/we_convertor.h @@ -35,11 +35,7 @@ #include "we_obj.h" #include "we_config.h" #include "calpontsystemcatalog.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/shared/we_dbfileop.h b/writeengine/shared/we_dbfileop.h index 1d426e4507..f0559622ae 100644 --- a/writeengine/shared/we_dbfileop.h +++ b/writeengine/shared/we_dbfileop.h @@ -26,11 +26,7 @@ #include "we_blockop.h" #include "we_cache.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/shared/we_dbrootextenttracker.h b/writeengine/shared/we_dbrootextenttracker.h index b6ded4e112..78f3df3cf9 100644 --- a/writeengine/shared/we_dbrootextenttracker.h +++ b/writeengine/shared/we_dbrootextenttracker.h @@ -40,11 +40,7 @@ #include "we_type.h" #include "brmtypes.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { diff --git a/writeengine/shared/we_define.h b/writeengine/shared/we_define.h index 416069245e..1716c68568 100644 --- a/writeengine/shared/we_define.h +++ b/writeengine/shared/we_define.h @@ -26,11 +26,7 @@ #include #include -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/shared/we_fileop.cpp b/writeengine/shared/we_fileop.cpp index 1db08a92fd..8ef0aa0da0 100644 --- a/writeengine/shared/we_fileop.cpp +++ b/writeengine/shared/we_fileop.cpp @@ -30,7 +30,7 @@ #if defined(__FreeBSD__) #include #include -#elif !defined(_MSC_VER) +#else #include #endif #include @@ -737,13 +737,7 @@ int FileOp::extendFile(OID oid, const uint8_t* emptyVal, int width, } } -#ifdef _MSC_VER - - // Need to call the win version with a dir, not a file - if (!isDiskSpaceAvail(Config::getDBRootByNum(dbRoot), allocSize)) -#else if (!isDiskSpaceAvail(segFile, allocSize)) -#endif { return ERR_FILE_DISK_SPACE; } @@ -868,13 +862,7 @@ int FileOp::addExtentExactFile(OID oid, const uint8_t* emptyVal, int width, int& } } -#ifdef _MSC_VER - - // Need to call the win version with a dir, not a file - if (!isDiskSpaceAvail(Config::getDBRootByNum(dbRoot), allocSize)) -#else if (!isDiskSpaceAvail(segFile, allocSize)) -#endif { return ERR_FILE_DISK_SPACE; } @@ -2556,25 +2544,6 @@ bool FileOp::isDiskSpaceAvail(const std::string& fileName, int nBlocks) const if (maxDiskUsage < 100) // 100% means to disable the check { -#ifdef _MSC_VER - ULARGE_INTEGER freeBytesAvail; - ULARGE_INTEGER totalBytesAvail; - - if (GetDiskFreeSpaceEx(fileName.c_str(), &freeBytesAvail, &totalBytesAvail, 0) != 0) - { - double avail = (double)freeBytesAvail.QuadPart; - double total = (double)totalBytesAvail.QuadPart; - double wanted = (double)nBlocks * (double)BYTE_PER_BLOCK; - - // If we want more than there is, return an error - if (wanted > avail) - bSpaceAvail = false; - // If the remaining bytes would be too few, return an error - else if ((total - (avail - wanted)) / total * 100.0 > maxDiskUsage) - bSpaceAvail = false; - } - -#else struct statfs fStats; int rc = statfs(fileName.c_str(), &fStats); @@ -2596,7 +2565,6 @@ bool FileOp::isDiskSpaceAvail(const std::string& fileName, int nBlocks) const //"; bAvail: " << bSpaceAvail << std::endl; } -#endif } return bSpaceAvail; diff --git a/writeengine/shared/we_fileop.h b/writeengine/shared/we_fileop.h index 58a8ef1fbc..7a5d8a03a7 100644 --- a/writeengine/shared/we_fileop.h +++ b/writeengine/shared/we_fileop.h @@ -27,15 +27,6 @@ #include #include -#ifdef _MSC_VER -#include -#define S_IRWXU 0 -#define S_IRWXG 0 -#ifndef S_IROTH -#define S_IROTH 0 -#endif -#define S_IXOTH 0 -#endif #include "we_blockop.h" #include "we_brm.h" @@ -44,11 +35,7 @@ #include "idbcompress.h" #include "calpontsystemcatalog.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif #define MAX_NBLOCKS 8192 diff --git a/writeengine/shared/we_log.cpp b/writeengine/shared/we_log.cpp index 1fe6f82102..89fc57a101 100644 --- a/writeengine/shared/we_log.cpp +++ b/writeengine/shared/we_log.cpp @@ -70,11 +70,7 @@ void Log::formatMsg(const std::string& msg, MsgLevel level, std::ostringstream& if (isDebug(DEBUG_2)) { oss << " (" << m_pid << ":" << -#ifdef _MSC_VER - GetCurrentThreadId() -#else pthread_self() -#endif << ") " << MSG_LEVEL_STR[level] << " : " << msg; } else @@ -155,19 +151,6 @@ void Log::setLogFileName(const char* logfile, const char* errlogfile, bool conso m_logFileName = logfile; m_errlogFileName = errlogfile; m_bConsoleOutput = consoleFlag; -#ifdef _MSC_VER - // cpimport.bin calls BulkLoad::loadJobInfo() before calling - // BulkLoad::processJob(). loadJobInfo() attempts to write to this log - // before it's opened (by processJob()). This doesn't seem to bother Linux - // but puts Windows in a bad state. Once this logic is fixed, this hack can - // go away. - // This code probably wouldn't hurt if run on Linux, but I'll leave this - // here as a reminder to fix the logic for all platforms. - m_logFile.close(); - m_logFile.clear(); - m_errLogFile.close(); - m_errLogFile.clear(); -#endif m_logFile.open(m_logFileName.c_str(), std::ofstream::out | std::ofstream::app); m_errLogFile.open(m_errlogFileName.c_str(), std::ofstream::out | std::ofstream::app); } diff --git a/writeengine/shared/we_log.h b/writeengine/shared/we_log.h index f1b0c3c271..d54cfea914 100644 --- a/writeengine/shared/we_log.h +++ b/writeengine/shared/we_log.h @@ -35,11 +35,7 @@ #include -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/shared/we_rbmetawriter.cpp b/writeengine/shared/we_rbmetawriter.cpp index 98bf2cdce9..f7c61b6852 100644 --- a/writeengine/shared/we_rbmetawriter.cpp +++ b/writeengine/shared/we_rbmetawriter.cpp @@ -1147,13 +1147,6 @@ int RBMetaWriter::writeHWMChunk(bool bColumnFile, // is this a column (vs dic // IDBDataFile flush() does a sync where appropriate delete backupFile; -#ifdef _MSC_VER - // Windows rename() behaves differently from Linux: it will return an error - // if the target exists - // FIXME: The Linux version seems a bit safer, perhaps implement a better - // Windows port? - unlink(fileName.c_str()); -#endif // Rename HWM backup file to final name. if (fs.rename(fileNameTmp.c_str(), fileName.c_str())) diff --git a/writeengine/shared/we_rbmetawriter.h b/writeengine/shared/we_rbmetawriter.h index 658cd70fb1..04544a10a0 100644 --- a/writeengine/shared/we_rbmetawriter.h +++ b/writeengine/shared/we_rbmetawriter.h @@ -40,11 +40,7 @@ #include "brmtypes.h" #include "we_fileop.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif #define DBROOT_BULK_ROLLBACK_SUBDIR "bulkRollback" diff --git a/writeengine/shared/we_simplesyslog.h b/writeengine/shared/we_simplesyslog.h index 6d41041eaf..ce8264366c 100644 --- a/writeengine/shared/we_simplesyslog.h +++ b/writeengine/shared/we_simplesyslog.h @@ -28,11 +28,7 @@ #include "messagelog.h" #include "messageobj.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/splitter/we_filereadthread.cpp b/writeengine/splitter/we_filereadthread.cpp index 4b64ad3fb9..99777dc3ca 100644 --- a/writeengine/splitter/we_filereadthread.cpp +++ b/writeengine/splitter/we_filereadthread.cpp @@ -43,9 +43,6 @@ using namespace messageqcpp; #include #include #include -#ifdef _MSC_VER -#include -#endif using namespace std; #include "we_filereadthread.h" @@ -554,19 +551,6 @@ void WEFileReadThread::openInFile() fInFile.rdbuf(fIfFile.rdbuf()); //@BUG 4326 } -#ifdef _MSC_VER - else // @bug 5193: binary import - { - if (fSdh.getImportDataMode() != IMPORT_DATA_TEXT) - { - if (_setmode(_fileno(stdin), _O_BINARY) == -1) - { - throw runtime_error("Could not change stdin to binary"); - } - } - } - -#endif //@BUG 4326 -below three lines commented out // if (!fInFile.is_open()) fInFile.open(fInFileName.c_str()); // if (!fInFile.good()) diff --git a/writeengine/splitter/we_splitterapp.cpp b/writeengine/splitter/we_splitterapp.cpp index 22a29100ae..a9f5a6d2f0 100644 --- a/writeengine/splitter/we_splitterapp.cpp +++ b/writeengine/splitter/we_splitterapp.cpp @@ -151,9 +151,6 @@ WESplitterApp::~WESplitterApp() void WESplitterApp::setupSignalHandlers() { -#ifdef _MSC_VER - // FIXME -#else struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = WESplitterApp::onSigInterrupt; @@ -171,7 +168,6 @@ void WESplitterApp::setupSignalHandlers() signal(SIGINT, WESplitterApp::onSigInterrupt); signal(SIGTERM, WESplitterApp::onSigTerminate); signal(SIGHUP, WESplitterApp::onSigHup); */ -#endif } //------------------------------------------------------------------------------ // handles on signal Terminate diff --git a/writeengine/wrapper/we_colop.h b/writeengine/wrapper/we_colop.h index d2f85428ef..3db0027d55 100644 --- a/writeengine/wrapper/we_colop.h +++ b/writeengine/wrapper/we_colop.h @@ -29,11 +29,7 @@ #include "we_tablemetadata.h" #include "../dictionary/we_dctnry.h" #include "stopwatch.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/wrapper/we_colopcompress.h b/writeengine/wrapper/we_colopcompress.h index 5c92ed885d..15be5e6147 100644 --- a/writeengine/wrapper/we_colopcompress.h +++ b/writeengine/wrapper/we_colopcompress.h @@ -27,11 +27,7 @@ #include "we_chunkmanager.h" #include "calpontsystemcatalog.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/wrapper/we_dctnrycompress.h b/writeengine/wrapper/we_dctnrycompress.h index 774daca594..2831b5c953 100644 --- a/writeengine/wrapper/we_dctnrycompress.h +++ b/writeengine/wrapper/we_dctnrycompress.h @@ -25,11 +25,7 @@ #include "../dictionary/we_dctnry.h" #include "we_chunkmanager.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine diff --git a/writeengine/wrapper/we_tablemetadata.h b/writeengine/wrapper/we_tablemetadata.h index 4a753c9602..91fe7d2f82 100644 --- a/writeengine/wrapper/we_tablemetadata.h +++ b/writeengine/wrapper/we_tablemetadata.h @@ -27,11 +27,7 @@ #include #include -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { diff --git a/writeengine/wrapper/writeengine.cpp b/writeengine/wrapper/writeengine.cpp index 0b783df6a5..3723e71376 100644 --- a/writeengine/wrapper/writeengine.cpp +++ b/writeengine/wrapper/writeengine.cpp @@ -65,9 +65,6 @@ using namespace idbdatafile; #include "dataconvert.h" #include "string_prefixes.h" -#ifdef _MSC_VER -#define isnan _isnan -#endif namespace WriteEngine //#define PROFILE 1 diff --git a/writeengine/wrapper/writeengine.h b/writeengine/wrapper/writeengine.h index a14c53888d..ad472a3022 100644 --- a/writeengine/wrapper/writeengine.h +++ b/writeengine/wrapper/writeengine.h @@ -29,11 +29,7 @@ #include // end #include -#ifdef _MSC_VER -#include -#else #include -#endif #include "we_brm.h" #include "we_colop.h" @@ -46,11 +42,7 @@ #define IO_BUFF_SIZE 81920 -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine { diff --git a/writeengine/xml/we_xmlgendata.cpp b/writeengine/xml/we_xmlgendata.cpp index e8ce4c1f6a..e619875f10 100644 --- a/writeengine/xml/we_xmlgendata.cpp +++ b/writeengine/xml/we_xmlgendata.cpp @@ -35,24 +35,12 @@ namespace WriteEngine { /* static */ const std::string XMLGenData::DELIMITER("-d"); /* static */ const std::string XMLGenData::DESCRIPTION("-s"); -#ifdef _MSC_VER -__declspec(dllexport) -#endif /* static */ const std::string XMLGenData::ENCLOSED_BY_CHAR("-E"); -#ifdef _MSC_VER -__declspec(dllexport) -#endif /* static */ const std::string XMLGenData::ESCAPE_CHAR("-C"); -#ifdef _MSC_VER -__declspec(dllexport) -#endif /* static */ const std::string XMLGenData::JOBID("-j"); /* static */ const std::string XMLGenData::MAXERROR("-e"); /* static */ const std::string XMLGenData::NAME("-n"); /* static */ const std::string XMLGenData::PATH("-p"); -#ifdef _MSC_VER -__declspec(dllexport) -#endif /* static */ const std::string XMLGenData::RPT_DEBUG("-b"); /* static */ const std::string XMLGenData::USER("-u"); /* static */ const std::string XMLGenData::NO_OF_READ_BUFFER("-r"); @@ -73,13 +61,7 @@ XMLGenData::XMLGenData() fParms.insert(ParmList::value_type(JOBID, std::string("299"))); fParms.insert(ParmList::value_type(MAXERROR, std::string("10"))); fParms.insert(ParmList::value_type(NAME, std::string())); -#ifdef _MSC_VER - std::string br; - br = Config::getBulkRoot(); - boost::filesystem::path p(br); -#else boost::filesystem::path p{std::string(Config::getBulkRoot())}; -#endif p /= JOBDIR; fParms.insert(ParmList::value_type(PATH, p.string())); diff --git a/writeengine/xml/we_xmlgendata.h b/writeengine/xml/we_xmlgendata.h index 7bb831cff2..5bf4873cc3 100644 --- a/writeengine/xml/we_xmlgendata.h +++ b/writeengine/xml/we_xmlgendata.h @@ -28,11 +28,7 @@ #include #include "calpontsystemcatalog.h" -#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { @@ -52,24 +48,12 @@ class XMLGenData // Valid parms that can be stored and retrieved from XMLGenData EXPORT const static std::string DELIMITER; EXPORT const static std::string DESCRIPTION; -#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT) - __declspec(dllimport) -#endif EXPORT const static std::string ENCLOSED_BY_CHAR; -#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT) - __declspec(dllimport) -#endif EXPORT const static std::string ESCAPE_CHAR; -#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT) - __declspec(dllimport) -#endif EXPORT const static std::string JOBID; EXPORT const static std::string MAXERROR; EXPORT const static std::string NAME; EXPORT const static std::string PATH; -#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT) - __declspec(dllimport) -#endif EXPORT const static std::string RPT_DEBUG; EXPORT const static std::string USER; EXPORT const static std::string NO_OF_READ_BUFFER; diff --git a/writeengine/xml/we_xmlgenproc.cpp b/writeengine/xml/we_xmlgenproc.cpp index afd6d2b6ca..7be9fe2fe8 100644 --- a/writeengine/xml/we_xmlgenproc.cpp +++ b/writeengine/xml/we_xmlgenproc.cpp @@ -424,11 +424,6 @@ std::string XMLGenProc::genJobXMLFileName() const // If the filespec doesn't begin with a '/' (i.e. it's not an absolute path), // attempt to make it absolute so that we can log the full pathname. -#ifdef _MSC_VER - // We won't worry about being so fancy in Windows, just print a relative - // path if so given - xmlFileName = p.string(); -#else if (!p.has_root_path()) { @@ -446,7 +441,6 @@ std::string XMLGenProc::genJobXMLFileName() const xmlFileName = p.string(); } -#endif return xmlFileName; } diff --git a/writeengine/xml/we_xmlgenproc.h b/writeengine/xml/we_xmlgenproc.h index 2da7fc925b..ca0cba1b12 100644 --- a/writeengine/xml/we_xmlgenproc.h +++ b/writeengine/xml/we_xmlgenproc.h @@ -31,11 +31,7 @@ #include "we_log.h" #include "we_xmlgendata.h" -#if defined(_MSC_VER) && defined(WRITEENGINEXMLGENPROC_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif namespace WriteEngine { diff --git a/writeengine/xml/we_xmljob.cpp b/writeengine/xml/we_xmljob.cpp index 2a95203dfa..f5bd25e3ff 100644 --- a/writeengine/xml/we_xmljob.cpp +++ b/writeengine/xml/we_xmljob.cpp @@ -1211,9 +1211,6 @@ int XMLJob::genJobXMLFileName(const string& sXMLJobDir, const string& jobDir, co // attempt to make it absolute so that we can log the full pathname. if (!xmlFilePath.has_root_path()) { -#ifdef _MSC_VER - // nothing else to do -#else char cwdPath[4096]; char* err; err = getcwd(cwdPath, sizeof(cwdPath)); @@ -1225,7 +1222,6 @@ int XMLJob::genJobXMLFileName(const string& sXMLJobDir, const string& jobDir, co string trailingPath(xmlFilePath.string()); xmlFilePath = cwdPath; xmlFilePath /= trailingPath; -#endif } } diff --git a/writeengine/xml/we_xmljob.h b/writeengine/xml/we_xmljob.h index d212d0a989..d5943f8b00 100644 --- a/writeengine/xml/we_xmljob.h +++ b/writeengine/xml/we_xmljob.h @@ -31,11 +31,7 @@ #include "we_xmlop.h" #include "calpontsystemcatalog.h" -#if defined(_MSC_VER) && defined(xxxWRITEENGINEXMLJOB_DLLEXPORT) -#define EXPORT __declspec(dllexport) -#else #define EXPORT -#endif /** Namespace WriteEngine */ namespace WriteEngine